hexsha
stringlengths 40
40
| size
int64 5
1.05M
| ext
stringclasses 98
values | lang
stringclasses 21
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
118
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
listlengths 1
10
| max_stars_count
int64 1
368k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
118
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
listlengths 1
10
| max_issues_count
int64 1
134k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
135
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
listlengths 1
10
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 5
1.05M
| avg_line_length
float64 1
1.03M
| max_line_length
int64 2
1.03M
| alphanum_fraction
float64 0
1
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
589ab671f4f37bcc504294fec304b10c0ceb46dd
| 3,953
|
css
|
CSS
|
css/carousel-gallery.css
|
NardiniA/Design-Test
|
7c1ccc248d1d8371a2a8dfcb79155972c9e0f22c
|
[
"MIT"
] | null | null | null |
css/carousel-gallery.css
|
NardiniA/Design-Test
|
7c1ccc248d1d8371a2a8dfcb79155972c9e0f22c
|
[
"MIT"
] | null | null | null |
css/carousel-gallery.css
|
NardiniA/Design-Test
|
7c1ccc248d1d8371a2a8dfcb79155972c9e0f22c
|
[
"MIT"
] | null | null | null |
@import url("https://fonts.googleapis.com/css?family=Heebo:800");
* {
margin: 0;
padding: 0;
box-sizing: border-box; }
.parent {
width: 681px;
height: 384px;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto auto;
overflow: hidden;
position: absolute;
border-radius: 16px;
-webkit-box-shadow: 0 0 88px 5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0 0 88px 5px rgba(0, 0, 0, 0.75);
box-shadow: 0 0 88px 5px rgba(0, 0, 0, 0.75); }
svg {
position: absolute;
z-index: 1;
width: 681px;
height: 384px; }
button {
position: absolute;
z-index: 50;
width: 40px;
overflow: hidden;
height: 40px;
border: none;
border-radius: 50%;
background: #fff;
cursor: pointer;
-webkit-box-shadow: 0 0 88px 5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0 0 88px 5px rgba(0, 0, 0, 0.75);
box-shadow: 0 0 88px 5px rgba(0, 0, 0, 0.75); }
button:focus {
outline-width: 0; }
circle {
stroke: #fff;
fill: none;
transition: 0.3s; }
#svg1 circle {
transition-timing-function: linear; }
#svg2 circle {
transition-timing-function: linear; }
#Capa_1 {
position: absolute;
width: 16px;
height: 16px;
transform: translate(-7px, -8px); }
#Capa_2 {
position: absolute;
width: 16px;
height: 16px;
transform: translate(-9px, -8px); }
.right {
margin-left: 628px;
margin-top: 168px;
border: 1px solid #849494;
background-color: transparent;
transition: .5s; }
.right:hover {
background-color: #fff; }
.left {
margin-left: 0.5%;
margin-top: 168px;
border: 1px solid #849494;
background-color: transparent;
transition: .5s; }
.left:hover {
background-color: #fff; }
.circle1 {
transition-delay: 0.05s; }
.circle2 {
transition-delay: 0.1s; }
.circle3 {
transition-delay: 0.15s; }
.circle4 {
transition-delay: 0.2s; }
.circle5 {
transition-delay: 0.25s; }
.circle6 {
transition-delay: 0.3s; }
.circle7 {
transition-delay: 0.35s; }
.circle8 {
transition-delay: 0.4s; }
.circle9 {
transition-delay: 0.45s; }
.circle10 {
transition-delay: 0.05s; }
.circle11 {
transition-delay: 0.1s; }
.circle12 {
transition-delay: 0.15s; }
.circle13 {
transition-delay: 0.2s; }
.circle14 {
transition-delay: 0.25s; }
.circle15 {
transition-delay: 0.3s; }
.circle16 {
transition-delay: 0.35s; }
.circle17 {
transition-delay: 0.4s; }
.circle18 {
transition-delay: 0.45s; }
.slide1 {
background-image: url("https://images.unsplash.com/photo-1483068612337-c045daaca40e?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1600&h=900&fit=crop&s=6de8746a693acc34ebe9e9a15c4c18d1"); }
.slide2 {
background-image: url("https://images.unsplash.com/photo-1489914099268-1dad649f76bf?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1600&h=900&fit=crop&s=f21f40bb93bae58300e83f7f72ebb5a5"); }
.slide3 {
background-image: url("https://images.unsplash.com/photo-1490100667990-4fced8021649?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1600&h=900&fit=crop&s=247f52de1a292b8a1877b0c7dd77a291"); }
.slide4 {
background-image: url("https://images.unsplash.com/photo-1494783404829-a93883e74b68?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1600&h=900&fit=crop&s=413f5f5c41f4db69a1474d92419601ac"); }
.slider {
position: absolute;
width: 400%;
height: 100%;
background: #000;
display: inline-flex;
overflow: hidden; }
.slide1, .slide2, .slide3, .slide4 {
position: absolute;
background-position: center;
background-size: cover;
color: #fff;
font-size: 62px;
padding-top: 138px;
font-weight: 800;
font-family: 'Heebo', sans-serif;
text-align: center;
width: 25%;
height: 100%;
z-index: 10;
transition: 1.4s; }
.tran {
transform: scale(1.3); }
.up1 {
z-index: 20; }
.up2 {
z-index: 40; }
.steap {
stroke-width: 0; }
.streak {
stroke-width: 82px; }
@media (max-width: 700px) {
.parent {
margin-left: 1%; } }
/*# sourceMappingURL=carousel-gallery.css.map */
| 20.376289
| 199
| 0.660005
|
dcc9ccd60b9a414c4ea41d4dd0233025d0e10355
| 198
|
rb
|
Ruby
|
lib/keras/normalization.rb
|
xiantotikui/Keras.rb
|
806a46c2e51d5eb9c0623ae459093d9b221a1009
|
[
"MIT"
] | 1
|
2019-10-23T12:54:08.000Z
|
2019-10-23T12:54:08.000Z
|
lib/keras/normalization.rb
|
xiantotikui/Keras.rb
|
806a46c2e51d5eb9c0623ae459093d9b221a1009
|
[
"MIT"
] | null | null | null |
lib/keras/normalization.rb
|
xiantotikui/Keras.rb
|
806a46c2e51d5eb9c0623ae459093d9b221a1009
|
[
"MIT"
] | null | null | null |
module Keras::Normalization
extend self
pyfrom 'keras.layers', import: 'BatchNormalization'
def batch_normalization(axis: -1, **args)
BatchNormalization.new(axis: axis, **args)
end
end
| 22
| 53
| 0.732323
|
9b0a67d6e42a0440ac2a53c52e561f88b04c4d75
| 5,453
|
dart
|
Dart
|
example/lib/page/home_page.dart
|
Tonigt/flutter_photo_manager
|
a53b0bf5fb2eaca7d86731955fb08aeb862718c3
|
[
"Apache-2.0"
] | null | null | null |
example/lib/page/home_page.dart
|
Tonigt/flutter_photo_manager
|
a53b0bf5fb2eaca7d86731955fb08aeb862718c3
|
[
"Apache-2.0"
] | null | null | null |
example/lib/page/home_page.dart
|
Tonigt/flutter_photo_manager
|
a53b0bf5fb2eaca7d86731955fb08aeb862718c3
|
[
"Apache-2.0"
] | null | null | null |
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_scanner_example/model/photo_provider.dart';
import 'package:image_scanner_example/page/gallery_list_page.dart';
import 'package:image_scanner_example/widget/change_notifier_builder.dart';
import 'package:photo_manager/photo_manager.dart';
import 'package:provider/provider.dart';
import 'filter_option_page.dart';
class NewHomePage extends StatefulWidget {
@override
_NewHomePageState createState() => _NewHomePageState();
}
class _NewHomePageState extends State<NewHomePage> {
PhotoProvider get readProvider => context.read<PhotoProvider>();
PhotoProvider get watchProvider => context.watch<PhotoProvider>();
@override
void initState() {
super.initState();
PhotoManager.addChangeCallback(onChange);
PhotoManager.setLog(true);
}
@override
Widget build(BuildContext context) {
return ChangeNotifierBuilder(
value: watchProvider,
builder: (_, __) => Scaffold(
appBar: AppBar(
title: Text("photo manager example"),
),
body: Column(
children: <Widget>[
buildButton("Get all gallery list", _scanGalleryList),
if (Platform.isIOS)
buildButton(
"Change limited photos with PhotosUI", _changeLimitPhotos),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("scan type"),
Container(
width: 10,
),
],
),
_buildTypeChecks(watchProvider),
_buildHasAllCheck(),
_buildOnlyAllCheck(),
_buildContainsEmptyCheck(),
_buildPathContainsModifiedDateCheck(),
_buildPngCheck(),
_buildNotifyCheck(),
_buildFilterOption(watchProvider),
],
),
),
);
}
Widget _buildTypeChecks(PhotoProvider provider) {
final currentType = provider.type;
Widget buildType(RequestType type) {
String typeText;
if (type.containsImage()) {
typeText = "image";
} else if (type.containsVideo()) {
typeText = "video";
} else if (type.containsAudio()) {
typeText = "audio";
} else {
typeText = "";
}
return Expanded(
child: CheckboxListTile(
title: Text(typeText),
value: currentType.containsType(type),
onChanged: (bool? value) {
if (value == true) {
provider.changeType(currentType + type);
} else {
provider.changeType(currentType - type);
}
},
),
);
}
return Container(
height: 50,
child: Row(
children: <Widget>[
buildType(RequestType.image),
buildType(RequestType.video),
buildType(RequestType.audio),
],
),
);
}
_scanGalleryList() async {
await readProvider.refreshGalleryList();
final page = GalleryListPage();
Navigator.of(context).push(MaterialPageRoute(
builder: (ctx) => page,
));
}
Widget _buildHasAllCheck() {
return CheckboxListTile(
value: watchProvider.hasAll,
onChanged: (value) {
readProvider.changeHasAll(value);
},
title: Text("hasAll"),
);
}
Widget _buildPngCheck() {
return CheckboxListTile(
value: watchProvider.thumbFormat == ThumbFormat.png,
onChanged: (value) {
readProvider.changeThumbFormat();
},
title: Text("thumb png"),
);
}
Widget _buildOnlyAllCheck() {
return CheckboxListTile(
value: watchProvider.onlyAll,
onChanged: (value) {
readProvider.changeOnlyAll(value);
},
title: Text("onlyAll"),
);
}
Widget _buildContainsEmptyCheck() {
if (!Platform.isIOS) {
return Container();
}
return CheckboxListTile(
value: watchProvider.containsEmptyAlbum,
onChanged: (value) {
readProvider.changeContainsEmptyAlbum(value);
},
title: Text("contains empty album(only iOS)"),
);
}
Widget _buildPathContainsModifiedDateCheck() {
return CheckboxListTile(
value: watchProvider.containsPathModified,
onChanged: (value) {
readProvider.changeContainsPathModified(value);
},
title: Text("contains path modified date"),
);
}
Widget _buildNotifyCheck() {
return CheckboxListTile(
value: watchProvider.notifying,
title: Text("onChanged"),
onChanged: (value) {
readProvider.notifying = value;
if (value == true) {
PhotoManager.startChangeNotify();
} else {
PhotoManager.stopChangeNotify();
}
});
}
void onChange(call) {}
Widget _buildFilterOption(PhotoProvider provider) {
return ElevatedButton(
child: Text("Change filter options."),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) {
return FilterOptionPage();
},
),
);
},
);
}
Future<void> _changeLimitPhotos() async {
await PhotoManager.presentLimited();
}
}
Widget buildButton(String text, VoidCallback function) {
return ElevatedButton(
child: Text(text),
onPressed: function,
);
}
| 25.721698
| 77
| 0.596736
|
25a4d88aba91aa92bb6bc98705a91c8c9031b501
| 788
|
js
|
JavaScript
|
test.js
|
jamestalmage/blind-bind
|
93e1ca9f9fb0388469d0085c30a5b2494954f087
|
[
"MIT"
] | null | null | null |
test.js
|
jamestalmage/blind-bind
|
93e1ca9f9fb0388469d0085c30a5b2494954f087
|
[
"MIT"
] | null | null | null |
test.js
|
jamestalmage/blind-bind
|
93e1ca9f9fb0388469d0085c30a5b2494954f087
|
[
"MIT"
] | null | null | null |
'use strict';
var assert = require('assert');
var sinon = require('sinon');
var bind = require('./');
it('should bind args ahead of time', function () {
var spy = sinon.spy();
var bound = bind('a', 'b');
bound(spy);
assert.strictEqual(spy.callCount, 1);
assert.deepEqual(spy.firstCall.args, ['a', 'b']);
});
it('should allow additional args', function () {
var spy = sinon.spy();
var bound = bind('c', 'd');
bound(spy, 'e', 'f');
assert.strictEqual(spy.callCount, 1);
assert.deepEqual(spy.firstCall.args, ['c', 'd', 'e', 'f']);
});
it('should return result of fn', function () {
var bound = bind('g', 'h');
var result = bound(joinArgs, 'e', 'f');
assert.strictEqual(result, 'ghef');
function joinArgs() {
return Array.prototype.slice.call(arguments).join('');
}
});
| 24.625
| 60
| 0.624365
|
f4581d827fe481d27ddbfa359d1ce4bd7376c67a
| 1,074
|
cs
|
C#
|
OctoAwesome/OctoAwesome/SimulationComponent.cs
|
HierGibtEsDrachen/octoawesome
|
39222dd6ffdd3cd4a8f421908f92a11b6874a37e
|
[
"MIT"
] | null | null | null |
OctoAwesome/OctoAwesome/SimulationComponent.cs
|
HierGibtEsDrachen/octoawesome
|
39222dd6ffdd3cd4a8f421908f92a11b6874a37e
|
[
"MIT"
] | null | null | null |
OctoAwesome/OctoAwesome/SimulationComponent.cs
|
HierGibtEsDrachen/octoawesome
|
39222dd6ffdd3cd4a8f421908f92a11b6874a37e
|
[
"MIT"
] | null | null | null |
using engenious;
using OctoAwesome.Entities;
namespace OctoAwesome
{
/// <summary>
/// Base class for World wide (web) simulations
/// </summary>
public abstract class SimulationComponent : Component
{
/// <summary>
/// Defaultconstructor
/// </summary>
public SimulationComponent() : base(true)
{
}
/// <summary>
/// Constructor with needupdate parameter
/// </summary>
/// <param name="needupdate">Indicates if this <see cref="Component"/> should be updated</param>
public SimulationComponent(bool needupdate) : base(needupdate)
{
}
/// <summary>
/// Register an <see cref="Entity"/>.
/// </summary>
/// <param name="entity">Entity to register</param>
public abstract void Register(Entity entity);
/// <summary>
/// Remove an <see cref="Entity"/>.
/// </summary>
/// <param name="entity">Entity to remove</param>
public abstract void Remove(Entity entity);
}
}
| 29.027027
| 104
| 0.564246
|
abd3068e87ed29099523ed84f7a9235ad4eb99bd
| 2,426
|
swift
|
Swift
|
Sources/SwiftCF/CFTypeExt/CFNumber.swift
|
ddddxxx/SwiftCF
|
72775c4b4dfceba8f6f43820d50f9286dc97160d
|
[
"MIT"
] | 11
|
2019-08-30T05:05:28.000Z
|
2021-06-30T15:13:33.000Z
|
Sources/SwiftCF/CFTypeExt/CFNumber.swift
|
ddddxxx/SwiftCF
|
72775c4b4dfceba8f6f43820d50f9286dc97160d
|
[
"MIT"
] | 1
|
2020-09-09T02:31:35.000Z
|
2020-09-09T02:31:35.000Z
|
Sources/SwiftCF/CFTypeExt/CFNumber.swift
|
ddddxxx/SwiftCF
|
72775c4b4dfceba8f6f43820d50f9286dc97160d
|
[
"MIT"
] | 4
|
2019-08-30T05:26:14.000Z
|
2021-06-11T07:29:05.000Z
|
import Foundation
import CoreFoundation
public extension CFNumber {
static let positiveInfinity = kCFNumberPositiveInfinity!
static let negativeInfinity = kCFNumberNegativeInfinity!
static let nan = kCFNumberNaN!
@inlinable var type: CFNumberType {
return CFNumberGetType(self)
}
@inlinable var byteSize: CFIndex {
return CFNumberGetByteSize(self)
}
@inlinable var isFloatType: Bool {
return CFNumberIsFloatType(self)
}
@inlinable func value<T: CFNumberRepresentable>() -> T {
return T._from(cfNumber: self).result
}
}
// MARK: - CFNumberRepresentable
public protocol CFNumberRepresentable {
static var cfNumberType: CFNumberType { get }
static func _from(cfNumber: CFNumber) -> (result: Self, lossless: Bool)
}
public extension CFNumberRepresentable where Self: BinaryInteger {
static func _from(cfNumber: CFNumber) -> (result: Self, lossless: Bool) {
var result = Self.zero
let lossless = CFNumberGetValue(cfNumber, Self.cfNumberType, &result)
return (result, lossless)
}
}
public extension CFNumberRepresentable where Self: FloatingPoint {
static func _from(cfNumber: CFNumber) -> (result: Self, lossless: Bool) {
var result = Self.zero
let lossless = CFNumberGetValue(cfNumber, Self.cfNumberType, &result)
return (result, lossless)
}
}
// TODO: Linux: CFNumberType on Linux
#if canImport(Darwin)
extension Int8: CFNumberRepresentable {
public static let cfNumberType = CFNumberType.sInt8Type
}
extension Int16: CFNumberRepresentable {
public static let cfNumberType = CFNumberType.sInt16Type
}
extension Int32: CFNumberRepresentable {
public static let cfNumberType = CFNumberType.sInt32Type
}
extension Int64: CFNumberRepresentable {
public static let cfNumberType = CFNumberType.sInt64Type
}
extension NSInteger: CFNumberRepresentable {
public static let cfNumberType = CFNumberType.nsIntegerType
}
extension Float32: CFNumberRepresentable {
public static let cfNumberType = CFNumberType.float32Type
}
extension Float64: CFNumberRepresentable {
public static let cfNumberType = CFNumberType.float64Type
}
#if canImport(CoreGraphics)
import CoreGraphics
extension CGFloat: CFNumberRepresentable {
public static let cfNumberType = CFNumberType.cgFloatType
}
#endif // canImport(CoreGraphics)
#endif
| 26.369565
| 77
| 0.73413
|
2f32aa36bc92fde1e69633be56054a616c5d5c89
| 730
|
js
|
JavaScript
|
www/js/character-data/character-type.js
|
webbestmaster/mk-11-kombo-guide
|
5ea2a4d9800df319f17d4f12fbc53be9fe05bd72
|
[
"MIT"
] | null | null | null |
www/js/character-data/character-type.js
|
webbestmaster/mk-11-kombo-guide
|
5ea2a4d9800df319f17d4f12fbc53be9fe05bd72
|
[
"MIT"
] | null | null | null |
www/js/character-data/character-type.js
|
webbestmaster/mk-11-kombo-guide
|
5ea2a4d9800df319f17d4f12fbc53be9fe05bd72
|
[
"MIT"
] | null | null | null |
// @flow
import type {ComboType} from '../move-type/combo-type';
export type CharacterMoveType = {|
+basicList: Array<ComboType>,
+jumpingAttackList: Array<ComboType>,
+hopAttackList: Array<ComboType>,
+getUpAttackList: Array<ComboType>,
+flawlessBlockAttacksList: Array<ComboType>,
+throwsList: Array<ComboType>,
+rollEscapeList: Array<ComboType>,
+airEscapeList: Array<ComboType>,
+comboList: Array<ComboType>,
+specialList: Array<ComboType>,
+fatalBlowList: Array<ComboType>,
+fatalityList: Array<ComboType>,
+brutalityList: Array<ComboType>,
|};
export type CharacterType = {|
+id: string,
+imagePath: string,
+name: string,
+move: CharacterMoveType,
|};
| 27.037037
| 55
| 0.689041
|
4cfcb0afa7992dd0b7457355243d41f833cb00da
| 2,210
|
py
|
Python
|
rl_agent/tambet/AlphaGZ.py
|
AntonPotapchuk/playground
|
e29cbc974c4d08f27a2078d47d1a79080e712efe
|
[
"Apache-2.0"
] | null | null | null |
rl_agent/tambet/AlphaGZ.py
|
AntonPotapchuk/playground
|
e29cbc974c4d08f27a2078d47d1a79080e712efe
|
[
"Apache-2.0"
] | null | null | null |
rl_agent/tambet/AlphaGZ.py
|
AntonPotapchuk/playground
|
e29cbc974c4d08f27a2078d47d1a79080e712efe
|
[
"Apache-2.0"
] | null | null | null |
from Basic import BasicModel
from keras.layers import Input,Conv2D,Dense,Activation,BatchNormalization,add
from keras.layers.core import Flatten
from keras.models import Model
from keras.utils import to_categorical
import numpy as np
class AlphaGZ(BasicModel):
def ConvBlock(self,mod):
mod = Conv2D(filters=256,kernel_size=3,strides=1,padding="same")(mod)
mod = BatchNormalization()(mod)
mod= Activation('relu')(mod)
return mod
def ResidualBlock(self,mod):
tmp =mod
mod = self.ConvBlock(mod)
mod = Conv2D(filters=256,kernel_size=3,strides=1,padding="same")(mod)
mod = BatchNormalization()(mod)
mod = add([mod,tmp])
mod = Activation('relu')(mod)
return mod
def PolicyHead(self,mod):
mod = self.ConvBlock(mod)
mod = Flatten()(mod)
mod = Dense(6,activation='softmax')(mod)
return mod
def ValueHead(self,mod):
mod = Conv2D(filters=1,kernel_size=1,strides=1,padding="same")(mod)
mod = BatchNormalization()(mod)
mod = Activation('relu')(mod)
mod = Flatten()(mod)
mod = Dense(256)(mod)
mod = Activation('relu')(mod)
mod = Dense(1)(mod)
mod = Activation('tanh')(mod)
return mod
def create(self,inshape,outshape,res_blks=1,conv_blks=1):
self.Y_train_v = self.Y_train[:,1]
self.Y_test_v = self.Y_test[:,1]
self.Y_train = to_categorical(self.Y_train[:,0],6)
self.Y_test = to_categorical(self.Y_test[:,0],6)
I = Input(shape=inshape)
mod = I
for i in range(conv_blks):
mod = self.ConvBlock(mod)
for i in range(res_blks):
mod = self.ResidualBlock(mod)
policy = self.PolicyHead(mod)
value = self.ValueHead(mod)
self.clf = Model(inputs=I,outputs=[policy,value])
self.clf.compile(loss=['categorical_crossentropy','mse'], optimizer='rmsprop',metrics=['accuracy'])
def train():
pass
def train(self,bs=32,eps=10):
self.clf.fit(self.X_train,[self.Y_train,self.Y_train_v],batch_size=bs,epochs=eps,validation_data=(self.X_test, [self.Y_test,self.Y_test_v]),shuffle=True)
| 36.229508
| 161
| 0.629412
|
f45a108d31b0beab4129fbaaa175d222202e6629
| 874
|
cs
|
C#
|
src/PowerShellEditorServices.VSCode/CustomViews/HtmlContent.cs
|
mavaddat/PowerShellEditorServices
|
912fa9d0af7cdf315dc119adbfa02fa2a8604eb3
|
[
"MIT"
] | 492
|
2015-11-18T16:09:02.000Z
|
2022-03-23T20:23:52.000Z
|
src/PowerShellEditorServices.VSCode/CustomViews/HtmlContent.cs
|
mavaddat/PowerShellEditorServices
|
912fa9d0af7cdf315dc119adbfa02fa2a8604eb3
|
[
"MIT"
] | 1,185
|
2015-11-18T16:17:02.000Z
|
2022-03-31T22:35:44.000Z
|
src/PowerShellEditorServices.VSCode/CustomViews/HtmlContent.cs
|
LaudateCorpus1/PowerShellEditorServices
|
5ded791cace223fe5cc32a5fd002e2cbf8f7a8f9
|
[
"MIT"
] | 213
|
2015-11-18T17:00:53.000Z
|
2022-03-18T04:38:09.000Z
|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.PowerShell.EditorServices.VSCode.CustomViews
{
/// <summary>
/// Contains details about the HTML content to be
/// displayed in an IHtmlContentView.
/// </summary>
public class HtmlContent
{
/// <summary>
/// Gets or sets the HTML body content.
/// </summary>
public string BodyContent { get; set; }
/// <summary>
/// Gets or sets the array of JavaScript file paths
/// to be used in the HTML content.
/// </summary>
public string[] JavaScriptPaths { get; set; }
/// <summary>
/// Gets or sets the array of stylesheet (CSS) file
/// paths to be used in the HTML content.
/// </summary>
public string[] StyleSheetPaths { get; set; }
}
}
| 29.133333
| 64
| 0.585812
|
583a8167a1e887db09d74642f91b8c8f7be70c80
| 5,023
|
css
|
CSS
|
public/css/style.css
|
mwangangievans/k
|
f2113fa7a00b1ca565f615b34f1958a2cd404aed
|
[
"MIT"
] | null | null | null |
public/css/style.css
|
mwangangievans/k
|
f2113fa7a00b1ca565f615b34f1958a2cd404aed
|
[
"MIT"
] | null | null | null |
public/css/style.css
|
mwangangievans/k
|
f2113fa7a00b1ca565f615b34f1958a2cd404aed
|
[
"MIT"
] | null | null | null |
.navbar {
background: linear-gradient(to right, white 15%, #e6b3e6);
position: fixed;
z-index: 2;
width: 100%;
}
.try {
margin-top: 30px;
margin-bottom: 30px;
max-width: 100%;
}
.spacer {
width: 100%;
height: 170px;
}
.navbar-brand {
font-family: 'Kaushan Script', cursive;
font-size: 45px;
color: #990099;
padding-left: 40px;
}
.nav-link {
font-family: 'Courgette', cursive;
font-size: 20px;
color: black;
padding-left: 40px;
padding-right: 40px;
}
.nav-item {
display: inline-block;
padding: 10px;
padding-left: 40px;
padding-right: 40px;
}
body {
background: #f9ecf9;
}
/*.carousel-item img {*/
/* margin: auto;*/
/*}*/
.section__carousel {
margin-top: 30px;
margin-bottom: 50px;
padding-left: 40px;
padding-right: 40px;
}
.carousel {
width: 100%;
}
.section_about h4 {
font-family: 'Courgette', cursive;
/*font-size: 20px;*/
}
.section_about p {
font-family: 'Montserrat', sans-serif;
}
.section_review h3 {
font-family: 'Courgette', cursive;
text-align: center;
}
.section_review h6 {
font-family: 'Montserrat', sans-serif;
text-align: center;
}
.review {
padding-top: 20px;
background-color: white;
}
.cust_review {
padding-top: 30px;
/*//padding-bottom: 30px;*/
background-color: #f2d9f2;
padding-left: 10px;
padding-right: 10px;
}
.service-img-row {
padding-top: 30px;
padding-bottom: 20px;
}
.service-headding-row {
font-family: 'Courgette', cursive;
text-align: center;
color: purple;
}
.service-table tr td {
padding-top: 20px;
padding-bottom: 8px;
padding-right: 15px
}
.column1 {
font-family: 'Montserrat', sans-serif;
}
.column2 {
font-family: 'Courgette', cursive;
}
.p1,
.p2 {
text-align: center;
}
.p1 {
padding-top: 20px;
font-family: 'Montserrat', sans-serif;
}
.p2 {
font-family: 'Courgette', cursive;
}
.service-img-row img {
max-width: 100%;
}
.product-img-row {
padding-top: 30px;
padding-bottom: 20px;
}
.product-img-row img {
max-width: 100%;
}
.product-headding-row {
font-family: 'Courgette', cursive;
/*text-align: center;*/
color: purple;
}
.product-para-row {
padding-top: 20px;
padding-bottom: 30px;
font-family: 'Montserrat', sans-serif;
}
.product_logo_row .col-sm-4 {
padding-top: 0px;
padding-bottom: 0px;
margin-top: 20Px;
margin-bottom: 30px
}
.product_logo img {
max-width: 100%;
}
.contact-headding-row {
font-family: 'Courgette', cursive;
color: purple;
padding-top: 30px;
}
.contact-headding-row img {
max-width: 100%;
}
.contact-headding-row p {
padding-top: 30px;
font-family: 'Montserrat', sans-serif;
font-size: 15px;
}
.cont-headding {
padding-top: 20px;
}
.contact-form-row {
padding-top: 30px;
font-family: 'Montserrat', sans-serif;
font-size: 15px;
padding-bottom: 20px;
}
iframe {
padding: 20px;
}
.hours {
padding-top: 30px;
padding-left: 40px;
}
.hours h5,
.location h5 {
font-family: 'Courgette', cursive;
}
.location {
padding-top: 30px;
/*padding-left: 20px;*/
}
.formfill {
padding-top: 30px;
padding-left: 20px;
}
footer {
margin-top: 20px;
background: linear-gradient(to left, #df9fdf, white 32%, #e6b3e6);
}
.footer_social {
color: purple;
font-size: 30px;
padding: 5px;
/*padding-top:10px;*/
}
.footer-col {
text-align: left;
padding: 15px;
}
#footer-brand {
font-family: 'Kaushan Script', cursive;
font-size: 35px;
color: #990099;
}
.footer-headding {
font-family: 'Courgette', cursive;
font-size: 20px;
color: black;
}
.footer-para {
font-family: 'Montserrat', sans-serif;
font-size: 15px
}
@media only screen and (max-width: 1024px) {
.nav-item {
display: inline-block;
padding: 10px;
padding-left: 20px;
padding-right: 20px;
}
.spacer {
height: 170px;
}
.navbar-brand {
padding-left: 15px;
}
}
@media only screen and (max-width: 768px) {
.nav-item {
display: inline-block;
padding: 10px;
padding-left: 10px;
padding-right: 10px;
}
.navbar-brand {
font-size: 38px;
}
.navbar-brand img {
max-width: 30%;
}
.navbar-brand {
padding-left: 5px;
}
#footer-brand {
font-size: 35px;
}
.footer-img {
display: none;
}
}
@media only screen and (max-width: 479px) {
.navbar-brand {
font-size: 30px;
}
.navbar-brand img {
max-width: 23%;
/*display: none;*/
}
.navbar-brand {
padding-left: 5px;
}
.footer-about {
display: none;
}
.footer-img {
display: none;
}
#footer-brand {
/*font-size: 30px;*/
display: none;
}
.spacer {
height: 116px;
}
}
| 14.517341
| 70
| 0.577941
|
386806fa21d44ecb288bb9d23e0f556a3bc13e94
| 791
|
php
|
PHP
|
resources/views/admin/multiupload.blade.php
|
AleksejSinchuk/LaravelIvolga
|
0ec1ef2eb53935688108241c2b9203e025588157
|
[
"MIT"
] | null | null | null |
resources/views/admin/multiupload.blade.php
|
AleksejSinchuk/LaravelIvolga
|
0ec1ef2eb53935688108241c2b9203e025588157
|
[
"MIT"
] | 1
|
2021-02-02T21:18:07.000Z
|
2021-02-02T21:18:07.000Z
|
resources/views/admin/multiupload.blade.php
|
AleksejSinchuk/LaravelIvolga
|
0ec1ef2eb53935688108241c2b9203e025588157
|
[
"MIT"
] | null | null | null |
@extends('layouts.admin')
@section('admin_content')
<div class="container">
<form action="{{route('image.multiupload')}}" method="post" multipart="" enctype="multipart/form-data">
{{csrf_field()}}
<div class="form-group">
<input type="file" name="image[]" multiple>
</div>
<div class="form-group">
<input type="text" name="folderpath" placeholder="Имя категории" >
</div>
<button class="btn btn-success" type="submit">Загрузка</button>
</form>
<br>
<ul class="list-group ">
@foreach($catalogs as $cat)
<li class="list-group-item list-group-item-dark" >{{$cat}}</li>
@endforeach
</ul>
</div>
@endsection
| 32.958333
| 112
| 0.527181
|
b05768ef31201e9ef0dddc140d0afc31a878625a
| 818
|
py
|
Python
|
cloudentries/tencentcloud/query/constants.py
|
CloudChef/CloudEntries
|
a890e2eb96cc537db131e7ca8a0e6e1edc0b6ebd
|
[
"Apache-2.0"
] | null | null | null |
cloudentries/tencentcloud/query/constants.py
|
CloudChef/CloudEntries
|
a890e2eb96cc537db131e7ca8a0e6e1edc0b6ebd
|
[
"Apache-2.0"
] | null | null | null |
cloudentries/tencentcloud/query/constants.py
|
CloudChef/CloudEntries
|
a890e2eb96cc537db131e7ca8a0e6e1edc0b6ebd
|
[
"Apache-2.0"
] | 1
|
2021-03-26T05:45:00.000Z
|
2021-03-26T05:45:00.000Z
|
# Copyright (c) 2021 Qianyun, Inc. All rights reserved.
INSTANCE_STATUSES = {
"LAUNCHING": "starting,POWERED_ON",
"RUNNING": "started,POWERED_ON",
"RESTARTING": "starting,POWERED_ON",
"REBOOTING": "starting,POWERED_ON",
"SHUTTINGDOWN": "stopping,POWERED_ON",
"SHUTDOWN": "stopped,POWERED_OFF",
"TERMINATING": "deleting,POWERED_OFF",
"TERMINATED": "lost,UNKNOWN",
"PENDING": "starting,POWERED_ON",
"STOPPED": "stopped,POWERED_OFF"
}
INSTANCE_TYPE = {'标准型': ['S1', 'S2', 'S2ne', 'SA1', 'S3', 'SN3ne', 'S4', 'SA2', 'S5'],
'内存型': ['M1', 'M2', 'M3', 'M4', 'M5'],
'高IO型': ['IT3'],
'大数据型': ['D2'],
'计算型': ['CN3', 'C3', 'C2'],
'批量型': ['BC1', 'BS1'],
'黑石物理服务器2.0': ['BMS4', 'BMD2']}
| 35.565217
| 86
| 0.518337
|
7cd83c3608cb5ed149db3c4e1027728504e1c94c
| 2,601
|
js
|
JavaScript
|
app/setup/security-controls/show/route.js
|
chasballew/dashboard.aptible.com
|
2260f373a2df4439d966d328b0fd72ad5d6255a9
|
[
"MIT"
] | null | null | null |
app/setup/security-controls/show/route.js
|
chasballew/dashboard.aptible.com
|
2260f373a2df4439d966d328b0fd72ad5d6255a9
|
[
"MIT"
] | null | null | null |
app/setup/security-controls/show/route.js
|
chasballew/dashboard.aptible.com
|
2260f373a2df4439d966d328b0fd72ad5d6255a9
|
[
"MIT"
] | null | null | null |
import Ember from 'ember';
import SPDRouteMixin from 'diesel/mixins/routes/spd-route';
export default Ember.Route.extend(SPDRouteMixin, {
stepName: 'security-controls',
model(params) {
let securityControlGroups = this.modelFor('setup.security-controls');
return securityControlGroups.findBy('handle', params.handle);
},
save() {
Ember.run(() => window.scrollTo(0, 0));
let { schemaDocument, attestation } = this.currentModel;
let documentClone = Ember.$.extend(true, {}, schemaDocument.dump({ excludeInvalid: true }));
attestation.set('document', documentClone);
attestation.setUser(this.session.get('currentUser'));
return attestation.save().then(() => {
Ember.set(this.currentModel, 'completed', true);
});
},
setupController(controller, model) {
let securityControlGroups = this.modelFor('setup.security-controls');
controller.set('model', model);
controller.set('securityControlGroups', securityControlGroups);
},
transitionToNextGroup() {
let handle = this.currentModel.handle;
let securityControlGroups = this.modelFor('setup.security-controls');
let transition;
securityControlGroups.forEach((group, index) => {
let next = securityControlGroups[index + 1];
if (group.handle === handle && next) {
transition = this.transitionTo('setup.security-controls.show', next);
}
});
// If we are at the end, but there are unfinished security-control groups
// we should redirect back to the index;
if (!transition && securityControlGroups.filterBy('completed', false).length > 1) {
transition = this.transitionTo('setup.security-controls');
}
if (!transition) {
// All steps complete, transition to finish step
this.finish();
}
},
transitionToPreviousGroup() {
let handle = this.currentModel.handle;
let securityControlGroups = this.modelFor('setup.security-controls');
let transition;
securityControlGroups.forEach((group, index) => {
let previous = securityControlGroups[index - 1];
if (group.handle === handle && previous) {
transition = this.transitionTo('setup.security-controls.show', previous);
}
});
if (!transition) {
this.transitionTo('setup.security-controls');
}
},
actions: {
onPrevious() {
this.transitionToPreviousGroup();
},
onNext() {
this.save().then(() => {
this.transitionToNextGroup();
Ember.set(this.currentModel, 'completed', true);
});
},
onSave() {
this.save();
}
}
});
| 28.582418
| 96
| 0.654748
|
b0e0d6df21aca22cac1fcc5be6f5d694c8c35cd9
| 492
|
py
|
Python
|
strategy/auto_spider/autospider_strategy.py
|
yfsoftcom/crawler
|
37b48285a74d587024f9f6b88de0de2f5dbc9d1d
|
[
"MIT"
] | null | null | null |
strategy/auto_spider/autospider_strategy.py
|
yfsoftcom/crawler
|
37b48285a74d587024f9f6b88de0de2f5dbc9d1d
|
[
"MIT"
] | null | null | null |
strategy/auto_spider/autospider_strategy.py
|
yfsoftcom/crawler
|
37b48285a74d587024f9f6b88de0de2f5dbc9d1d
|
[
"MIT"
] | null | null | null |
import re
from strategy.strategy import Strategy
from strategy.parser.unknown_parser import UnknownParser
from strategy.parser.autospider_parser import DefaultAutoSpiderParser
class AutoSpiderStrategy(Strategy):
def __init__(self, spider = None):
self._spider = spider
def get_parser(self, url, is_html = True, data = None, encoding = 'utf-8'):
# print url
return DefaultAutoSpiderParser(self._spider, encoding = encoding)
def _filter(self, input):
return True
| 27.333333
| 77
| 0.760163
|
90f813a70db086f4ab8ebc408b69f261db9d6b3a
| 918
|
rb
|
Ruby
|
app/models/custom_field.rb
|
1vasari/Dashwork
|
f6ba5dcf5010a7ff61eeab14155b023f46e5a5dc
|
[
"MIT"
] | null | null | null |
app/models/custom_field.rb
|
1vasari/Dashwork
|
f6ba5dcf5010a7ff61eeab14155b023f46e5a5dc
|
[
"MIT"
] | null | null | null |
app/models/custom_field.rb
|
1vasari/Dashwork
|
f6ba5dcf5010a7ff61eeab14155b023f46e5a5dc
|
[
"MIT"
] | null | null | null |
# == Schema Information
#
# Table name: custom_fields
#
# id :integer not null, primary key
# domain :string
# name :string
# type :string
# created_at :datetime not null
# updated_at :datetime not null
# tenant_id :bigint
# user_id :bigint
#
# Indexes
#
# index_custom_fields_on_tenant_id (tenant_id)
# index_custom_fields_on_user_id (user_id)
#
class CustomField < ApplicationRecord
self.inheritance_column = :domain
decorate_with FieldDecorator
TYPES = %w{CustomStringValue CustomTextValue}.freeze
DOMAINS = %w{CustomCompanyField CustomContactField CustomProjectField}.freeze
belongs_to :tenant
belongs_to :user
has_many :custom_values, dependent: :restrict_with_error
validates :name, presence: true
validates :domain, presence: true, inclusion: { in: DOMAINS }
validates :type, presence: true, inclusion: { in: TYPES }
end
| 27
| 79
| 0.711329
|
148f1824090d45f091e57bbc4e708ef443b7dcf1
| 1,443
|
ts
|
TypeScript
|
src/identity.ts
|
AdExNetwork/subgraph-v2
|
5ae88c06807eba6e6e6ec0e580fe5bfda370e171
|
[
"MIT"
] | null | null | null |
src/identity.ts
|
AdExNetwork/subgraph-v2
|
5ae88c06807eba6e6e6ec0e580fe5bfda370e171
|
[
"MIT"
] | 1
|
2022-01-22T12:08:32.000Z
|
2022-01-22T12:08:32.000Z
|
src/identity.ts
|
AdExNetwork/subgraph-v2
|
5ae88c06807eba6e6e6ec0e580fe5bfda370e171
|
[
"MIT"
] | 1
|
2020-05-22T09:48:57.000Z
|
2020-05-22T09:48:57.000Z
|
import { LogPrivilegeChanged, LogRoutineAuth } from "../generated/templates/Identity/Identity"
import { IdentityPrivilege, IdentityRoutine } from '../generated/schema'
export function handleLogPrivilegeChanged(event: LogPrivilegeChanged): void {
let id = event.address.toHexString() + ":" + event.params.addr.toHexString()
let identity = IdentityPrivilege.load(id)
if(!identity) {
identity = new IdentityPrivilege(id)
identity.timestamp = event.block.timestamp.toI32()
identity.lastUpdateTimestamp = event.block.timestamp.toI32()
} else {
identity.lastUpdateTimestamp = event.block.timestamp.toI32()
}
identity.identity = event.address
identity.address = event.params.addr
identity.level = event.params.privLevel
identity.timestamp = event.block.timestamp.toI32()
identity.save()
}
export function handleLogRoutineAuth(event: LogRoutineAuth): void {
let id = event.address.toHexString() + ":" + event.params.hash.toHexString();
let identity = IdentityRoutine.load(id)
if(!identity) {
identity = new IdentityRoutine(id)
identity.timestamp = event.block.timestamp.toI32()
identity.lastUpdateTimestamp = event.block.timestamp.toI32()
} else {
identity.lastUpdateTimestamp = event.block.timestamp.toI32()
}
identity.identity = event.address
identity.hash = event.params.hash
identity.authorized = event.params.authorized
identity.save()
}
| 37.973684
| 94
| 0.730423
|
5d7b647819062eb4fabe69a419d03fe39d751b64
| 1,351
|
dart
|
Dart
|
lib/helpers/model.dart
|
antoniosequeira/mobile_application_old
|
ef7ce2acf164bdf68ae6f5e9e02f05c44a8a7f0d
|
[
"MIT"
] | null | null | null |
lib/helpers/model.dart
|
antoniosequeira/mobile_application_old
|
ef7ce2acf164bdf68ae6f5e9e02f05c44a8a7f0d
|
[
"MIT"
] | null | null | null |
lib/helpers/model.dart
|
antoniosequeira/mobile_application_old
|
ef7ce2acf164bdf68ae6f5e9e02f05c44a8a7f0d
|
[
"MIT"
] | null | null | null |
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:flutter/services.dart';
class Model {
//To call the tflite plugin
static const MethodChannel _channel = const MethodChannel('tflite');
//Method that loads the mobilenet model
static Future<String> loadModel({
@required String model,
String labels = "",
int numThreads = 1,
bool isAsset = true,
}) async {
return await _channel.invokeMethod(
'loadModel',
{
"model": model,
"labels": labels,
"numThreads": numThreads,
"isAsset": isAsset,
},
);
}
//Method that runs the model on the given image, parameter are the default values for the runModelOnImage method
static Future<List> runModelOnImage(
{@required String path,
double imageMean = 117.0,
double imageStd = 1.0,
int numResults = 5,
double threshold = 0.1,
bool asynch = true}) async {
return await _channel.invokeMethod(
'runModelOnImage',
{
"path": path,
"imageMean": imageMean,
"imageStd": imageStd,
"numResults": numResults,
"threshold": threshold,
"asynch": asynch,
},
);
}
static Future close() async {
return await _channel.invokeMethod('close');
}
}
| 25.018519
| 115
| 0.592894
|
e2ac22db94156ce13b64b0df4ca22b85a912e64f
| 1,118
|
py
|
Python
|
src/storager/CategoryStorager.py
|
skaneko-0311/irasutoya-searcher
|
8463f8434594acae2c1ecf60076448107c2f2de1
|
[
"Unlicense"
] | null | null | null |
src/storager/CategoryStorager.py
|
skaneko-0311/irasutoya-searcher
|
8463f8434594acae2c1ecf60076448107c2f2de1
|
[
"Unlicense"
] | null | null | null |
src/storager/CategoryStorager.py
|
skaneko-0311/irasutoya-searcher
|
8463f8434594acae2c1ecf60076448107c2f2de1
|
[
"Unlicense"
] | null | null | null |
import mysql.connector
from urllib.parse import urlparse
class CategoryStorager:
def __init__(self):
pass
def connect(self):
url = urlparse('mysql://irasutoya_user:Irasutoya@20190901@localhost:3306/irasutoya')
self.conn = mysql.connector.connect(
host = url.hostname or 'localhost',
port = url.port or 3306,
user = url.username or 'root',
password = url.password or 'password',
database = url.path[1:] or 'test_database',
)
self.conn.ping(reconnect=True)
def disconnect(self):
self.conn.close()
def insert(self, labels, links):
cur = self.conn.cursor()
records = []
for record in zip(labels, links):
records.append(record)
cur.executemany("INSERT INTO `category` (`label`, `link`) VALUES (%s, %s)", records)
self.conn.commit()
cur.close()
def selectAll(self):
cur = self.conn.cursor()
cur.execute("SELECT * FROM `category`")
records = cur.fetchall()
cur.close()
return records
| 30.216216
| 92
| 0.581395
|
9c7cdc349fb441ed1eb2bf76a7041f4425c4c5d8
| 4,861
|
rs
|
Rust
|
src/main.rs
|
CodeSandwich/n_body
|
47ec6ee61e065fa0e01d878f764d07616de48a7b
|
[
"MIT"
] | null | null | null |
src/main.rs
|
CodeSandwich/n_body
|
47ec6ee61e065fa0e01d878f764d07616de48a7b
|
[
"MIT"
] | null | null | null |
src/main.rs
|
CodeSandwich/n_body
|
47ec6ee61e065fa0e01d878f764d07616de48a7b
|
[
"MIT"
] | null | null | null |
use std::env;
use std::f64::consts::PI;
const SOLAR_MASS: f64 = 4. * PI * PI;
const DAYS_PER_YEAR: f64 = 365.24;
const TIME_STEP: f64 = 0.01;
fn main() {
let steps: u32 = env::args()
.nth(1)
.and_then(|a| a.parse().ok())
.unwrap_or(1000);
let mut bodies = Bodies::new();
println!("{:.9}", bodies.get_energy());
bodies.step_time(steps);
println!("{:.9}", bodies.get_energy());
}
struct Bodies(Body, Body, Body, Body, Body);
impl Bodies {
fn new() -> Self {
Bodies(Body::new_sun(), Body::new_jupiter(), Body::new_saturn(), Body::new_uranus(), Body::new_neptune())
}
fn get_energy(&self) -> f64 {
let mut e = 0.;
let bodies = [&self.0, &self.1, &self.2, &self.3, &self.4];
for i in 0..bodies.len() {
let body_i = bodies[i];
e += 0.5 * body_i.mass * (
body_i.vx.powi(2) +
body_i.vy.powi(2) +
body_i.vz.powi(2));
for j in i + 1..bodies.len() {
let body_j = bodies[j];
let d =
(body_i.x - body_j.x).powi(2) +
(body_i.y - body_j.y).powi(2) +
(body_i.z - body_j.z).powi(2);
e -= body_i.mass * body_j.mass / d.sqrt();
}
}
e
}
fn step_time(&mut self, steps: u32) {
for _ in 0..steps {
//Unrolling this loops about halved processing time
update_v(&mut self.0, &mut self.1);
update_v(&mut self.0, &mut self.2);
update_v(&mut self.0, &mut self.3);
update_v(&mut self.0, &mut self.4);
update_v(&mut self.1, &mut self.2);
update_v(&mut self.1, &mut self.3);
update_v(&mut self.1, &mut self.4);
update_v(&mut self.2, &mut self.3);
update_v(&mut self.2, &mut self.4);
update_v(&mut self.3, &mut self.4);
update_pos(&mut self.0);
update_pos(&mut self.1);
update_pos(&mut self.2);
update_pos(&mut self.3);
update_pos(&mut self.4);
}
}
}
#[inline(always)]
fn update_v(body_i: &mut Body, body_j: &mut Body) {
let dx = body_i.x - body_j.x;
let dy = body_i.y - body_j.y;
let dz = body_i.z - body_j.z;
let d = dx * dx + dy * dy + dz * dz;
let mag = TIME_STEP / (d.sqrt() * d);
let mass_j = body_j.mass * mag;
body_i.vx -= dx * mass_j;
body_i.vy -= dy * mass_j;
body_i.vz -= dz * mass_j;
let mass_i = body_i.mass * mag;
body_j.vx += dx * mass_i;
body_j.vy += dy * mass_i;
body_j.vz += dz * mass_i;
}
#[inline(always)]
fn update_pos(body: &mut Body) {
body.x += body.vx * TIME_STEP;
body.y += body.vy * TIME_STEP;
body.z += body.vz * TIME_STEP;
}
struct Body {
x: f64,
y: f64,
z: f64,
vx: f64,
vy: f64,
vz: f64,
mass: f64,
}
impl Body {
fn new_jupiter() -> Self {
Body {
x: 4.84143144246472090e+00,
y: -1.16032004402742839e+00,
z: -1.03622044471123109e-01,
vx: 1.66007664274403694e-03 * DAYS_PER_YEAR,
vy: 7.69901118419740425e-03 * DAYS_PER_YEAR,
vz: -6.90460016972063023e-05 * DAYS_PER_YEAR,
mass: 9.54791938424326609e-04 * SOLAR_MASS,
}
}
fn new_saturn() -> Self {
Body {
x: 8.34336671824457987e+00,
y: 4.12479856412430479e+00,
z: -4.03523417114321381e-01,
vx: -2.76742510726862411e-03 * DAYS_PER_YEAR,
vy: 4.99852801234917238e-03 * DAYS_PER_YEAR,
vz: 2.30417297573763929e-05 * DAYS_PER_YEAR,
mass: 2.85885980666130812e-04 * SOLAR_MASS,
}
}
fn new_uranus() -> Self {
Body {
x: 1.28943695621391310e+01,
y: -1.51111514016986312e+01,
z: -2.23307578892655734e-01,
vx: 2.96460137564761618e-03 * DAYS_PER_YEAR,
vy: 2.37847173959480950e-03 * DAYS_PER_YEAR,
vz: -2.96589568540237556e-05 * DAYS_PER_YEAR,
mass: 4.36624404335156298e-05 * SOLAR_MASS,
}
}
fn new_neptune() -> Self {
Body {
x: 1.53796971148509165e+01,
y: -2.59193146099879641e+01,
z: 1.79258772950371181e-01,
vx: 2.68067772490389322e-03 * DAYS_PER_YEAR,
vy: 1.62824170038242295e-03 * DAYS_PER_YEAR,
vz: -9.51592254519715870e-05 * DAYS_PER_YEAR,
mass: 5.15138902046611451e-05 * SOLAR_MASS,
}
}
fn new_sun() -> Self {
Body {
x: 0.,
y: 0.,
z: 0.,
vx: -3.8766340719874267e-04,
vy: -3.2753590371765707e-03,
vz: 2.3935734080003002e-05,
mass: SOLAR_MASS,
}
}
}
| 29.107784
| 113
| 0.513269
|
77ac49b07f481f35204ce0213bc1b4bf8dc31811
| 4,146
|
h
|
C
|
include/pre/hidden/utility/ranges_iota.h
|
mgradysaunders/Precept
|
0677c70ac4ed9e0a8c5aad7b049daad22998de9e
|
[
"BSD-2-Clause"
] | null | null | null |
include/pre/hidden/utility/ranges_iota.h
|
mgradysaunders/Precept
|
0677c70ac4ed9e0a8c5aad7b049daad22998de9e
|
[
"BSD-2-Clause"
] | null | null | null |
include/pre/hidden/utility/ranges_iota.h
|
mgradysaunders/Precept
|
0677c70ac4ed9e0a8c5aad7b049daad22998de9e
|
[
"BSD-2-Clause"
] | null | null | null |
/*-*- C++ -*-*/
#pragma once
#include "./concepts.h"
namespace pre::ranges {
template <std::integral Int>
struct iota : enable_view {
using value_type = Int;
using reference = Int;
using difference_type = std::make_signed_t<Int>;
struct Sentinel {};
struct Iterator {
using value_type = Int;
using reference = Int;
using pointer = void;
using difference_type = std::make_signed_t<Int>;
using iterator_category = std::random_access_iterator_tag;
constexpr Iterator() noexcept = default;
constexpr Iterator(Int value, Int limit, Int increment) noexcept
: value(value), limit(limit), increment(increment) {}
constexpr Int operator*() const noexcept { return value; }
constexpr Iterator& operator++() noexcept {
value += increment;
return *this;
}
constexpr Iterator& operator--() noexcept {
value -= increment;
return *this;
}
constexpr Iterator operator++(int) noexcept {
Iterator copy = *this;
operator++();
return copy;
}
constexpr Iterator operator--(int) noexcept {
Iterator copy = *this;
operator--();
return copy;
}
constexpr Iterator& operator+=(difference_type count) noexcept {
value += increment * count;
return *this;
}
constexpr Iterator& operator-=(difference_type count) noexcept {
value -= increment * count;
return *this;
}
constexpr Iterator operator+(difference_type count) const noexcept {
return Iterator(*this) += count;
}
constexpr Iterator operator-(difference_type count) const noexcept {
return Iterator(*this) -= count;
}
friend constexpr Iterator operator+(
difference_type count, const Iterator& itr) noexcept {
return itr + count;
}
constexpr difference_type operator-(
const Iterator& other) const noexcept {
return (difference_type(value) - difference_type(other.value)) /
difference_type(other.increment);
}
constexpr Int operator[](difference_type count) const noexcept {
return value + increment * count;
}
constexpr auto operator<=>(const Iterator& other) const noexcept {
return value <=> other.value;
}
constexpr bool operator==(const Iterator&) const noexcept = default;
constexpr bool operator==(Sentinel) const noexcept {
if (increment > 0) return value >= limit;
if (increment < 0) return value <= limit;
return true;
}
Int value = 0;
Int limit = 0;
Int increment = 1;
};
using sentinel = Sentinel;
using iterator = Iterator;
using const_iterator = Iterator;
public:
constexpr iota() noexcept = default;
constexpr iota(Int n) noexcept : iota(0, n, 1) {}
constexpr iota(Int a, Int b) noexcept : iota(a, b, a <= b ? 1 : -1) {}
constexpr iota(Int a, Int b, Int inc) noexcept
: first(a), limit(b), increment(inc) {}
[[nodiscard]] constexpr iterator begin() const noexcept {
return iterator(first, limit, increment);
}
[[nodiscard]] constexpr sentinel end() const noexcept { return {}; }
Int first = 0;
Int limit = 0;
Int increment = 1;
template <concepts::arithmetic Arith>
constexpr auto operator*(Arith value) const noexcept {
return std::ranges::subrange(begin(), end()) |
std::views::transform([value](Int i) { return i * value; });
}
template <concepts::arithmetic Arith>
constexpr auto operator/(Arith value) const noexcept {
to_floating_point_t<Arith> denom =
to_floating_point_t<Arith>(1) / value;
return std::ranges::subrange(begin(), end()) |
std::views::transform([denom](Int i) { return i * denom; });
}
};
} // namespace pre::ranges
| 26.922078
| 76
| 0.580801
|
7e779c16dbaca28245a2b0145c39b6e6b29c9629
| 535
|
rb
|
Ruby
|
old_spec/lib/carbonmu/internationalization_spec.rb
|
tkrajcar/carbonmu
|
edbd0fa8a2d80e6b5dc626453cff2c9a664dc49e
|
[
"MIT"
] | 12
|
2015-04-25T22:20:51.000Z
|
2020-11-22T17:18:28.000Z
|
old_spec/lib/carbonmu/internationalization_spec.rb
|
tkrajcar/carbonmu
|
edbd0fa8a2d80e6b5dc626453cff2c9a664dc49e
|
[
"MIT"
] | 21
|
2015-02-23T05:57:55.000Z
|
2016-02-23T02:32:06.000Z
|
old_spec/lib/carbonmu/internationalization_spec.rb
|
tkrajcar/carbonmu
|
edbd0fa8a2d80e6b5dc626453cff2c9a664dc49e
|
[
"MIT"
] | 10
|
2015-02-28T08:07:57.000Z
|
2020-09-11T04:14:16.000Z
|
require "spec_helper"
describe Internationalization do
context ".setup" do
it "loads the core locale files" do
CarbonMU::Internationalization.setup
core_locales_dir = File.expand_path("../../../../config/locales", __FILE__)
expect(I18n.load_path).to include("#{core_locales_dir}/en.yml")
end
end
context ".t" do
it "calls I18n.t" do
str = "foo"
opts = {foo: "bar"}
expect(I18n).to receive(:t).with(str, opts)
CarbonMU::Internationalization.t(str, opts)
end
end
end
| 23.26087
| 81
| 0.64486
|
769be0c4cad1e8de76f7567c3bcfde66468907df
| 2,116
|
rs
|
Rust
|
src/linear_reusable.rs
|
EVaillant/lockfree-object-pool
|
e3d11553426ba4091c8a4443369446ba03bc6459
|
[
"BSL-1.0"
] | 18
|
2021-01-21T13:39:38.000Z
|
2022-02-17T03:33:07.000Z
|
src/linear_reusable.rs
|
EVaillant/lockfree-object-pool
|
e3d11553426ba4091c8a4443369446ba03bc6459
|
[
"BSL-1.0"
] | 3
|
2021-01-22T07:59:11.000Z
|
2021-02-15T07:46:57.000Z
|
src/linear_reusable.rs
|
EVaillant/lockfree-object-pool
|
e3d11553426ba4091c8a4443369446ba03bc6459
|
[
"BSL-1.0"
] | 1
|
2021-01-21T15:38:45.000Z
|
2021-01-21T15:38:45.000Z
|
use crate::linear_object_pool::LinearObjectPool;
use crate::page::{Page, PageId};
use std::ops::{Deref, DerefMut};
/// Wrapper over T used by [`LinearObjectPool`].
///
/// Access is allowed with [`std::ops::Deref`] or [`std::ops::DerefMut`]
/// # Example
/// ```rust
/// use lockfree_object_pool::LinearObjectPool;
///
/// let pool = LinearObjectPool::<u32>::new(
/// || Default::default(),
/// |v| {
/// *v = 0;
/// }
/// );
/// let mut item = pool.pull();
///
/// *item = 5;
/// let work = *item * 5;
/// ```
pub struct LinearReusable<'a, T> {
pool: &'a LinearObjectPool<T>,
page_id: PageId,
page: &'a Page<T>,
}
impl<'a, T> LinearReusable<'a, T> {
/// Create new element
///
/// # Arguments
/// * `pool` object pool owner
/// * `page_id` page id
/// * `page` page that contains data
/// # Safety
/// * `page` has to be a valid pointer to a page in `pool`
/// * `pool_id` has to be a valid id for `page`
#[inline]
pub(crate) unsafe fn new(
pool: &'a LinearObjectPool<T>,
page_id: PageId,
page: &'a Page<T>,
) -> Self {
Self {
pool,
page_id,
page,
}
}
}
impl<'a, T> DerefMut for LinearReusable<'a, T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe {
// SAFETY: there exists only this `LinearReusable` with this page_id
self.page.get_mut(&self.page_id)
}
}
}
impl<'a, T> Deref for LinearReusable<'a, T> {
type Target = T;
#[inline]
fn deref(&self) -> &Self::Target {
unsafe {
// SAFETY: there exists only this `LinearReusable` with this page_id
self.page.get(&self.page_id)
}
}
}
impl<'a, T> Drop for LinearReusable<'a, T> {
#[inline]
fn drop(&mut self) {
let page = self.page;
(self.pool.get_reset_callback())(unsafe {
// SAFETY: there exists only this `LinearReusable` with this page_id
page.get_mut(&self.page_id)
});
page.free(&self.page_id);
}
}
| 24.604651
| 80
| 0.534499
|
f426a516e303d2fe050bc95df31f8585e682d193
| 455
|
cs
|
C#
|
tests/cs/return/Return.cs
|
jonathanvdc/ecsc
|
8cd825f3e53e8416c7ff84a90e6cf30937d4b92c
|
[
"MIT"
] | 2
|
2018-03-30T18:59:59.000Z
|
2018-10-02T22:02:08.000Z
|
tests/cs/return/Return.cs
|
jonathanvdc/ecsc
|
8cd825f3e53e8416c7ff84a90e6cf30937d4b92c
|
[
"MIT"
] | null | null | null |
tests/cs/return/Return.cs
|
jonathanvdc/ecsc
|
8cd825f3e53e8416c7ff84a90e6cf30937d4b92c
|
[
"MIT"
] | null | null | null |
public static class ReturnTest
{
public static void ReturnVoid()
{
return;
}
public static int ReturnValue(int Value)
{
return Value;
}
public static T ReturnGeneric<T>(T Value)
{
return Value;
}
public static void Main()
{
ReturnTest.ReturnVoid();
System.Console.WriteLine(ReturnValue(4));
System.Console.WriteLine(ReturnTest.ReturnGeneric<int>(2));
}
}
| 17.5
| 67
| 0.595604
|
d19e71204b2e5ca29adbbb2349d351e35640fc95
| 15,429
|
sql
|
SQL
|
smmp_ser/target/classes/smmp.sql
|
feichailianmeng/sm
|
0d51505a4e45fa131b95b25ad5395d3b3669fed9
|
[
"Apache-2.0"
] | null | null | null |
smmp_ser/target/classes/smmp.sql
|
feichailianmeng/sm
|
0d51505a4e45fa131b95b25ad5395d3b3669fed9
|
[
"Apache-2.0"
] | null | null | null |
smmp_ser/target/classes/smmp.sql
|
feichailianmeng/sm
|
0d51505a4e45fa131b95b25ad5395d3b3669fed9
|
[
"Apache-2.0"
] | null | null | null |
/*
Navicat MySQL Data Transfer
Source Server : smpp
Source Server Version : 50722
Source Host : 192.168.140.36:3306
Source Database : smmp
Target Server Type : MYSQL
Target Server Version : 50722
File Encoding : 65001
Date: 2018-08-03 18:56:59
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for sys_area
-- ----------------------------
DROP TABLE IF EXISTS `sys_area`;
CREATE TABLE `sys_area` (
`id` varchar(64) NOT NULL,
`parent_id` varchar(64) NOT NULL,
`parent_ids` varchar(2048) NOT NULL,
`name` varchar(64) NOT NULL,
`sort` decimal(10,0) DEFAULT NULL,
`code` varchar(64) DEFAULT NULL,
`type` char(1) NOT NULL,
`remark` varchar(512) DEFAULT NULL,
`flag` char(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_area
-- ----------------------------
INSERT INTO `sys_area` VALUES ('0010d52ef2004088a6744d0f324acb0c', 'pareentid2', 'parentIds2', 'name2', '0', 'af9434401e7f4a74af615505547fe1af', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('14786489e73c47e9a261507c1ddfa220', 'pareentid0', 'parentIds0', 'name0', '0', '80b640f21d53436c9401063cb67fdc86', '0', 'reark', '0');
INSERT INTO `sys_area` VALUES ('327a98e4bdb9455dacf12d94b811d11b', 'pareentid16', 'parentIds16', 'name16', '0', '826e1e84e0e34ec6b3c49190a9d2020a', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('3305c35abda1401aa3a6faacf5a4d73b', 'pareentid7', 'parentIds7', 'name7', '0', 'd71cb2ef05464749b5a2e8b0c3213e73', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('382da12e77dd4714919415eafde4575f', 'pareentid24', 'parentIds24', 'name24', '0', 'e66cd300ad514ce3a90f5b07f2fc712f', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('44afc231a75346ce986e0aa6a777d824', 'pareentid10', 'parentIds10', 'name10', '0', 'aa9f22e7f174404388aba3f2472d6ec8', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('513c7f3d5d954f4d8429e4932e7e0621', 'pareentid3', 'parentIds3', 'name3', '0', '8bce6df7e3fe408590c74e232b9c2a1c', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('5d5b0bc16564495eaec957e80eabafa6', 'pareentid8', 'parentIds8', 'name8', '0', 'f1333a4dbdd843d999263ad5e10e31d0', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('5efc6e50eec64db4bddaed65e24eb0df', 'pareentid22', 'parentIds22', 'name22', '0', '3275c8097e734c4baabc4cac87cc44cd', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('64185c16f2894915ac4d9004e7ecc475', 'pareentid27', 'parentIds27', 'name27', '0', '826fe69bb28a47e58a78bf0265ecad66', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('677d44241bcb420396d2eb992546854a', 'pareentid5', 'parentIds5', 'name5', '0', 'a94cad7b433f41b797038a0e08a713df', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('6e7c8ae59d754e7f914ab686189caac9', 'pareentid25', 'parentIds25', 'name25', '0', 'efc4ab4ab6c948c4b7b71d3140684647', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('6f16887abebf4b26b69ed29b77c04545', 'pareentid4', 'parentIds4', 'name4', '0', 'ad05d24442484b4d98c449fd19d4867b', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('73e6d1bd0c9246c18105fcb8440fd7a9', 'pareentid23', 'parentIds23', 'name23', '0', 'bdb72d12b18b4899b14e995a42bd51c7', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('7675e61dd06145de9181efeecf69aa1d', 'pareentid12', 'parentIds12', 'name12', '0', '3347be01ba4a4a93aadc35d1f4a9190b', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('7ba8ac3be7934499828dc9d665f740ac', 'pareentid14', 'parentIds14', 'name14', '0', 'ac61712605c3450fa9cf3b5dffd1a623', '1', 'reark', '1');
INSERT INTO `sys_area` VALUES ('85b90edcfc934433bcf2a1fd98121c53', 'pareentid20', 'parentIds20', 'name20', '0', '72b6559becc441469d893532c6b3f511', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('93f58192ee2a49269b65dcece48dacee', 'pareentid6', 'parentIds6', 'name6', '0', 'e22cabd36c2c46a28646919236729c2f', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('9ac9b104e7f343b69faf2052c761fe1b', 'pareentid9', 'parentIds9', 'name9', '0', '4639090eff414cb087bd8bbd378d6cc0', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('9c4a7d44f5a54f37a60e85c2de43ef25', 'pareentid26', 'parentIds26', 'name26', '0', 'e2d4976bdf5e40af8a834e8d8c56b198', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('9fd7d2171dc34a7b85c815c750501870', 'pareentid15', 'parentIds15', 'name15', '0', 'a2e573da5e0f48faa910ffabb4ef4f5e', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('a6d0c577b7744547b6b9d6ba898d3bb8', 'pareentid0', 'parentIds0', 'name0', '0', 'cedbac33a77b47509f1ae0ffbb28f99f', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('da62741ac1de46a79191f093edfd00f3', 'pareentid1', 'parentIds1', 'name1', '0', '77de6205d458478bbfb7a1d30d996a23', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('e4f4f725d9984d6d9464aa09c07254ea', 'pareentid19', 'parentIds19', 'name19', '0', 'b31538e3b929453a89e1af5ed27df851', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('e9d085defa8c45958f29ceeda08d0e0c', 'pareentid18', 'parentIds18', 'name18', '0', 'bfadab3a79fe4fa4b758f873687d9855', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('edcc2f0a54b14f6e8b1b5de7022a2ff9', 'pareentid13', 'parentIds13', 'name13', '0', '9155826c36d0494daaffda8610139801', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('ef4da3c2377945758145129319e7271b', 'pareentid30', 'parentIds30', 'name30', '0', 'cf170550a88842959d13ae75c6ff5c6a', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('f1c1a39b33b34937bc4d14d6864c3b4c', 'pareentid11', 'parentIds11', 'name11', '0', 'ee2294b1bb624220aa1b0d340eb03893', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('f42af6ac63d1427080b05a1b41d914f5', 'pareentid28', 'parentIds28', 'name28', '0', 'a54f0d0de3924624a7a9e2d044613b95', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('f61ded8b8a1e403c86c06e57162ce06a', 'pareentid17', 'parentIds17', 'name17', '0', 'e76023a7153844eb99bdee29199256d9', '1', 'reark', '0');
INSERT INTO `sys_area` VALUES ('fbd7390e36d04055a98de6b2e49612cf', 'pareentid21', 'parentIds21', 'name21', '0', '89709ac9f19f4280bbcaef56f160f318', '1', 'reark', '0');
-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
`id` varchar(64) NOT NULL,
`type_code` varchar(64) NOT NULL,
`label` varchar(64) NOT NULL,
`value` varchar(64) NOT NULL,
`sort` decimal(10,0) DEFAULT NULL,
`remark` varchar(512) DEFAULT NULL,
`flag` char(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_dict
-- ----------------------------
INSERT INTO `sys_dict` VALUES ('1e790d1e9ceb4425bbbca422fbd5836a', 'A8', 'label8', 'value8', '1', 'remark8', '0');
INSERT INTO `sys_dict` VALUES ('6c93ebdb114a42c091bb5d0f8918713c', 'A7', 'label7', 'value7', '1', 'remark7', '0');
INSERT INTO `sys_dict` VALUES ('6fcac6beaabc46e1a8c3729d53827fc4', 'A3', 'label3', 'value3', null, 'remark3', '1');
INSERT INTO `sys_dict` VALUES ('77717f621e9c4ad694020d9ad86e3e2b', 'A10', 'label10', 'value10', '1', 'remark10', '0');
INSERT INTO `sys_dict` VALUES ('7fd36a58332944ad823f96f5cdbcbbac', 'A4', 'label4', 'value4', '1', 'remark4', '0');
INSERT INTO `sys_dict` VALUES ('901298829a96445eb28ddb8593d589ba', 'A1', 'label1', 'value1', '1', 'remark1', '0');
INSERT INTO `sys_dict` VALUES ('940b8b6451524dbcacd533e464b993cd', 'B9', 'B9', 'B9', '1', 'B9', '0');
INSERT INTO `sys_dict` VALUES ('99895a55e1e04a12a247385205f94792', 'A2', 'B9', 'value2', '1', 'remark2', '0');
INSERT INTO `sys_dict` VALUES ('a7b205eb09bd4361b84d838da2b24fa1', 'A6', 'label6', 'value6', '1', 'remark6', '0');
INSERT INTO `sys_dict` VALUES ('e7d2504a5ce2407297756341fb3a6b47', 'A0', 'label0', 'value0', '1', 'remark0', '0');
INSERT INTO `sys_dict` VALUES ('fd87ebd376d74c5b92355742d2a60f11', 'A5', 'label5', 'value5', '1', 'remark5', '0');
-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`id` varchar(64) NOT NULL,
`parent_id` varchar(64) NOT NULL,
`parent_ids` varchar(2048) NOT NULL,
`name` varchar(64) NOT NULL,
`code` varchar(64) NOT NULL,
`href` varchar(1024) DEFAULT NULL,
`icon` varchar(128) DEFAULT NULL,
`type` varchar(128) NOT NULL,
`permission` varchar(128) DEFAULT NULL,
`sort` decimal(10,0) NOT NULL,
`target` char(1) DEFAULT NULL,
`is_show` char(1) NOT NULL,
`remark` varchar(512) DEFAULT NULL,
`flag` char(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT INTO `sys_menu` VALUES ('1', '0', '1', '1', '1', '1', null, '1', 'sys:add', '0', null, '1', null, '0');
INSERT INTO `sys_menu` VALUES ('2', '0', '1', '1', '1', '1', null, '1', 'sys:edit', '0', null, '1', null, '0');
INSERT INTO `sys_menu` VALUES ('3', '0', '1', '1', '1', '1', null, '1', '11', '0', null, '1', null, '0');
INSERT INTO `sys_menu` VALUES ('4', '0', '4', '4', '4', null, '4', '4', 'sys:del', '4', null, '1', null, '0');
-- ----------------------------
-- Table structure for sys_org
-- ----------------------------
DROP TABLE IF EXISTS `sys_org`;
CREATE TABLE `sys_org` (
`id` varchar(64) NOT NULL,
`parent_id` varchar(64) NOT NULL,
`parent_ids` varchar(2048) NOT NULL,
`name` varchar(64) NOT NULL,
`code` varchar(64) NOT NULL,
`type` char(1) NOT NULL,
`url` varchar(1024) DEFAULT NULL,
`icon` varchar(128) DEFAULT NULL,
`grade` char(1) DEFAULT NULL,
`sort` decimal(10,0) NOT NULL,
`master` varchar(64) DEFAULT NULL,
`mobile` varchar(16) DEFAULT NULL,
`useable` char(1) NOT NULL,
`remark` varchar(512) DEFAULT NULL,
`flag` char(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_org
-- ----------------------------
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`id` varchar(64) NOT NULL,
`name` varchar(64) NOT NULL,
`code` varchar(64) DEFAULT NULL,
`type` char(1) NOT NULL,
`remark` varchar(512) DEFAULT NULL,
`flag` char(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES ('1', '11', '111', '1', '1', '0');
INSERT INTO `sys_role` VALUES ('2', '22', '222', '2', '2', '0');
-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
`role_id` varchar(64) NOT NULL,
`menu_id` varchar(64) NOT NULL,
PRIMARY KEY (`role_id`,`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
INSERT INTO `sys_role_menu` VALUES ('1', '1');
INSERT INTO `sys_role_menu` VALUES ('1', '2');
INSERT INTO `sys_role_menu` VALUES ('1', '3');
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` varchar(64) NOT NULL,
`org_id` varchar(64) NOT NULL,
`username` varchar(64) NOT NULL,
`password` varchar(128) NOT NULL,
`safecode` varchar(64) DEFAULT NULL,
`name` varchar(64) NOT NULL,
`idcard` varchar(18) DEFAULT NULL,
`photo` varchar(1024) DEFAULT NULL,
`mobile` varchar(16) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`type` char(1) NOT NULL,
`remark` varchar(512) DEFAULT NULL,
`flag` char(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES ('04bc3402c74e4e3c87e2e27b50a98a2e', '0', 'test6', '45e1473b4ba52bbe9d5215ee5163e86a', '6e6821dd960d4b78bd2d7381aad26a69', 'test6', '6', '', '610000', '6@123.com', '0', 'nothing6', '0');
INSERT INTO `sys_user` VALUES ('0bd4ad9ee64b4b73bbfb9b7dbba6ba41', '0', 'test3', '846f739a4d88f8ca258646fa745ecc9d', 'c6f08617595940e98a257bcf176817fc', 'test3', '3', '', '310000', '3@123.com', '0', 'nothing3', '0');
INSERT INTO `sys_user` VALUES ('0e207e95eb9d4f3985120ec7d5528013', '0', 'test1', 'b265f5fb1d15481d121b6eaa7145b5bb', '3a9388238ec3416f805da89940ff4dae', 'test1', '1', '', '110000', '1@123.com', '0', 'nothing1', '0');
INSERT INTO `sys_user` VALUES ('0f53c59c7fa24c9d8534411edc9f52c2', '0', 'test13', 'ab92a07803058aec7f97d9e659bed98a', '3e72ffc3cf7549e6855db1751d7aa7b7', 'test13', '13', '', '1310000', '13@123.com', '0', 'nothing13', '0');
INSERT INTO `sys_user` VALUES ('133ab8e0ce0a45a38070140dbcf2f25a', '0', 'test4', '12ddd0c4d1f018df1a26799b3a7b2a0a', 'ed71747394a44ae7a1b2f838b84a8718', 'test4', '4', '', '410000', '4@123.com', '0', 'nothing4', '0');
INSERT INTO `sys_user` VALUES ('230f2f0df45344fd8826c8ab1eae447e', '0', 'test11', '890103597e94bb506548c5c4117cfd19', '43508530a6ff4ceda6e2eebe6974ffe8', 'test11', '11', '', '1110000', '11@123.com', '0', 'nothing11', '0');
INSERT INTO `sys_user` VALUES ('3f1f44da3abd426db2258ad657919df1', '0', 'test5', '7f4b67199c2be6011c2900f88755e2e9', '01a648817342490089f02dc9db415bee', 'test5', '5', '', '510000', '5@123.com', '0', 'nothing5', '0');
INSERT INTO `sys_user` VALUES ('407ef1dca9a840f38d5732aa45a3a729', '0', 'test2', '5776054a8d86536011d83632166c86c2', 'aabb5a7e22c14a01beb521bc9829f2dd', 'test2', '2', '', '210000', '2@123.com', '0', 'nothing2', '0');
INSERT INTO `sys_user` VALUES ('8535c962d4724f8c96e2dd2d787dbfcc', '0', 'test10', '3cdc69bda8e5125a661a630b682c5b71', 'c096b57b9e2c4bf7b56a81476c944092', 'test10', '10', '', '1010000', '10@123.com', '0', 'nothing10', '0');
INSERT INTO `sys_user` VALUES ('a67fcebdd1b24c47adafe3f33adce11e', '0', 'test0', '0113a875c98860db677d4020b5e0e328', '177d9a9da4ee408d9f351cbbfa2905c5', 'test0', '0', '', '010000', '0@123.com', '0', 'nothing0', '0');
INSERT INTO `sys_user` VALUES ('cd6635a2cd8c490e9eb7eab371f14f20', '0', 'test12', '5b2428d58001ee2f3a4efac2c6ee6b8f', 'c5966db0dcb64f7ebdb78bb691a09436', 'test12', '12', '', '1210000', '12@123.com', '0', 'nothing12', '0');
INSERT INTO `sys_user` VALUES ('dc6d238e51694f3da92fda3b9cd09659', '0', 'test9', '18e4a46766e4583c9926ea2aa0185e46', 'a1d24d4a053c49d799f6251c5364b14a', 'test9', '9', '', '910000', '9@123.com', '0', 'nothing9', '0');
INSERT INTO `sys_user` VALUES ('e34790f9c3ca4c39841b781cf80e0a42', '0', 'test7', '165f20a0dc91c25031da203fb075af34', 'f4666d1b7c3e45d494da3fa55cc18d33', 'test7', '7', '', '710000', '7@123.com', '0', 'nothing7', '0');
INSERT INTO `sys_user` VALUES ('eadf4b92771441f98a01dd02687df8f2', '0', 'test8', '3b9db5fd1fc986cd02b3e8051821ac9d', '8532b2af06f146598b7f2291ea034144', 'test8', '8', '', '810000', '8@123.com', '0', 'nothing8', '0');
-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`user_id` varchar(64) NOT NULL,
`role_id` varchar(64) NOT NULL,
PRIMARY KEY (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
INSERT INTO `sys_user_role` VALUES ('0e207e95eb9d4f3985120ec7d5528013', '1');
INSERT INTO `sys_user_role` VALUES ('0e207e95eb9d4f3985120ec7d5528013', '2');
| 62.21371
| 222
| 0.658695
|
c3542c92adfb929cba74a956f1f098a50bc9f0dc
| 2,676
|
lua
|
Lua
|
InGameAvatarEditor/src/ServerScriptService/AvatarEditorInGameSetup/AvatarEditorInGame/Modules/Packages/UIBlox/App/Container/__stories__/HorizontalPageMargin/Resizing.story.lua
|
MirayXS/avatar
|
7c78513fbe9587915700a0a5fd3c15d5f23596d2
|
[
"RSA-MD"
] | 41
|
2021-04-30T18:27:45.000Z
|
2022-03-23T21:12:57.000Z
|
InGameAvatarEditor/src/ServerScriptService/AvatarEditorInGameSetup/AvatarEditorInGame/Modules/Packages/UIBlox/App/Container/__stories__/HorizontalPageMargin/Resizing.story.lua
|
MirayXS/avatar
|
7c78513fbe9587915700a0a5fd3c15d5f23596d2
|
[
"RSA-MD"
] | 3
|
2021-08-24T20:07:47.000Z
|
2022-02-15T19:40:13.000Z
|
InGameAvatarEditor/src/ServerScriptService/AvatarEditorInGameSetup/AvatarEditorInGame/Modules/Packages/UIBlox/App/Container/__stories__/HorizontalPageMargin/Resizing.story.lua
|
MirayXS/avatar
|
7c78513fbe9587915700a0a5fd3c15d5f23596d2
|
[
"RSA-MD"
] | 25
|
2021-05-02T14:33:04.000Z
|
2022-03-17T20:28:07.000Z
|
-- DEPRECATED: This story is provided for backwards compatibility with horsecat and will be removed.
-- Please only make changes to `src\Stories\Private\App\Container\HorizontalPageMargin\Resizing.story.lua`
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StoryComponents = ReplicatedStorage.Packages.StoryComponents
local StoryView = require(StoryComponents.StoryView)
local StoryLeftBar = require(StoryComponents.StoryLeftBar)
local ResizingFrame = require(StoryComponents.ResizingFrame)
local SectionHeader = require(StoryComponents.SectionHeader)
local Container = script:FindFirstAncestor("Container")
local HorizontalPageMargin = require(Container.HorizontalPageMargin)
local Packages = Container:FindFirstAncestor("Packages")
local Roact = require(Packages.Roact)
return function(target)
local tree = Roact.createElement(StoryView, nil, {
leftBar = Roact.createElement(StoryLeftBar, {
title = "HorizontalPageMargin: Resizing",
subtitle = table.concat({
"Page margins are either 12pt, 24pt, or 48pt, depending on container width.",
"Interact with the red rulers to resize the demonstration.",
}, "\n\n")
}, {
layout = Roact.createElement("UIListLayout", {
Padding = UDim.new(0, 50),
HorizontalAlignment = Enum.HorizontalAlignment.Left,
VerticalAlignment = Enum.VerticalAlignment.Center,
SortOrder = Enum.SortOrder.LayoutOrder,
}),
iconButtonsSection = Roact.createElement(SectionHeader, {
title = "HorizontalPageMargin With Icon Buttons",
subtitle = "",
LayoutOrder = 1,
}),
resizeDemo1 = Roact.createElement(ResizingFrame, {
startingWidth = 360,
startingHeight = 80,
horizontalRulers = { 360, 540, 680 },
LayoutOrder = 2,
}, {
demo = Roact.createElement(HorizontalPageMargin, {
backgroundColor3 = Color3.fromRGB(155, 10, 155),
}, {
text = Roact.createElement("TextLabel", {
Text = "text",
Size = UDim2.fromScale(1, 1),
}),
}),
}),
textButtonSection = Roact.createElement(SectionHeader, {
title = "HorizontalPageMargin with Text Buttons",
subtitle = "",
LayoutOrder = 3,
}),
resizeDemo2 = Roact.createElement(ResizingFrame, {
startingWidth = 360,
startingHeight = 80,
horizontalRulers = { 360, 540, 680 },
LayoutOrder = 4,
}, {
demo = Roact.createElement(HorizontalPageMargin, {
backgroundColor3 = Color3.fromRGB(155, 10, 155),
}, {
text = Roact.createElement("TextLabel", {
Text = "text",
Size = UDim2.fromScale(1, 1),
}),
}),
}),
}),
})
local handle = Roact.mount(tree, target)
return function()
Roact.unmount(handle)
end
end
| 33.45
| 106
| 0.704783
|
dd608b717f69133cfbe33599fa4b37f4a510de9e
| 4,120
|
java
|
Java
|
com.ibm.team.rtc.extensions.workitem.copy/src/com/ibm/team/rtc/extensions/workitem/copy/internal/WorkItemsResolver.java
|
sandy081/Copy-Work-Items
|
042f3cc31757b59966dcadb81ad9ee040f835813
|
[
"MIT"
] | 3
|
2015-03-30T11:44:33.000Z
|
2021-06-07T04:10:10.000Z
|
com.ibm.team.rtc.extensions.workitem.copy/src/com/ibm/team/rtc/extensions/workitem/copy/internal/WorkItemsResolver.java
|
sandy081/Copy-Work-Items
|
042f3cc31757b59966dcadb81ad9ee040f835813
|
[
"MIT"
] | 3
|
2015-03-09T20:36:48.000Z
|
2016-02-05T07:43:19.000Z
|
com.ibm.team.rtc.extensions.workitem.copy/src/com/ibm/team/rtc/extensions/workitem/copy/internal/WorkItemsResolver.java
|
sandy081/Copy-Work-Items
|
042f3cc31757b59966dcadb81ad9ee040f835813
|
[
"MIT"
] | 3
|
2016-02-05T09:10:47.000Z
|
2017-09-17T17:58:39.000Z
|
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Sandeep Somavarapu
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.ibm.team.rtc.extensions.workitem.copy.internal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.workitem.common.model.IWorkItem;
import com.ibm.team.workitem.common.model.IWorkItemHandle;
import com.ibm.team.workitem.common.model.ItemProfile;
import com.ibm.team.workitem.common.query.IQueryDescriptor;
import com.ibm.team.workitem.common.query.IQueryResult;
import com.ibm.team.workitem.common.query.IResult;
public class WorkItemsResolver {
public interface IWorkItems {
public boolean hasNext() throws TeamRepositoryException;
public Collection<IWorkItem> next() throws TeamRepositoryException;
}
public static final int BATCH_SIZE= 100;
private final IQueryDescriptor fQuery;
private final RepositoryContext fContext;
private final ItemProfile<IWorkItem> fProfile;
private int fTotalSize;
public WorkItemsResolver(EvaluationContext evaluationContext) {
fQuery= evaluationContext.queryDescriptor;
fContext= evaluationContext.sourceContext;
fProfile= evaluationContext.configuration.copyAttachments || evaluationContext.configuration.copyLinks ? IWorkItem.FULL_PROFILE : ItemProfile.<IWorkItem> createFullProfile(IWorkItem.ITEM_TYPE);
}
public IWorkItems resolve(IProgressMonitor monitor) throws TeamRepositoryException {
IQueryResult<IResult> results= fContext.queryClient.getQueryResults(fQuery);
results.setLimit(Integer.MAX_VALUE);
results.setPageSize(BATCH_SIZE);
fTotalSize= results.getResultSize(monitor).getTotal();
return new WorkItemsIterator(results, monitor);
}
public int getTotalResultsSize() {
return fTotalSize;
}
private class WorkItemsIterator implements IWorkItems {
private final IQueryResult<IResult> fResults;
private final IProgressMonitor fMonitor;
private List<IWorkItem> fNext;
private WorkItemsIterator(IQueryResult<IResult> results, IProgressMonitor monitor) throws TeamRepositoryException {
fResults= results;
fMonitor= monitor;
fMonitor.beginTask("Fetching Work Items", 10);
fetchNextPage();
}
public boolean hasNext() throws TeamRepositoryException {
return fNext != null;
}
public Collection<IWorkItem> next() throws TeamRepositoryException {
Collection<IWorkItem> result= fNext;
fetchNextPage();
return result;
}
private void fetchNextPage() throws TeamRepositoryException {
if (!fResults.hasNext(fMonitor)) {
fMonitor.done();
fNext= null;
return;
}
List<IResult> page= fResults.nextPage(fMonitor);
List<IWorkItemHandle> handles= new ArrayList<IWorkItemHandle>();
for (IResult result : page) {
handles.add((IWorkItemHandle)result.getItem());
}
fNext= fContext.auditableClient.resolveAuditables(handles, IWorkItem.FULL_PROFILE, fMonitor);
fContext.workingCopyManager.connect(fNext, fProfile, fMonitor);
}
}
}
| 35.213675
| 195
| 0.780825
|
38b4f3b3fa424ed566a07f2759dcb4c9a371c105
| 1,644
|
php
|
PHP
|
app/Http/Controllers/QuestionnaireController.php
|
MarkLester10/Survey-Web-Application
|
6bf4abf80af02cd34e09355c8866c09cf31698b5
|
[
"MIT"
] | null | null | null |
app/Http/Controllers/QuestionnaireController.php
|
MarkLester10/Survey-Web-Application
|
6bf4abf80af02cd34e09355c8866c09cf31698b5
|
[
"MIT"
] | 1
|
2022-02-19T00:10:34.000Z
|
2022-02-19T00:10:34.000Z
|
app/Http/Controllers/QuestionnaireController.php
|
MarkLester10/Survey-Web-Application
|
6bf4abf80af02cd34e09355c8866c09cf31698b5
|
[
"MIT"
] | null | null | null |
<?php
namespace App\Http\Controllers;
use App\Questionnaire;
class QuestionnaireController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function create()
{
return view('questionnaire.create');
}
public function store()
{
$questionnaire = auth()->user()->questionnaires()->create($this->validatedData());
return view('questionnaire.show', compact('questionnaire'));
}
public function show(Questionnaire $questionnaire)
{
$questionnaire->load('questions.answers.responses'); //lazy loading
return view('questionnaire.show', compact('questionnaire'));
}
public function destroy(Questionnaire $questionnaire)
{
$questionnaire->questions()->delete();
$questionnaire->surveys()->delete();
$questionnaire->responses()->delete();
$questionnaire->delete();
return redirect('/home')->with('success', 'Questionnaire Deleted Successfully.');
}
public function edit(Questionnaire $questionnaire)
{
$questionnaire->load('questions.answers.responses');
return view('questionnaire.edit', compact('questionnaire'));
}
public function update(Questionnaire $questionnaire)
{
$questionnaire->update($this->validatedData());
return redirect('/home')->with('success', 'Questionnaire Updated Successfully');
}
protected function validatedData()
{
return request()->validate([
'title' => 'required|min:5',
'purpose' => 'required|max:50',
]);
}
}
| 25.6875
| 90
| 0.624696
|
5af381e1ff1d8f4814e492a93f72912322c02a88
| 1,279
|
cs
|
C#
|
System/compmod/system/componentmodel/RunWorkerCompletedEventArgs.cs
|
cnork/referencesource
|
d4b0506aea0b2ad7dc81864a8fd0a486ae800d25
|
[
"MIT"
] | 911
|
2019-05-07T03:19:15.000Z
|
2022-03-30T16:02:56.000Z
|
System/compmod/system/componentmodel/RunWorkerCompletedEventArgs.cs
|
cnork/referencesource
|
d4b0506aea0b2ad7dc81864a8fd0a486ae800d25
|
[
"MIT"
] | 63
|
2019-05-09T09:51:57.000Z
|
2022-03-27T06:57:52.000Z
|
System/compmod/system/componentmodel/RunWorkerCompletedEventArgs.cs
|
cnork/referencesource
|
d4b0506aea0b2ad7dc81864a8fd0a486ae800d25
|
[
"MIT"
] | 665
|
2019-05-07T08:29:23.000Z
|
2022-03-31T12:53:12.000Z
|
//------------------------------------------------------------------------------
// <copyright file="RunWorkerCompletedEventArgs.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.ComponentModel
{
using System.Security.Permissions;
[HostProtection(SharedState = true)]
public class RunWorkerCompletedEventArgs : AsyncCompletedEventArgs
{
private object result;
public RunWorkerCompletedEventArgs(object result,
Exception error,
bool cancelled)
: base(error, cancelled, null)
{
this.result = result;
}
public object Result
{
get
{
base.RaiseExceptionIfNecessary();
return result;
}
}
// Hide from editor, since never used.
[ Browsable(false), EditorBrowsable(EditorBrowsableState.Never) ]
public new object UserState
{
get
{
return base.UserState;
}
}
}
}
| 28.422222
| 80
| 0.455043
|
b933d16b8c069d4ed658dbb55b8fc502f20168a7
| 43,369
|
css
|
CSS
|
web/assets/template2/css/main.css
|
amelhamoudi/CrtStage
|
1bc15c19363a7a11f46a8807746de2b2d6fd8734
|
[
"MIT"
] | null | null | null |
web/assets/template2/css/main.css
|
amelhamoudi/CrtStage
|
1bc15c19363a7a11f46a8807746de2b2d6fd8734
|
[
"MIT"
] | null | null | null |
web/assets/template2/css/main.css
|
amelhamoudi/CrtStage
|
1bc15c19363a7a11f46a8807746de2b2d6fd8734
|
[
"MIT"
] | null | null | null |
/* ==========================================================================
1. IMPORT GOOGLE FONTS
========================================================================== */
@import url("https://fonts.googleapis.com/css?family=Montserrat:500,700|Open+Sans");
/* ==========================================================================
2. GENERAL
========================================================================== */
body {
font-family: 'Open Sans', sans-serif;
color: #546E7A;
font-size: 14px;
font-weight: 400;
background: #fff;
overflow-x: hidden;
}
#videoIntro{
background: url(../img/crt.jpg) ;
}
html {
overflow-x: hidden;
}
p {
font-size: 14px;
color: #546E7A;
line-height: 26px;
font-family: 'Open Sans', sans-serif;
margin-bottom: 0;
}
a:hover, a:focus {
color: #ea0e0e;
}
a {
color: #ea0e0e;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
h1, h2, h3, h4, h5 {
font-family: 'Montserrat', sans-serif;
font-size: 40px;
font-weight: 700;
color: #263238;
}
ul {
margin: 0;
padding: 0;
}
ul li {
list-style: none;
}
a:hover,
a:focus {
text-decoration: none;
outline: none;
}
a:not([href]):not([tabindex]) {
color: #fff;
}
a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover {
color: #fff;
}
.bg-transparent {
background: transparent !important;
}
.bg-defult {
background: #ea0e0e !important;
}
/* ==========================================================================
2.1 Section Title
========================================================================== */
.section {
padding: 80px 0;
}
.section-header {
color: #fff;
margin-bottom: 40px;
text-align: center;
position: relative;
}
.section-header .section-title {
font-size: 36px;
margin-bottom: 20px;
text-transform: uppercase;
font-family: 'Montserrat', sans-serif;
font-weight: 700;
color: #263238;
position: relative;
}
.section-header .section-title:before {
content: '';
position: absolute;
bottom: -8px;
width: 80px;
height: 2px;
background: #ea0e0e;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
transition: 0.3s;
}
.section-header span {
font-size: 60px;
color: rgba(0, 0, 0, 0.07);
z-index: 2;
font-family: 'Montserrat', sans-serif;
font-weight: 500;
text-transform: capitalize;
position: absolute;
top: 7px;
left: 0;
width: 100%;
}
/* ==========================================================================
2.2 Buttons
========================================================================== */
.btn {
font-size: 14px;
padding: 10px 30px;
border-radius: 30px;
font-weight: 400;
color: #fff;
text-transform: uppercase;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
display: inline-block;
}
.btn:focus,
.btn:active {
box-shadow: none;
outline: none;
color: #fff;
}
.btn-common {
background-color: #ea0e0e;
position: relative;
z-index: 1;
padding: 12px 32px;
border-radius: 30px;
}
.btn-common:hover {
color: #fff;
}
.btn-effect {
overflow: hidden;
}
.btn-effect:after {
content: '';
position: absolute;
width: 0;
height: 100%;
z-index: 1;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.1);
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
}
.btn-effect:hover:after {
width: 100%;
}
.btn-border {
border-style: solid;
border-width: 2px;
cursor: pointer;
background-color: transparent;
border-color: #fff;
color: #fff;
}
.btn-border:hover {
color: #ffffff;
background-color:#ea0e0e;
}
.btn-lg {
padding: 14px 33px;
text-transform: uppercase;
font-size: 16px;
}
.btn-rm {
padding: 7px 10px;
text-transform: capitalize;
}
button:focus {
outline: none !important;
}
.clear {
clear: both;
}
/* ==========================================================================
2.3 Social Iocns
========================================================================== */
.social-icons {
margin-bottom: 20px;
}
.social-icons ul {
margin: 0;
padding: 0;
list-style: none;
}
.social-icons ul li {
display: inline;
}
.social-icons ul li a {
display: inline-block;
margin-left: 5px;
margin-right: 5px;
margin-bottom: 15px;
border-radius: 4px;
border: 1px solid rgba(255, 254, 254, 0.07);
line-height: 40px;
width: 40px;
height: 40px;
text-align: center;
font-size: 16px;
}
.social-icons ul li a:hover {
color: #fff;
}
.facebook a {
color: #4867AA;
}
.facebook a:hover {
background: #4867AA;
}
.twitter a {
color: #1DA1F2;
}
.twitter a:hover {
background: #1DA1F2;
}
.google-plus a {
color: #ea0e0e;
}
.google-plus a:hover {
background: #ea0e0e;
}
.youtube a {
color: #ea0e0e;
}
.youtube a:hover {
background: #ea0e0e;
}
.linkedin a {
color: #007BB6;
}
.linkedin a:hover {
background: #007BB6;
}
.pinterest a {
color: #ea0e0e;
}
.pinterest a:hover {
background: #ea0e0e;
}
.dribbble a {
color: #ea0e0e;
}
.dribbble a:hover {
background: #ea0e0e;
}
.behance a {
color: #0B7CFF;
}
.behance a:hover {
background: #0B7CFF;
}
/* ==========================================================================
2.4 Pre Loader
========================================================================== */
#loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #263238;
z-index: 9999999999;
}
.spinner {
width: 40px;
height: 40px;
top: 45%;
position: relative;
margin: 0px auto;
}
.double-bounce1, .double-bounce2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #ea0e0e;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: sk-bounce 2.0s infinite ease-in-out;
animation: sk-bounce 2.0s infinite ease-in-out;
}
.double-bounce2 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
@-webkit-keyframes sk-bounce {
0%, 100% {
-webkit-transform: scale(0);
}
50% {
-webkit-transform: scale(1);
}
}
@keyframes sk-bounce {
0%, 100% {
transform: scale(0);
-webkit-transform: scale(0);
}
50% {
transform: scale(1);
-webkit-transform: scale(1);
}
}
/* ==========================================================================
-2.5 Scroll To Up
========================================================================== */
.back-to-top {
display: none;
position: fixed;
bottom: 18px;
right: 15px;
}
.back-to-top i {
display: block;
width: 36px;
height: 36px;
line-height: 36px;
color: #fff;
font-size: 14px;
text-align: center;
border-radius: 30px;
background-color: #ea0e0e;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.overlay-2 {
background: rgba(0, 0, 0, 0.9) !important;
}
.overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: #ea0e0e;
opacity: 0.5;
filter: alpha(opacity=80);
}
/* ==========================================================================
Navbar Style
========================================================================== */
.bg-faded {
background-color: #fff;
}
.mainmenu-area {
padding: 10px 0;
border: none;
margin: 0;
-webkit-transition: 0.6s;
-moz-transition: 0.6s;
transition: 0.6s;
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
background-color: #ffffff;
}
.mainmenu-area .menu-button {
position: relative;
color: #263238;
line-height: 58px;
top: 0;
outline: none;
}
.logo-menu a {
font-size: 20px;
color: #fff;
}
.menu-bg {
background-color: #fff !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.16), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
z-index: 999;
padding: 3px;
}
.menu-bg .menu-button {
top: 0;
}
.menu-bg .menu-button:hover {
cursor: pointer;
color: #ea0e0e;
}
.menu-bg .logo-menu a {
color: #ea0e0e;
}
.menu-bg .navbar-nav .nav-link {
color: #263238 !important;
}
.menu-bg .navbar-nav .nav-link:hover {
color: #ea0e0e !important;
}
.menu-bg .navbar-nav .active {
color: #ea0e0e !important;
}
.menu-button:hover {
cursor: pointer;
opacity: initial;
}
.bg-white {
background-color: #fff !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.16), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
z-index: 999;
padding: 5px;
}
.bg-white .menu-button {
top: 0;
}
.bg-white .menu-button:hover {
cursor: pointer;
color: #ea0e0e;
}
.bg-white .logo-menu a {
color: #ea0e0e;
}
.bg-white .navbar-nav .nav-link {
color: #263238 !important;
}
.bg-white .navbar-nav .nav-link:hover {
color: #ea0e0e !important;
}
.bg-white .navbar-nav .active {
color: #ea0e0e!important;
}
.close-button {
cursor: pointer;
}
.navbar-expand-md .navbar-nav .nav-link {
color: #fff;
font-size: 14px;
padding: 5px 0px;
margin-left: 30px;
position: relative;
}
.navbar-expand-md .navbar-nav .nav-link:before {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background: #ea0e0e;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
transition: 0.3s;
}
.navbar-expand-md .navbar-nav .active::before,
.navbar-expand-md .navbar-nav .nav-link:hover::before {
width: 50%;
}
.navbar-brand img {
max-width: 115px;
}
.navbar-expand-md .navbar-nav .nav-link:focus,
.navbar-expand-md .navbar-nav .nav-link:hover,
.navbar-expand-md .navbar-nav .nav-link:hover:before {
color: #ea0e0e;
}
.navbar-expand-md .navbar-nav .active > .nav-link,
.navbar-expand-md .navbar-nav .nav-link.active,
.navbar-expand-md .navbar-nav .nav-link.active:before,
.navbar-expand-md .navbar-nav .nav-link.open,
.navbar-expand-md .navbar-nav .open > .nav-link {
color:#ea0e0e ;
}
.navbar-expand-md .navbar-toggler {
background: #ea0e0e;
border-radius: 0px;
margin: 5px;
cursor: pointer;
float: right;
}
.navbar-expand-md .navbar-toggler i {
color: #fff !important;
}
.mainmenu-area .navbar-nav .nav-link {
color: #263238 !important;
}
.collapse.show {
background: #3e3a3a;
margin-bottom: 10px;
-webkit-transition: 0.6s;
-moz-transition: 0.6s;
transition: 0.6s;
}
.menu-bg .collapse.show {
background: #fff;
margin-bottom: 10px;
-webkit-transition: 0.6s;
-moz-transition: 0.6s;
transition: 0.6s;
}
.navbar-expand-md .navbar-toggler:active {
border: 1px solid #ea0e0e;
color: #ea0e0e;
}
/* ==========================================================================
Hero Area
========================================================================== */
.hero-area {
background: url(../img/hero-area.jpg) no-repeat;
background-size: cover;
color: #fff;
overflow: hidden;
position: relative;
}
.hero-area .overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: #ea0e0e;
opacity: 0.7;
}
.hero-area .contents {
padding: 160px 0 140px;
}
.hero-area .contents h2 {
color: #fff;
font-size: 52px;
font-weight: 300;
margin-bottom: 25px;
}
.hero-area .contents h4 {
font-size: 16px;
color: #fff;
font-weight: 300;
line-height: 30px;
margin-bottom: 20px;
}
.hero-area .contents p {
color: #fff;
font-size: 14px;
line-height: 26px;
}
.hero-area .contents .btn {
margin-top: 40px;
text-transform: uppercase;
}
.hero-area .banner_bottom_btn {
margin-top: 40px;
}
.hero-area .banner_bottom_btn i {
color: #fff;
font-size: 48px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.hero-area .banner_bottom_btn i:hover {
color: #ea0e0e;
}
.intro-img {
padding: 148px 0 0px;
}
.intro-img img {
display: block;
height: auto;
max-width: 100%;
}
/* ==========================================================================
Hero Production version
========================================================================== */
.hero-area-2 {
background: url(../img/bg/hero-area-2.jpg) fixed no-repeat;
background-size: cover;
color: #fff;
overflow: hidden;
position: relative;
}
.hero-area-2 .overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background: rgba(0, 0, 0, 0.8);
opacity: 0.8;
}
.hero-area-2 .contents {
padding: 160px 0 140px;
}
.hero-area-2 .contents h3 {
color: #fff;
font-size: 48px;
font-weight: 500;
}
.hero-area-2 .contents h2 {
color: #fff;
font-size: 42px;
margin-bottom: 30px;
font-weight: 700;
}
.hero-area-2 .contents h4 {
font-size: 18px;
color: #fff;
font-weight: 400;
line-height: 30px;
letter-spacing: 0.5px;
margin-bottom: 20px;
}
.hero-area-2 .contents p {
font-size: 14px;
color: #fff;
line-height: 26px;
}
.hero-area-2 .contents .header-button {
margin-top: 30px;
}
.hero-area-2 .contents .btn {
margin: 10px;
text-transform: uppercase;
}
.hero-area-2 .contents .tag-type ul {
position: relative;
}
.hero-area-2 .contents .tag-type ul li {
display: inline-block;
padding: 10px;
position: relative;
}
.hero-area-2 .contents .tag-type ul li a {
color: #fff;
text-transform: uppercase;
}
.hero-area-2 .contents .tag-type ul li:before {
content: '';
width: 4px;
height: 4px;
background: #fff;
position: absolute;
top: 19px;
right: -5px;
border-radius: 50%;
}
.hero-area-2 .contents .tag-type ul li:before:last-child {
display: none;
}
.hero-area-2 .contents .tag-type ul li:last-child:before {
background: transparent;
}
.hero-area-2 .contents .tag-type ul:before {
content: '';
width: 40px;
height: 1px;
background: #f1f1f1;
position: absolute;
top: 20px;
margin-left: -45px;
}
.hero-area-2 .contents .tag-type ul:after {
content: '';
width: 40px;
height: 1px;
background: #f1f1f1;
position: absolute;
top: 20px;
margin-left: 6px;
}
.hero-area-2 .contents .arrow-down-icon {
border: 2px solid #fff;
width: 42px;
height: 42px;
line-height: 42px;
margin: 30px auto;
border-radius: 50%;
font-size: 18px;
}
.hero-area-2 .contents .arrow-down-icon a {
color: #fff;
}
/* ==========================================================================
Video Background
========================================================================== */
#video-area {
overflow: hidden;
position: relative;
}
#video-area .contents {
padding: 160px 0 80px;
}
#video-area .contents h1 {
color: #fff;
font-size: 50px;
font-weight: 300;
margin-bottom: 25px;
line-height: 70px;
}
#video-area .contents p {
font-size: 14px;
color: #fff;
font-weight: 400;
line-height: 30px;
letter-spacing: 0.5px;
}
#video-area .contents .btn {
margin: 20px 10px;
text-transform: uppercase;
}
#video-area .banner_bottom_btn {
margin-top: 40px;
}
#video-area .banner_bottom_btn i {
color: #fff;
font-size: 48px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#video-area .banner_bottom_btn i:hover {
color: #ea0e0e;
}
/* ==========================================================================
About Section Style
========================================================================== */
#about {
position: relative;
background: #f9f9f9;
}
#about .box-item {
padding: 15px 0;
}
#about .box-item .icon {
float: left;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#about .box-item .icon i {
color: #ea0e0e;
display: inline-block;
font-size: 36px;
margin-bottom: 20px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#about .box-item .text {
margin-left: 64px;
}
#about .box-item .text h4 {
font-weight: 500;
font-size: 18px;
line-height: 22px;
}
#about .box-item .text p {
font-size: 14px;
line-height: 26px;
}
#about .show-box {
margin: 30px 40px;
}
/* ==========================================================================
About Area
========================================================================== */
#about-area .about-thumb {
position: relative;
z-index: 1;
margin-left: 80px;
margin-top: 60px;
}
#about-area .about-thumb img {
width: 100%;
height: auto;
}
#about-area .about-thumb-2 {
position: absolute;
z-index: 5;
left: 5%;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
/* ==========================================================================
Clients
========================================================================== */
#clients {
background: #f9f9f9;
}
#clients .client-item-wrapper {
text-align: center;
margin: 0 5px;
-moz-transition: all .6s ease;
-webkit-transition: all .6s ease;
transition: all .6s ease;
}
#clients #clients-scroller img:hover {
-moz-transition: all .6s ease;
-webkit-transition: all .6s ease;
transition: all .6s ease;
opacity: 1.0;
}
#clients #clients-scroller .owl-pagination {
display: none;
}
/* ==========================================================================
call to action
========================================================================== */
#cta {
background: url(../img/bg/bg-cta.jpg) fixed;
background-size: cover;
}
#cta h5 {
color: #fff;
font-size: 32px;
font-weight: 500;
line-height: 48px;
}
#cta .btn {
margin: 30px 10px;
}
.call-action {
background: #f9f9f9;
}
.call-action .cta-trial h3 {
font-size: 28px;
font-weight: 500;
margin-bottom: 28px;
letter-spacing: 1px;
}
.call-action .cta-trial p {
margin-bottom: 30px;
}
/* ==========================================================================
Video promo Style
========================================================================== */
.video-promo {
background: url(../img/bg/video.jpg);
position: relative;
}
.video-promo .video-promo-content {
color: #fff;
}
.video-promo .video-promo-content .video-popup {
width: 80px;
height: 80px;
line-height: 80px;
text-align: center;
border: 3px solid #fff;
color: #fff;
border-radius: 50%;
display: inline-block;
font-size: 26px;
}
.video-promo .video-promo-content h2 {
margin-top: 30px;
color: #fff;
font-size: 30px;
text-transform: uppercase;
}
.video-promo .video-promo-content p {
color: #fff;
}
/* ==========================================================================
Portfolio Section
========================================================================== */
#portfolios {
background: #f9f9f9;
}
#portfolios .mix {
padding: 0px;
}
#portfolios .portfolio-item {
padding: 10px;
}
#portfolio .mix {
display: none;
}
.controls {
text-align: center;
padding: 0px 0px 20px;
}
.controls .active {
color: #ea0e0e !important;
border-color:#ea0e0e;
background: transparent;
}
.controls .btn {
text-transform: uppercase;
margin: 2px;
}
.controls:hover {
color: #fff;
cursor: pointer;
}
.shot-item {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
}
.shot-item img {
width: 100%;
height: 300px;
-webkit-transition-duration: 4000ms;
-o-transition-duration: 4000ms;
transition-duration: 4000ms;
}
.shot-item .single-content {
background-color: rgba(22, 26, 39, 0.7);
opacity: 0.90;
height: 100%;
left: 0;
opacity: 0;
position: absolute;
top: 0;
-webkit-transition-duration: 500ms;
-o-transition-duration: 500ms;
transition-duration: 500ms;
width: 100%;
}
.shot-item .single-content .fancy-table {
display: table;
height: 100%;
left: 0;
position: relative;
top: 0;
width: 100%;
z-index: 2;
}
.shot-item .single-content .fancy-table .table-cell {
display: table-cell;
vertical-align: middle;
text-align: center;
}
.shot-item .single-content .zoom-icon a {
color: #fff;
font-size: 30px;
margin-bottom: 15px;
}
.shot-item .single-content a {
color: #fff;
font-size: 16px;
}
.shot-item:hover img {
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
.shot-item:hover .single-content {
opacity: 0.8;
}
/* Services Item */
.item-boxes {
padding: 30px;
border-radius: 4px;
border: 1px solid #eaeaea;
margin: 15px 0;
webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.item-boxes .icon {
margin-bottom: 10px;
}
.item-boxes .icon i {
font-size: 30px;
line-height: 60px;
color: #ea0e0e;
}
.item-boxes h4 {
font-size: 18px;
font-weight: 500;
margin-bottom: 15px;
}
.item-boxes p {
margin: 0;
}
.item-boxes:hover {
background: transparent;
box-shadow: 0px 10px 50px 0px rgba(84, 110, 122, 0.35);
}
.services-item {
padding: 30px 15px;
background: #fff;
border-radius: 4px;
text-align: center;
margin-bottom: 30px;
position: relative;
transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
}
.services-item .icon {
margin-bottom: 20px;
}
.services-item .icon i {
width: 60px;
height: 60px;
background: #f9f9f9;
display: inline-block;
line-height: 60px;
font-size: 24px;
text-align: center;
border-radius: 50%;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
}
.services-item .color-1 i {
background: #FAE3E3;
color: #ea0e0e !important;
}
.services-item .color-2 i {
background: #E6F8ED;
color: #57D283 !important;
}
.services-item .color-3 i {
background: #E3EAFA;
color: #457BF4 !important;
}
.services-item .color-4 i {
background: #F3EAD6;
color: #ea0e0e; !important;
}
.services-item .color-5 i {
background: #E7E6FF;
color: #7271FF !important;
}
.services-item .color-6 i {
background: #DEDEDE;
color: #35393D !important;
}
.services-item .services-content {
padding-left: 65px;
}
.services-item .services-content h3 {
margin-bottom: 10px;
font-size: 18px;
font-weight: 500;
}
.services-item .services-content h3 a {
color: #272727;
}
.services-item .services-content h3 a:hover {
color: #ea0e0e;
}
.services-item:hover {
box-shadow: 0px 10px 50px 0px rgba(84, 110, 122, 0.35);
}
.services-item:hover .icon i {
background: transparent;
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
}
.featured-bg {
background: #fafafa;
}
.featured-bg .intro-title {
font-size: 18px;
font-weight: 500;
margin-bottom: 15px;
}
.featured-bg .title-sub {
font-size: 22px;
margin-bottom: 15px;
line-height: 36px;
}
.featured-bg .intro-desc {
margin-bottom: 20px;
}
.featured-bg .featured-item {
margin-bottom: 30px;
position: relative;
transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
}
.featured-bg .featured-item .icon {
float: left;
padding-right: 15px;
}
.featured-bg .featured-item .icon i {
font-size: 32px;
text-align: center;
margin-bottom: 30px;
color: #ea0e0e;
transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
}
.featured-bg .featured-item h3 {
margin-bottom: 15px;
font-size: 18px;
font-weight: 500;
line-height: 36px;
}
.featured-bg .featured-item h3 a {
color: #272727;
}
.featured-bg .featured-item h3 a:hover {
color: #ea0e0e;
}
/* ==========================================================================
Featured Section Start
========================================================================== */
.featured-box {
margin-top: 15px;
margin-bottom: 15px;
}
.featured-box .featured-icon {
float: left;
}
.featured-box .featured-icon i {
font-size: 30px;
color: #ea0e0e;
text-align: center;
float: left;
margin-right: 25px;
margin-bottom: 85px;
display: block;
}
.featured-box .featured-content {
padding-left: 40px;
position: relative;
}
.featured-box .featured-content .icon-o {
font-size: 86px;
color: rgba(0, 0, 0, 0.07);
z-index: 2;
font-weight: 400;
text-transform: capitalize;
position: absolute;
top: 0px;
left: 50px;
width: 100%;
}
.featured-box .featured-content h4 {
font-size: 18px;
font-weight: 500;
margin-bottom: 10px;
transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-webkit-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
}
.featured-box .featured-content p {
font-size: 14px;
}
/* ==========================================================================
Team Section
========================================================================== */
.single-team:hover .team-details {
opacity: 1;
}
.single-team {
position: relative;
background: #f9f9f9;
border-radius: 4px;
-webkit-transition: 0.5s;
transition: 0.5s;
box-shadow: 0px 10px 50px 0px rgba(84, 110, 122, 0.15);
border-radius: 0px;
overflow: hidden;
}
.single-team:hover {
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
box-shadow: 0px 10px 50px 0px rgba(84, 110, 122, 0.35);
}
.single-team img {
width: 100%;
}
.single-team .team-inner {
-webkit-transition: 0.5s;
transition: 0.5s;
}
.single-team .team-details {
padding: 20px;
width: 100%;
text-align: center;
-webkit-transition: 0.5s;
-moz-transition: 0.5s;
transition: 0.5s;
}
.single-team .team-details .team-title {
margin-bottom: 5px;
font-size: 18px;
font-weight: 500;
color: #263238;
}
.single-team .team-details p {
margin-bottom: 15px;
}
.single-team .social-list li {
display: inline-block;
}
.single-team .social-list li a {
display: block;
height: 34px;
line-height: 34px;
text-align: center;
width: 34px;
color: #ea0e0e;
font-size: 14px;
background: #fff;
border-radius: 50px;
-webkit-transition: 0.5s;
-moz-transition: 0.5s;
transition: 0.5s;
}
.single-team .social-list .facebook a:hover {
background: #4867aa;
color: #fff;
}
.single-team .social-list .twitter a:hover {
background: #1da1f2;
color: #fff;
}
.single-team .social-list .google-plus a:hover {
background: #ea0e0e;
color: #fff;
}
.single-team .social-list .linkedin a:hover {
background: #007bb6;
color: #fff;
}
.testimonial {
background: #f9f9f9;
}
.testimonial-item {
padding: 30px;
margin: 15px;
background: #fff;
border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.06);
}
.testimonial-item .author {
display: inline-block;
margin-bottom: 20px;
}
.testimonial-item .author .img-thumb {
float: left;
overflow: hidden;
position: relative;
}
.testimonial-item .author .img-thumb img {
border-radius: 50%;
width: 75%;
}
.testimonial-item .author .author-info {
float: left;
padding: 3px 0;
}
.testimonial-item .author .author-info h2 {
font-size: 18px;
font-weight: 500;
line-height: 30px;
margin-bottom: 0;
}
.testimonial-item .author .author-info h2 a {
color: #484848;
}
.testimonial-item .author .author-info h2 a:hover {
color: #ea0e0e;
}
.testimonial-item .content-inner {
overflow: hidden;
}
.testimonial-item .content-inner .description {
width: 100%;
margin-bottom: 10px;
}
.testimonial-item .content-inner span {
color: #ea0e0e;
}
.owl-pagination {
position: absolute;
width: 100%;
left: 0;
bottom: -40px;
}
.owl-theme .owl-controls .owl-page {
display: inline-block;
zoom: 1;
*display: inline;
}
.owl-theme .owl-controls .owl-page span {
display: block;
width: 12px;
height: 12px;
margin: 2px 4px;
filter: alpha(opacity=50);
opacity: 1;
border-radius: 30px;
background: #fff;
border: 2px solid #fff;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2);
transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-webkit-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
}
.owl-theme .owl-controls .owl-page.active span, .owl-theme .owl-controls.clickable .owl-page:hover span {
background: #ea0e0e;
}
/* ==========================================================================
Pricing Table
========================================================================== */
.pricing-table {
padding: 20px 0px 0px;
margin: 0 auto;
margin-bottom: 5px;
border: 1px solid #eaeaea;
text-align: center;
border-radius: 4px;
background-color: #FFFFFF;
box-shadow: 0px 10px 50px 0px rgba(84, 110, 122, 0.15);
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
margin-top: 30px;
}
.pricing-table:hover {
box-shadow: 0px 10px 50px 0px rgba(84, 110, 122, 0.35);
}
.pricing-table .pricing-details h2 {
font-size: 18px;
color: #546E7A;
font-weight: 500;
padding-top: 15px;
padding-bottom: 15px;
}
.pricing-table .pricing-details .price {
color: #263238;
font-size: 36px;
line-height: 40px;
font-weight: 500;
letter-spacing: -1px;
background-color: #fff !important;
border-bottom: 1px solid #e9edf2;
padding-bottom: 40px;
}
.pricing-table .pricing-details .price span {
font-size: 12px;
line-height: 15px;
font-weight: 400;
color: #A2A2A2;
}
.pricing-table .pricing-details ul li {
padding: 12px;
font-size: 14px;
}
.pricing-table .pricing-details ul li:nth-child(even) {
background-color: #f9f9f9;
}
.pricing-table .plan-button {
padding: 30px 0;
background: #f9f9f9;
}
.pricing-big {
-webkit-transform: scale3d(1.1, 1.1, 1.1);
-moz-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
/* ==========================================================================
Slider
========================================================================== */
#carousel-area {
overflow: hidden;
background: #2c3e50;
}
#carousel-area .carousel-item {
background-size: 100%;
}
#carousel-area .carousel-item .carousel-caption {
top: 32%;
right: 10%;
left: 12%;
text-shadow: none;
padding-top: 0;
padding-bottom: 0;
}
#carousel-area .carousel-item .carousel-caption h3 {
color: #fff;
font-weight: 500;
font-size: 26px;
line-height: 38px;
}
#carousel-area .carousel-item .carousel-caption h2 {
font-size: 80px;
font-weight: 700;
color: #fff;
}
#carousel-area .carousel-item .carousel-caption h4 {
color: #ffffff;
font-size: 18px;
font-weight: 500;
margin-bottom: 30px;
}
#carousel-area .carousel-control {
display: none;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#carousel-area:hover .carousel-control {
display: block;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation-name: fadeIn;
animation-name: fadeIn;
}
#carousel-area .carousel-control-next, #carousel-area .carousel-control-prev {
opacity: 1;
}
#carousel-area .carousel-control-next i, #carousel-area .carousel-control-prev i {
width: 48px;
line-height: 48px;
height: 48px;
color: #fff;
font-size: 24px;
display: inline-block;
background: #ea0e0e;
border-radius: 30px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
}
#carousel-area .carousel-control-next i:hover, #carousel-area .carousel-control-prev i:hover {
opacity: 0.9;
}
#carousel-area .carousel-indicators li:hover,
#carousel-area .carousel-indicators li.active {
opacity: 1;
}
#carousel-area .carousel-indicators {
bottom: 35px;
}
#carousel-area .carousel-indicators li {
width: 30px;
height: 7px;
border-radius: 4px;
}
#slider-area {
margin-top: -1px;
}
#slider-area .btn {
margin-right: 15px;
}
#slider-area .large_white {
color: #fff;
}
#slider-area .about-info p {
color: #333;
}
.contents p {
font-size: 16px;
font-weight: 400;
line-height: 50px;
}
.contents .header-button .btn i {
margin-left: 10px;
}
/* ==========================================================================
Blog
========================================================================== */
#blog .blog-item-wrapper {
background: #fff;
border-radius: 4px;
box-shadow: 0px 10px 50px 0px rgba(84, 110, 122, 0.15);
-webkit-transition: transform 0.2s linear, -webkit-box-shadow 0.2s linear;
-moz-transition: transform 0.2s linear, -moz-box-shadow 0.2s linear;
transition: transform 0.2s linear, box-shadow 0.2s linear;
}
#blog .blog-item-wrapper:hover {
box-shadow: 0px 10px 50px 0px rgba(84, 110, 122, 0.35);
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
#blog .blog-item-wrapper:hover .blog-item-img:before {
opacity: 1;
}
#blog .blog-item-img {
position: relative;
}
#blog .blog-item-img img {
width: 100%;
border-radius: 4px;
}
#blog .blog-item-text {
padding: 20px 30px;
}
#blog .blog-item-text .date {
font-size: 14px;
margin-bottom: 10px;
}
#blog .blog-item-text .date i {
margin-right: 7px;
}
#blog .blog-item-text h3 {
line-height: 26px;
font-size: 18px;
font-weight: 500;
margin-bottom: 10px;
}
#blog .blog-item-text h3 a {
color: #263238;
}
#blog .blog-item-text h3 a:hover {
color: #ea0e0e;
}
.meta-tags {
margin-bottom: 10px;
}
.meta-tags span {
color: #999;
font-size: 14px;
margin-right: 10px;
}
.meta-tags span i {
margin-right: 5px;
}
.meta-tags span a {
color: #999;
}
.meta-tags span a:hover {
color: #ea0e0e;
}
/* ==========================================================================
Single Page Style
========================================================================== */
#blog-single {
padding: 80px 0;
background: #ECF0F1;
}
#blog-single .blog-post {
background: #fff;
overflow: hidden;
margin-bottom: 40px;
}
#blog-single .blog-post .post-thumb img {
width: 100%;
}
#blog-single .blog-post .post-content {
padding: 30px;
}
#blog-single .blog-post .post-content h3 {
font-size: 30px;
padding-bottom: 10px;
}
.blog-comment {
background: #fff;
padding: 50px 30px;
margin-top: 30px;
overflow: hidden;
}
.blog-comment h4 {
font-size: 24px;
margin-bottom: 30px;
}
.blog-comment .comment-list {
list-style: none;
margin: 0;
padding: 0;
margin-bottom: 50px;
}
.blog-comment .comment-list .the-comment {
border-bottom: 1px solid #e7e6e6;
padding-bottom: 25px;
margin-bottom: 25px;
}
.blog-comment .comment-list .children {
padding-left: 40px;
}
.blog-comment .avatar {
float: left;
margin-right: 15px;
padding: 5px;
border-radius: 3px;
background: #ffffff;
border: 1px dashed #346AFE;
}
.blog-comment .comment-author {
margin-bottom: 10px;
}
.blog-comment .meta {
margin-bottom: 10px;
color: #999;
}
.post-meta {
color: #fff;
margin-top: 15px;
margin-bottom: 15px;
}
.post-meta ul li {
display: inline-block;
margin-right: 8px;
margin-left: 8px;
}
.post-meta ul li i {
margin-right: 5px;
}
.post-meta ul li a {
color: #fff;
}
.post-meta ul li a:hover {
color: #ea0e0e;
}
/* ==========================================================================
Contact Us
========================================================================== */
.form-control {
width: 100%;
margin-bottom: 20px;
padding: 15px 30px;
font-size: 14px;
border-radius: 30px;
border: 1px solid transparent;
background: #f5f5f5;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
}
.form-control:focus {
border: 1px solid #ea0e0e;
outline: none;
box-shadow: none;
}
.btn.disabled, .btn:disabled {
opacity: 1;
}
textarea {
border-radius: 4px !important;
}
.contact-info {
margin-bottom: 15px;
}
.contact-info i {
font-size: 20px;
color: #ea0e0e;
}
.contact-info h5 {
margin-top: 5px;
font-size: 18px;
font-weight: 500;
}
.contact-info p {
font-size: 14px;
margin-bottom: 0;
}
#contact {
background: #ffffff;
position: relative;
overflow: hidden;
}
#contact .contact-block {
overflow: hidden;
}
.text-danger {
font-size: 14px;
margin-top: 10px;
}
.list-unstyled li {
color: #ea0e0e;
}
/* Contact Map */
#conatiner-map {
width: 100%;
height: 480px;
}
#google-map-area {
position: relative;
}
#google-map-area .container-fluid {
padding-left: 0;
padding-right: 0;
}
.toggle-map {
height: 5px;
width: 100%;
background-color: #ea0e0e;
bottom: 0px;
text-align: center;
position: absolute;
z-index: 106;
}
.toggle-map .map-icon {
width: 50px;
height: 50px;
display: inline-block;
-moz-border-radius: 100%;
-webkit-border-radius: 100%;
border-radius: 100%;
background-color: #fff;
border: #ea0e0e 3px solid;
position: relative;
top: -46px;
}
.toggle-map .map-icon i {
width: 44px;
height: 44px;
display: inline-block;
line-height: 44px;
text-align: center;
font-size: 20px;
}
#google-map {
text-align: center;
background-color: #fff;
height: 465px;
position: absolute;
bottom: -460px;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
z-index: 101;
width: 100%;
border-top: #ea0e0e 3px solid;
}
#google-map.panel-show {
bottom: -20px !important;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
}
/* ==========================================================================
19. Subscribe Style
========================================================================== */
#subscribe {
background: url(../img/bg/bg-subs.jpg);
position: relative;
}
.subscribe-form .sub-title {
margin-bottom: 30px;
}
.subscribe-form .sub-title h3 {
font-size: 30px;
margin-bottom: 10px;
position: relative;
font-weight: 500;
}
.subscribe-form .form-wrapper {
background-color: #ffffff;
padding: 58px 40px;
border-radius: 4px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}
.subscribe-form .form-wrapper .form-group {
margin-bottom: 0px;
}
.subscribe-form .form-wrapper .form-control {
display: block;
width: 100%;
font-size: 14px;
box-shadow: none;
color: #848484;
text-transform: capitalize;
background: #f7f7f7;
border: 1px solid transparent;
padding: 15px 30px;
border-radius: 30px;
background-image: none;
background-clip: padding-box;
}
.subscribe-form .form-wrapper .form-control:focus {
color: #212121;
background-color: #fff;
border-color: #ea0e0e;
box-shadow: none;
outline: 0;
}
.subscribe-form .form-submit .btn {
width: 100%;
padding: 13px 30px;
}
#subscribe .sub-item-box {
padding: 30px;
margin-bottom: 30px;
border-radius: 4px;
background: #fff;
}
#subscribe .sub-item-box .icon-box {
float: left;
}
#subscribe .sub-item-box .icon-box i {
font-size: 30px;
color: #ea0e0e;
}
#subscribe .sub-item-box .text-box {
margin-left: 60px;
}
#subscribe .sub-item-box .text-box h4 {
font-size: 16px;
font-weight: 500;
}
#subscribe .sub-item-box .text-box p {
margin-bottom: 0;
}
#subscribe .sub-item-box:last-child {
margin-bottom: 0;
}
/* ==========================================================================
Footer Style
========================================================================== */
.block-title {
font-size: 14px;
font-weight: 500;
color: #263238;
margin-bottom: 30px;
text-transform: uppercase;
position: relative;
}
footer .footer-Content {
background-color: #ffffff;
padding: 60px 0;
color: #546E7A;
}
.textwidget {
font-size: 14px;
line-height: 24px;
margin-bottom: 10px;
}
.textwidget p {
color: #546E7A;
}
footer .menu {
padding-left: 0;
}
footer .menu li {
padding-bottom: 12px;
}
footer .menu li a {
color: #546E7A;
}
footer .menu li a:hover {
color: #ea0e0e;
}
.contact-footer {
margin: 0;
padding: 0;
display: inline-block;
}
.contact-footer li {
padding: 3px 0;
margin-bottom: 15px;
}
.contact-footer li strong {
float: left;
}
.contact-footer li span {
margin-left: 73px;
display: block;
}
.contact-footer li span a {
color: #546E7A;
}
.contact-footer li span a:hover {
color: #ea0e0e;
}
.instagram-footer {
padding: 0;
}
.instagram-footer li {
display: block;
width: 33%;
float: left;
padding: 0 5px 5px 0;
margin: 0;
}
.instagram-footer li a img {
width: 100%;
}
.footer-social li {
display: inline-block;
margin-right: 12px;
}
.footer-social li a {
background-color: #ea0e0e;
border-radius: 50%;
color: #fff;
height: 32px;
line-height: 32px;
text-align: center;
width: 32px;
display: inline-block;
-webkit-transition: all .4s ease-in-out;
-moz-transition: all .4s ease-in-out;
transition: all .4s ease-in-out;
}
.footer-social li .facebook:hover {
background-color: #3b5998;
}
.footer-social li .twitter:hover {
background-color: #55acee;
}
.footer-social li .linkedin:hover {
background-color: #007bb5;
}
.footer-social li .google-plus:hover {
background-color: #ea0e0e;
}
#copyright {
background-color: #ffffff;
padding: 20px 0 10px;
border-top: 1px solid #eaeaea;
color: #546E7A;
}
#copyright p {
margin-bottom: 0;
line-height: 40px;
}
#copyright p a {
color: #546E7A;
}
#copyright p a:hover {
color: #ea0e0e;
}
#copyright .nav-inline .nav-link {
color: #546E7A;
padding: 10px 0;
margin-left: 10px;
}
#copyright .nav-inline .nav-link:hover {
color: #ea0e0e;
}
/* ==========================================================================
Counter Section Style
========================================================================== */
.counters {
//background: url("") fixed;
position: relative;
}
.counters .facts-item {
text-align: center;
color: #fff;
border: 1px dotted #fff;
border-radius: 4px;
padding: 30px;
}
.counters .facts-item .icon {
margin-bottom: 15px;
}
.counters .facts-item .icon i {
font-size: 40px;
color: #fff;
}
.counters .facts-item .fact-count h3 {
font-size: 40px;
color: #fff;
font-weight: 400;
line-height: 40px;
}
.counters .facts-item .fact-count h4 {
font-size: 15px;
color: #fff;
margin-bottom: 0;
}
.counter-item {
text-align: center;
padding: 30px;
background: #f9f9f9;
border: 1px solid #eaeaea;
margin: 15px 0;
}
.counter-item .icon {
margin-bottom: 20px;
}
.counter-item .icon i {
font-size: 40px;
color: #ea0e0e;
}
.counter-item .fact-count h3 {
font-size: 50px;
font-weight: 500;
line-height: 60px;
}
.counter-item .fact-count h4 {
font-size: 18px;
margin-bottom: 0;
}
| 18.108142
| 105
| 0.589615
|
6fc73c88cde4d9265b87ad8a9cd9961d09829d28
| 1,772
|
ps1
|
PowerShell
|
src/Public/Add-StorageTableRow.ps1
|
rdbartram/AzStorageTable
|
b52aeb672c9340883a814352ea543f1edc1274c2
|
[
"MIT"
] | 1
|
2019-03-19T04:54:16.000Z
|
2019-03-19T04:54:16.000Z
|
src/Public/Add-StorageTableRow.ps1
|
rdbartram/AzStorageTable
|
b52aeb672c9340883a814352ea543f1edc1274c2
|
[
"MIT"
] | 1
|
2019-02-01T17:22:28.000Z
|
2019-02-01T17:22:28.000Z
|
src/Public/Add-StorageTableRow.ps1
|
rdbartram/AzStorageTable
|
b52aeb672c9340883a814352ea543f1edc1274c2
|
[
"MIT"
] | 2
|
2019-01-31T21:20:51.000Z
|
2019-03-26T17:34:46.000Z
|
function Add-StorageTableRow
{
<#
.SYNOPSIS
Adds a row/entity to a specified table
.DESCRIPTION
Adds a row/entity to a specified table
.PARAMETER Table
Table object of type Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel.AzureStorageTable where the entity will be added
.PARAMETER PartitionKey
Identifies the table partition
.PARAMETER RowKey
Identifies a row within a partition
.PARAMETER Property
Hashtable with the columns that will be part of the entity. e.g. @{"firstName"="Paulo";"lastName"="Marques"}
.EXAMPLE
# Adding a row
$saContext = (Get-AzRmStorageAccount -ResourceGroupName $resourceGroup -Name $storageAccount).Context
$table = Get-AzStorageTable -Name $tableName -Context $saContext
Add-StorageTableRow -table $table -partitionKey $partitionKey -rowKey ([guid]::NewGuid().tostring()) -property @{"firstName"="Paulo";"lastName"="Costa";"role"="presenter"}
#>
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
$table,
[Parameter(Mandatory=$true)]
[AllowEmptyString()]
[String]$partitionKey,
[Parameter(Mandatory=$true)]
[AllowEmptyString()]
[String]$rowKey,
[Parameter(Mandatory=$false)]
[hashtable]$property
)
# Creates the table entity with mandatory partitionKey and rowKey arguments
$entity = New-Object -TypeName "Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity" -ArgumentList $partitionKey, $rowKey
# Adding the additional columns to the table entity
foreach ($prop in $property.Keys)
{
if ($prop -ne "TableTimestamp")
{
$entity.Properties.Add($prop, $property.Item($prop))
}
}
return ($table.CloudTable.ExecuteAsync((invoke-expression "[Microsoft.WindowsAzure.Storage.Table.TableOperation]::insert(`$entity)")))
}
| 31.642857
| 173
| 0.731941
|
54722a7fe2bc347feb1e3019819b7a9c0aa7e3e8
| 553
|
css
|
CSS
|
react-app/src/index.css
|
moesalih/dapp-limo
|
204f0ae6346595d503f39589b67d6b9039b4d890
|
[
"MIT"
] | 1
|
2022-02-12T14:55:46.000Z
|
2022-02-12T14:55:46.000Z
|
react-app/src/index.css
|
moesalih/dapp-limo
|
204f0ae6346595d503f39589b67d6b9039b4d890
|
[
"MIT"
] | null | null | null |
react-app/src/index.css
|
moesalih/dapp-limo
|
204f0ae6346595d503f39589b67d6b9039b4d890
|
[
"MIT"
] | null | null | null |
body {
font-family: ui-rounded, "SF Pro Rounded", system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji" !important;
}
.fw-200 { font-weight: 200; }
.fw-300 { font-weight: 300; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fw-900 { font-weight: 900; }
.smaller { font-size: .75em; }
.opacity-10 { opacity: 0.1; }
[role=button] {
outline: none;
}
| 29.105263
| 235
| 0.65642
|
25e89b7f0694e7c4c32501382651a32cb55bebe6
| 5,766
|
cs
|
C#
|
bencode/TorrentMetadata.cs
|
tomatobot/bencode
|
440080514ff47bab4b422fa60272699de2962802
|
[
"MIT"
] | null | null | null |
bencode/TorrentMetadata.cs
|
tomatobot/bencode
|
440080514ff47bab4b422fa60272699de2962802
|
[
"MIT"
] | null | null | null |
bencode/TorrentMetadata.cs
|
tomatobot/bencode
|
440080514ff47bab4b422fa60272699de2962802
|
[
"MIT"
] | null | null | null |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Security.Cryptography;
namespace bencode
{
public class TorrentMetadata
{
private TorrentMetadataInfo Load(Stream stream)
{
TorrentMetadataInfo metadata = new TorrentMetadataInfo();
metadata.AnnounceList = new List<string>();
metadata.Files = new Dictionary<string, long>();
metadata.PieceHashes = new List<byte[]>();
var root = Bencoding.Decode(stream);
BenDictionary dicroot = (BenDictionary)root;
if (dicroot == null) return null;
if (dicroot.ContainsKey(ConstDefinition.ANNOUNCE))
{
metadata.Announce = ((BenString)dicroot[ConstDefinition.ANNOUNCE]).Value;
}
if (dicroot.ContainsKey(ConstDefinition.ANNOUNCELIST))
{
BenList list = (BenList)dicroot[ConstDefinition.ANNOUNCELIST];
foreach (var type in list)
{
if (type is BenString)
{
metadata.AnnounceList.Add(((BenString)type).Value);
}
else
{
BenList clist = (BenList)type;
if (clist != null)
{
foreach (var btype in clist)
{
metadata.AnnounceList.Add(((BenString)btype).Value);
}
}
}
}
}
if (dicroot.ContainsKey(ConstDefinition.COMMENT))
{
metadata.Comment = ((BenString)dicroot[ConstDefinition.COMMENT]).Value;
}
if (dicroot.ContainsKey(ConstDefinition.CREATEDBY))
{
metadata.CreatedBy = ((BenString)dicroot[ConstDefinition.CREATEDBY]).Value;
}
if (dicroot.ContainsKey(ConstDefinition.CREATIONDATE))
{
long second = ((BenInt)dicroot[ConstDefinition.CREATIONDATE]).Value;
metadata.CreationDate = new DateTime(1970, 1, 1).AddSeconds(second);
}
if (dicroot.ContainsKey(ConstDefinition.INFO))
{
BenDictionary dictinfo = (BenDictionary)dicroot[ConstDefinition.INFO];
using (SHA1Managed sha1 = new SHA1Managed())
{
byte[] bytes = Bencoding.EncodeBytes(dictinfo);
metadata.Hash = sha1.ComputeHash(bytes);
}
if (dictinfo.ContainsKey(ConstDefinition.FILES))
{
BenList filelist = (BenList)dictinfo[ConstDefinition.FILES];
foreach (var file in filelist)
{
BenDictionary dictfile = (BenDictionary)file;
string filename = "";
long filelength = 0;
if (dictfile.ContainsKey(ConstDefinition.PATH))
{
BenList filenamelist = (BenList)dictfile[ConstDefinition.PATH];
foreach (var fn in filenamelist)
{
filename += ((BenString)fn).Value;
filename += "\\";
}
filename = filename.Trim('\\');
}
if (dictfile.ContainsKey(ConstDefinition.LENGTH))
{
filelength = ((BenInt)dictfile[ConstDefinition.LENGTH]).Value;
}
metadata.Files.Add(filename, filelength);
}
}
if (dictinfo.ContainsKey(ConstDefinition.NAME))
{
if (metadata.Files.Count == 0 && dictinfo.ContainsKey(ConstDefinition.LENGTH))
{
metadata.Files.Add(((BenString)dictinfo[ConstDefinition.NAME]).Value, ((BenInt)dictinfo[ConstDefinition.LENGTH]).Value);
}
}
if (dictinfo.ContainsKey(ConstDefinition.PIECES))
{
BenString pieces = (BenString)dictinfo[ConstDefinition.PIECES];
byte[] bytes = Bencoding.EncodeBytes(pieces);
for (int i = 0; i < bytes.Length; i += 20)
{
byte[] hash = bytes.GetBytes(i);
metadata.PieceHashes.Add(hash);
}
}
if (dictinfo.ContainsKey(ConstDefinition.PIECELENGTH))
{
metadata.PieceLength = ((BenInt)dictinfo[ConstDefinition.PIECELENGTH]).Value;
}
}
return metadata;
}
public TorrentMetadataInfo FormFile(string filepath)
{
using (FileStream fs = File.OpenRead(filepath))
{
return Load(fs);
}
}
public TorrentMetadataInfo FormStream(Stream stream)
{
return Load(stream);
}
public TorrentMetadataInfo FormBytes(byte[] bytes)
{
using (MemoryStream ms=new MemoryStream(bytes))
{
return Load(ms);
}
}
public TorrentMetadataInfo FormString(string metadataInfo)
{
return FormBytes(Bencoding.BEncoding.GetBytes(metadataInfo));
}
}
}
| 38.697987
| 144
| 0.479709
|
ef766e72276ce6e64b45079867cfe866aca65b32
| 1,310
|
c
|
C
|
client/src/request_handlers/edit_message.c
|
High-Voltaged/Ucode-Uchat
|
ce61241af5c518e8e60b7e016bcc90e01d0c9252
|
[
"MIT"
] | null | null | null |
client/src/request_handlers/edit_message.c
|
High-Voltaged/Ucode-Uchat
|
ce61241af5c518e8e60b7e016bcc90e01d0c9252
|
[
"MIT"
] | null | null | null |
client/src/request_handlers/edit_message.c
|
High-Voltaged/Ucode-Uchat
|
ce61241af5c518e8e60b7e016bcc90e01d0c9252
|
[
"MIT"
] | null | null | null |
#include "../../inc/client.h"
static void edit_global_messages(int message_id, const char* new_msg_text) {
t_msg* msg_to_edit = mx_get_msg_by_id(utils->current_chat->messages, message_id);
if (msg_to_edit) {
mx_strdel(&msg_to_edit->text);
msg_to_edit->text = mx_strdup(new_msg_text);
update_chatlist_item_info(utils->current_chat);
}
}
void handle_edit_msg_request(int message_id, const char* new_msg_text) {
utils->is_suspended = true;
cJSON *json = cJSON_CreateObject();
cJSON_AddNumberToObject(json, "type", REQ_EDIT_MESSAGE);
cJSON_AddNumberToObject(json, "id", message_id);
cJSON_AddStringToObject(json, "text", new_msg_text);
cJSON_AddNumberToObject(json, "user_id", utils->current_user->user_id);
cJSON_AddNumberToObject(json, "chat_id", utils->current_chat->id);
char* json_str = cJSON_PrintUnformatted(json);
cJSON_Delete(json);
char* response = send_and_recv_from_server(utils->ssl, json_str);
int error_code = handle_server_response(response);
logger(get_response_str(error_code), error_code == R_SUCCESS ? INFO_LOG : ERROR_LOG);
if (error_code == R_SUCCESS) {
edit_global_messages(message_id, new_msg_text);
}
free(json_str);
free(response);
utils->is_suspended = false;
}
| 30.465116
| 89
| 0.716794
|
b7876393208cc4dee3f36665fff3a0b43b884549
| 1,303
|
cs
|
C#
|
DigitallyImported.Components/Base/ChannelCollection.cs
|
jaypatrick/dica
|
f3d90c7e894db7d861183bcff1e324ec557afdf1
|
[
"BSD-3-Clause"
] | null | null | null |
DigitallyImported.Components/Base/ChannelCollection.cs
|
jaypatrick/dica
|
f3d90c7e894db7d861183bcff1e324ec557afdf1
|
[
"BSD-3-Clause"
] | null | null | null |
DigitallyImported.Components/Base/ChannelCollection.cs
|
jaypatrick/dica
|
f3d90c7e894db7d861183bcff1e324ec557afdf1
|
[
"BSD-3-Clause"
] | null | null | null |
using System;
using System.Collections.Generic;
using System.Text;
namespace DigitallyImported.Components
{
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
///
[Serializable]
public class ChannelCollection<T>: ContentCollection<T> where T: IChannel
{
private string _channelName;
public ChannelCollection()
: base()
{
}
public ChannelCollection(int capacity)
: base(capacity)
{
}
// TESTING
public static T GetChannel(string channelName)
{
// _channelName = channelName.ToLower().Trim();
return default(T);
}
/// <summary>
/// Initializes the Channel Collection for viewing by setting sort parameters
/// </summary>
/// <param name="viewer"></param>
public void View(ChannelViewer<T> viewer)
{
//Channel channel = T;
//if (channel.SortBy) // YADA YADA YADA, encapsulates it into this classs
//{
//}
}
// predicate
private bool TESTING(T t)
{
if (t.Name == _channelName)
return true;
else
return false;
}
}
}
| 22.859649
| 85
| 0.513431
|
7bcaa7dab52e901730b34cc0f6c1d474f25ac60f
| 129
|
cc
|
C++
|
Blob_Lib/assimp-5.2.3/assimp/contrib/draco/src/draco/compression/mesh/mesh_encoder.cc
|
antholuo/Blob_Traffic
|
5d6acf88044e9abc63c0ff356714179eaa4b75bf
|
[
"MIT"
] | null | null | null |
Blob_Lib/assimp-5.2.3/assimp/contrib/draco/src/draco/compression/mesh/mesh_encoder.cc
|
antholuo/Blob_Traffic
|
5d6acf88044e9abc63c0ff356714179eaa4b75bf
|
[
"MIT"
] | null | null | null |
Blob_Lib/assimp-5.2.3/assimp/contrib/draco/src/draco/compression/mesh/mesh_encoder.cc
|
antholuo/Blob_Traffic
|
5d6acf88044e9abc63c0ff356714179eaa4b75bf
|
[
"MIT"
] | null | null | null |
version https://git-lfs.github.com/spec/v1
oid sha256:8c8bd90ea92d058b67832d126b5441f74ba246aed3a678bf4d3dd60d66de283a
size 1068
| 32.25
| 75
| 0.883721
|
e2962ac2e4f14b12a996a128b77bd879fdb6eca9
| 1,577
|
js
|
JavaScript
|
packages/track-navigator/src/NavigatorTrack.js
|
monkollek/mito_browser
|
01bd0326bcb17357232cf47098f63f6ce549dbeb
|
[
"MIT"
] | 2
|
2019-07-18T18:12:16.000Z
|
2019-07-25T15:23:09.000Z
|
packages/track-navigator/src/NavigatorTrack.js
|
monkollek/mito_browser
|
01bd0326bcb17357232cf47098f63f6ce549dbeb
|
[
"MIT"
] | 25
|
2020-10-21T21:16:24.000Z
|
2022-02-28T04:09:52.000Z
|
packages/track-navigator/src/NavigatorTrack.js
|
monkollek/mito_browser
|
01bd0326bcb17357232cf47098f63f6ce549dbeb
|
[
"MIT"
] | 2
|
2019-08-04T14:13:32.000Z
|
2020-01-22T13:39:02.000Z
|
import PropTypes from 'prop-types'
import React from 'react'
import ReactCursorPosition from 'react-cursor-position'
import styled from 'styled-components'
import { Track } from '@broad/region-viewer'
import { Navigator } from './Navigator'
const TitlePanel = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
height: ${props => props.height}px;
`
export const NavigatorTrack = ({
height,
hoveredVariant,
onNavigatorClick,
title,
variants,
visibleVariantWindow,
}) => (
<Track
renderLeftPanel={() => (
<TitlePanel height={height}>
{title.split('\n').map(s => (
<span key={s}>{s}</span>
))}
</TitlePanel>
)}
>
{({ scalePosition, width }) => (
<ReactCursorPosition className="cursorPosition">
<Navigator
height={height}
hoveredVariant={hoveredVariant}
onNavigatorClick={onNavigatorClick}
scalePosition={scalePosition}
variants={variants}
visibleVariantWindow={visibleVariantWindow}
width={width}
/>
</ReactCursorPosition>
)}
</Track>
)
NavigatorTrack.propTypes = {
height: PropTypes.number,
hoveredVariant: PropTypes.string,
onNavigatorClick: PropTypes.func.isRequired,
title: PropTypes.string,
variants: PropTypes.arrayOf(PropTypes.object).isRequired, // eslint-disable-line react/forbid-prop-types
visibleVariantWindow: PropTypes.arrayOf(PropTypes.number).isRequired,
}
NavigatorTrack.defaultProps = {
height: 60,
hoveredVariant: null,
title: '',
}
| 24.640625
| 106
| 0.667724
|
44579ed4f06dfc7a7315c83a29faf288272baba5
| 9,761
|
py
|
Python
|
tests/test_dockerspawner.py
|
Prussia/dockerspawner
|
b842330f9f7cdb9dc443d64bf82592d0b21f962d
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_dockerspawner.py
|
Prussia/dockerspawner
|
b842330f9f7cdb9dc443d64bf82592d0b21f962d
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_dockerspawner.py
|
Prussia/dockerspawner
|
b842330f9f7cdb9dc443d64bf82592d0b21f962d
|
[
"BSD-3-Clause"
] | null | null | null |
"""Tests for DockerSpawner class"""
import asyncio
import json
import logging
import os
from unittest import mock
import docker
import pytest
import traitlets
from jupyterhub.tests.mocking import public_url
from jupyterhub.tests.test_api import add_user
from jupyterhub.tests.test_api import api_request
from jupyterhub.utils import url_path_join
from tornado.httpclient import AsyncHTTPClient
from dockerspawner import DockerSpawner
# Mark all tests in this file as asyncio
pytestmark = pytest.mark.asyncio
def test_name_collision(dockerspawner_configured_app):
app = dockerspawner_configured_app
has_hyphen = "user--foo"
add_user(app.db, app, name=has_hyphen)
user = app.users[has_hyphen]
spawner1 = user.spawners[""]
assert isinstance(spawner1, DockerSpawner)
assert spawner1.object_name == "{}-{}".format(
spawner1.prefix, has_hyphen.replace("-", "-2d")
)
part1, part2 = ["user", "foo"]
add_user(app.db, app, name=part1)
user2 = app.users[part1]
spawner2 = user2.spawners[part2]
assert spawner1.object_name != spawner2.object_name
@pytest.mark.parametrize("remove", (True, False))
async def test_start_stop(dockerspawner_configured_app, remove):
app = dockerspawner_configured_app
name = "has@"
add_user(app.db, app, name=name)
user = app.users[name]
server_name = 'also-has@'
spawner = user.spawners[server_name]
assert isinstance(spawner, DockerSpawner)
spawner.remove = remove
token = user.new_api_token()
# start the server
r = await api_request(app, "users", name, "servers", server_name, method="post")
pending = r.status_code == 202
while pending:
# request again
r = await api_request(app, "users", name)
user_info = r.json()
pending = user_info["servers"][server_name]["pending"]
assert r.status_code in {201, 200}, r.text
url = url_path_join(public_url(app, user), server_name, "api/status")
resp = await AsyncHTTPClient().fetch(
url, headers={"Authorization": "token %s" % token}
)
assert resp.effective_url == url
resp.rethrow()
assert "kernels" in resp.body.decode("utf-8")
# stop the server
r = await api_request(app, "users", name, "servers", server_name, method="delete")
pending = r.status_code == 202
while pending:
# request again
r = await api_request(app, "users", name)
user_info = r.json()
pending = user_info["servers"][server_name]["pending"]
assert r.status_code in {204, 200}, r.text
state = spawner.get_state()
if remove:
assert state == {}
else:
assert sorted(state) == ["object_id", "object_name"]
@pytest.mark.parametrize("image", ["1.0", "1.1.0", "nomatch"])
async def test_allowed_image(dockerspawner_configured_app, image):
app = dockerspawner_configured_app
name = "checker"
add_user(app.db, app, name=name)
user = app.users[name]
assert isinstance(user.spawner, DockerSpawner)
user.spawner.remove_containers = True
user.spawner.allowed_images = {
"1.0": "jupyterhub/singleuser:1.0",
"1.1": "jupyterhub/singleuser:1.1",
}
token = user.new_api_token()
# start the server
r = await api_request(
app, "users", name, "server", method="post", data=json.dumps({"image": image})
)
if image not in user.spawner.allowed_images:
with pytest.raises(Exception):
r.raise_for_status()
return
pending = r.status_code == 202
while pending:
# request again
r = await api_request(app, "users", name)
user_info = r.json()
pending = user_info["servers"][""]["pending"]
url = url_path_join(public_url(app, user), "api/status")
resp = await AsyncHTTPClient().fetch(
url, headers={"Authorization": "token %s" % token}
)
assert resp.effective_url == url
resp.rethrow()
assert resp.headers['x-jupyterhub-version'].startswith(image)
r = await api_request(
app,
"users",
name,
"server",
method="delete",
)
r.raise_for_status()
@pytest.mark.xfail(
"podman.sock" in os.getenv("DOCKER_HOST", ""), reason="Fails with Podman"
)
async def test_image_pull_policy(dockerspawner_configured_app):
app = dockerspawner_configured_app
name = "gumby"
add_user(app.db, app, name=name)
user = app.users[name]
assert isinstance(user.spawner, DockerSpawner)
spawner = user.spawners[""]
spawner.image = "jupyterhub/doesntexist:nosuchtag"
with pytest.raises(docker.errors.NotFound):
spawner.image_pull_policy = "never"
await spawner.pull_image(spawner.image)
repo = "busybox"
tag = "1.29.1" # a version that's definitely not latest
# ensure image isn't present
try:
await asyncio.wrap_future(
spawner.docker("remove_image", "{}:{}".format(repo, tag))
)
except docker.errors.ImageNotFound:
pass
spawner.pull_policy = "ifnotpresent"
image = "{}:{}".format(repo, tag)
# should trigger a pull
await spawner.pull_image(image)
# verify that the image exists now
old_image_info = await asyncio.wrap_future(spawner.docker("inspect_image", image))
print(old_image_info)
# now tag busybox:latest as our current version
# which is not latest!
await asyncio.wrap_future(spawner.docker("tag", image, repo))
image = repo # implicit :latest
spawner.pull_policy = "ifnotpresent"
# check with ifnotpresent shouldn't pull
await spawner.pull_image(image)
image_info = await asyncio.wrap_future(spawner.docker("inspect_image", repo))
assert image_info["Id"] == old_image_info["Id"]
# run again with Always,
# should trigger a pull even though the image is present
spawner.pull_policy = "always"
await spawner.pull_image(image)
image_info = await asyncio.wrap_future(spawner.docker("inspect_image", repo))
assert image_info["Id"] != old_image_info["Id"]
# run again with never, make sure it's still happy
spawner.pull_policy = "never"
await spawner.pull_image(image)
async def test_post_start(dockerspawner_configured_app, caplog):
app = dockerspawner_configured_app
name = "post-start"
add_user(app.db, app, name=name)
user = app.users[name]
spawner = user.spawners['']
log_name = "dockerspawner"
spawner.log = logging.getLogger(log_name)
spawner.remove = True
# mock out ip and port, no need for it
async def mock_ip_port():
return ("127.0.0.1", 1234)
spawner.get_ip_and_port = mock_ip_port
spawner.image = "busybox:1.29.1"
spawner.cmd = ["sh", "-c", "sleep 300"]
spawner.post_start_cmd = "ls /"
# verify that it's called during startup
finished_future = asyncio.Future()
finished_future.set_result(None)
mock_post_start = mock.Mock(return_value=finished_future)
with mock.patch.object(spawner, 'post_start_exec', mock_post_start):
await spawner.start()
mock_post_start.assert_called_once()
# verify log capture for 3 combinations:
# - success
# - failure
# - no such command (different failure)
for (cmd, expected_stdout, expected_stderr) in [
("true", False, False),
("ls /", True, False),
("ls /nosuchfile", False, True),
("nosuchcommand", False, True),
("echo", False, False),
]:
spawner.post_start_cmd = cmd
idx = len(caplog.records)
with caplog.at_level(logging.DEBUG, log_name):
await spawner.post_start_exec()
logged = "\n".join(
f"{rec.levelname}: {rec.message}" for rec in caplog.records[idx:]
)
if expected_stdout:
assert "DEBUG: post_start stdout" in logged
else:
assert "post_start stdout" not in logged
if expected_stderr:
assert "WARNING: post_start stderr" in logged
else:
assert "post_start stderr" not in logged
await spawner.stop()
@pytest.mark.skipif(
traitlets.__version__ < '5.0', reason="One test fails on traitlets < 5.0. See #420."
)
@pytest.mark.parametrize(
"mem_limit, expected",
[
("1G", 1024 ** 3),
(1_000_000, 1_000_000),
(None, None),
(lambda spawner: None, None),
(lambda spawner: "2G", 2 * 1024 ** 3),
(lambda spawner: 1_000_000, 1_000_000),
],
)
def test_mem_limit(mem_limit, expected):
s = DockerSpawner(mem_limit=mem_limit)
assert s.mem_limit == expected
@pytest.mark.parametrize(
"cpu_limit, expected",
[
(1, 1),
(None, None),
(1.5, 1.5),
(lambda spawner: None, None),
(lambda spawner: 2, 2),
(lambda spawner: 1.25, 1.25),
],
)
async def test_cpu_limit(dockerspawner_configured_app, cpu_limit, expected, username):
app = dockerspawner_configured_app
app.config.DockerSpawner.cpu_limit = cpu_limit
add_user(app.db, app, name=username)
user = app.users[username]
s = user.spawners[""]
assert s.cpu_limit == expected
original_docker = s.docker
async def mock_docker(cmd, *args, **kwargs):
if cmd == "create_container":
return args, kwargs
else:
return await original_docker(cmd, *args, **kwargs)
with mock.patch.object(s, 'docker', new=mock_docker):
args, kwargs = await s.create_object()
print(kwargs)
host_config = kwargs['host_config']
if expected is not None:
assert host_config['CpuPeriod'] == 100_000
assert host_config['CpuQuota'] == int(expected * 100_000)
else:
assert 'CpuPeriod' not in host_config
assert 'CpuQuota' not in host_config
| 32.321192
| 88
| 0.654646
|
772c6c6643986d2cba098e62f74c493e84080443
| 586
|
sh
|
Shell
|
scripts/ipnotifier.sh
|
gitter-badger/NetCoreRover
|
3b2783d5565e23354436e7bfa53296ac77b0bb41
|
[
"MIT"
] | 2
|
2020-03-02T03:50:26.000Z
|
2020-03-04T13:19:05.000Z
|
scripts/ipnotifier.sh
|
gitter-badger/NetCoreRover
|
3b2783d5565e23354436e7bfa53296ac77b0bb41
|
[
"MIT"
] | 9
|
2020-03-05T19:45:33.000Z
|
2020-03-22T06:12:03.000Z
|
scripts/ipnotifier.sh
|
gitter-badger/NetCoreRover
|
3b2783d5565e23354436e7bfa53296ac77b0bb41
|
[
"MIT"
] | 2
|
2020-03-07T13:20:42.000Z
|
2021-08-16T11:08:54.000Z
|
#!/bin/sh
cd /home/pi/scripts/
currentIp=$(hostname -I)
read oldIp < ip.txt
if [ $currentIp = $oldIp ]
then
exit
else
echo $currentIp > ip.txt
curl --request POST \
--url https://api.sendgrid.com/v3/mail/send \
--header "Authorization: Bearer <yout api key>" \
--header 'Content-Type: application/json' \
--data '{"personalizations": [{"to": [{"email": "<receivers email>"}]}],"from": {"email": "<any sender email>"},"subject": "Chipmunk rover started (ip: '"$currentIp"')","content": [{"type": "text/plain", "value": "Chipmunk rover is ready to go!"}]}'
fi
| 27.904762
| 253
| 0.622867
|
c3df993bc5f95b26be3c38a3bce3554348107ead
| 408
|
cs
|
C#
|
GalvanizedBeethoven/Extensions/PropertyInfoExtensions.cs
|
GalvanizedSoftware/Beethoven
|
44ffa7d95202019569d09e813a9dd448482150bf
|
[
"Apache-2.0"
] | 3
|
2018-05-18T16:54:48.000Z
|
2020-11-08T19:02:24.000Z
|
GalvanizedBeethoven/Extensions/PropertyInfoExtensions.cs
|
GalvanizedSoftware/Beethoven
|
44ffa7d95202019569d09e813a9dd448482150bf
|
[
"Apache-2.0"
] | null | null | null |
GalvanizedBeethoven/Extensions/PropertyInfoExtensions.cs
|
GalvanizedSoftware/Beethoven
|
44ffa7d95202019569d09e813a9dd448482150bf
|
[
"Apache-2.0"
] | 1
|
2019-08-04T03:31:06.000Z
|
2019-08-04T03:31:06.000Z
|
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using GalvanizedSoftware.Beethoven.Core.Properties;
namespace GalvanizedSoftware.Beethoven.Extensions
{
internal static class PropertyInfoExtensions
{
internal static IEnumerable<PropertyInfo> DistinctProperties(this IEnumerable<PropertyInfo> properties) =>
properties.Distinct(new ExactPropertyComparer());
}
}
| 29.142857
| 110
| 0.813725
|
af89bc48c4fea06c35f8ad93e7b05cd06f829436
| 525
|
py
|
Python
|
python/setup.py
|
kriskall/Zeeguu-Exercises
|
87241b43c94fa8bcf75dd41498f173f37339ec3d
|
[
"MIT"
] | 1
|
2021-05-02T07:32:57.000Z
|
2021-05-02T07:32:57.000Z
|
python/setup.py
|
kriskall/Zeeguu-Exercises
|
87241b43c94fa8bcf75dd41498f173f37339ec3d
|
[
"MIT"
] | 89
|
2017-02-13T09:30:25.000Z
|
2017-08-23T12:25:48.000Z
|
python/setup.py
|
kriskall/Zeeguu-Exercises
|
87241b43c94fa8bcf75dd41498f173f37339ec3d
|
[
"MIT"
] | 2
|
2017-12-04T18:10:11.000Z
|
2018-11-22T17:48:37.000Z
|
#!/usr/bin/env python
# -*- coding: utf8 -*-
import os
import setuptools
setuptools.setup(
name="zeeguu_exercises",
version="0.1",
packages=setuptools.find_packages(),
include_package_data=True,
zip_safe=False,
author="Martin Avagyan",
author_email="zeeguu_team@zeeguu.com",
description="Web Exercises for Zeeguu",
keywords="The zeeguu_exercises is a cool module!",
install_requires=("flask>=0.10.1",
"Flask-SQLAlchemy",
"Flask-Assets")
)
| 25
| 54
| 0.638095
|
58f1d61a8dc59cbdd9784ae6fcd559dd6eca38ed
| 22,678
|
sql
|
SQL
|
penyimpanan database/kemahasiswaandua.sql
|
kadaiapak/sibpartnership
|
563c00ed3750ef6bf5b298a77a280c6ff5c7561e
|
[
"MIT"
] | null | null | null |
penyimpanan database/kemahasiswaandua.sql
|
kadaiapak/sibpartnership
|
563c00ed3750ef6bf5b298a77a280c6ff5c7561e
|
[
"MIT"
] | null | null | null |
penyimpanan database/kemahasiswaandua.sql
|
kadaiapak/sibpartnership
|
563c00ed3750ef6bf5b298a77a280c6ff5c7561e
|
[
"MIT"
] | null | null | null |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 06, 2021 at 07:37 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `kemahasiswaandua`
--
-- --------------------------------------------------------
--
-- Table structure for table `akses`
--
CREATE TABLE `akses` (
`kode_menu` char(15) NOT NULL,
`level_user` varchar(30) NOT NULL,
`akses` enum('0','1') NOT NULL,
`detail` enum('0','1') NOT NULL,
`tambah` enum('0','1') NOT NULL,
`edit` enum('0','1') NOT NULL,
`hapus` enum('0','1') NOT NULL,
`id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `akses`
--
INSERT INTO `akses` (`kode_menu`, `level_user`, `akses`, `detail`, `tambah`, `edit`, `hapus`, `id`) VALUES
('10', '1', '1', '0', '1', '1', '1', 28),
('8', '1', '1', '0', '1', '1', '1', 55),
('4', '1', '1', '0', '1', '1', '1', 57),
('5', '1', '1', '0', '1', '1', '1', 58),
('2', '1', '1', '0', '1', '1', '1', 71),
('7', '1', '1', '1', '1', '1', '1', 76),
('11', '1', '1', '0', '1', '1', '1', 79),
('3', '1', '1', '0', '1', '1', '1', 90),
('18', '1', '1', '0', '1', '1', '1', 91),
('6', '1', '1', '0', '1', '1', '1', 92),
('5', '14', '1', '0', '0', '0', '0', 96),
('4', '5', '1', '0', '0', '0', '0', 97),
('5', '5', '1', '0', '0', '0', '0', 98),
('20', '1', '1', '0', '1', '1', '1', 106),
('1', '1', '1', '0', '1', '1', '1', 108),
('21', '1', '1', '0', '1', '1', '1', 109),
('20', '19', '1', '0', '1', '1', '1', 111),
('4', '19', '1', '0', '0', '0', '0', 112),
('5', '19', '1', '0', '0', '0', '0', 113),
('20', '2', '1', '0', '0', '0', '0', 115),
('21', '2', '1', '0', '0', '0', '0', 116),
('23', '1', '1', '0', '0', '0', '0', 117),
('23', '2', '1', '0', '0', '0', '0', 118),
('24', '1', '1', '0', '1', '1', '1', 119),
('29', '1', '1', '0', '0', '0', '0', 129);
-- --------------------------------------------------------
--
-- Table structure for table `asal_beasiswa`
--
CREATE TABLE `asal_beasiswa` (
`id` int(11) NOT NULL,
`nama_asal_beasiswa` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `asal_beasiswa`
--
INSERT INTO `asal_beasiswa` (`id`, `nama_asal_beasiswa`) VALUES
(1, 'Pusat'),
(2, 'Daerah'),
(3, 'BANK'),
(4, 'Baznas Provinsi'),
(5, 'Provinsi'),
(10, 'Swasta');
-- --------------------------------------------------------
--
-- Table structure for table `contact_person`
--
CREATE TABLE `contact_person` (
`id` int(11) NOT NULL,
`nama` varchar(100) DEFAULT NULL,
`kontak` varchar(100) DEFAULT NULL,
`deskripsi` varchar(255) NOT NULL,
`id_master_beasiswa` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
`updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='contact_person';
-- --------------------------------------------------------
--
-- Table structure for table `jenis_beasiswa`
--
CREATE TABLE `jenis_beasiswa` (
`id` int(11) NOT NULL,
`nama_jenis` varchar(40) NOT NULL,
`keterangan` varchar(250) NOT NULL,
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
`updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `jenis_beasiswa`
--
INSERT INTO `jenis_beasiswa` (`id`, `nama_jenis`, `keterangan`, `created_at`, `updated_at`) VALUES
(1, 'Satu kali penerimaan', 'Jenis Beasiswa yang penerimanya hanya mendapatkan bantuan beasiswa sebanyak satu kali penerimaan. Untuk penerimaan selanjutnya akan diadakan pendaftaran dan penyeleksian kembali.', '2021-10-29 11:14:41', '0000-00-00 00:00:00'),
(2, 'Sampai semester delapan', 'Jenis Beasiswa yang penerimaannya akan terus mendapatkan bantuan maksimal sampai semester 8, namun penerima bisa diberhentikan sewaktu waktu sesuai dengan peraturan yang berlaku', '2021-10-29 11:30:57', '0000-00-00 00:00:00'),
(3, 'dlls', 'dlls', '2021-10-29 11:31:35', '0000-00-00 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `kelompok_beasiswa`
--
CREATE TABLE `kelompok_beasiswa` (
`id` int(11) NOT NULL,
`nama_kelompok` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `kelompok_beasiswa`
--
INSERT INTO `kelompok_beasiswa` (`id`, `nama_kelompok`) VALUES
(2, 'BUMD'),
(9, 'Pemerintah'),
(16, 'Pemerintah Daerah'),
(17, 'Yayasan'),
(19, 'Pemerintah Provinsi'),
(21, 'kelompoks');
-- --------------------------------------------------------
--
-- Table structure for table `mahasiswa`
--
CREATE TABLE `mahasiswa` (
`id` int(11) NOT NULL,
`nim` varchar(100) NOT NULL,
`nama` varchar(100) NOT NULL,
`prodi` varchar(100) DEFAULT NULL,
`fakultas` varchar(100) DEFAULT NULL,
`photo` varchar(100) DEFAULT NULL,
`aktif` enum('1','0') NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `mahasiswa`
--
INSERT INTO `mahasiswa` (`id`, `nim`, `nama`, `prodi`, `fakultas`, `photo`, `aktif`) VALUES
(255, '20334017', 'Aprilian Zulfa Badriah', 'Keperawatan (D3)', 'FIK', NULL, '1'),
(256, '19130069', 'Weri Sasra Yanti', 'Teknik Elektro Industri', 'FT', NULL, '1'),
(257, '19023116', 'Abelita Khre Vanesa', 'Sendratasik', 'FBS', NULL, '1'),
(258, '20062007', 'Aldewo Valentio', 'Teknik Sipil dan Banunan (D3)', 'FT', NULL, '1'),
(259, '20130058', 'Nari Amelia Aprilianti Sukma', 'Teknik Elektro Industri', 'FT', NULL, '1');
-- --------------------------------------------------------
--
-- Table structure for table `mahasiswa_beasiswa`
--
CREATE TABLE `mahasiswa_beasiswa` (
`id` int(11) NOT NULL,
`nim_mahasiswa` varchar(11) NOT NULL,
`id_beasiswa` int(11) NOT NULL,
`status_beasiswa` enum('1','0') NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `mahasiswa_beasiswa`
--
INSERT INTO `mahasiswa_beasiswa` (`id`, `nim_mahasiswa`, `id_beasiswa`, `status_beasiswa`) VALUES
(258, '19130069', 17, '1'),
(259, '19023116', 17, '1'),
(260, '20062007', 17, '1'),
(261, '20130058', 17, '1');
-- --------------------------------------------------------
--
-- Table structure for table `mahasiswa_beasiswa_bukti_pembayaran`
--
CREATE TABLE `mahasiswa_beasiswa_bukti_pembayaran` (
`id` int(11) NOT NULL,
`id_mahasiswa_beasiswa` int(11) NOT NULL,
`periode_bukti_pembayaran` int(11) NOT NULL,
`tahun_bukti_pembayaran` int(11) NOT NULL,
`nama_file` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `master_beasiswa`
--
CREATE TABLE `master_beasiswa` (
`id` int(11) NOT NULL,
`nama_beasiswa` int(11) NOT NULL,
`kelompok_beasiswa` int(2) NOT NULL,
`asal_beasiswa` int(2) NOT NULL,
`jenis_beasiswa` int(11) NOT NULL,
`biaya` varchar(255) NOT NULL,
`periode` int(11) NOT NULL,
`tahun` int(4) NOT NULL,
`metode_pembayaran` varchar(255) DEFAULT NULL,
`sk` varchar(255) DEFAULT NULL,
`rekap_bukti_pembayaran` varchar(100) DEFAULT NULL,
`tanggal_penetapan` date DEFAULT NULL,
`buka_pendaftaran` enum('1','0') NOT NULL DEFAULT '0',
`tampil` enum('1','0') NOT NULL DEFAULT '1',
`aktif` enum('1','0') NOT NULL DEFAULT '1',
`created_at` datetime DEFAULT current_timestamp(),
`updated_at` datetime DEFAULT NULL,
`user_created` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `master_beasiswa`
--
INSERT INTO `master_beasiswa` (`id`, `nama_beasiswa`, `kelompok_beasiswa`, `asal_beasiswa`, `jenis_beasiswa`, `biaya`, `periode`, `tahun`, `metode_pembayaran`, `sk`, `rekap_bukti_pembayaran`, `tanggal_penetapan`, `buka_pendaftaran`, `tampil`, `aktif`, `created_at`, `updated_at`, `user_created`) VALUES
(17, 1, 19, 4, 1, '2000000', 1, 2021, 'Transfer langsung ke rekening penerima', NULL, NULL, '2021-10-03', '0', '1', '1', '2021-10-30 22:34:42', '2021-11-02 07:28:17', NULL),
(18, 14, 21, 10, 3, '2000001', 3, 2021, 'Transfer langsung ke rekening penerimasasd', NULL, NULL, '2021-07-04', '1', '1', '0', '2021-10-30 23:51:12', '2021-11-05 03:54:43', 'adminunp');
-- --------------------------------------------------------
--
-- Table structure for table `master_beasiswa_bp`
--
CREATE TABLE `master_beasiswa_bp` (
`id_master_beasiswa_bp` int(11) NOT NULL,
`id_master_beasiswa` int(11) NOT NULL,
`periode` int(2) NOT NULL,
`tahun` varchar(4) NOT NULL,
`nama_file` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `master_beasiswa_sk`
--
CREATE TABLE `master_beasiswa_sk` (
`id_master_beasiswa_sk` int(11) NOT NULL,
`id_master_beasiswa` int(11) NOT NULL,
`periode` int(2) NOT NULL,
`tahun` varchar(4) NOT NULL,
`nama_file` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `menu`
--
CREATE TABLE `menu` (
`kode_menu` int(10) NOT NULL,
`nama_menu` varchar(50) NOT NULL,
`url` varchar(125) NOT NULL,
`icon` varchar(100) DEFAULT NULL,
`level` enum('main_menu','sub_menu','single_menu') NOT NULL,
`main_menu` varchar(15) DEFAULT NULL,
`aktif` enum('0','1') NOT NULL,
`no_urut` int(11) NOT NULL,
`show` enum('0','1') NOT NULL,
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
`user` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `menu`
--
INSERT INTO `menu` (`kode_menu`, `nama_menu`, `url`, `icon`, `level`, `main_menu`, `aktif`, `no_urut`, `show`, `created_at`, `user`) VALUES
(1, 'Kelompok Beasiswa', 'mbeasiswa/kelompok_beasiswa', NULL, 'sub_menu', '10', '1', 8, '1', '2021-10-06 19:05:41', 'adminunp'),
(2, 'Master Beasiswa', 'mbeasiswa/master_beasiswa', NULL, 'sub_menu', '10', '1', 9, '1', '2021-10-07 20:42:53', 'adminunp'),
(3, 'Manajemen User', 'user', 'fas fa-fw fa-user-plus', 'single_menu', 'null', '1', 10, '1', '2021-10-07 21:55:55', 'adminunp'),
(4, 'Manajemen Penerima Beasiswa', 'data_beasiswa', 'fas fa-fw fa-clipboard-list', 'main_menu', 'null', '1', 11, '1', '2021-10-10 05:39:00', 'adminunp'),
(5, 'Upload Penerima', 'data_beasiswa/beasiswa', '', 'sub_menu', '4', '1', 12, '1', '2021-10-10 05:42:11', 'adminunp'),
(6, 'Konfigurasi', 'konfigurasi', 'fas fa-fw fa-cog', 'main_menu', '', '1', 1, '1', '2021-09-07 17:53:35', 'Admin'),
(7, 'Akses', 'konfigurasi/akses', 'fas fa-fw fa-circle', 'sub_menu', '6', '1', 2, '1', '2021-09-07 17:56:02', 'Admin'),
(8, 'Menu Sistem', 'konfigurasi/menu_sistem', 'fas fa-fw fa-circle', 'sub_menu', '6', '1', 4, '1', '2021-09-07 17:57:48', 'denisuardi'),
(10, 'Manajemen Beasiswa', 'mbeasiswa', 'fas fa-fw fa-user-tie', 'main_menu', 'null', '1', 6, '1', '2021-10-03 18:52:12', 'denisuardi'),
(11, 'Nama Beasiswa', 'mbeasiswa/nama_beasiswa', NULL, 'sub_menu', '10', '1', 7, '1', '2021-10-03 18:56:16', 'denisuardi'),
(18, 'Asal Beasiswa', 'mbeasiswa/asal_beasiswa', NULL, 'sub_menu', '10', '1', 0, '1', '2021-10-22 00:00:00', 'adminunp'),
(20, 'Daftar Penerima', 'mhs', 'fas fa-fw fa-user-graduate', 'single_menu', 'null', '1', 0, '1', '2021-10-25 00:00:00', 'adminunp'),
(21, 'controller', 'mhs/get_ajax', NULL, 'sub_menu', '10', '1', 0, '0', '2021-10-25 00:00:00', 'adminunp'),
(22, 'controller2', 'mhs/coba', NULL, 'sub_menu', '10', '1', 0, '0', '2021-10-26 00:00:00', 'adminunp'),
(23, 'Daftar Beasiswa', 'bsw', 'fas fa-fw fa-graduation-cap', 'single_menu', 'null', '1', 0, '1', '2021-10-28 00:00:00', 'adminunp'),
(24, 'Jenis Beasiswa', 'mbeasiswa/jenis_beasiswa', NULL, 'sub_menu', '10', '1', 0, '1', '2021-10-29 00:00:00', 'adminunp'),
(29, 'Manajemen Mahasiswa', 'data_beasiswa/mahasiswa', NULL, 'sub_menu', '4', '1', 0, '1', '2021-11-04 00:00:00', 'adminunp');
-- --------------------------------------------------------
--
-- Table structure for table `nama_beasiswa`
--
CREATE TABLE `nama_beasiswa` (
`id` int(11) NOT NULL,
`nama_beasiswa` varchar(255) NOT NULL,
`singkatan` varchar(255) NOT NULL,
`keterangan` varchar(1000) NOT NULL,
`profil` varchar(1000) NOT NULL,
`kontak` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `nama_beasiswa`
--
INSERT INTO `nama_beasiswa` (`id`, `nama_beasiswa`, `singkatan`, `keterangan`, `profil`, `kontak`) VALUES
(1, 'Badan Amil Zakat Nasional', 'Baznas', 'Beasiswa baznas', 'Badan Amil Zakat Nasional (BAZNAS) merupakan badan resmi dan satu-satunya yang dibentuk oleh pemerintah berdasarkan Keputusan Presiden RI No. 8 Tahun 2001 yang memiliki tugas dan fungsi menghimpun dan menyalurkan zakat, infaq, dan sedekah (ZIS) pada tingkat nasional. Lahirnya Undang-Undang Nomor 23 Tahun 2011 tentang Pengelolaan Zakat semakin mengukuhkan peran BAZNAS sebagai lembaga yang berwenang melakukan pengelolaan zakat secara nasional. Dalam UU tersebut, BAZNAS dinyatakan sebagai lembaga pemerintah nonstruktural yang bersifat mandiri dan bertanggung jawab kepada Presiden melalui Menteri Agama. Dengan demikian, BAZNAS bersama Pemerintah bertanggung jawab untuk mengawal pengelolaan zakat yang berasaskan: syariat Islam, amanah, kemanfaatan, keadilan, kepastian hukum, terintegrasi dan akuntabilitas.', ''),
(8, 'Kartu Jakarta Mahasiswa Unggul', 'KJMU', 'Besaran KJMU<br>\r\n\r\na. Bantuan Biaya Peningkatan Mutu Pendidikan diberikan dalam bentuk biaya penyelenggaraan pendidikan dan/atau biaya pendukung personal yaitu sebesar Rp 1.500.000 per bulan.<br>\r\nb. Biaya penyelenggaraan pendidikan dikelola oleh PTN dan Penyaluran biaya penyelenggaraan pendidikan ke rekening PTN melalui pendebetan dari rekening mahasiswa berdasarkan Surat Kuasa Pendebetan Biaya Penyelenggaraan Pendidikan.', 'Tentang KJMU\r\nKartu Jakarta Mahasiswa Unggul (KJMU) adalah program pemberian bantuan Biaya Peningkatan Mutu Pendidikan bagi calon/mahasiswa PTN/PTS dari keluarga tidak mampu secara ekonomi dan memiliki potensi akademik yang baik untuk meningkatkan akses dan kesempatan belajar di PTN/PTS dengan dibiayai penuh dari dana APBD Provinsi DKI Jakarta.', ''),
(11, 'Van Deventer-Maas Indonesia', 'VDMI', 'Menyalurkan bantuan terutama dalam bentuk beasiswa dan beberapa pelatihan dan proyek sebagai pembekalan dalam meningkatkan kemampuan atau pengembangan potensi diri. Salah satu kegiatan yang menjadi andalan utama adalah “Pengembangan Kemampuan Diri Pribadi', 'The Van Deventer-Maas Indonesia was established in September 17, 2018 . The foundation founded by Prof. Irfan Dwidya Prijambada, M.Eng., Ph.D. and Dr. Ing. Ir. Ilya Fadjar Maharika, MA., IAI. The Foundation donated by Van Deventer-Maas Stichting Netherland as a non profit social organization especially support Indonesian students in Indonesia, as it\'s mission “To build young talented Indonesian people to be Mandiri” Van Deventer Maas Stichting is governed by the Boards to ensure the good management of the foundation asset to support the program and the strategic plan of Yayasan Van Deventer-Maas Indonesia and to manage the “niche” of fund.', ''),
(14, 'satus', 'satu', 'satus', 'satu', '');
-- --------------------------------------------------------
--
-- Table structure for table `penerima_beasiswa`
--
CREATE TABLE `penerima_beasiswa` (
`id` int(11) NOT NULL,
`nim` varchar(255) NOT NULL,
`master_beasiswa` int(11) NOT NULL,
`historis nilai` varchar(255) NOT NULL,
`bukti_pembayaran` varchar(255) DEFAULT NULL,
`status` int(1) NOT NULL,
`aktif` enum('1','0') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `periode`
--
CREATE TABLE `periode` (
`id` int(11) NOT NULL,
`nama` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `periode`
--
INSERT INTO `periode` (`id`, `nama`) VALUES
(1, 'Januari - Juni'),
(2, 'Juli - Desember'),
(3, 'Januari - Desember\r\n');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`name` varchar(128) NOT NULL,
`username` varchar(128) NOT NULL,
`email` varchar(128) NOT NULL,
`image` varchar(128) NOT NULL,
`password` varchar(256) NOT NULL,
`role_id` int(11) NOT NULL,
`is_active` int(1) NOT NULL,
`date_created` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `name`, `username`, `email`, `image`, `password`, `role_id`, `is_active`, `date_created`) VALUES
(1, 'Deni Suardi', 'denisuardi', 'deni@example.com', 'default.jpg', '$2y$10$ke9//UBxH/0m6OYhWBSSqe3eKro/Z9kCS/xqlFDkIpP9Kgpe34guq', 2, 1, 1627412147),
(6, 'adminunp', 'adminunp', 'admin@gmail.com', 'default.jpg', '$2y$10$IK1e3BaxLXrALPeEyrPhpOqgJVjrJ0fDfehRzlEoKQ0LSpFOrA.Ni', 1, 1, 1627567235),
(30, 'Admin Baznas', 'adminbaznas', 'baznas@gmail.com', 'default.jpg', '$2y$10$r8hw1C66/8kH1w9gUWzGfeG9iufG26ifO5Nc8Jxcit9hORHZQ/DH.', 5, 1, 1635056332),
(31, 'Febriyani Yunus', 'febriyani', 'febriyaniyunus1502@gmail.com', 'default.jpg', '$2y$10$lSCj1xcJJGCqbu8u5aaL8Ov4GV.feQZ8riG888EDPVlsBVGvx1SK6', 19, 1, 1635307864);
-- --------------------------------------------------------
--
-- Table structure for table `user_role`
--
CREATE TABLE `user_role` (
`id` int(11) NOT NULL,
`role` varchar(128) NOT NULL,
`nama_panjang` varchar(100) NOT NULL,
`id_beasiswa` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `user_role`
--
INSERT INTO `user_role` (`id`, `role`, `nama_panjang`, `id_beasiswa`) VALUES
(1, 'administrator', 'Administrator', 0),
(2, 'member', 'Member Biasa', 0),
(5, 'partnershipbaznas', 'Admin Partnership Baznas', 1),
(13, 'partnershipnagari', 'Admin Partnership Bank Nagari', 6),
(14, 'partnershipkjmu', 'Admin Partnership KJMU', 8),
(19, 'adminbeasiswa', 'Admin Beasiswa', 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `akses`
--
ALTER TABLE `akses`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `asal_beasiswa`
--
ALTER TABLE `asal_beasiswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contact_person`
--
ALTER TABLE `contact_person`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `jenis_beasiswa`
--
ALTER TABLE `jenis_beasiswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `kelompok_beasiswa`
--
ALTER TABLE `kelompok_beasiswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mahasiswa`
--
ALTER TABLE `mahasiswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mahasiswa_beasiswa`
--
ALTER TABLE `mahasiswa_beasiswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mahasiswa_beasiswa_bukti_pembayaran`
--
ALTER TABLE `mahasiswa_beasiswa_bukti_pembayaran`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `master_beasiswa`
--
ALTER TABLE `master_beasiswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `master_beasiswa_bp`
--
ALTER TABLE `master_beasiswa_bp`
ADD PRIMARY KEY (`id_master_beasiswa_bp`);
--
-- Indexes for table `master_beasiswa_sk`
--
ALTER TABLE `master_beasiswa_sk`
ADD PRIMARY KEY (`id_master_beasiswa_sk`);
--
-- Indexes for table `menu`
--
ALTER TABLE `menu`
ADD PRIMARY KEY (`kode_menu`);
--
-- Indexes for table `nama_beasiswa`
--
ALTER TABLE `nama_beasiswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `penerima_beasiswa`
--
ALTER TABLE `penerima_beasiswa`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `periode`
--
ALTER TABLE `periode`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_role`
--
ALTER TABLE `user_role`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `akses`
--
ALTER TABLE `akses`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=130;
--
-- AUTO_INCREMENT for table `asal_beasiswa`
--
ALTER TABLE `asal_beasiswa`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `contact_person`
--
ALTER TABLE `contact_person`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `jenis_beasiswa`
--
ALTER TABLE `jenis_beasiswa`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `kelompok_beasiswa`
--
ALTER TABLE `kelompok_beasiswa`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `mahasiswa`
--
ALTER TABLE `mahasiswa`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=260;
--
-- AUTO_INCREMENT for table `mahasiswa_beasiswa`
--
ALTER TABLE `mahasiswa_beasiswa`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=262;
--
-- AUTO_INCREMENT for table `mahasiswa_beasiswa_bukti_pembayaran`
--
ALTER TABLE `mahasiswa_beasiswa_bukti_pembayaran`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `master_beasiswa`
--
ALTER TABLE `master_beasiswa`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `master_beasiswa_bp`
--
ALTER TABLE `master_beasiswa_bp`
MODIFY `id_master_beasiswa_bp` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `master_beasiswa_sk`
--
ALTER TABLE `master_beasiswa_sk`
MODIFY `id_master_beasiswa_sk` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `menu`
--
ALTER TABLE `menu`
MODIFY `kode_menu` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
--
-- AUTO_INCREMENT for table `nama_beasiswa`
--
ALTER TABLE `nama_beasiswa`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `penerima_beasiswa`
--
ALTER TABLE `penerima_beasiswa`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `periode`
--
ALTER TABLE `periode`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
--
-- AUTO_INCREMENT for table `user_role`
--
ALTER TABLE `user_role`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 34.517504
| 961
| 0.65213
|
14a771596af669cfc0f144e46f37d44855656b90
| 919
|
ts
|
TypeScript
|
src/roles/worker.ts
|
SugarF0x/Screeps
|
d21bd0e661b62c9a811ed095f5e405286809646b
|
[
"Unlicense"
] | null | null | null |
src/roles/worker.ts
|
SugarF0x/Screeps
|
d21bd0e661b62c9a811ed095f5e405286809646b
|
[
"Unlicense"
] | null | null | null |
src/roles/worker.ts
|
SugarF0x/Screeps
|
d21bd0e661b62c9a811ed095f5e405286809646b
|
[
"Unlicense"
] | null | null | null |
import { findProxy, findSpawn } from "utils"
export const workerLogic = (creep: Creep) => {
if (shouldSleep(creep)) return
if (creep.store.getFreeCapacity() > 0) harvest(creep)
else deposit(creep)
}
const harvest = (creep: Creep) => {
const proxy = findProxy(creep.room)
if (creep.harvest(proxy) === ERR_NOT_IN_RANGE) creep.moveTo(proxy)
}
const deposit = (creep: Creep) => {
const spawn = findSpawn(creep.room)
if (creep.transfer(spawn, RESOURCE_ENERGY) === ERR_NOT_IN_RANGE) creep.moveTo(spawn)
}
const shouldSleep = (creep: Creep) => {
const creepEnergyCapacity = creep.store.getFreeCapacity()
const storedEnergy = creep.room.energyAvailable
const maxEnergy = creep.room.energyCapacityAvailable
const spawn = findSpawn(creep.room)
const isInSpawnProximity = creep.pos.inRangeTo(spawn.pos, 2)
return (storedEnergy === maxEnergy) && creepEnergyCapacity <= 0 && isInSpawnProximity
}
| 27.848485
| 87
| 0.725789
|
e73b7f5a98eabd569b53d5db84e93748256b924b
| 1,182
|
php
|
PHP
|
lab-09/q3/login.php
|
aghorler/sec-labs
|
bf7124961acc104ae899d318fc32f47739d59dd6
|
[
"MIT"
] | 2
|
2018-08-06T16:14:26.000Z
|
2019-07-31T03:10:23.000Z
|
lab-09/q3/login.php
|
aghorler/sec-labs
|
bf7124961acc104ae899d318fc32f47739d59dd6
|
[
"MIT"
] | null | null | null |
lab-09/q3/login.php
|
aghorler/sec-labs
|
bf7124961acc104ae899d318fc32f47739d59dd6
|
[
"MIT"
] | 1
|
2019-05-26T11:46:29.000Z
|
2019-05-26T11:46:29.000Z
|
<!DOCTYPE html>
<html>
<body>
<?php
include('rsa.php');
$username = $_POST['username'];
$password = $_POST['password'];
echo "<p><strong>POSTed password: </strong>" . $password . "</p>";
$privateKey = get_rsa_privatekey('private.key');
$decrypted = rsa_decryption($password, $privateKey);
echo "<p><strong>POSTed password (decrypted): </strong>" . $decrypted . "</p>";
$value = explode("&", $decrypted);
echo "<p><strong>Current timestamp: </strong>" . time() . "</p>";
echo "<p><strong>POSTed timestamp: </strong>" . $value[1] . "</p>";
if((time() - $value[1]) < 150){
echo "<p><strong>Timestamp difference is less than 150!</strong></p>";
$exist = 0;
foreach(file('database.txt') as $line){
$result = explode(",", $line);
if($result[0] == $username && rtrim($result[1]) == $value[0]){
$exist = 1;
break;
}
}
if($exist == 1){
echo "<p>You are logged in!</p>";
}
else{
echo "<p>Account not found!</p>";
}
}
else{
echo "<p><strong>Timestamp difference is less than 150!</strong></p>";
echo "<p>You are not logged in!</p>";
}
?>
</body>
</html>
| 23.64
| 82
| 0.544839
|
dd7c28baa7a8f02460f8d38dff652aa9f264c65b
| 3,784
|
java
|
Java
|
clients/java/src/main/java/io/zeebe/client/api/command/PublishMessageCommandStep1.java
|
bcgov/zeebe-camunda
|
d53741b799022bca7c4209abf11fa5e6fd690733
|
[
"Apache-2.0"
] | null | null | null |
clients/java/src/main/java/io/zeebe/client/api/command/PublishMessageCommandStep1.java
|
bcgov/zeebe-camunda
|
d53741b799022bca7c4209abf11fa5e6fd690733
|
[
"Apache-2.0"
] | 1
|
2020-04-17T21:58:37.000Z
|
2020-04-17T21:58:37.000Z
|
clients/java/src/main/java/io/zeebe/client/api/command/PublishMessageCommandStep1.java
|
bcgov/zeebe-camunda
|
d53741b799022bca7c4209abf11fa5e6fd690733
|
[
"Apache-2.0"
] | 2
|
2020-07-16T17:15:03.000Z
|
2022-03-16T14:12:51.000Z
|
/*
* Copyright © 2017 camunda services GmbH (info@camunda.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.zeebe.client.api.command;
import java.io.InputStream;
import java.time.Duration;
import java.util.Map;
public interface PublishMessageCommandStep1 {
/**
* Set the name of the message.
*
* @param messageName the name of the message
* @return the builder for this command
*/
PublishMessageCommandStep2 messageName(String messageName);
interface PublishMessageCommandStep2 {
/**
* Set the value of the correlation key of the message.
*
* <p>This value will be used together with the message name to find matching message
* subscriptions.
*
* @param correlationKey the correlation key value of the message
* @return the builder for this command
*/
PublishMessageCommandStep3 correlationKey(String correlationKey);
}
interface PublishMessageCommandStep3 extends FinalCommandStep<Void> {
/**
* Set the id of the message. The message is rejected if another message is already published
* with the same id, name and correlation-key.
*
* @param messageId the id of the message
* @return the builder for this command. Call {@link #send()} to complete the command and send
* it to the broker.
*/
PublishMessageCommandStep3 messageId(String messageId);
/**
* Set the time-to-live of the message. The message can only be correlated within the given
* time-to-live.
*
* <p>If the duration is zero or negative then the message can only be correlated to open
* subscriptions (e.g. to an entered message catch event).
*
* <p>If no duration is set then the default is used from the configuration.
*
* @param timeToLive the time-to-live of the message
* @return the builder for this command. Call {@link #send()} to complete the command and send
* it to the broker.
*/
PublishMessageCommandStep3 timeToLive(Duration timeToLive);
/**
* Set the variables of the message.
*
* @param variables the variables (JSON) as stream
* @return the builder for this command. Call {@link #send()} to complete the command and send
* it to the broker.
*/
PublishMessageCommandStep3 variables(InputStream variables);
/**
* Set the variables of the message.
*
* @param variables the variables (JSON) as String
* @return the builder for this command. Call {@link #send()} to complete the command and send
* it to the broker.
*/
PublishMessageCommandStep3 variables(String variables);
/**
* Set the variables of the message.
*
* @param variables the variables as map
* @return the builder for this command. Call {@link #send()} to complete the command and send
* it to the broker.
*/
PublishMessageCommandStep3 variables(Map<String, Object> variables);
/**
* Set the variables of the message.
*
* @param variables the variables as object
* @return the builder for this command. Call {@link #send()} to complete the command and send
* it to the broker.
*/
PublishMessageCommandStep3 variables(Object variables);
}
}
| 35.037037
| 98
| 0.683668
|
3f4fcbd29da83d8cad48cdbbea4967d5b920cdc9
| 741
|
php
|
PHP
|
application/views/home.php
|
Piusin/Collegems
|
75c2c6a099d99cb05b25aa52567a0828e20a952b
|
[
"MIT"
] | null | null | null |
application/views/home.php
|
Piusin/Collegems
|
75c2c6a099d99cb05b25aa52567a0828e20a952b
|
[
"MIT"
] | null | null | null |
application/views/home.php
|
Piusin/Collegems
|
75c2c6a099d99cb05b25aa52567a0828e20a952b
|
[
"MIT"
] | null | null | null |
<?php include("include/header.php");?>
<div class="container">
<div class="jumbotron">
<h2 class="display-3" style="text align: center;"> ADMIN & CO ADMIN LOGIN</h2>
<hr>
<div class="my-4">
<div class="row">
<?php if(count($chkAdminExist)):?>
<?php else:?>
<div class="col-lg-4">
<?php echo anchor("welcome/adminRegister", "ADMIN REGISTER", ['class'=>'btn btn-primary']);?>
</div>
<?php endif;?>
<div class="col-lg-4">
<?php echo anchor("welcome/login", "ADMIN LOGIN", ['class'=>'btn btn-primary']);?>
</div>
</div>
</div>
</div>
</div>
<?php include("include/footer.php");?>
| 30.875
| 111
| 0.492578
|
2cbcbf06bc2d170744d660890740960491444f2d
| 871
|
c++
|
C++
|
9.1.two.arrays.c++
|
Sambitcr-7/DSA-C-
|
f3c80f54fa6160a99f39a934f330cdf40711de50
|
[
"Apache-2.0"
] | null | null | null |
9.1.two.arrays.c++
|
Sambitcr-7/DSA-C-
|
f3c80f54fa6160a99f39a934f330cdf40711de50
|
[
"Apache-2.0"
] | null | null | null |
9.1.two.arrays.c++
|
Sambitcr-7/DSA-C-
|
f3c80f54fa6160a99f39a934f330cdf40711de50
|
[
"Apache-2.0"
] | null | null | null |
#include <iostream>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r",stdin);
freopen("output.txt","w", stdout);
#endif
int n,m;
cin>>n>>m;
int arr[n][m];
for( int i=0; i<n;i++){
for(int j=0;j<m;j++){
cin>>arr[i][j];
}
}
cout<<"Matrix is:\n";
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cout<<arr[i][j]<<" ";
}
cout<<"\n";
}
int x;
cin>>x;
bool flag=false;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(arr[i][j]==x){
cout<<i<<" "<<j<<"\n";
flag=true;
}
}
}
if(flag){
cout<<"Element is found\n";
}else{
cout<<"Element is not found\n";
}
return 0;
}
| 15.836364
| 38
| 0.375431
|
8e8722caaaec4a17260ef4eaaea14c0cd0fc73ad
| 73
|
rb
|
Ruby
|
lib/driver.rb
|
wyattp23/cs362-exam-practice
|
890ce2dbd42490ba7e85f11b0fc3b68b3cd96e1f
|
[
"FSFAP"
] | null | null | null |
lib/driver.rb
|
wyattp23/cs362-exam-practice
|
890ce2dbd42490ba7e85f11b0fc3b68b3cd96e1f
|
[
"FSFAP"
] | null | null | null |
lib/driver.rb
|
wyattp23/cs362-exam-practice
|
890ce2dbd42490ba7e85f11b0fc3b68b3cd96e1f
|
[
"FSFAP"
] | 61
|
2020-06-04T15:12:13.000Z
|
2022-03-17T22:17:50.000Z
|
#! /usr/bin/env ruby
require_relative 'game'
game = Game.new
game.start
| 12.166667
| 23
| 0.726027
|
456c7876c9e495052b4d059448fc14036e36379f
| 93
|
py
|
Python
|
peco/parser/read_end_for.py
|
Tikubonn/peco
|
c77fc163ad31d3c271d299747914ce4ef3386987
|
[
"MIT"
] | null | null | null |
peco/parser/read_end_for.py
|
Tikubonn/peco
|
c77fc163ad31d3c271d299747914ce4ef3386987
|
[
"MIT"
] | null | null | null |
peco/parser/read_end_for.py
|
Tikubonn/peco
|
c77fc163ad31d3c271d299747914ce4ef3386987
|
[
"MIT"
] | null | null | null |
from .end_for import EndFor
def read_end_for(preread, stream, parser):
raise EndFor()
| 13.285714
| 42
| 0.731183
|
df1599fa46e127e12af2a1bd7fe22a0c09014700
| 62
|
rb
|
Ruby
|
app/controllers/admin/dashboards_controller.rb
|
OpenIntelligence/PolicyAlpha
|
acea77b5eaf691a094ceb50324ca2b04cb416f1a
|
[
"MIT"
] | null | null | null |
app/controllers/admin/dashboards_controller.rb
|
OpenIntelligence/PolicyAlpha
|
acea77b5eaf691a094ceb50324ca2b04cb416f1a
|
[
"MIT"
] | null | null | null |
app/controllers/admin/dashboards_controller.rb
|
OpenIntelligence/PolicyAlpha
|
acea77b5eaf691a094ceb50324ca2b04cb416f1a
|
[
"MIT"
] | null | null | null |
class Admin::DashboardsController < Admin::BaseController
end
| 20.666667
| 57
| 0.83871
|
ef471f38004be78cf252a23e96a25ba0e4430ea0
| 5,352
|
php
|
PHP
|
PembrokePSui/php/managed_files.php
|
jpsider/PembrokePSui
|
2a0ed60053593a0de0d8e260985940b7f27e2653
|
[
"MIT"
] | null | null | null |
PembrokePSui/php/managed_files.php
|
jpsider/PembrokePSui
|
2a0ed60053593a0de0d8e260985940b7f27e2653
|
[
"MIT"
] | 4
|
2018-02-25T21:43:47.000Z
|
2018-04-01T03:36:17.000Z
|
PembrokePSui/php/managed_files.php
|
jpsider/PembrokePSui
|
2a0ed60053593a0de0d8e260985940b7f27e2653
|
[
"MIT"
] | null | null | null |
<!DOCTYPE html>
<html lang="en">
<?php
require_once 'components/header.php';
?>
<!-- Insert Head PHP -->
<?php
if (!empty($_GET['NewManagedFile'])) {
$FILE_NAME=$_GET['FILE_NAME'];
$FILE_PATH=$_GET['FILE_PATH'];
$REBOOT_REQUIRED=$_GET['REBOOT_REQUIRED'];
include 'components/database.php';
$sql = "INSERT INTO MANAGED_FILES (FILE_NAME,FILE_PATH,FILE_HASH,REBOOT_REQUIRED,STATUS_ID) VALUES ('$FILE_NAME','$FILE_PATH','NewFile','$REBOOT_REQUIRED',11)";
$pdo = Database::connect();
$pdo->query($sql);
header("Refresh:0 url=managed_files.php");
}
elseif (!empty($_GET['UpdateManagedFile'])) {
$ID=$_GET['ID'];
$FILE_NAME=$_GET['FILE_NAME'];
$FILE_PATH=$_GET['FILE_PATH'];
$REBOOT_REQUIRED=$_GET['REBOOT_REQUIRED'];
include 'components/database.php';
$pdo = Database::connect();
$sql = "UPDATE MANAGED_FILES SET FILE_NAME='$FILE_NAME',FILE_PATH='$FILE_PATH\',REBOOT_REQUIRED='$REBOOT_REQUIRED' WHERE ID=$ID";
echo $sql;
$pdo->query($sql);
header("Refresh:10 url=managed_files.php");
}
elseif (!empty($_GET['DisableManagedFile'])) {
$ID=$_GET['ID'];
include 'components/database.php';
$pdo = Database::connect();
$sql = "UPDATE MANAGED_FILES SET STATUS_ID=12 WHERE ID=$ID";
$pdo->query($sql);
header("Refresh:0 url=managed_files.php");
}
elseif (!empty($_GET['EnableManagedFile'])) {
$ID=$_GET['ID'];
include 'components/database.php';
$pdo = Database::connect();
$sql = "UPDATE MANAGED_FILES SET STATUS_ID=11 WHERE ID=$ID";
$pdo->query($sql);
header("Refresh:0 url=managed_files.php");
}
else {
?>
<!-- End Head PHP -->
<div class="content-area"><!-- Start content-area -->
<h3>Managed Files</h3>
<table id="example" class="table table-compact">
<thead>
<tr>
<th>ID</th>
<th>File NAME</th>
<th>File Path</th>
<th>File Hash</th>
<th>Reboot Required</th>
<th>Update</th>
<th>Status</th>
<th>Action</th>
<th>date_modified</th>
</tr>
</thead>
<tbody>
<?php
include 'components/database.php';
$pdo = Database::connect();
$sql = 'select mf.ID, '
. 'mf.FILE_NAME, '
. 'mf.FILE_PATH, '
. 'mf.FILE_HASH, '
. 'mf.REBOOT_REQUIRED, '
. 'mf.STATUS_ID, '
. 'mf.date_modified, '
. 's.STATUS_NAME, '
. 's.HTMLCOLOR '
. 'FROM MANAGED_FILES mf '
. 'join STATUS s on mf.STATUS_ID=s.ID';
foreach ($pdo->query($sql) as $row) {
echo '<tr>';
echo '<form action="managed_files.php" method="get">';
echo '<td><input type="hidden" name="ID" value="' . $row['ID'] . '">'. $row['ID'] . '</td>';
echo '<td><input type="text" name="FILE_NAME" value="'. $row['FILE_NAME'] . '"></td>';
echo '<td><input type="text" name="FILE_PATH" value="'. $row['FILE_PATH'] . '"></td>';
echo '<td>'. $row['FILE_HASH'] . '</td>';
echo '<td><input type="text" name="REBOOT_REQUIRED" value="'. $row['REBOOT_REQUIRED'] . '"></td>';
echo '<td><input type="hidden" name="UpdateManagedFile" value="TRUE"><input type="Submit" class="btn btn-success-outline btn-sm" value="Update"</td>';
echo '</form>';
echo '<td style=background-color:'. $row['HTMLCOLOR'] . '><b>'. $row['STATUS_NAME'] . '</b></td>';
if($row['STATUS_ID'] == 11){
echo '<form action="managed_files.php" method="get"><input type="hidden" name="ID" value="' . $row['ID'] . '">';
echo '<td><input type="hidden" name="DisableManagedFile" value="TRUE"><input type="Submit" class="btn btn-warning-outline btn-sm" value="Disable"></td>';
echo '</form>';
} else {
echo '<form action="managed_files.php" method="get"><input type="hidden" name="ID" value="' . $row['ID'] . '">';
echo '<td><input type="hidden" name="EnableManagedFile" value="TRUE"><input type="Submit" class="btn btn-success-outline btn-sm" value="Enable"></td>';
echo '</form>';
}
echo '<td>'. $row['date_modified'] . '</td>';
echo '</tr>';
}
Database::disconnect();
?>
</tbody>
</table>
<table class="table table-compact">
<tr>
<th></th>
<th>Name:</th>
<th>Path:</th>
<th>Restart Required:</th>
<th>Submit</th>
</tr>
<tr>
<form>
<td><b>Add a New Managed File</b></td>
<td>
<input type="text" name="FILE_NAME" value="Enter a NAME">
</td>
<td>
<input type="text" name="FILE_PATH" value="Enter a Path">
</td>
<td>
<input type="text" name="REBOOT_REQUIRED" value="Enter a 0 or 1">
</td>
<td>
<input type="hidden" name="NewManagedFile" value="TRUE"><input type="Submit" class="btn btn-success-outline btn-sm" value="Add Managed File"></td>
</td>
</form>
</tr>
</table>
</div><!-- End content-area -->
<nav class="sidenav">
<?php
require_once 'components/Side_Bar.html';
?>
</nav>
</div><!-- End content-container (From Header) -->
</body>
<!-- Insert if there is Head PHP -->
<?php
}
?>
<!-- End Head PHP closing statement -->
</html>
| 36.657534
| 170
| 0.551196
|
ae4c706cb08b63ab8d129668a3cde1f1ef7ae104
| 103
|
sql
|
SQL
|
004_cte_view_query.sql
|
awksedgreep/pg_jsonb
|
ca742140e92a8ac396e6ccfaa8d5b2dba5305140
|
[
"BSD-2-Clause"
] | 1
|
2022-01-28T20:10:07.000Z
|
2022-01-28T20:10:07.000Z
|
004_cte_view_query.sql
|
awksedgreep/pg_jsonb
|
ca742140e92a8ac396e6ccfaa8d5b2dba5305140
|
[
"BSD-2-Clause"
] | null | null | null |
004_cte_view_query.sql
|
awksedgreep/pg_jsonb
|
ca742140e92a8ac396e6ccfaa8d5b2dba5305140
|
[
"BSD-2-Clause"
] | null | null | null |
SELECT jsonb_pretty(artist_data)
FROM v_json_artist_data
WHERE artist_data->>'name' = 'Miles Davis';
| 25.75
| 43
| 0.786408
|
e70312b8c21fd38d8597147a8c8a03576714db9a
| 2,027
|
lua
|
Lua
|
Game/Scripts/Entities/Others/VisRegPoint.lua
|
Vondoe90/AngryBoids
|
9f6739958a16b450196b28c4533a040a9bc03eb1
|
[
"MIT"
] | 1
|
2016-07-04T15:02:50.000Z
|
2016-07-04T15:02:50.000Z
|
Game/Scripts/Entities/Others/VisRegPoint.lua
|
Vondoe90/AngryBoids
|
9f6739958a16b450196b28c4533a040a9bc03eb1
|
[
"MIT"
] | null | null | null |
Game/Scripts/Entities/Others/VisRegPoint.lua
|
Vondoe90/AngryBoids
|
9f6739958a16b450196b28c4533a040a9bc03eb1
|
[
"MIT"
] | 1
|
2021-02-12T07:29:14.000Z
|
2021-02-12T07:29:14.000Z
|
----------------------------------------------------------------------------------------------------
-- Crytek Source File.
-- Copyright (C), Crytek Studios, 2010
----------------------------------------------------------------------------------------------------
-- $Id$
-- $DateTime$
-- Description: Visual Regression Point - used for visual regression tests, extends TagPoint
--
----------------------------------------------------------------------------------------------------
-- History:
-- - 11:6:2010 12:00 : Created by Christian Helmich
--
----------------------------------------------------------------------------------------------------
Script.ReloadScript("scripts/entities/AI/TagPoint.lua")
VisRegPoint = new(TagPoint);
VisRegPoint.type = "VisRegPoint";
VisRegPoint.Editor = {
Icon = "VisRegPoint.bmp",
Model= "Editor/Objects/Particles.cgf",
};
-------------------------------------------------------
function VisRegPoint:OnInit()
end
function VisRegPoint:OnMove()
TagPoint.OnMove(self);
end
function VisRegPoint:OnReset()
TagPoint.OnReset(self);
end
function VisRegPoint:Input_pos(params, pos)
TagPoint.Input_pos(self, params, pos);
end
function VisRegPoint:Input_rotate(params, rotation)
TagPoint.Input_rotate(self, params, rotation);
end
function VisRegPoint:Input_scale(params, scale)
TagPoint.Input_scale(self, params, scale);
end
function VisRegPoint:Output_pos()
TagPoint.Output_pos(self);
end
function VisRegPoint:Output_rotate()
TagPoint.Output_rotate(self);
end
function VisRegPoint:Output_scale()
TagPoint.Output_scale(self);
end
function VisRegPoint:Output_Directions()
TagPoint.Output_Directions(self);
end
VisRegPoint.FlowEvents =
{
Inputs =
{
pos = { VisRegPoint.Input_pos, "vec3" },
rotate = { VisRegPoint.Input_rotate, "vec3" },
scale = { VisRegPoint.Input_scale, "vec3" },
},
Outputs =
{
pos = "vec3",
rotate = "vec3",
scale = "vec3",
fwdDir = "vec3",
rightDir = "vec3",
upDir = "vec3",
},
}
| 21.336842
| 100
| 0.546621
|
a712811b1ac5685769e40a8a17a0cd6e788c2f80
| 8,798
|
lua
|
Lua
|
src/engine/game/battle/ui/tensionbar.lua
|
Fussmatte/kristal
|
fcbaf241123f80f91b1c525624345b1f7fb64c48
|
[
"BSD-3-Clause"
] | 1
|
2021-12-26T01:11:43.000Z
|
2021-12-26T01:11:43.000Z
|
src/engine/game/battle/ui/tensionbar.lua
|
Fussmatte/kristal
|
fcbaf241123f80f91b1c525624345b1f7fb64c48
|
[
"BSD-3-Clause"
] | null | null | null |
src/engine/game/battle/ui/tensionbar.lua
|
Fussmatte/kristal
|
fcbaf241123f80f91b1c525624345b1f7fb64c48
|
[
"BSD-3-Clause"
] | null | null | null |
local TensionBar, super = Class(Object)
function TensionBar:init(x, y)
super:init(self, x, y)
self.layer = LAYERS["ui"] - 1
self.tp_bar_fill = Assets.getTexture("ui/battle/tp_bar_fill")
self.tp_bar_outline = Assets.getTexture("ui/battle/tp_bar_outline")
self.apparent = 0
self.current = 0
self.change = 0
self.changetimer = 15
self.font = Assets.getFont("main")
self.tp_text = Assets.getTexture("ui/battle/tp_text")
self.parallax_y = 0
self.animating_in = true
self.animation_timer = 0
self.tsiner = 0
self.tension_preview = 0
end
function TensionBar:giveTension(amount)
return self:giveTensionExact(amount * 2.5) / 2.5
end
function TensionBar:removeTension(amount)
return self:removeTensionExact(amount * 2.5) / 2.5
end
function TensionBar:setTension(amount)
self:setTensionExact(amount * 2.5)
end
function TensionBar:getTension()
return Game.battle.tension / 2.5
end
function TensionBar:setMaxTension(amount)
Game.battle.max_tension = amount * 2.5
end
function TensionBar:getMaxTension()
return Game.battle.max_tension / 2.5
end
function TensionBar:setTensionPreview(amount)
self:setTensionPreviewExact(amount * 2.5)
end
function TensionBar:giveTensionExact(amount)
local start = Game.battle.tension
Game.battle.tension = Game.battle.tension + amount
if Game.battle.tension > Game.battle.max_tension then
Game.battle.tension = Game.battle.max_tension
end
self.tension_preview = 0
return Game.battle.tension - start
end
function TensionBar:removeTensionExact(amount)
local start = Game.battle.tension
Game.battle.tension = Game.battle.tension - amount
if Game.battle.tension < 0 then
Game.battle.tension = 0
end
self.tension_preview = 0
return start - Game.battle.tension
end
function TensionBar:setTensionExact(amount)
Game.battle.tension = Utils.clamp(amount, 0, Game.battle.max_tension)
end
function TensionBar:setTensionPreviewExact(amount)
self.tension_preview = amount
end
function TensionBar:update(dt)
if self.animating_in then
self.animation_timer = self.animation_timer + (dt * 30)
if self.animation_timer > 12 then
self.animation_timer = 12
end
self.x = Ease.outCubic(self.animation_timer, -25, 25 + 38, 12)
end
if (math.abs((self.apparent - Game.battle.tension)) < 20) then
self.apparent = Game.battle.tension
elseif (self.apparent < Game.battle.tension) then
self.apparent = self.apparent + (20 * (DT * 30))
elseif (self.apparent > Game.battle.tension) then
self.apparent = self.apparent - (20 * (DT * 30))
end
if (self.apparent ~= self.current) then
self.changetimer = self.changetimer + (1 * (DT * 30))
if (self.changetimer > 15) then
if ((self.apparent - self.current) > 0) then
self.current = self.current + (2 * (DT * 30))
end
if ((self.apparent - self.current) > 10) then
self.current = self.current + (2 * (DT * 30))
end
if ((self.apparent - self.current) > 25) then
self.current = self.current + (3 * (DT * 30))
end
if ((self.apparent - self.current) > 50) then
self.current = self.current + (4 * (DT * 30))
end
if ((self.apparent - self.current) > 100) then
self.current = self.current + (5 * (DT * 30))
end
if ((self.apparent - self.current) < 0) then
self.current = self.current - (2 * (DT * 30))
end
if ((self.apparent - self.current) < -10) then
self.current = self.current - (2 * (DT * 30))
end
if ((self.apparent - self.current) < -25) then
self.current = self.current - (3 * (DT * 30))
end
if ((self.apparent - self.current) < -50) then
self.current = self.current - (4 * (DT * 30))
end
if ((self.apparent - self.current) < -100) then
self.current = self.current - (5 * (DT * 30))
end
if (math.abs((self.apparent - self.current)) < 3) then
self.current = self.apparent
end
end
end
if (self.tension_preview > 0) then
self.tsiner = self.tsiner + DTMULT
end
super:update(self, dt)
end
function TensionBar:draw()
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(self.tp_bar_outline, 0, 0)
love.graphics.setColor(128/255, 0, 0, 1)
Draw.pushScissor()
Draw.scissor(0, 0, 25, 196 - ((self.current / Game.battle.max_tension) * 196) + 1)
love.graphics.draw(self.tp_bar_fill, 0, 0)
Draw.popScissor()
if (self.apparent < self.current) then
love.graphics.setColor(1, 0, 0, 1)
Draw.pushScissor()
Draw.scissor(0, 196 - ((self.current / Game.battle.max_tension) * 196) + 1, 25, 196)
love.graphics.draw(self.tp_bar_fill, 0, 0)
Draw.popScissor()
love.graphics.setColor(255 / 255, 160 / 255, 64 / 255, 1)
Draw.pushScissor()
Draw.scissor(0, 196 - ((self.apparent / Game.battle.max_tension) * 196) + 1 + ((self.tension_preview / Game.battle.max_tension) * 196), 25, 196)
love.graphics.draw(self.tp_bar_fill, 0, 0)
Draw.popScissor()
elseif (self.apparent > self.current) then
love.graphics.setColor(1, 1, 1, 1)
Draw.pushScissor()
Draw.scissor(0, 196 - ((self.apparent / Game.battle.max_tension) * 196) + 1, 25, 196)
love.graphics.draw(self.tp_bar_fill, 0, 0)
Draw.popScissor()
love.graphics.setColor(255 / 255, 160 / 255, 64 / 255, 1)
if (self.maxed) then
love.graphics.setColor(255 / 255, 208 / 255, 32 / 255, 1)
end
Draw.pushScissor()
Draw.scissor(0, 196 - ((self.current / Game.battle.max_tension) * 196) + 1 + ((self.tension_preview / Game.battle.max_tension) * 196), 25, 196)
love.graphics.draw(self.tp_bar_fill, 0, 0)
Draw.popScissor()
elseif (self.apparent == self.current) then
love.graphics.setColor(255 / 255, 160 / 255, 64 / 255, 1)
if (self.maxed) then
love.graphics.setColor(255 / 255, 208 / 255, 32 / 255, 1)
end
Draw.pushScissor()
Draw.scissor(0, 196 - ((self.current / Game.battle.max_tension) * 196) + 1 + ((self.tension_preview / Game.battle.max_tension) * 196), 25, 196)
love.graphics.draw(self.tp_bar_fill, 0, 0)
Draw.popScissor()
end
if (self.tension_preview > 0) then
local alpha = (math.abs((math.sin((self.tsiner / 8)) * 0.5)) + 0.2)
local color_to_set = {1, 1, 1, alpha}
local theight = 196 - ((self.current / Game.battle.max_tension) * 196)
local theight2 = theight + ((self.tension_preview / Game.battle.max_tension) * 196)
-- Note: DOESNT cause a visual bug. Sorry
if (theight2 > 196) then
theight2 = 196
color_to_set = {COLORS.dkgray[1], COLORS.dkgray[2], COLORS.dkgray[3], 0.7}
end
Draw.pushScissor()
Draw.scissor(0, theight2 + 1, 25, math.floor(theight + 1))
-- No idea how Deltarune draws this, cause this code was added in Kristal:
local r,g,b,_ = love.graphics.getColor()
love.graphics.setColor(r, g, b, 0.7)
love.graphics.draw(self.tp_bar_fill, 0, 0)
-- And back to the translated code:
love.graphics.setColor(color_to_set)
love.graphics.draw(self.tp_bar_fill, 0, 0)
Draw.popScissor()
love.graphics.setColor(1, 1, 1, 1)
end
if ((self.apparent > 20) and (self.apparent < Game.battle.max_tension)) then
love.graphics.setColor(1, 1, 1, 1)
Draw.pushScissor()
Draw.scissor(0, 196 - ((self.current / Game.battle.max_tension) * 196) + 1, 25, 196 - ((self.current / Game.battle.max_tension) * 196) + 3)
love.graphics.draw(self.tp_bar_fill, 0, 0)
Draw.popScissor()
end
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(self.tp_text, -30, 30)
local tamt = math.floor(((self.apparent / Game.battle.max_tension) * 100))
self.maxed = false
love.graphics.setFont(self.font)
if (tamt < 100) then
love.graphics.print(tostring(math.floor((self.apparent / Game.battle.max_tension) * 100)), -30, 70)
love.graphics.print("%", -25, 95)
end
if (tamt >= 100) then
self.maxed = true
love.graphics.setColor(1, 1, 0, 1)
love.graphics.print("M", -28, 70)
love.graphics.print("A", -24, 90)
love.graphics.print("X", -20, 110)
end
super:draw(self)
end
return TensionBar
| 34.501961
| 152
| 0.609798
|
4563f83c19a4fbf5202fd6315a422e4104952ea4
| 3,995
|
py
|
Python
|
fixture/project.py
|
vyacheslavmarkov/python_training_mantis
|
0818f9705733169efdfd6f2b5762a3a9e0b979eb
|
[
"Apache-2.0"
] | null | null | null |
fixture/project.py
|
vyacheslavmarkov/python_training_mantis
|
0818f9705733169efdfd6f2b5762a3a9e0b979eb
|
[
"Apache-2.0"
] | null | null | null |
fixture/project.py
|
vyacheslavmarkov/python_training_mantis
|
0818f9705733169efdfd6f2b5762a3a9e0b979eb
|
[
"Apache-2.0"
] | null | null | null |
from model.project import Project
from selenium.webdriver.support.select import Select
import string
import random
import re
class ProjectHelper:
def __init__(self, app):
self.app = app
project_cache = None
def random_string(self, prefix, maxlen):
symbols = string.ascii_letters + string.digits + " " * 10
return prefix + "".join([random.choice(symbols) for i in range(random.randrange(maxlen))])
def create(self, project):
wd = self.app.wd
self.open_projects_management_page()
wd.find_element_by_xpath("//input[@value='Create New Project']").click()
self.fill_project_form(project)
wd.find_element_by_xpath("//input[@value='Add Project']").click()
self.project_cache = None
def create_simple_project(self):
project = Project(name=self.random_string("name", 10), status="development", view_status="private",
description="description")
self.create(project)
def open_projects_management_page(self):
wd = self.app.wd
if not wd.current_url.endswith("/mantisbt-1.2.20/manage_proj_page.php"):
wd.find_element_by_link_text("Manage").click()
wd.find_element_by_link_text("Manage Projects").click()
def fill_project_form(self, project):
wd = self.app.wd
wd.find_element_by_name("name").click()
wd.find_element_by_name("name").clear()
wd.find_element_by_name("name").send_keys(project.name)
wd.find_element_by_name("status").click()
Select(wd.find_element_by_name("status")).select_by_visible_text(project.status)
wd.find_element_by_name("view_state").click()
Select(wd.find_element_by_name("view_state")).select_by_visible_text(project.view_status)
wd.find_element_by_name("description").click()
wd.find_element_by_name("description").clear()
wd.find_element_by_name("description").send_keys(project.description)
def get_projects_list(self):
if self.project_cache is None:
wd = self.app.wd
self.open_projects_management_page()
self.project_cache = []
elements = wd.find_elements_by_xpath("/html/body/table[3]/tbody/tr")[2:]
for element in elements:
columns = element.find_elements_by_xpath(".//td")
name = columns[0].find_element_by_xpath(".//a").text
link = columns[0].find_element_by_xpath(".//a").get_attribute('href')
id = link[link.find("=") + 1:]
status = columns[1].text
view_status = columns[3].text
description = columns[4].text
self.project_cache.append(Project(name=name, status=status, view_status=view_status,
description=description, id=id))
return list(self.project_cache)
def delete_project_by_index(self, index):
wd = self.app.wd
self.open_projects_management_page()
elements = wd.find_elements_by_xpath("/html/body/table[3]/tbody/tr")[2:]
elements[index].find_element_by_xpath(".//td//a").click()
wd.find_element_by_xpath("//input[@value='Delete Project']").click()
# confirmation of deletion
wd.find_element_by_xpath("//input[@value='Delete Project']").click()
self.project_cache = None
def delete_project_by_id(self, id):
wd = self.app.wd
self.open_projects_management_page()
wd.find_element_by_xpath("//a[@href='manage_proj_edit_page.php?project_id=%s']" % id).click()
wd.find_element_by_xpath("//input[@value='Delete Project']").click()
# confirmation of deletion
wd.find_element_by_xpath("//input[@value='Delete Project']").click()
self.project_cache = None
def truncate_whitespaces(self, s):
cleared_str = re.sub("\s+", " ", s)
cleared_str = cleared_str.strip()
return cleared_str
| 42.5
| 107
| 0.643554
|
df19fe9f658c05bd1a16f012303c1be79465bdf5
| 1,064
|
rb
|
Ruby
|
wearlog/app/models/image.rb
|
hoshinari/FK_1809
|
403d581d3062133e0fc0fac93dd0a3cb0a7ad065
|
[
"MIT"
] | 2
|
2018-10-28T00:55:59.000Z
|
2018-12-25T10:12:08.000Z
|
wearlog/app/models/image.rb
|
hoshinari/FK_1809
|
403d581d3062133e0fc0fac93dd0a3cb0a7ad065
|
[
"MIT"
] | null | null | null |
wearlog/app/models/image.rb
|
hoshinari/FK_1809
|
403d581d3062133e0fc0fac93dd0a3cb0a7ad065
|
[
"MIT"
] | 1
|
2018-10-28T05:49:12.000Z
|
2018-10-28T05:49:12.000Z
|
class Image < ApplicationRecord
require 'net/http'
require 'uri'
def self.send_notify
event = Event.find_by(start_date: Date.current)
return unless event
token = ""
File.open("#{Rails.root.to_s}/lib/assets/token.txt", mode = "rt"){|f|
token = f.read
}
uri = URI.parse("https://notify-api.line.me/api/notify")
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
event_str = event ? "今日の予定: #{event.title}" : ""
msg = "今日の天気:#{Weather.today[:weather]}\n#{event_str}\n前回の#{event.title}で着ていた服はこちらです。"
prev_event = Event.where(title: event.title).order("start_date desc").second
prev_wear = Image.find_by(wear_date: prev_event.start_date)
img = File.open("#{Rails.root.to_s}/app/assets/images/wear_images/#{prev_wear.image_path}", mode = "r+b")
data = [
["message", msg],
["imageFile", img]
]
req = Net::HTTP::Post.new(uri.request_uri)
req["Authorization"] = "Bearer #{token}"
req.set_form(data, "multipart/form-data")
res = https.request(req)
end
end
| 32.242424
| 109
| 0.644737
|
88fb70762128a91c540b352d79373b5e1335dc07
| 1,756
|
cs
|
C#
|
DistancesTranslator/Program.cs
|
rdanigo/DistanceTranslator
|
a7d42448df44176fadcc7e17b4309c96bc1e1498
|
[
"MIT"
] | null | null | null |
DistancesTranslator/Program.cs
|
rdanigo/DistanceTranslator
|
a7d42448df44176fadcc7e17b4309c96bc1e1498
|
[
"MIT"
] | null | null | null |
DistancesTranslator/Program.cs
|
rdanigo/DistanceTranslator
|
a7d42448df44176fadcc7e17b4309c96bc1e1498
|
[
"MIT"
] | null | null | null |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DistancesTranslator
{
public class Program
{
public string OriginDistance;
public string DestinyDistance;
public string[] parts;
public string InputPath = @"C:\Users\rdaniellagomez\source\repos\DistancesTranslator\Input.txt";
public string OutputPath = @"C:\Users\rdaniellagomez\source\repos\DistancesTranslator\Output.txt";
public double Destiny;
public Dictionary<string, int> DistanceTypes = new Dictionary<string, int>
{
{ "MM", 1 },
{ "CM", 2 },
{ "dM", 3 },
{ "M", 4 },
{ "DM", 5 },
{ "HM", 6 },
{ "KM", 7 },
};
public void Formater()
{
TxtHandler txtHandler = new TxtHandler();
txtHandler.OutputPath = OutputPath;
txtHandler.InputPath = InputPath;
parts = txtHandler.ReadTxt();
Converter(DistanceTypes[parts[1]], DistanceTypes[parts[2]], Convert.ToDouble(parts[0]), parts[1], parts[2]);
txtHandler.WriteTxt(Convert.ToDouble(parts[0]), parts[1], parts[2], Destiny);
}
public void Converter(int Distance, int Distance2, double origin, string OriginDistance, string DestinyDistance)
{
DistanceConverter converter = new DistanceConverter();
Destiny = converter.Convert(Distance, Distance2, origin, OriginDistance, DestinyDistance);
}
static void Main(string[] args)
{
Program program = new Program();
program.Formater();
Console.ReadKey();
}
}
}
| 31.927273
| 120
| 0.587699
|
bb0f3a14af9b6c119387553dfb8b78a54f5d3b49
| 1,948
|
cs
|
C#
|
src/Spark/Compiler/NodeVisitors/NameUtility.cs
|
Yoshi325/spark
|
da58c19574c88cca9685ce7c25f58d876a21cfe3
|
[
"Apache-2.0"
] | 99
|
2015-01-02T14:15:29.000Z
|
2021-09-11T16:28:02.000Z
|
src/Spark/Compiler/NodeVisitors/NameUtility.cs
|
dtabuenc/spark
|
5488c035f5690a80cf5c167e85efee73855b3855
|
[
"Apache-2.0"
] | 13
|
2015-02-02T23:00:34.000Z
|
2021-08-24T15:12:13.000Z
|
src/Spark/Compiler/NodeVisitors/NameUtility.cs
|
dtabuenc/spark
|
5488c035f5690a80cf5c167e85efee73855b3855
|
[
"Apache-2.0"
] | 44
|
2015-02-02T22:56:44.000Z
|
2021-11-12T21:09:27.000Z
|
// Copyright 2008-2009 Louis DeJardin - http://whereslou.com
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Spark.Compiler.NodeVisitors
{
static class NameUtility
{
public static string GetPrefix(string name)
{
var colonIndex = name.IndexOf(':');
return colonIndex <= 0 ? "" : name.Substring(0, colonIndex);
}
public static string GetName(string name)
{
var colonIndex = name.IndexOf(':');
if (colonIndex < 0)
return name;
return name.Substring(colonIndex + 1);
}
public static bool IsMatch(string matchName, NamespacesType type, string name, string ns)
{
if (type == NamespacesType.Unqualified)
return name == matchName;
if (ns != Constants.Namespace)
return false;
return GetName(name) == matchName;
}
public static bool IsMatch(string nameA, string namespaceA, string nameB, string namespaceB, NamespacesType type)
{
if (type == NamespacesType.Unqualified)
return nameA == nameB;
return namespaceA == namespaceB &&
GetName(nameA) == GetName(nameB);
}
}
}
| 33.016949
| 122
| 0.604209
|
9403e04cf13c9c3e38c349fc8e57354e7263f097
| 5,803
|
dart
|
Dart
|
test/src/validators/compare_validator_test.dart
|
derolf/reactive_forms
|
ca17771bd9cd49f03b9694a37e4109d4b8d1b296
|
[
"MIT"
] | null | null | null |
test/src/validators/compare_validator_test.dart
|
derolf/reactive_forms
|
ca17771bd9cd49f03b9694a37e4109d4b8d1b296
|
[
"MIT"
] | 1
|
2021-03-01T23:17:10.000Z
|
2021-03-01T23:17:10.000Z
|
test/src/validators/compare_validator_test.dart
|
derolf/reactive_forms
|
ca17771bd9cd49f03b9694a37e4109d4b8d1b296
|
[
"MIT"
] | 2
|
2021-02-22T10:07:58.000Z
|
2021-03-21T02:21:50.000Z
|
import 'package:flutter_test/flutter_test.dart';
import 'package:reactive_forms/reactive_forms.dart';
void main() {
group('Compare Validator Tests', () {
test('Lower compare', () {
// Given: a valid form
final form = fb.group({
'amount': 10,
'balance': 20,
}, [
Validators.compare('amount', 'balance', CompareOption.lower),
]);
// Expect: form is valid
expect(form.valid, true);
});
test('Lower compare invalid', () {
// Given: an invalid form
final form = fb.group({
'amount': 10,
'balance': 10,
}, [
Validators.compare('amount', 'balance', CompareOption.lower),
]);
// Expect: form is invalid
expect(form.valid, false);
});
test('Lower or equal compare', () {
// Given: a valid form
final form = fb.group({
'amount': 10,
'balance': 20,
}, [
Validators.compare('amount', 'balance', CompareOption.lower_or_equal),
]);
// Expect: form is valid
expect(form.valid, true);
});
test('Lower or equal compare valid', () {
// Given: an invalid form
final form = fb.group({
'amount': 10,
'balance': 10,
}, [
Validators.compare('amount', 'balance', CompareOption.lower_or_equal),
]);
// Expect: form is invalid
expect(form.valid, true);
});
test('Lower or equal compare invalid', () {
// Given: an invalid form
final form = fb.group({
'amount': 11,
'balance': 10,
}, [
Validators.compare('amount', 'balance', CompareOption.lower_or_equal),
]);
// Expect: form is invalid
expect(form.valid, false);
});
test('Equal compare valid', () {
// Given: an invalid form
final form = fb.group({
'amount': 10,
'balance': 10,
}, [
Validators.compare('amount', 'balance', CompareOption.equal),
]);
// Expect: form is invalid
expect(form.valid, true);
});
test('Equal compare lower (invalid)', () {
// Given: an invalid form
final form = fb.group({
'amount': 5,
'balance': 10,
}, [
Validators.compare('amount', 'balance', CompareOption.equal),
]);
// Expect: form is invalid
expect(form.valid, false);
});
test('Equal compare greater (invalid)', () {
// Given: an invalid form
final form = fb.group({
'amount': 10,
'balance': 15,
}, [
Validators.compare('amount', 'balance', CompareOption.equal),
]);
// Expect: form is invalid
expect(form.valid, false);
});
test('Greater compare', () {
// Given: an invalid form
final form = fb.group({
'amount': 20,
'balance': 10,
}, [
Validators.compare('amount', 'balance', CompareOption.greater),
]);
// Expect: form is invalid
expect(form.valid, true);
});
test('Greater compare invalid (equal values)', () {
// Given: an invalid form
final form = fb.group({
'amount': 20,
'balance': 20,
}, [
Validators.compare('amount', 'balance', CompareOption.greater),
]);
// Expect: form is invalid
expect(form.valid, false);
});
test('Greater compare invalid (lower values)', () {
// Given: an invalid form
final form = fb.group({
'amount': 10,
'balance': 20,
}, [
Validators.compare('amount', 'balance', CompareOption.greater),
]);
// Expect: form is invalid
expect(form.valid, false);
});
test('Greater or equal compare', () {
// Given: an invalid form
final form = fb.group({
'amount': 20,
'balance': 10,
}, [
Validators.compare('amount', 'balance', CompareOption.greater_or_equal),
]);
// Expect: form is invalid
expect(form.valid, true);
});
test('Greater or equal compare (equal values)', () {
// Given: an invalid form
final form = fb.group({
'amount': 20,
'balance': 20,
}, [
Validators.compare('amount', 'balance', CompareOption.greater_or_equal)
]);
// Expect: form is invalid
expect(form.valid, true);
});
test('Greater or equal compare (invalid)', () {
// Given: an invalid form
final form = fb.group({
'amount': 20,
'balance': 30,
}, [
Validators.compare('amount', 'balance', CompareOption.greater_or_equal),
]);
// Expect: form is invalid
expect(form.valid, false);
});
// test('Assert error on Null arguments', () {
// expect(() => CompareValidator(null, '', CompareOption.equal),
// throwsAssertionError);
// expect(() => CompareValidator('', null, CompareOption.equal),
// throwsAssertionError);
// expect(() => CompareValidator('', '', null), throwsAssertionError);
// });
test('Compare DateTime controls', () {
// Given: an invalid form
final form = fb.group({
'expedition': DateTime(2020),
'expiration': DateTime(1985),
}, [
Validators.compare('expedition', 'expiration', CompareOption.lower),
]);
// Expect: form is invalid
expect(form.valid, false);
});
// test('Compare null DateTime values', () {
// // Given: an invalid form
// final form = fb.group({
// 'expedition': fb.control<DateTime>(null),
// 'expiration': fb.control<DateTime>(null),
// }, [
// Validators.compare('expedition', 'expiration', CompareOption.lower),
// ]);
//
// // Expect: form is invalid
// expect(form.valid, false);
// });
});
}
| 26.865741
| 80
| 0.534896
|
0a6c57ee682b35488f92669bb8774e1ec9da0cf6
| 840
|
cs
|
C#
|
SmartValley.WebApi/Feedbacks/FeedbackService.cs
|
SmartValleyEcosystem/smartvalley
|
fa279a8ffcb2957030c3df6fb0d037c2f0840f34
|
[
"MIT"
] | 4
|
2018-04-04T14:39:31.000Z
|
2021-03-06T09:36:21.000Z
|
SmartValley.WebApi/Feedbacks/FeedbackService.cs
|
SmartValleyEcosystem/smartvalley
|
fa279a8ffcb2957030c3df6fb0d037c2f0840f34
|
[
"MIT"
] | null | null | null |
SmartValley.WebApi/Feedbacks/FeedbackService.cs
|
SmartValleyEcosystem/smartvalley
|
fa279a8ffcb2957030c3df6fb0d037c2f0840f34
|
[
"MIT"
] | 4
|
2018-04-06T20:14:48.000Z
|
2019-11-20T06:23:51.000Z
|
using System.Threading.Tasks;
using SmartValley.Domain.Core;
using SmartValley.Domain.Entities;
using SmartValley.Domain.Interfaces;
using SmartValley.WebApi.Feedbacks.Requests;
namespace SmartValley.WebApi.Feedbacks
{
public class FeedbackService : IFeedbackService
{
private readonly IFeedbackRepository _repository;
public FeedbackService(IFeedbackRepository repository)
{
_repository = repository;
}
public Task AddAsync(CreateFeedbackRequest request)
{
_repository.Add(new Feedback(request.FirstName, request.LastName, request.Email, request.Text));
return _repository.SaveChangesAsync();
}
public Task<PagingCollection<Feedback>> GetAsync(int offset, int count)
=> _repository.GetAsync(offset, count);
}
}
| 31.111111
| 108
| 0.704762
|
2fa1084a1feeed4394f0865ef6038f23e9ec3185
| 570
|
py
|
Python
|
src/webdev/server-side/hello/application.py
|
tangaw/cs50
|
1ed09b3199f6a366c43d3b0ecd89481b1650af17
|
[
"MIT"
] | null | null | null |
src/webdev/server-side/hello/application.py
|
tangaw/cs50
|
1ed09b3199f6a366c43d3b0ecd89481b1650af17
|
[
"MIT"
] | 6
|
2021-02-07T21:47:03.000Z
|
2021-03-04T20:56:34.000Z
|
src/webdev/server-side/hello/application.py
|
tangaw/cs50
|
1ed09b3199f6a366c43d3b0ecd89481b1650af17
|
[
"MIT"
] | null | null | null |
from flask import Flask, render_template, request
app = Flask(__name__) # Turns current file into an application
# Specifying URL path/route
@app.route("/") # `@` is a specialy Python declarator
def index():
# Render HTML template
# Use the `request` library to parse URL input "name" and store in variable `name`
# Set "world" as default value for `name`
return render_template("index.html")
# Point to alternate URL path
@app.route("/greet", methods=['POST'])
def greet():
return render_template("greet.html", name=request.form.get("name", "world"))
| 31.666667
| 84
| 0.712281
|
a9decaed9ac3759a341711d90983c0c1cff3e82a
| 3,491
|
php
|
PHP
|
app/lang/en/messages.php
|
ashah-kaira/laravel-4.2-Test
|
cc8ee1eefab61df7c9fd99759f9bc149869367d7
|
[
"MIT"
] | null | null | null |
app/lang/en/messages.php
|
ashah-kaira/laravel-4.2-Test
|
cc8ee1eefab61df7c9fd99759f9bc149869367d7
|
[
"MIT"
] | null | null | null |
app/lang/en/messages.php
|
ashah-kaira/laravel-4.2-Test
|
cc8ee1eefab61df7c9fd99759f9bc149869367d7
|
[
"MIT"
] | null | null | null |
<?php
return array(
"PropertyRequired"=>":attribute is required",
"MobileAlreadyRegistered"=>"Oops, this mobile number is already in use. Try entering a different one.",
"EmailAlreadyRegistered"=>"Oops, this email is already in use. Try entering a different one.",
"UserCreationSuccess"=>"User creation successfully",
"UserUpdateSuccess"=>"User update successfully",
"LoginSuccess" => "You are logged in successfully!!",
"OTPverified"=>"Your OTP is verified",
"OTPincorrect"=>"You enter wrong OTP, Please enter correct OTP",
"LoginFail"=>"Incorrect username or password",
"NoRecordFound"=>"No Record Found.",
"InvalidUserNamePassword" => "An account with this username and/or password could not be found.",
"PasswordWasWrong" => "Provided password is not valid.",
"TokenIsNotValid"=> "Provided token is not valid.",
"LogoutSuccess" => "You are log out successfully!!",
"UserAlreadyRegistered" => "Oops, this e-mail is already in use. Try entering a different one.",
"JobCreationSuccess" => "Thanks for your order! Sit back and relax. We will notify you when we receive your quotes.",
"JobUpdateSuccess"=> "Job updated successfully.",
"JobCreationFail" => "Failed to create job, Please try again.",
"ErrorOccured" => "There is some error. Please try later.",
"CannotBid" => "Sorry, you can't bid on this job.",
"AlreadyBided" => "Sorry, you have already bided for this job.",
"BidSuccess" => "Your bid was sent to the client. We will notify you when it has been accepted. Thank you!",
"ForMobileAccountCreated" => "Account created successfully.Verification mail has been sent your email address please verify from email.",
"AccountCreated" => "Account created successfully.Verification m has been sent your email address please verify from email.",
"AccountUpdated" => "Account updated successfully.",
"AddDriver" => "Driver created successfully",
"ProfileUpdate" => "Profile updated successfully.",
"DriverDeletedSuccessfully" => "Driver Deleted Successfully.",
"ProfileUpdated" => "Profile Updated sucesfully.",
"ForgotEmailSent" => "Email sent successfully.Please follow instructions provided in email.",
"NoUserWithThisEmail" => "No user exist into system with supplied email address.",
"NoUserWithThisEmailAndPassword" => "Provided old password seems wrong, please provide accurate information or contact administrations.",
"NoProjectFound" => "No Project Found.",
"NoIssueFound" => "No Issue Found.",
"NoHistoryFound" => "No History Found.",
"NoDescriptionFound"=>"No Description Found",
"history.title.unknown"=>"Unknown Title",
"newIssueCreated"=>"New issue created",
'date.relative.days.plural' => 'days ago',
'date.relative.days.singular' => 'yesterday',
'date.relative.hours.plural' => 'hours ago',
'date.relative.hours.singular' => 'about an hour ago',
'date.relative.minutes.plural' => ' minutes ago',
'date.relative.minutes.singular' => ' minute ago',
'date.relative.months.plural' => ' months ago',
'date.relative.months.singular' => ' month ago',
'date.relative.never' => 'Never',
'date.relative.seconds' => 'less than a minute ago',
'date.relative.weeks.plural' => 'weeks ago',
'date.relative.weeks.singular' => 'about a week ago',
'date.relative.years.plural' => ' years ago',
'date.relative.years.singular' => 'about a year ago',
'date.timezone.invalid' => 'Invalid timezone.',
'attachement.deleted' => 'Attachment Deleted.',
'comment.deleted' => 'Comment Deleted.',
'issue.updated' => 'Issue has been updated.',
'comment.updated' => 'Comment has been updated.',
);
| 51.338235
| 137
| 0.737897
|
da58d526ccb9ab6ecd883b1af4c8ef2f378daf29
| 839
|
php
|
PHP
|
wordpress-material-design.php
|
wissile/wordpress-material-design
|
fb5190f9ec81efecf4e8585848c3f5d1107214fb
|
[
"MIT"
] | null | null | null |
wordpress-material-design.php
|
wissile/wordpress-material-design
|
fb5190f9ec81efecf4e8585848c3f5d1107214fb
|
[
"MIT"
] | null | null | null |
wordpress-material-design.php
|
wissile/wordpress-material-design
|
fb5190f9ec81efecf4e8585848c3f5d1107214fb
|
[
"MIT"
] | null | null | null |
<?php
/**
* Created by PhpStorm.
* User: wissilesogoyou
* Date: 9/11/15
* Time: 4:12 PM
*
* Plugin Name: Material Design
* Plugin URI: http://www.sogoyou.org
* Description: Material Design
* Author: Wissile Sogoyou
* Author URI: http://www.sogoyou.org
* Version: 1.0
*/
// function for wordpress script & stylesheet enqueue
function theme_enqueue_material(){
wp_enqueue_style('materialize-css', 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/css/materialize.min.css');
wp_enqueue_script('jquery-js', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js' , array(), false, true);
wp_enqueue_script('materialize-js', 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/js/materialize.min.js' , array(), false, true);
}
add_action('wp_enqueue_scripts', 'theme_enqueue_material');
| 31.074074
| 146
| 0.718713
|
628a989702c63e95ada0197a316a476491d35a02
| 616
|
lua
|
Lua
|
test/test.lua
|
crowleaj/ApolloParser
|
135ca7aec83e7f44dadc3c81989e7cb362bbc216
|
[
"MIT"
] | null | null | null |
test/test.lua
|
crowleaj/ApolloParser
|
135ca7aec83e7f44dadc3c81989e7cb362bbc216
|
[
"MIT"
] | null | null | null |
test/test.lua
|
crowleaj/ApolloParser
|
135ca7aec83e7f44dadc3c81989e7cb362bbc216
|
[
"MIT"
] | null | null | null |
require "parser"
runfile("capabilities/04_arrays",true)
--[[
A = {
b = function() B.b() end
}
B = {
b = function() print "hi" end
}
A.b()
--]]
--runfile("../scripts/controller.ns",false)
--print(m.x)
--[[Entity = {
__init = function (self,name)
local this = {x=0,y=0}
this.name = name
setmetatable(o,self)
return o
end,
move = function(self,x,y)
self.x = x
self.y = y
end
}
Entity.__index = Entity
local m = Entity:__init("Alice")
local v = Entity:__init("Bob")
m:move(2,3)
print(m.x)
print(v.name)--
print(5,4,6,7)
print(print(5,4,p(6)(10)),6,7)
print(tryit[1](0)[1]())
var q = 6
]]
| 13.106383
| 43
| 0.592532
|
3f1eb3fa89ba100b1afade25a08879ec2cafdf59
| 204
|
php
|
PHP
|
application/views/include/style/categories_style.php
|
andresetiawan-as/allsensor
|
dd798878b88858b2e11458c31cf64de8266569d1
|
[
"MIT"
] | null | null | null |
application/views/include/style/categories_style.php
|
andresetiawan-as/allsensor
|
dd798878b88858b2e11458c31cf64de8266569d1
|
[
"MIT"
] | null | null | null |
application/views/include/style/categories_style.php
|
andresetiawan-as/allsensor
|
dd798878b88858b2e11458c31cf64de8266569d1
|
[
"MIT"
] | null | null | null |
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/categories.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/categories_responsive.css">
| 102
| 107
| 0.730392
|
a8cb06b394ad639a2b0aa7eb6f5348141695e82a
| 592
|
go
|
Go
|
converter/lower.go
|
go-ee/kazaam
|
3bdf947c1706647211ab4a340f8de2908475b8a2
|
[
"MIT"
] | 3
|
2019-03-15T16:28:34.000Z
|
2019-06-04T21:45:32.000Z
|
converter/lower.go
|
mbordner/kazaam
|
f1b2166f5ff70858d4b39a0c7477385e996982f5
|
[
"MIT"
] | null | null | null |
converter/lower.go
|
mbordner/kazaam
|
f1b2166f5ff70858d4b39a0c7477385e996982f5
|
[
"MIT"
] | null | null | null |
package converter
import (
"errors"
"github.com/mbordner/kazaam/transform"
"strconv"
"strings"
)
type Lower struct {
ConverterBase
}
func (c *Lower) Convert(jsonData []byte, value []byte, args []byte) (newValue []byte, err error) {
newValue = value
var jsonValue *transform.JSONValue
jsonValue, err = c.NewJSONValue(value)
if err != nil {
return
}
if jsonValue.IsString() == false {
err = errors.New("value must be string for lower converter")
return
}
origValue := jsonValue.GetStringValue()
newValue = []byte(strconv.Quote(strings.ToLower(origValue)))
return
}
| 17.411765
| 98
| 0.702703
|
0d2ac9eb01335a079cbafef31b4551f7594a0517
| 1,846
|
cs
|
C#
|
MHWMasterDataUtils/Builders/Equipment/CharmEquipmentBuilder.cs
|
TanukiSharp/MHWMasterDataUtils
|
8c25b6256f1a604183c386e2211900f53d24019f
|
[
"MIT"
] | 4
|
2019-08-13T09:14:35.000Z
|
2022-03-28T07:48:24.000Z
|
MHWMasterDataUtils/Builders/Equipment/CharmEquipmentBuilder.cs
|
TanukiSharp/MHWMasterDataUtils
|
8c25b6256f1a604183c386e2211900f53d24019f
|
[
"MIT"
] | null | null | null |
MHWMasterDataUtils/Builders/Equipment/CharmEquipmentBuilder.cs
|
TanukiSharp/MHWMasterDataUtils
|
8c25b6256f1a604183c386e2211900f53d24019f
|
[
"MIT"
] | 1
|
2021-04-01T04:22:31.000Z
|
2021-04-01T04:22:31.000Z
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MHWMasterDataUtils.Core;
using MHWMasterDataUtils.Equipment;
using MHWMasterDataUtils.Languages;
namespace MHWMasterDataUtils.Builders.Equipment
{
public class CharmEquipmentBuilder : EquipmentBuilderBase<Charm>
{
private readonly Dictionary<uint, EquipmentUpgradeEntryPrimitive> equipmentUpgrades;
public CharmEquipmentBuilder(
EquipmentPackageProcessor equipments,
LanguagePackageProcessor equipmentLanguages,
EquipmentCraftPackageProcessor<EquipmentType> equipmentCraft,
EquipmentUpgradePackageProcessor equipmentUpgrades
)
: base(
EquipmentType.Charm,
x => x.EquipSlot == EquipmentType.Charm,
equipments,
equipmentLanguages,
equipmentCraft
)
{
this.equipmentUpgrades = equipmentUpgrades.Table[(byte)EquipmentType.Charm];
}
protected override CraftItem[] CreateCraft(EquipmentPrimitive equipment)
{
CraftItem[] craft = base.CreateCraft(equipment);
if (craft != null)
return craft;
if (equipmentUpgrades.TryGetValue(equipment.Id, out EquipmentUpgradeEntryPrimitive upgradeEntry) == false)
return null;
var result = new List<CraftItem>();
TryAddCraft(result, upgradeEntry.Item1Id, upgradeEntry.Item1Quantity);
TryAddCraft(result, upgradeEntry.Item2Id, upgradeEntry.Item2Quantity);
TryAddCraft(result, upgradeEntry.Item3Id, upgradeEntry.Item3Quantity);
TryAddCraft(result, upgradeEntry.Item4Id, upgradeEntry.Item4Quantity);
return result.ToArray();
}
}
}
| 34.830189
| 118
| 0.660347
|
0ad1f33e1adc5d1a5999e294957a1e246a7d39f9
| 6,253
|
dart
|
Dart
|
lib/src/features/home_tops/presentation/widgets/series_month_widget.dart
|
bunkalogic/BunkaList-Flutter-Version
|
ad52c68ba145040839306aa3d1d2d3a3857e7f97
|
[
"Apache-2.0"
] | 2
|
2019-09-29T12:46:45.000Z
|
2019-10-24T21:17:44.000Z
|
lib/src/features/home_tops/presentation/widgets/series_month_widget.dart
|
bunkalogic/BunkaList-Flutter-Version
|
ad52c68ba145040839306aa3d1d2d3a3857e7f97
|
[
"Apache-2.0"
] | null | null | null |
lib/src/features/home_tops/presentation/widgets/series_month_widget.dart
|
bunkalogic/BunkaList-Flutter-Version
|
ad52c68ba145040839306aa3d1d2d3a3857e7f97
|
[
"Apache-2.0"
] | null | null | null |
import 'package:bunkalist/src/core/constans/constants_top_id.dart';
import 'package:bunkalist/src/core/constans/object_type_code.dart';
import 'package:bunkalist/src/core/reusable_widgets/icon_empty_widget.dart';
import 'package:bunkalist/src/core/reusable_widgets/loading_custom_widget.dart';
import 'package:bunkalist/src/core/utils/get_id_and_type.dart';
import 'package:bunkalist/src/features/add_ouevre_in_list/presentation/widgets/added_or_update_controller_widget.dart';
import 'package:bunkalist/src/features/home_tops/domain/entities/serie_entity.dart';
import 'package:bunkalist/src/features/home_tops/presentation/bloc/bloc_series_air_month/seriesair_bloc.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class CarouselSeriesInMonthWidget extends StatefulWidget {
@override
_CarouselSeriesInMonthWidgetState createState() => _CarouselSeriesInMonthWidgetState();
}
class _CarouselSeriesInMonthWidgetState extends State<CarouselSeriesInMonthWidget> {
@override
void initState() {
BlocProvider.of<SeriesAirBloc>(context)
..add(GetSeriesAirInMonth(Constants.topsSeriesMonthId, 1));
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height / 3.8,
child: BlocBuilder<SeriesAirBloc, SeriesAirState>(
builder: (context, state) {
if(state is SeriesAirInitial){
return LoadingCustomWidget();
}else if(state is LoadingSeries){
return LoadingCustomWidget();
}else if (state is LoadedSeries){
if(state.series.isNotEmpty){
return Container(
child: CarouselSlider.builder(
options: CarouselOptions(
enlargeCenterPage: true,
viewportFraction: 0.9,
aspectRatio: 2.0,
autoPlay: false,
),
itemCount: state.series.length,
itemBuilder: (context, i, h) => _cardItemBuilder(context, state.series[i]),
),
);
}else{
return EmptyIconWidget();
}
}else if(state is ErrorSeries){
return EmptyIconWidget();
}
return EmptyIconWidget();
},
),
);
}
Widget _cardItemBuilder(BuildContext context, SeriesEntity serie) {
return Card(
elevation: 15.0,
margin: EdgeInsets.symmetric(
horizontal: 5.0,
vertical: 20.0
),
color: Colors.transparent,
child: Container(
child: _stackTextAndIcon(context, serie),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
)
),
);
}
Widget _stackTextAndIcon(BuildContext context, SeriesEntity serie) {
return Stack(
children: <Widget>[
_imageBackground(context, serie),
_itemRating(serie),
_nameItem(serie),
_buttonItem(context, serie)
],
);
}
Widget _itemRating(SeriesEntity serie){
return Container(
margin: EdgeInsets.all(6.0),
padding: EdgeInsets.all(4.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.grey[400].withOpacity(0.3)
),
child: Text(
serie.voteAverage.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.w800,
shadows: [
Shadow(blurRadius: 1.0, color: Colors.black, offset: Offset(1.0, 1.0))
]
),
),
);
}
Widget _imageBackground(BuildContext context, SeriesEntity serie) {
final placeholder = AssetImage('assets/poster_placeholder.png');
final poster = NetworkImage('https://image.tmdb.org/t/p/w780${ serie.backdropPath }');
//! Agregar el Hero
return GestureDetector(
onTap: (){
Navigator.pushNamed(context, '/AllDetails', arguments: getIdAndType(serie.id, serie.type, serie.name));
},
child: Container(
width: double.infinity,
child: ClipRRect(
borderRadius: BorderRadius.circular(10.0),
child: FadeInImage(
image: (serie.posterPath == null) ? placeholder : poster, //? Image Poster Item,
placeholder: placeholder, //? PlaceHolder Item,
fit: BoxFit.cover,
),
),
),
);
}
Widget _nameItem(SeriesEntity serie){
return Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(6.0),
child: Text(
serie.name,//? Title of Item
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.w500,
shadows: [
Shadow(blurRadius: 1.0, color: Colors.black, offset: Offset(1.0, 1.0))
]
),
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
),
),
);
}
Widget _buttonItem(BuildContext context, SeriesEntity serie){
return Align(
alignment: Alignment.topRight,
child: FloatingActionButton(
onPressed: (){
return ButtonClikedAdded(
context: context,
isUpdated: false,
ouevre: serie,
type: serie.type,
objectType: ConstantsTypeObject.serieEntity
).showBottomModal();
},
heroTag: null,
elevation: 10.0,
mini: true,
child: Icon(Icons.add, color: Colors.pinkAccent[400], size: 20.0,),
backgroundColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: Colors.pinkAccent[400],
width: 2.0
),
),
),
);
}
}
| 30.207729
| 119
| 0.587558
|
f42f57c86c6fecf09746849bc17e9813ea540d64
| 1,539
|
tsx
|
TypeScript
|
components/sections/service/ServiceSection.tsx
|
pokornyd/fintech-demo-site
|
5f7d8195e0f807f66869cc9e6398c75e485c75df
|
[
"MIT"
] | null | null | null |
components/sections/service/ServiceSection.tsx
|
pokornyd/fintech-demo-site
|
5f7d8195e0f807f66869cc9e6398c75e485c75df
|
[
"MIT"
] | 4
|
2021-03-11T04:35:26.000Z
|
2022-02-10T23:48:10.000Z
|
components/sections/service/ServiceSection.tsx
|
pokornyd/fintech-demo-site
|
5f7d8195e0f807f66869cc9e6398c75e485c75df
|
[
"MIT"
] | null | null | null |
import { ContentItem } from 'kentico-cloud-delivery';
import { NextFC } from 'next';
import PropTypes, { ValidationMap } from 'prop-types';
import React from 'react';
import {
Description,
PreTitle,
Title,
} from '../../sectionIntroductionRenderers';
import { ServiceFeature } from './ServiceFeature';
export interface IServiceSectionStateProps {
readonly data: ContentItem;
}
export interface IServiceSectionDispatchProps {
}
interface IServiceSectionProps extends IServiceSectionStateProps, IServiceSectionDispatchProps {
}
const propTypes: ValidationMap<IServiceSectionProps> = {
data: PropTypes.any.isRequired,
};
export const ServiceSection: NextFC<IServiceSectionProps> = ({ data }) => {
return (
<section className="service pt-0">
<div className="container">
<div className="row">
<div className="col-12 col-lg-8 mx-auto">
<div className="title text-center">
<PreTitle
data={data}
/>
<Title
data={data}
/>
<Description
data={data}
/>
</div>
</div>
</div>
<div className="row">
{data.list_of_features.map((feature: ContentItem) => (
<ServiceFeature
key={feature.system.id}
data={feature}
/>
))}
</div>
</div>
</section>
);
};
ServiceSection.displayName = 'ServiceSection';
ServiceSection.propTypes = propTypes;
| 24.822581
| 96
| 0.590643
|
53afc21ca3fb37dabe6386863f4b10c53ffdb613
| 24
|
dart
|
Dart
|
syncit_flutter/lib/data/data.dart
|
amgugu111/syncit
|
fb6a92263c8394f10a2f7212e5e429a3053fab88
|
[
"MIT"
] | null | null | null |
syncit_flutter/lib/data/data.dart
|
amgugu111/syncit
|
fb6a92263c8394f10a2f7212e5e429a3053fab88
|
[
"MIT"
] | null | null | null |
syncit_flutter/lib/data/data.dart
|
amgugu111/syncit
|
fb6a92263c8394f10a2f7212e5e429a3053fab88
|
[
"MIT"
] | null | null | null |
export 'constants.dart';
| 24
| 24
| 0.791667
|
fe9864dcad354e311b9a5721dff5c2c66e123582
| 42,407
|
go
|
Go
|
vendor/github.com/projectatomic/libpod/libpod/runtime_img.go
|
kubic-project/container-feeder
|
066ce5398544eab35b7d46d460f67950e30ad466
|
[
"Apache-2.0"
] | 8
|
2017-02-27T11:48:43.000Z
|
2019-03-20T22:36:46.000Z
|
vendor/github.com/projectatomic/libpod/libpod/runtime_img.go
|
SUSE/container-feeder
|
066ce5398544eab35b7d46d460f67950e30ad466
|
[
"Apache-2.0"
] | 26
|
2017-03-13T09:55:59.000Z
|
2018-09-10T18:53:30.000Z
|
vendor/github.com/projectatomic/libpod/libpod/runtime_img.go
|
kubic-project/container-feeder
|
066ce5398544eab35b7d46d460f67950e30ad466
|
[
"Apache-2.0"
] | 8
|
2017-03-09T09:26:01.000Z
|
2018-12-21T10:33:12.000Z
|
package libpod
import (
"fmt"
"io"
"net"
"os"
"strings"
"syscall"
"time"
cp "github.com/containers/image/copy"
"github.com/containers/image/directory"
"github.com/containers/image/docker"
dockerarchive "github.com/containers/image/docker/archive"
"github.com/containers/image/docker/reference"
"github.com/containers/image/docker/tarfile"
ociarchive "github.com/containers/image/oci/archive"
"github.com/containers/image/pkg/sysregistries"
"github.com/containers/image/signature"
is "github.com/containers/image/storage"
"github.com/containers/image/tarball"
"github.com/containers/image/transports/alltransports"
"github.com/containers/image/types"
"github.com/containers/storage"
"github.com/containers/storage/pkg/archive"
ociv1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod/common"
"github.com/projectatomic/libpod/libpod/driver"
"github.com/projectatomic/libpod/pkg/inspect"
"github.com/projectatomic/libpod/pkg/util"
)
// Runtime API
var (
// DockerArchive is the transport we prepend to an image name
// when saving to docker-archive
DockerArchive = dockerarchive.Transport.Name()
// OCIArchive is the transport we prepend to an image name
// when saving to oci-archive
OCIArchive = ociarchive.Transport.Name()
// DirTransport is the transport for pushing and pulling
// images to and from a directory
DirTransport = directory.Transport.Name()
// TransportNames are the supported transports in string form
TransportNames = [...]string{DefaultTransport, DockerArchive, OCIArchive, "ostree:", "dir:"}
// TarballTransport is the transport for importing a tar archive
// and creating a filesystem image
TarballTransport = tarball.Transport.Name()
// Docker is the transport for docker registries
Docker = docker.Transport.Name()
// Atomic is the transport for atomic registries
Atomic = "atomic"
)
// CopyOptions contains the options given when pushing or pulling images
type CopyOptions struct {
// Compression specifies the type of compression which is applied to
// layer blobs. The default is to not use compression, but
// archive.Gzip is recommended.
Compression archive.Compression
// DockerRegistryOptions encapsulates settings that affect how we
// connect or authenticate to a remote registry to which we want to
// push the image.
common.DockerRegistryOptions
// SigningOptions encapsulates settings that control whether or not we
// strip or add signatures to the image when pushing (uploading) the
// image to a registry.
common.SigningOptions
// SigningPolicyPath this points to a alternative signature policy file, used mainly for testing
SignaturePolicyPath string
// AuthFile is the path of the cached credentials file defined by the user
AuthFile string
// Writer is the reportWriter for the output
Writer io.Writer
// Reference is the name for the image created when a tar archive is imported
Reference string
// ImageConfig is the Image spec for the image created when a tar archive is imported
ImageConfig ociv1.Image
// ManifestMIMEType is the manifest type of the image when saving to a directory
ManifestMIMEType string
// ForceCompress compresses the image layers when saving to a directory using the dir transport if true
ForceCompress bool
}
// Image API
// ImageFilterParams contains the filter options that may be given when outputting images
type ImageFilterParams struct {
Dangling string
Label string
BeforeImage time.Time
SinceImage time.Time
ReferencePattern string
ImageName string
ImageInput string
}
// struct for when a user passes a short or incomplete
// image name
type imageDecomposeStruct struct {
imageName string
tag string
registry string
hasRegistry bool
transport string
}
// ImageResultFilter is a mock function for image filtering
type ImageResultFilter func(inspect.ImageResult) bool
func (k *Image) assembleFqName() string {
return fmt.Sprintf("%s/%s:%s", k.Registry, k.ImageName, k.Tag)
}
func (k *Image) assembleFqNameTransport() string {
return fmt.Sprintf("%s%s/%s:%s", k.Transport, k.Registry, k.ImageName, k.Tag)
}
//Image describes basic attributes of an image
type Image struct {
Name string
ID string
fqname string
runtime *Runtime
Registry string
ImageName string
Tag string
HasRegistry bool
Transport string
beenDecomposed bool
PullName string
LocalName string
}
// NewImage creates a new image object based on its name
func (r *Runtime) NewImage(name string) Image {
return Image{
Name: name,
runtime: r,
}
}
// IsImageID determines if the input is a valid image ID.
// The input can be a full or partial image ID
func (r *Runtime) IsImageID(input string) (bool, error) {
images, err := r.GetImages(&ImageFilterParams{})
if err != nil {
return false, errors.Wrapf(err, "unable to get images")
}
for _, image := range images {
if strings.HasPrefix(image.ID, input) {
return true, nil
}
}
return false, nil
}
// GetNameByID returns the name of the image when supplied
// the full or partion ID
func (k *Image) GetNameByID() (string, error) {
images, err := k.runtime.GetImages(&ImageFilterParams{})
if err != nil {
return "", errors.Wrapf(err, "unable to get images")
}
for _, image := range images {
if strings.HasPrefix(image.ID, k.Name) {
return image.Names[0], nil
}
}
return "", errors.Errorf("unable to determine image for %s", k.Name)
}
// GetImageID returns the image ID of the image
func (k *Image) GetImageID() (string, error) {
// If the ID field is already populated, then
// return it.
if k.ID != "" {
return k.ID, nil
}
// If we have the name of the image locally, then
// get the image and returns its ID
if k.LocalName != "" {
img, err := k.runtime.GetImage(k.LocalName)
if err == nil {
return img.ID, nil
}
}
// If the user input is an ID
images, err := k.runtime.GetImages(&ImageFilterParams{})
if err != nil {
return "", errors.Wrapf(err, "unable to get images")
}
for _, image := range images {
// Check if we have an ID match
if strings.HasPrefix(image.ID, k.Name) {
return image.ID, nil
}
// Check if we have a name match, perhaps a tagged name
for _, name := range image.Names {
if k.Name == name {
return image.ID, nil
}
}
}
// If neither the ID is known and no local name
// is know, we search it out.
image, _ := k.GetFQName()
img, err := k.runtime.GetImage(image)
if err != nil {
return "", err
}
return img.ID, nil
}
// GetFQName returns the fully qualified image name if it can be determined
func (k *Image) GetFQName() (string, error) {
// Check if the fqname has already been found
if k.fqname != "" {
return k.fqname, nil
}
if err := k.Decompose(); err != nil {
return "", err
}
k.fqname = k.assembleFqName()
return k.fqname, nil
}
func (k *Image) findImageOnRegistry() error {
searchRegistries, err := GetRegistries()
if err != nil {
return errors.Wrapf(err, " the image name '%s' is incomplete.", k.Name)
}
for _, searchRegistry := range searchRegistries {
k.Registry = searchRegistry
err = k.GetManifest()
if err == nil {
k.fqname = k.assembleFqName()
return nil
}
}
return errors.Errorf("unable to find image on any configured registries")
}
// GetManifest tries to GET an images manifest, returns nil on success and err on failure
func (k *Image) GetManifest() error {
pullRef, err := alltransports.ParseImageName(k.assembleFqNameTransport())
if err != nil {
return errors.Errorf("unable to parse1 '%s'", k.assembleFqName())
}
imageSource, err := pullRef.NewImageSource(nil)
if err != nil {
return errors.Wrapf(err, "unable to create new image source")
}
_, _, err = imageSource.GetManifest(nil)
if err == nil {
return nil
}
return err
}
//Decompose breaks up an image name into its parts
func (k *Image) Decompose() error {
if k.beenDecomposed {
return nil
}
k.beenDecomposed = true
k.Transport = k.runtime.config.ImageDefaultTransport
decomposeName := k.Name
for _, transport := range TransportNames {
if strings.HasPrefix(k.Name, transport) {
k.Transport = transport
decomposeName = strings.Replace(k.Name, transport, "", -1)
break
}
}
if k.Transport == "dir:" {
return nil
}
var imageError = fmt.Sprintf("unable to parse '%s'\n", decomposeName)
imgRef, err := reference.Parse(decomposeName)
if err != nil {
return errors.Wrapf(err, imageError)
}
tagged, isTagged := imgRef.(reference.NamedTagged)
k.Tag = "latest"
if isTagged {
k.Tag = tagged.Tag()
}
k.HasRegistry = true
registry := reference.Domain(imgRef.(reference.Named))
if registry == "" {
k.HasRegistry = false
}
k.ImageName = reference.Path(imgRef.(reference.Named))
// account for image names with directories in them like
// umohnani/get-started:part1
if k.HasRegistry {
k.Registry = registry
k.fqname = k.assembleFqName()
k.PullName = k.assembleFqName()
registries, err := getRegistries()
if err != nil {
return nil
}
if util.StringInSlice(k.Registry, registries) {
return nil
}
// We need to check if the registry name is legit
_, err = net.LookupHost(k.Registry)
if err == nil {
return nil
}
// Combine the Registry and Image Name together and blank out the Registry Name
k.ImageName = fmt.Sprintf("%s/%s", k.Registry, k.ImageName)
k.Registry = ""
}
// No Registry means we check the globals registries configuration file
// and assemble a list of candidate sources to try
//searchRegistries, err := GetRegistries()
err = k.findImageOnRegistry()
k.PullName = k.assembleFqName()
if err != nil {
return errors.Wrapf(err, " the image name '%s' is incomplete.", k.Name)
}
return nil
}
func getTags(nameInput string) (reference.NamedTagged, bool, error) {
inputRef, err := reference.Parse(nameInput)
if err != nil {
return nil, false, errors.Wrapf(err, "unable to obtain tag from input name")
}
tagged, isTagged := inputRef.(reference.NamedTagged)
return tagged, isTagged, nil
}
// GetLocalImageName returns the name of the image if it is local as well
// as the image's ID. It will return an empty strings and error if not found.
func (k *Image) GetLocalImageName() (string, string, error) {
localImage, err := k.runtime.GetImage(k.Name)
if err == nil {
k.LocalName = k.Name
return k.Name, localImage.ID, nil
}
localImages, err := k.runtime.GetImages(&ImageFilterParams{})
if err != nil {
return "", "", errors.Wrapf(err, "unable to find local images")
}
_, isTagged, err := getTags(k.Name)
if err != nil {
return "", "", err
}
for _, image := range localImages {
for _, name := range image.Names {
imgRef, err := reference.Parse(name)
if err != nil {
continue
}
var imageName string
imageNameOnly := reference.Path(imgRef.(reference.Named))
if isTagged {
imageNameTag, _, err := getTags(name)
if err != nil {
continue
}
imageName = fmt.Sprintf("%s:%s", imageNameOnly, imageNameTag.Tag())
} else {
imageName = imageNameOnly
}
if imageName == k.Name {
k.LocalName = name
return name, image.ID, nil
}
imageSplit := strings.Split(imageName, "/")
baseName := imageSplit[len(imageSplit)-1]
if baseName == k.Name {
k.LocalName = name
return name, image.ID, nil
}
}
}
return "", "", errors.Wrapf(storage.ErrImageUnknown, "unable to find image locally")
}
// HasLatest determines if we have the latest image local
func (k *Image) HasLatest() (bool, error) {
localName, _, err := k.GetLocalImageName()
if err != nil {
return false, err
}
if localName == "" {
return false, nil
}
fqname, err := k.GetFQName()
if err != nil {
return false, err
}
pullRef, err := alltransports.ParseImageName(fqname)
if err != nil {
return false, err
}
_, _, err = pullRef.(types.ImageSource).GetManifest(nil)
return false, err
}
// Pull is a wrapper function to pull and image
func (k *Image) Pull(writer io.Writer) error {
// If the image hasn't been decomposed yet
if !k.beenDecomposed {
err := k.Decompose()
if err != nil {
return err
}
}
k.runtime.PullImage(k.PullName, CopyOptions{Writer: writer, SignaturePolicyPath: k.runtime.config.SignaturePolicyPath})
return nil
}
// Remove calls into container storage and deletes the image
func (k *Image) Remove(force bool) (string, error) {
if k.LocalName == "" {
// This populates the images local name
_, _, err := k.GetLocalImageName()
if err != nil {
return "", errors.Wrapf(err, "unable to find %s locally", k.Name)
}
}
iid, err := k.GetImageID()
if err != nil {
return "", errors.Wrapf(err, "unable to get image id")
}
image, err := k.runtime.GetImage(iid)
if err != nil {
return "", errors.Wrapf(err, "unable to remove %s", iid)
}
return k.runtime.RemoveImage(image, force)
}
// GetRegistries gets the searchable registries from the global registration file.
func GetRegistries() ([]string, error) {
registryConfigPath := ""
envOverride := os.Getenv("REGISTRIES_CONFIG_PATH")
if len(envOverride) > 0 {
registryConfigPath = envOverride
}
searchRegistries, err := sysregistries.GetRegistries(&types.SystemContext{SystemRegistriesConfPath: registryConfigPath})
if err != nil {
return nil, errors.Errorf("unable to parse the registries.conf file")
}
return searchRegistries, nil
}
// GetInsecureRegistries obtains the list of inseure registries from the global registration file.
func GetInsecureRegistries() ([]string, error) {
registryConfigPath := ""
envOverride := os.Getenv("REGISTRIES_CONFIG_PATH")
if len(envOverride) > 0 {
registryConfigPath = envOverride
}
registries, err := sysregistries.GetInsecureRegistries(&types.SystemContext{SystemRegistriesConfPath: registryConfigPath})
if err != nil {
return nil, errors.Errorf("unable to parse the registries.conf file")
}
return registries, nil
}
// getRegistries returns both searchable and insecure registries from the global conf file.
func getRegistries() ([]string, error) {
var r []string
registries, err := GetRegistries()
if err != nil {
return r, err
}
insecureRegistries, err := GetInsecureRegistries()
if err != nil {
return r, err
}
r = append(registries, insecureRegistries...)
return r, nil
}
// ImageFilter is a function to determine whether an image is included in
// command output. Images to be outputted are tested using the function. A true
// return will include the image, a false return will exclude it.
type ImageFilter func(*storage.Image, *inspect.ImageData) bool
func (ips imageDecomposeStruct) returnFQName() string {
return fmt.Sprintf("%s%s/%s:%s", ips.transport, ips.registry, ips.imageName, ips.tag)
}
func getRegistriesToTry(image string, store storage.Store, defaultTransport string) ([]*pullStruct, error) {
var pStructs []*pullStruct
var imageError = fmt.Sprintf("unable to parse '%s'\n", image)
imgRef, err := reference.Parse(image)
if err != nil {
return nil, errors.Wrapf(err, imageError)
}
tagged, isTagged := imgRef.(reference.NamedTagged)
tag := "latest"
if isTagged {
tag = tagged.Tag()
}
hasDomain := true
registry := reference.Domain(imgRef.(reference.Named))
if registry == "" {
hasDomain = false
}
imageName := reference.Path(imgRef.(reference.Named))
pImage := imageDecomposeStruct{
imageName,
tag,
registry,
hasDomain,
defaultTransport,
}
if pImage.hasRegistry {
// If input has a registry, we have to assume they included an image
// name but maybe not a tag
srcRef, err := alltransports.ParseImageName(pImage.returnFQName())
if err != nil {
return nil, errors.Errorf(imageError)
}
pStruct := &pullStruct{
image: srcRef.DockerReference().String(),
srcRef: srcRef,
}
pStructs = append(pStructs, pStruct)
} else {
// No registry means we check the globals registries configuration file
// and assemble a list of candidate sources to try
registryConfigPath := ""
envOverride := os.Getenv("REGISTRIES_CONFIG_PATH")
if len(envOverride) > 0 {
registryConfigPath = envOverride
}
searchRegistries, err := sysregistries.GetRegistries(&types.SystemContext{SystemRegistriesConfPath: registryConfigPath})
if err != nil {
return nil, errors.Wrapf(err, "unable to parse the registries.conf file and"+
" the image name '%s' is incomplete.", imageName)
}
for _, searchRegistry := range searchRegistries {
pImage.registry = searchRegistry
srcRef, err := alltransports.ParseImageName(pImage.returnFQName())
if err != nil {
return nil, errors.Errorf("unable to parse '%s'", pImage.returnFQName())
}
pStruct := &pullStruct{
image: srcRef.DockerReference().String(),
srcRef: srcRef,
}
pStructs = append(pStructs, pStruct)
}
}
for _, pStruct := range pStructs {
destRef, err := is.Transport.ParseStoreReference(store, pStruct.image)
if err != nil {
return nil, errors.Errorf("error parsing dest reference name: %v", err)
}
pStruct.dstRef = destRef
}
return pStructs, nil
}
type pullStruct struct {
image string
srcRef types.ImageReference
dstRef types.ImageReference
}
func (r *Runtime) getPullStruct(srcRef types.ImageReference, destName string) (*pullStruct, error) {
reference := destName
if srcRef.DockerReference() != nil {
reference = srcRef.DockerReference().String()
}
destRef, err := is.Transport.ParseStoreReference(r.store, reference)
if err != nil {
return nil, errors.Errorf("error parsing dest reference name: %v", err)
}
return &pullStruct{
image: destName,
srcRef: srcRef,
dstRef: destRef,
}, nil
}
// returns a list of pullStruct with the srcRef and DstRef based on the transport being used
func (r *Runtime) getPullListFromRef(srcRef types.ImageReference, imgName string, sc *types.SystemContext) ([]*pullStruct, error) {
var pullStructs []*pullStruct
splitArr := strings.Split(imgName, ":")
archFile := splitArr[len(splitArr)-1]
// supports pulling from docker-archive, oci, and registries
if srcRef.Transport().Name() == DockerArchive {
tarSource, err := tarfile.NewSourceFromFile(archFile)
if err != nil {
return nil, err
}
manifest, err := tarSource.LoadTarManifest()
if err != nil {
return nil, errors.Errorf("error retrieving manifest.json: %v", err)
}
// to pull the first image stored in the tar file
if len(manifest) == 0 {
// use the hex of the digest if no manifest is found
reference, err := getImageDigest(srcRef, sc)
if err != nil {
return nil, err
}
pullInfo, err := r.getPullStruct(srcRef, reference)
if err != nil {
return nil, err
}
pullStructs = append(pullStructs, pullInfo)
} else {
var dest string
if len(manifest[0].RepoTags) > 0 {
dest = manifest[0].RepoTags[0]
} else {
// If the input image has no repotags, we need to feed it a dest anyways
dest, err = getImageDigest(srcRef, sc)
if err != nil {
return nil, err
}
}
pullInfo, err := r.getPullStruct(srcRef, dest)
if err != nil {
return nil, err
}
pullStructs = append(pullStructs, pullInfo)
}
} else if srcRef.Transport().Name() == OCIArchive {
// retrieve the manifest from index.json to access the image name
manifest, err := ociarchive.LoadManifestDescriptor(srcRef)
if err != nil {
return nil, errors.Wrapf(err, "error loading manifest for %q", srcRef)
}
if manifest.Annotations == nil || manifest.Annotations["org.opencontainers.image.ref.name"] == "" {
return nil, errors.Errorf("error, archive doesn't have a name annotation. Cannot store image with no name")
}
pullInfo, err := r.getPullStruct(srcRef, manifest.Annotations["org.opencontainers.image.ref.name"])
if err != nil {
return nil, err
}
pullStructs = append(pullStructs, pullInfo)
} else if srcRef.Transport().Name() == DirTransport {
// supports pull from a directory
image := splitArr[1]
// remove leading "/"
if image[:1] == "/" {
image = image[1:]
}
pullInfo, err := r.getPullStruct(srcRef, image)
if err != nil {
return nil, err
}
pullStructs = append(pullStructs, pullInfo)
} else {
pullInfo, err := r.getPullStruct(srcRef, imgName)
if err != nil {
return nil, err
}
pullStructs = append(pullStructs, pullInfo)
}
return pullStructs, nil
}
// PullImage pulls an image from configured registries
// By default, only the latest tag (or a specific tag if requested) will be
// pulled. If allTags is true, all tags for the requested image will be pulled.
// Signature validation will be performed if the Runtime has been appropriately
// configured
func (r *Runtime) PullImage(imgName string, options CopyOptions) (string, error) {
r.lock.Lock()
defer r.lock.Unlock()
if !r.valid {
return "", ErrRuntimeStopped
}
// PullImage copies the image from the source to the destination
var pullStructs []*pullStruct
signaturePolicyPath := r.config.SignaturePolicyPath
if options.SignaturePolicyPath != "" {
signaturePolicyPath = options.SignaturePolicyPath
}
sc := common.GetSystemContext(signaturePolicyPath, options.AuthFile, false)
srcRef, err := alltransports.ParseImageName(imgName)
if err != nil {
// could be trying to pull from registry with short name
pullStructs, err = getRegistriesToTry(imgName, r.store, r.config.ImageDefaultTransport)
if err != nil {
return "", errors.Wrap(err, "error getting default registries to try")
}
} else {
pullStructs, err = r.getPullListFromRef(srcRef, imgName, sc)
if err != nil {
return "", errors.Wrapf(err, "error getting pullStruct info to pull image %q", imgName)
}
}
policyContext, err := getPolicyContext(sc)
if err != nil {
return "", err
}
defer policyContext.Destroy()
copyOptions := common.GetCopyOptions(options.Writer, signaturePolicyPath, &options.DockerRegistryOptions, nil, options.SigningOptions, options.AuthFile, "", false)
for _, imageInfo := range pullStructs {
// Print the following statement only when pulling from a docker or atomic registry
if options.Writer != nil && (imageInfo.srcRef.Transport().Name() == Docker || imageInfo.srcRef.Transport().Name() == Atomic) {
io.WriteString(options.Writer, fmt.Sprintf("Trying to pull %s...\n", imageInfo.image))
}
if err = cp.Image(policyContext, imageInfo.dstRef, imageInfo.srcRef, copyOptions); err != nil {
if options.Writer != nil {
io.WriteString(options.Writer, "Failed\n")
}
} else {
return imageInfo.image, nil
}
}
return "", errors.Wrapf(err, "error pulling image from %q", imgName)
}
// PushImage pushes the given image to a location described by the given path
func (r *Runtime) PushImage(source string, destination string, options CopyOptions) error {
r.lock.Lock()
defer r.lock.Unlock()
if !r.valid {
return ErrRuntimeStopped
}
// PushImage pushes the src image to the destination
//func PushImage(source, destination string, options CopyOptions) error {
if source == "" || destination == "" {
return errors.Wrapf(syscall.EINVAL, "source and destination image names must be specified")
}
// Get the destination Image Reference
dest, err := alltransports.ParseImageName(destination)
if err != nil {
if hasTransport(destination) {
return errors.Wrapf(err, "error getting destination imageReference for %q", destination)
}
// Try adding the images default transport
destination2 := r.config.ImageDefaultTransport + destination
dest, err = alltransports.ParseImageName(destination2)
if err != nil {
// One last try with docker:// as the transport
destination2 = DefaultTransport + destination
dest, err = alltransports.ParseImageName(destination2)
if err != nil {
return errors.Wrapf(err, "error getting destination imageReference for %q", destination)
}
}
}
signaturePolicyPath := r.config.SignaturePolicyPath
if options.SignaturePolicyPath != "" {
signaturePolicyPath = options.SignaturePolicyPath
}
sc := common.GetSystemContext(signaturePolicyPath, options.AuthFile, options.ForceCompress)
policyContext, err := getPolicyContext(sc)
if err != nil {
return err
}
defer policyContext.Destroy()
// Look up the source image, expecting it to be in local storage
src, err := is.Transport.ParseStoreReference(r.store, source)
if err != nil {
return errors.Wrapf(err, "error getting source imageReference for %q", source)
}
copyOptions := common.GetCopyOptions(options.Writer, signaturePolicyPath, nil, &options.DockerRegistryOptions, options.SigningOptions, options.AuthFile, options.ManifestMIMEType, options.ForceCompress)
// Copy the image to the remote destination
err = cp.Image(policyContext, dest, src, copyOptions)
if err != nil {
return errors.Wrapf(err, "Error copying image to the remote destination")
}
return nil
}
// TagImage adds a tag to the given image
func (r *Runtime) TagImage(image *storage.Image, tag string) error {
r.lock.Lock()
defer r.lock.Unlock()
if !r.valid {
return ErrRuntimeStopped
}
tags, err := r.store.Names(image.ID)
if err != nil {
return err
}
for _, key := range tags {
if key == tag {
return nil
}
}
tags = append(tags, tag)
return r.store.SetNames(image.ID, tags)
}
// UntagImage removes a tag from the given image
func (r *Runtime) UntagImage(image *storage.Image, tag string) (string, error) {
r.lock.Lock()
defer r.lock.Unlock()
if !r.valid {
return "", ErrRuntimeStopped
}
tags, err := r.store.Names(image.ID)
if err != nil {
return "", err
}
for i, key := range tags {
if key == tag {
tags[i] = tags[len(tags)-1]
tags = tags[:len(tags)-1]
break
}
}
if err = r.store.SetNames(image.ID, tags); err != nil {
return "", err
}
return tag, nil
}
// RemoveImage deletes an image from local storage
// Images being used by running containers can only be removed if force=true
func (r *Runtime) RemoveImage(image *storage.Image, force bool) (string, error) {
r.lock.Lock()
defer r.lock.Unlock()
if !r.valid {
return "", ErrRuntimeStopped
}
// Get all containers, filter to only those using the image, and remove those containers
ctrs, err := r.state.AllContainers()
if err != nil {
return "", err
}
imageCtrs := []*Container{}
for _, ctr := range ctrs {
if ctr.config.RootfsImageID == image.ID {
imageCtrs = append(imageCtrs, ctr)
}
}
if len(imageCtrs) > 0 && len(image.Names) <= 1 {
if force {
for _, ctr := range imageCtrs {
if err := r.removeContainer(ctr, true); err != nil {
return "", errors.Wrapf(err, "error removing image %s: container %s using image could not be removed", image.ID, ctr.ID())
}
}
} else {
return "", fmt.Errorf("could not remove image %s as it is being used by %d containers", image.ID, len(imageCtrs))
}
}
if len(image.Names) > 1 && !force {
return "", fmt.Errorf("unable to delete %s (must force) - image is referred to in multiple tags", image.ID)
}
// If it is forced, we have to untag the image so that it can be deleted
if err = r.store.SetNames(image.ID, image.Names[:0]); err != nil {
return "", err
}
_, err = r.store.DeleteImage(image.ID, true)
if err != nil {
return "", err
}
return image.ID, nil
}
// GetImage retrieves an image matching the given name or hash from system
// storage
// If no matching image can be found, an error is returned
func (r *Runtime) GetImage(image string) (*storage.Image, error) {
r.lock.Lock()
defer r.lock.Unlock()
if !r.valid {
return nil, ErrRuntimeStopped
}
return r.getImage(image)
}
func (r *Runtime) getImage(image string) (*storage.Image, error) {
var img *storage.Image
ref, err := is.Transport.ParseStoreReference(r.store, image)
if err == nil {
img, err = is.Transport.GetStoreImage(r.store, ref)
}
if err != nil {
img2, err2 := r.store.Image(image)
if err2 != nil {
if ref == nil {
return nil, errors.Wrapf(err, "error parsing reference to image %q", image)
}
return nil, errors.Wrapf(err, "unable to locate image %q", image)
}
img = img2
}
return img, nil
}
// GetImageRef searches for and returns a new types.Image matching the given name or ID in the given store.
func (r *Runtime) GetImageRef(image string) (types.Image, error) {
r.lock.Lock()
defer r.lock.Unlock()
if !r.valid {
return nil, ErrRuntimeStopped
}
return r.getImageRef(image)
}
func (r *Runtime) getImageRef(image string) (types.Image, error) {
img, err := r.getImage(image)
if err != nil {
return nil, errors.Wrapf(err, "unable to locate image %q", image)
}
ref, err := is.Transport.ParseStoreReference(r.store, "@"+img.ID)
if err != nil {
return nil, errors.Wrapf(err, "error parsing reference to image %q", img.ID)
}
imgRef, err := ref.NewImage(nil)
if err != nil {
return nil, errors.Wrapf(err, "error reading image %q", img.ID)
}
return imgRef, nil
}
// GetImages retrieves all images present in storage
// Filters can be provided which will determine which images are included in the
// output. Multiple filters are handled by ANDing their output, so only images
// matching all filters are included
func (r *Runtime) GetImages(params *ImageFilterParams, filters ...ImageFilter) ([]*storage.Image, error) {
r.lock.RLock()
defer r.lock.RUnlock()
if !r.valid {
return nil, ErrRuntimeStopped
}
images, err := r.store.Images()
if err != nil {
return nil, err
}
var imagesFiltered []*storage.Image
for _, img := range images {
info, err := r.getImageInspectInfo(img)
if err != nil {
return nil, err
}
var names []string
if len(img.Names) > 0 {
names = img.Names
} else {
names = append(names, "<none>")
}
for _, name := range names {
include := true
if params != nil {
params.ImageName = name
}
for _, filter := range filters {
include = include && filter(&img, info)
}
if include {
newImage := img
newImage.Names = []string{name}
imagesFiltered = append(imagesFiltered, &newImage)
}
}
}
return imagesFiltered, nil
}
// GetHistory gets the history of an image and information about its layers
func (r *Runtime) GetHistory(image string) ([]ociv1.History, []types.BlobInfo, string, error) {
r.lock.RLock()
defer r.lock.RUnlock()
if !r.valid {
return nil, nil, "", ErrRuntimeStopped
}
img, err := r.getImage(image)
if err != nil {
return nil, nil, "", errors.Wrapf(err, "no such image %q", image)
}
src, err := r.getImageRef(image)
if err != nil {
return nil, nil, "", errors.Wrapf(err, "error instantiating image %q", image)
}
oci, err := src.OCIConfig()
if err != nil {
return nil, nil, "", err
}
return oci.History, src.LayerInfos(), img.ID, nil
}
// ImportImage imports an OCI format image archive into storage as an image
func (r *Runtime) ImportImage(path string, options CopyOptions) (*storage.Image, error) {
r.lock.RLock()
defer r.lock.RUnlock()
if !r.valid {
return nil, ErrRuntimeStopped
}
file := TarballTransport + ":" + path
src, err := alltransports.ParseImageName(file)
if err != nil {
return nil, errors.Wrapf(err, "error parsing image name %q", path)
}
updater, ok := src.(tarball.ConfigUpdater)
if !ok {
return nil, errors.Wrapf(err, "unexpected type, a tarball reference should implement tarball.ConfigUpdater")
}
annotations := make(map[string]string)
err = updater.ConfigUpdate(options.ImageConfig, annotations)
if err != nil {
return nil, errors.Wrapf(err, "error updating image config")
}
var reference = options.Reference
sc := common.GetSystemContext("", "", false)
// if reference not given, get the image digest
if reference == "" {
reference, err = getImageDigest(src, sc)
if err != nil {
return nil, err
}
}
policyContext, err := getPolicyContext(sc)
if err != nil {
return nil, err
}
defer policyContext.Destroy()
copyOptions := common.GetCopyOptions(options.Writer, "", nil, nil, common.SigningOptions{}, "", "", false)
dest, err := is.Transport.ParseStoreReference(r.store, reference)
if err != nil {
errors.Wrapf(err, "error getting image reference for %q", options.Reference)
}
if err = cp.Image(policyContext, dest, src, copyOptions); err != nil {
return nil, err
}
// Use no lock version of GetImage
return r.getImage(reference)
}
// GetImageInspectInfo returns the inspect information of an image
func (r *Runtime) GetImageInspectInfo(image storage.Image) (*inspect.ImageData, error) {
r.lock.RLock()
defer r.lock.RUnlock()
if !r.valid {
return nil, ErrRuntimeStopped
}
return r.getImageInspectInfo(image)
}
func (r *Runtime) getImageInspectInfo(image storage.Image) (*inspect.ImageData, error) {
imgRef, err := r.getImageRef("@" + image.ID)
if err != nil {
return nil, errors.Wrapf(err, "error reading image %q", image.ID)
}
layer, err := r.store.Layer(image.TopLayer)
if err != nil {
return nil, errors.Wrapf(err, "error reading information about layer %q", image.TopLayer)
}
size, err := r.store.DiffSize(layer.Parent, layer.ID)
if err != nil {
return nil, errors.Wrapf(err, "error determining size of layer %q", layer.ID)
}
driverData, err := driver.GetDriverData(r.store, layer.ID)
if err != nil {
return nil, errors.Wrapf(err, "error getting graph driver info %q", image.ID)
}
return getImageData(image, imgRef, size, driverData)
}
// ParseImageFilter takes a set of images and a filter string as input, and returns the libpod.ImageFilterParams struct
func (r *Runtime) ParseImageFilter(imageInput, filter string) (*ImageFilterParams, error) {
r.lock.RLock()
defer r.lock.RUnlock()
if !r.valid {
return nil, ErrRuntimeStopped
}
if filter == "" && imageInput == "" {
return nil, nil
}
var params ImageFilterParams
params.ImageInput = imageInput
if filter == "" && imageInput != "" {
return ¶ms, nil
}
images, err := r.store.Images()
if err != nil {
return nil, err
}
filterStrings := strings.Split(filter, ",")
for _, param := range filterStrings {
pair := strings.SplitN(param, "=", 2)
switch strings.TrimSpace(pair[0]) {
case "dangling":
if common.IsValidBool(pair[1]) {
params.Dangling = pair[1]
} else {
return nil, fmt.Errorf("invalid filter: '%s=[%s]'", pair[0], pair[1])
}
case "label":
params.Label = pair[1]
case "before":
if img, err := findImageInSlice(images, pair[1]); err == nil {
info, err := r.GetImageInspectInfo(img)
if err != nil {
return nil, err
}
params.BeforeImage = *info.Created
} else {
return nil, fmt.Errorf("no such id: %s", pair[0])
}
case "since":
if img, err := findImageInSlice(images, pair[1]); err == nil {
info, err := r.GetImageInspectInfo(img)
if err != nil {
return nil, err
}
params.SinceImage = *info.Created
} else {
return nil, fmt.Errorf("no such id: %s``", pair[0])
}
case "reference":
params.ReferencePattern = pair[1]
default:
return nil, fmt.Errorf("invalid filter: '%s'", pair[0])
}
}
return ¶ms, nil
}
// MatchesID returns true if argID is a full or partial match for id
func MatchesID(id, argID string) bool {
return strings.HasPrefix(argID, id)
}
// MatchesReference returns true if argName is a full or partial match for name
// Partial matches will register only if they match the most specific part of the name available
// For example, take the image docker.io/library/redis:latest
// redis, library/redis, docker.io/library/redis, redis:latest, etc. will match
// But redis:alpine, ry/redis, library, and io/library/redis will not
func MatchesReference(name, argName string) bool {
if argName == "" {
return false
}
splitName := strings.Split(name, ":")
// If the arg contains a tag, we handle it differently than if it does not
if strings.Contains(argName, ":") {
splitArg := strings.Split(argName, ":")
return strings.HasSuffix(splitName[0], splitArg[0]) && (splitName[1] == splitArg[1])
}
return strings.HasSuffix(splitName[0], argName)
}
// ParseImageNames parses the names we've stored with an image into a list of
// tagged references and a list of references which contain digests.
func ParseImageNames(names []string) (tags, digests []string, err error) {
for _, name := range names {
if named, err := reference.ParseNamed(name); err == nil {
if digested, ok := named.(reference.Digested); ok {
canonical, err := reference.WithDigest(named, digested.Digest())
if err == nil {
digests = append(digests, canonical.String())
}
} else {
if reference.IsNameOnly(named) {
named = reference.TagNameOnly(named)
}
if tagged, ok := named.(reference.Tagged); ok {
namedTagged, err := reference.WithTag(named, tagged.Tag())
if err == nil {
tags = append(tags, namedTagged.String())
}
}
}
}
}
return tags, digests, nil
}
func findImageInSlice(images []storage.Image, ref string) (storage.Image, error) {
for _, image := range images {
if MatchesID(image.ID, ref) {
return image, nil
}
for _, name := range image.Names {
if MatchesReference(name, ref) {
return image, nil
}
}
}
return storage.Image{}, errors.New("could not find image")
}
// getImageDigest creates an image object and uses the hex value of the digest as the image ID
// for parsing the store reference
func getImageDigest(src types.ImageReference, ctx *types.SystemContext) (string, error) {
newImg, err := src.NewImage(ctx)
if err != nil {
return "", err
}
defer newImg.Close()
digest := newImg.ConfigInfo().Digest
if err = digest.Validate(); err != nil {
return "", errors.Wrapf(err, "error getting config info")
}
return "@" + digest.Hex(), nil
}
// getPolicyContext sets up, intializes and returns a new context for the specified policy
func getPolicyContext(ctx *types.SystemContext) (*signature.PolicyContext, error) {
policy, err := signature.DefaultPolicy(ctx)
if err != nil {
return nil, err
}
policyContext, err := signature.NewPolicyContext(policy)
if err != nil {
return nil, err
}
return policyContext, nil
}
// sizer knows its size.
type sizer interface {
Size() (int64, error)
}
func imageSize(img types.ImageSource) *uint64 {
if s, ok := img.(sizer); ok {
if sum, err := s.Size(); err == nil {
usum := uint64(sum)
return &usum
}
}
return nil
}
// ReposToMap parses the specified repotags and returns a map with repositories
// as keys and the corresponding arrays of tags as values.
func ReposToMap(repotags []string) map[string][]string {
// map format is repo -> tag
repos := make(map[string][]string)
for _, repo := range repotags {
var repository, tag string
if len(repo) > 0 {
li := strings.LastIndex(repo, ":")
repository = repo[0:li]
tag = repo[li+1:]
}
repos[repository] = append(repos[repository], tag)
}
if len(repos) == 0 {
repos["<none>"] = []string{"<none>"}
}
return repos
}
// GetImageResults gets the images for podman images and returns them as
// an array of ImageResults
func (r *Runtime) GetImageResults() ([]inspect.ImageResult, error) {
var results []inspect.ImageResult
images, err := r.store.Images()
if err != nil {
return nil, err
}
for _, image := range images {
storeRef, err := is.Transport.ParseStoreReference(r.store, image.ID)
if err != nil {
return nil, err
}
systemContext := &types.SystemContext{}
img, err := storeRef.NewImageSource(systemContext)
if err != nil {
return nil, err
}
ic, err := storeRef.NewImage(&types.SystemContext{})
if err != nil {
return nil, err
}
imgInspect, err := ic.Inspect()
if err != nil {
return nil, err
}
dangling := false
if len(image.Names) == 0 {
dangling = true
}
for repo, tags := range ReposToMap(image.Names) {
// use the first pair as the image's default repo and tag
results = append(results, inspect.ImageResult{
ID: image.ID,
Repository: repo,
RepoTags: image.Names,
Tag: tags[0],
Size: imageSize(img),
Digest: image.Digest,
Created: image.Created,
Labels: imgInspect.Labels,
Dangling: dangling,
})
break
}
}
return results, nil
}
// ImageCreatedBefore allows you to filter on images created before
// the given time.Time
func ImageCreatedBefore(createTime time.Time) ImageResultFilter {
return func(i inspect.ImageResult) bool {
if i.Created.Before(createTime) {
return true
}
return false
}
}
// ImageCreatedAfter allows you to filter on images created after
// the given time.Time
func ImageCreatedAfter(createTime time.Time) ImageResultFilter {
return func(i inspect.ImageResult) bool {
if i.Created.After(createTime) {
return true
}
return false
}
}
// ImageDangling allows you to filter images for dangling images
func ImageDangling() ImageResultFilter {
return func(i inspect.ImageResult) bool {
if i.Dangling {
return true
}
return false
}
}
// ImageLabel allows you to filter by images labels key and/or value
func ImageLabel(labelfilter string) ImageResultFilter {
// We need to handle both label=key and label=key=value
return func(i inspect.ImageResult) bool {
var value string
splitFilter := strings.Split(labelfilter, "=")
key := splitFilter[0]
if len(splitFilter) > 1 {
value = splitFilter[1]
}
for labelKey, labelValue := range i.Labels {
// handles label=key
if key == labelKey && len(strings.TrimSpace(value)) == 0 {
return true
}
//handles label=key=value
if key == labelKey && value == labelValue {
return true
}
}
return false
}
}
// OutputImageFilter allows you to filter by an a specific image name
func OutputImageFilter(name string) ImageResultFilter {
return func(i inspect.ImageResult) bool {
li := strings.LastIndex(name, ":")
var repository, tag string
if li < 0 {
repository = name
} else {
repository = name[0:li]
tag = name[li+1:]
}
if repository == i.Repository && len(strings.TrimSpace(tag)) == 0 {
return true
}
if repository == i.Repository && tag == i.Tag {
return true
}
return false
}
}
// FilterImages filters images using a set of predefined fitler funcs
func FilterImages(images []inspect.ImageResult, filters []ImageResultFilter) []inspect.ImageResult {
var filteredImages []inspect.ImageResult
for _, image := range images {
include := true
for _, filter := range filters {
include = include && filter(image)
}
if include {
filteredImages = append(filteredImages, image)
}
}
return filteredImages
}
| 28.946758
| 202
| 0.694225
|
c424bb1d9916145c4ecfbcf3106ff97b6794b842
| 809
|
cpp
|
C++
|
mp2/main.cpp
|
Atrifex/ECE-438
|
fbf2c3f51291bfa347abaa06f843e2d20d5239f6
|
[
"MIT"
] | 2
|
2019-04-25T00:24:55.000Z
|
2019-04-25T04:35:05.000Z
|
mp2/main.cpp
|
Atrifex/ECE-438
|
fbf2c3f51291bfa347abaa06f843e2d20d5239f6
|
[
"MIT"
] | null | null | null |
mp2/main.cpp
|
Atrifex/ECE-438
|
fbf2c3f51291bfa347abaa06f843e2d20d5239f6
|
[
"MIT"
] | 1
|
2020-10-02T21:32:34.000Z
|
2020-10-02T21:32:34.000Z
|
#include <iostream>
#include <utility>
#include <thread>
#include <chrono>
#include <functional>
#include <atomic>
#include "ls_router.h"
using std::thread;
using std::ref;
void announceToNeighbors(LS_Router & router) {
router.announceToNeighbors();
}
void generateLSP(LS_Router & router) {
router.generateLSP();
}
int main(int argc, char** argv)
{
if(argc != 4) {
fprintf(stderr, "Usage: %s mynodeid initialcostsfile logfile\n\n", argv[0]);
exit(1);
}
// Parse input and initialize router
LS_Router router(atoi(argv[1]), argv[2], argv[3]);
// start announcing
thread announcer(announceToNeighbors, ref(router));
// start generating lsps
thread lspGenerator(generateLSP, ref(router));
// start listening
router.listenForNeighbors();
}
| 19.731707
| 84
| 0.672435
|
41644075b9fe991eb77604429344aac7012e44f6
| 1,346
|
dart
|
Dart
|
lib/src/models/User.dart
|
pectoraux/EMSRwanda-Web
|
59f15b93b79a87a49fc4235ef94e7e27f3d61c98
|
[
"MIT"
] | null | null | null |
lib/src/models/User.dart
|
pectoraux/EMSRwanda-Web
|
59f15b93b79a87a49fc4235ef94e7e27f3d61c98
|
[
"MIT"
] | null | null | null |
lib/src/models/User.dart
|
pectoraux/EMSRwanda-Web
|
59f15b93b79a87a49fc4235ef94e7e27f3d61c98
|
[
"MIT"
] | 1
|
2019-06-18T15:44:05.000Z
|
2019-06-18T15:44:05.000Z
|
import 'package:angular/angular.dart';
import 'package:angular_components/angular_components.dart';
class mUser {
final String userName;
String userRole, firstName, lastName, dob, country, nationalID, passportNo, mainPhone, sex, altPhone1, altPhone2, email1, email2, tin, cvStatusElec;
// mUser(this.userName, this.firstName, this.lastName, this.dob, this.country, this.nationalID, this.passportNo, this.mainPhone, this.sex, this.altPhone1, this.altPhone2, this.email1, this.email2, this.tin, this.cvStatusElec) {
// }
mUser(this.userName);
String get userId => "$userName";
// mUser.fromMap(Map map): this(map['userName'],
// map['firstName'],
// map['lastName'],
// map['dob'],
// map['country'],
// map['nationalID'],
// map['passportNo'],
// map['mainPhone'],
// map['sex'],
// map['altPhone1'],
// map['altPhone2'],
// map['email1'],
// map['email2'],
// map['tin'],
// map['cvStatusElec']);
Map toMap() => {
"userName": userName,
"firstName": firstName,
"lastName": lastName,
"dob": dob,
"country": country,
"nationalID": nationalID,
"passportNo": passportNo,
"mainPhone": mainPhone,
"sex":sex,
"altPhone1":altPhone1,
"altPhone2":altPhone2,
"email1": email1,
"email2": email2,
"tin": tin,
"cvStatusElec":cvStatusElec
};
}
| 29.26087
| 228
| 0.638187
|
53d192440a35ce8460e472cb1ee9981dfd07229d
| 2,701
|
dart
|
Dart
|
packages/mobx_resource_bloc/lib/src/computed_resource_bloc.dart
|
brianrobles204/resource_bloc
|
df28d772d58bb64e17ebae0f81a2a9d18f93cf3e
|
[
"MIT"
] | null | null | null |
packages/mobx_resource_bloc/lib/src/computed_resource_bloc.dart
|
brianrobles204/resource_bloc
|
df28d772d58bb64e17ebae0f81a2a9d18f93cf3e
|
[
"MIT"
] | 2
|
2021-10-10T08:19:30.000Z
|
2021-12-16T22:34:00.000Z
|
packages/mobx_resource_bloc/lib/src/computed_resource_bloc.dart
|
brianrobles204/resource_bloc
|
df28d772d58bb64e17ebae0f81a2a9d18f93cf3e
|
[
"MIT"
] | null | null | null |
import 'package:mobx/mobx.dart';
import 'package:mobx_resource_bloc/mobx_resource_bloc.dart';
import 'package:resource_bloc/resource_bloc.dart';
abstract class ComputedBaseResourceBloc<K extends Object, V>
extends BaseResourceBloc<K, V> with ComputedResourceBlocMixin<K, V> {
ComputedBaseResourceBloc({
required KeyCallback<K> key,
InitialValue<K, V>? initialValue,
}) : this._computed(
computedKey: Computed(key, name: 'ComputedResourceBloc<$K,$V>.key'),
initialValue: initialValue,
);
ComputedBaseResourceBloc._computed({
required this.computedKey,
InitialValue<K, V>? initialValue,
}) : super.fromState(
_initialStateFor(computedKey, initialValue),
initialValue: initialValue,
);
@override
final Computed<K> computedKey;
static ResourceState<K, V> _initialStateFor<K extends Object, V>(
Computed<K> computedKey,
InitialValue<K, V>? initialValue,
) {
try {
final key = computedKey.value;
return BaseResourceBloc.initialStateFor(
key,
initialValue,
isLoading: false,
);
} on MobXCaughtException catch (e) {
return ResourceState.withError(e.exception, key: null, isLoading: false);
}
}
}
abstract class ComputedResourceBloc<K extends Object, V>
extends ComputedBaseResourceBloc<K, V> with ReloadResourceBlocMixin {
ComputedResourceBloc({
required KeyCallback<K> key,
InitialValue<K, V>? initialValue,
OnObservePolicy? onObservePolicy,
}) : _onObservePolicy = onObservePolicy,
super(key: key, initialValue: initialValue);
factory ComputedResourceBloc.from({
required KeyCallback<K> key,
required FreshSource<K, V> freshSource,
required TruthSource<K, V> truthSource,
InitialValue<K, V>? initialValue,
OnObservePolicy? onObservePolicy,
}) = CallbackComputedResourceBloc;
static OnObservePolicy defaultOnObservePolicy =
OnObservePolicy.reloadIfCached;
final OnObservePolicy? _onObservePolicy;
@override
OnObservePolicy get onObservePolicy =>
_onObservePolicy ?? defaultOnObservePolicy;
}
class CallbackComputedResourceBloc<K extends Object, V>
extends ComputedResourceBloc<K, V> with CallbackResourceBlocMixin<K, V> {
CallbackComputedResourceBloc({
required KeyCallback<K> key,
required this.freshSource,
required this.truthSource,
InitialValue<K, V>? initialValue,
OnObservePolicy? onObservePolicy,
}) : super(
key: key,
initialValue: initialValue,
onObservePolicy: onObservePolicy,
);
@override
final FreshSource<K, V> freshSource;
@override
final TruthSource<K, V> truthSource;
}
| 30.011111
| 79
| 0.711218
|
c4badfa74e68b7a750e380f0295c21575f1b9a23
| 7,552
|
cpp
|
C++
|
BMA400.cpp
|
akita11/Grove_3Axis_Digital_Accelerometer_BMA400
|
f32641a877cf6a73dfe8badc66796205d9e5fd96
|
[
"MIT"
] | 3
|
2020-02-06T10:05:21.000Z
|
2020-08-16T01:57:51.000Z
|
BMA400.cpp
|
akita11/Grove_3Axis_Digital_Accelerometer_BMA400
|
f32641a877cf6a73dfe8badc66796205d9e5fd96
|
[
"MIT"
] | 1
|
2021-08-15T22:04:05.000Z
|
2021-08-15T22:04:05.000Z
|
BMA400.cpp
|
akita11/Grove_3Axis_Digital_Accelerometer_BMA400
|
f32641a877cf6a73dfe8badc66796205d9e5fd96
|
[
"MIT"
] | 8
|
2019-03-26T19:08:08.000Z
|
2021-10-12T00:06:48.000Z
|
/*
A library for Grove - 3-Axis Digital Accelerometer ±2g to 16g Ultra-low Power(BMA400)
Copyright (c) 2018 seeed technology co., ltd.
Author : Wayen Weng
Create Time : June 2018
Change Log :
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "BMA400.h"
BMA400::BMA400(void) {
devAddr = BMA400_ADDRESS;
}
void BMA400::readwrite(uint8_t reg, uint8_t* buf, uint16_t len, uint8_t rw){
uint8_t i = 0;
if (rw == 1)
{ //write
while (len-- > 0)
{
//Serial.print (reg, buf[i]);
write8(reg++, buf[i++]);
}
}
else
{ //read
while (len-- > 0)
{
buf[i++] = read8(reg++);
//Serial.print(reg-1, buf[i-1]);
}
}
}
void BMA400::initialize(void) {
setPoweMode(NORMAL);
setFullScaleRange(RANGE_4G);
setOutputDataRate(ODR_200);
setOSR(OSR_LOWEST);
setFilter(ACC_FILT1);
enableGen1();
setRouteGen1();
configIntPin();
setLatch();
}
bool BMA400::isConnection(void) {
return (getDeviceID() == 0x90);
}
uint8_t BMA400::getDeviceID(void) {
return read8(BMA400_CHIPID);
}
void BMA400::reset(void) {
write8(BMA400_CMD, 0xb6);
}
void BMA400::setPoweMode(power_type_t mode) {
uint8_t data = 0;
data = read8(BMA400_ACC_CONFIG_0);
data = (data & 0xfc) | mode;
write8(BMA400_ACC_CONFIG_0, data);
}
void BMA400::setFullScaleRange(scale_type_t range) {
uint8_t data = 0;
if (range == RANGE_2G) {
accRange = 2000;
} else if (range == RANGE_4G) {
accRange = 4000;
} else if (range == RANGE_8G) {
accRange = 8000;
} else if (range == RANGE_16G) {
accRange = 16000;
}
data = read8(BMA400_ACC_CONFIG_1);
data = (data & 0x3f) | (range << 6);
write8(BMA400_ACC_CONFIG_1, data);
}
void BMA400::setOutputDataRate(odr_type_t odr) {
uint8_t data = 0;
data = read8(BMA400_ACC_CONFIG_1);
data = (data & 0xf0) | odr;
write8(BMA400_ACC_CONFIG_1, data);
}
//method to set the data registers source
void BMA400::setFilter(filter_type_t filter){
uint8_t data=0;
data= read8(BMA400_ACC_CONFIG_2);
data= data & 0b11110011;
data= data| (filter<<2);
write8(BMA400_ACC_CONFIG_2,data);
}
//method to set the oversampling rate
void BMA400::setOSR(overSampling_rate_t overSampling){
uint8_t data=0;
data=read8(BMA400_ACC_CONFIG_1);
data=data&0b11001111;
data=data|(overSampling<<4);
write8(BMA400_ACC_CONFIG_1,data);
}
//method to enable the interrupt gen1
void BMA400::enableGen1(void){
uint8_t data=0;
data=read8(BMA400_INT_CONFIG_0);
data=data&0b11111011;
data=data|0b00000100;//0x04;
write8(BMA400_INT_CONFIG_0,data);
}
//method to map the gen1 interrupt signal on pin INT1
void BMA400::setRouteGen1(void){
uint8_t data=0;
data=read8(BMA400_INT_1_MAP);
data=data&0b11111011;
data=data|0b00000100;//0x04;
write8(BMA400_INT_1_MAP,data);
}
//method to set the interrupt pins in configuration push-pull e active-high
void BMA400::configIntPin(void){
uint8_t data=0;
data=read8(BMA400_INT_1_2_CTRL);
data=data&0b11011101;
data=data|0b00100010;//0x22;
write8(BMA400_INT_1_2_CTRL,data);
}
//method to set the interrupt latching
void BMA400::setLatch(void){
uint8_t data=0;
data=read8(BMA400_INT_CONFIG_1);
data=data&0b01111111;
data=data|0x80;
write8(BMA400_INT_CONFIG_1, data);
}
bool BMA400::read0x0e(){
uint8_t data=0;
data=read8(BMA400_INT_STAT0);
data=data&0b00000100;
if(data>0)
return true;
else
return false;
}
void BMA400::getAcceleration(float* x, float* y, float* z) {
uint8_t buf[6] = {0};
uint16_t ax = 0, ay = 0, az = 0;
float value = 0;
read(BMA400_ACC_X_LSB, buf, 6);
ax = buf[0] | (buf[1] << 8);
ay = buf[2] | (buf[3] << 8);
az = buf[4] | (buf[5] << 8);
if (ax > 2047) {
ax = ax - 4096;
}
if (ay > 2047) {
ay = ay - 4096;
}
if (az > 2047) {
az = az - 4096;
}
value = (int16_t)ax;
*x = accRange * value / 2048;
value = (int16_t)ay;
*y = accRange * value / 2048;
value = (int16_t)az;
*z = accRange * value / 2048;
}
float BMA400::getAccelerationX(void) {
uint16_t ax = 0;
float value = 0;
ax = read16(BMA400_ACC_X_LSB);
if (ax > 2047) {
ax = ax - 4096;
}
value = (int16_t)ax;
value = accRange * value / 2048;
return value;
}
float BMA400::getAccelerationY(void) {
uint16_t ay = 0;
float value = 0;
ay = read16(BMA400_ACC_Y_LSB);
if (ay > 2047) {
ay = ay - 4096;
}
value = (int16_t)ay;
value = accRange * value / 2048;
return value;
}
float BMA400::getAccelerationZ(void) {
uint16_t az = 0;
float value = 0;
az = read16(BMA400_ACC_Z_LSB);
if (az > 2047) {
az = az - 4096;
}
value = (int16_t)az;
value = accRange * value / 2048;
return value;
}
int16_t BMA400::getTemperature(void) {
int8_t data = 0;
int16_t temp = 0;
data = (int8_t)read8(BMA400_TEMP_DATA);
temp = data / 2 + 23;
return temp;
}
void BMA400::write8(uint8_t reg, uint8_t val) {
Wire.beginTransmission(devAddr);
Wire.write(reg);
Wire.write(val);
Wire.endTransmission();
}
uint8_t BMA400::read8(uint8_t reg) {
uint8_t data = 0;
Wire.beginTransmission(devAddr);
Wire.write(reg);
Wire.endTransmission();
Wire.requestFrom((int16_t)devAddr, 1);
while (Wire.available()) {
data = Wire.read();
}
return data;
}
uint16_t BMA400::read16(uint8_t reg) {
uint16_t msb = 0, lsb = 0;
Wire.beginTransmission(devAddr);
Wire.write(reg);
Wire.endTransmission();
Wire.requestFrom((int16_t)devAddr, 2);
while (Wire.available()) {
lsb = Wire.read();
msb = Wire.read();
}
return (lsb | (msb << 8));
}
uint32_t BMA400::read24(uint8_t reg) {
uint32_t hsb = 0, msb = 0, lsb = 0;
Wire.beginTransmission(devAddr);
Wire.write(reg);
Wire.endTransmission();
Wire.requestFrom((int16_t)devAddr, 3);
while (Wire.available()) {
lsb = Wire.read();
msb = Wire.read();
hsb = Wire.read();
}
return (lsb | (msb << 8) | (hsb << 16));
}
void BMA400::read(uint8_t reg, uint8_t* buf, uint16_t len) {
Wire.beginTransmission(devAddr);
Wire.write(reg);
Wire.endTransmission();
Wire.requestFrom((int16_t)devAddr, len);
while (Wire.available()) {
for (uint16_t i = 0; i < len; i ++) {
buf[i] = Wire.read();
}
}
}
BMA400 bma400;
| 22.017493
| 89
| 0.639433
|
756d6b9a95878f9ebf10fb97e2c51eba5f2ca51d
| 30,794
|
css
|
CSS
|
vendor/onmotion/yii2-survey/assets/css/survey.css
|
Kodynska/SurveyAnn
|
bffb8c0ddc0c6944f15c12deab04e26494727895
|
[
"BSD-3-Clause"
] | null | null | null |
vendor/onmotion/yii2-survey/assets/css/survey.css
|
Kodynska/SurveyAnn
|
bffb8c0ddc0c6944f15c12deab04e26494727895
|
[
"BSD-3-Clause"
] | null | null | null |
vendor/onmotion/yii2-survey/assets/css/survey.css
|
Kodynska/SurveyAnn
|
bffb8c0ddc0c6944f15c12deab04e26494727895
|
[
"BSD-3-Clause"
] | null | null | null |
.survey-container{max-width:900px;margin:10px auto 0 auto}#survey-questions-pjax{-webkit-transition:all .2s;transition:all .2s}.survey-container .btn,.kv-editable-popover .btn,#survey-index .btn{-webkit-transition:all .3s;transition:all .3s;background-color:transparent;color:#393939;border-radius:5px;min-width:28px;-webkit-box-shadow:0 3px 7px transparent;box-shadow:0 3px 7px transparent;margin:7px 3px}.survey-container .btn.btn-xs,.kv-editable-popover .btn.btn-xs,#survey-index .btn.btn-xs{padding:2px 8px}.survey-container .btn:hover,.kv-editable-popover .btn:hover,#survey-index .btn:hover{-webkit-box-shadow:0 3px 7px #9a9a9a;box-shadow:0 3px 7px #9a9a9a}.survey-container .btn.btn-primary,.kv-editable-popover .btn.btn-primary,#survey-index .btn.btn-primary{border-color:#2196F3;background-color:transparent}.survey-container .btn.btn-primary:hover,.survey-container .btn.btn-primary:focus,.kv-editable-popover .btn.btn-primary:hover,.kv-editable-popover .btn.btn-primary:focus,#survey-index .btn.btn-primary:hover,#survey-index .btn.btn-primary:focus{background-color:#239dff;border-color:#239dff;color:#fff}.survey-container .btn.btn-primary:active,.survey-container .btn.btn-primary:active:focus,.kv-editable-popover .btn.btn-primary:active,.kv-editable-popover .btn.btn-primary:active:focus,#survey-index .btn.btn-primary:active,#survey-index .btn.btn-primary:active:focus{background-color:#1f7aca;border-color:#1f7aca;color:#fff}.survey-container .btn.btn-success,.kv-editable-popover .btn.btn-success,#survey-index .btn.btn-success{border-color:#009688;background-color:transparent}.survey-container .btn.btn-success:hover,.survey-container .btn.btn-success:focus,.kv-editable-popover .btn.btn-success:hover,.kv-editable-popover .btn.btn-success:focus,#survey-index .btn.btn-success:hover,#survey-index .btn.btn-success:focus{background-color:#00bdad;border-color:#00bdad;color:#fff}.survey-container .btn.btn-success:active,.survey-container .btn.btn-success:active:focus,.kv-editable-popover .btn.btn-success:active,.kv-editable-popover .btn.btn-success:active:focus,#survey-index .btn.btn-success:active,#survey-index .btn.btn-success:active:focus{background-color:#00a696;border-color:#00a696;color:#fff}.survey-container .btn.btn-info,.kv-editable-popover .btn.btn-info,#survey-index .btn.btn-info{border-color:#00bcd4;background-color:transparent}.survey-container .btn.btn-info:hover,.survey-container .btn.btn-info:focus,.kv-editable-popover .btn.btn-info:hover,.kv-editable-popover .btn.btn-info:focus,#survey-index .btn.btn-info:hover,#survey-index .btn.btn-info:focus{background-color:#00d5ed;border-color:#00d5ed;color:#fff}.survey-container .btn.btn-info:active,.survey-container .btn.btn-info:active:focus,.kv-editable-popover .btn.btn-info:active,.kv-editable-popover .btn.btn-info:active:focus,#survey-index .btn.btn-info:active,#survey-index .btn.btn-info:active:focus{background-color:#0099b1;border-color:#0099b1;color:#fff}.survey-container .btn.btn-danger,.kv-editable-popover .btn.btn-danger,#survey-index .btn.btn-danger{border-color:#F44336;background-color:transparent;color:#F44336}.survey-container .btn.btn-danger:hover,.survey-container .btn.btn-danger:focus,.kv-editable-popover .btn.btn-danger:hover,.kv-editable-popover .btn.btn-danger:focus,#survey-index .btn.btn-danger:hover,#survey-index .btn.btn-danger:focus{background-color:#ff4637;border-color:#ff4637;color:#fff}.survey-container .btn.btn-danger:active,.survey-container .btn.btn-danger:active:focus,.kv-editable-popover .btn.btn-danger:active,.kv-editable-popover .btn.btn-danger:active:focus,#survey-index .btn.btn-danger:active,#survey-index .btn.btn-danger:active:focus{background-color:#e74036;border-color:#e74036;color:#fff}#survey-widget .survey-container .form-group{width:100%}.survey-container .form-group,.kv-editable-popover .form-group{min-width:100px}.survey-container .form-control,.kv-editable-popover .form-control{padding:0;height:23px;border-top:none;border-left:none;border-right:none;border-bottom:1px solid #2196F3;border-radius:0;background:transparent;width:100% !important;-webkit-box-shadow:none !important;box-shadow:none !important}.survey-container .input-group .input-group-addon,.kv-editable-popover .input-group .input-group-addon{padding:0 8px;font-size:14px;font-weight:normal;line-height:1;color:#555;text-align:center;background-color:transparent;border:none;border-radius:4px}.survey-container .input-group .form-control,.kv-editable-popover .input-group .form-control{padding:0;height:23px;border-top:none;border-left:none;border-right:none;border-bottom:1px solid #2196F3;border-radius:0;background:transparent;width:100% !important;-webkit-box-shadow:none !important;box-shadow:none !important}.survey-container .has-success .form-control,.kv-editable-popover .has-success .form-control{border-color:#009688}.survey-container .has-error .form-control,.kv-editable-popover .has-error .form-control{border-color:#F44336}.survey-container .survey-block,.kv-editable-popover .survey-block{background:#fff;padding:15px;border-radius:5px;margin-bottom:20px;position:relative;-webkit-box-shadow:0 2px 15px rgba(0,0,0,0.14);box-shadow:0 2px 15px rgba(0,0,0,0.14)}.survey-container .survey-block .survey-name-wrap,.survey-container .survey-block .survey-question-name-wrap,.survey-container .survey-block .survey-question-view-wrap,.kv-editable-popover .survey-block .survey-name-wrap,.kv-editable-popover .survey-block .survey-question-name-wrap,.kv-editable-popover .survey-block .survey-question-view-wrap{background-color:#82be50;border-radius:5px;padding:10px}.survey-container .survey-block .survey-name-wrap .kv-editable-link,.survey-container .survey-block .survey-question-name-wrap .kv-editable-link,.survey-container .survey-block .survey-question-view-wrap .kv-editable-link,.kv-editable-popover .survey-block .survey-name-wrap .kv-editable-link,.kv-editable-popover .survey-block .survey-question-name-wrap .kv-editable-link,.kv-editable-popover .survey-block .survey-question-view-wrap .kv-editable-link{color:#ffffff;font-size:19px}.survey-container .survey-block .survey-questions-form-field,.kv-editable-popover .survey-block .survey-questions-form-field{margin:0 10px}.survey-container .survey-block .survey-question-view-wrap,.kv-editable-popover .survey-block .survey-question-view-wrap{background-color:#e3e8ea}.survey-container .survey-block .survey-question-view-wrap h4,.kv-editable-popover .survey-block .survey-question-view-wrap h4{display:inline-block}.survey-container .survey-block .btn,.kv-editable-popover .survey-block .btn{padding:4px 8px}.survey-container .survey-block .btn.btn-primary,.kv-editable-popover .survey-block .btn.btn-primary{border-color:#ababab;color:#ababab;background-color:transparent}.survey-container .survey-block .btn.btn-primary:hover,.survey-container .survey-block .btn.btn-primary:focus,.kv-editable-popover .survey-block .btn.btn-primary:hover,.kv-editable-popover .survey-block .btn.btn-primary:focus{background-color:#239dff;border-color:#239dff;color:#fff}.survey-container .survey-block .btn.btn-primary:active,.survey-container .survey-block .btn.btn-primary:active:focus,.kv-editable-popover .survey-block .btn.btn-primary:active,.kv-editable-popover .survey-block .btn.btn-primary:active:focus{background-color:#1f7aca;border-color:#1f7aca;color:#fff}.survey-container .survey-block .btn.btn-success,.kv-editable-popover .survey-block .btn.btn-success{border-color:#ababab;color:#ababab;background-color:transparent}.survey-container .survey-block .btn.btn-success:hover,.survey-container .survey-block .btn.btn-success:focus,.kv-editable-popover .survey-block .btn.btn-success:hover,.kv-editable-popover .survey-block .btn.btn-success:focus{background-color:#00bdad;border-color:#00bdad;color:#fff}.survey-container .survey-block .btn.btn-success:active,.survey-container .survey-block .btn.btn-success:active:focus,.kv-editable-popover .survey-block .btn.btn-success:active,.kv-editable-popover .survey-block .btn.btn-success:active:focus{background-color:#00a696;border-color:#00a696;color:#fff}.survey-container .survey-block .btn.btn-info,.kv-editable-popover .survey-block .btn.btn-info{border-color:#ababab;color:#ababab;background-color:transparent}.survey-container .survey-block .btn.btn-info:hover,.survey-container .survey-block .btn.btn-info:focus,.kv-editable-popover .survey-block .btn.btn-info:hover,.kv-editable-popover .survey-block .btn.btn-info:focus{background-color:#00d5ed;border-color:#00d5ed;color:#fff}.survey-container .survey-block .btn.btn-info:active,.survey-container .survey-block .btn.btn-info:active:focus,.kv-editable-popover .survey-block .btn.btn-info:active,.kv-editable-popover .survey-block .btn.btn-info:active:focus{background-color:#0099b1;border-color:#0099b1;color:#fff}.survey-container .survey-block .btn.btn-danger,.kv-editable-popover .survey-block .btn.btn-danger{border-color:#ababab;background-color:transparent;color:#ababab}.survey-container .survey-block .btn.btn-danger:hover,.survey-container .survey-block .btn.btn-danger:focus,.kv-editable-popover .survey-block .btn.btn-danger:hover,.kv-editable-popover .survey-block .btn.btn-danger:focus{background-color:#ff4637;border-color:#ff4637;color:#fff}.survey-container .survey-block .btn.btn-danger:active,.survey-container .survey-block .btn.btn-danger:active:focus,.kv-editable-popover .survey-block .btn.btn-danger:active,.kv-editable-popover .survey-block .btn.btn-danger:active:focus{background-color:#e74036;border-color:#e74036;color:#fff}.survey-container .survey-block .survey-question-name-wrap,.kv-editable-popover .survey-block .survey-question-name-wrap{background-color:transparent}.survey-container .survey-block .survey-question-name-wrap h4,.kv-editable-popover .survey-block .survey-question-name-wrap h4{font-size:16px;margin-bottom:17px}.survey-container .survey-block .survey-question-name-wrap .btn,.kv-editable-popover .survey-block .survey-question-name-wrap .btn{margin-left:5px}.survey-container .survey-block .survey-question-name-wrap .survey-questions-form-field,.kv-editable-popover .survey-block .survey-question-name-wrap .survey-questions-form-field{margin:0}.survey-container .survey-block .survey-question-name-wrap .form-control,.kv-editable-popover .survey-block .survey-question-name-wrap .form-control{color:#374141;font-weight:bold;font-size:16px}.survey-container .survey-block .survey-question-name-wrap .form-group,.kv-editable-popover .survey-block .survey-question-name-wrap .form-group{width:80%}.survey-container .survey-block label,.kv-editable-popover .survey-block label{margin-right:10px}.survey-container .survey-block .select2-container--krajee,.kv-editable-popover .survey-block .select2-container--krajee{display:inline-block;width:inherit !important;min-width:200px}.survey-container .survey-block .select2-container--krajee .select2-selection--single,.kv-editable-popover .survey-block .select2-container--krajee .select2-selection--single{padding:0;height:23px;border-top:none;border-left:none;border-right:none;border-bottom:1px solid #2196F3;border-radius:0;background:transparent;width:100% !important;-webkit-box-shadow:none !important;box-shadow:none !important}.survey-container .survey-block .select2-container--krajee .select2-selection--single .select2-selection__arrow,.kv-editable-popover .survey-block .select2-container--krajee .select2-selection--single .select2-selection__arrow{border-left:none;top:-5px}.survey-container .survey-block .points-wrap,.kv-editable-popover .survey-block .points-wrap{width:50px;display:inline-block;text-align:center}.survey-container .survey-block .points-wrap input,.kv-editable-popover .survey-block .points-wrap input{text-align:center}.survey-container .survey-block .points-wrap .points-title,.kv-editable-popover .survey-block .points-wrap .points-title{font-size:12px;color:#afafaf}.survey-container .survey-block .checkbox-inline,.kv-editable-popover .survey-block .checkbox-inline{min-width:initial}.survey-container .survey-block .checkbox-inline label,.kv-editable-popover .survey-block .checkbox-inline label{font-weight:300}.survey-container .survey-block .survey-questions-form-field-inline,.kv-editable-popover .survey-block .survey-questions-form-field-inline{margin:10px}.survey-container .survey-block .survey-questions-form-field-inline input,.kv-editable-popover .survey-block .survey-questions-form-field-inline input{width:40px !important;text-align:center}.survey-container .survey-block .inline-input,.kv-editable-popover .survey-block .inline-input{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.survey-container .survey-block .inline-input label,.kv-editable-popover .survey-block .inline-input label{-ms-flex-negative:0;flex-shrink:0}.survey-container .pagination>.active>a,.survey-container .pagination>.active>span,.survey-container .pagination>.active>a:hover,.survey-container .pagination>.active>span:hover,.survey-container .pagination>.active>a:focus,.survey-container .pagination>.active>span:focus,.kv-editable-popover .pagination>.active>a,.kv-editable-popover .pagination>.active>span,.kv-editable-popover .pagination>.active>a:hover,.kv-editable-popover .pagination>.active>span:hover,.kv-editable-popover .pagination>.active>a:focus,.kv-editable-popover .pagination>.active>span:focus{background-color:#374141;border:none}.survey-container .pagination>.active>a,.kv-editable-popover .pagination>.active>a{color:#eee}.survey-container .pagination>li>a,.survey-container .pagination>li>span,.kv-editable-popover .pagination>li>a,.kv-editable-popover .pagination>li>span{padding:3px 10px;border-radius:4px;border:none;color:#607D8B}.select2-container.select2-container--krajee .select2-dropdown{-webkit-box-shadow:0 7px 15px rgba(0,0,0,0.26);box-shadow:0 7px 15px rgba(0,0,0,0.26);border-color:transparent}.survey-container .survey-btn{margin:10px auto}.answers-container .pseudo-checkbox{margin:10px 0 10px 10px}.answers-container .name{font-size:14px}.answers-container .answer-description{margin:15px 0}.answers-container label{font-size:14px;font-weight:normal}#survey-index{margin-top:20px}#survey-index .summary{margin:15px 0}#survey-index .survey-card{background:#fff;-webkit-box-shadow:0 2px 11px rgba(0,0,0,0.07);box-shadow:0 2px 11px rgba(0,0,0,0.07);margin-bottom:10px;max-width:700px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row;flex-flow:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;-webkit-transition:-webkit-box-shadow .3s;transition:-webkit-box-shadow .3s;transition:box-shadow .3s;transition:box-shadow .3s, -webkit-box-shadow .3s}#survey-index .survey-card .first-line{padding:10px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row;flex-flow:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap}#survey-index .survey-card .second-line{padding:0 10px 5px 10px;width:100%;-ms-flex-wrap:nowrap;flex-wrap:nowrap;font-size:12px;color:#9c9c9c}#survey-index .survey-card .second-line .date{float:right}#survey-index .survey-card:hover{-webkit-box-shadow:1px 5px 11px rgba(0,0,0,0.13);box-shadow:1px 5px 11px rgba(0,0,0,0.13)}#survey-index .survey-card .status{width:3px;-ms-flex-item-align:baseline;align-self:baseline;position:absolute;left:0;height:100%;top:0}#survey-index .survey-card .status.active{background-color:#88f367}#survey-index .survey-card .status.closed{background-color:#ff6a6a}#survey-index .survey-card .status.expired{background-color:#91918d}#survey-index .survey-card .image{display:inline-block;vertical-align:middle;width:40px;height:40px;border-radius:50%;background-color:#cecece;color:#fff;text-align:center;line-height:40px;font-size:20px;background-position:center;background-size:cover}#survey-index .survey-card .description{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;vertical-align:middle;-webkit-box-align:center;-ms-flex-align:center;align-items:center}#survey-index .survey-card .description .name{margin:0 10px}#survey-index .survey-card .description .survey-labels{margin-right:10px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}#survey-index .survey-card .description .survey-labels .survey-label{background-color:#607d8b;color:#fff;padding:2px 5px;border-radius:15px;min-width:40px;display:inline-block;text-align:center;margin:0 5px}#survey-index .survey-card .description .survey-labels .survey-label.respondents{background-color:#9C27B0}#survey-index .survey-card .description .survey-labels .survey-label.completed-respondents{background-color:#009688}#survey-index .survey-card .description .survey-actions{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}#survey-index .pagination>.active>a{color:#fff}#survey-list .summary+.item{margin-top:40px}#survey-pjax .field-survey-survey_descr{margin-bottom:15px}#survey-pjax .field-survey-survey_descr textarea{height:100%;width:100%}#survey-pjax .form-group{margin-top:10px}#survey-pjax .form-group input{width:100%}#survey-title{background:#82be50;padding:10px 20px;margin:0 -15px;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;vertical-align:middle;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:50px}#survey-title .survey-labels{margin-right:10px}#survey-title .survey-labels .survey-label{background-color:#607d8b;color:#fff;padding:2px 5px;border-radius:15px;min-width:40px;display:inline-block;text-align:center;margin:0 5px}#survey-title .survey-labels .survey-label.respondents{background-color:#9C27B0}#survey-title .survey-labels .survey-label.completed-respondents{background-color:#009688}#survey-title .survey-labels .survey-label:hover{text-decoration:none}#survey-view .survey-container .survey-block,#survey-view .kv-editable-popover .survey-block{margin-bottom:55px}#survey-view .survey-question-name-wrap{font-size:16px;font-weight:600}.respondents-toggle{cursor:pointer}.hidden-modal-right{position:fixed;top:0;right:-600px;z-index:1;width:600px;height:100vh;background:rgba(255,255,255,0.96);padding:20px;-webkit-transition:all .3s;transition:all .3s;-webkit-box-shadow:-2px 0 10px rgba(0,0,0,0.16);box-shadow:-2px 0 10px rgba(0,0,0,0.16)}.hidden-modal-right .close-btn{float:right;font-size:22px;cursor:pointer}.hidden-modal-right.opened{right:0}#survey-respondents-pjax #survey-respondents-list{margin-top:20px}#survey-respondents-pjax #survey-respondents-list .summary{margin-bottom:15px}#survey-respondents-pjax #survey-respondents-list .item{padding:2px 10px;background:#fff;-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1);margin:8px 0;-webkit-transition:all .3s;transition:all .3s;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}#survey-respondents-pjax #survey-respondents-list .item:hover{-webkit-box-shadow:0 2px 10px rgba(0,0,0,0.13);box-shadow:0 2px 10px rgba(0,0,0,0.13)}#remote-modal .modal-content{background:rgba(255,255,255,0.83)}#remote-modal .modal-content .modal-body{background:transparent}#remote-modal .modal-content .modal-body .buttons .btn{padding:4px 9px;margin:0}.tt-menu .tt-dataset .disabled{color:#ddd}#survey-widget .survey-block{padding:15px 5px}#survey-widget .survey-infopane{top:10px;margin-top:25px}#survey-widget .survey-infopane .infopane-block{margin-top:15px}#survey-widget .survey-infopane p{color:#8c8c8c;font-size:14px;margin:0}#survey-widget .survey-infopane .wallet-price{color:#fa9646}#survey-widget .survey-infopane .status-price{color:#fadc64}#survey-widget .survey-infopane .price{font-size:20px;font-weight:bold}#survey-widget .survey-infopane .survey-label{display:inline-block;background:#555;padding:3px 10px;border-radius:15px;color:#fff;margin-right:5px}#survey-widget .survey-infopane .status{color:#fff;background:#374141;padding:5px 20px;border-radius:30px;font-weight:700;display:inline-block}#survey-widget .survey-infopane .status.active{background:#82BE50}#survey-widget .survey-infopane .status.closed{background:#fd4646}#survey-widget .survey-infopane .status.expired{background:#c3bec2}#survey-widget .survey-infopane .status.is-done{background:#fa9646}#survey-widget-title{padding:0 15px 30px}#survey-widget-title h3{font-weight:bold;font-size:20px}#survey-widget-title .survey-description{font-weight:300;font-size:14px}#survey-widget #survey-title,#survey-view #survey-title{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;height:300px;display:block;background:#374141}#survey-widget #survey-title .subcontainer,#survey-view #survey-title .subcontainer{max-width:900px;margin:0 auto 10px auto}#survey-widget #survey-title .subcontainer label,#survey-view #survey-title .subcontainer label{margin-right:10px}#survey-widget #survey-title .subcontainer.flex,#survey-view #survey-title .subcontainer.flex{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}#survey-widget #survey-title .survey-labels .survey-label,#survey-view #survey-title .survey-labels .survey-label{background:#03A9F4;border-radius:3px;font-size:13px}#survey-widget #survey-title .survey-labels .survey-label.warning,#survey-view #survey-title .survey-labels .survey-label.warning{background:#E91E63}#survey-widget .survey-container,#survey-view .survey-container{margin-top:0}#survey-widget .survey-container textarea.form-control,#survey-view .survey-container textarea.form-control{height:100%}#survey-widget #survey-questions .radio-group label,#survey-widget #survey-questions .checkbox-group label,#survey-view #survey-questions .radio-group label,#survey-view #survey-questions .checkbox-group label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;font-weight:initial}#survey-widget #survey-questions .radio-group label>input,#survey-widget #survey-questions .checkbox-group label>input,#survey-view #survey-questions .radio-group label>input,#survey-view #survey-questions .checkbox-group label>input{margin-right:15px}#survey-widget #survey-questions .radio-group label .text img,#survey-widget #survey-questions .checkbox-group label .text img,#survey-view #survey-questions .radio-group label .text img,#survey-view #survey-questions .checkbox-group label .text img{max-width:100%;height:auto !important}#survey-widget #survey-questions .survey-question-descr-wrap,#survey-view #survey-questions .survey-question-descr-wrap{margin:0 15px}#survey-widget #survey-questions .survey-question-descr-wrap img,#survey-view #survey-questions .survey-question-descr-wrap img{max-width:100%}#survey-widget #survey-questions .survey-block,#survey-view #survey-questions .survey-block{margin-bottom:0;-webkit-box-shadow:none;box-shadow:none}#survey-widget #survey-questions .survey-block .survey-question-name-wrap,#survey-view #survey-questions .survey-block .survey-question-name-wrap{padding:0 10px;color:#82be50}#survey-widget #survey-questions .survey-block .answer-item,#survey-view #survey-questions .survey-block .answer-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 10px}#survey-widget #survey-questions .survey-block .answer-item .answer-text,#survey-view #survey-questions .survey-block .answer-item .answer-text{margin-left:10px}#survey-widget #survey-questions .survey-block .survey-question-descr-wrap,#survey-view #survey-questions .survey-block .survey-question-descr-wrap{border-bottom:1px solid #ddd;margin:20px 15px}#survey-widget #survey-questions .survey-block .slider.slider-horizontal,#survey-view #survey-questions .survey-block .slider.slider-horizontal{width:100%}#survey-widget #survey-questions .survey-block .btn-submit,#survey-view #survey-questions .survey-block .btn-submit{margin:auto;display:block;padding:10px;opacity:0}#survey-widget #survey-questions .survey-block hr,#survey-view #survey-questions .survey-block hr{margin-bottom:15px}#survey-widget #survey-questions .error-summary,#survey-view #survey-questions .error-summary{margin:15px 0 0 0}#survey-widget #survey-questions .card-footer,#survey-view #survey-questions .card-footer{display:none;height:40px}.survey-loading{-webkit-transition:opacity .3s;transition:opacity .3s;opacity:0.7;overflow:hidden}.survey-loading:after{content:"Please, wait...";display:block;position:fixed;width:200px;left:calc(50vw - 100px);top:50vh;text-align:center}#survey-view .survey-actions #survey-pjax{float:none;margin-top:15px}#survey-view .progress{height:12px;margin-bottom:10px}#survey-view .progress .progress-bar{font-size:12px;line-height:12px}#survey-view .progress .progress-bar.init{width:0 !important}#survey-view .answers-stat{margin:0 10px}#survey-form .form-group{display:block}.checkbox{vertical-align:top;margin:0 3px 0 0;width:17px;height:17px}.checkbox+label{cursor:pointer}.checkbox:not(checked){position:absolute;opacity:0}.checkbox:not(checked)+label{position:relative;padding:0 0 0 60px}.checkbox:not(checked)+label:before{content:'';position:absolute;top:-4px;left:0;width:50px;height:26px;border-radius:13px;background:#CDD1DA;-webkit-box-shadow:inset 0 2px 3px rgba(0,0,0,0.2);box-shadow:inset 0 2px 3px rgba(0,0,0,0.2)}.checkbox:not(checked)+label:after{content:'';position:absolute;top:-2px;left:2px;width:22px;height:22px;border-radius:10px;background:#FFF;-webkit-box-shadow:0 2px 5px rgba(0,0,0,0.3);box-shadow:0 2px 5px rgba(0,0,0,0.3);-webkit-transition:all .2s;transition:all .2s}.checkbox:checked+label:before{background:#03A9F4}.checkbox.danger:checked+label:before{background:#ff5722}.checkbox:checked+label:after{left:26px}input[type=checkbox].css-checkbox{position:absolute;z-index:-1000;left:-1000px;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0;display:none}input[type=checkbox].css-checkbox+label.css-label{padding-left:27px;display:inline-block;line-height:25px;vertical-align:middle;cursor:pointer}input[type=checkbox].css-checkbox:checked+label.css-label:after{content:"";display:inline-block;width:8px;height:10px;background:transparent;border-radius:3px;text-align:center;line-height:20px;position:absolute;left:5px;top:5px;border:solid #82be50;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}input[type=checkbox].css-checkbox:checked+label.css-label:before{content:"";border:2px solid #82be50}input[type=checkbox].css-checkbox+label.css-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative}input[type=checkbox].css-checkbox+label.css-label:before{content:"";display:inline-block;width:18px;height:18px;background:#ffffff;border-radius:4px;border:2px solid #d4d4d4;text-align:center;line-height:20px;position:absolute;left:0;top:3px}input[type=radio].css-radio{position:absolute;z-index:-1000;left:-1000px;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0;display:none}input[type=radio].css-radio+label.css-label{padding-left:27px;display:inline-block;line-height:25px;vertical-align:middle;cursor:pointer}input[type=radio].css-radio:checked+label.css-label:after{content:"";display:inline-block;width:8px;height:8px;background:#82be50;text-align:center;line-height:20px;position:absolute;left:5px;top:8px;border-radius:50%}input[type=radio].css-radio:checked+label.css-label:before{content:"";border:2px solid #82be50}input[type=radio].css-radio+label.css-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative}input[type=radio].css-radio+label.css-label:before{content:"";display:inline-block;width:18px;height:18px;background:#ffffff;border-radius:50%;border:2px solid #d4d4d4;text-align:center;line-height:20px;position:absolute;left:0;top:3px}.survey-container .survey-block .survey-name-wrap{position:relative;padding:15px}.survey-container .survey-block .survey-name-wrap #form-photo-pjax{display:inline-block;width:59px;height:66px;position:absolute;top:-30px;left:2px}.survey-container .survey-block .survey-name-wrap #survey-survey_name-cont{margin-left:45px}.survey-container .survey-block .survey-name-wrap .preview-container{height:41px;background:#d1deff;border-radius:50%}.survey-container .survey-block .survey-name-wrap .uploadcrop label.control-label{height:100px}.survey-container .survey-block .survey-name-wrap .uploadcrop .preview-pane{height:59px}#s-done{margin:50px auto 30px auto}#survey-modal .modal-content .modal-header{background:#82be50}#survey-modal .modal-content .modal-header h2{color:#fff;font-size:30px}#survey-modal .modal-content .modal-header img{margin:30px auto 20px auto}#survey-modal .modal-content .modal-body{color:#333;background:#fff;padding-bottom:10px}#survey-modal .modal-content .modal-body .wallet-price{color:#fa9646;margin-bottom:3px}#survey-modal .modal-content .modal-body .status-price{color:#fadc64;margin-bottom:3px}#survey-modal .modal-content .modal-body .reward-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row;flex-flow:row}#survey-modal .modal-content .modal-body .reward-info .reward-item{margin:0 20px;text-align:center}#survey-modal .modal-content .modal-body .price{font-size:24px;font-weight:bold}#survey-modal .modal-content .modal-body p{font-size:14px;font-weight:300;color:#374141}#survey-modal .modal-content .modal-body .text{text-align:center;margin:10px auto}#survey-modal .modal-content .modal-footer{color:#333;background:#fff;padding-bottom:30px;border-bottom-left-radius:5px;border-bottom-right-radius:5px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:distribute;justify-content:space-around}@media (max-width: 430px){#survey-modal .modal-content .modal-footer .btn{font-size:13px;padding:3px 10px;line-height:26px}}#survey-modal{overflow-y:auto}
| 15,397
| 30,793
| 0.802494
|
027bb391c109eb9866ead92e51ab438cc9d42def
| 3,066
|
cc
|
C++
|
ecs/src/model/DescribeDiskMonitorDataRequest.cc
|
iamzken/aliyun-openapi-cpp-sdk
|
3c991c9ca949b6003c8f498ce7a672ea88162bf1
|
[
"Apache-2.0"
] | 3
|
2020-01-06T08:23:14.000Z
|
2022-01-22T04:41:35.000Z
|
ecs/src/model/DescribeDiskMonitorDataRequest.cc
|
sdk-team/aliyun-openapi-cpp-sdk
|
d0e92f6f33126dcdc7e40f60582304faf2c229b7
|
[
"Apache-2.0"
] | null | null | null |
ecs/src/model/DescribeDiskMonitorDataRequest.cc
|
sdk-team/aliyun-openapi-cpp-sdk
|
d0e92f6f33126dcdc7e40f60582304faf2c229b7
|
[
"Apache-2.0"
] | 1
|
2020-11-27T09:13:12.000Z
|
2020-11-27T09:13:12.000Z
|
/*
* Copyright 2009-2017 Alibaba Cloud 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 <alibabacloud/ecs/model/DescribeDiskMonitorDataRequest.h>
using AlibabaCloud::Ecs::Model::DescribeDiskMonitorDataRequest;
DescribeDiskMonitorDataRequest::DescribeDiskMonitorDataRequest() :
RpcServiceRequest("ecs", "2014-05-26", "DescribeDiskMonitorData")
{
setMethod(HttpRequest::Method::Post);
}
DescribeDiskMonitorDataRequest::~DescribeDiskMonitorDataRequest()
{}
long DescribeDiskMonitorDataRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void DescribeDiskMonitorDataRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string DescribeDiskMonitorDataRequest::getStartTime()const
{
return startTime_;
}
void DescribeDiskMonitorDataRequest::setStartTime(const std::string& startTime)
{
startTime_ = startTime;
setParameter("StartTime", startTime);
}
std::string DescribeDiskMonitorDataRequest::getDiskId()const
{
return diskId_;
}
void DescribeDiskMonitorDataRequest::setDiskId(const std::string& diskId)
{
diskId_ = diskId;
setParameter("DiskId", diskId);
}
int DescribeDiskMonitorDataRequest::getPeriod()const
{
return period_;
}
void DescribeDiskMonitorDataRequest::setPeriod(int period)
{
period_ = period;
setParameter("Period", std::to_string(period));
}
std::string DescribeDiskMonitorDataRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void DescribeDiskMonitorDataRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string DescribeDiskMonitorDataRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void DescribeDiskMonitorDataRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
std::string DescribeDiskMonitorDataRequest::getEndTime()const
{
return endTime_;
}
void DescribeDiskMonitorDataRequest::setEndTime(const std::string& endTime)
{
endTime_ = endTime;
setParameter("EndTime", endTime);
}
long DescribeDiskMonitorDataRequest::getOwnerId()const
{
return ownerId_;
}
void DescribeDiskMonitorDataRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
| 25.983051
| 102
| 0.771363
|
c47bb1b899688d92bd0727ca8cfe6e5159f48e7a
| 5,428
|
cpp
|
C++
|
emulator/src/lib/util/strformat.cpp
|
rjw57/tiw-computer
|
5ef1c79893165b8622d1114d81cd0cded58910f0
|
[
"MIT"
] | 1
|
2022-01-15T21:38:38.000Z
|
2022-01-15T21:38:38.000Z
|
emulator/src/lib/util/strformat.cpp
|
rjw57/tiw-computer
|
5ef1c79893165b8622d1114d81cd0cded58910f0
|
[
"MIT"
] | null | null | null |
emulator/src/lib/util/strformat.cpp
|
rjw57/tiw-computer
|
5ef1c79893165b8622d1114d81cd0cded58910f0
|
[
"MIT"
] | null | null | null |
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
/***************************************************************************
strformat.h
type-safe printf substitutes
***************************************************************************/
#include "strformat.h"
#include "vecstream.h"
#include <iostream>
#include <sstream>
namespace util {
namespace detail {
template class format_chars<char>;
template class format_chars<wchar_t>;
template void format_flags::apply(std::ostream &) const;
template void format_flags::apply(std::wostream &) const;
template void format_flags::apply(std::iostream &) const;
template void format_flags::apply(std::wiostream &) const;
template void format_flags::apply(std::ostringstream &) const;
template void format_flags::apply(std::wostringstream &) const;
template void format_flags::apply(std::stringstream &) const;
template void format_flags::apply(std::wstringstream &) const;
template void format_flags::apply(ovectorstream &) const;
template void format_flags::apply(wovectorstream &) const;
template void format_flags::apply(vectorstream &) const;
template void format_flags::apply(wvectorstream &) const;
template class format_argument<std::ostream>;
template class format_argument<std::wostream>;
template class format_argument<std::iostream>;
template class format_argument<std::wiostream>;
template class format_argument<std::ostringstream>;
template class format_argument<std::wostringstream>;
template class format_argument<std::stringstream>;
template class format_argument<std::wstringstream>;
template class format_argument<ovectorstream>;
template class format_argument<wovectorstream>;
template class format_argument<vectorstream>;
template class format_argument<wvectorstream>;
template class format_argument_pack<std::ostream>;
template class format_argument_pack<std::wostream>;
template class format_argument_pack<std::iostream>;
template class format_argument_pack<std::wiostream>;
template class format_argument_pack<std::ostringstream>;
template class format_argument_pack<std::wostringstream>;
template class format_argument_pack<std::stringstream>;
template class format_argument_pack<std::wstringstream>;
template class format_argument_pack<ovectorstream>;
template class format_argument_pack<wovectorstream>;
template class format_argument_pack<vectorstream>;
template class format_argument_pack<wvectorstream>;
template std::ostream::off_type stream_format(std::ostream &, format_argument_pack<std::ostream> const &);
template std::wostream::off_type stream_format(std::wostream &, format_argument_pack<std::wostream> const &);
template std::iostream::off_type stream_format(std::iostream &, format_argument_pack<std::ostream> const &);
template std::iostream::off_type stream_format(std::iostream &, format_argument_pack<std::iostream> const &);
template std::wiostream::off_type stream_format(std::wiostream &, format_argument_pack<std::wostream> const &);
template std::wiostream::off_type stream_format(std::wiostream &, format_argument_pack<std::wiostream> const &);
template std::ostringstream::off_type stream_format(std::ostringstream &, format_argument_pack<std::ostream> const &);
template std::ostringstream::off_type stream_format(std::ostringstream &, format_argument_pack<std::ostringstream> const &);
template std::wostringstream::off_type stream_format(std::wostringstream &, format_argument_pack<std::wostream> const &);
template std::wostringstream::off_type stream_format(std::wostringstream &, format_argument_pack<std::wostringstream> const &);
template std::stringstream::off_type stream_format(std::stringstream &, format_argument_pack<std::ostream> const &);
template std::stringstream::off_type stream_format(std::stringstream &, format_argument_pack<std::iostream> const &);
template std::stringstream::off_type stream_format(std::stringstream &, format_argument_pack<std::stringstream> const &);
template std::wstringstream::off_type stream_format(std::wstringstream &, format_argument_pack<std::wostream> const &);
template std::wstringstream::off_type stream_format(std::wstringstream &, format_argument_pack<std::wiostream> const &);
template std::wstringstream::off_type stream_format(std::wstringstream &, format_argument_pack<std::wstringstream> const &);
template ovectorstream::off_type stream_format(ovectorstream &, format_argument_pack<std::ostream> const &);
template ovectorstream::off_type stream_format(ovectorstream &, format_argument_pack<ovectorstream> const &);
template wovectorstream::off_type stream_format(wovectorstream &, format_argument_pack<std::wostream> const &);
template wovectorstream::off_type stream_format(wovectorstream &, format_argument_pack<wovectorstream> const &);
template vectorstream::off_type stream_format(vectorstream &, format_argument_pack<std::ostream> const &);
template vectorstream::off_type stream_format(vectorstream &, format_argument_pack<std::iostream> const &);
template vectorstream::off_type stream_format(vectorstream &, format_argument_pack<vectorstream> const &);
template wvectorstream::off_type stream_format(wvectorstream &, format_argument_pack<std::wostream> const &);
template wvectorstream::off_type stream_format(wvectorstream &, format_argument_pack<std::wiostream> const &);
template wvectorstream::off_type stream_format(wvectorstream &, format_argument_pack<wvectorstream> const &);
} // namespace detail
} // namespace util
| 57.744681
| 127
| 0.792373
|
259c980b782a5d9bfcaadc50bb3b24b8fb9ef344
| 603
|
cs
|
C#
|
source/VitNX3_net5/UI/ControlsV2/VitNX2_MessageBoxType2/VitNX2_MessageBoxType2_Form.cs
|
Zalexanninev15/VitNX
|
43f2dd04b8ba97c4a78ae51a99e7980a6b9b85a9
|
[
"MIT"
] | 2
|
2022-01-25T12:09:46.000Z
|
2022-01-27T11:26:48.000Z
|
source/VitNX3_netframework45/UI/ControlsV2/VitNX2_MessageBoxType2/VitNX2_MessageBoxType2_Form.cs
|
Zalexanninev15/VitNX
|
43f2dd04b8ba97c4a78ae51a99e7980a6b9b85a9
|
[
"MIT"
] | null | null | null |
source/VitNX3_netframework45/UI/ControlsV2/VitNX2_MessageBoxType2/VitNX2_MessageBoxType2_Form.cs
|
Zalexanninev15/VitNX
|
43f2dd04b8ba97c4a78ae51a99e7980a6b9b85a9
|
[
"MIT"
] | null | null | null |
using System;
using System.Windows.Forms;
using VitNX3.Functions.WindowAndControls;
namespace VitNX2.UI.ControlsV2
{
public partial class VitNX2_MessageBoxType2 : Form
{
public static string MessageText { get; set; }
public VitNX2_MessageBoxType2()
{
InitializeComponent();
Window.SetWindowsTenAndHighStyleForWinFormTitleToDark(Handle);
Size = new System.Drawing.Size(309, 247);
messageRichTextBox.Text = MessageText;
}
private void Button1Click(object sender, EventArgs e)
{ Close(); }
}
}
| 26.217391
| 74
| 0.655058
|
3f97c6c97ce2147b53b6b9012fc1e548c8b0136e
| 1,698
|
rb
|
Ruby
|
spec/bitly/http/client_spec.rb
|
CodingFu/bitly
|
d8b1ac1f7237a325c39ddfc746dd4c1da936982c
|
[
"MIT"
] | 167
|
2015-01-01T12:04:00.000Z
|
2022-03-19T10:06:28.000Z
|
spec/bitly/http/client_spec.rb
|
CodingFu/bitly
|
d8b1ac1f7237a325c39ddfc746dd4c1da936982c
|
[
"MIT"
] | 23
|
2015-01-01T21:41:32.000Z
|
2020-08-26T15:31:46.000Z
|
spec/bitly/http/client_spec.rb
|
CodingFu/bitly
|
d8b1ac1f7237a325c39ddfc746dd4c1da936982c
|
[
"MIT"
] | 51
|
2015-01-23T20:01:32.000Z
|
2021-02-19T01:09:40.000Z
|
# frozen_string_literal: true
RSpec.describe Bitly::HTTP::Client do
it "can be initialized with no arguments" do
expect { Bitly::HTTP::Client.new }.not_to raise_error
end
it "can be initialized with an adapter (that has a request method)" do
expect do
Bitly::HTTP::Client.new(Bitly::HTTP::Adapters::NetHTTP.new)
end.not_to raise_error
end
it "needs an adapter to have a request method" do
expect do
Bitly::HTTP::Client.new(Object.new)
end.to raise_error(ArgumentError)
end
describe "#request" do
it "returns a Bitly::HTTP::Response if the request is made successfully" do
request = Bitly::HTTP::Request.new(uri: URI.parse("https://bitly.com"))
adapter = double(:adapter)
response_values = ["200", { response: "OK" }.to_json, {}, true]
expect(adapter).to receive(:request).once.with(request).and_return(response_values)
client = Bitly::HTTP::Client.new(adapter)
response = client.request(request)
expect(response.status).to eq(response_values[0])
expect(response.body).to eq(JSON.parse(response_values[1]))
expect(response.headers).to eq(response_values[2])
expect(response.request).to eq(request)
end
it "raises a Bitly::Error if the request is not successful" do
request = Bitly::HTTP::Request.new(uri: URI.parse("https://bitly.com"))
adapter = double(:adapter)
response_values = ["500", { response: "Not OK" }.to_json, {}, false]
expect(adapter).to receive(:request).once.with(request).and_return(response_values)
client = Bitly::HTTP::Client.new(adapter)
expect { client.request(request) }.to raise_error(Bitly::Error)
end
end
end
| 39.488372
| 89
| 0.685512
|
ddf7f3da73180fc37ba77d6ea0ca2b195998ab0b
| 712
|
c
|
C
|
aoapcbac2nd/exercise3-2_molarmass.c
|
aoibird/pc
|
b72c0b10117f95d45e2e7423614343b5936b260a
|
[
"MIT"
] | null | null | null |
aoapcbac2nd/exercise3-2_molarmass.c
|
aoibird/pc
|
b72c0b10117f95d45e2e7423614343b5936b260a
|
[
"MIT"
] | null | null | null |
aoapcbac2nd/exercise3-2_molarmass.c
|
aoibird/pc
|
b72c0b10117f95d45e2e7423614343b5936b260a
|
[
"MIT"
] | null | null | null |
#include <stdio.h>
#include <ctype.h>
void solve()
{
int c;
double sum = 0;
while ((c = getchar()) != '\n' && c != EOF) {
//printf("%c\n", c);
int t;
int cx = getchar();
ungetc(cx, stdin);
if (!isdigit(cx)) {
t = 1;
}
else {
scanf("%d", &t);
//printf("%d", t);
}
if (c == 'C') {
sum += (t * 12.01);
}
else if (c == 'H') {
sum += (t * 1.008);
}
else if (c == 'O') {
sum += (t * 16.00);
}
else if (c == 'N') {
sum += (t * 14.01);
}
else {
;
}
}
printf("%.3f\n", sum);
}
int main()
{
int rnd;
scanf("%d", &rnd); getchar();
for (int i = 0; i < rnd; i++) {
solve();
}
}
| 14.24
| 47
| 0.365169
|
5fdb05e639003b30452d5676f12be4c7860066e8
| 1,524
|
rb
|
Ruby
|
spec/features/user_creates_new_clinician_spec.rb
|
Kamilleski/NMF_Tool
|
ee535263d0473a45a583680948126a849df637dd
|
[
"MIT"
] | 2
|
2019-02-04T18:17:17.000Z
|
2019-02-13T16:34:51.000Z
|
spec/features/user_creates_new_clinician_spec.rb
|
kamillamagna/marfan-registry
|
ee535263d0473a45a583680948126a849df637dd
|
[
"MIT"
] | 6
|
2016-10-19T17:42:36.000Z
|
2016-11-21T20:53:00.000Z
|
spec/features/user_creates_new_clinician_spec.rb
|
Kamilleski/NMF_Tool
|
ee535263d0473a45a583680948126a849df637dd
|
[
"MIT"
] | null | null | null |
require 'rails_helper'
feature 'user can add new clinician' do
background do
visit new_clinician_path
end
scenario "user adds new clinician with valid information" do
expect(page).to have_content("New Clinician Information")
fill_in "clinician_first_name", with: "David"
fill_in "clinician_last_name", with: "Liang"
fill_in "clinician_practice_name", with: "The Stanford University Center for Marfan Syndrome and Aortic Disorders"
fill_in "clinician_address_line_1", with: "Stanford University Medical Center Cardiology Clinic, 2nd Floor of Main Hospital"
fill_in "clinician_address_line_2", with: "300 Pasteur Drive"
fill_in "clinician_address_line_3", with: "Room H2157"
fill_in "clinician_city", with: "Stanford"
fill_in "clinician_state", with: "CA"
fill_in "clinician_postal_code", with: "94305"
fill_in "clinician_country", with: "United States"
click_button "Add New Clinician"
expect(page).to have_content("Clinician Liang, David successfully added!")
expect(page).to have_content("All Clinicians")
end
scenario "user adds new clinician with invalid information" do
expect(page).to have_content("New Clinician Information")
fill_in "clinician_first_name", with: "Abraham"
fill_in "clinician_last_name", with: "Lincoln"
click_button "Add New Clinician"
expect(page).to have_content("Please re-check information and/or fill required fields.")
expect(page).to have_content("New Clinician Information")
end
end
| 34.636364
| 128
| 0.748031
|
7aa7479d7c658cd53830b0eddb46d516f2bccefb
| 1,378
|
cs
|
C#
|
src/OWSPublicAPI/Requests/Users/LoginAndCreateSessionRequest.cs
|
Sinidious/OWS
|
1295d2ffe30d4852a990cf75cd8c4ea7c63d7616
|
[
"MIT"
] | 102
|
2021-02-14T15:34:28.000Z
|
2022-03-29T23:52:44.000Z
|
src/OWSPublicAPI/Requests/Users/LoginAndCreateSessionRequest.cs
|
Sinidious/OWS
|
1295d2ffe30d4852a990cf75cd8c4ea7c63d7616
|
[
"MIT"
] | 5
|
2021-08-09T22:16:50.000Z
|
2022-03-11T01:20:57.000Z
|
src/OWSPublicAPI/Requests/Users/LoginAndCreateSessionRequest.cs
|
Sinidious/OWS
|
1295d2ffe30d4852a990cf75cd8c4ea7c63d7616
|
[
"MIT"
] | 36
|
2021-03-10T08:42:59.000Z
|
2022-03-29T12:58:02.000Z
|
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using OWSData.Models.StoredProcs;
using OWSData.Repositories.Interfaces;
using OWSShared.Interfaces;
namespace OWSPublicAPI.Requests.Users
{
public class LoginAndCreateSessionRequest : IRequestHandler<LoginAndCreateSessionRequest, IActionResult>, IRequest
{
public string Email { get; set; }
public string Password { get; set; }
private PlayerLoginAndCreateSession output;
private Guid customerGUID;
private IUsersRepository usersRepository;
public void SetData(IUsersRepository usersRepository, IHeaderCustomerGUID customerGuid)
{
//CustomerGUID = new Guid("56FB0902-6FE7-4BFE-B680-E3C8E497F016");
this.customerGUID = customerGuid.CustomerGUID;
this.usersRepository = usersRepository;
}
public async Task<IActionResult> Handle()
{
output = await usersRepository.LoginAndCreateSession(customerGUID, Email, Password, false);
if (!output.Authenticated || !output.UserSessionGuid.HasValue || output.UserSessionGuid == Guid.Empty)
{
output.ErrorMessage = "Username or Password is invalid!";
}
return new OkObjectResult(output);
}
}
}
| 33.609756
| 118
| 0.689405
|
dd68f2c4bb420412b2af3033335556946ab81c73
| 1,311
|
java
|
Java
|
src/com/easimer/Monster.java
|
Easimer/LD32
|
e537ed466145488323511a7a0b4bdd8bd1d66cd1
|
[
"CC0-1.0"
] | null | null | null |
src/com/easimer/Monster.java
|
Easimer/LD32
|
e537ed466145488323511a7a0b4bdd8bd1d66cd1
|
[
"CC0-1.0"
] | null | null | null |
src/com/easimer/Monster.java
|
Easimer/LD32
|
e537ed466145488323511a7a0b4bdd8bd1d66cd1
|
[
"CC0-1.0"
] | null | null | null |
package com.easimer;
import org.jsfml.graphics.RenderTarget;
/**
*
* @author easimer
*/
public class Monster implements Entity {
public AI ai;
private int hp = 100;
private int maxhp = 100;
int x, y;
boolean dead = false;
public Monster(){}
public Monster(int x, int y)
{
this.x = x;
this.y = y;
}
@Override
public void Init() {
}
@Override
public void Update(long dt) {
}
@Override
public void Draw(RenderTarget rt) {
}
@Override
public void Event(org.jsfml.window.event.Event e) {
}
public void Attack()
{
}
@Override
public int GetX() {
return x;
}
@Override
public int GetY() {
return y;
}
public int GetHealth()
{
return hp;
}
private void SetHealth(int newhp)
{
hp = newhp;
}
public int GetMaxHealth()
{
return maxhp;
}
public void SetMaxHealth(int newmhp)
{
maxhp = newmhp;
}
public void GetDamage(int dmg)
{
hp -= dmg;
}
@Override
public int GetW() {
return 0;
}
@Override
public int GetH() {
return 0;
}
}
| 13.65625
| 55
| 0.485889
|
6d8c7e889ee97e1c3a72c856e67dfc6f9f87b227
| 10,920
|
c
|
C
|
src/protocols/rdp/error.c
|
dev-ddoe/guacamole-server
|
8ecdedb05aed4aa9c282ce11d0d1fc8b247265cb
|
[
"Apache-2.0"
] | 1,450
|
2017-11-29T07:18:10.000Z
|
2022-03-30T04:20:50.000Z
|
src/protocols/rdp/error.c
|
dev-ddoe/guacamole-server
|
8ecdedb05aed4aa9c282ce11d0d1fc8b247265cb
|
[
"Apache-2.0"
] | 122
|
2017-12-19T09:17:49.000Z
|
2022-03-22T19:58:49.000Z
|
src/protocols/rdp/error.c
|
dev-ddoe/guacamole-server
|
8ecdedb05aed4aa9c282ce11d0d1fc8b247265cb
|
[
"Apache-2.0"
] | 431
|
2017-12-05T16:35:42.000Z
|
2022-03-31T22:49:20.000Z
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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
*
* 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 "error.h"
#include <freerdp/freerdp.h>
#include <guacamole/client.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <winpr/wtypes.h>
/**
* Translates the error code returned by freerdp_get_last_error() for the given
* RDP instance into a Guacamole status code and human-readable message. If no
* error was reported, a successful error code and message will be assigned.
*
* @param rdp_inst
* The FreeRDP client instance handling the RDP connection that failed.
*
* @param status
* Pointer to the variable that should receive the guac_protocol_status
* value equivalent to the error returned by freerdp_get_last_error().
*
* @param message
* Pointer to the variable that should receive a static human-readable
* message generally describing the error returned by
* freerdp_get_last_error().
*/
static void guac_rdp_translate_last_error(freerdp* rdp_inst,
guac_protocol_status* status, const char** message) {
UINT32 last_error = freerdp_get_last_error(rdp_inst->context);
switch (last_error) {
/*
* Normal disconnect (no error at all)
*/
case FREERDP_ERROR_NONE:
case FREERDP_ERROR_SUCCESS:
*status = GUAC_PROTOCOL_STATUS_SUCCESS;
*message = "Disconnected.";
break;
/*
* General credentials expired (password has expired, password must be
* reset before it can be used for the first time, etc.)
*/
#ifdef FREERDP_ERROR_CONNECT_ACCOUNT_EXPIRED
case FREERDP_ERROR_CONNECT_ACCOUNT_EXPIRED:
#endif
#ifdef FREERDP_ERROR_CONNECT_PASSWORD_MUST_CHANGE
case FREERDP_ERROR_CONNECT_PASSWORD_MUST_CHANGE:
#endif
case FREERDP_ERROR_CONNECT_PASSWORD_CERTAINLY_EXPIRED:
case FREERDP_ERROR_CONNECT_PASSWORD_EXPIRED:
case FREERDP_ERROR_SERVER_FRESH_CREDENTIALS_REQUIRED:
*status = GUAC_PROTOCOL_STATUS_CLIENT_FORBIDDEN;
*message = "Credentials expired.";
break;
/*
* Security negotiation failed (the server is refusing the connection
* because the security negotiation process failed)
*/
case FREERDP_ERROR_SECURITY_NEGO_CONNECT_FAILED:
*status = GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED;
*message = "Security negotiation failed (wrong security type?)";
break;
/*
* General access denied/revoked (regardless of any credentials
* provided, the server is denying the requested access by this
* account)
*/
#ifdef FREERDP_ERROR_CONNECT_ACCESS_DENIED
case FREERDP_ERROR_CONNECT_ACCESS_DENIED:
#endif
#ifdef FREERDP_ERROR_CONNECT_ACCOUNT_DISABLED
case FREERDP_ERROR_CONNECT_ACCOUNT_DISABLED:
#endif
#ifdef FREERDP_ERROR_CONNECT_ACCOUNT_LOCKED_OUT
case FREERDP_ERROR_CONNECT_ACCOUNT_LOCKED_OUT:
#endif
#ifdef FREERDP_ERROR_CONNECT_ACCOUNT_RESTRICTION
case FREERDP_ERROR_CONNECT_ACCOUNT_RESTRICTION:
#endif
#ifdef FREERDP_ERROR_CONNECT_LOGON_TYPE_NOT_GRANTED
case FREERDP_ERROR_CONNECT_LOGON_TYPE_NOT_GRANTED:
#endif
case FREERDP_ERROR_CONNECT_CLIENT_REVOKED:
case FREERDP_ERROR_INSUFFICIENT_PRIVILEGES:
case FREERDP_ERROR_SERVER_DENIED_CONNECTION:
case FREERDP_ERROR_SERVER_INSUFFICIENT_PRIVILEGES:
*status = GUAC_PROTOCOL_STATUS_CLIENT_FORBIDDEN;
*message = "Access denied by server (account locked/disabled?)";
break;
/*
* General authentication failure (no credentials provided or wrong
* credentials provided)
*/
#ifdef FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS
case FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS:
#endif
#ifdef FREERDP_ERROR_CONNECT_LOGON_FAILURE
case FREERDP_ERROR_CONNECT_LOGON_FAILURE:
#endif
#ifdef FREERDP_ERROR_CONNECT_WRONG_PASSWORD
case FREERDP_ERROR_CONNECT_WRONG_PASSWORD:
#endif
case FREERDP_ERROR_AUTHENTICATION_FAILED:
*status = GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED;
*message = "Authentication failure (invalid credentials?)";
break;
/*
* SSL/TLS connection failed (the server's certificate is not trusted)
*/
case FREERDP_ERROR_TLS_CONNECT_FAILED:
*status = GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND;
*message = "SSL/TLS connection failed (untrusted/self-signed certificate?)";
break;
/*
* DNS lookup failed (hostname resolution failed or invalid IP address)
*/
case FREERDP_ERROR_DNS_ERROR:
case FREERDP_ERROR_DNS_NAME_NOT_FOUND:
*status = GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND;
*message = "DNS lookup failed (incorrect hostname?)";
break;
/*
* Connection refused (the server is outright refusing to handle the
* inbound connection, typically due to the client requesting a
* security type that is not allowed)
*/
case FREERDP_ERROR_CONNECT_TRANSPORT_FAILED:
*status = GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND;
*message = "Server refused connection (wrong security type?)";
break;
/*
* Connection failed (the network connection to the server did not
* succeed)
*/
case FREERDP_ERROR_CONNECT_CANCELLED:
case FREERDP_ERROR_CONNECT_FAILED:
case FREERDP_ERROR_CONNECT_KDC_UNREACHABLE:
case FREERDP_ERROR_MCS_CONNECT_INITIAL_ERROR:
*status = GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND;
*message = "Connection failed (server unreachable?)";
break;
/*
* All other (unknown) errors
*/
default:
*status = GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR;
*message = "Upstream error.";
}
}
void guac_rdp_client_abort(guac_client* client, freerdp* rdp_inst) {
/*
* NOTE: The RDP status codes translated here are documented within
* [MS-RDPBCGR], section 2.2.5.1.1: "Set Error Info PDU Data", in the
* description of the "errorInfo" field.
*
* https://msdn.microsoft.com/en-us/library/cc240544.aspx
*/
guac_protocol_status status;
const char* message;
/* Read disconnect reason code from connection */
int error_info = freerdp_error_info(rdp_inst);
/* Translate reason code into Guacamole protocol status */
switch (error_info) {
/* Possibly-normal disconnect, depending on freerdp_get_last_error() */
case 0x0: /* ERRINFO_SUCCESS */
guac_rdp_translate_last_error(rdp_inst, &status, &message);
break;
/* Forced disconnect (possibly by admin) */
case 0x1: /* ERRINFO_RPC_INITIATED_DISCONNECT */
status = GUAC_PROTOCOL_STATUS_SESSION_CLOSED;
message = "Forcibly disconnected.";
break;
/* The user was logged off (possibly by admin) */
case 0x2: /* ERRINFO_RPC_INITIATED_LOGOFF */
status = GUAC_PROTOCOL_STATUS_SESSION_CLOSED;
message = "Logged off.";
break;
/* The user was idle long enough that the RDP server disconnected */
case 0x3: /* ERRINFO_IDLE_TIMEOUT */
status = GUAC_PROTOCOL_STATUS_SESSION_TIMEOUT;
message = "Idle session time limit exceeded.";
break;
/* The user's session has been active for too long */
case 0x4: /* ERRINFO_LOGON_TIMEOUT */
status = GUAC_PROTOCOL_STATUS_SESSION_CLOSED;
message = "Active session time limit exceeded.";
break;
/* Another user logged on, disconnecting this user */
case 0x5: /* ERRINFO_DISCONNECTED_BY_OTHER_CONNECTION */
status = GUAC_PROTOCOL_STATUS_SESSION_CONFLICT;
message = "Disconnected by other connection.";
break;
/* The RDP server is refusing to service the connection */
case 0x6: /* ERRINFO_OUT_OF_MEMORY */
case 0x7: /* ERRINFO_SERVER_DENIED_CONNECTION */
status = GUAC_PROTOCOL_STATUS_UPSTREAM_UNAVAILABLE;
message = "Server refused connection.";
break;
/* The user does not have permission to connect */
case 0x9: /* ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES */
status = GUAC_PROTOCOL_STATUS_CLIENT_FORBIDDEN;
message = "Insufficient privileges.";
break;
/* The user's credentials have expired */
case 0xA: /* ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED */
status = GUAC_PROTOCOL_STATUS_CLIENT_FORBIDDEN;
message = "Credentials expired.";
break;
/* The user manually disconnected using an administrative tool within
* the session */
case 0xB: /* ERRINFO_RPC_INITIATED_DISCONNECT_BYUSER */
status = GUAC_PROTOCOL_STATUS_SUCCESS;
message = "Manually disconnected.";
break;
/* The user manually logged off */
case 0xC: /* ERRINFO_LOGOFF_BY_USER */
status = GUAC_PROTOCOL_STATUS_SUCCESS;
message = "Manually logged off.";
break;
/* Unimplemented/unknown disconnect reason code */
default:
status = GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR;
message = "Upstream error.";
}
/* Send error code if an error occurred */
if (status != GUAC_PROTOCOL_STATUS_SUCCESS) {
guac_protocol_send_error(client->socket, message, status);
guac_socket_flush(client->socket);
}
/* Log human-readable description of disconnect at info level */
guac_client_log(client, GUAC_LOG_INFO, "RDP server closed/refused "
"connection: %s", message);
/* Log internal disconnect reason code at debug level */
if (error_info)
guac_client_log(client, GUAC_LOG_DEBUG, "Disconnect reason "
"code: 0x%X.", error_info);
/* Abort connection */
guac_client_stop(client);
}
| 34.77707
| 88
| 0.671703
|
24a845ef85f0e76c82077dbbafae4c64c2fc2964
| 3,837
|
php
|
PHP
|
app/Article.php
|
lpx20000/laravel-blog
|
e4be24130b9453763335b468b51d581fa20d7479
|
[
"MIT"
] | 1
|
2017-03-09T09:51:22.000Z
|
2017-03-09T09:51:22.000Z
|
app/Article.php
|
lpx20000/laravel-blog
|
e4be24130b9453763335b468b51d581fa20d7479
|
[
"MIT"
] | null | null | null |
app/Article.php
|
lpx20000/laravel-blog
|
e4be24130b9453763335b468b51d581fa20d7479
|
[
"MIT"
] | null | null | null |
<?php
namespace App;
use App\Traits\RelationTrait\ArticleTrait;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Overtrue\Pinyin\Pinyin;
/**
* App\Article
*
* @property int $id
* @property string $title 文章标题
* @property string $slug
* @property int $user_id
* @property int $tag_id 标签id
* @property int $category_id 分类id
* @property string $image_url 图片地址
* @property bool $view 浏览次数
* @property bool $order 文章排序
* @property bool $is_original
* @property string $is_top 是否置顶
* @property string $is_show 是否发布
* @property string $content
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @method static \Illuminate\Database\Query\Builder|\App\Article whereId($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereTitle($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereSlug($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereTagId($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereCategoryId($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereImageUrl($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereView($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereOrder($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereIsOriginal($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereIsTop($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereIsShow($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereContent($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\App\Article whereUpdatedAt($value)
* @mixin \Eloquent
* @property \Carbon\Carbon $deleted_at
* @method static \Illuminate\Database\Query\Builder|\App\Article whereDeletedAt($value)
*/
class Article extends Model
{
use SoftDeletes, ArticleTrait;
/**
* @var array
*/
protected $dates = ['deleted_at'];
protected $fillable = ['title', 'slug', 'user_id', 'tag_id', 'category_id', 'image_url', 'view',
'order', 'is_original', 'is_top', 'is_show', 'content'];
/**
* @param $value
*/
public function setSlugAttribute($value)
{
$pinYin = new Pinyin();
$info = $pinYin->convert($value);
$this->attributes['slug'] = $info;
}
/**
* @param $query
* @return @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeShow($query)
{
return $query->whereIsShow(1)
->whereNull('deleted_at')
->orderBy('is_top', 'desc')
->orderBy('order', 'desc')
->orderBy('created_at', 'desc');
}
/**
* @param $query
* @param $order
* @param string $desc
* @param int $limit
* @return @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeGetLimit($query, $order, $desc = 'desc', $limit = 4)
{
return $query->whereIsShow(1)->select('id', 'title', 'slug', 'image_url')->orderBy($order, $desc)->limit($limit);
}
/**
* @return bool
*/
public function isShow()
{
return !!$this->is_show;
}
/**
* @return bool
*/
public function isNotDeleted()
{
return !!$this->deleted_at;
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function comments()
{
return $this->hasMany(Comment::class, 'article_id', 'id');
}
}
| 32.794872
| 121
| 0.670055
|
e0e9d45ffc23b35b73f822ef8b72436231451015
| 1,916
|
kt
|
Kotlin
|
app/src/main/java/co/omisego/omgshop/base/BaseDialogFragment.kt
|
vaibhav-payr/sample-android
|
3508cf1bc3a9e07c79a8c98daa2e22a6d26a4db1
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/co/omisego/omgshop/base/BaseDialogFragment.kt
|
vaibhav-payr/sample-android
|
3508cf1bc3a9e07c79a8c98daa2e22a6d26a4db1
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/co/omisego/omgshop/base/BaseDialogFragment.kt
|
vaibhav-payr/sample-android
|
3508cf1bc3a9e07c79a8c98daa2e22a6d26a4db1
|
[
"Apache-2.0"
] | null | null | null |
package co.omisego.omgshop.base
/*
* OmiseGO
*
* Created by Phuchit Sirimongkolsathien on 11/28/2017 AD.
* Copyright © 2017-2018 OmiseGO. All rights reserved.
*/
import android.content.Context
import android.graphics.Color
import android.graphics.Point
import android.graphics.drawable.ColorDrawable
import android.support.v4.app.DialogFragment
import android.util.Log
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import android.widget.Toast
@Suppress("UNCHECKED_CAST")
abstract class BaseDialogFragment<in V : BaseContract.BaseView, C : BaseContract.BaseCaller, out P : BaseContract.BasePresenter<V, C>> : DialogFragment(), BaseContract.BaseView {
protected abstract val mPresenter: P
private lateinit var mLoadingView: View
override fun onAttach(context: Context?) {
super.onAttach(context)
mPresenter.attachView(this as V)
}
override fun onDetach() {
super.onDetach()
mPresenter.detachView()
}
fun log(message: String) {
Log.d(this.javaClass.name, message)
}
override fun onResume() {
super.onResume()
val size = Point()
val window = dialog.window
val display = window.windowManager.defaultDisplay
display.getSize(size)
window.setLayout((size.x * 0.9).toInt(), WindowManager.LayoutParams.WRAP_CONTENT)
window.setGravity(Gravity.CENTER)
window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
}
override fun showLoading() {
mLoadingView.visibility = View.VISIBLE
}
override fun clearTokenAndGotoLogin() {}
override fun hideLoading() {
mLoadingView.visibility = View.GONE
}
override fun setViewLoading(view: View) {
mLoadingView = view
}
override fun showMessage(msg: String) {
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show()
}
}
| 28.176471
| 178
| 0.703027
|
ef38044da6933ab222c3292cae10dc0ce828a84f
| 3,606
|
h
|
C
|
clients/RemoteDisplay/input_sender.h
|
marcusaz/ias
|
0735feec2adf467135d071886a4265df105eda93
|
[
"MIT"
] | 18
|
2018-07-31T05:58:31.000Z
|
2021-05-13T16:12:23.000Z
|
clients/RemoteDisplay/input_sender.h
|
marcusaz/ias
|
0735feec2adf467135d071886a4265df105eda93
|
[
"MIT"
] | 69
|
2018-08-06T21:33:39.000Z
|
2021-10-07T11:56:00.000Z
|
clients/RemoteDisplay/input_sender.h
|
marcusaz/ias
|
0735feec2adf467135d071886a4265df105eda93
|
[
"MIT"
] | 35
|
2018-09-20T04:48:10.000Z
|
2022-02-23T08:04:51.000Z
|
/*
* Copyright © 2018 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __REMOTE_DISPLAY_INPUT_SENDER_H__
#define __REMOTE_DISPLAY_INPUT_SENDER_H__
#include <stdint.h>
/* Based on vmdisplay-shared.h */
/* For now, assume that these are the same on sender and receiver. */
#define MAX_TOUCH_X 32767
#define MAX_TOUCH_Y 32767
enum remote_display_msg_type {
REMOTE_DISPLAY_INIT_MSG = 1,
REMOTE_DISPLAY_METADATA_UPDATE_MSG,
REMOTE_DISPLAY_NEW_OUTPUT_MSG,
REMOTE_DISPLAY_CLEANUP_MSG,
};
struct remote_display_msg {
enum remote_display_msg_type type;
uint32_t display_num;
};
enum remote_display_input_event_type {
REMOTE_DISPLAY_TOUCH_EVENT = 0x00,
REMOTE_DISPLAY_KEY_EVENT,
REMOTE_DISPLAY_POINTER_EVENT,
REMOTE_DISPLAY_INPUT_EVENT_MAX,
};
struct remote_display_input_event_header {
uint32_t type;
uint32_t size;
};
enum remote_display_touch_event_type {
REMOTE_DISPLAY_TOUCH_DOWN = 0x00,
REMOTE_DISPLAY_TOUCH_UP,
REMOTE_DISPLAY_TOUCH_MOTION,
REMOTE_DISPLAY_TOUCH_FRAME,
REMOTE_DISPLAY_TOUCH_CANCEL,
};
struct remote_display_touch_event {
uint32_t id;
uint32_t x;
uint32_t y;
uint32_t time;
};
enum remote_display_key_event_type {
REMOTE_DISPLAY_KEY_ENTER = 0x00,
REMOTE_DISPLAY_KEY_LEAVE,
REMOTE_DISPLAY_KEY_KEY,
REMOTE_DISPLAY_KEY_MODIFIERS,
};
struct remote_display_key_event {
uint32_t time;
uint32_t key;
uint32_t state;
uint32_t mods_depressed;
uint32_t mods_latched;
uint32_t mods_locked;
uint32_t group;
};
enum remote_display_pointer_event_type {
REMOTE_DISPLAY_POINTER_ENTER = 0x00,
REMOTE_DISPLAY_POINTER_LEAVE,
REMOTE_DISPLAY_POINTER_MOTION,
REMOTE_DISPLAY_POINTER_BUTTON,
REMOTE_DISPLAY_POINTER_AXIS,
};
struct remote_display_pointer_event {
uint32_t time;
uint32_t x;
uint32_t y;
union {
uint32_t button;
uint32_t axis;
};
union {
uint32_t state;
uint32_t value;
};
};
typedef enum {
POINTER_HANDLE_ENTER,
POINTER_HANDLE_LEAVE,
POINTER_HANDLE_MOTION,
POINTER_HANDLE_BUTTON,
POINTER_HANDLE_AXIS,
KEYBOARD_HANDLE_KEYMAP,
KEYBOARD_HANDLE_ENTER,
KEYBOARD_HANDLE_LEAVE,
KEYBOARD_HANDLE_KEY,
KEYBOARD_HANDLE_MODIFIERS,
TOUCH_HANDLE_DOWN,
TOUCH_HANDLE_UP,
TOUCH_HANDLE_MOTION,
TOUCH_HANDLE_FRAME,
TOUCH_HANDLE_CANCEL,
ALL_TOUCH_EVENTS,
} GstInputEventType;
typedef struct _gstInputMsg {
GstInputEventType type;
union {
struct remote_display_touch_event t;
struct remote_display_key_event k;
struct remote_display_pointer_event p;
};
} gstInputMsg;
#endif /* __REMOTE_DISPLAY_INPUT_SENDER_H__ */
| 24.69863
| 72
| 0.797282
|
3557b6c410c914f5c05399d59d5e7389a3bf94f1
| 1,847
|
lua
|
Lua
|
Corona/main.lua
|
CoronaCards/sample-ios-OverlayChildView
|
c7d2e2f22c50a8bf133ac7dac2b9f2adca7230d9
|
[
"MIT"
] | null | null | null |
Corona/main.lua
|
CoronaCards/sample-ios-OverlayChildView
|
c7d2e2f22c50a8bf133ac7dac2b9f2adca7230d9
|
[
"MIT"
] | null | null | null |
Corona/main.lua
|
CoronaCards/sample-ios-OverlayChildView
|
c7d2e2f22c50a8bf133ac7dac2b9f2adca7230d9
|
[
"MIT"
] | null | null | null |
--
-- Abstract: SnapshotPaint sample app
--
-- Version: 2.0
--
-- Sample code is MIT licensed, see http://www.coronalabs.com/links/code/license
-- Copyright (C) 2013 Corona Labs Inc. All Rights Reserved.
--
-- Supports Graphics 2.0
------------------------------------------------------------
local w = display.actualContentWidth
local h = display.actualContentHeight
display.setDefault( "background", 0, 0, 0, 0 )
local snapshot = display.newSnapshot( w,h )
snapshot:translate( display.contentCenterX, display.contentCenterY )
-- Don't record changes to save memory.
--
-- However, saving memory comes at a cost. If the GL context changes,
-- the snapshot will *not* be able to re-draw the contents. For example,
-- on some Android devices, this can occur after a suspend/resume cycle.
snapshot.canvasMode = "discard"
local previousX, previousY
local threshold = 0
local thresholdSq = threshold*threshold
local function draw( x, y )
local o = display.newImage( "brush.png", x, y )
o:setFillColor( 1, 0, 1 ) -- magenta paint
snapshot.canvas:insert( o )
snapshot:invalidate( "canvas" ) -- accumulate changes w/o clearing
end
local function listener( event )
local x,y = event.x - snapshot.x, event.y - snapshot.y
if ( event.phase == "began" ) then
previousX,previousY = x,y
draw( x, y )
elseif ( event.phase == "moved" ) then
local dx = x - previousX
local dy = y - previousY
local deltaSq = dx*dx + dy*dy
if ( deltaSq > thresholdSq ) then
draw( x, y )
previousX,previousY = x,y
end
end
end
Runtime:addEventListener( "touch", listener )
local instruction = display.newText{
text="Touch screen to start painting",
x = display.contentCenterX,
y = 30,
fontSize=12,
}
instruction:setFillColor( 0 )
Runtime:addEventListener( "bar", function(event)
print( event.name, event.key, type( event.key) )
end )
| 27.161765
| 80
| 0.686519
|
9e64c71ab2a2aceb64ba99b235206a5101bc3065
| 316
|
sql
|
SQL
|
JDBCDataSourceTomcat/src/resources/OracleSetup.sql
|
ashish246/j2ee-labs
|
f87367ef000d207d26314c57e5260885e555aeaa
|
[
"MIT"
] | null | null | null |
JDBCDataSourceTomcat/src/resources/OracleSetup.sql
|
ashish246/j2ee-labs
|
f87367ef000d207d26314c57e5260885e555aeaa
|
[
"MIT"
] | null | null | null |
JDBCDataSourceTomcat/src/resources/OracleSetup.sql
|
ashish246/j2ee-labs
|
f87367ef000d207d26314c57e5260885e555aeaa
|
[
"MIT"
] | null | null | null |
CREATE TABLE "EMPLOYEE"
(
"EMPID" NUMBER NOT NULL ENABLE,
"NAME" VARCHAR2(10 BYTE) DEFAULT NULL,
PRIMARY KEY ("EMPID")
);
Insert into EMPLOYEE (EMPID,NAME) values (10,'Ashish');
Insert into EMPLOYEE (EMPID,NAME) values (5,'Tripathi');
Insert into EMPLOYEE (EMPID,NAME) values (1,'AT');
commit;
| 28.727273
| 56
| 0.670886
|
c9a06cb79b940a320024e38f575f26efd33b7922
| 294
|
ts
|
TypeScript
|
src/pages/api/sections/index.ts
|
sawbeanraz/eskoolportal
|
fae30b7cca12ae40729413de5dc02ccc0627b2e3
|
[
"MIT"
] | null | null | null |
src/pages/api/sections/index.ts
|
sawbeanraz/eskoolportal
|
fae30b7cca12ae40729413de5dc02ccc0627b2e3
|
[
"MIT"
] | null | null | null |
src/pages/api/sections/index.ts
|
sawbeanraz/eskoolportal
|
fae30b7cca12ae40729413de5dc02ccc0627b2e3
|
[
"MIT"
] | null | null | null |
import { NextApiResponse } from "next";
import prisma from "~/lib/prisma";
import { secureRoute } from "~/lib/secureRoute";
export default secureRoute(async function handler(_, res: NextApiResponse) {
const sections = await prisma.section.findMany();
res.status(200).json(sections);
});
| 26.727273
| 76
| 0.731293
|
14258e092196086cb4519405215aaac6d1714baa
| 4,341
|
tsx
|
TypeScript
|
src/app/components/pages/confirmation-page/ConfirmationPage.tsx
|
navikt/omsorgspengerutbetaling-arbeidstaker-soknad
|
06cd986385f125322688f89ae8d88dbff1cfe7f0
|
[
"MIT"
] | null | null | null |
src/app/components/pages/confirmation-page/ConfirmationPage.tsx
|
navikt/omsorgspengerutbetaling-arbeidstaker-soknad
|
06cd986385f125322688f89ae8d88dbff1cfe7f0
|
[
"MIT"
] | 189
|
2020-07-28T14:47:10.000Z
|
2022-03-09T10:09:31.000Z
|
src/app/components/pages/confirmation-page/ConfirmationPage.tsx
|
navikt/omsorgspengerutbetaling-arbeidstaker-soknad
|
06cd986385f125322688f89ae8d88dbff1cfe7f0
|
[
"MIT"
] | null | null | null |
import * as React from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { SIFCommonPageKey, useLogSidevisning } from '@navikt/sif-common-amplitude/lib';
import AlertStripe from 'nav-frontend-alertstriper';
import { Knapp } from 'nav-frontend-knapper';
import Panel from 'nav-frontend-paneler/lib';
import { Innholdstittel, Undertittel } from 'nav-frontend-typografi';
import Box from 'common/components/box/Box';
import CheckmarkIcon from 'common/components/checkmark-icon/CheckmarkIcon';
import Page from 'common/components/page/Page';
import bemUtils from 'common/utils/bemUtils';
import intlHelper from 'common/utils/intlUtils';
import { Søkerdata } from '../../../types/Søkerdata';
import { SøknadApiData } from '../../../types/SøknadApiData';
import TilArbeidsgiverDokumentListe from './components/TilArbeidsgiverDokumentListe';
import './confirmationPage.less';
import FormattedHtmlMessage from '@navikt/sif-common-core/lib/components/formatted-html-message/FormattedHtmlMessage';
const bem = bemUtils('confirmationPage');
export interface OwnProps {
søkerdata: Søkerdata | undefined;
søknadApiData: SøknadApiData | undefined;
}
const ConfirmationPage: React.FC<OwnProps> = (props: OwnProps): JSX.Element => {
const { søkerdata, søknadApiData } = props;
const intl = useIntl();
useLogSidevisning(SIFCommonPageKey.kvittering);
return (
<Page title={intlHelper(intl, 'page.confirmation.sidetittel')} className={bem.block}>
<div className={bem.element('centeredContent')}>
<CheckmarkIcon />
<Box margin="xl">
<Innholdstittel>
<FormattedMessage id="page.confirmation.tittel" />
</Innholdstittel>
</Box>
</div>
<Box margin="xl">
<div className={'infopanelInfoForsvinner'}>
<Undertittel>
<FormattedMessage id="page.confirmation.undertittel" />
</Undertittel>
<Panel border={true} className={'luftOver'}>
<AlertStripe type="advarsel" form="inline">
<Box padBottom={'l'}>
<FormattedMessage id="page.conformation.alert.infoForsvinner" />
</Box>
<Box>
<FormattedMessage id="page.conformation.alert.infoPrint" />
</Box>
</AlertStripe>
</Panel>
</div>
<ul className="checklist">
<li>
<AlertStripe type="info" form="inline">
<FormattedHtmlMessage id="page.conformation.alert.info.1.html" />
</AlertStripe>
</li>
<li>
<AlertStripe type="info" form="inline">
<FormattedHtmlMessage id="page.conformation.alert.info.2.html" />
</AlertStripe>
</li>
<li>
<AlertStripe type="info" form="inline">
<FormattedMessage id="page.conformation.alert.info.3" />
</AlertStripe>
</li>
</ul>
</Box>
<Box margin="xl" padBottom={'xl'}>
<div className={'skrivUtKnapp'}>
<Knapp
type={'hoved'}
onClick={(): boolean => {
window.print();
return false;
}}>
<FormattedMessage id="page.conformation.skrivUtKnapp" />
</Knapp>
</div>
</Box>
<Box padBottom={'xl'}>
<div className={'kviteringsBlokk'}>
<FormattedMessage id="page.conformation.skrivUt.info" />
</div>
</Box>
{søkerdata && søknadApiData && (
<TilArbeidsgiverDokumentListe søkerdata={søkerdata} søknadApiData={søknadApiData} />
)}
</Page>
);
};
export default ConfirmationPage;
| 41.740385
| 118
| 0.522
|
1aaf585c17b3f7509128ab84cd47623dfb0e8f9a
| 3,080
|
py
|
Python
|
tests/long_running/db_disk_growth.py
|
AlexTalker/integrated-manager-for-lustre
|
251099e5c776f3c1898af50bb7cc77924c7cf7c7
|
[
"MIT"
] | 1
|
2021-02-08T16:59:14.000Z
|
2021-02-08T16:59:14.000Z
|
tests/long_running/db_disk_growth.py
|
AlexTalker/integrated-manager-for-lustre
|
251099e5c776f3c1898af50bb7cc77924c7cf7c7
|
[
"MIT"
] | null | null | null |
tests/long_running/db_disk_growth.py
|
AlexTalker/integrated-manager-for-lustre
|
251099e5c776f3c1898af50bb7cc77924c7cf7c7
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# Copyright (c) 2018 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
# chroma-sampling is a commandline command. Use it to periodically sample
# logs and disk usage for long periods of time.
# Install by copying to the server you want to sample, then doing
# chmod u+x db_disk_growth.py
# To run in Run Forground:
# $ ./db_disk_growth.py -d 60 # sample once per minute
# To Run Background, example
# $ nohup ./db_disk_growth.py -d 60 >/dev/null 2>&1 &
import subprocess
import time
from datetime import datetime
import argparse
LOG_CMD = "du -s /var/log/chroma"
LOG_CMD_STRIPPED = LOG_CMD
DB_CMD = "du -s /var/lib/pgsql"
DB_CMD_STRIPPED = DB_CMD
STATS_TABLES = (
"chroma_core_sample_10",
"chroma_core_sample_300",
"chroma_core_sample_3600",
"chroma_core_sample_60",
"chroma_core_sample_86400",
)
STAT_SQL = "select count(id) as rows, pg_relation_size('{0}') as data_length, pg_total_relation_size('{0}') - pg_relation_size('{0}') as index_length from {0};"
STAT_SIZES_SQL_TEMPLATE_CMD = 'psql -U chroma -q chroma -c "%s" ' % STAT_SQL
STATS_SQL_CMD_HEADER = "%s | head -n 3" % STAT_SIZES_SQL_TEMPLATE_CMD
STATS_SQL_CMD_STRIPPED = "%s | tail -n 3 | head -n 1 " % STAT_SIZES_SQL_TEMPLATE_CMD
HEADER_INTERVAL = 10
def _concat_date(cmd):
"""Concatonate date to end of command with some spaces"""
return 'echo "`%s` `date -u`"' % cmd
def main():
parser = argparse.ArgumentParser(description="Sample disk usage for logs " "and data")
parser.add_argument("--delta_seconds", "-d", type=int, default=300)
parser.add_argument("--header_rows", "-r", type=int, default=-1)
args = parser.parse_args()
time_stamp = datetime.utcnow().strftime("%Y%m%dT%H%M%S")
log_sample_filename = "sample_logs_%s" % time_stamp
db_sample_filename = "sample_db_%s" % time_stamp
stat_sample_filename_template = "sample_stats_{0}_%s" % time_stamp
print("Sampling delta: %s" % args.delta_seconds)
row = 0
while True:
# print header each args.header_rows num of rows, or only the first row
header_row = (args.header_rows > 0 and row % args.header_rows == 0) or (args.header_rows < 0 and row == 0)
cmd = _concat_date(LOG_CMD if header_row else LOG_CMD_STRIPPED)
cmd = "%s >> %s" % (cmd, log_sample_filename)
subprocess.Popen(cmd, shell=True)
cmd = _concat_date(DB_CMD if header_row else DB_CMD_STRIPPED)
cmd = "%s >> %s" % (cmd, db_sample_filename)
subprocess.Popen(cmd, shell=True)
for stat_table in STATS_TABLES:
cmd = _concat_date(STATS_SQL_CMD_HEADER if header_row else STATS_SQL_CMD_STRIPPED)
cmd = "%s >> %s" % (cmd, stat_sample_filename_template)
# replace {0} with stat_table both in the cmd and the filename
cmd = cmd.format(stat_table)
subprocess.Popen(cmd, shell=True)
row += 1
time.sleep(args.delta_seconds)
if __name__ == "__main__":
main()
| 33.478261
| 160
| 0.684416
|
ff4ae0fb493ff3a426fea0f383a07b7ed27fd160
| 2,984
|
py
|
Python
|
init.py
|
vherrin/MatrixNTFScan
|
0f9fb0a8f8f262786456726a00dde9ba31ba54fa
|
[
"MIT"
] | null | null | null |
init.py
|
vherrin/MatrixNTFScan
|
0f9fb0a8f8f262786456726a00dde9ba31ba54fa
|
[
"MIT"
] | null | null | null |
init.py
|
vherrin/MatrixNTFScan
|
0f9fb0a8f8f262786456726a00dde9ba31ba54fa
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import glob
import numpy as np
import cloudscraper
import re
import math
import shutil
import os
import sys
import cfscrape
import time
import requests
import IPython
import webbrowser
import json
import logging
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from datetime import date
from IPython.display import HTML
from IPython.display import display
from IPython.display import clear_output
from urllib.request import urlopen
from bs4 import BeautifulSoup
# In[2]:
pd.set_option("display.max_rows", None)
dataDir = './data/'
#contractURLs=['ckw5j7pqf0011g4731pvaj6gm/']
#contractURLs=['ckw5j7pqf0011g4731pvaj6gm/', 'matrix-red-contract/', 'matrix-blue-contract/']
contractURLs=['matrix-red-contract/', 'matrix-blue-contract/']
#contractURLs='ckw5j7pqf0011g4731pvaj6gm/'
#contractURLs='matrix-red-contract/'
# In[3]:
attributeList = {}
dfDict = {}
contractColumnDict={}
for contractURL in contractURLs:
contractPath = dataDir + contractURL
if os.path.exists(contractPath + 'retrievedColumnsList.txt'):
#print('path exists')
with open(contractPath + 'retrievedColumnsList.txt', 'r') as filehandle:
contractColumnDict[contractURL] = json.load(filehandle)
#print(contractColumnDict[contractURL])
attributeList[contractURL] = [contractPath + 'Attributes_1_5000.csv',
contractPath + 'Attributes_5001_10000.csv',
contractPath + 'Attributes_10001_15000.csv',
contractPath + 'Attributes_15001_20000.csv',
contractPath + 'Attributes_20001_25000.csv',
contractPath + 'Attributes_25001_30000.csv',
contractPath + 'Attributes_30001_35000.csv',
contractPath + 'Attributes_35001_40000.csv',
contractPath + 'Attributes_40001_45000.csv',
contractPath + 'Attributes_45001_50000.csv',
contractPath + 'Attributes_50001_55000.csv',
contractPath + 'Attributes_55001_60000.csv',
contractPath + 'Attributes_60001_65000.csv',
contractPath + 'Attributes_65001_70000.csv',
contractPath + 'Attributes_70001_75000.csv',
contractPath + 'Attributes_75001_80000.csv',
contractPath + 'Attributes_80001_85000.csv',
contractPath + 'Attributes_85001_90000.csv',
contractPath + 'Attributes_90001_95000.csv',
contractPath + 'Attributes_95001_100000.csv']
dfDict[contractURL] = pd.concat(map(pd.read_csv, attributeList[contractURL]))
mci = contractColumnDict[contractURL].copy()
mci.insert(0,'ID')
dfDict[contractURL].columns = mci.copy()
print('Length of ' + contractURL + ' attributes added ', len(dfDict[contractURL].index))
#print(dfDict[contractURL].columns)
dfTemp = dfDict[contractURL]
validCount = len(dfTemp.index) - len(np.where(pd.isnull(dfTemp['Background']))[0])
print('Number of valid rows with ' + contractURL + ' attributes ', validCount)
print('\n')
# In[ ]:
| 28.692308
| 93
| 0.732909
|
40e0f7c74f838c15dddd80912a57c266102e5ac3
| 1,833
|
ts
|
TypeScript
|
packages/@ngx-cache/platform-server/src/fs-cache.service.ts
|
m1kl/ngx-cache
|
bbaac5239cb4bcab1aadaac624aae352d77f8b9c
|
[
"MIT"
] | 131
|
2017-08-29T14:23:19.000Z
|
2022-02-07T09:21:56.000Z
|
packages/@ngx-cache/platform-server/src/fs-cache.service.ts
|
m1kl/ngx-cache
|
bbaac5239cb4bcab1aadaac624aae352d77f8b9c
|
[
"MIT"
] | 77
|
2017-08-18T16:17:02.000Z
|
2021-07-21T01:14:05.000Z
|
packages/@ngx-cache/platform-server/src/fs-cache.service.ts
|
m1kl/ngx-cache
|
bbaac5239cb4bcab1aadaac624aae352d77f8b9c
|
[
"MIT"
] | 19
|
2017-09-26T23:22:59.000Z
|
2022-03-02T20:11:15.000Z
|
import { isPlatformServer } from '@angular/common';
import { Inject, Injectable, Injector, PLATFORM_ID } from '@angular/core';
import { Cache, CacheValue, STORAGE, Storage } from '@ngx-cache/core';
@Injectable()
export class FsCacheService implements Cache {
protected readonly fsStorage: Storage;
private get isEnabled(): boolean {
if (!isPlatformServer(this.platformId)) {
return false;
}
try {
this.fsStorage.setItem('test', 'test');
this.fsStorage.removeItem('test');
return true;
} catch (e) {
return false;
}
}
constructor(@Inject(PLATFORM_ID) private readonly platformId: any, private readonly injector: Injector) {
if (!isPlatformServer(platformId)) {
throw new Error('FsCacheService is not supported outside `server` platform!');
}
this.fsStorage = injector.get(STORAGE);
}
get keys(): Array<string> {
if (!this.isEnabled) {
return undefined;
}
return this.fsStorage.keys;
}
setItem(key: string, value: CacheValue): boolean {
if (!this.isEnabled) {
return false;
}
try {
this.fsStorage.setItem(key, JSON.stringify(value));
return true;
} catch (e) {
return false;
}
}
getItem(key: string): CacheValue {
if (!this.isEnabled) {
return undefined;
}
const value = this.fsStorage.getItem(key);
return value ? JSON.parse(value) : undefined;
}
removeItem(key: string, wild = false): void {
if (!this.isEnabled) {
return;
}
this.fsStorage.removeItem(key);
if (wild) {
for (const item of this.keys) {
if (item.indexOf(key) === 0) {
this.fsStorage.removeItem(item);
}
}
}
}
clear(): void {
if (!this.isEnabled) {
return;
}
this.fsStorage.clear();
}
}
| 20.829545
| 107
| 0.610475
|
850ea355a6e7b172b13bbd2037cb75957e7e517a
| 51
|
lua
|
Lua
|
[ui]/dpChat/client/exports.lua
|
dcr30/drive-crew-mta
|
1bc6b1bf6520b1818c54b7fb9b75f97f9b290e69
|
[
"Apache-2.0"
] | 16
|
2017-09-02T20:31:49.000Z
|
2020-06-07T20:59:55.000Z
|
[ui]/dpChat/client/exports.lua
|
dcr30/drive-crew-mta
|
1bc6b1bf6520b1818c54b7fb9b75f97f9b290e69
|
[
"Apache-2.0"
] | 1
|
2019-05-21T18:35:44.000Z
|
2019-05-21T18:35:44.000Z
|
[ui]/dpChat/client/exports.lua
|
JluHeuKa/driftparadise-legacy
|
570ff6350a1960d531448c62ec10a0708f429c31
|
[
"Apache-2.0"
] | 16
|
2018-02-18T16:39:35.000Z
|
2020-05-18T16:15:01.000Z
|
setVisible = Chat.setVisible
message = Chat.message
| 25.5
| 28
| 0.823529
|
e7e0ff7d797c739cb45244c5ebaa29c4430c6814
| 203
|
ps1
|
PowerShell
|
hsp3-debug-window-adapter/vscode-ext/install.ps1
|
honobonosun/hsp3-ginger
|
d2788085d71c8d8fdf31e445a8e262c08e18fba8
|
[
"CC0-1.0"
] | 2
|
2019-04-20T00:57:54.000Z
|
2019-11-23T06:02:14.000Z
|
hsp3-debug-window-adapter/vscode-ext/install.ps1
|
honobonosun/hsp3-ginger
|
d2788085d71c8d8fdf31e445a8e262c08e18fba8
|
[
"CC0-1.0"
] | 7
|
2020-01-11T12:35:38.000Z
|
2021-11-01T12:25:11.000Z
|
hsp3-debug-window-adapter/vscode-ext/install.ps1
|
honobonosun/hsp3-ginger
|
d2788085d71c8d8fdf31e445a8e262c08e18fba8
|
[
"CC0-1.0"
] | 2
|
2020-06-24T07:51:40.000Z
|
2022-01-04T03:17:54.000Z
|
#!/bin/pwsh
npm --version
if (!$?) {
echo 'Node.js をインストールしてください。'
exit 1
}
npm install
npm run build
npm run vsce:package
code --install-extension 'hsp3-debug-window-adapter.vsix'
| 15.615385
| 58
| 0.64532
|
a32c18472853df19ee2daf9e56df0a2038a80b57
| 3,254
|
java
|
Java
|
data-protocols/ids/ids-core/src/main/java/org/eclipse/dataspaceconnector/ids/core/policy/CustomIdsConstraintDeserializer.java
|
saudkhan116/DataSpaceConnector
|
ff0cf33fa6c0994f8eb7d76877bbd2271510c9cd
|
[
"Apache-2.0"
] | 3
|
2021-11-25T10:57:45.000Z
|
2022-03-29T11:18:32.000Z
|
data-protocols/ids/ids-core/src/main/java/org/eclipse/dataspaceconnector/ids/core/policy/CustomIdsConstraintDeserializer.java
|
sovity/EDC
|
52f028017aeea68c8efa6f6a45f0ded38db7b110
|
[
"Apache-2.0"
] | 180
|
2022-02-07T07:56:53.000Z
|
2022-03-31T13:01:13.000Z
|
data-protocols/ids/ids-core/src/main/java/org/eclipse/dataspaceconnector/ids/core/policy/CustomIdsConstraintDeserializer.java
|
mercedes-benz/EclipseDataSpaceConnector
|
14009c9f0032a15e9317a3a99b8dba18b4989995
|
[
"Apache-2.0"
] | 2
|
2021-11-12T12:01:28.000Z
|
2021-11-23T12:04:10.000Z
|
/*
* Copyright (c) 2022 Fraunhofer Institute for Software and Systems Engineering
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Fraunhofer Institute for Software and Systems Engineering - initial API and implementation
*
*/
package org.eclipse.dataspaceconnector.ids.core.policy;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.node.NullNode;
import de.fraunhofer.iais.eis.BinaryOperator;
import de.fraunhofer.iais.eis.Constraint;
import de.fraunhofer.iais.eis.util.RdfResource;
import org.eclipse.dataspaceconnector.spi.EdcException;
import java.io.IOException;
import java.net.URI;
public class CustomIdsConstraintDeserializer extends StdDeserializer<Constraint> {
private static final long serialVersionUID = 1L;
public CustomIdsConstraintDeserializer() {
this(null);
}
public CustomIdsConstraintDeserializer(Class clazz) {
super(clazz);
}
@Override
public Constraint deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
JsonNode jsonNode = p.getCodec().readTree(p);
var id = getOrThrow(jsonNode, "@id");
var leftOperand = getOrThrow(jsonNode, "ids:leftOperand");
var operator = getOrThrow(jsonNode, "ids:operator");
var rightOperand = jsonNode.get("ids:rightOperand");
var rightOperandReference = jsonNode.get("ids:rightOperandReference");
var unit = jsonNode.get("ids:unit");
var endpoint = jsonNode.get("ids:pipEndpoint");
// NOTE custom properties are not deserialized
var builder = new IdsConstraintBuilder(URI.create(id.asText()))
.leftOperand(leftOperand.asText())
.operator(BinaryOperator.deserialize(operator));
if (isValidNode(rightOperand)) {
builder.rightOperand(new RdfResource(getOrThrow(rightOperand, "@value").asText(), URI.create(getOrThrow(rightOperand, "@type").asText())));
} else if (isValidNode(rightOperandReference)) {
builder.rightOperandReference(URI.create(rightOperandReference.asText()));
} else {
throw new EdcException("Either RightOperand or RightOperandReference must be provided");
}
if (isValidNode(unit)) {
builder.unit(URI.create(unit.asText()));
}
if (isValidNode(endpoint)) {
builder.pipEndpoint(URI.create(endpoint.asText()));
}
return builder.build();
}
private static JsonNode getOrThrow(JsonNode json, String key) {
var value = json.get(key);
if (!isValidNode(value)) {
throw new EdcException(String.format("Missing key: %s in %s", key, json));
}
return value;
}
private static boolean isValidNode(JsonNode node) {
return node != null && node != NullNode.getInstance();
}
}
| 36.977273
| 151
| 0.693301
|
e747d4127f08dfba0208e6b55c1f93bf2e58c43a
| 2,763
|
php
|
PHP
|
application/company/command/Subversion.php
|
H-Jack/Project
|
2f790af553c978efae735f88c495c4467bbc729d
|
[
"MIT"
] | null | null | null |
application/company/command/Subversion.php
|
H-Jack/Project
|
2f790af553c978efae735f88c495c4467bbc729d
|
[
"MIT"
] | null | null | null |
application/company/command/Subversion.php
|
H-Jack/Project
|
2f790af553c978efae735f88c495c4467bbc729d
|
[
"MIT"
] | null | null | null |
<?php
namespace app\company\command;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\Db;
/**
* SVN 版本指令
* Class Subversion
* @package app\company\command
*/
class Subversion extends Command
{
/**
* 账号授权文件位置
* @var string
*/
protected $authzFile = 'php://output';
/**
* 账号管理文件位置
* @var string
*/
protected $passwdFile = 'php://output';
/**
* 配置指令配置
*/
protected function configure()
{
$this->setName('xsubversion:config')->setDescription('从数据库的配置同步到SVN配置文件');
}
/**
* @param Input $input
* @param Output $output
* @return int|void|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
protected function execute(Input $input, Output $output)
{
$paths = ['/' => [0]];
$where = ['status' => '1', 'is_deleted' => '0'];
// 取得可用的用户账号
$users = Db::name('CompanyUser')->field('svn_username,svn_password,svn_authorize')->where($where)->select();
$authids = array_unique(explode(',', join(',', array_column($users, 'svn_authorize'))));
// 取得可用的权限配置
$userAuths = Db::name('CompanyUserAuth')->field('id,path')->where($where)->whereIn('id', $authids)->order('sort desc,id desc')->select();
foreach ($userAuths as $item) foreach (explode("\n", preg_replace('/\s+/i', "\n", trim($item['path']))) as $path) {
$paths[$path][] = $item['id'];
}
$this->writeAuth($users, $paths);
}
/**
* 写入 SVN 配置文件
* @param array $users
* @param array $paths
*/
protected function writeAuth($users, $paths)
{
$output = [];
// Passwd 用户账号处理
foreach ($users as $user) $output[] = "{$user['svn_username']}={$user['svn_password']}";
file_put_contents($this->passwdFile, join(PHP_EOL, $output));
// Authz 授权配置处理
$groups = ['_0' => []];
foreach ($users as $user) {
$ids = array_unique(explode(',', $user['svn_authorize']));
foreach ($ids as $id) $groups["_{$id}"][] = $user['svn_username'];
}
$output = [];
$output[] = '[groups]';
foreach ($groups as $key => $group) $output[] = "group{$key}=" . join(',', $group);
$output[] = '';
foreach ($paths as $path => $ids) {
$output[] = "[{$path}]";
$output[] = "* =";
$output[] = '@group_0 = rw';
foreach ($ids as $id) if ($id > 0) $output[] = "@group_{$id} = rw";
$output[] = '';
}
file_put_contents($this->authzFile, join(PHP_EOL, $output));
}
}
| 30.032609
| 145
| 0.535288
|
c66a80983956187f6f659ba746fae561571e823a
| 935
|
rb
|
Ruby
|
app/models/user.rb
|
tanaka51-jp/haruno
|
ae572bd7aeb55eee0005792dfb7d750bde57139d
|
[
"MIT"
] | null | null | null |
app/models/user.rb
|
tanaka51-jp/haruno
|
ae572bd7aeb55eee0005792dfb7d750bde57139d
|
[
"MIT"
] | null | null | null |
app/models/user.rb
|
tanaka51-jp/haruno
|
ae572bd7aeb55eee0005792dfb7d750bde57139d
|
[
"MIT"
] | null | null | null |
class User < ActiveRecord::Base
authenticates_with_sorcery!
belongs_to :organization
validates :family_name, presence: true
validates :given_name, presence: true
validates :email, presence: true, uniqueness: { scope: :organization_id }, email: true
validates :password, length: { minimum: 6 }, confirmation: true, allow_nil: true, presence: { on: :create }
validates :password_confirmation, presence: true, if: -> { password.present? }
class << self
# override sorcery default authentication method
def authenticate(organization_login_name, email, password)
org = Organization.find_by(login_name: organization_login_name)
return unless org
user = org.users.find_by(email: email)
return unless user
set_encryption_attributes
return unless user.valid_password?(password)
user
end
end
def full_name
"#{family_name} #{given_name}"
end
end
| 26.714286
| 112
| 0.71123
|
4cbc92b22b91b0c7a8265d125f6c3d5c9f8814c7
| 2,337
|
dart
|
Dart
|
lib/74_marquee/marquee.dart
|
md-siam/package_of_the_day
|
7e712f8c857b5c1ea4848d321810d1c13f1ce4c3
|
[
"MIT"
] | 5
|
2022-02-25T15:38:00.000Z
|
2022-03-30T05:51:05.000Z
|
lib/74_marquee/marquee.dart
|
md-siam/package_of_the_day
|
7e712f8c857b5c1ea4848d321810d1c13f1ce4c3
|
[
"MIT"
] | null | null | null |
lib/74_marquee/marquee.dart
|
md-siam/package_of_the_day
|
7e712f8c857b5c1ea4848d321810d1c13f1ce4c3
|
[
"MIT"
] | 6
|
2022-02-25T15:38:26.000Z
|
2022-03-19T07:31:02.000Z
|
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:marquee/marquee.dart';
class MyMarquee extends StatelessWidget {
const MyMarquee({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Marquee')),
body: Stack(
children: [
SizedBox(
height: double.infinity,
width: double.infinity,
child: Image.asset(
'assets/images/background/bulb.jpg',
fit: BoxFit.cover,
),
),
Column(
children: [
Container(
height: 40,
color: Colors.red,
child: Marquee(
text: 'Some sample text that takes some space.',
style: const TextStyle(
color: Colors.white,
fontSize: 30,
fontWeight: FontWeight.bold,
),
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.start,
blankSpace: 20.0,
velocity: 100.0,
pauseAfterRound: const Duration(seconds: 1),
startPadding: 10.0,
accelerationDuration: const Duration(seconds: 1),
accelerationCurve: Curves.linear,
decelerationDuration: const Duration(milliseconds: 500),
decelerationCurve: Curves.easeOut,
),
),
const SizedBox(height: 20.0),
Center(
child: Column(
children: const [
FaIcon(
FontAwesomeIcons.arrowUp,
color: Colors.white,
size: 30,
),
Text(
'That\'s cool 😮 !!',
style: TextStyle(
fontSize: 30,
color: Colors.white,
fontWeight: FontWeight.bold,
),
)
],
),
),
],
),
],
),
);
}
}
| 32.013699
| 74
| 0.438596
|