identifier
stringlengths 42
383
| collection
stringclasses 1
value | open_type
stringclasses 1
value | license
stringlengths 0
1.81k
| date
float64 1.99k
2.02k
⌀ | title
stringlengths 0
100
| creator
stringlengths 1
39
| language
stringclasses 157
values | language_type
stringclasses 2
values | word_count
int64 1
20k
| token_count
int64 4
1.32M
| text
stringlengths 5
1.53M
| __index_level_0__
int64 0
57.5k
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/ItsANameToo/swift-crypto/blob/master/Crypto/Crypto/Utils/Helpers.swift
|
Github Open Source
|
Open Source
|
MIT
| null |
swift-crypto
|
ItsANameToo
|
Swift
|
Code
| 121
| 342
|
//
// This file is part of Ark Swift Crypto.
//
// (c) Ark Ecosystem <info@ark.io>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
//
import Foundation
import BitcoinKit
func base58CheckEncode(_ bytes: [UInt8]) -> String {
let checksum = Crypto.sha256sha256(Data.init(bytes: bytes)).prefix(4)
var checkedBytes = bytes
checkedBytes.append(contentsOf: checksum)
return Base58.encode(Data.init(bytes: checkedBytes))
}
func base58CheckDecode(_ string: String) -> [UInt8]? {
let checkedBytes = Base58.decode(string)
if var checkedBytes = checkedBytes {
guard checkedBytes.count >= 0 else {
return nil
}
// TODO: Data.suffix(4)
let checksum = [UInt8](checkedBytes[checkedBytes.count-4..<checkedBytes.count])
let bytes = [UInt8](checkedBytes[0..<checkedBytes.count-4])
let calculatedChecksum = [UInt8](Crypto.sha256sha256(Data.init(bytes: bytes)).prefix(4))
if checksum != calculatedChecksum {
return nil
}
return bytes
}
return nil
}
| 18,419
|
https://github.com/powerpool-finance/powerindex/blob/master/contracts/test/MockIndicesSupplyRedeemZap.sol
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
powerindex
|
powerpool-finance
|
Solidity
|
Code
| 64
| 243
|
// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity 0.6.12;
import "../IndicesSupplyRedeemZap.sol";
contract MockIndicesSupplyRedeemZap is IndicesSupplyRedeemZap {
constructor(address _usdc, address _powerPoke) public IndicesSupplyRedeemZap(_usdc, _powerPoke) {}
function mockSupplyAndRedeemPokeFromReporter(bytes32[] memory _roundKeys) external {
_supplyAndRedeemPoke(_roundKeys, false);
}
function mockClaimPokeFromReporter(bytes32 _roundKey, address[] memory _claimForList) external {
_claimPoke(_roundKey, _claimForList, false);
}
function _getMinMaxReportInterval() internal view override returns (uint256 min, uint256 max) {
min = 0;
max = 0;
}
}
| 37,986
|
https://github.com/WallaceLiu/obdtool/blob/master/Msg_Dest.py
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,018
|
obdtool
|
WallaceLiu
|
Python
|
Code
| 60
| 197
|
# -*- coding: utf-8 -*-
from Biz_Base import Biz_Base
from mysql_python_factory import MysqlPythonFacotry
import CommonUtil
from CommonUtil import hostname
import mysql.connector
import datetime
import time
class Msg_Dest(Biz_Base):
__tableName = "incoming"
def __init__(self, db):
Biz_Base.__init__(self, db)
def insertMsg(self, clientIp, processingData, type):
cnt = self.db.insert(self.__tableName, \
clientIp = clientIp, \
processingData = mysql.connector.Binary(processingData),\
flag=0,\
type=type,\
createdBy=hostname() + '_py')
return cnt > 0
| 4,091
|
https://github.com/qaiken/mmmystery/blob/master/app/components/side-menu/FAQ.js
|
Github Open Source
|
Open Source
|
MIT
| 2,015
|
mmmystery
|
qaiken
|
JavaScript
|
Code
| 131
| 487
|
import React from 'react-native';
import Dimensions from 'Dimensions';
const window = Dimensions.get('window');
import globals from '../../../globalVariables';
import { getFaqs } from '../../utils/faqs';
let {
StyleSheet,
View,
Modal,
ScrollView,
TouchableOpacity,
TouchableHighlight,
Image,
Text,
Easing,
AlertIOS,
LinkingIOS,
Animated,
} = React;
class FAQ extends React.Component {
render() {
return (
<View style={styles.container}>
<Image
source={require('image!white-pattern-bg')}
style={styles.bgImage}>
<ScrollView
style={styles.listView}>
{getFaqs().map(function(faq) {
return (
<View style={styles.faq}>
<Text style={[styles.text, styles.question]}>
{faq.question}
</Text>
<Text style={[styles.text, styles.answer]}>
{faq.answer}
</Text>
</View>
);
})}
</ScrollView>
</Image>
</View>
);
}
}
var styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
},
text: {
fontFamily: globals.fontTextRegular,
},
question: {
marginBottom: 5,
fontWeight: 'bold',
fontSize: 18,
},
listView: {
paddingHorizontal: 20,
},
faq: {
marginBottom: 15,
},
answer: {
fontSize: 16,
},
bgImage: {
flex: 1,
width: window.width,
},
});
export default FAQ;
| 21,399
|
https://github.com/villfa/psalm/blob/master/src/Psalm/Issue/ForbiddenEcho.php
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
psalm
|
villfa
|
PHP
|
Code
| 19
| 49
|
<?php
namespace Psalm\Issue;
class ForbiddenEcho extends CodeIssue
{
public const ERROR_LEVEL = -2;
public const SHORTCODE = 172;
}
| 47,055
|
https://github.com/shaolonger/nuall-monitor-platform/blob/master/web-monitor-ui/web-monitor-ui-flutter/lib/modules/module_log/consts/const_log.dart
|
Github Open Source
|
Open Source
|
MIT
| null |
nuall-monitor-platform
|
shaolonger
|
Dart
|
Code
| 66
| 314
|
import 'dart:ui';
class ConstLog {
/// 日志类型,包括jsErrorLog、httpErrorLog、resourceLoadErrorLog、customErrorLog
static const LOG_TYPE_LIST_MAP = {
"JS": "jsErrorLog",
"HTTP": "httpErrorLog",
"RES": "resourceLoadErrorLog",
"CUS": "customErrorLog",
};
/// 统计类型
static const INDICATOR_LIST_MAP = {
// 设备类型
"DEVICE_NAME": "device_name",
// 操作系统
"OS": "os",
// 浏览器
"BROWSER_NAME": "browser_name",
// 网络类型
"NET_TYPE": "net_type",
// 状态码
"STATUS": "status",
// 资源类型
"RESOURCE_TYPE": "resource_type",
};
/// 图标颜色集合
static const CHART_COLORS_LIST = [
Color(0xff0293ee),
Color(0xfff8b250),
Color(0xff845bef),
Color(0xff13d38e),
];
}
| 32,027
|
https://github.com/blockchyp/blockchyp-ios/blob/master/blockchyp-ios-examples/UpdateSurveyQuestionExample.m
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
blockchyp-ios
|
blockchyp
|
Objective-C
|
Code
| 78
| 349
|
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["id"] = "<QUESTION ID>"
request["ordinal"] = 1
request["questionText"] = "Would you shop here again?"
request["questionType"] = "yes_no"
request["enabled"] = true
[client updateSurveyQuestionWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
| 43,424
|
https://github.com/ofpiyush/hedwig-py/blob/master/hedwig/core/worker.py
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
hedwig-py
|
ofpiyush
|
Python
|
Code
| 47
| 208
|
__author__ = 'sandeep'
import multiprocessing
from consumer import Consumer
import logging
LOGGER = logging.getLogger(__name__)
class HedwigWorker(multiprocessing.Process):
def __init__(self, settings, *args, **kwargs):
self.hedwig_consumer = Consumer(settings)
super(HedwigWorker, self).__init__(*args, **kwargs)
def run(self):
LOGGER.info("Hedwig consumer: starting")
self.hedwig_consumer.consume()
LOGGER.info("hedwig consumer: stopped")
def shutdown(self):
LOGGER.info("Hedwig consumer: shutting down")
self.hedwig_consumer.shutdown()
LOGGER.info("Hedwig consumer: shutdown complete")
| 5,500
|
https://github.com/xinqinglhj/LCLFramework/blob/master/Source/src/LCL/Properties/AssemblyInfo.cs
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
LCLFramework
|
xinqinglhj
|
C#
|
Code
| 11
| 45
|
using System.Reflection;
[assembly: AssemblyDefaultAlias("LCL.dll")]
[assembly: AssemblyDescription("LCL Application Development Framework")]
[assembly: AssemblyTitle("LCL")]
| 2,211
|
https://github.com/LLH2019/multi-agent-v4/blob/master/src/main/java/base/model/connect/UpConnectIn.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
multi-agent-v4
|
LLH2019
|
Java
|
Code
| 22
| 72
|
package base.model.connect;
/**
* @author :LLH
* @date :Created in 2021/4/16 11:15
* @description:接收来自于上层的一些消息
*/
public interface UpConnectIn {
void upConnectIn();
}
| 19,441
|
https://github.com/koxudaxi/datamodel-code-generator/blob/master/datamodel_code_generator/model/typed_dict.py
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
datamodel-code-generator
|
koxudaxi
|
Python
|
Code
| 351
| 1,456
|
from __future__ import annotations
import keyword
from pathlib import Path
from typing import (
Any,
ClassVar,
DefaultDict,
Dict,
Iterator,
List,
Optional,
Tuple,
)
from datamodel_code_generator.imports import Import
from datamodel_code_generator.model import DataModel, DataModelFieldBase
from datamodel_code_generator.model.base import UNDEFINED
from datamodel_code_generator.model.imports import (
IMPORT_NOT_REQUIRED,
IMPORT_NOT_REQUIRED_BACKPORT,
IMPORT_TYPED_DICT,
IMPORT_TYPED_DICT_BACKPORT,
)
from datamodel_code_generator.reference import Reference
from datamodel_code_generator.types import NOT_REQUIRED_PREFIX
escape_characters = str.maketrans(
{
'\\': r'\\',
"'": r"\'",
'\b': r'\b',
'\f': r'\f',
'\n': r'\n',
'\r': r'\r',
'\t': r'\t',
}
)
def _is_valid_field_name(field: DataModelFieldBase) -> bool:
name = field.original_name or field.name
if name is None: # pragma: no cover
return False
return name.isidentifier() and not keyword.iskeyword(name)
class TypedDict(DataModel):
TEMPLATE_FILE_PATH: ClassVar[str] = 'TypedDict.jinja2'
BASE_CLASS: ClassVar[str] = 'typing.TypedDict'
DEFAULT_IMPORTS: ClassVar[Tuple[Import, ...]] = (IMPORT_TYPED_DICT,)
def __init__(
self,
*,
reference: Reference,
fields: List[DataModelFieldBase],
decorators: Optional[List[str]] = None,
base_classes: Optional[List[Reference]] = None,
custom_base_class: Optional[str] = None,
custom_template_dir: Optional[Path] = None,
extra_template_data: Optional[DefaultDict[str, Dict[str, Any]]] = None,
methods: Optional[List[str]] = None,
path: Optional[Path] = None,
description: Optional[str] = None,
default: Any = UNDEFINED,
nullable: bool = False,
) -> None:
super().__init__(
reference=reference,
fields=fields,
decorators=decorators,
base_classes=base_classes,
custom_base_class=custom_base_class,
custom_template_dir=custom_template_dir,
extra_template_data=extra_template_data,
methods=methods,
path=path,
description=description,
default=default,
nullable=nullable,
)
@property
def is_functional_syntax(self) -> bool:
return any(not _is_valid_field_name(f) for f in self.fields)
@property
def all_fields(self) -> Iterator[DataModelFieldBase]:
for base_class in self.base_classes:
if base_class.reference is None: # pragma: no cover
continue
data_model = base_class.reference.source
if not isinstance(data_model, DataModel): # pragma: no cover
continue
if isinstance(data_model, TypedDict): # pragma: no cover
yield from data_model.all_fields
yield from self.fields
def render(self, *, class_name: Optional[str] = None) -> str:
response = self._render(
class_name=class_name or self.class_name,
fields=self.fields,
decorators=self.decorators,
base_class=self.base_class,
methods=self.methods,
description=self.description,
is_functional_syntax=self.is_functional_syntax,
all_fields=self.all_fields,
**self.extra_template_data,
)
return response
class TypedDictBackport(TypedDict):
BASE_CLASS: ClassVar[str] = 'typing_extensions.TypedDict'
DEFAULT_IMPORTS: ClassVar[Tuple[Import, ...]] = (IMPORT_TYPED_DICT_BACKPORT,)
class DataModelField(DataModelFieldBase):
DEFAULT_IMPORTS: ClassVar[Tuple[Import, ...]] = (IMPORT_NOT_REQUIRED,)
@property
def key(self) -> str:
return (self.original_name or self.name or '').translate( # pragma: no cover
escape_characters
)
@property
def type_hint(self) -> str:
type_hint = super().type_hint
if self._not_required:
return f'{NOT_REQUIRED_PREFIX}{type_hint}]'
return type_hint
@property
def _not_required(self) -> bool:
return not self.required and isinstance(self.parent, TypedDict)
@property
def fall_back_to_nullable(self) -> bool:
return not self._not_required
@property
def imports(self) -> Tuple[Import, ...]:
return (
*super().imports,
*(self.DEFAULT_IMPORTS if self._not_required else ()),
)
class DataModelFieldBackport(DataModelField):
DEFAULT_IMPORTS: ClassVar[Tuple[Import, ...]] = (IMPORT_NOT_REQUIRED_BACKPORT,)
| 27,198
|
https://github.com/thuongaptech/TTCMS/blob/master/TTCMS.Web/Controllers/ProductController.cs
|
Github Open Source
|
Open Source
|
MIT
| null |
TTCMS
|
thuongaptech
|
C#
|
Code
| 994
| 4,150
|
using AutoMapper;
using log4net;
using PagedList;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;
using TTCMS.Data.Infrastructure;
using TTCMS.Domain;
using TTCMS.Service;
using TTCMS.Web.Models.Product;
namespace TTCMS.Web.Controllers
{
public class ProductController : BaseController
{
private readonly IProductService _proSrv;
private readonly IOrderDetailService _orderDetailService;
private readonly ICategoryService categoryService;
private readonly IProductColorService _colorSrv;
private readonly IProductImageService _imageSrv;
private readonly IProductSizeService _sizeSrv;
public ProductController(IOrderDetailService _orderDetailService, IProductSizeService _sizeSrv,IProductImageService _imageSrv,IProductColorService _colorSrv,ICategoryService categoryService,IProductService _proSrv)
{
this._orderDetailService = _orderDetailService;
this._sizeSrv = _sizeSrv;
this._colorSrv = _colorSrv;
this._imageSrv = _imageSrv;
this.categoryService = categoryService;
this._proSrv = _proSrv;
}
[ChildActionOnly]
public ActionResult Home_Sale()
{
string _Cahe_Home_Sale = "Home_Sale";
IList<ProductVM> model = new List<ProductVM>();
if (!Cache.IsSet(_Cahe_Home_Sale))
{
model = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductVM>>(_proSrv.GetListbyActive().Where(x => x.GiaKM > 0).Take(8).OrderByDescending(x => x.Published)).ToArray();
Cache.Set(_Cahe_Home_Sale, model);
}
else
{
model = Cache.Get(_Cahe_Home_Sale) as ProductVM[];
}
return PartialView(model);
}
[ChildActionOnly]
public ActionResult CateHome()
{
string _Cahe_CateHome = "CateHome";
IList<CateHomeViewModel> model = new List<CateHomeViewModel>();
if (!Cache.IsSet(_Cahe_CateHome))
{
model = Mapper.Map<IEnumerable<Category>, IEnumerable<CateHomeViewModel>>(categoryService.GetListbyActive(CategoryType.Product,cultureName).Where(x => x.IsHome && x.IsActive).OrderBy(x => x.Order)).ToArray();
foreach (var item in model)
{
item.ListParent = Mapper.Map<IEnumerable<Category>, IEnumerable<CateHomeViewModel>>(categoryService.GetListbyActive(CategoryType.Product, cultureName).Where(x=>x.ParentID == item.Id).OrderBy(x=>x.Order).Take(3)).ToList();
item.ListProductNews = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive(item.Id,item.ShowProduct)).ToList();
foreach (var pro in item.ListProductNews)
{
pro.DaMua = pro.DaMua + _orderDetailService.TongDaMua(pro.Id);
}
item.ListProductHot = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive(item.Id)).Where(x=>x.IsBanChay).OrderByDescending(x=>x.Published).Take(item.ShowProduct).ToList();
foreach (var pro in item.ListProductHot)
{
pro.DaMua = pro.DaMua + _orderDetailService.TongDaMua(pro.Id);
}
item.ListProductPrice = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive(item.Id)).OrderByDescending(x => x.Published).ToList().OrderByDescending(x=>x.Percent).ThenByDescending(x=>x.Published).ToList();
foreach (var pro in item.ListProductPrice)
{
pro.DaMua = pro.DaMua + _orderDetailService.TongDaMua(pro.Id);
}
}
Cache.Set(_Cahe_CateHome, model);
}
else
{
model = Cache.Get(_Cahe_CateHome) as CateHomeViewModel[];
}
return PartialView(model.ToArray());
}
[ChildActionOnly]
public ActionResult BarMenu()
{
string _Cahe_CateHome = "BarMenu";
IList<CateHomeViewModel> model = new List<CateHomeViewModel>();
if (!Cache.IsSet(_Cahe_CateHome))
{
model = Mapper.Map<IEnumerable<Category>, IEnumerable<CateHomeViewModel>>(categoryService.GetListbyActive(CategoryType.Product, cultureName).Where(x => x.IsHome && x.IsActive).OrderBy(x => x.Order)).ToArray();
foreach (var item in model)
{
item.ListProductNews = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive(item.Id, item.ShowProduct)).ToList();
}
}
else
{
model = Cache.Get(_Cahe_CateHome) as CateHomeViewModel[];
}
return PartialView(model.ToArray());
}
public ActionResult Detail(int Id = 0)
{
if (Id > 0)
{
var product = _proSrv.GetbyId(Id);
if (product != null)
{
var model = Mapper.Map<Product, ProductDetailViewModel>(product);
model.ListHinhAnh = Mapper.Map<IEnumerable<ProductImage>, IEnumerable<HinhAnh>>(_imageSrv.GetListbyPro(Id)).ToList();
model.ListMauSac = Mapper.Map<IEnumerable<ProductColor>, IEnumerable<MauSac>>(_colorSrv.GetListbyPro(Id)).ToList();
model.SPLienQuan = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductDetailViewModel>>(_proSrv.GetListbyActive(model.CategoryId)).Take(8).ToList();
model.ListSize = Mapper.Map<IEnumerable<ProductSize>, IEnumerable<Size>>(_sizeSrv.GetListbyPro(Id)).ToList();
model.DaMua = model.DaMua + _orderDetailService.TongDaMua(model.Id);
Config.Description = model.Description;
Config.Keywords = model.Keywords;
Config.Seo_Image = model.Img_Thumbnail;
ViewBag.Meta = Config;
return View(model);
}
else
{
return HttpNotFound();
}
}
else
{
return HttpNotFound();
}
}
public ActionResult BanChay()
{
var model = new BanChayViewModel();
model.ListBanChay = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive().Where(x => x.IsBanChay).OrderByDescending(x => x.Published).Take(8)).ToList();
foreach (var pro in model.ListBanChay)
{
pro.DaMua = pro.DaMua + _orderDetailService.TongDaMua(pro.Id);
}
model.ListMoiNhat = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive().OrderByDescending(x => x.Published).Take(8)).ToList();
foreach (var pro in model.ListMoiNhat)
{
pro.DaMua = pro.DaMua + _orderDetailService.TongDaMua(pro.Id);
}
return PartialView(model);
}
public ActionResult Category(int Id = 0, int? page = 1, string field = "")
{
if (Id == 0)
{
return HttpNotFound();
}
string _Cahe_Category = "Category";
int pageSize = Config.pageSize;
int pageNumber = (page ?? 1);
IList<ProductHomeViewModel> model = new List<ProductHomeViewModel>();
if (!Cache.IsSet(_Cahe_Category + Id.ToString() + page.ToString()))
{
model = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive(Id)).ToArray();
foreach (var pro in model)
{
pro.DaMua = pro.DaMua + _orderDetailService.TongDaMua(pro.Id);
}
Cache.Set(_Cahe_Category + Id.ToString() + page.ToString(), model);
}
else
{
model = Cache.Get(_Cahe_Category + Id.ToString() + page.ToString()) as ProductHomeViewModel[];
}
if(field != "")
{
switch (field)
{
case "hot":
model = model.Where(x => x.IsBanChay).OrderByDescending(x => x.Published).ToList();
break;
case "price":
model = model.OrderByDescending(x => x.Percent).ThenByDescending(x=>x.Published).ToList();
break;
}
}
if (Request.IsAjaxRequest())
{
return PartialView("_Ajax_Category", model.ToPagedList(pageNumber, pageSize));
}
var cate = categoryService.GetbyId(Id);
Config.Description = cate.Description;
Config.Keywords = cate.Keywords;
Config.Seo_Image = cate.Img_Thumbnail;
ViewBag.Meta = Config;
ViewBag.CateName = cate.Name;
ViewBag.Route = cate.Route;
ViewBag.Id = Id;
ViewBag.field = field;
return View(model.ToPagedList(pageNumber, pageSize));
}
[ChildActionOnly]
public ActionResult Breadcrumb(int Id = 0)
{
var model = new BreadcrumbViewModel();
if (Id > 0)
{
var cate = categoryService.GetbyId(Id);
if (cate.ParentID == 0 || cate.ParentID == null)
{
model.RootId = cate.Id;
model.RootName = cate.Name;
model.RootRouter = cate.Route;
model.Childrent = false;
}
else
{
var root = categoryService.GetbyId(cate.ParentID ?? 0);
model.RootId = root.Id;
model.RootName = root.Name;
model.RootRouter = root.Route;
model.Childrent = true;
model.ParentId = cate.Id;
model.ParentName = cate.Name;
model.ParentRouter = cate.Route;
}
}
ViewBag.Meta = Config;
return PartialView(model);
}
[ChildActionOnly]
public ActionResult CateParent(int Id = 0)
{
IList<CateHomeViewModel> model = new List<CateHomeViewModel>();
if(Id > 0)
{
int IDRoot = 0;
var cate = categoryService.GetbyId(Id);
if(cate.ParentID == 0 || cate.ParentID == null)
{
IDRoot = cate.Id;
}
else
{
IDRoot = cate.ParentID??0;
}
model = Mapper.Map<IEnumerable<Category>, IEnumerable<CateHomeViewModel>>(categoryService.GetListbyActive(CategoryType.Product, cultureName).Where(x => x.ParentID == IDRoot).OrderBy(x => x.Order)).ToArray();
foreach (var item in model)
{
item.CountProduct = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive(item.Id, item.ShowProduct)).Count();
item.ActiveClass = item.Id == Id ? true : false;
}
}
return PartialView(model);
}
[ChildActionOnly]
public ActionResult MoiNhat()
{
string _Cahe_MoiNhat = "MoiNhat";
IList<ProductVM> model = new List<ProductVM>();
if (!Cache.IsSet(_Cahe_MoiNhat))
{
model = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductVM>>(_proSrv.GetListbyActive().Take(8).OrderByDescending(x => x.Published)).ToArray();
Cache.Set(_Cahe_MoiNhat, model);
}
else
{
model = Cache.Get(_Cahe_MoiNhat) as ProductVM[];
}
return PartialView(model);
}
public ActionResult TimKiem(int? page = 1, string q = "", string field = "", int category = 0)
{
string _Cahe_TimKiem = "TimKiem" + q + page.ToString();
int pageSize = Config.pageSize;
int pageNumber = (page ?? 1);
IList<ProductHomeViewModel> model = new List<ProductHomeViewModel>();
if (!Cache.IsSet(_Cahe_TimKiem))
{
var list = _proSrv.GetListbyActive().OrderByDescending(x => x.Published).ToList();
if (q != "")
{
list = list.Where(x => x.Name.Contains(q) || x.MaSP.Contains(q) || x.Summary.Contains(q) || (x.Name !="" && XString.BoDau(x.Name).Contains(q))).ToList();
}
if(category > 0)
{
list = list.Where(x => x.CategoryId == category || x.Category.ParentID == category).ToList();
}
model = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(list).ToArray();
foreach (var pro in model)
{
pro.DaMua = pro.DaMua + _orderDetailService.TongDaMua(pro.Id);
}
Cache.Set(_Cahe_TimKiem, model);
}
else
{
model = Cache.Get(_Cahe_TimKiem) as ProductHomeViewModel[];
}
if (field != "")
{
switch (field)
{
case "hot":
model = model.Where(x => x.IsBanChay).OrderByDescending(x => x.Published).ToList();
break;
case "price":
model = model.OrderByDescending(x => x.Percent).ThenByDescending(x => x.Published).ToList();
break;
}
}
if (Request.IsAjaxRequest())
{
return PartialView("_Ajax_TimKiem", model.ToPagedList(pageNumber, pageSize));
}
ViewBag.Meta = Config;
ViewBag.tukhoa = q;
ViewBag.field = field;
return View(model.ToPagedList(pageNumber, pageSize));
}
public ActionResult Sales(int? page = 1)
{
string _Cahe_Sales = "Sales";
int pageSize = Config.pageSize;
int pageNumber = (page ?? 1);
IList<ProductHomeViewModel> model = new List<ProductHomeViewModel>();
if (!Cache.IsSet(_Cahe_Sales))
{
model = Mapper.Map<IEnumerable<Product>, IEnumerable<ProductHomeViewModel>>(_proSrv.GetListbyActive().Where(x => x.GiaKM > 0).OrderByDescending(x => x.Published)).ToArray();
Cache.Set(_Cahe_Sales, model);
}
else
{
model = Cache.Get(_Cahe_Sales) as ProductHomeViewModel[];
}
ViewBag.show = "0";
if (model.Count > pageSize)
{
ViewBag.show = "1";
}
ViewBag.Meta = Config;
return View(model.ToPagedList(pageNumber, pageSize));
}
}
}
| 17,504
|
https://github.com/dphrygian/zeta/blob/master/Code/Projects/Rosa/src/Components/wbcomprosaobjectives.h
|
Github Open Source
|
Open Source
|
Zlib, Unlicense
| 2,022
|
zeta
|
dphrygian
|
C
|
Code
| 189
| 580
|
#ifndef WBCOMPROSAOBJECTIVES_H
#define WBCOMPROSAOBJECTIVES_H
#include "wbrosacomponent.h"
#include "array.h"
#include "hashedstring.h"
class WBCompRosaObjectives : public WBRosaComponent
{
public:
WBCompRosaObjectives();
virtual ~WBCompRosaObjectives();
DEFINE_WBCOMP( RosaObjectives, WBRosaComponent );
virtual int GetTickOrder() { return ETO_NoTick; }
virtual void HandleEvent( const WBEvent& Event );
virtual uint GetSerializationSize();
virtual void Save( const IDataStream& Stream );
virtual void Load( const IDataStream& Stream );
bool IsObjectiveComplete( const HashedString& ObjectiveTag, const bool RejectFail ) const;
protected:
virtual void InitializeFromDefinition( const SimpleString& DefinitionName );
private:
void PushPersistence() const;
void PullPersistence();
void ClearObjectives();
uint AddObjective( const HashedString& ObjectiveTag ); // Returns index of added objective
void CompleteObjective( const HashedString& ObjectiveTag, const bool Fail, const bool ForceAdd );
bool ObjectiveExists( const HashedString& ObjectiveTag, uint& OutIndex ) const;
void PublishToHUD() const;
enum EObjectiveStatus
{
EOS_None,
EOS_Incomplete,
EOS_Succeeded,
EOS_Failed,
};
struct SObjective
{
SObjective()
: m_ObjectiveTag()
, m_ObjectiveStatus( EOS_None )
{
}
HashedString m_ObjectiveTag;
EObjectiveStatus m_ObjectiveStatus;
// ROSANOTE: Need to change the serialization code if more elements are added!
// It assumes the size of this struct is a constant between versions.
};
Array<SObjective> m_Objectives; // Serialized
bool m_Persist; // Config; set to true if objectives should persist through levels
};
#endif // WBCOMPROSAOBJECTIVES_H
| 5,551
|
https://github.com/joenix/vue-cli-plugin-uni/blob/master/generator.js
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
vue-cli-plugin-uni
|
joenix
|
JavaScript
|
Code
| 7
| 16
|
module.exports = (api, options, rootOptions) => {};
| 751
|
https://github.com/cysec-platform/coach-standard-language/blob/master/src/main/java/eu/smesec/cysec/csl/parser/CommandConcat.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
coach-standard-language
|
cysec-platform
|
Java
|
Code
| 193
| 403
|
/*-
* #%L
* CYSEC Standard Coach Language
* %%
* Copyright (C) 2020 - 2022 FHNW (University of Applied Sciences and Arts Northwestern Switzerland)
* %%
* 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.
* #L%
*/
package eu.smesec.cysec.csl.parser;
import java.util.List;
public class CommandConcat extends Command {
@Override
public Atom execute(List<Atom> list, CoachContext coachContext) throws ExecutorException {
if (list == null || list.size() < 1) {
throw new ExecutorException("concat operations require at least one argument");
}
StringBuilder sb = new StringBuilder();
for (Atom a : list) {
if (a.getType() == Atom.AtomType.METHODE) {
a = a.execute(coachContext);
}
sb.append(a.getType() == Atom.AtomType.STRING ? a.getId() : a.toString());
}
return new Atom(Atom.AtomType.STRING, sb.toString(), null);
}
}
| 29,708
|
https://github.com/MooseValley/Amazon-Web-Services-AWS---Get-WAN-IP-Address/blob/master/AmazonAwsGetWanIpAddress.java
|
Github Open Source
|
Open Source
|
MIT
| null |
Amazon-Web-Services-AWS---Get-WAN-IP-Address
|
MooseValley
|
Java
|
Code
| 173
| 428
|
/*
Simple example to use Amazon AWS to get my WAN IP Address using basic Java commands.
Amazon AWS is a huge and complex beast. But some things
are really easy to do, like getting AWS to tell us what my
WAN IP address is. i.e. get AWS to tell me what my IP address
appears to be from outside my local network.
Example Usage:
System.out.println ("WAN IP: " + AmazonAwsGetWanIpAddress.getWanIPAddress ());
Sample output:
WAN IP: 209.231.145.72
Moose
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
public class AmazonAwsGetWanIpAddress
{
public static String getWanIPAddress ()
{
String wanIPAddress = "unknown";
try
{
// Use Amazon Web Services: this returns a single line - the WAN IP Address.
URL url = new URL("http://checkip.amazonaws.com/");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
//System.out.println(br.readLine());
wanIPAddress = br.readLine();
}
catch (IOException err)
{
err.printStackTrace();
wanIPAddress = "Error: cannot determine WAN IP Address: " + err.toString();
}
return wanIPAddress;
}
public static void main (String[] args)
{
System.out.println("WAN IP: " + getWanIPAddress ());
}
} // public class AmazonAwsGetWanIpAddress
| 12,818
|
https://github.com/cyjseagull/bcos-pbft/blob/master/bcos-pbft/pbft/cache/PBFTCacheFactory.h
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
bcos-pbft
|
cyjseagull
|
C
|
Code
| 166
| 403
|
/**
* Copyright (C) 2021 FISCO BCOS.
* SPDX-License-Identifier: Apache-2.0
* 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.
*
* @brief factory for PBFTCache
* @file PBFTCacheFactory.h
* @author: yujiechen
* @date 2021-06-01
*/
#pragma once
#include "PBFTCache.h"
namespace bcos
{
namespace consensus
{
class PBFTCacheFactory
{
public:
using Ptr = std::shared_ptr<PBFTCacheFactory>;
PBFTCacheFactory() = default;
virtual ~PBFTCacheFactory() {}
virtual PBFTCache::Ptr createPBFTCache(PBFTConfig::Ptr _config,
bcos::protocol::BlockNumber _index,
std::function<void(bcos::protocol::BlockNumber)> _committedIndexNotifier)
{
auto cache = std::make_shared<PBFTCache>(_config, _index);
cache->registerCommittedIndexNotify(_committedIndexNotifier);
return cache;
}
};
} // namespace consensus
} // namespace bcos
| 39,934
|
https://github.com/MaxIakovliev/problemSolving/blob/master/src/test/java/com/problems/test/MinimumNumberOfPlatformsTest.java
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
problemSolving
|
MaxIakovliev
|
Java
|
Code
| 55
| 200
|
package com.problems.test;
import com.problems.MinimumNumberOfPlatforms;
import org.junit.Assert;
import org.junit.Test;
/**
* Created by Maks on 5/3/2017.
*/
public class MinimumNumberOfPlatformsTest implements ISingleTestCase {
@Test
public void solution1TestCase1() {
MinimumNumberOfPlatforms s=new MinimumNumberOfPlatforms();
double arr[]= {2.00, 2.10, 3.00, 3.20, 3.50, 5.00 };
double dep[]= {2.30, 3.40, 3.20, 4.30, 4.00, 5.20 };
int res=s.solution1(arr,dep);
int expected=2;
Assert.assertEquals(expected,res);
}
}
| 16,619
|
https://github.com/shamiul94/Problem-Solving-Online-Judges/blob/master/LeetCode/416. Partition Equal Subset Sum.cpp
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
Problem-Solving-Online-Judges
|
shamiul94
|
C++
|
Code
| 484
| 1,136
|
class Solution
{
public:
void print(vector<int> &nums)
{
for (int i = 0; i < nums.size(); i++)
{
cout << nums[i] << " ";
}
cout << endl;
}
int getSum(vector<int> &nums)
{
int sum = 0;
for (int i = 0; i < nums.size(); i++)
{
sum += nums[i];
}
return sum;
}
int getValue(vector<int> &dp, int i, int len)
{
if (i < 0 || i >= len)
{
return 0;
}
else
{
return dp[i];
}
}
// O(n) space
int solve(vector<int> &nums, int target)
{
vector<int> dp1(target + 1, 0);
int row = nums.size();
// int colm = target+1;
dp1[0] = 1;
for (int i = 1; i <= target; i++)
{
dp1[i] = 0;
}
// print(dp1);
for (int i = 1; i <= row; i++)
{
// cout << "hi " << i << endl;
for (int j = target; j >= 0; j--)
{
dp1[j] = getValue(dp1, j, target + 1) + getValue(dp1, j - nums[i - 1], target + 1);
}
// print(dp2);
}
// print(dp1);
return dp1[target];
// getValue(dp, 0, target + 1);
}
// O(2n) space
int solve1(vector<int> &nums, int target)
{
// vector<vector<int>> dp(nums.size() + 1, vector<int>(target + 1, 0));
vector<int> dp1(target + 1, 0);
vector<int> dp2(target + 1, 0);
int row = nums.size();
// int colm = target+1;
dp1[0] = 1;
for (int i = 1; i <= target; i++)
{
dp1[i] = 0;
}
// print(dp1);
for (int i = 1; i <= row; i++)
{
// cout << "hi " << i << endl;
for (int j = 0; j <= target; j++)
{
// dp2[i] = dp1[i] + dp1[i - nums[i]];
dp2[j] = getValue(dp1, j, target + 1) + getValue(dp1, j - nums[i - 1], target + 1);
}
for (int j = 0; j <= target; j++)
{
dp1[j] = dp2[j];
}
// print(dp2);
}
// print(dp1);
return dp2[target];
// getValue(dp, 0, target + 1);
}
int
findTargetSumWays(vector<int> &nums, int S)
{
int sum = getSum(nums);
// s1 - s2 = S
// s1 + s2 = sum
// so, s1 = (S + sum)/ 2
// and, s2 = sum - s1
/*
You might ask what if the given difference is negative?
lets say, s1-s2 = -3, So, s2-s1=3.
again, say, s1+s2 = 10
So, 2*s2 = (3+10)/2.
So, it doesn't matter actually if it's negative or not because you are either calculating s1 or s2.
*/
// this line is needed because the sum is bound to be within 1000 as specified in the description
// array sum can't be less than the difference of 2 subsets for non-negative integers.
// so, you will get tle if diff = 100000000000000 but sum <= 1000.
if (S > sum)
return 0;
if ((S + sum) % 2 != 0)
{
return 0;
}
int target = (S + sum) / 2;
return solve(nums, target);
}
};
| 50,802
|
https://github.com/bianliu1013/acqChina/blob/master/iAcqChina/NavigationViewController.h
|
Github Open Source
|
Open Source
|
MIT
| null |
acqChina
|
bianliu1013
|
C
|
Code
| 50
| 181
|
//
// NavigationViewController.h
// REMenuExample
//
// Created by Roman Efimov on 4/18/13.
// Copyright (c) 2013 Roman Efimov. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "REMenu.h"
@interface NavigationViewController : UINavigationController
@property (strong, readonly, nonatomic) REMenu *menu;
- (void)toggleMenu;
@end
// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com
| 3,597
|
https://github.com/ansumandas441/Data-Structures-and-Algorithms/blob/master/Java/soln-sliding-window-problems/minimum-operations-to-reduce-x-to-zero.java
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
Data-Structures-and-Algorithms
|
ansumandas441
|
Java
|
Code
| 63
| 285
|
/**
@author Farheen Bano
Reference-
https://leetcode.com/problems/minimum-operations-to-reduce-x-to-zero/
*/
import java.util.*;
import java.lang.*;
import java.io.*;
class Solution {
public int minOperations(int[] nums, int x) {
int total=0;
for(int n:nums)
total+=n;
int diff=total-x;
//since arrays contains only positive integers
if(diff<0)
return -1;
int i=0;
int j=0;
int sum=0;
int maxLen=Integer.MIN_VALUE;
while(j<nums.length){
sum+=nums[j];
while(sum>diff && i<nums.length){
sum-=nums[i];
i++;
}
if(sum==diff)
maxLen=Math.max(maxLen,j-i+1);
j++;
}
return maxLen==Integer.MIN_VALUE?-1:(nums.length-maxLen);
}
}
| 28,224
|
https://github.com/xlm1226/A-Definitive-Guide-to-Apache-ShardingSphere/blob/master/Code_Snippets_Chapter06/Snippet24_Example_Query_Encrytion_Rules_Chapter06.sql
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
A-Definitive-Guide-to-Apache-ShardingSphere
|
xlm1226
|
SQL
|
Code
| 45
| 137
|
show encrypt rules from encrypt_db;
+-----------+--------------+------------------+--------------+----------------+-----------------+
| table | logic_column | cipher_column | plain_column | encryptor_type | encryptor_props |
+-----------+--------------+------------------+--------------+----------------+-----------------+
| t_encrypt | user_name | user_name_cipher | NULL | MD5 | |
| t_encrypt | password | password_cipher | NULL | MD5 | |
+-----------+--------------+------------------+--------------+----------------
| 3,593
|
https://github.com/Jackintoshh/Webmappingtest/blob/master/shops/models.py
|
Github Open Source
|
Open Source
|
MIT
| null |
Webmappingtest
|
Jackintoshh
|
Python
|
Code
| 18
| 75
|
from django.contrib.gis.db import models
class Shop(models.Model):
name = models.CharField(max_length=100)
location = models.PointField()
address = models.CharField(max_length=100)
city = models.CharField(max_length=50)
| 43,746
|
https://github.com/i-gaven/Just_a_dumper/blob/master/all_headers/LINE-8.4.0(越狱应用)_headers/NLPayRegistrationFlow.h
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
Just_a_dumper
|
i-gaven
|
Objective-C
|
Code
| 192
| 954
|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import "NLPayFlow.h"
#import "NLPayAdditionalIdentifyMethodViewControllerDelegate-Protocol.h"
#import "NLPayAdditionalIdentifyViewControllerDelegate-Protocol.h"
#import "NLPayTermsOfUseViewControllerDelegate-Protocol.h"
@class LinePaymentPaymentRegionalInfo, NLPayNavigationController, NSArray, NSDictionary, NSString, _TtC4LINE29NLPayLineCardRegistrationFlow;
@interface NLPayRegistrationFlow : NLPayFlow <NLPayTermsOfUseViewControllerDelegate, NLPayAdditionalIdentifyViewControllerDelegate, NLPayAdditionalIdentifyMethodViewControllerDelegate>
{
_Bool _showInAppBrowser;
NSDictionary *_startInfo;
_TtC4LINE29NLPayLineCardRegistrationFlow *_cardRegistrationFlow;
LinePaymentPaymentRegionalInfo *_regionalInfo;
NSArray *_checkedUrlIDs;
NLPayNavigationController *_modalNavigationController;
NSString *_authToken;
NSString *_deviceIdentifier;
}
@property(retain, nonatomic) NSString *deviceIdentifier; // @synthesize deviceIdentifier=_deviceIdentifier;
@property(retain, nonatomic) NSString *authToken; // @synthesize authToken=_authToken;
@property(retain, nonatomic) NLPayNavigationController *modalNavigationController; // @synthesize modalNavigationController=_modalNavigationController;
@property(nonatomic) _Bool showInAppBrowser; // @synthesize showInAppBrowser=_showInAppBrowser;
@property(retain, nonatomic) NSArray *checkedUrlIDs; // @synthesize checkedUrlIDs=_checkedUrlIDs;
@property(retain, nonatomic) LinePaymentPaymentRegionalInfo *regionalInfo; // @synthesize regionalInfo=_regionalInfo;
@property(retain, nonatomic) _TtC4LINE29NLPayLineCardRegistrationFlow *cardRegistrationFlow; // @synthesize cardRegistrationFlow=_cardRegistrationFlow;
@property(retain, nonatomic) NSDictionary *startInfo; // @synthesize startInfo=_startInfo;
- (void).cxx_destruct;
- (void)carryForwardLinePayAccount;
- (void)moveBalance;
- (void)createAccount;
- (void)flowDidFinish:(id)arg1;
- (void)pushAdditionalIdentifyViewController:(id)arg1;
- (void)additionalIdentifyMethodViewControllerDidCancel:(id)arg1;
- (void)additionalIdentifyMethodViewController:(id)arg1 didSelectMethod:(long long)arg2;
- (void)additionalIdentifyViewControllerDidCancel:(id)arg1;
- (void)additionalIdentifyViewController:(id)arg1 financesRequestToken:(CDUnknownBlockType)arg2;
- (void)additionalIdentifyViewController:(id)arg1 didIdentifyUserWithAuthToken:(id)arg2;
- (void)termsOfUseViewControllerDidFinish:(id)arg1 checkedUrlIDs:(id)arg2;
- (id)viewControllerClassesShouldBeRemovedBeforeShowViewController:(id)arg1;
- (void)payTHRegistrationViewControllerDidTapForeign:(id)arg1;
- (void)payTHRegistrationViewControllerDidTapNextButton:(id)arg1;
- (id)THRegistrationViewController;
- (id)termsOfUseViewController;
- (id)registrationViewController;
- (void)startRegistartion:(_Bool)arg1;
- (void)inAppBrowserWillAppear;
- (void)didFinish;
- (void)start:(_Bool)arg1;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
| 27,332
|
https://github.com/phenix3443/leetcode/blob/master/11-container-with-most-water/solution.py
|
Github Open Source
|
Open Source
|
MIT
| null |
leetcode
|
phenix3443
|
Python
|
Code
| 59
| 372
|
# -*- coding:utf-8; -*-
class Solution:
""" 相向双指针思路:
首先,水的面积area=(r-l)*min(height[l],height[r])
如果是使用同向双指针的话,对于位置l,要把右边所有的元素遍历一遍。整体时间复杂度是O(n^2)。
这是因为这种情况下,r-l是增大的,而且height[r]也是变化的。
如果能将变化条件降低一维,有利于减少时间复杂度。
考虑相向双指针,此时 (r-l)是缩小的,那么只有min(height[l],height[r])中的最小着替换为更大的值,水池面积才能增大。
"""
def maxArea(self, height: List[int]) -> int:
m, l, r = 0, 0, len(height) - 1
while l < r:
area = (r - l) * min(height[l], height[r])
m = max(m, area)
if height[l] < height[r]:
l += 1
else:
r -= 1
return m
| 30,951
|
https://github.com/laylaythwe/larashop/blob/master/resources/views/frontend/layouts/app.blade.php
|
Github Open Source
|
Open Source
|
MIT
| null |
larashop
|
laylaythwe
|
PHP
|
Code
| 846
| 4,242
|
<!--
author: W3layouts
author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE html>
<html>
<head>
<title>@yield('title', app_name())</title>
<!-- for-mobile-apps -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="@yield('meta_description', 'Larashop')">
<meta name="author" content="@yield('meta_author', 'Cho')">
@yield('meta')
<!-- Styles -->
@yield('before-styles')
{{ Html::style('assets/css/bootstrap.css') }}
{{ Html::style('assets/css/style.css') }}
<!-- //for-mobile-apps -->
<!-- <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" /> -->
<!-- font-awesome icons -->
<link href="css/font-awesome.css" rel="stylesheet" type="text/css" media="all" />
<!-- //font-awesome icons -->
<link href='//fonts.googleapis.com/css?family=Ubuntu:400,300,300italic,400italic,500,500italic,700,700italic' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
<!-- Check if the language is set to RTL, so apply the RTL layouts -->
@yield('after-styles')
<!-- Scripts -->
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- js -->
{!! Html::script('assets/js/jquery-1.11.1.min.js') !!}
<!-- start-smoth-scrolling -->
{!! Html::script('assets/js/move-top.js') !!}
{!! Html::script('assets/js/easing.js') !!}
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
});
});
</script>
<script>
window.Laravel = <?php echo json_encode([
'csrfToken' => csrf_token(),
]); ?>
</script>
<!-- //js -->
<!-- start-smoth-scrolling -->
</head>
<body>
<!-- header -->
<div class="agileits_header">
<div class="w3l_offers">
<a href="products.html">Today's special Offers !</a>
</div>
<div class="w3l_search">
<form action="{{url('/products')}}" method="get">
<input type="text" name="q" placeholder="Search a product..." onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Search a product...';}" required="">
<input type="submit" value=" ">
</form>
</div>
<div class="product_list_header">
<form action={{route("frontend.shoppingcart")}} method="get" class="last">
<fieldset>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="display" value="1" />
<input type="submit" name="submit" value="View your cart" class="button" />
</fieldset>
</form>
</div>
<div class="w3l_header_right">
<ul>
<li class="dropdown profile_details_drop">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@if(Auth::check())
{{Auth::user()->name}}
@endif
<i class="fa fa-user" aria-hidden="true"></i><span class="caret"></span></a>
<div class="mega-dropdown-menu">
<div class="w3ls_vegetables">
<ul class="dropdown-menu drp-mnu">
@if(Auth::check())
<li><a href="{{route('frontend.auth.logout')}}">Logout</a></li>
@else
<li><a href="{{route('frontend.auth.login')}}">Login</a></li>
<li><a href="{{route('frontend.auth.register')}}">Sign Up</a></li>
@endif
</ul>
</div>
</div>
</li>
</ul>
</div>
<div class="w3l_header_right1">
<h2><a href="mail.html">Contact Us</a></h2>
</div>
<div class="clearfix"> </div>
</div>
<!-- script-for sticky-nav -->
<script>
$(document).ready(function() {
var navoffeset=$(".agileits_header").offset().top;
$(window).scroll(function(){
var scrollpos=$(window).scrollTop();
if(scrollpos >=navoffeset){
$(".agileits_header").addClass("fixed");
}else{
$(".agileits_header").removeClass("fixed");
}
});
});
</script>
<!-- //script-for sticky-nav -->
<div class="logo_products">
<div class="container">
<div class="w3ls_logo_products_left">
<h1><a href={{route('frontend.index')}}><span>Lara</span> Shop</a></h1>
</div>
<div class="w3ls_logo_products_left1">
<ul class="special_items">
<li><a href="events.html">Events</a><i>/</i></li>
<li><a href="about.html">About Us</a><i>/</i></li>
<li><a href="products.html">Best Deals</a><i>/</i></li>
<li><a href="services.html">Services</a></li>
</ul>
</div>
<div class="w3ls_logo_products_left1">
<ul class="phone_email">
<li><i class="fa fa-phone" aria-hidden="true"></i>(+0123) 234 567</li>
<li><i class="fa fa-envelope-o" aria-hidden="true"></i><a href="mailto:store@grocery.com">store@grocery.com</a></li>
</ul>
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //header -->
<!-- products-breadcrumb -->
<div class="products-breadcrumb">
<div class="container">
<ul>
<li><i class="fa fa-home" aria-hidden="true"></i><a href={{route('frontend.index')}}>Home</a><span>|</span></li>
<li><i class="fa fa-home" aria-hidden="true"></i><a href={{route('frontend.products')}}>Products</a><span>|</span></li>
<li><a href={{route('frontend.faq')}}>FAQ's</a><span>|</span></li>
<li><i class="fa fa-home" aria-hidden="true"></i><a href={{route('frontend.contact')}}>Contact Us</a></li>
</ul>
</div>
</div>
<!-- //products-breadcrumb -->
<!-- banner -->
<div class="banner">
<div class="w3l_banner_nav_left">
<nav class="navbar nav_bottom">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header nav_2">
<button type="button" class="navbar-toggle collapsed navbar-toggle1" data-toggle="collapse" data-target="#bs-megadropdown-tabs">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-megadropdown-tabs">
@include('frontend.includes.category_menu')
</div><!-- /.navbar-collapse -->
</nav>
</div>
<div class="w3l_banner_nav_right">
@include("includes.partials.messages")
@yield('content')
</div>
<div class="clearfix"></div>
</div>
@yield('secondary_content','')
<!-- //banner -->
<!-- newsletter -->
<div class="newsletter">
<div class="container">
<div class="w3agile_newsletter_left">
<h3>sign up for our newsletter</h3>
</div>
<div class="w3agile_newsletter_right">
<form action="#" method="post">
<input type="email" name="Email" value="Email" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email';}" required="">
<input type="submit" value="subscribe now">
</form>
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //newsletter -->
<!-- footer -->
<div class="footer">
<div class="container">
<div class="col-md-3 w3_footer_grid">
<h3>information</h3>
<ul class="w3_footer_grid_list">
<li><a href="events.html">Events</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="products.html">Best Deals</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="short-codes.html">Short Codes</a></li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>policy info</h3>
<ul class="w3_footer_grid_list">
<li><a href="faqs.html">FAQ</a></li>
<li><a href={{route('frontend.products')}}>Products</a></li>
<li><a href="privacy.html">privacy policy</a></li>
<li><a href="privacy.html">terms of use</a></li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>what in stores</h3>
<ul class="w3_footer_grid_list">
<li><a href="pet.html">Pet Food</a></li>
<li><a href="frozen.html">Frozen Snacks</a></li>
<li><a href="kitchen.html">Kitchen</a></li>
<li><a href="products.html">Branded Foods</a></li>
<li><a href="household.html">Households</a></li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>twitter posts</h3>
<ul class="w3_footer_grid_list1">
<li><label class="fa fa-twitter" aria-hidden="true"></label><i>01 day ago</i><span>Non numquam <a href="#">http://sd.ds/13jklf#</a>
eius modi tempora incidunt ut labore et
<a href="#">http://sd.ds/1389kjklf#</a>quo nulla.</span></li>
<li><label class="fa fa-twitter" aria-hidden="true"></label><i>02 day ago</i><span>Con numquam <a href="#">http://fd.uf/56hfg#</a>
eius modi tempora incidunt ut labore et
<a href="#">http://fd.uf/56hfg#</a>quo nulla.</span></li>
</ul>
</div>
<div class="clearfix"> </div>
<div class="agile_footer_grids">
<div class="col-md-3 w3_footer_grid agile_footer_grids_w3_footer">
<div class="w3_footer_grid_bottom">
<h4>100% secure payments</h4>
<img src="images/card.png" alt=" " class="img-responsive" />
</div>
</div>
<div class="col-md-3 w3_footer_grid agile_footer_grids_w3_footer">
<div class="w3_footer_grid_bottom">
<h5>connect with us</h5>
<ul class="agileits_social_icons">
<li><a href="#" class="facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li><a href="#" class="twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
<li><a href="#" class="google"><i class="fa fa-google-plus" aria-hidden="true"></i></a></li>
<li><a href="#" class="instagram"><i class="fa fa-instagram" aria-hidden="true"></i></a></li>
<li><a href="#" class="dribbble"><i class="fa fa-dribbble" aria-hidden="true"></i></a></li>
</ul>
</div>
</div>
<div class="clearfix"> </div>
</div>
<div class="wthree_footer_copy">
<p>© 2016 Grocery Store. All rights reserved | Design by <a href="http://w3layouts.com/">W3layouts</a></p>
</div>
</div>
</div>
<!-- //footer -->
<!-- Bootstrap Core JavaScript -->
<!-- Scripts -->
@yield('before-scripts')
{!! Html::script('assets/js/bootstrap.min.js') !!}
<script>
$(document).ready(function(){
$(".dropdown").hover(
function() {
$('.dropdown-menu', this).stop( true, true ).slideDown("fast");
$(this).toggleClass('open');
},
function() {
$('.dropdown-menu', this).stop( true, true ).slideUp("fast");
$(this).toggleClass('open');
}
);
});
</script>
<!-- here stars scrolling icon -->
<script type="text/javascript">
$(document).ready(function() {
/*
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 1200,
easingType: 'linear'
};
*/
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>
<!-- //here ends scrolling icon -->
<!-- //{!! Html::script('assets/js/minicart.min.js') !!}
<script>
// Mini Cart
paypal.minicart.render({
action: '#'
});
if (~window.location.search.indexOf('reset=true')) {
paypal.minicart.reset();
}
</script> -->
@yield('after-scripts')
</body>
</html>
| 4,313
|
https://github.com/duberDev/eventstore-rpc/blob/master/clients/go/event_store.pb.go
|
Github Open Source
|
Open Source
|
MIT
| 2,017
|
eventstore-rpc
|
duberDev
|
Go
|
Code
| 5,001
| 19,418
|
// Code generated by protoc-gen-go.
// source: event_store.proto
// DO NOT EDIT!
/*
Package eventstore is a generated protocol buffer package.
It is generated from these files:
event_store.proto
It has these top-level messages:
AppendToStreamRequest
AppendToStreamResponse
SubscribeToStreamFromRequest
SubscribeToStreamFromResponse
CreatePersistentSubscriptionRequest
CreatePersistentSubscriptionResponse
UpdatePersistentSubscriptionRequest
UpdatePersistentSubscriptionResponse
DeletePersistentSubscriptionRequest
DeletePersistentSubscriptionResponse
ConnectToPersistentSubscriptionRequest
ConnectToPersistentSubscriptionResponse
EventData
UserCredentials
Position
Error
RecordedEvent
ResolvedEvent
PersistentSubscriptionSettings
*/
package eventstore
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type SubscribeToStreamFromResponse_DropReason int32
const (
SubscribeToStreamFromResponse_UserInitiated SubscribeToStreamFromResponse_DropReason = 0
SubscribeToStreamFromResponse_NotAuthenticated SubscribeToStreamFromResponse_DropReason = 1
SubscribeToStreamFromResponse_AccessDenied SubscribeToStreamFromResponse_DropReason = 2
SubscribeToStreamFromResponse_SubscribingError SubscribeToStreamFromResponse_DropReason = 3
SubscribeToStreamFromResponse_ServerError SubscribeToStreamFromResponse_DropReason = 4
SubscribeToStreamFromResponse_ConnectionClosed SubscribeToStreamFromResponse_DropReason = 5
SubscribeToStreamFromResponse_CatchUpError SubscribeToStreamFromResponse_DropReason = 6
SubscribeToStreamFromResponse_ProcessingQueueOverflow SubscribeToStreamFromResponse_DropReason = 7
SubscribeToStreamFromResponse_EventHandlerException SubscribeToStreamFromResponse_DropReason = 8
SubscribeToStreamFromResponse_MaxSubscribersReached SubscribeToStreamFromResponse_DropReason = 9
SubscribeToStreamFromResponse_PersistentSubscriptionDeleted SubscribeToStreamFromResponse_DropReason = 10
SubscribeToStreamFromResponse_Unknown SubscribeToStreamFromResponse_DropReason = 100
SubscribeToStreamFromResponse_NotFound SubscribeToStreamFromResponse_DropReason = 101
)
var SubscribeToStreamFromResponse_DropReason_name = map[int32]string{
0: "UserInitiated",
1: "NotAuthenticated",
2: "AccessDenied",
3: "SubscribingError",
4: "ServerError",
5: "ConnectionClosed",
6: "CatchUpError",
7: "ProcessingQueueOverflow",
8: "EventHandlerException",
9: "MaxSubscribersReached",
10: "PersistentSubscriptionDeleted",
100: "Unknown",
101: "NotFound",
}
var SubscribeToStreamFromResponse_DropReason_value = map[string]int32{
"UserInitiated": 0,
"NotAuthenticated": 1,
"AccessDenied": 2,
"SubscribingError": 3,
"ServerError": 4,
"ConnectionClosed": 5,
"CatchUpError": 6,
"ProcessingQueueOverflow": 7,
"EventHandlerException": 8,
"MaxSubscribersReached": 9,
"PersistentSubscriptionDeleted": 10,
"Unknown": 100,
"NotFound": 101,
}
func (x SubscribeToStreamFromResponse_DropReason) String() string {
return proto.EnumName(SubscribeToStreamFromResponse_DropReason_name, int32(x))
}
func (SubscribeToStreamFromResponse_DropReason) EnumDescriptor() ([]byte, []int) {
return fileDescriptor0, []int{3, 0}
}
type ConnectToPersistentSubscriptionResponse_DropReason int32
const (
ConnectToPersistentSubscriptionResponse_UserInitiated ConnectToPersistentSubscriptionResponse_DropReason = 0
ConnectToPersistentSubscriptionResponse_NotAuthenticated ConnectToPersistentSubscriptionResponse_DropReason = 1
ConnectToPersistentSubscriptionResponse_AccessDenied ConnectToPersistentSubscriptionResponse_DropReason = 2
ConnectToPersistentSubscriptionResponse_SubscribingError ConnectToPersistentSubscriptionResponse_DropReason = 3
ConnectToPersistentSubscriptionResponse_ServerError ConnectToPersistentSubscriptionResponse_DropReason = 4
ConnectToPersistentSubscriptionResponse_ConnectionClosed ConnectToPersistentSubscriptionResponse_DropReason = 5
ConnectToPersistentSubscriptionResponse_CatchUpError ConnectToPersistentSubscriptionResponse_DropReason = 6
ConnectToPersistentSubscriptionResponse_ProcessingQueueOverflow ConnectToPersistentSubscriptionResponse_DropReason = 7
ConnectToPersistentSubscriptionResponse_EventHandlerException ConnectToPersistentSubscriptionResponse_DropReason = 8
ConnectToPersistentSubscriptionResponse_MaxSubscribersReached ConnectToPersistentSubscriptionResponse_DropReason = 9
ConnectToPersistentSubscriptionResponse_PersistentSubscriptionDeleted ConnectToPersistentSubscriptionResponse_DropReason = 10
ConnectToPersistentSubscriptionResponse_Unknown ConnectToPersistentSubscriptionResponse_DropReason = 100
ConnectToPersistentSubscriptionResponse_NotFound ConnectToPersistentSubscriptionResponse_DropReason = 101
)
var ConnectToPersistentSubscriptionResponse_DropReason_name = map[int32]string{
0: "UserInitiated",
1: "NotAuthenticated",
2: "AccessDenied",
3: "SubscribingError",
4: "ServerError",
5: "ConnectionClosed",
6: "CatchUpError",
7: "ProcessingQueueOverflow",
8: "EventHandlerException",
9: "MaxSubscribersReached",
10: "PersistentSubscriptionDeleted",
100: "Unknown",
101: "NotFound",
}
var ConnectToPersistentSubscriptionResponse_DropReason_value = map[string]int32{
"UserInitiated": 0,
"NotAuthenticated": 1,
"AccessDenied": 2,
"SubscribingError": 3,
"ServerError": 4,
"ConnectionClosed": 5,
"CatchUpError": 6,
"ProcessingQueueOverflow": 7,
"EventHandlerException": 8,
"MaxSubscribersReached": 9,
"PersistentSubscriptionDeleted": 10,
"Unknown": 100,
"NotFound": 101,
}
func (x ConnectToPersistentSubscriptionResponse_DropReason) String() string {
return proto.EnumName(ConnectToPersistentSubscriptionResponse_DropReason_name, int32(x))
}
func (ConnectToPersistentSubscriptionResponse_DropReason) EnumDescriptor() ([]byte, []int) {
return fileDescriptor0, []int{11, 0}
}
type AppendToStreamRequest struct {
StreamId string `protobuf:"bytes,1,opt,name=stream_id,json=streamId" json:"stream_id,omitempty"`
ExpectedVersion int32 `protobuf:"varint,2,opt,name=expected_version,json=expectedVersion" json:"expected_version,omitempty"`
Events []*EventData `protobuf:"bytes,3,rep,name=events" json:"events,omitempty"`
UserCredentials *UserCredentials `protobuf:"bytes,4,opt,name=user_credentials,json=userCredentials" json:"user_credentials,omitempty"`
}
func (m *AppendToStreamRequest) Reset() { *m = AppendToStreamRequest{} }
func (m *AppendToStreamRequest) String() string { return proto.CompactTextString(m) }
func (*AppendToStreamRequest) ProtoMessage() {}
func (*AppendToStreamRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *AppendToStreamRequest) GetStreamId() string {
if m != nil {
return m.StreamId
}
return ""
}
func (m *AppendToStreamRequest) GetExpectedVersion() int32 {
if m != nil {
return m.ExpectedVersion
}
return 0
}
func (m *AppendToStreamRequest) GetEvents() []*EventData {
if m != nil {
return m.Events
}
return nil
}
func (m *AppendToStreamRequest) GetUserCredentials() *UserCredentials {
if m != nil {
return m.UserCredentials
}
return nil
}
type AppendToStreamResponse struct {
NextExpectedVersion int64 `protobuf:"varint,1,opt,name=next_expected_version,json=nextExpectedVersion" json:"next_expected_version,omitempty"`
Position *Position `protobuf:"bytes,2,opt,name=position" json:"position,omitempty"`
Error *Error `protobuf:"bytes,3,opt,name=error" json:"error,omitempty"`
}
func (m *AppendToStreamResponse) Reset() { *m = AppendToStreamResponse{} }
func (m *AppendToStreamResponse) String() string { return proto.CompactTextString(m) }
func (*AppendToStreamResponse) ProtoMessage() {}
func (*AppendToStreamResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *AppendToStreamResponse) GetNextExpectedVersion() int64 {
if m != nil {
return m.NextExpectedVersion
}
return 0
}
func (m *AppendToStreamResponse) GetPosition() *Position {
if m != nil {
return m.Position
}
return nil
}
func (m *AppendToStreamResponse) GetError() *Error {
if m != nil {
return m.Error
}
return nil
}
type SubscribeToStreamFromRequest struct {
StreamId string `protobuf:"bytes,1,opt,name=stream_id,json=streamId" json:"stream_id,omitempty"`
LastCheckpoint int32 `protobuf:"varint,2,opt,name=last_checkpoint,json=lastCheckpoint" json:"last_checkpoint,omitempty"`
UserCredentials *UserCredentials `protobuf:"bytes,3,opt,name=user_credentials,json=userCredentials" json:"user_credentials,omitempty"`
}
func (m *SubscribeToStreamFromRequest) Reset() { *m = SubscribeToStreamFromRequest{} }
func (m *SubscribeToStreamFromRequest) String() string { return proto.CompactTextString(m) }
func (*SubscribeToStreamFromRequest) ProtoMessage() {}
func (*SubscribeToStreamFromRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *SubscribeToStreamFromRequest) GetStreamId() string {
if m != nil {
return m.StreamId
}
return ""
}
func (m *SubscribeToStreamFromRequest) GetLastCheckpoint() int32 {
if m != nil {
return m.LastCheckpoint
}
return 0
}
func (m *SubscribeToStreamFromRequest) GetUserCredentials() *UserCredentials {
if m != nil {
return m.UserCredentials
}
return nil
}
type SubscribeToStreamFromResponse struct {
Event *ResolvedEvent `protobuf:"bytes,1,opt,name=event" json:"event,omitempty"`
DropReason SubscribeToStreamFromResponse_DropReason `protobuf:"varint,2,opt,name=drop_reason,json=dropReason,enum=eventstore.SubscribeToStreamFromResponse_DropReason" json:"drop_reason,omitempty"`
Error *Error `protobuf:"bytes,3,opt,name=error" json:"error,omitempty"`
}
func (m *SubscribeToStreamFromResponse) Reset() { *m = SubscribeToStreamFromResponse{} }
func (m *SubscribeToStreamFromResponse) String() string { return proto.CompactTextString(m) }
func (*SubscribeToStreamFromResponse) ProtoMessage() {}
func (*SubscribeToStreamFromResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *SubscribeToStreamFromResponse) GetEvent() *ResolvedEvent {
if m != nil {
return m.Event
}
return nil
}
func (m *SubscribeToStreamFromResponse) GetDropReason() SubscribeToStreamFromResponse_DropReason {
if m != nil {
return m.DropReason
}
return SubscribeToStreamFromResponse_UserInitiated
}
func (m *SubscribeToStreamFromResponse) GetError() *Error {
if m != nil {
return m.Error
}
return nil
}
type CreatePersistentSubscriptionRequest struct {
Stream string `protobuf:"bytes,1,opt,name=stream" json:"stream,omitempty"`
GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"`
Settings *PersistentSubscriptionSettings `protobuf:"bytes,3,opt,name=settings" json:"settings,omitempty"`
UserCredentials *UserCredentials `protobuf:"bytes,4,opt,name=user_credentials,json=userCredentials" json:"user_credentials,omitempty"`
}
func (m *CreatePersistentSubscriptionRequest) Reset() { *m = CreatePersistentSubscriptionRequest{} }
func (m *CreatePersistentSubscriptionRequest) String() string { return proto.CompactTextString(m) }
func (*CreatePersistentSubscriptionRequest) ProtoMessage() {}
func (*CreatePersistentSubscriptionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{4}
}
func (m *CreatePersistentSubscriptionRequest) GetStream() string {
if m != nil {
return m.Stream
}
return ""
}
func (m *CreatePersistentSubscriptionRequest) GetGroupName() string {
if m != nil {
return m.GroupName
}
return ""
}
func (m *CreatePersistentSubscriptionRequest) GetSettings() *PersistentSubscriptionSettings {
if m != nil {
return m.Settings
}
return nil
}
func (m *CreatePersistentSubscriptionRequest) GetUserCredentials() *UserCredentials {
if m != nil {
return m.UserCredentials
}
return nil
}
type CreatePersistentSubscriptionResponse struct {
}
func (m *CreatePersistentSubscriptionResponse) Reset() { *m = CreatePersistentSubscriptionResponse{} }
func (m *CreatePersistentSubscriptionResponse) String() string { return proto.CompactTextString(m) }
func (*CreatePersistentSubscriptionResponse) ProtoMessage() {}
func (*CreatePersistentSubscriptionResponse) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{5}
}
type UpdatePersistentSubscriptionRequest struct {
Stream string `protobuf:"bytes,1,opt,name=stream" json:"stream,omitempty"`
GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"`
Settings *PersistentSubscriptionSettings `protobuf:"bytes,3,opt,name=settings" json:"settings,omitempty"`
UserCredentials *UserCredentials `protobuf:"bytes,4,opt,name=user_credentials,json=userCredentials" json:"user_credentials,omitempty"`
}
func (m *UpdatePersistentSubscriptionRequest) Reset() { *m = UpdatePersistentSubscriptionRequest{} }
func (m *UpdatePersistentSubscriptionRequest) String() string { return proto.CompactTextString(m) }
func (*UpdatePersistentSubscriptionRequest) ProtoMessage() {}
func (*UpdatePersistentSubscriptionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{6}
}
func (m *UpdatePersistentSubscriptionRequest) GetStream() string {
if m != nil {
return m.Stream
}
return ""
}
func (m *UpdatePersistentSubscriptionRequest) GetGroupName() string {
if m != nil {
return m.GroupName
}
return ""
}
func (m *UpdatePersistentSubscriptionRequest) GetSettings() *PersistentSubscriptionSettings {
if m != nil {
return m.Settings
}
return nil
}
func (m *UpdatePersistentSubscriptionRequest) GetUserCredentials() *UserCredentials {
if m != nil {
return m.UserCredentials
}
return nil
}
type UpdatePersistentSubscriptionResponse struct {
}
func (m *UpdatePersistentSubscriptionResponse) Reset() { *m = UpdatePersistentSubscriptionResponse{} }
func (m *UpdatePersistentSubscriptionResponse) String() string { return proto.CompactTextString(m) }
func (*UpdatePersistentSubscriptionResponse) ProtoMessage() {}
func (*UpdatePersistentSubscriptionResponse) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{7}
}
type DeletePersistentSubscriptionRequest struct {
Stream string `protobuf:"bytes,1,opt,name=stream" json:"stream,omitempty"`
GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"`
UserCredentials *UserCredentials `protobuf:"bytes,3,opt,name=user_credentials,json=userCredentials" json:"user_credentials,omitempty"`
}
func (m *DeletePersistentSubscriptionRequest) Reset() { *m = DeletePersistentSubscriptionRequest{} }
func (m *DeletePersistentSubscriptionRequest) String() string { return proto.CompactTextString(m) }
func (*DeletePersistentSubscriptionRequest) ProtoMessage() {}
func (*DeletePersistentSubscriptionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{8}
}
func (m *DeletePersistentSubscriptionRequest) GetStream() string {
if m != nil {
return m.Stream
}
return ""
}
func (m *DeletePersistentSubscriptionRequest) GetGroupName() string {
if m != nil {
return m.GroupName
}
return ""
}
func (m *DeletePersistentSubscriptionRequest) GetUserCredentials() *UserCredentials {
if m != nil {
return m.UserCredentials
}
return nil
}
type DeletePersistentSubscriptionResponse struct {
}
func (m *DeletePersistentSubscriptionResponse) Reset() { *m = DeletePersistentSubscriptionResponse{} }
func (m *DeletePersistentSubscriptionResponse) String() string { return proto.CompactTextString(m) }
func (*DeletePersistentSubscriptionResponse) ProtoMessage() {}
func (*DeletePersistentSubscriptionResponse) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{9}
}
type ConnectToPersistentSubscriptionRequest struct {
Stream string `protobuf:"bytes,1,opt,name=stream" json:"stream,omitempty"`
GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"`
UserCredentials *UserCredentials `protobuf:"bytes,3,opt,name=user_credentials,json=userCredentials" json:"user_credentials,omitempty"`
BufferSize int32 `protobuf:"varint,4,opt,name=bufferSize" json:"bufferSize,omitempty"`
AutoAck bool `protobuf:"varint,5,opt,name=autoAck" json:"autoAck,omitempty"`
}
func (m *ConnectToPersistentSubscriptionRequest) Reset() {
*m = ConnectToPersistentSubscriptionRequest{}
}
func (m *ConnectToPersistentSubscriptionRequest) String() string { return proto.CompactTextString(m) }
func (*ConnectToPersistentSubscriptionRequest) ProtoMessage() {}
func (*ConnectToPersistentSubscriptionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{10}
}
func (m *ConnectToPersistentSubscriptionRequest) GetStream() string {
if m != nil {
return m.Stream
}
return ""
}
func (m *ConnectToPersistentSubscriptionRequest) GetGroupName() string {
if m != nil {
return m.GroupName
}
return ""
}
func (m *ConnectToPersistentSubscriptionRequest) GetUserCredentials() *UserCredentials {
if m != nil {
return m.UserCredentials
}
return nil
}
func (m *ConnectToPersistentSubscriptionRequest) GetBufferSize() int32 {
if m != nil {
return m.BufferSize
}
return 0
}
func (m *ConnectToPersistentSubscriptionRequest) GetAutoAck() bool {
if m != nil {
return m.AutoAck
}
return false
}
type ConnectToPersistentSubscriptionResponse struct {
Event *ResolvedEvent `protobuf:"bytes,1,opt,name=event" json:"event,omitempty"`
DropReason ConnectToPersistentSubscriptionResponse_DropReason `protobuf:"varint,2,opt,name=drop_reason,json=dropReason,enum=eventstore.ConnectToPersistentSubscriptionResponse_DropReason" json:"drop_reason,omitempty"`
Error *Error `protobuf:"bytes,3,opt,name=error" json:"error,omitempty"`
}
func (m *ConnectToPersistentSubscriptionResponse) Reset() {
*m = ConnectToPersistentSubscriptionResponse{}
}
func (m *ConnectToPersistentSubscriptionResponse) String() string { return proto.CompactTextString(m) }
func (*ConnectToPersistentSubscriptionResponse) ProtoMessage() {}
func (*ConnectToPersistentSubscriptionResponse) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{11}
}
func (m *ConnectToPersistentSubscriptionResponse) GetEvent() *ResolvedEvent {
if m != nil {
return m.Event
}
return nil
}
func (m *ConnectToPersistentSubscriptionResponse) GetDropReason() ConnectToPersistentSubscriptionResponse_DropReason {
if m != nil {
return m.DropReason
}
return ConnectToPersistentSubscriptionResponse_UserInitiated
}
func (m *ConnectToPersistentSubscriptionResponse) GetError() *Error {
if m != nil {
return m.Error
}
return nil
}
type EventData struct {
EventId []byte `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
EventType string `protobuf:"bytes,2,opt,name=event_type,json=eventType" json:"event_type,omitempty"`
IsJson bool `protobuf:"varint,3,opt,name=is_json,json=isJson" json:"is_json,omitempty"`
Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
}
func (m *EventData) Reset() { *m = EventData{} }
func (m *EventData) String() string { return proto.CompactTextString(m) }
func (*EventData) ProtoMessage() {}
func (*EventData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }
func (m *EventData) GetEventId() []byte {
if m != nil {
return m.EventId
}
return nil
}
func (m *EventData) GetEventType() string {
if m != nil {
return m.EventType
}
return ""
}
func (m *EventData) GetIsJson() bool {
if m != nil {
return m.IsJson
}
return false
}
func (m *EventData) GetData() []byte {
if m != nil {
return m.Data
}
return nil
}
func (m *EventData) GetMetadata() []byte {
if m != nil {
return m.Metadata
}
return nil
}
type UserCredentials struct {
Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
}
func (m *UserCredentials) Reset() { *m = UserCredentials{} }
func (m *UserCredentials) String() string { return proto.CompactTextString(m) }
func (*UserCredentials) ProtoMessage() {}
func (*UserCredentials) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} }
func (m *UserCredentials) GetUsername() string {
if m != nil {
return m.Username
}
return ""
}
func (m *UserCredentials) GetPassword() string {
if m != nil {
return m.Password
}
return ""
}
type Position struct {
CommitPosition int64 `protobuf:"varint,1,opt,name=commit_position,json=commitPosition" json:"commit_position,omitempty"`
PreparePosition int64 `protobuf:"varint,2,opt,name=prepare_position,json=preparePosition" json:"prepare_position,omitempty"`
}
func (m *Position) Reset() { *m = Position{} }
func (m *Position) String() string { return proto.CompactTextString(m) }
func (*Position) ProtoMessage() {}
func (*Position) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} }
func (m *Position) GetCommitPosition() int64 {
if m != nil {
return m.CommitPosition
}
return 0
}
func (m *Position) GetPreparePosition() int64 {
if m != nil {
return m.PreparePosition
}
return 0
}
type Error struct {
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
Text string `protobuf:"bytes,2,opt,name=text" json:"text,omitempty"`
}
func (m *Error) Reset() { *m = Error{} }
func (m *Error) String() string { return proto.CompactTextString(m) }
func (*Error) ProtoMessage() {}
func (*Error) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} }
func (m *Error) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (m *Error) GetText() string {
if m != nil {
return m.Text
}
return ""
}
type RecordedEvent struct {
EventStreamId string `protobuf:"bytes,1,opt,name=event_stream_id,json=eventStreamId" json:"event_stream_id,omitempty"`
EventId []byte `protobuf:"bytes,2,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
EventNumber int64 `protobuf:"varint,3,opt,name=event_number,json=eventNumber" json:"event_number,omitempty"`
EventType string `protobuf:"bytes,4,opt,name=event_type,json=eventType" json:"event_type,omitempty"`
Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
Metadata []byte `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
IsJson bool `protobuf:"varint,7,opt,name=is_json,json=isJson" json:"is_json,omitempty"`
Created int64 `protobuf:"varint,8,opt,name=created" json:"created,omitempty"`
CreatedEpoch int64 `protobuf:"varint,9,opt,name=created_epoch,json=createdEpoch" json:"created_epoch,omitempty"`
}
func (m *RecordedEvent) Reset() { *m = RecordedEvent{} }
func (m *RecordedEvent) String() string { return proto.CompactTextString(m) }
func (*RecordedEvent) ProtoMessage() {}
func (*RecordedEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} }
func (m *RecordedEvent) GetEventStreamId() string {
if m != nil {
return m.EventStreamId
}
return ""
}
func (m *RecordedEvent) GetEventId() []byte {
if m != nil {
return m.EventId
}
return nil
}
func (m *RecordedEvent) GetEventNumber() int64 {
if m != nil {
return m.EventNumber
}
return 0
}
func (m *RecordedEvent) GetEventType() string {
if m != nil {
return m.EventType
}
return ""
}
func (m *RecordedEvent) GetData() []byte {
if m != nil {
return m.Data
}
return nil
}
func (m *RecordedEvent) GetMetadata() []byte {
if m != nil {
return m.Metadata
}
return nil
}
func (m *RecordedEvent) GetIsJson() bool {
if m != nil {
return m.IsJson
}
return false
}
func (m *RecordedEvent) GetCreated() int64 {
if m != nil {
return m.Created
}
return 0
}
func (m *RecordedEvent) GetCreatedEpoch() int64 {
if m != nil {
return m.CreatedEpoch
}
return 0
}
type ResolvedEvent struct {
Event *RecordedEvent `protobuf:"bytes,1,opt,name=event" json:"event,omitempty"`
Position *Position `protobuf:"bytes,2,opt,name=position" json:"position,omitempty"`
}
func (m *ResolvedEvent) Reset() { *m = ResolvedEvent{} }
func (m *ResolvedEvent) String() string { return proto.CompactTextString(m) }
func (*ResolvedEvent) ProtoMessage() {}
func (*ResolvedEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} }
func (m *ResolvedEvent) GetEvent() *RecordedEvent {
if m != nil {
return m.Event
}
return nil
}
func (m *ResolvedEvent) GetPosition() *Position {
if m != nil {
return m.Position
}
return nil
}
type PersistentSubscriptionSettings struct {
ResolveLinkTos bool `protobuf:"varint,1,opt,name=resolve_link_tos,json=resolveLinkTos" json:"resolve_link_tos,omitempty"`
StartFrom int64 `protobuf:"varint,2,opt,name=start_from,json=startFrom" json:"start_from,omitempty"`
ExtraStatistics bool `protobuf:"varint,3,opt,name=extra_statistics,json=extraStatistics" json:"extra_statistics,omitempty"`
MessageTimeout float64 `protobuf:"fixed64,4,opt,name=message_timeout,json=messageTimeout" json:"message_timeout,omitempty"`
MaxRetryCount int32 `protobuf:"varint,5,opt,name=max_retry_count,json=maxRetryCount" json:"max_retry_count,omitempty"`
LiveBufferSize int32 `protobuf:"varint,6,opt,name=live_buffer_size,json=liveBufferSize" json:"live_buffer_size,omitempty"`
ReadBatchSize int32 `protobuf:"varint,7,opt,name=read_batch_size,json=readBatchSize" json:"read_batch_size,omitempty"`
HistoryBufferSize int32 `protobuf:"varint,8,opt,name=history_buffer_size,json=historyBufferSize" json:"history_buffer_size,omitempty"`
CheckPointAfter float64 `protobuf:"fixed64,9,opt,name=check_point_after,json=checkPointAfter" json:"check_point_after,omitempty"`
MinCheckPointCount int32 `protobuf:"varint,10,opt,name=min_check_point_count,json=minCheckPointCount" json:"min_check_point_count,omitempty"`
MaxCheckPointCount int32 `protobuf:"varint,11,opt,name=max_check_point_count,json=maxCheckPointCount" json:"max_check_point_count,omitempty"`
MaxSubscriberCount int32 `protobuf:"varint,12,opt,name=max_subscriber_count,json=maxSubscriberCount" json:"max_subscriber_count,omitempty"`
NamedConsumerStrategy string `protobuf:"bytes,13,opt,name=named_consumer_strategy,json=namedConsumerStrategy" json:"named_consumer_strategy,omitempty"`
}
func (m *PersistentSubscriptionSettings) Reset() { *m = PersistentSubscriptionSettings{} }
func (m *PersistentSubscriptionSettings) String() string { return proto.CompactTextString(m) }
func (*PersistentSubscriptionSettings) ProtoMessage() {}
func (*PersistentSubscriptionSettings) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} }
func (m *PersistentSubscriptionSettings) GetResolveLinkTos() bool {
if m != nil {
return m.ResolveLinkTos
}
return false
}
func (m *PersistentSubscriptionSettings) GetStartFrom() int64 {
if m != nil {
return m.StartFrom
}
return 0
}
func (m *PersistentSubscriptionSettings) GetExtraStatistics() bool {
if m != nil {
return m.ExtraStatistics
}
return false
}
func (m *PersistentSubscriptionSettings) GetMessageTimeout() float64 {
if m != nil {
return m.MessageTimeout
}
return 0
}
func (m *PersistentSubscriptionSettings) GetMaxRetryCount() int32 {
if m != nil {
return m.MaxRetryCount
}
return 0
}
func (m *PersistentSubscriptionSettings) GetLiveBufferSize() int32 {
if m != nil {
return m.LiveBufferSize
}
return 0
}
func (m *PersistentSubscriptionSettings) GetReadBatchSize() int32 {
if m != nil {
return m.ReadBatchSize
}
return 0
}
func (m *PersistentSubscriptionSettings) GetHistoryBufferSize() int32 {
if m != nil {
return m.HistoryBufferSize
}
return 0
}
func (m *PersistentSubscriptionSettings) GetCheckPointAfter() float64 {
if m != nil {
return m.CheckPointAfter
}
return 0
}
func (m *PersistentSubscriptionSettings) GetMinCheckPointCount() int32 {
if m != nil {
return m.MinCheckPointCount
}
return 0
}
func (m *PersistentSubscriptionSettings) GetMaxCheckPointCount() int32 {
if m != nil {
return m.MaxCheckPointCount
}
return 0
}
func (m *PersistentSubscriptionSettings) GetMaxSubscriberCount() int32 {
if m != nil {
return m.MaxSubscriberCount
}
return 0
}
func (m *PersistentSubscriptionSettings) GetNamedConsumerStrategy() string {
if m != nil {
return m.NamedConsumerStrategy
}
return ""
}
func init() {
proto.RegisterType((*AppendToStreamRequest)(nil), "eventstore.AppendToStreamRequest")
proto.RegisterType((*AppendToStreamResponse)(nil), "eventstore.AppendToStreamResponse")
proto.RegisterType((*SubscribeToStreamFromRequest)(nil), "eventstore.SubscribeToStreamFromRequest")
proto.RegisterType((*SubscribeToStreamFromResponse)(nil), "eventstore.SubscribeToStreamFromResponse")
proto.RegisterType((*CreatePersistentSubscriptionRequest)(nil), "eventstore.CreatePersistentSubscriptionRequest")
proto.RegisterType((*CreatePersistentSubscriptionResponse)(nil), "eventstore.CreatePersistentSubscriptionResponse")
proto.RegisterType((*UpdatePersistentSubscriptionRequest)(nil), "eventstore.UpdatePersistentSubscriptionRequest")
proto.RegisterType((*UpdatePersistentSubscriptionResponse)(nil), "eventstore.UpdatePersistentSubscriptionResponse")
proto.RegisterType((*DeletePersistentSubscriptionRequest)(nil), "eventstore.DeletePersistentSubscriptionRequest")
proto.RegisterType((*DeletePersistentSubscriptionResponse)(nil), "eventstore.DeletePersistentSubscriptionResponse")
proto.RegisterType((*ConnectToPersistentSubscriptionRequest)(nil), "eventstore.ConnectToPersistentSubscriptionRequest")
proto.RegisterType((*ConnectToPersistentSubscriptionResponse)(nil), "eventstore.ConnectToPersistentSubscriptionResponse")
proto.RegisterType((*EventData)(nil), "eventstore.EventData")
proto.RegisterType((*UserCredentials)(nil), "eventstore.UserCredentials")
proto.RegisterType((*Position)(nil), "eventstore.Position")
proto.RegisterType((*Error)(nil), "eventstore.Error")
proto.RegisterType((*RecordedEvent)(nil), "eventstore.RecordedEvent")
proto.RegisterType((*ResolvedEvent)(nil), "eventstore.ResolvedEvent")
proto.RegisterType((*PersistentSubscriptionSettings)(nil), "eventstore.PersistentSubscriptionSettings")
proto.RegisterEnum("eventstore.SubscribeToStreamFromResponse_DropReason", SubscribeToStreamFromResponse_DropReason_name, SubscribeToStreamFromResponse_DropReason_value)
proto.RegisterEnum("eventstore.ConnectToPersistentSubscriptionResponse_DropReason", ConnectToPersistentSubscriptionResponse_DropReason_name, ConnectToPersistentSubscriptionResponse_DropReason_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for EventStore service
type EventStoreClient interface {
AppendToStream(ctx context.Context, in *AppendToStreamRequest, opts ...grpc.CallOption) (*AppendToStreamResponse, error)
SubscribeToStreamFrom(ctx context.Context, opts ...grpc.CallOption) (EventStore_SubscribeToStreamFromClient, error)
CreatePersistentSubscription(ctx context.Context, in *CreatePersistentSubscriptionRequest, opts ...grpc.CallOption) (*CreatePersistentSubscriptionResponse, error)
UpdatePersistentSubscription(ctx context.Context, in *UpdatePersistentSubscriptionRequest, opts ...grpc.CallOption) (*UpdatePersistentSubscriptionResponse, error)
DeletePersistentSubscription(ctx context.Context, in *DeletePersistentSubscriptionRequest, opts ...grpc.CallOption) (*DeletePersistentSubscriptionResponse, error)
ConnectToPersistentSubscription(ctx context.Context, opts ...grpc.CallOption) (EventStore_ConnectToPersistentSubscriptionClient, error)
}
type eventStoreClient struct {
cc *grpc.ClientConn
}
func NewEventStoreClient(cc *grpc.ClientConn) EventStoreClient {
return &eventStoreClient{cc}
}
func (c *eventStoreClient) AppendToStream(ctx context.Context, in *AppendToStreamRequest, opts ...grpc.CallOption) (*AppendToStreamResponse, error) {
out := new(AppendToStreamResponse)
err := grpc.Invoke(ctx, "/eventstore.EventStore/AppendToStream", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eventStoreClient) SubscribeToStreamFrom(ctx context.Context, opts ...grpc.CallOption) (EventStore_SubscribeToStreamFromClient, error) {
stream, err := grpc.NewClientStream(ctx, &_EventStore_serviceDesc.Streams[0], c.cc, "/eventstore.EventStore/SubscribeToStreamFrom", opts...)
if err != nil {
return nil, err
}
x := &eventStoreSubscribeToStreamFromClient{stream}
return x, nil
}
type EventStore_SubscribeToStreamFromClient interface {
Send(*SubscribeToStreamFromRequest) error
Recv() (*SubscribeToStreamFromResponse, error)
grpc.ClientStream
}
type eventStoreSubscribeToStreamFromClient struct {
grpc.ClientStream
}
func (x *eventStoreSubscribeToStreamFromClient) Send(m *SubscribeToStreamFromRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *eventStoreSubscribeToStreamFromClient) Recv() (*SubscribeToStreamFromResponse, error) {
m := new(SubscribeToStreamFromResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *eventStoreClient) CreatePersistentSubscription(ctx context.Context, in *CreatePersistentSubscriptionRequest, opts ...grpc.CallOption) (*CreatePersistentSubscriptionResponse, error) {
out := new(CreatePersistentSubscriptionResponse)
err := grpc.Invoke(ctx, "/eventstore.EventStore/CreatePersistentSubscription", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eventStoreClient) UpdatePersistentSubscription(ctx context.Context, in *UpdatePersistentSubscriptionRequest, opts ...grpc.CallOption) (*UpdatePersistentSubscriptionResponse, error) {
out := new(UpdatePersistentSubscriptionResponse)
err := grpc.Invoke(ctx, "/eventstore.EventStore/UpdatePersistentSubscription", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eventStoreClient) DeletePersistentSubscription(ctx context.Context, in *DeletePersistentSubscriptionRequest, opts ...grpc.CallOption) (*DeletePersistentSubscriptionResponse, error) {
out := new(DeletePersistentSubscriptionResponse)
err := grpc.Invoke(ctx, "/eventstore.EventStore/DeletePersistentSubscription", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eventStoreClient) ConnectToPersistentSubscription(ctx context.Context, opts ...grpc.CallOption) (EventStore_ConnectToPersistentSubscriptionClient, error) {
stream, err := grpc.NewClientStream(ctx, &_EventStore_serviceDesc.Streams[1], c.cc, "/eventstore.EventStore/ConnectToPersistentSubscription", opts...)
if err != nil {
return nil, err
}
x := &eventStoreConnectToPersistentSubscriptionClient{stream}
return x, nil
}
type EventStore_ConnectToPersistentSubscriptionClient interface {
Send(*ConnectToPersistentSubscriptionRequest) error
Recv() (*ConnectToPersistentSubscriptionResponse, error)
grpc.ClientStream
}
type eventStoreConnectToPersistentSubscriptionClient struct {
grpc.ClientStream
}
func (x *eventStoreConnectToPersistentSubscriptionClient) Send(m *ConnectToPersistentSubscriptionRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *eventStoreConnectToPersistentSubscriptionClient) Recv() (*ConnectToPersistentSubscriptionResponse, error) {
m := new(ConnectToPersistentSubscriptionResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for EventStore service
type EventStoreServer interface {
AppendToStream(context.Context, *AppendToStreamRequest) (*AppendToStreamResponse, error)
SubscribeToStreamFrom(EventStore_SubscribeToStreamFromServer) error
CreatePersistentSubscription(context.Context, *CreatePersistentSubscriptionRequest) (*CreatePersistentSubscriptionResponse, error)
UpdatePersistentSubscription(context.Context, *UpdatePersistentSubscriptionRequest) (*UpdatePersistentSubscriptionResponse, error)
DeletePersistentSubscription(context.Context, *DeletePersistentSubscriptionRequest) (*DeletePersistentSubscriptionResponse, error)
ConnectToPersistentSubscription(EventStore_ConnectToPersistentSubscriptionServer) error
}
func RegisterEventStoreServer(s *grpc.Server, srv EventStoreServer) {
s.RegisterService(&_EventStore_serviceDesc, srv)
}
func _EventStore_AppendToStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AppendToStreamRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EventStoreServer).AppendToStream(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/eventstore.EventStore/AppendToStream",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EventStoreServer).AppendToStream(ctx, req.(*AppendToStreamRequest))
}
return interceptor(ctx, in, info, handler)
}
func _EventStore_SubscribeToStreamFrom_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(EventStoreServer).SubscribeToStreamFrom(&eventStoreSubscribeToStreamFromServer{stream})
}
type EventStore_SubscribeToStreamFromServer interface {
Send(*SubscribeToStreamFromResponse) error
Recv() (*SubscribeToStreamFromRequest, error)
grpc.ServerStream
}
type eventStoreSubscribeToStreamFromServer struct {
grpc.ServerStream
}
func (x *eventStoreSubscribeToStreamFromServer) Send(m *SubscribeToStreamFromResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *eventStoreSubscribeToStreamFromServer) Recv() (*SubscribeToStreamFromRequest, error) {
m := new(SubscribeToStreamFromRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _EventStore_CreatePersistentSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreatePersistentSubscriptionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EventStoreServer).CreatePersistentSubscription(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/eventstore.EventStore/CreatePersistentSubscription",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EventStoreServer).CreatePersistentSubscription(ctx, req.(*CreatePersistentSubscriptionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _EventStore_UpdatePersistentSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdatePersistentSubscriptionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EventStoreServer).UpdatePersistentSubscription(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/eventstore.EventStore/UpdatePersistentSubscription",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EventStoreServer).UpdatePersistentSubscription(ctx, req.(*UpdatePersistentSubscriptionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _EventStore_DeletePersistentSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePersistentSubscriptionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EventStoreServer).DeletePersistentSubscription(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/eventstore.EventStore/DeletePersistentSubscription",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EventStoreServer).DeletePersistentSubscription(ctx, req.(*DeletePersistentSubscriptionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _EventStore_ConnectToPersistentSubscription_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(EventStoreServer).ConnectToPersistentSubscription(&eventStoreConnectToPersistentSubscriptionServer{stream})
}
type EventStore_ConnectToPersistentSubscriptionServer interface {
Send(*ConnectToPersistentSubscriptionResponse) error
Recv() (*ConnectToPersistentSubscriptionRequest, error)
grpc.ServerStream
}
type eventStoreConnectToPersistentSubscriptionServer struct {
grpc.ServerStream
}
func (x *eventStoreConnectToPersistentSubscriptionServer) Send(m *ConnectToPersistentSubscriptionResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *eventStoreConnectToPersistentSubscriptionServer) Recv() (*ConnectToPersistentSubscriptionRequest, error) {
m := new(ConnectToPersistentSubscriptionRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _EventStore_serviceDesc = grpc.ServiceDesc{
ServiceName: "eventstore.EventStore",
HandlerType: (*EventStoreServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "AppendToStream",
Handler: _EventStore_AppendToStream_Handler,
},
{
MethodName: "CreatePersistentSubscription",
Handler: _EventStore_CreatePersistentSubscription_Handler,
},
{
MethodName: "UpdatePersistentSubscription",
Handler: _EventStore_UpdatePersistentSubscription_Handler,
},
{
MethodName: "DeletePersistentSubscription",
Handler: _EventStore_DeletePersistentSubscription_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "SubscribeToStreamFrom",
Handler: _EventStore_SubscribeToStreamFrom_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "ConnectToPersistentSubscription",
Handler: _EventStore_ConnectToPersistentSubscription_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "event_store.proto",
}
func init() { proto.RegisterFile("event_store.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 1477 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x5d, 0x6f, 0x1b, 0x45,
0x17, 0xce, 0xda, 0xf1, 0xd7, 0x71, 0x12, 0x3b, 0xd3, 0xa6, 0x75, 0x3f, 0xdf, 0xd4, 0xad, 0x52,
0xb7, 0xd2, 0x9b, 0xe6, 0x75, 0x5f, 0x21, 0x71, 0x83, 0x94, 0x38, 0x09, 0x04, 0x41, 0x30, 0xeb,
0x04, 0x89, 0x1b, 0x56, 0x93, 0xdd, 0x93, 0x64, 0x89, 0xbd, 0xb3, 0xcc, 0x8c, 0x53, 0x87, 0x2b,
0x24, 0xee, 0x2b, 0x7e, 0x00, 0x57, 0x70, 0x51, 0x09, 0xf1, 0x7b, 0xb8, 0x46, 0xe2, 0x92, 0x7f,
0xc0, 0x15, 0x9a, 0x0f, 0xaf, 0xbd, 0x21, 0x75, 0xdc, 0xaa, 0x20, 0x24, 0xb8, 0xdb, 0x79, 0xce,
0x39, 0x33, 0xe7, 0x6b, 0x8e, 0x9f, 0x31, 0x2c, 0xe2, 0x29, 0x46, 0xd2, 0x13, 0x92, 0x71, 0x5c,
0x8d, 0x39, 0x93, 0x8c, 0x80, 0x86, 0x34, 0x52, 0xff, 0xc9, 0x81, 0xa5, 0xf5, 0x38, 0xc6, 0x28,
0xd8, 0x63, 0x1d, 0xc9, 0x91, 0xf6, 0x5c, 0xfc, 0xa2, 0x8f, 0x42, 0x92, 0x5b, 0x50, 0x12, 0x1a,
0xf0, 0xc2, 0xa0, 0xe6, 0x2c, 0x3b, 0x8d, 0x92, 0x5b, 0x34, 0xc0, 0x4e, 0x40, 0x1e, 0x41, 0x15,
0x07, 0x31, 0xfa, 0x12, 0x03, 0xef, 0x14, 0xb9, 0x08, 0x59, 0x54, 0xcb, 0x2c, 0x3b, 0x8d, 0x9c,
0x5b, 0x19, 0xe2, 0x9f, 0x18, 0x98, 0xfc, 0x17, 0xf2, 0xe6, 0xbc, 0x5a, 0x76, 0x39, 0xdb, 0x28,
0x37, 0x97, 0x56, 0x47, 0xc7, 0xaf, 0x6e, 0xa9, 0xcf, 0x4d, 0x2a, 0xa9, 0x6b, 0x95, 0xc8, 0x36,
0x54, 0xfb, 0x02, 0xb9, 0xe7, 0x73, 0x0c, 0x30, 0x92, 0x21, 0xed, 0x8a, 0xda, 0xec, 0xb2, 0xd3,
0x28, 0x37, 0x6f, 0x8d, 0x1b, 0xee, 0x0b, 0xe4, 0xad, 0x91, 0x8a, 0x5b, 0xe9, 0xa7, 0x81, 0xfa,
0x0b, 0x07, 0xae, 0x9d, 0x0f, 0x4c, 0xc4, 0x2c, 0x12, 0x48, 0x9a, 0xb0, 0x14, 0xe1, 0x40, 0x7a,
0x7f, 0x88, 0x40, 0x45, 0x99, 0x75, 0xaf, 0x28, 0xe1, 0xd6, 0xb9, 0x28, 0xd6, 0xa0, 0x18, 0x33,
0x11, 0xca, 0x61, 0xa0, 0xe5, 0xe6, 0xd5, 0x71, 0x77, 0xda, 0x56, 0xe6, 0x26, 0x5a, 0xe4, 0x21,
0xe4, 0x90, 0x73, 0xc6, 0x6b, 0x59, 0xad, 0xbe, 0x98, 0x0a, 0x5b, 0x09, 0x5c, 0x23, 0xaf, 0xff,
0xe8, 0xc0, 0xed, 0x4e, 0xff, 0x40, 0xf8, 0x3c, 0x3c, 0xc0, 0xa1, 0xb3, 0xdb, 0x9c, 0x4d, 0x57,
0x89, 0x87, 0x50, 0xe9, 0x52, 0x21, 0x3d, 0xff, 0x18, 0xfd, 0x93, 0x98, 0x85, 0x91, 0xb4, 0x85,
0x58, 0x50, 0x70, 0x2b, 0x41, 0x2f, 0x4c, 0x6c, 0xf6, 0x35, 0x12, 0xfb, 0x5b, 0x16, 0xee, 0xbc,
0xc4, 0x5d, 0x9b, 0xdf, 0x27, 0x90, 0xd3, 0x1b, 0x6a, 0x5f, 0xcb, 0xcd, 0x1b, 0xe3, 0xdb, 0xbb,
0x28, 0x58, 0xf7, 0x14, 0x03, 0x5d, 0x78, 0xd7, 0xe8, 0x91, 0x7d, 0x28, 0x07, 0x9c, 0xc5, 0x1e,
0x47, 0x2a, 0x6c, 0x7e, 0x17, 0x9a, 0xff, 0x1f, 0x37, 0x9b, 0x78, 0xe0, 0xea, 0x26, 0x67, 0xb1,
0xab, 0x6d, 0x5d, 0x08, 0x92, 0xef, 0xe9, 0x2b, 0xf0, 0x22, 0x03, 0x30, 0xda, 0x83, 0x2c, 0xc2,
0xbc, 0xca, 0xc2, 0x4e, 0x14, 0xca, 0x90, 0x4a, 0x0c, 0xaa, 0x33, 0xe4, 0x2a, 0x54, 0x77, 0x99,
0x5c, 0xef, 0xcb, 0x63, 0x95, 0x06, 0x5f, 0xa3, 0x0e, 0xa9, 0xc2, 0xdc, 0xba, 0xef, 0xa3, 0x10,
0x9b, 0x18, 0x85, 0x18, 0x54, 0x33, 0x4a, 0x6f, 0xe8, 0x6a, 0x18, 0x1d, 0xe9, 0x43, 0xaa, 0x59,
0x52, 0x81, 0x72, 0x07, 0xf9, 0x29, 0x72, 0x03, 0xcc, 0x2a, 0xb5, 0x16, 0x8b, 0x22, 0xf4, 0x55,
0xa7, 0xb4, 0xba, 0x4c, 0x60, 0x50, 0xcd, 0xa9, 0xed, 0x5a, 0x54, 0xfa, 0xc7, 0xfb, 0xb1, 0xd1,
0xcb, 0x93, 0x5b, 0x70, 0xbd, 0xcd, 0x99, 0x3a, 0x21, 0x8c, 0x8e, 0x3e, 0xee, 0x63, 0x1f, 0x3f,
0x3a, 0x45, 0x7e, 0xd8, 0x65, 0xcf, 0xaa, 0x05, 0x72, 0x03, 0x96, 0x74, 0x16, 0xdf, 0xa3, 0x51,
0xd0, 0x45, 0xbe, 0x35, 0xf0, 0x31, 0x56, 0xfb, 0x55, 0x8b, 0x4a, 0xf4, 0x21, 0x1d, 0x24, 0x49,
0xe3, 0xc2, 0x45, 0xea, 0x1f, 0x63, 0x50, 0x2d, 0x91, 0x7b, 0x70, 0xa7, 0xad, 0x7a, 0x5a, 0x48,
0x8c, 0xa4, 0xd5, 0xd0, 0x66, 0x9b, 0xd8, 0x45, 0x15, 0x16, 0x90, 0x32, 0x14, 0xf6, 0xa3, 0x93,
0x88, 0x3d, 0x8b, 0xaa, 0x01, 0x99, 0x83, 0xe2, 0x2e, 0x93, 0xdb, 0xac, 0x1f, 0x05, 0x55, 0xac,
0xff, 0xea, 0xc0, 0xfd, 0x16, 0x47, 0x2a, 0xf1, 0xe2, 0x4d, 0x86, 0x2d, 0x7b, 0x0d, 0xf2, 0xa6,
0x43, 0x6d, 0xbf, 0xda, 0x15, 0xb9, 0x0d, 0xa5, 0x23, 0xce, 0xfa, 0xf1, 0x2e, 0xed, 0xa1, 0xae,
0x73, 0xc9, 0x1d, 0x01, 0x64, 0x1b, 0x8a, 0x02, 0xa5, 0x0c, 0xa3, 0xa3, 0x61, 0x6b, 0x3e, 0x4e,
0x5d, 0xb2, 0x0b, 0x8f, 0xec, 0x58, 0x0b, 0x37, 0xb1, 0x7d, 0x63, 0x33, 0x64, 0x05, 0x1e, 0x4c,
0x0e, 0xd6, 0xf4, 0x9f, 0xce, 0xca, 0x7e, 0x1c, 0xfc, 0x73, 0xb2, 0x32, 0x39, 0x58, 0x9b, 0x95,
0xef, 0x1d, 0xb8, 0x6f, 0x9a, 0xea, 0xcf, 0xc9, 0xca, 0x9b, 0x19, 0x67, 0x2b, 0xf0, 0x60, 0xb2,
0x93, 0x36, 0x9a, 0x9f, 0x1d, 0x58, 0xb1, 0x77, 0x76, 0x8f, 0xfd, 0x8d, 0x03, 0x22, 0x77, 0x01,
0x0e, 0xfa, 0x87, 0x87, 0xc8, 0x3b, 0xe1, 0x97, 0xa8, 0x0b, 0x9c, 0x73, 0xc7, 0x10, 0x52, 0x83,
0x02, 0xed, 0x4b, 0xb6, 0xee, 0x9f, 0xd4, 0x72, 0xcb, 0x4e, 0xa3, 0xe8, 0x0e, 0x97, 0xf5, 0xe7,
0xb3, 0xf0, 0xf0, 0xd2, 0x10, 0x5f, 0x77, 0xc6, 0x7b, 0x17, 0xcd, 0xf8, 0x77, 0xc6, 0xcd, 0xa6,
0x3c, 0xfa, 0xdf, 0x69, 0xff, 0x97, 0x4d, 0xfb, 0xe7, 0x0e, 0x94, 0x12, 0x86, 0x46, 0x6e, 0x40,
0xd1, 0x70, 0x49, 0xcb, 0x42, 0xe6, 0xdc, 0x82, 0x5e, 0xef, 0x04, 0xe4, 0x0e, 0x18, 0x4e, 0xe9,
0xc9, 0xb3, 0x38, 0x69, 0x6d, 0x8d, 0xec, 0x9d, 0xc5, 0x48, 0xae, 0x43, 0x21, 0x14, 0xde, 0xe7,
0xaa, 0xee, 0x59, 0xdd, 0x72, 0xf9, 0x50, 0xbc, 0xaf, 0x72, 0x4f, 0x60, 0x36, 0xa0, 0x92, 0xea,
0x2e, 0x9d, 0x73, 0xf5, 0x37, 0xb9, 0x09, 0xc5, 0x1e, 0x4a, 0xaa, 0xf1, 0x9c, 0xc6, 0x93, 0x75,
0x7d, 0x07, 0x2a, 0xe7, 0xfa, 0x5f, 0xa9, 0xab, 0x1b, 0x10, 0xa9, 0x3b, 0x65, 0xb9, 0xd1, 0x70,
0xad, 0x64, 0x31, 0x15, 0xe2, 0x19, 0xe3, 0x81, 0x75, 0x2a, 0x59, 0xd7, 0x3f, 0x83, 0x62, 0x7b,
0x44, 0xd5, 0x2a, 0x3e, 0xeb, 0xf5, 0x42, 0xe9, 0x25, 0x1c, 0xcf, 0x50, 0xc1, 0x05, 0x03, 0x27,
0x8a, 0x8f, 0xa0, 0x1a, 0x73, 0x8c, 0x29, 0x47, 0x2f, 0xc5, 0x06, 0xb3, 0x6e, 0xc5, 0xe2, 0x43,
0xd5, 0xfa, 0x13, 0xc8, 0xe9, 0xba, 0xaa, 0x18, 0x75, 0x56, 0x8c, 0x73, 0xfa, 0x5b, 0x63, 0x38,
0x90, 0xd6, 0x29, 0xfd, 0x5d, 0xff, 0x36, 0x03, 0xf3, 0x2e, 0xfa, 0x8c, 0x07, 0xf6, 0xe6, 0x90,
0x15, 0xa8, 0x0c, 0xc9, 0x7b, 0x9a, 0xfd, 0xcd, 0x6b, 0xb8, 0x33, 0xa4, 0x80, 0xe3, 0x85, 0xc9,
0xa4, 0x0b, 0x73, 0x0f, 0xe6, 0x8c, 0x28, 0xea, 0xf7, 0x0e, 0xd0, 0xdc, 0x8d, 0xac, 0x5b, 0xd6,
0xd8, 0xae, 0x86, 0xce, 0xd5, 0x6e, 0xf6, 0x7c, 0xed, 0x86, 0x25, 0xca, 0xbd, 0xa4, 0x44, 0xf9,
0x74, 0x89, 0xc6, 0x6b, 0x5d, 0x48, 0xd5, 0xba, 0x06, 0x05, 0x5f, 0xff, 0x98, 0x06, 0xb5, 0xa2,
0xf6, 0x62, 0xb8, 0x24, 0xf7, 0x61, 0xde, 0x7e, 0x7a, 0x18, 0x33, 0xff, 0xb8, 0x56, 0xd2, 0xf2,
0x39, 0x0b, 0x6e, 0x29, 0xac, 0xce, 0x55, 0x76, 0xc6, 0xe6, 0xca, 0x25, 0x13, 0x68, 0x2c, 0x8f,
0xc3, 0x09, 0xf4, 0xca, 0x14, 0xbe, 0xfe, 0xcb, 0x2c, 0xdc, 0x9d, 0xfc, 0xf3, 0x4a, 0x1a, 0x50,
0xe5, 0xc6, 0x2d, 0xaf, 0x1b, 0x46, 0x27, 0x9e, 0x64, 0x42, 0x3b, 0x54, 0x74, 0x17, 0x2c, 0xfe,
0x41, 0x18, 0x9d, 0xec, 0x31, 0xa1, 0xf2, 0x2c, 0x24, 0xe5, 0xd2, 0x3b, 0xe4, 0xac, 0x67, 0xbb,
0xa6, 0xa4, 0x11, 0xc5, 0x65, 0xcd, 0x8b, 0x4a, 0x72, 0xea, 0x09, 0x49, 0x65, 0x28, 0x64, 0xe8,
0x0b, 0x7b, 0x59, 0x2a, 0x1a, 0xef, 0x24, 0xb0, 0x6a, 0xd7, 0x1e, 0x0a, 0x41, 0x8f, 0xd0, 0x93,
0x61, 0x0f, 0x59, 0x5f, 0xea, 0xb2, 0x39, 0xee, 0x82, 0x85, 0xf7, 0x0c, 0xaa, 0x1a, 0xa8, 0x47,
0x07, 0x1e, 0x47, 0xc9, 0xcf, 0x3c, 0x9f, 0xf5, 0x23, 0xa9, 0xcb, 0x98, 0x73, 0xe7, 0x7b, 0x74,
0xe0, 0x2a, 0xb4, 0xa5, 0x40, 0x15, 0x44, 0x37, 0x3c, 0x45, 0xcf, 0xfc, 0x4a, 0x78, 0x42, 0xfd,
0x70, 0xe4, 0xed, 0x23, 0x22, 0x3c, 0xc5, 0x8d, 0xd1, 0x8f, 0xc7, 0x0a, 0x54, 0x38, 0xd2, 0xc0,
0x3b, 0x50, 0x93, 0xcb, 0x28, 0x16, 0xcc, 0x8e, 0x0a, 0xde, 0x50, 0xa8, 0xd6, 0x5b, 0x85, 0x2b,
0xc7, 0xa1, 0xca, 0xeb, 0x59, 0x6a, 0xd3, 0xa2, 0xd6, 0x5d, 0xb4, 0xa2, 0xb1, 0x7d, 0x1f, 0xc3,
0xa2, 0x7e, 0xc0, 0x78, 0xfa, 0xad, 0xe2, 0xd1, 0x43, 0x89, 0x5c, 0xb7, 0x81, 0xe3, 0x56, 0xb4,
0xa0, 0xad, 0xf0, 0x75, 0x05, 0x93, 0xff, 0xc1, 0x52, 0x2f, 0x8c, 0xbc, 0x71, 0x7d, 0x13, 0x1b,
0xe8, 0xdd, 0x49, 0x2f, 0x8c, 0x5a, 0x89, 0x89, 0x09, 0x50, 0x99, 0xd0, 0xc1, 0x05, 0x26, 0x65,
0x6b, 0x42, 0x07, 0xe7, 0x4d, 0xd6, 0xe0, 0xaa, 0x32, 0x11, 0xc9, 0x54, 0xb5, 0x16, 0x73, 0x89,
0xc5, 0x68, 0xe0, 0x1a, 0x8b, 0xb7, 0xe0, 0xba, 0x9a, 0x3a, 0x81, 0xe7, 0xb3, 0x48, 0xf4, 0x7b,
0x2a, 0x66, 0xc9, 0xa9, 0xc4, 0xa3, 0xb3, 0xda, 0xbc, 0xbe, 0x55, 0x4b, 0x5a, 0xdc, 0xb2, 0xd2,
0x8e, 0x15, 0x36, 0xbf, 0xca, 0x03, 0x6c, 0x99, 0x0b, 0xcd, 0x38, 0x92, 0x4f, 0x61, 0x21, 0xfd,
0x6e, 0x25, 0xf7, 0xc6, 0xdb, 0xf4, 0xc2, 0xc7, 0xfa, 0xcd, 0xfa, 0x24, 0x15, 0xcb, 0x60, 0x66,
0x08, 0x87, 0xa5, 0x0b, 0x1f, 0x52, 0xa4, 0x31, 0xc5, 0x5b, 0xcb, 0x1c, 0xf4, 0x68, 0xea, 0x57,
0x59, 0x7d, 0xa6, 0xe1, 0xac, 0x39, 0xe4, 0x6b, 0x07, 0x6e, 0x4f, 0x22, 0xd1, 0xe4, 0x49, 0x8a,
0x03, 0x5c, 0xfe, 0xb6, 0xb8, 0xb9, 0x36, 0xbd, 0x41, 0x12, 0xb9, 0xf2, 0x62, 0x12, 0x69, 0x4d,
0x7b, 0x31, 0x05, 0x97, 0x4f, 0x7b, 0x31, 0x15, 0x1f, 0x36, 0x5e, 0x4c, 0x22, 0x9b, 0x69, 0x2f,
0xa6, 0xe0, 0xce, 0x69, 0x2f, 0xa6, 0xe2, 0xb1, 0x33, 0xe4, 0x1b, 0x07, 0xfe, 0x73, 0x09, 0xd7,
0x22, 0xcd, 0x57, 0x22, 0x66, 0xc6, 0x97, 0xa7, 0xaf, 0x41, 0xe6, 0x4c, 0x93, 0x6c, 0xbc, 0x0d,
0xc4, 0x67, 0xbd, 0x71, 0x7b, 0x1e, 0xfb, 0x1b, 0xe5, 0x77, 0xdd, 0x76, 0x6b, 0xab, 0xd3, 0xe6,
0x4c, 0xb2, 0xb6, 0xf3, 0x5d, 0x26, 0xb3, 0xd5, 0xf9, 0x21, 0xb3, 0x30, 0xba, 0x2a, 0xab, 0x6e,
0xbb, 0x75, 0x90, 0xd7, 0xff, 0x69, 0x3d, 0xfd, 0x3d, 0x00, 0x00, 0xff, 0xff, 0xae, 0xaf, 0xe4,
0x52, 0xe8, 0x12, 0x00, 0x00,
}
| 40,640
|
https://github.com/AvivBenchorin/tianleh-test-cases/blob/master/cypress/integration/home-page-spec.js
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
tianleh-test-cases
|
AvivBenchorin
|
JavaScript
|
Code
| 42
| 151
|
import { HomePage } from '@tianleh/tianleh-test-utility'
Cypress.on('uncaught:exception', (err, runnable) => {
return false;
});
const homePage = new HomePage(cy);
describe('search amazon on google', () => {
beforeEach(() => {
homePage.open('https://www.google.com/');
})
it('type and search', () => {
homePage.clickSearchBox();
homePage.typeInSearchBox("amazon");
homePage.submitSearchQuery()
})
})
| 50,832
|
https://github.com/joealden/listed/blob/master/src/components/icons/Circle.tsx
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
listed
|
joealden
|
TSX
|
Code
| 47
| 140
|
import React from "react";
import styled from "../../utils/styled-components";
const Circle: React.FunctionComponent = () => (
<StyledSVG height="20" width="20">
<circle cx="10" cy="10" r="5" />
</StyledSVG>
);
const StyledSVG = styled.svg`
display: block;
circle {
fill: ${props => props.theme.foregroundColor};
transition: fill ${props => props.theme.transition};
}
`;
export default Circle;
| 27,355
|
https://github.com/ivandewolf1/subdivMesh/blob/master/.gitignore
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
subdivMesh
|
ivandewolf1
|
Ignore List
|
Code
| 67
| 224
|
# Created by https://www.gitignore.io/api/c++,cmake,emacs
# Edit at https://www.gitignore.io/?templates=c++,cmake,emacs
# hand edited down from there
### C++ ###
# Compiled Object files
*.o
# Compiled Dynamic libraries
*.so
# Compiled Static libraries
*.a
### CMake ###
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
### CMake Patch ###
# External projects
*-prefix/
### Emacs ###
*~
\#*\#
.\#*
### Ivans additions ###
lwtv/
backup/
build/
| 17,918
|
https://github.com/UCY-LINC-LAB/5G-Slicer/blob/master/tests/test_networks.py
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
5G-Slicer
|
UCY-LINC-LAB
|
Python
|
Code
| 497
| 2,929
|
import unittest
from networks.QoS import QoS
from networks.connections.mathematical_connections import FunctionalDegradation
from networks.slicing import SliceConceptualGraph
from utils.location import Location
class TestBaseStationLinear(unittest.TestCase):
def setUp(self):
self.name = "network"
self.wireless_connection_type = "LinearDegradation"
self.backhaul_qos = {'latency': {'delay': '3.0ms', 'deviation': '1.0ms'}, 'bandwidth': '100.0mbps',
'error_rate': '1.0%'}
self.midhaul_qos = {'latency': {'delay': '3.0ms', 'deviation': '1.0ms'}, 'bandwidth': '100.0mbps',
'error_rate': '1.0%'}
self.parameters = dict(
best_qos={'latency': {'delay': '5.0ms', 'deviation': '2.0ms'}, 'bandwidth': '10.0mbps',
'error_rate': '1.0%'},
worst_qos={'latency': {'delay': '100.0ms', 'deviation': '20.0ms'}, 'bandwidth': '5.0mbps',
'error_rate': '2.0%'}, radius="5km")
self.network = SliceConceptualGraph(self.name, self.midhaul_qos, self.backhaul_qos, self.parameters)
def test_creation(self):
self.assertEqual(self.network.get_name(), "network")
def test_get_empty_nodes(self):
self.assertEqual(self.network.get_nodes(), {})
def test_add_node(self):
name, lat, lon = 'node', 33, 40
lat, lon = 33, 40
self.network.set_RU(lat, lon)
self.network.add_node(name, lat, lon)
self.assertEqual(self.network.get_nodes(), {'node': Location(lat, lon)})
with self.assertRaises(SliceConceptualGraph.NetworkSliceException):
self.network.add_node('node', 33, 40)
def test_get_empty_RUs(self):
self.assertEqual(self.network.get_RUs(), {})
def test_set_basetastion(self):
lat, lon = 33, 40
self.network.set_RU(lat, lon)
self.assertEqual(self.network.get_RUs(), {f'{lat}-{lon}': Location(lat, lon)})
with self.assertRaises(SliceConceptualGraph.NetworkSliceException):
self.network.set_RU(lat, lon)
def test_constructor(self):
with self.assertRaises(FunctionalDegradation.FunctionDegradationNetworkException):
SliceConceptualGraph('test', {}, {}, {})
SliceConceptualGraph('test', self.midhaul_qos, {}, {})
SliceConceptualGraph('test', {}, self.backhaul_qos, {})
SliceConceptualGraph('test', {}, {}, self.parameters)
def test_get_qos(self):
self.assertEqual(self.network.get_backhaul(), QoS(self.backhaul_qos))
def test_set_qos(self):
self.network.set_backhaul(QoS.minimum_qos_dict)
self.assertEqual(self.network.get_backhaul(), QoS(QoS.minimum_qos_dict))
def test_qos_from_distance(self):
self.assertEqual(self.network.get_qos_from(5).get_formated_qos(), self.parameters.get('worst_qos'))
self.assertEqual(self.network.get_qos_from(0.0).get_formated_qos(), self.parameters.get('best_qos'))
def test_get_node_location(self):
lat, lon = 33, 40
self.network.set_RU(lat, lon)
self.network.add_node('test', 10, 10)
self.assertEqual(self.network.get_node_location('test2'), None)
self.assertEqual(self.network.get_node_location('test'), Location(10, 10))
def test_has_to_pass_through_backhaul(self):
self.network.set_RU(10, 10)
self.network.set_RU(20, 20)
self.network.add_node('source1', 10, 10)
self.network.add_node('destination1', 10, 10)
self.network.add_node('destination2', 20, 20)
def test_set_RUs(self):
self.network.set_RUs([{'lat': 10, 'lon': 10}, {'lat': 5, 'lon': 5}])
self.assertEqual(self.network.get_RUs(),
{'10-10': Location(**{'lat': 10, 'lon': 10}), '5-5': Location(**{'lat': 5, 'lon': 5})})
lat, lon = 33, 40
self.network.set_RU(lat, lon)
with self.assertRaises(SliceConceptualGraph.NetworkSliceException):
self.network.set_RUs([{'lat': 10, 'lon': 10}, {'lat': 5, 'lon': 5}])
def test_set_node_location(self):
lat, lon = 33, 40
self.network.set_RU(lat, lon)
self.network.add_node('destination1', 10, 10)
self.network.set_node_location('destination1', 20, 20)
self.assertEqual(self.network.get_node_location('destination1'), Location(20, 20))
with self.assertRaises(Location.LocationException):
self.network.set_node_location('destination1', 'test', 20)
with self.assertRaises(Location.LocationException):
self.network.set_node_location('destination1', 20, 'test')
class TestBaseLog2Degradation(unittest.TestCase):
def setUp(self):
self.name = "network"
self.wireless_connection_type = "Log2Degradation"
self.midhaul_qos = {'latency': {'delay': '3.0ms', 'deviation': '1.0ms'}, 'bandwidth': '100.0mbps',
'error_rate': '1.0%'}
self.backhaul_qos = {'latency': {'delay': '3.0ms', 'deviation': '1.0ms'}, 'bandwidth': '100.0mbps',
'error_rate': '1.0%'}
self.parameters = dict(
best_qos={'latency': {'delay': '5.0ms', 'deviation': '2.0ms'}, 'bandwidth': '10.0mbps',
'error_rate': '1.0%'},
worst_qos={'latency': {'delay': '100.0ms', 'deviation': '20.0ms'}, 'bandwidth': '5.0mbps',
'error_rate': '2.0%'}, radius="5km")
self.network = SliceConceptualGraph(self.name, self.midhaul_qos, self.backhaul_qos, self.parameters)
def test_creation(self):
self.assertEqual(self.network.get_name(), "network")
def test_get_empty_nodes(self):
self.assertEqual(self.network.get_nodes(), {})
def test_add_node(self):
name, lat, lon = 'node', 33, 40
with self.assertRaises(SliceConceptualGraph.NetworkSliceException):
self.network.add_node(name, lat, lon)
self.network.set_RU(33, 40, 0)
self.network.add_node(name, lat, lon)
self.assertEqual(self.network.get_nodes(), {'node': Location(lat, lon)})
with self.assertRaises(SliceConceptualGraph.NetworkSliceException):
self.network.add_node('node', 33, 40)
def test_get_empty_RUs(self):
self.assertEqual(self.network.get_RUs(), {})
def test_set_basetastion(self):
lat, lon = 33, 40
self.network.set_RU(lat, lon)
self.assertEqual(self.network.get_RUs(), {f'{lat}-{lon}': Location(lat, lon)})
with self.assertRaises(SliceConceptualGraph.NetworkSliceException):
self.network.set_RU(lat, lon)
def test_constructor(self):
with self.assertRaises(FunctionalDegradation.FunctionDegradationNetworkException):
SliceConceptualGraph('test', {} ,{}, {})
SliceConceptualGraph('test', self.midhaul_qos, {}, {})
SliceConceptualGraph('test', {}, self.backhaul_qos, {})
SliceConceptualGraph('test', {}, {}, self.parameters)
def test_get_qos(self):
self.assertEqual(self.network.get_backhaul(), QoS(self.backhaul_qos))
def test_set_qos(self):
self.network.set_backhaul(QoS.minimum_qos_dict)
self.assertEqual(self.network.get_backhaul(), QoS(QoS.minimum_qos_dict))
def test_qos_from_distance(self):
self.assertEqual(self.network.get_qos_from(5).get_formated_qos(), self.parameters.get('worst_qos'))
self.assertEqual(self.network.get_qos_from(0.0).get_formated_qos(), self.parameters.get('best_qos'))
def test_get_node_location(self):
lat, lon = 33, 40
self.network.set_RU(lat, lon)
self.network.add_node('test', 10, 10)
self.assertEqual(self.network.get_node_location('test2'), None)
self.assertEqual(self.network.get_node_location('test'), Location(10, 10))
def test_set_RUs(self):
self.network.set_RUs([{'lat': 10, 'lon': 10}, {'lat': 5, 'lon': 5}])
self.assertEqual(self.network.get_RUs(),
{'10-10': Location(**{'lat': 10, 'lon': 10}), '5-5': Location(**{'lat': 5, 'lon': 5})})
with self.assertRaises(SliceConceptualGraph.NetworkSliceException):
self.network.set_RUs([{'lat': 10, 'lon': 10}, {'lat': 5, 'lon': 5}])
def test_set_node_location(self):
lat, lon = 33, 40
self.network.set_RU(lat, lon)
self.network.add_node('destination1', 10, 10)
self.network.set_node_location('destination1', 20, 20)
self.assertEqual(self.network.get_node_location('destination1'), Location(20, 20))
with self.assertRaises(Location.LocationException):
self.network.set_node_location('destination1', 'test', 20)
with self.assertRaises(Location.LocationException):
self.network.set_node_location('destination1', 20, 'test')
| 7,584
|
https://github.com/alexeyneu/recycle-bin/blob/master/recycle_/makefile
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
recycle-bin
|
alexeyneu
|
Makefile
|
Code
| 67
| 288
|
CC=c++ -c
CFLAGS=-c -DSTRICT -G3 -Ow -W3 -Zp -Tp
CFLAGSMT=-std=c++11 -municode
LINKER=c++
GUILIBS=-lole32 -luuid -mwindows -municode
RC=windres
RCFLAGS=-D WIN32 -D _WIN64 -D NDEBUG -D _UNICODE -D UNICODE -O coff
docks : trail build/recycle_.exe
trail :
ifeq ($(wildcard build/.),)
@mkdir build
endif
build/recycle_.exe: build/recycle_.o build/recycle_.res
$(LINKER) $(GUIFLAGS) build/recycle_.o build/recycle_.res $(GUILIBS) -o build/recycle_.exe
build/recycle_.o: recycle_.cpp recycle_.h
$(CC) $(CFLAGSMT) recycle_.cpp -o build/recycle_.o
build/recycle_.res :recycle_.rc
$(RC) $(RCFLAGS) -i recycle_.rc -o build/recycle_.res
| 1,828
|
https://github.com/elliottkember/flipper/blob/master/desktop/scripts/jest-setup.js
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
flipper
|
elliottkember
|
JavaScript
|
Code
| 152
| 344
|
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
// import/no-unresolved complains, although it is a perfectly fine import
// eslint-disable-next-line
global.fetch = require('jest-fetch-mock');
// make sure test run everywhere in the same timezone!
// +11, somewhere in the middle of nowhere, so this deviates for everyone and will fail early :)
const timezone = 'Pacific/Pohnpei';
if (process.env.TZ !== timezone) {
throw new Error(
`Test started in the wrong timezone, got ${process.env.TZ}, but expected ${timezone}. Please use the package.json commands to start Jest, or prefix the command with TZ=${timezone}`,
);
}
// Make sure we have identical formatting of Dates everywhere
const toLocaleString = Date.prototype.toLocaleString;
// eslint-disable-next-line no-extend-native
Date.prototype.toLocaleString = function (_locale, ...args) {
return toLocaleString.call(this, 'en-US', ...args);
};
require('immer').enableMapSet();
require('../app/src/fb-stubs/Logger').init(undefined, {isTest: true});
| 33,240
|
https://github.com/sufzoli/suf-electronics-pcbay-psu/blob/master/SW/PSU_Control/PSU_Control/Form1.Designer.cs
|
Github Open Source
|
Open Source
|
CC0-1.0
| 2,020
|
suf-electronics-pcbay-psu
|
sufzoli
|
C#
|
Code
| 3,177
| 13,918
|
namespace PSU_Control
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button7 = new System.Windows.Forms.Button();
this.button8 = new System.Windows.Forms.Button();
this.button9 = new System.Windows.Forms.Button();
this.button10 = new System.Windows.Forms.Button();
this.button11 = new System.Windows.Forms.Button();
this.button12 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button();
this.button14 = new System.Windows.Forms.Button();
this.button15 = new System.Windows.Forms.Button();
this.button16 = new System.Windows.Forms.Button();
this.button17 = new System.Windows.Forms.Button();
this.button18 = new System.Windows.Forms.Button();
this.textBox2 = new System.Windows.Forms.TextBox();
this.button19 = new System.Windows.Forms.Button();
this.button20 = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.button21 = new System.Windows.Forms.Button();
this.button22 = new System.Windows.Forms.Button();
this.label9 = new System.Windows.Forms.Label();
this.button23 = new System.Windows.Forms.Button();
this.button24 = new System.Windows.Forms.Button();
this.button25 = new System.Windows.Forms.Button();
this.button26 = new System.Windows.Forms.Button();
this.button27 = new System.Windows.Forms.Button();
this.button28 = new System.Windows.Forms.Button();
this.button29 = new System.Windows.Forms.Button();
this.button30 = new System.Windows.Forms.Button();
this.button31 = new System.Windows.Forms.Button();
this.button32 = new System.Windows.Forms.Button();
this.button33 = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.button41 = new System.Windows.Forms.Button();
this.button42 = new System.Windows.Forms.Button();
this.button43 = new System.Windows.Forms.Button();
this.button44 = new System.Windows.Forms.Button();
this.button45 = new System.Windows.Forms.Button();
this.button46 = new System.Windows.Forms.Button();
this.button47 = new System.Windows.Forms.Button();
this.button48 = new System.Windows.Forms.Button();
this.textBox3 = new System.Windows.Forms.TextBox();
this.button49 = new System.Windows.Forms.Button();
this.button50 = new System.Windows.Forms.Button();
this.label11 = new System.Windows.Forms.Label();
this.button51 = new System.Windows.Forms.Button();
this.button52 = new System.Windows.Forms.Button();
this.button53 = new System.Windows.Forms.Button();
this.button54 = new System.Windows.Forms.Button();
this.button55 = new System.Windows.Forms.Button();
this.button56 = new System.Windows.Forms.Button();
this.textBox4 = new System.Windows.Forms.TextBox();
this.button57 = new System.Windows.Forms.Button();
this.button58 = new System.Windows.Forms.Button();
this.button59 = new System.Windows.Forms.Button();
this.button60 = new System.Windows.Forms.Button();
this.label12 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button61 = new System.Windows.Forms.Button();
this.button62 = new System.Windows.Forms.Button();
this.button63 = new System.Windows.Forms.Button();
this.button64 = new System.Windows.Forms.Button();
this.button65 = new System.Windows.Forms.Button();
this.button66 = new System.Windows.Forms.Button();
this.button67 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.label1.Font = new System.Drawing.Font("Courier New", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(40, 77);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(336, 73);
this.label1.TabIndex = 0;
this.label1.Text = " 00.214V";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(174, 25);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(50, 24);
this.label2.TabIndex = 1;
this.label2.Text = "CH1";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Courier New", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label6.Location = new System.Drawing.Point(172, 240);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(34, 36);
this.label6.TabIndex = 5;
this.label6.Text = "V";
//
// button1
//
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.button1.Location = new System.Drawing.Point(46, 439);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(102, 36);
this.button1.TabIndex = 8;
this.button1.Text = "On/Off";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.button2.Location = new System.Drawing.Point(251, 439);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(104, 36);
this.button2.TabIndex = 9;
this.button2.Text = "CV/CC";
this.button2.UseVisualStyleBackColor = true;
//
// button3
//
this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.button3.Location = new System.Drawing.Point(391, 106);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(89, 33);
this.button3.TabIndex = 10;
this.button3.Text = "Parallel";
this.button3.UseVisualStyleBackColor = true;
//
// button4
//
this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.button4.Location = new System.Drawing.Point(391, 154);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(89, 33);
this.button4.TabIndex = 11;
this.button4.Text = "Serial";
this.button4.UseVisualStyleBackColor = true;
//
// button5
//
this.button5.Location = new System.Drawing.Point(64, 214);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(22, 23);
this.button5.TabIndex = 12;
this.button5.Text = "▲";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// button6
//
this.button6.Location = new System.Drawing.Point(64, 282);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(22, 23);
this.button6.TabIndex = 13;
this.button6.Text = "▼";
this.button6.UseVisualStyleBackColor = true;
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("Courier New", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.textBox1.Location = new System.Drawing.Point(45, 237);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(121, 44);
this.textBox1.TabIndex = 14;
this.textBox1.Text = "00.214";
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// button7
//
this.button7.Location = new System.Drawing.Point(144, 214);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(22, 23);
this.button7.TabIndex = 15;
this.button7.Text = "▲";
this.button7.UseVisualStyleBackColor = true;
//
// button8
//
this.button8.Location = new System.Drawing.Point(125, 214);
this.button8.Name = "button8";
this.button8.Size = new System.Drawing.Size(22, 23);
this.button8.TabIndex = 16;
this.button8.Text = "▲";
this.button8.UseVisualStyleBackColor = true;
//
// button9
//
this.button9.Location = new System.Drawing.Point(104, 214);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(22, 23);
this.button9.TabIndex = 17;
this.button9.Text = "▲";
this.button9.UseVisualStyleBackColor = true;
//
// button10
//
this.button10.Location = new System.Drawing.Point(144, 282);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(22, 23);
this.button10.TabIndex = 18;
this.button10.Text = "▼";
this.button10.UseVisualStyleBackColor = true;
//
// button11
//
this.button11.Location = new System.Drawing.Point(125, 282);
this.button11.Name = "button11";
this.button11.Size = new System.Drawing.Size(22, 23);
this.button11.TabIndex = 19;
this.button11.Text = "▼";
this.button11.UseVisualStyleBackColor = true;
//
// button12
//
this.button12.Location = new System.Drawing.Point(104, 282);
this.button12.Name = "button12";
this.button12.Size = new System.Drawing.Size(22, 23);
this.button12.TabIndex = 20;
this.button12.Text = "▼";
this.button12.UseVisualStyleBackColor = true;
//
// button13
//
this.button13.Location = new System.Drawing.Point(264, 282);
this.button13.Name = "button13";
this.button13.Size = new System.Drawing.Size(22, 23);
this.button13.TabIndex = 30;
this.button13.Text = "▼";
this.button13.UseVisualStyleBackColor = true;
//
// button14
//
this.button14.Location = new System.Drawing.Point(285, 282);
this.button14.Name = "button14";
this.button14.Size = new System.Drawing.Size(22, 23);
this.button14.TabIndex = 29;
this.button14.Text = "▼";
this.button14.UseVisualStyleBackColor = true;
//
// button15
//
this.button15.Location = new System.Drawing.Point(304, 282);
this.button15.Name = "button15";
this.button15.Size = new System.Drawing.Size(22, 23);
this.button15.TabIndex = 28;
this.button15.Text = "▼";
this.button15.UseVisualStyleBackColor = true;
//
// button16
//
this.button16.Location = new System.Drawing.Point(264, 214);
this.button16.Name = "button16";
this.button16.Size = new System.Drawing.Size(22, 23);
this.button16.TabIndex = 27;
this.button16.Text = "▲";
this.button16.UseVisualStyleBackColor = true;
//
// button17
//
this.button17.Location = new System.Drawing.Point(285, 214);
this.button17.Name = "button17";
this.button17.Size = new System.Drawing.Size(22, 23);
this.button17.TabIndex = 26;
this.button17.Text = "▲";
this.button17.UseVisualStyleBackColor = true;
//
// button18
//
this.button18.Location = new System.Drawing.Point(304, 214);
this.button18.Name = "button18";
this.button18.Size = new System.Drawing.Size(22, 23);
this.button18.TabIndex = 25;
this.button18.Text = "▲";
this.button18.UseVisualStyleBackColor = true;
//
// textBox2
//
this.textBox2.Font = new System.Drawing.Font("Courier New", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.textBox2.Location = new System.Drawing.Point(226, 237);
this.textBox2.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 44);
this.textBox2.TabIndex = 24;
this.textBox2.Text = "1.000";
this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// button19
//
this.button19.Location = new System.Drawing.Point(224, 282);
this.button19.Name = "button19";
this.button19.Size = new System.Drawing.Size(22, 23);
this.button19.TabIndex = 23;
this.button19.Text = "▼";
this.button19.UseVisualStyleBackColor = true;
//
// button20
//
this.button20.Location = new System.Drawing.Point(224, 214);
this.button20.Name = "button20";
this.button20.Size = new System.Drawing.Size(22, 23);
this.button20.TabIndex = 22;
this.button20.Text = "▲";
this.button20.UseVisualStyleBackColor = true;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Courier New", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label5.Location = new System.Drawing.Point(332, 240);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(34, 36);
this.label5.TabIndex = 21;
this.label5.Text = "A";
this.label5.Click += new System.EventHandler(this.label5_Click);
//
// button21
//
this.button21.Location = new System.Drawing.Point(45, 214);
this.button21.Name = "button21";
this.button21.Size = new System.Drawing.Size(22, 23);
this.button21.TabIndex = 31;
this.button21.Text = "▲";
this.button21.UseVisualStyleBackColor = true;
//
// button22
//
this.button22.Location = new System.Drawing.Point(45, 282);
this.button22.Name = "button22";
this.button22.Size = new System.Drawing.Size(22, 23);
this.button22.TabIndex = 32;
this.button22.Text = "▼";
this.button22.UseVisualStyleBackColor = true;
//
// label9
//
this.label9.AutoSize = true;
this.label9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.label9.Font = new System.Drawing.Font("Courier New", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label9.Location = new System.Drawing.Point(40, 137);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(336, 73);
this.label9.TabIndex = 33;
this.label9.Text = " 0.214A";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// button23
//
this.button23.Location = new System.Drawing.Point(10, 20);
this.button23.Name = "button23";
this.button23.Size = new System.Drawing.Size(93, 23);
this.button23.TabIndex = 34;
this.button23.Text = "CV 3.3V";
this.button23.UseVisualStyleBackColor = true;
//
// button24
//
this.button24.Location = new System.Drawing.Point(120, 20);
this.button24.Name = "button24";
this.button24.Size = new System.Drawing.Size(91, 23);
this.button24.TabIndex = 35;
this.button24.Text = "CV 5V";
this.button24.UseVisualStyleBackColor = true;
//
// button25
//
this.button25.Location = new System.Drawing.Point(99, 65);
this.button25.Name = "button25";
this.button25.Size = new System.Drawing.Size(60, 23);
this.button25.TabIndex = 36;
this.button25.Text = "Custom2";
this.button25.UseVisualStyleBackColor = true;
//
// button26
//
this.button26.Location = new System.Drawing.Point(234, 20);
this.button26.Name = "button26";
this.button26.Size = new System.Drawing.Size(85, 23);
this.button26.TabIndex = 37;
this.button26.Text = "CV 12V";
this.button26.UseVisualStyleBackColor = true;
//
// button27
//
this.button27.Location = new System.Drawing.Point(10, 65);
this.button27.Name = "button27";
this.button27.Size = new System.Drawing.Size(60, 23);
this.button27.TabIndex = 38;
this.button27.Text = "Custom1";
this.button27.UseVisualStyleBackColor = true;
this.button27.Click += new System.EventHandler(this.button27_Click);
//
// button28
//
this.button28.Location = new System.Drawing.Point(177, 65);
this.button28.Name = "button28";
this.button28.Size = new System.Drawing.Size(60, 23);
this.button28.TabIndex = 39;
this.button28.Text = "Custom3";
this.button28.UseVisualStyleBackColor = true;
//
// button29
//
this.button29.Location = new System.Drawing.Point(259, 65);
this.button29.Name = "button29";
this.button29.Size = new System.Drawing.Size(60, 23);
this.button29.TabIndex = 40;
this.button29.Text = "Custom4";
this.button29.UseVisualStyleBackColor = true;
//
// button30
//
this.button30.Location = new System.Drawing.Point(391, 301);
this.button30.Name = "button30";
this.button30.Size = new System.Drawing.Size(89, 25);
this.button30.TabIndex = 41;
this.button30.Text = "Common1";
this.button30.UseVisualStyleBackColor = true;
//
// button31
//
this.button31.Location = new System.Drawing.Point(391, 332);
this.button31.Name = "button31";
this.button31.Size = new System.Drawing.Size(89, 23);
this.button31.TabIndex = 42;
this.button31.Text = "Common2";
this.button31.UseVisualStyleBackColor = true;
//
// button32
//
this.button32.Location = new System.Drawing.Point(391, 361);
this.button32.Name = "button32";
this.button32.Size = new System.Drawing.Size(89, 23);
this.button32.TabIndex = 43;
this.button32.Text = "Common3";
this.button32.UseVisualStyleBackColor = true;
//
// button33
//
this.button33.Location = new System.Drawing.Point(391, 390);
this.button33.Name = "button33";
this.button33.Size = new System.Drawing.Size(89, 23);
this.button33.TabIndex = 44;
this.button33.Text = "Common4";
this.button33.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Lime;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label3.Location = new System.Drawing.Point(60, 53);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 24);
this.label3.TabIndex = 45;
this.label3.Text = "On";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label4.Location = new System.Drawing.Point(109, 53);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(38, 24);
this.label4.TabIndex = 46;
this.label4.Text = "CV";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label7.Location = new System.Drawing.Point(569, 53);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(38, 24);
this.label7.TabIndex = 82;
this.label7.Text = "CV";
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.SystemColors.Control;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label8.Location = new System.Drawing.Point(520, 53);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(36, 24);
this.label8.TabIndex = 81;
this.label8.Text = "Off";
//
// label10
//
this.label10.AutoSize = true;
this.label10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.label10.Font = new System.Drawing.Font("Courier New", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label10.Location = new System.Drawing.Point(500, 137);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(336, 73);
this.label10.TabIndex = 73;
this.label10.Text = " 0.000A";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// button41
//
this.button41.Location = new System.Drawing.Point(505, 282);
this.button41.Name = "button41";
this.button41.Size = new System.Drawing.Size(22, 23);
this.button41.TabIndex = 72;
this.button41.Text = "▼";
this.button41.UseVisualStyleBackColor = true;
//
// button42
//
this.button42.Location = new System.Drawing.Point(505, 214);
this.button42.Name = "button42";
this.button42.Size = new System.Drawing.Size(22, 23);
this.button42.TabIndex = 71;
this.button42.Text = "▲";
this.button42.UseVisualStyleBackColor = true;
//
// button43
//
this.button43.Location = new System.Drawing.Point(724, 282);
this.button43.Name = "button43";
this.button43.Size = new System.Drawing.Size(22, 23);
this.button43.TabIndex = 70;
this.button43.Text = "▼";
this.button43.UseVisualStyleBackColor = true;
//
// button44
//
this.button44.Location = new System.Drawing.Point(745, 282);
this.button44.Name = "button44";
this.button44.Size = new System.Drawing.Size(22, 23);
this.button44.TabIndex = 69;
this.button44.Text = "▼";
this.button44.UseVisualStyleBackColor = true;
//
// button45
//
this.button45.Location = new System.Drawing.Point(764, 282);
this.button45.Name = "button45";
this.button45.Size = new System.Drawing.Size(22, 23);
this.button45.TabIndex = 68;
this.button45.Text = "▼";
this.button45.UseVisualStyleBackColor = true;
//
// button46
//
this.button46.Location = new System.Drawing.Point(724, 214);
this.button46.Name = "button46";
this.button46.Size = new System.Drawing.Size(22, 23);
this.button46.TabIndex = 67;
this.button46.Text = "▲";
this.button46.UseVisualStyleBackColor = true;
//
// button47
//
this.button47.Location = new System.Drawing.Point(745, 214);
this.button47.Name = "button47";
this.button47.Size = new System.Drawing.Size(22, 23);
this.button47.TabIndex = 66;
this.button47.Text = "▲";
this.button47.UseVisualStyleBackColor = true;
//
// button48
//
this.button48.Location = new System.Drawing.Point(764, 214);
this.button48.Name = "button48";
this.button48.Size = new System.Drawing.Size(22, 23);
this.button48.TabIndex = 65;
this.button48.Text = "▲";
this.button48.UseVisualStyleBackColor = true;
//
// textBox3
//
this.textBox3.Font = new System.Drawing.Font("Courier New", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.textBox3.Location = new System.Drawing.Point(686, 237);
this.textBox3.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(100, 44);
this.textBox3.TabIndex = 64;
this.textBox3.Text = "0.000";
this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// button49
//
this.button49.Location = new System.Drawing.Point(684, 282);
this.button49.Name = "button49";
this.button49.Size = new System.Drawing.Size(22, 23);
this.button49.TabIndex = 63;
this.button49.Text = "▼";
this.button49.UseVisualStyleBackColor = true;
//
// button50
//
this.button50.Location = new System.Drawing.Point(684, 214);
this.button50.Name = "button50";
this.button50.Size = new System.Drawing.Size(22, 23);
this.button50.TabIndex = 62;
this.button50.Text = "▲";
this.button50.UseVisualStyleBackColor = true;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Font = new System.Drawing.Font("Courier New", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label11.Location = new System.Drawing.Point(792, 240);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(34, 36);
this.label11.TabIndex = 61;
this.label11.Text = "A";
//
// button51
//
this.button51.Location = new System.Drawing.Point(564, 282);
this.button51.Name = "button51";
this.button51.Size = new System.Drawing.Size(22, 23);
this.button51.TabIndex = 60;
this.button51.Text = "▼";
this.button51.UseVisualStyleBackColor = true;
//
// button52
//
this.button52.Location = new System.Drawing.Point(585, 282);
this.button52.Name = "button52";
this.button52.Size = new System.Drawing.Size(22, 23);
this.button52.TabIndex = 59;
this.button52.Text = "▼";
this.button52.UseVisualStyleBackColor = true;
//
// button53
//
this.button53.Location = new System.Drawing.Point(604, 282);
this.button53.Name = "button53";
this.button53.Size = new System.Drawing.Size(22, 23);
this.button53.TabIndex = 58;
this.button53.Text = "▼";
this.button53.UseVisualStyleBackColor = true;
//
// button54
//
this.button54.Location = new System.Drawing.Point(564, 214);
this.button54.Name = "button54";
this.button54.Size = new System.Drawing.Size(22, 23);
this.button54.TabIndex = 57;
this.button54.Text = "▲";
this.button54.UseVisualStyleBackColor = true;
//
// button55
//
this.button55.Location = new System.Drawing.Point(585, 214);
this.button55.Name = "button55";
this.button55.Size = new System.Drawing.Size(22, 23);
this.button55.TabIndex = 56;
this.button55.Text = "▲";
this.button55.UseVisualStyleBackColor = true;
//
// button56
//
this.button56.Location = new System.Drawing.Point(604, 214);
this.button56.Name = "button56";
this.button56.Size = new System.Drawing.Size(22, 23);
this.button56.TabIndex = 55;
this.button56.Text = "▲";
this.button56.UseVisualStyleBackColor = true;
//
// textBox4
//
this.textBox4.Font = new System.Drawing.Font("Courier New", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.textBox4.Location = new System.Drawing.Point(505, 237);
this.textBox4.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(121, 44);
this.textBox4.TabIndex = 54;
this.textBox4.Text = "00.000";
this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// button57
//
this.button57.Location = new System.Drawing.Point(524, 282);
this.button57.Name = "button57";
this.button57.Size = new System.Drawing.Size(22, 23);
this.button57.TabIndex = 53;
this.button57.Text = "▼";
this.button57.UseVisualStyleBackColor = true;
//
// button58
//
this.button58.Location = new System.Drawing.Point(524, 214);
this.button58.Name = "button58";
this.button58.Size = new System.Drawing.Size(22, 23);
this.button58.TabIndex = 52;
this.button58.Text = "▲";
this.button58.UseVisualStyleBackColor = true;
//
// button59
//
this.button59.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.button59.Location = new System.Drawing.Point(711, 439);
this.button59.Name = "button59";
this.button59.Size = new System.Drawing.Size(104, 36);
this.button59.TabIndex = 51;
this.button59.Text = "CV/CC";
this.button59.UseVisualStyleBackColor = true;
//
// button60
//
this.button60.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.button60.Location = new System.Drawing.Point(506, 439);
this.button60.Name = "button60";
this.button60.Size = new System.Drawing.Size(102, 36);
this.button60.TabIndex = 50;
this.button60.Text = "On/Off";
this.button60.UseVisualStyleBackColor = true;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Font = new System.Drawing.Font("Courier New", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label12.Location = new System.Drawing.Point(632, 240);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(34, 36);
this.label12.TabIndex = 49;
this.label12.Text = "V";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label13.Location = new System.Drawing.Point(634, 25);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(50, 24);
this.label13.TabIndex = 48;
this.label13.Text = "CH2";
//
// label14
//
this.label14.AutoSize = true;
this.label14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.label14.Font = new System.Drawing.Font("Courier New", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label14.Location = new System.Drawing.Point(500, 77);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(336, 73);
this.label14.TabIndex = 47;
this.label14.Text = " 00.000V";
this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button24);
this.groupBox1.Controls.Add(this.button23);
this.groupBox1.Controls.Add(this.button25);
this.groupBox1.Controls.Add(this.button26);
this.groupBox1.Controls.Add(this.button27);
this.groupBox1.Controls.Add(this.button28);
this.groupBox1.Controls.Add(this.button29);
this.groupBox1.Location = new System.Drawing.Point(35, 323);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(341, 100);
this.groupBox1.TabIndex = 83;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Preset";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.button61);
this.groupBox2.Controls.Add(this.button62);
this.groupBox2.Controls.Add(this.button63);
this.groupBox2.Controls.Add(this.button64);
this.groupBox2.Controls.Add(this.button65);
this.groupBox2.Controls.Add(this.button66);
this.groupBox2.Controls.Add(this.button67);
this.groupBox2.Location = new System.Drawing.Point(495, 323);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(341, 100);
this.groupBox2.TabIndex = 84;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Preset";
//
// button61
//
this.button61.Location = new System.Drawing.Point(120, 20);
this.button61.Name = "button61";
this.button61.Size = new System.Drawing.Size(91, 23);
this.button61.TabIndex = 35;
this.button61.Text = "CV 5V";
this.button61.UseVisualStyleBackColor = true;
//
// button62
//
this.button62.Location = new System.Drawing.Point(10, 20);
this.button62.Name = "button62";
this.button62.Size = new System.Drawing.Size(93, 23);
this.button62.TabIndex = 34;
this.button62.Text = "CV 3.3V";
this.button62.UseVisualStyleBackColor = true;
//
// button63
//
this.button63.Location = new System.Drawing.Point(99, 65);
this.button63.Name = "button63";
this.button63.Size = new System.Drawing.Size(60, 23);
this.button63.TabIndex = 36;
this.button63.Text = "Custom2";
this.button63.UseVisualStyleBackColor = true;
//
// button64
//
this.button64.Location = new System.Drawing.Point(234, 20);
this.button64.Name = "button64";
this.button64.Size = new System.Drawing.Size(85, 23);
this.button64.TabIndex = 37;
this.button64.Text = "CV 12V";
this.button64.UseVisualStyleBackColor = true;
//
// button65
//
this.button65.Location = new System.Drawing.Point(10, 65);
this.button65.Name = "button65";
this.button65.Size = new System.Drawing.Size(60, 23);
this.button65.TabIndex = 38;
this.button65.Text = "Custom1";
this.button65.UseVisualStyleBackColor = true;
//
// button66
//
this.button66.Location = new System.Drawing.Point(177, 65);
this.button66.Name = "button66";
this.button66.Size = new System.Drawing.Size(60, 23);
this.button66.TabIndex = 39;
this.button66.Text = "Custom3";
this.button66.UseVisualStyleBackColor = true;
//
// button67
//
this.button67.Location = new System.Drawing.Point(259, 65);
this.button67.Name = "button67";
this.button67.Size = new System.Drawing.Size(60, 23);
this.button67.TabIndex = 40;
this.button67.Text = "Custom4";
this.button67.UseVisualStyleBackColor = true;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(870, 520);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.label7);
this.Controls.Add(this.label8);
this.Controls.Add(this.label10);
this.Controls.Add(this.button41);
this.Controls.Add(this.button42);
this.Controls.Add(this.button43);
this.Controls.Add(this.button44);
this.Controls.Add(this.button45);
this.Controls.Add(this.button46);
this.Controls.Add(this.button47);
this.Controls.Add(this.button48);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.button49);
this.Controls.Add(this.button50);
this.Controls.Add(this.label11);
this.Controls.Add(this.button51);
this.Controls.Add(this.button52);
this.Controls.Add(this.button53);
this.Controls.Add(this.button54);
this.Controls.Add(this.button55);
this.Controls.Add(this.button56);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.button57);
this.Controls.Add(this.button58);
this.Controls.Add(this.button59);
this.Controls.Add(this.button60);
this.Controls.Add(this.label12);
this.Controls.Add(this.label13);
this.Controls.Add(this.label14);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.button33);
this.Controls.Add(this.button32);
this.Controls.Add(this.button31);
this.Controls.Add(this.button30);
this.Controls.Add(this.label9);
this.Controls.Add(this.button22);
this.Controls.Add(this.button21);
this.Controls.Add(this.button13);
this.Controls.Add(this.button14);
this.Controls.Add(this.button15);
this.Controls.Add(this.button16);
this.Controls.Add(this.button17);
this.Controls.Add(this.button18);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.button19);
this.Controls.Add(this.button20);
this.Controls.Add(this.label5);
this.Controls.Add(this.button12);
this.Controls.Add(this.button11);
this.Controls.Add(this.button10);
this.Controls.Add(this.button9);
this.Controls.Add(this.button8);
this.Controls.Add(this.button7);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button6);
this.Controls.Add(this.button5);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label6);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1";
this.Text = "Bench Power Supply";
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
private System.Windows.Forms.Button button11;
private System.Windows.Forms.Button button12;
private System.Windows.Forms.Button button13;
private System.Windows.Forms.Button button14;
private System.Windows.Forms.Button button15;
private System.Windows.Forms.Button button16;
private System.Windows.Forms.Button button17;
private System.Windows.Forms.Button button18;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Button button19;
private System.Windows.Forms.Button button20;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button button21;
private System.Windows.Forms.Button button22;
public System.Windows.Forms.Label label1;
public System.Windows.Forms.Label label9;
private System.Windows.Forms.Button button23;
private System.Windows.Forms.Button button24;
private System.Windows.Forms.Button button25;
private System.Windows.Forms.Button button26;
private System.Windows.Forms.Button button27;
private System.Windows.Forms.Button button28;
private System.Windows.Forms.Button button29;
private System.Windows.Forms.Button button30;
private System.Windows.Forms.Button button31;
private System.Windows.Forms.Button button32;
private System.Windows.Forms.Button button33;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
public System.Windows.Forms.Label label10;
private System.Windows.Forms.Button button41;
private System.Windows.Forms.Button button42;
private System.Windows.Forms.Button button43;
private System.Windows.Forms.Button button44;
private System.Windows.Forms.Button button45;
private System.Windows.Forms.Button button46;
private System.Windows.Forms.Button button47;
private System.Windows.Forms.Button button48;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Button button49;
private System.Windows.Forms.Button button50;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Button button51;
private System.Windows.Forms.Button button52;
private System.Windows.Forms.Button button53;
private System.Windows.Forms.Button button54;
private System.Windows.Forms.Button button55;
private System.Windows.Forms.Button button56;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Button button57;
private System.Windows.Forms.Button button58;
private System.Windows.Forms.Button button59;
private System.Windows.Forms.Button button60;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label13;
public System.Windows.Forms.Label label14;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button button61;
private System.Windows.Forms.Button button62;
private System.Windows.Forms.Button button63;
private System.Windows.Forms.Button button64;
private System.Windows.Forms.Button button65;
private System.Windows.Forms.Button button66;
private System.Windows.Forms.Button button67;
}
}
| 19,435
|
https://github.com/sigma-random/ptmalloc2_exploit_demos/blob/master/heap-demos/dump_malloc_state.c
|
Github Open Source
|
Open Source
|
MIT
| 2,017
|
ptmalloc2_exploit_demos
|
sigma-random
|
C
|
Code
| 40
| 242
|
#include "heap_helper.h"
#define CHUNK_SIZE sizeof(size_t)
int main()
{
void *malloc_state_ptr;
void *p1,*p2,*p3,*p4,*p5;
printf("sizeof(size_t) = %d\n",sizeof(size_t));
printf("sizeof(int) = %d\n",sizeof(int));
p1 = malloc_helper(CHUNK_SIZE*1);
p2 = malloc_helper(CHUNK_SIZE*2);
p3 = malloc_helper(CHUNK_SIZE*3);
p4 = malloc_helper(CHUNK_SIZE*4);
p5 = malloc_helper(CHUNK_SIZE*5);
free_helper(p1);
free_helper(p3);
dump_malloc_state();
getchar();
return 0;
}
| 10,208
|
https://github.com/yuyf-fsd/cartodb/blob/master/lib/assets/core/test/spec/cartodb3/editor/layers/layer-content-view.spec.js
|
Github Open Source
|
Open Source
|
BSD-3-Clause
| null |
cartodb
|
yuyf-fsd
|
JavaScript
|
Code
| 1,121
| 5,273
|
var _ = require('underscore');
var $ = require('jquery');
var Backbone = require('backbone');
var AnalysisDefinitionNodeSourceModel = require('../../../../../javascripts/cartodb3/data/analysis-definition-node-source-model');
var LayerDefinitionsCollection = require('../../../../../javascripts/cartodb3/data/layer-definitions-collection');
var LayerDefinitionModel = require('../../../../../javascripts/cartodb3/data/layer-definition-model');
var LayerContentView = require('../../../../../javascripts/cartodb3/editor/layers/layer-content-view');
var ConfigModel = require('../../../../../javascripts/cartodb3/data/config-model');
var UserModel = require('../../../../../javascripts/cartodb3/data/user-model');
var EditorModel = require('../../../../../javascripts/cartodb3/data/editor-model');
var UserNotifications = require('../../../../../javascripts/cartodb3/data/user-notifications');
var AnalysesService = require('../../../../../javascripts/cartodb3/editor/layers/layer-content-views/analyses/analyses-service');
var FactoryModals = require('../../factories/modals');
var Router = require('../../../../../javascripts/cartodb3/routes/router');
describe('editor/layers/layer-content-view/layer-content-view', function () {
var dashboardCanvasEl;
var handleRouteSpy;
var analysesTabName = 'analyses';
var dataTabName = 'data';
beforeEach(function () {
dashboardCanvasEl = document.createElement('div');
dashboardCanvasEl.className = 'CDB-Dashboard-canvas';
document.body.appendChild(dashboardCanvasEl);
var canvas = document.createElement('div');
canvas.classList.add('CDB-Map-canvas');
dashboardCanvasEl.appendChild(canvas);
var configModel = new ConfigModel({
base_url: '/u/pepe',
user_name: 'pepe',
sql_api_protocol: 'http'
});
this.userModel = new UserModel({}, {
configModel: configModel,
username: 'pepe'
});
this.mapDefModel = new Backbone.Model({
legends: true
});
this.layer = new LayerDefinitionModel({
id: 'l-1',
options: {
type: 'CartoDB',
table_name: 'foo'
}
}, {
parse: true,
configModel: configModel
});
var onboardings = new Backbone.Model();
onboardings.create = function () {};
onboardings.destroy = function () {};
this.analysisDefinitionNodeModel = new AnalysisDefinitionNodeSourceModel({
id: 'a0',
type: 'source',
table_name: 'foo'
}, {
configModel: configModel,
userModel: this.userModel,
collection: new Backbone.Collection()
});
this.analysisDefinitionNodeModel.querySchemaModel.attributes.query = 'SELECT * FROM foo';
this.layerDefinitionsCollection = new LayerDefinitionsCollection(null, {
configModel: configModel,
userModel: this.userModel,
analysisDefinitionNodesCollection: new Backbone.Collection(),
mapId: 'map-123',
stateDefinitionModel: {}
});
this.layerDefinitionsCollection.add(this.layer);
this.widgetDefinitionsCollection = new Backbone.Collection();
this.widgetDefinitionsCollection.isThereTimeSeries = function () {
return false;
};
this.widgetDefinitionsCollection.isThereOtherWidgets = function () {
return false;
};
spyOn(this.layer, 'getAnalysisDefinitionNodeModel').and.returnValue(this.analysisDefinitionNodeModel);
spyOn(this.layer, 'findAnalysisDefinitionNodeModel').and.returnValue(this.analysisDefinitionNodeModel);
spyOn(Router, 'goToLayerList');
spyOn(Router, 'navigate');
handleRouteSpy = spyOn(LayerContentView.prototype, 'handleRoute');
var onboardingNotification = new UserNotifications({}, {
key: 'builder',
configModel: configModel
});
this.visDefinitionModel = new Backbone.Model();
this.stackLayoutModel = jasmine.createSpyObj('stackLayoutModel', ['prevStep', 'goToStep']);
AnalysesService.init({
onboardings: onboardings,
layerDefinitionsCollection: this.layerDefinitionsCollection,
modals: FactoryModals.createModalService(),
userModel: this.userModel,
configModel: configModel
});
this.editorModel = new EditorModel({ edition: false });
this.view = new LayerContentView({
mapDefinitionModel: this.mapDefModel,
layerDefinitionModel: this.layer,
analysisDefinitionsCollection: new Backbone.Collection(),
analysisDefinitionNodesCollection: new Backbone.Collection(),
layerDefinitionsCollection: this.layerDefinitionsCollection,
legendDefinitionsCollection: new Backbone.Collection(),
widgetDefinitionsCollection: this.widgetDefinitionsCollection,
userModel: this.userModel,
modals: FactoryModals.createModalService(),
onboardings: onboardings,
analysis: {},
userActions: {},
vis: {},
stackLayoutModel: this.stackLayoutModel,
configModel: configModel,
editorModel: this.editorModel,
mapModeModel: jasmine.createSpyObj('mapModeModel', ['enterDrawingFeatureMode']),
stateDefinitionModel: {},
onboardingNotification: onboardingNotification,
visDefinitionModel: this.visDefinitionModel
});
this.view.render();
});
describe('.render', function () {
it('should render correctly', function () {
expect(_.size(this.view._subviews)).toBe(3); // [Header, Placeholder, Geometry Toolips]
expect(this.view.$('.Editor-HeaderInfo-titleText').text()).toContain('foo');
});
});
describe('when all query objects are loaded', function () {
beforeEach(function () {
spyOn(this.analysisDefinitionNodeModel.querySchemaModel, 'isDone').and.returnValue(true);
spyOn(this.analysisDefinitionNodeModel.queryGeometryModel, 'isDone').and.returnValue(true);
spyOn(this.analysisDefinitionNodeModel.queryRowsCollection, 'isDone').and.returnValue(true);
});
describe('.render', function () {
it('should render correctly', function () {
this.view.render();
expect(_.size(this.view._subviews)).toBe(3); // [Header, TabPane, Geometry Toolips]
expect(this.view.$('.Editor-HeaderInfo-titleText').text()).toContain('foo');
expect(this.view.$('.CDB-NavMenu .CDB-NavMenu-item').length).toBe(5);
// Onboarding
expect(this.view.$('.js-editorPanelContent').length).toBe(1);
});
});
describe('when can be georeferenced', function () {
beforeEach(function () {
spyOn(this.view._layerDefinitionModel, 'canBeGeoreferenced').and.returnValue(true);
spyOn(this.view._layerDefinitionModel, 'isEmpty').and.returnValue(false);
this.view.render();
});
it('should disable tabs', function () {
expect(this.view.$el.find('.CDB-NavMenu-item.is-disabled').length).toBe(3);
});
it('should select the analysis tab', function () {
expect(this.view._layerTabPaneView.getSelectedTabPaneName()).toBe(analysesTabName);
});
});
describe('when analysisDefinitionNodeModel has errors', function () {
beforeEach(function () {
spyOn(this.view._layerDefinitionModel, 'isEmpty').and.returnValue(true);
spyOn(this.analysisDefinitionNodeModel, 'hasFailed').and.returnValue(true);
this.view.render();
});
it('should disable tabs', function () {
expect(this.view.$el.find('.CDB-NavMenu-item.is-disabled').length).toBe(3);
});
it('should select the analysis tab', function () {
expect(this.view._layerTabPaneView.getSelectedTabPaneName()).toBe(analysesTabName);
});
});
describe('when is empty', function () {
it('should disable tabs', function () {
spyOn(this.view._layerDefinitionModel, 'canBeGeoreferenced').and.returnValue(true);
spyOn(this.view._layerDefinitionModel, 'isEmpty').and.returnValue(true);
this.view.render();
expect(this.view.$el.find('.CDB-NavMenu-item.is-disabled').length).toBe(4); // All but data
});
it('should select the data tab', function () {
expect(this.view._layerTabPaneView.getSelectedTabPaneName()).toBe(dataTabName);
});
});
});
it('should have no leaks', function () {
expect(this.view).toHaveNoLeaks();
});
describe('._onClickBack', function () {
it('should call goToLayerList in Router', function () {
this.view.$('.js-back').click();
expect(Router.goToLayerList).toHaveBeenCalled();
});
it('should set editorModel edition to false', function () {
this.editorModel.set('edition', true, { silent: true });
this.view.$('.js-back').click();
expect(this.editorModel.get('edition')).toBe(false);
});
});
describe('.handleRoute', function () {
it('should create editOverlay', function () {
handleRouteSpy.and.callThrough();
var routeModel = new Backbone.Model({
currentRoute: ['add_feature_']
});
this.view.handleRoute(routeModel);
expect($(dashboardCanvasEl).find('.js-editOverlay').length).toBe(1);
});
});
describe('._renderContextButtons', function () {
var analysisDefNodeModel;
var layerDefinitionModel;
var queryGeometryModel;
var needsGeoSpy;
var isEmptySpy;
function hasTipsy (subviews) {
var newGeomItems = _.filter(subviews, function (elem) {
return elem.el.classList.contains('js-newGeometryView');
});
if (newGeomItems.length === 0) return false;
return newGeomItems.reduce(function (hasTipsy, btn) {
return btn.tipsy && hasTipsy;
}, true);
}
beforeEach(function () {
analysisDefNodeModel = this.view._getAnalysisDefinitionNodeModel();
layerDefinitionModel = this.view._layerDefinitionModel;
queryGeometryModel = this.view._getQueryGeometryModel();
spyOn(analysisDefNodeModel, 'isReadOnly');
needsGeoSpy = spyOn(this.view._layerDefinitionModel, 'canBeGeoreferenced');
isEmptySpy = spyOn(this.view._layerDefinitionModel, 'isEmpty');
this.view._renderContextButtons();
});
afterEach(function () {
this.view._destroyContextButtons();
});
it('shouldn\'t disable tabs', function () {
needsGeoSpy.and.returnValue(false);
isEmptySpy.and.returnValue(false);
this.view.render();
expect(this.view.$el.find('.CDB-NavMenu-item.is-disabled').length).toBe(0);
});
it('should not create editOverlay tip view', function () {
expect($(dashboardCanvasEl).find('js-editOverlay').length).toBe(0);
});
it('should navigate when click on new geometry', function () {
queryGeometryModel.set('simple_geom', 'point');
analysisDefNodeModel.isReadOnly.and.returnValue(false);
layerDefinitionModel.set('visible', true);
this.view._renderContextButtons();
$(dashboardCanvasEl).find('.js-newGeometry').trigger('click');
expect(Router.navigate).toHaveBeenCalled();
});
it('should render context switch toggler properly', function () {
expect($(dashboardCanvasEl).find('.Editor-contextSwitcher.js-mapTableView').length).toBe(1);
});
it('should render geometry buttons properly', function () {
expect($(dashboardCanvasEl).find('.Editor-contextSwitcherItem.js-newGeometryItem').length).toBe(3);
});
it('should disable edit geometry buttons when node is read only and visible', function () {
analysisDefNodeModel.isReadOnly.and.returnValue(true);
layerDefinitionModel.set('visible', true);
expect($(dashboardCanvasEl).find('.Editor-contextSwitcherItem.js-newGeometryItem.is-disabled').length).toBe(3);
});
it('should disable edit geometry buttons when node is read only and not visible', function () {
analysisDefNodeModel.isReadOnly.and.returnValue(true);
layerDefinitionModel.set('visible', false);
expect($(dashboardCanvasEl).find('.Editor-contextSwitcherItem.js-newGeometryItem.is-disabled').length).toBe(3);
});
it('should disable edit geometry buttons when node is neither visible nor read only', function () {
analysisDefNodeModel.isReadOnly.and.returnValue(false);
layerDefinitionModel.set('visible', false);
expect($(dashboardCanvasEl).find('.Editor-contextSwitcherItem.js-newGeometryItem.is-disabled').length).toBe(3);
});
it('should not disable edit geometry buttons when node is visible and not read only', function () {
analysisDefNodeModel.isReadOnly.and.returnValue(false);
layerDefinitionModel.set('visible', true);
expect($(dashboardCanvasEl).find('.Editor-contextSwitcherItem.js-newGeometryItem.is-disabled').length).toBe(0);
});
it('should add tipsy subview when not visible or read only', function () {
this.view.clearSubViews();
analysisDefNodeModel.isReadOnly.and.returnValue(true);
layerDefinitionModel.set('visible', false);
expect(hasTipsy(this.view._subviews)).toBe(true);
});
it('should not add tipsy subview when not visible or read only', function () {
this.view.clearSubViews();
analysisDefNodeModel.isReadOnly.and.returnValue(false);
layerDefinitionModel.set('visible', true);
expect(hasTipsy(this.view._subviews)).toBe(false);
});
it('should display only one button per geometry', function () {
queryGeometryModel.set('simple_geom', 'polygon');
this.view._renderContextButtons();
expect($(dashboardCanvasEl).find('.Editor-contextSwitcherItem.js-newGeometryItem').length).toBe(1);
});
it('should show the button for the simple_geom type', function () {
queryGeometryModel.set('simple_geom', 'point');
this.view._renderContextButtons();
expect($(dashboardCanvasEl).find('.js-newGeometry[data-feature-type="point"]').length).toBe(1);
queryGeometryModel.set('simple_geom', 'line');
this.view._renderContextButtons();
expect($(dashboardCanvasEl).find('.js-newGeometry[data-feature-type="line"]').length).toBe(1);
queryGeometryModel.set('simple_geom', 'polygon');
this.view._renderContextButtons();
expect($(dashboardCanvasEl).find('.js-newGeometry[data-feature-type="polygon"]').length).toBe(1);
});
});
describe('._initBinds', function () {
function buildResponse (geom) {
return {
status: 200,
contentType: 'application/json; charset=utf-8',
responseText: '{"rows":[{"the_geom":"' + geom + '"}],"time":0.005,"fields":{"the_geom":{"type":"string"}},"total_rows":1}'
};
}
beforeEach(function () {
jasmine.Ajax.install();
});
afterEach(function () {
jasmine.Ajax.uninstall();
});
it('should call _renderContextButtons and set default style properties if there is a change in simple_geom to a valid value', function () {
var queryGeometryModel = this.view._getQueryGeometryModel();
queryGeometryModel.set('status', 'unfetched');
queryGeometryModel.set('simple_geom', 'point');
queryGeometryModel.set('query', 'SELECT TOP 10 FROM fake_table;');
spyOn(this.view, '_renderContextButtons');
jasmine.Ajax.stubRequest(/sql/)
.andReturn(buildResponse('polygon'));
this.view._initBinds();
queryGeometryModel.set('simple_geom', 'polygon');
expect(this.view._renderContextButtons).toHaveBeenCalled();
});
it('should call _renderContextButtons and not set default style properties if there is a change in simple_geom to nothing', function () {
var queryGeometryModel = this.view._getQueryGeometryModel();
queryGeometryModel.set('status', 'unfetched');
queryGeometryModel.set('simple_geom', 'point');
queryGeometryModel.set('query', 'SELECT TOP 10 FROM fake_table;');
spyOn(this.view, '_renderContextButtons');
jasmine.Ajax.stubRequest(/sql/)
.andReturn(buildResponse(''));
this.view._initBinds();
queryGeometryModel.set('simple_geom', '');
expect(this.view._renderContextButtons).toHaveBeenCalled();
});
it('should call _onTogglerChanged if togglerModel:active changes', function () {
spyOn(this.view, '_onTogglerChanged');
this.view._initBinds();
this.view._togglerModel.trigger('change:active');
expect(this.view._onTogglerChanged).toHaveBeenCalled();
});
it('should call handleRoute if routeModel:currentRoute changes', function () {
Router.getRouteModel().trigger('change:currentRoute');
expect(this.view.handleRoute).toHaveBeenCalled();
});
it('should call render if analysisDefinitionNodeModel:error changes', function () {
spyOn(this.view, 'render');
this.view._initBinds();
this.analysisDefinitionNodeModel.trigger('change:error');
expect(this.view.render).toHaveBeenCalled();
});
});
describe('._onTogglerChanged', function () {
it('should set context correctly', function () {
expect(this.view.model.get('context')).toEqual('map');
this.view._togglerModel.set('active', true, { silent: true });
this.view._onTogglerChanged();
expect(this.view.model.get('context')).toEqual('table');
this.view._togglerModel.set('active', false, { silent: true });
this.view._onTogglerChanged();
expect(this.view.model.get('context')).toEqual('map');
});
it('should call _initTable if context is table', function () {
spyOn(this.view, '_initTable');
this.view._togglerModel.set('active', true, { silent: true });
this.view._onTogglerChanged();
expect(this.view._initTable).toHaveBeenCalled();
});
it('should call _destroyTable if context is map', function () {
spyOn(this.view, '_destroyTable');
this.view._togglerModel.set('active', false, { silent: true });
this.view._onTogglerChanged();
expect(this.view._destroyTable).toHaveBeenCalled();
});
});
describe('._isContextTable', function () {
it('should return true if model context is table', function () {
expect(this.view._isContextTable()).toBe(false);
this.view.model.set('context', 'table', { silent: true });
expect(this.view._isContextTable()).toBe(true);
});
});
afterEach(function () {
dashboardCanvasEl.parentNode.removeChild(dashboardCanvasEl);
this.view.clean();
});
});
| 2,707
|
https://github.com/guojiangclub/catering.miniprogram/blob/master/src/pages/user/bindingphone/bindingphone.js
|
Github Open Source
|
Open Source
|
MIT
| null |
catering.miniprogram
|
guojiangclub
|
JavaScript
|
Code
| 302
| 1,654
|
import {is,config,sandBox,cookieStorage} from '../../../lib/myapp.js';
Page({
data: {
code:{
total:60,
access_token:null,
codeText:"获取验证码"
},
sending:false,
tellphone: '',
identifyingcode: '',
url: '',
config: ''
},
onLoad(e) {
// 第三方平台配置颜色
var bgConfig = cookieStorage.get('globalConfig') || '';
this.setData({
config: bgConfig
})
if (e.url) {
this.setData({
url: e.url
})
}
},
getCode(){
if(this.data.sending) return;
var randoms=this.random();
this.setData({
sending:true,
'code.codeText':"短信发送中",
'code.access_token':randoms
});
var fn;
fn=this.getLoginCode;
fn(()=>{
var total =this.data.code.total;
this.setData({
'code.codeText':total+"秒后再发送"
});
var timer =setInterval(()=>{
total--;
this.setData({
'code.codeText':total+"秒后再发送"
});
if(total<1){
this.setData({
sending:false,
'code.codeText':"获取验证码"
});
clearInterval(timer);
}
},1000);
},()=>{
this.setData({
sending:false,
'code.codeText':"获取验证码"
});
});
},
changeCode(e){
this.setData({
tellphone: e.detail.value
})
},
changeIdentifyCode(e){
this.setData({
identifyingcode: e.detail.value
})
},
random(){
return Math.random().toString(36).substr(2,24);
},
getLoginCode(resolve,reject){
var message =null;
if(!is.has(this.data.tellphone)){
message = "请输入您的手机号";
} else if(!is.mobile(this.data.tellphone)){
message = '手机号格式不正确,请重新输入';
}
if(message){
this.setData({
message:message
});
reject();
setTimeout(()=>{
this.setData({
message:""
});
},3000)
return
}
sandBox.post({
api:"api/sms/verify-code",
data:{
mobile:this.data.tellphone,
access_token:this.data.code.access_token
},
}).then(res =>{
if(res.data.success){
resolve();
}
else{
reject();
}
})
// resolve();
},
submit(){
var message=null;
if(!is.has(this.data.tellphone)){
message = "请输入您的手机号";
} else if(!is.mobile(this.data.tellphone)){
message = '手机号格式不正确,请重新输入';
} else if(!is.has(this.data.identifyingcode)){
message="请填写验证码";
}
if(message){
this.setData({
message:message
});
setTimeout(()=>{
this.setData({
message:""
});
},3000)
return
}
this.setData({
showLoading: true
})
this.bindUserMobile();
},
bindUserMobile() {
sandBox.post({
api: 'api/users/update/mobile',
data: {
mobile: this.data.tellphone,
code: this.data.identifyingcode,
access_token: this.data.code.access_token
},
header:{
Authorization: cookieStorage.get('user_token')
},
}).then(res => {
wx.hideLoading();
if (res.statusCode == 200) {
res =res.data;
if (res.status) {
wx.showModal({
content: '绑定成功',
showCancel: false,
success: res=>{
if (res.confirm || (!res.cancel && !res.confirm)) {
if (this.data.url) {
wx.redirectTo({
url: '/' + decodeURIComponent(this.data.url)
})
} else {
wx.switchTab({
url: '/pages/user/personal/personal'
})
}
}
}
})
} else {
wx.showModal({
content: res.message || '绑定失败',
showCancel: false,
})
}
} else {
wx.showModal({
content: '请求失败,请重试',
showCancel: false
})
}
}).catch(rej => {
res =res.data;
wx.showModal({
content: '请求失败,请重试',
showCancel: false
})
})
},
back() {
if (this.data.url) {
wx.redirectTo({
url: '/' + decodeURIComponent(this.data.url)
})
} else {
wx.navigateBack();
}
}
})
| 25,526
|
https://github.com/ivosabev/zdrkopr/blob/master/packages/server/build/graphql/types/Message.js
|
Github Open Source
|
Open Source
|
Unlicense
| 2,018
|
zdrkopr
|
ivosabev
|
JavaScript
|
Code
| 113
| 390
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MessageEdge = exports.MessagesConnection = exports.MessageType = undefined;
var _graphql = require('graphql');
var _graphqlRelay = require('graphql-relay');
var _Node = require('./Node');
var MessageType = (0, _Node.registerType)(new _graphql.GraphQLObjectType({
name: 'Message',
interfaces: function interfaces() {
return [_Node.NodeInterface];
},
fields: function fields() {
return {
id: (0, _graphqlRelay.globalIdField)('Message'),
userId: {
type: _graphql.GraphQLString,
resolve: function resolve(source) {
return (0, _graphqlRelay.toGlobalId)('User', source.userId);
}
},
username: { type: _graphql.GraphQLString },
text: { type: _graphql.GraphQLString },
createdAt: { type: _graphql.GraphQLString },
updatedAt: { type: _graphql.GraphQLString }
};
}
}));
var _connectionDefinition = (0, _graphqlRelay.connectionDefinitions)({
name: 'Message',
nodeType: MessageType
}),
MessagesConnection = _connectionDefinition.connectionType,
MessageEdge = _connectionDefinition.edgeType;
exports.MessageType = MessageType;
exports.MessagesConnection = MessagesConnection;
exports.MessageEdge = MessageEdge;
| 37,774
|
https://github.com/hcse/chrome-extension-wallet/blob/master/src/components/transactionStatus/TransactionStatusView.tsx
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
chrome-extension-wallet
|
hcse
|
TypeScript
|
Code
| 46
| 167
|
import * as React from 'react'
import './TransactionStatusView.css'
import BodyView from 'components/shared/layout/BodyView'
interface Props {
title: string
body: string
icon: string
}
const TransactionStatusView: React.SFC<Props> = (props: Props) => (
<BodyView className='transaction-status-container'>
<div className='transaction-status-content'>
<img src={props.icon} alt='transactionStatusIcon' />
<h1>{props.title}</h1>
<p>{props.body}</p>
</div>
</BodyView>
)
export default TransactionStatusView
| 28,287
|
https://github.com/mrnettek/VBScript0/blob/master/VBScript3/Start DNS Server Scavenging.vbs
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
VBScript0
|
mrnettek
|
Visual Basic
|
Code
| 45
| 125
|
' Description: Instructs a DNS server to begin scavenging stale records in the appropriate DNS zones.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\MicrosoftDNS")
Set colItems = objWMIService.ExecQuery("Select * From MicrosoftDNS_Server")
For Each objItem in colItems
objItem.StartScavenging()
Next
| 10,115
|
https://github.com/linkedin/avro-util/blob/master/helper/helper/src/main/java/com/linkedin/avroutil1/compatibility/AvroRecordUtil.java
|
Github Open Source
|
Open Source
|
BSD-2-Clause, Apache-2.0
| 2,023
|
avro-util
|
linkedin
|
Java
|
Code
| 3,250
| 8,744
|
/*
* Copyright 2022 LinkedIn Corp.
* Licensed under the BSD 2-Clause License (the "License").
* See License in the project root for license information.
*/
package com.linkedin.avroutil1.compatibility;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericEnumSymbol;
import org.apache.avro.generic.GenericFixed;
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.generic.IndexedRecord;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.specific.SpecificFixed;
import org.apache.avro.specific.SpecificRecord;
import org.apache.avro.util.Utf8;
public class AvroRecordUtil {
private static final List<StringRepresentation> STRING_ONLY = Collections.singletonList(StringRepresentation.String);
private static final List<StringRepresentation> UTF8_PREFERRED = Collections.unmodifiableList(Arrays.asList(
StringRepresentation.Utf8, StringRepresentation.String
));
/**
* field names that avro will avoid and instead append a "$" to.
* see {@link org.apache.avro.specific.SpecificCompiler}.RESERVED_WORDS and mangle()
*/
public final static Set<String> AVRO_RESERVED_FIELD_NAMES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
"abstract", "assert", "boolean", "break", "byte", "case", "catch",
"char", "class", "const", "continue", "default", "do", "double",
"else", "enum", "extends", "false", "final", "finally", "float",
"for", "goto", "if", "implements", "import", "instanceof", "int",
"interface", "long", "native", "new", "null", "package", "private",
"protected", "public", "return", "schema", "short", "static", "strictfp",
"super", "switch", "synchronized", "this", "throw", "throws",
"transient", "true", "try", "void", "volatile", "while"
)));
private AvroRecordUtil() {
//utility class
}
/**
* sets all fields who's value is not allowed according to their schema to their default values (as specified in their schema)
* optionally throws if field is not set to a valid value yet schema has no default for it
* @param record a record to recursively supplement defaults in
* @param throwIfMissingValuesLeft true to throw if field value is invalid yet no default exists
* @param <T> exact type of record
* @return the input record
*/
public static <T extends IndexedRecord> T supplementDefaults(T record, boolean throwIfMissingValuesLeft) {
if (record == null) {
throw new IllegalArgumentException("record argument required");
}
boolean isSpecific = AvroCompatibilityHelper.isSpecificRecord(record);
//noinspection unchecked
return (T) supplementDefaults(record, throwIfMissingValuesLeft, isSpecific);
}
/**
* sets all fields who's value is not allowed according to their schema to their default values (as specified in their schema)
* optionally throws if field is not set to a valid value yes schema has no default for it
* @param record a record to DFS
* @param throwIfMissingValuesLeft true to throw if field value is invalid yet no default exists
* @param useSpecifics true to populate specific default values, false to populate with generics
* @return the input record
*/
private static IndexedRecord supplementDefaults(IndexedRecord record, boolean throwIfMissingValuesLeft, boolean useSpecifics) {
Schema schema = record.getSchema();
List<Schema.Field> fields = schema.getFields();
for (Schema.Field field : fields) {
Object fieldValue = record.get(field.pos());
Schema fieldSchema = field.schema();
boolean populate = true;
if (AvroSchemaUtil.isValidValueForSchema(fieldValue, fieldSchema)) {
//this field is fine
populate = false;
} else if (!AvroCompatibilityHelper.fieldHasDefault(field)) {
//no default, yet no value. complain?
if (throwIfMissingValuesLeft) {
throw new IllegalArgumentException(schema.getName() + "." + field.name()
+ " has no default value, yet no value is set on the input record");
}
populate = false;
}
if (populate) {
if (useSpecifics) {
fieldValue = AvroCompatibilityHelper.getSpecificDefaultValue(field);
} else {
fieldValue = AvroCompatibilityHelper.getGenericDefaultValue(field);
}
record.put(field.pos(), fieldValue);
}
if (fieldValue instanceof IndexedRecord) {
supplementDefaults((IndexedRecord) fieldValue, throwIfMissingValuesLeft, useSpecifics);
}
}
return record;
}
/**
* converts a given {@link GenericData.Record} into an instance of the "equivalent"
* {@link SpecificRecord} (SR) class. Can optionally reuse a given SR instance as output,
* otherwise SR class will be looked up on the current thread's classpath by fullname
* (or optionally by aliases) <br>
* <b>WARNING:</b> this method is a crutch. If at all possible, configure your avro decoding operation
* to generate the desired output type - either generics or specifics - directly. it will be FAR cheaper
* than using this method of conversion.
* @param input generic record to convert from. required
* @param outputReuse specific record to convert into. optional. if provided must be of the correct
* fullname (matching input or any of input's aliases, depending on config)
* @param config configuration for the operation
* @param <T> type of the SR class
* @return a SR converted from the input
*/
public static <T extends SpecificRecord> T genericRecordToSpecificRecord(
GenericRecord input,
T outputReuse,
RecordConversionConfig config
) {
if (input == null) {
throw new IllegalArgumentException("input required");
}
if (config == null) {
throw new IllegalArgumentException("config required");
}
RecordConversionContext context = new RecordConversionContext(config);
context.setUseSpecifics(true);
Schema inputSchema = input.getSchema();
Schema outputSchema;
ClassLoader cl;
T outputRecord;
if (outputReuse == null) {
//use context loader
Class<T> srClass;
cl = Thread.currentThread().getContextClassLoader();
context.setClassLoader(cl);
//look up SR class by fullname and possibly aliases
//noinspection unchecked
srClass = (Class<T>) context.lookup(inputSchema);
if (srClass == null) {
throw new IllegalStateException("unable to find/load class " + inputSchema.getFullName());
}
outputSchema = AvroSchemaUtil.getDeclaredSchema(srClass);
//noinspection unchecked
outputRecord = (T) AvroCompatibilityHelper.newInstance(srClass, outputSchema);
} else {
//use same loader that loaded output
cl = outputReuse.getClass().getClassLoader();
context.setClassLoader(cl);
outputSchema = outputReuse.getSchema();
//TODO - validate output schema vs input schema
outputRecord = outputReuse;
}
deepConvertRecord(input, outputRecord, context);
return outputRecord;
}
/**
* converts a given {@link SpecificRecord} (SR) into an instance of the "equivalent"
* {@link GenericData.Record}. Can optionally reuse a given GR instance as output.
* otherwise a new GR will be created using the schema from the input SR<br>
* <b>WARNING:</b> this method is a crutch. If at all possible, configure your avro decoding operation
* to generate the desired output type - either generics or specifics - directly. it will be FAR cheaper
* than using this method of conversion.
* @param input specific record to convert from. required
* @param outputReuse generic record to convert into. optional. if provided must be of the correct
* fullname (matching input or any of input's aliases, depending on config)
* @param config configuration for the operation
* @return a SR converted from the input
*/
public static GenericRecord specificRecordToGenericRecord(
SpecificRecord input,
GenericRecord outputReuse,
RecordConversionConfig config
) {
if (input == null) {
throw new IllegalArgumentException("input required");
}
if (config == null) {
throw new IllegalArgumentException("config required");
}
RecordConversionContext context = new RecordConversionContext(config);
context.setUseSpecifics(false);
Schema inputSchema = input.getSchema();
Schema outputSchema;
ClassLoader cl;
GenericRecord outputRecord;
if (outputReuse == null) {
//use context loader
cl = Thread.currentThread().getContextClassLoader();
context.setClassLoader(cl);
outputSchema = inputSchema;
outputRecord = new GenericData.Record(outputSchema);
} else {
//use same loader that loaded output
cl = outputReuse.getClass().getClassLoader();
context.setClassLoader(cl);
outputSchema = outputReuse.getSchema();
//TODO - validate output schema vs input schema
outputRecord = outputReuse;
}
deepConvertRecord(input, outputRecord, context);
return outputRecord;
}
public static <T extends IndexedRecord> T setStringField(T record, String fieldName, CharSequence value) {
Schema.Field field = resolveField(record, fieldName);
if (!(record instanceof SpecificRecord)) {
//generic record
//TODO - make this honor schema logical types or runtime avro version?
record.put(field.pos(), value);
return record;
}
String expectedFieldName = AVRO_RESERVED_FIELD_NAMES.contains(fieldName) ? fieldName + "$" : fieldName;
Class<? extends IndexedRecord> recordClass = record.getClass();
//look for public field 1st
Field[] classFields = recordClass.getFields();
for (Field classField : classFields) {
if (expectedFieldName.equals(classField.getName())) {
Class<?> classFieldType = classField.getType();
StringRepresentation classFieldStringRep = StringRepresentation.forClass(classFieldType);
CharSequence convertedValue = toString(value, classFieldStringRep);
try {
classField.set(record, convertedValue);
} catch (Exception e) {
throw new IllegalStateException("unable to set field " + recordClass.getName() + "." + classField.getName()
+ " to " + classFieldStringRep + " " + convertedValue, e);
}
return record;
}
}
//look for setter
Method[] classMethods = recordClass.getMethods();
String expectedMethodName = "set" + expectedFieldName.substring(0, 1).toUpperCase(Locale.ROOT) + expectedFieldName.substring(1);
for (Method method : classMethods) {
//needs to be called setSomething()
if (!expectedMethodName.equals(method.getName())) {
continue;
}
//needs to be void
Class<?> returnType = method.getReturnType();
if (!Void.TYPE.equals(returnType)) {
continue;
}
//needs to have a single arg
Class<?>[] args = method.getParameterTypes();
if (args == null || args.length != 1) {
continue;
}
Class<?> setterArgType = args[0];
StringRepresentation setterArgStringRep = StringRepresentation.forClass(setterArgType);
CharSequence convertedValue = toString(value, setterArgStringRep);
try {
method.invoke(record, convertedValue);
} catch (Exception e) {
throw new IllegalStateException("unable to call setter " + method
+ " to " + setterArgStringRep + " " + convertedValue, e);
}
return record;
}
throw new IllegalStateException("unable to find either public field of setter method for " + recordClass.getName() + "." + fieldName);
}
public static <T extends IndexedRecord> T setField(T record, String fieldName, Object value) {
Schema.Field field = resolveField(record, fieldName);
Schema fieldSchema = field.schema();
Schema destinationSchema = fieldSchema; //unless union (see below)
if (fieldSchema.getType() == Schema.Type.UNION) {
//will throw if no matching branch found
//TODO - catch and provide details of record.field ?
destinationSchema = AvroSchemaUtil.resolveUnionBranchOf(value, fieldSchema);
}
if (!(record instanceof SpecificRecord)) {
//generic record
//TODO - make this honor schema logical types or runtime avro version?
record.put(field.pos(), value);
return record;
}
//specific record class below this point
Class<? extends IndexedRecord> recordClass = record.getClass();
//locate the destination - field or method
Field publicField = findPublicFieldFor(recordClass, fieldName);
Method setter = findSetterFor(recordClass, fieldName);;
FieldAccessor accessor = new FieldAccessor(
((SpecificRecord) record).getClass(),
record.getSchema(),
field,
publicField,
setter
);
accessor.setValue((SpecificRecord) record, value);
return record;
}
private static Field findPublicFieldFor(Class<? extends IndexedRecord> recordClass, String schemaFieldName) {
String expectedFieldName = AVRO_RESERVED_FIELD_NAMES.contains(schemaFieldName) ? schemaFieldName + "$" : schemaFieldName;
//getting all public fields might be faster than getting the desired field by name
//because ot avoids the exception that would be thrown if its not found
//TODO - benchmark to prove the above statement
Field[] publicFields = recordClass.getFields();
for (Field publicField : publicFields) {
if (expectedFieldName.equals(publicField.getName())) {
return publicField;
}
}
return null;
}
private static Method findSetterFor(Class<? extends IndexedRecord> recordClass, String schemaFieldName) {
//bob --> setBob
String expectedSetterName = "set" + schemaFieldName.substring(0, 1).toUpperCase(Locale.ROOT) + schemaFieldName.substring(1);
if (AVRO_RESERVED_FIELD_NAMES.contains(schemaFieldName)) {
//setClass --> setClass$
expectedSetterName += "$";
}
String expectedFieldName =
AVRO_RESERVED_FIELD_NAMES.contains(schemaFieldName) ? schemaFieldName + "$" : schemaFieldName;
//going over all public methods might be faster compared to catching
//an exception trying to get a specific one
//TODO - benchmark above
Method[] publicMethods = recordClass.getMethods();
for (Method method : publicMethods) {
//needs to be called setSomething()
if (!expectedSetterName.equals(method.getName())) {
continue;
}
//needs to be void
Class<?> returnType = method.getReturnType();
if (!Void.TYPE.equals(returnType)) {
continue;
}
//needs to have a single arg
Class<?>[] args = method.getParameterTypes();
if (args == null || args.length != 1) {
continue;
}
return method;
}
//no setter
return null;
}
private static Schema.Field resolveField(IndexedRecord record, String fieldName) {
if (record == null) {
throw new IllegalArgumentException("record argument required");
}
Schema schema = record.getSchema();
Schema.Field field = schema.getField(fieldName);
if (field == null) {
throw new IllegalArgumentException("schema " + schema.getFullName() + " has no such field " + fieldName);
}
return field;
}
private static void deepConvertRecord(IndexedRecord input, IndexedRecord output, RecordConversionContext context) {
RecordConversionConfig config = context.getConfig();
Schema inputSchema = input.getSchema();
Schema outputSchema = output.getSchema();
for (Schema.Field outField : outputSchema.getFields()) {
//look up field on input by name then (optionally) aliases
Schema.Field inField = findMatchingField(outField, inputSchema, config);
//grab and convert inField value if found, use outField default if not
Object outputValue;
if (inField == null) {
outputValue = context.isUseSpecifics() ? AvroCompatibilityHelper.getSpecificDefaultValue(outField)
: AvroCompatibilityHelper.getGenericDefaultValue(outField);
} else {
Object inputValue = input.get(inField.pos());
//figure out what type (in avro) this value is, which is only tricky for unions
Schema inFieldSchema = inField.schema();
Schema inValueSchema;
Schema.Type inFieldSchemaType = inFieldSchema.getType();
if (inFieldSchemaType == Schema.Type.UNION) {
boolean inputSpecific = AvroCompatibilityHelper.isSpecificRecord(input);
int unionBranch;
if (inputSpecific) {
unionBranch = SpecificData.get().resolveUnion(inFieldSchema, inputValue);
} else {
unionBranch = GenericData.get().resolveUnion(inFieldSchema, inputValue);
}
inValueSchema = inFieldSchema.getTypes().get(unionBranch);
} else {
inValueSchema = inFieldSchema;
}
//figure out the output schema that matches the input value (following the same logic
//as regular avro decoding)
Schema outFieldSchema = outField.schema();
SchemaResolutionResult readerSchemaResolution = AvroSchemaUtil.resolveReaderVsWriter(
inValueSchema,
outFieldSchema,
config.isUseAliasesOnNamedTypes()
, true
);
if (readerSchemaResolution == null) {
throw new IllegalArgumentException("value for field " + inField.name() + " (" + inValueSchema + " value "
+ inputValue + ") cannot me resolved to destination schema " + outFieldSchema);
}
Schema readerSchema = readerSchemaResolution.getReaderMatch();
//if reader (destination) field is a string, determine what string representation to use
StringRepresentation stringRepresentation = context.getConfig().getPreferredStringRepresentation();
if (readerSchema.getType() == Schema.Type.STRING) {
if (context.isUseSpecifics()) {
List<StringRepresentation> fieldPrefs = stringRepForSpecificField((SpecificRecord) output, outField);
if (fieldPrefs != null && !fieldPrefs.isEmpty()) {
//are we able to determine what string representation the generated class "prefers" ?
//TODO - complain if we cant determine string type used by generated code
if (config.isUseStringRepresentationHints()) {
stringRepresentation = fieldPrefs.get(0);
} else {
if (!fieldPrefs.contains(stringRepresentation)) {
//only use field prefs if its physically impossible to use the config pref
stringRepresentation = fieldPrefs.get(0);
}
}
}
} else {
StringRepresentation fieldPref = stringRepForGenericField(outputSchema, outField);
if (stringRepresentation != null && config.isUseStringRepresentationHints()) {
stringRepresentation = fieldPref;
}
}
}
outputValue = deepConvert(inputValue, inValueSchema, readerSchema, context, stringRepresentation);
}
output.put(outField.pos(), outputValue);
}
}
/**
* find the corresponding "source" field from an input ("writer") record schema
* that matches a given "output" field from a destination ("reader") record schema
* @param outField
* @param inputSchema
* @param config
* @return
*/
private static Schema.Field findMatchingField(Schema.Field outField, Schema inputSchema, RecordConversionConfig config) {
String outFieldName = outField.name();
//look up field on input by name then (optionally) aliases
Schema.Field inField = inputSchema.getField(outFieldName);
if (inField == null && config.isUseAliasesOnFields()) {
//~same as avro applying reader schema aliases to writer schema on decoding
Set<String> fieldAliases = AvroCompatibilityHelper.getFieldAliases(outField); //never null
for (String fieldAlias : fieldAliases) {
Schema.Field matchByAlias = inputSchema.getField(fieldAlias);
if (matchByAlias == null) {
continue;
}
if (inField != null) {
//TODO - consider better matching by type as well? see what avro decoding does
throw new IllegalStateException("output field " + outFieldName
+ " has multiple input fields matching by aliases: " + inField.name() + " and " + fieldAlias);
}
inField = matchByAlias;
}
}
return inField;
}
protected static Object deepConvert(
Object inputValue,
Schema inputSchema,
Schema outputSchema,
RecordConversionContext context,
StringRepresentation stringRepresentation
) {
Schema.Type inputType = inputSchema.getType();
Schema.Type outputType = outputSchema.getType();
boolean inputIsUnion;
boolean outputIsUnion;
Schema inputValueActualSchema;
Schema outputValueActualSchema;
switch (outputType) {
//primitives
case NULL:
if (inputValue != null) {
throw new IllegalArgumentException("only legal input value for type NULL is null, not " + inputValue);
}
return null;
case BOOLEAN:
//noinspection RedundantCast - cast serves as input validation
return (Boolean) inputValue;
case INT:
//noinspection RedundantCast - cast serves as input validation
return (Integer) inputValue;
case LONG:
switch (inputType) {
case INT:
return ((Integer) inputValue).longValue();
case LONG:
//noinspection RedundantCast - cast serves as input validation
return (Long) inputValue;
}
break;
case FLOAT:
switch (inputType) {
case INT:
return ((Integer) inputValue).floatValue();
case LONG:
return ((Long) inputValue).floatValue();
case FLOAT:
//noinspection RedundantCast - cast serves as input validation
return (Float) inputValue;
}
break;
case DOUBLE:
switch (inputType) {
case INT:
return ((Integer) inputValue).doubleValue();
case LONG:
return ((Long) inputValue).doubleValue();
case FLOAT:
return ((Float) inputValue).doubleValue();
case DOUBLE:
//noinspection RedundantCast - cast serves as input validation
return (Double) inputValue;
}
break;
case BYTES:
switch (inputType) {
case BYTES:
//noinspection RedundantCast - cast serves as input validation
return (ByteBuffer) inputValue;
case STRING:
return ByteBuffer.wrap(((String) inputValue).getBytes(StandardCharsets.UTF_8));
}
break;
case STRING:
switch (inputType) {
case BYTES:
ByteBuffer buf = (ByteBuffer) inputValue;
if (buf.position() != 0) {
buf.flip();
}
byte[] bytes = new byte[buf.limit()];
buf.get(bytes);
return toString(bytes, stringRepresentation);
case STRING:
return toString((CharSequence) inputValue, stringRepresentation);
}
break;
//named types
case FIXED:
GenericFixed fixedInput = (GenericFixed) inputValue; //works on generics and specifics
byte[] bytes = fixedInput.bytes();
if (context.isUseSpecifics()) {
@SuppressWarnings("unchecked")
Class<? extends SpecificFixed> fixedClass = (Class<? extends SpecificFixed>) context.lookup(outputSchema);
SpecificFixed specific = (SpecificFixed) AvroCompatibilityHelper.newInstance(fixedClass, outputSchema);
specific.bytes(bytes);
return specific;
} else {
return AvroCompatibilityHelper.newFixed(outputSchema, bytes);
}
case ENUM:
String inputSymbolStr;
if (inputValue instanceof GenericEnumSymbol) {
inputSymbolStr = inputValue.toString();
} else if (inputValue instanceof Enum) {
inputSymbolStr = ((Enum<?>) inputValue).name();
} else {
throw new IllegalArgumentException("input " + inputValue + " (a " + inputValue.getClass().getName() + ") not any kind of enum?");
}
String outputSymbolStr = inputSymbolStr;
if (!outputSchema.hasEnumSymbol(inputSymbolStr)) {
outputSymbolStr = null;
if (context.getConfig().isUseEnumDefaults()) {
outputSymbolStr = AvroCompatibilityHelper.getEnumDefault(outputSchema);
}
}
if (outputSymbolStr == null) {
throw new IllegalArgumentException("cant map input enum symbol " + inputSymbolStr + " to output " + outputSchema.getFullName());
}
if (context.isUseSpecifics()) {
@SuppressWarnings("unchecked")
Class<? extends Enum<?>> enumClass = (Class<? extends Enum<?>>) context.lookup(outputSchema);
return getSpecificEnumSymbol(enumClass, outputSymbolStr);
} else {
return AvroCompatibilityHelper.newEnumSymbol(outputSchema, outputSymbolStr);
}
case RECORD:
IndexedRecord inputRecord = (IndexedRecord) inputValue;
IndexedRecord outputRecord;
if (context.isUseSpecifics()) {
Class<?> recordClass = context.lookup(outputSchema);
outputRecord = (IndexedRecord) AvroCompatibilityHelper.newInstance(recordClass, outputSchema);
} else {
outputRecord = new GenericData.Record(outputSchema);
}
deepConvertRecord(inputRecord, outputRecord, context);
return outputRecord;
//collection schemas
case ARRAY:
List<?> inputList = (List<?>) inputValue;
List<Object> outputList;
if (context.isUseSpecifics()) {
outputList = new ArrayList<>(inputList.size());
} else {
outputList = new GenericData.Array<>(inputList.size(), outputSchema);
}
//TODO - add support for collections of unions
Schema inputElementDeclaredSchema = inputSchema.getElementType();
inputIsUnion = inputElementDeclaredSchema.getType() == Schema.Type.UNION;
Schema outputElementDeclaredSchema = outputSchema.getElementType();
outputIsUnion = outputElementDeclaredSchema.getType() == Schema.Type.UNION;
for (Object inputElement : inputList) {
inputValueActualSchema = inputElementDeclaredSchema;
if (inputIsUnion) {
inputValueActualSchema = AvroSchemaUtil.resolveUnionBranchOf(inputElement, inputElementDeclaredSchema);
}
outputValueActualSchema = outputElementDeclaredSchema;
if (outputIsUnion) {
SchemaResolutionResult resolution = AvroSchemaUtil.resolveReaderVsWriter(inputValueActualSchema, outputElementDeclaredSchema, true, true);
outputValueActualSchema = resolution.getReaderMatch();
if (outputValueActualSchema == null) {
throw new UnsupportedOperationException("dont know how to resolve a " + inputValueActualSchema.getType() + " to " + outputElementDeclaredSchema);
}
}
Object outputElement = deepConvert(
inputElement,
inputValueActualSchema,
outputValueActualSchema,
context,
stringRepresentation
);
outputList.add(outputElement);
}
return outputList;
case MAP:
@SuppressWarnings("unchecked") //cast serves as input validation
Map<? extends CharSequence, ?> inputMap = (Map<String, ?>) inputValue;
Map<CharSequence, Object> outputMap = new HashMap<>(inputMap.size()); //for both generic and specific output
//TODO - add support for collections of unions
Schema inputValueDeclaredSchema = inputSchema.getValueType();
inputIsUnion = inputValueDeclaredSchema.getType() == Schema.Type.UNION;
Schema outputValueDeclaredSchema = outputSchema.getValueType();
outputIsUnion = outputValueDeclaredSchema.getType() == Schema.Type.UNION;
for (Map.Entry<? extends CharSequence, ?> entry : inputMap.entrySet()) {
CharSequence key = entry.getKey();
Object inputElement = entry.getValue();
inputValueActualSchema = inputValueDeclaredSchema;
if (inputIsUnion) {
inputValueActualSchema = AvroSchemaUtil.resolveUnionBranchOf(inputElement, inputValueDeclaredSchema);
}
outputValueActualSchema = outputValueDeclaredSchema;
if (outputIsUnion) {
SchemaResolutionResult resolution = AvroSchemaUtil.resolveReaderVsWriter(inputValueActualSchema, outputValueDeclaredSchema, true, true);
outputValueActualSchema = resolution.getReaderMatch();
if (outputValueActualSchema == null) {
throw new UnsupportedOperationException("dont know how to resolve a " + inputValueActualSchema.getType() + " to " + outputValueDeclaredSchema);
}
}
Object outputElement = deepConvert(
inputElement,
inputValueActualSchema,
outputValueActualSchema,
context,
stringRepresentation
);
CharSequence outputKey = toString(key, stringRepresentation);
outputMap.put(outputKey, outputElement);
}
return outputMap;
case UNION:
inputValueActualSchema = AvroSchemaUtil.resolveUnionBranchOf(inputValue, inputSchema);
outputValueActualSchema = AvroSchemaUtil.resolveUnionBranchOf(inputValue, outputSchema);
return deepConvert(inputValue, inputValueActualSchema, outputValueActualSchema, context, stringRepresentation);
}
String inputClassName = inputValue == null ? "null" : inputValue.getClass().getName();
throw new UnsupportedOperationException("dont know how to convert " + inputType + " " + inputValue
+ " (a " + inputClassName + ") into " + outputType);
}
/**
* @param record record
* @param field (string) field of record
* @return possible string representations field can accept, in order of preference
*/
private static List<StringRepresentation> stringRepForSpecificField(SpecificRecord record, Schema.Field field) {
Class<? extends SpecificRecord> srClass = record.getClass();
try {
Field actualField = srClass.getDeclaredField(field.name());
List<StringRepresentation> classification = classifyStringField(actualField);
if (classification != null) {
return classification;
}
//its possible the field is a union containing string, in which case the java type will be Object.
//in this case we try and look for other string fields
for (Schema.Field otherField : record.getSchema().getFields()) {
if (otherField == field || otherField.schema().getType() != Schema.Type.STRING) {
continue;
}
Field otherClassField = srClass.getDeclaredField(otherField.name());
classification = classifyStringField(otherClassField);
if (classification != null) {
return classification;
}
}
//no luck, cant determine
return null;
} catch (Exception e) {
throw new IllegalStateException("unable to access " + srClass.getName() + "." + field.name(), e);
}
}
private static List<StringRepresentation> classifyStringField(Field classField) {
Class<?> type = classField.getType();
if (String.class.equals(type)) {
return STRING_ONLY;
}
if (CharSequence.class.equals(type)) {
return UTF8_PREFERRED;
}
return null;
}
private static StringRepresentation stringRepForGenericField(Schema schema, Schema.Field field) {
String preferredRepString = field.getProp(HelperConsts.STRING_REPRESENTATION_PROP);
if (preferredRepString == null) {
return null;
}
return StringRepresentation.valueOf(preferredRepString);
}
private static CharSequence toString(CharSequence inputStr, StringRepresentation desired) {
if (inputStr == null) {
return null;
}
switch (desired) {
case String:
return String.valueOf(inputStr);
case CharSequence:
// intentional pass through
case Utf8:
return new Utf8(String.valueOf(inputStr));
default:
throw new IllegalStateException("dont know how to convert to " + desired);
}
}
private static CharSequence toString(byte[] inputBytes, StringRepresentation desired) {
switch (desired) {
case String:
return new String(inputBytes, StandardCharsets.UTF_8);
case CharSequence:
// intentional pass through
case Utf8:
return new Utf8(inputBytes);
default:
throw new IllegalStateException("dont know how to convert to " + desired);
}
}
private static Enum<?> getSpecificEnumSymbol(Class<? extends Enum<?>> enumClass, String symbolStr) {
try {
Method valueOf = enumClass.getDeclaredMethod("valueOf", String.class);
return (Enum<?>) valueOf.invoke(enumClass, symbolStr);
} catch (Exception e) {
throw new IllegalStateException("while trying to resolve " + enumClass.getName() + ".valueOf(" + symbolStr + ")", e);
}
}
}
| 45,706
|
https://github.com/MiloVentimiglia/es4kafka/blob/master/examples/books-catalog/src/main/scala/catalog/EntryPoint.scala
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
es4kafka
|
MiloVentimiglia
|
Scala
|
Code
| 125
| 787
|
package catalog
import catalog.authors._
import catalog.authors.akkaStream.AuthorKafkaTable
import catalog.authors.http.AuthorsRoutes
import catalog.books._
import catalog.books.akkaStream._
import catalog.books.http.BooksRoutes
import catalog.booksCards._
import catalog.booksCards.http.BooksCardsRoutes
import catalog.streaming.StreamingPipeline
import es4kafka._
import es4kafka.administration.KafkaTopicAdmin
import es4kafka.akkaStream.GraphBuilder
import es4kafka.http._
import es4kafka.modules._
import es4kafka.streaming._
import java.util.UUID
object EntryPoint extends App {
def installers: Seq[Module.Installer] = {
Seq(
new AvroModule.Installer(),
new AkkaHttpModule.Installer(Config),
new AkkaStreamModule.Installer(),
new KafkaModule.Installer(Config),
new KafkaStreamsModule.Installer[StreamingPipeline](Config),
new CatalogInstaller(),
)
}
def init(): Unit = {
new KafkaTopicAdmin(Config)
.addSchemaTopic()
.addAggregate(Config.Book)
.addAggregate(Config.Author)
.addProjection(Config.BookCard)
.addPersistentTopic(Config.topicGreetings, compact = true)
.setup()
}
ServiceApp.create(
Config,
installers,
).startAndWait(() => init())
}
class CatalogInstaller extends Module.Installer {
override def configure(): Unit = {
val routes = newSetBinder[RouteController]()
bind[CommandSender[String, AuthorCommand, AuthorEvent]].to[AuthorCommandSender].in[SingletonScope]()
bind[SnapshotStateReader[String, Author]].to[AuthorStateReader].in[SingletonScope]()
routes.addBinding.to[AuthorsRoutes].in[SingletonScope]()
bind[CommandSender[UUID, BookCommand, BookEvent]].to[BookCommandSender].in[SingletonScope]()
bind[SnapshotStateReader[UUID, Book]].to[BookStateReader].in[SingletonScope]()
routes.addBinding.to[BooksRoutes].in[SingletonScope]()
bind[SnapshotStateReader[UUID, BookCard]].to[BooksCardsStateReader].in[SingletonScope]()
routes.addBinding.to[BooksCardsRoutes].in[SingletonScope]()
routes.addBinding.to[MetadataRoutes].in[SingletonScope]()
val graphs = newSetBinder[GraphBuilder]()
graphs.addBinding.to[HelloWorldGraph].in[SingletonScope]()
graphs.addBinding.to[BookPrinterGraph].in[SingletonScope]()
graphs.addBinding.to[GreetingsProducerGraph].in[SingletonScope]()
graphs.addBinding.to[GreetingsProducerMultiGraph].in[SingletonScope]()
graphs.addBinding.to[AuthorKafkaTable].in[SingletonScope]()
}
}
| 46,504
|
https://github.com/tha061/DataRing/blob/master/native/src/Server.h
|
Github Open Source
|
Open Source
|
MIT
| null |
DataRing
|
tha061
|
C
|
Code
| 1,659
| 3,204
|
#ifndef SERVER
#define SERVER
#include "../include/public_header.h"
#include "./process_noise.h"
/**
* @file Server.h
* @brief Definition of functions in Server class
* @author Tham Nguyen tham.nguyen@mq.edu.au, Nam Bui, Data Ring
* @date April 2020
*/
/**
* @brief This class provides functionalities of a single server in the Data Ring system.
* @details Functions include form an encrypted question from a query or a test, compute a answer for a test function from the encrypted partial view.
* @author Tham Nguyen tham.nguyen@mq.edu.au, Nam Bui, Data Ring
* @date April 2020
*/
class Server
{
public:
/// A key pair
gamal_key_t key;
/// The participant's dataset size
int size_dataset;
/// ratio of partial view to dataset size
double pv_ratio;
/// Encrypted query/test function
ENC_DOMAIN_MAP enc_question_map;
/// Precomputed encrypted query/test function for performance improvement
ENC_DOMAIN_MAP enc_question_map_pre;
/// Sample vector in clear
int *server_sample_vector_clear;
/// Sample Vector encrypted
gamal_ciphertext_t *server_sample_vector_encrypted;
/// Partial view sampled from permuted histogram
ENC_DOMAIN_MAP PV_sample_from_permuted_map;
/// Encrypted PV from the participant to be shared to all servers
ENC_DOMAIN_MAP un_permute_PV;
/// Indicating which attribute to be summed in a sum query
int index_attr_sum;
/// Subset of records included in the servers' backround knowledge
id_domain_set known_record_subset;
/// Set of labels in clear of the histogram
hash_pair_map plain_domain_map;
/// Vector of matching records from SQL query to query formulation
id_domain_vector match_query_domain_vect;
/**
* @brief Default constructor.
*/
Server();
/**
* @brief Initiate a server
* @param size dataset's size
* @param known_domain_dir Directory to background knowledge shared by all servers
*/
Server(int size, string known_domain_dir);
/**
* @brief Import .csv files from the file_url directory
* @param file_url link to the file of background knowledge
* @return a set of records of the participan't dataset known by all servers
*/
void importFile(string file_url);
/**
* @brief Finding matching labels to form a query
* @param test_or_query specify matching condition for a test or a query
* 1: test --> go to the test matching condition file
* 0: query --> go to the query matching condiftion file
*/
void generateMatchDomain(bool test_or_query);
/**
* @brief One server generate the sampling vector and encrypt it
* @param pre_enc_stack: pre-computed stack of enc(1) and enc(0)
* @param pv_ratio: ratio of partial view size to dataset size
* @param data_size: dataset size
* @return server_sample_vector_encrypted: an encrypted sampling vector
*/
// void createPVsamplingVector(ENC_Stack &pre_enc_stack, double pv_ratio, int data_size);
void createEncryptedPVSamplingVector(ENC_Stack &pre_enc_stack, int* server_sample_vector_clear);
/**
* @brief One server applies the encrypted sampling vector to PV from the permuted histogram map
* @param permuted_map_from_participant: ratio of partial view size to dataset size
* @param server_sample_vector_encrypted: an encrypted sampling vector
* @param pre_enc_stack: pre-computed stack of enc(1) and enc(0)
* @return PV_sample_from_permuted_map: an encrypted PV from the permuted histogram
*/
void generatePVfromPermutedHistogram(hash_pair_map permuted_map_from_participant,
gamal_ciphertext_t *server_sample_vector_encrypted, ENC_Stack &pre_enc_stack);
/**
* @brief Another server rerandomize the encrypted PV to prevent the server generated this PV link to the original label order
* @param PV_sample_from_permuted_map: the PV to be re-rendomised
* @param pre_enc_stack: pre-computed stack of enc(1) and enc(0)
* @return PV_sample_from_permuted_map and rerandomized.
*/
void rerandomizePVSampleFromPermutedHistogram(ENC_DOMAIN_MAP PV_sample_from_permuted_map, ENC_Stack &pre_enc_stack);
/**
* @brief A server un-permute the permuted PV to get the PV with orginal order of the label
* @param PV_sample_from_permuted_map: the PV to be un-permuted
* @param vector_un_permute_sort: the vector for un-permutation sent by participant
* @return un_permute_PV: the resulted PV
*/
void getUnPermutePV(ENC_DOMAIN_MAP PV_sample_from_permuted_map, vector<string> vector_un_permute_sort);
/**
* @brief Determine mininum number of known rows needs to be found in PV
* @param dataset: size of the dataset N
* @param int PV: size of the partial view
* @param known_records: number of known records in background knowledge: L
* @param $1-\eta$ the tolerated false positive rate
*/
float generatePVTestCondition(int dataset, int PV, int known_records, double eta);
/**
* @brief Pre-compute a test function or a query function
* @details This function pre-prepare a vector for a test function/query function, each element in the vector
* is a domain and its value is an enc(0).
* This is pre-computed so that when the server wishes to generate a test,
* it only needs to find the element where the domain is satisfied the condition
* of the test and changes it from enc(0) to enc(1)
* @param pre_enc_stack: point to the precomputed encryption stack
* @param enc_domain_map: partial view for server to get labels
* @return a precomputed test function/query function with all enc(0)
*/
void prepareTestFuntion_Query_Vector(ENC_Stack &pre_enc_stack, ENC_DOMAIN_MAP enc_domain_map);
/**
* @brief Generate the test that counts all records in the dataset that are known by the servers
* @details This function modifed the pre-computed test function for reduce runtime. The expected answer is L+/- noise
* @param pre_enc_stack: point to precomputed encryption stack of the serve
* @param enc_domain_map: set of labels in enc partial view
* @return an encrypted vector of enc(0) and enc(1), labels matched with partial view's labels
* enc(1) is placed to element with labels matched the L known records
* enc(0) is placed to all other elements
*/
void generateTestKnownRecords_opt(ENC_Stack &pre_enc_stack, ENC_DOMAIN_MAP enc_domain_map);
/**
* @brief Generates the test that counts all records in the dataset that are sampled in the partial view
* @details The expected answer is V+/- noise
* This function only re-randomises some of encryptions in the partial view map to reduce runtime
* @param pre_enc_stack: point to precomputed encryption stack of the serve
* @param enc_domain_map: set of labels in enc partial view
* @return an encrypted vector of enc(0) and enc(1), labels matched with partial view's labels
* enc(1) becomes a new ciphertext of 1
* enc(0) becomes a new ciphertext of 0
*/
void generateTestBasedPartialView_opt(ENC_Stack &pre_enc_stack, ENC_DOMAIN_MAP enc_domain_map);// added by Tham 16Dec
/**
* @brief Generates the test that counts all records in the dataset that have attributes satisfied given values
* @details This function modified a pre-computed test function and a matching domain function to reduce runtime
* server matches all records that have the attributes sastifing given values to labels in the pre-computed test function
* Then server add enc(1) to matched labels, enc(0) are remained as it in the pre-computed test version
* @param pre_enc_stack: point to precomputed encryption stack of the serve
* @return an encrypted vector of enc(0) and enc(1), labels matched with partial view's labels
*/
void generateTest_Target_Attr_opt(ENC_Stack &pre_enc_stack);
/**
* @brief Generates clear test function to compute answer from encrypted partial view,
* @details This test count all records in partial view that satify some condition
* server matches the labels of condition with the label in the partial view
* server matches all records that have the attributes sastifing given values using a matching function
* Then server place 1 to matched labels, 0 to non matched labels
* @param pre_enc_stack: point to precomputed encryption stack of the server
* @return an clear vector of 0 and 1, labels matched with partial view's labels
*/
void generate_Test_Target_Attr_Clear(ENC_Stack &pre_enc_stack); //not using pre_enc_stack at all
/**
* @brief Generates the test that counts all records in the dataset
* @details The expected answer is N+/- noise
* @param pre_enc_stack: point to precomputed encryption stack of the serve
* @param enc_domain_map: set of labels in enc partial view
* @return an encrypted vector of all enc(1), labels matched with partial view's labels
*/
void generateTest_Target_All_Records(ENC_Stack &pre_enc_stack, ENC_DOMAIN_MAP enc_domain_map);
/**
* @brief Generates encrypted query that counts all records in the dataset that match the query selection.
* @details This function modified a pre-computed query function and a matching domain function to reduce runtime
* server matches all records that have the attributes sastifing given values to labels in the pre-computed query function
* Then server add enc(1) to matched labels, enc(0) are remained as it in the pre-computed query version
* @param pre_enc_stack: point to precomputed encryption stack of the serve
* @return an encrypted vector of enc(0) and enc(1), labels matched with partial view's labels
*/
void generateNormalQuery_opt(ENC_Stack &pre_enc_stack);
/**
* @brief Generates encrypted query that counts all records in the dataset that match the query selection and then sum their attribute's value
* @details The answer is a sum of attribute's values of those matched records. This function modified a pre-computed query function and a matching domain function to reduce runtime
* The server matches all records that have the attributes sastifing given values to labels in the pre-computed query function
* Then server add enc(1) to matched labels, enc(0) are remained as it in the pre-computed query version
* @param pre_enc_stack: point to precomputed encryption stack of the serve
* @return an encrypted vector of enc(0) and enc(1), labels matched with partial view's labels and also the index of attribute to be sum up
*/
int generateNormalQuery_sum(ENC_Stack &pre_enc_stack, int index_attr_to_sum);
/**
* @brief Generates clear query to compute answer from encrypted partial view, in case a cheating party is detected
* @details The server matches all records that have the attributes sastifing given values using a matching function
* Then server add 1 to matched labels, 0 to non matched labels
* @param pre_enc_stack: point to precomputed encryption stack of the server
* @return an clear vector of 0 and 1, labels matched with partial view's labels
*/
void generateNormalQuery_Clear(ENC_Stack &pre_enc_stack); //Added by Tham 17 Feb 2020 for releasing phase
/**
* @brief Compute test result from the encrypted partial view
* @details servers then use this decrypted result as the input of function estimate_conf_interval()
* @param enc_domain_map: encrypted partial view
* @param enc_PV_answer: to store the encrypted answer
* @return an encrypted result from the partial view for the test
*/
void getTestResult_fromPV(ENC_DOMAIN_MAP enc_domain_map, gamal_ciphertext_t enc_PV_answer);
/**
* @brief This function is to get quer result from the encrypted PV in case a cheating party is detected
* @details servers then use this decrypted result as the input of function estimate_conf_interval()
* @param enc_PV: enc partial view
* @param enc_PV_answer: to store the encrypted answer
* @return an encrypted result from the partial view for the query
*/
void getQueryResult_fromPV(ENC_DOMAIN_MAP enc_PV, gamal_ciphertext_t enc_PV_query_answer);
};
#endif
| 5,134
|
https://github.com/aleksandr-aleksashin/TypeIndicatorConverter/blob/master/Json.Net/UnificationHelpers/NewtonsoftUnificationHelper.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
TypeIndicatorConverter
|
aleksandr-aleksashin
|
C#
|
Code
| 196
| 637
|
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
using System.Threading;
using TypeIndicatorConverter.Core.AssertionsAbstraction.Interfaces;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
namespace TypeIndicatorConverter.NewtonsoftJson.UnificationHelpers
{
internal class NewtonsoftUnificationHelper : IUnificationHelper<JToken, JsonSerializer>
{
public static readonly Lazy<NewtonsoftUnificationHelper> Instance = new(() => new NewtonsoftUnificationHelper(), LazyThreadSafetyMode.ExecutionAndPublication);
private NewtonsoftUnificationHelper() { }
public string? GetAsString(JToken element, JsonSerializer settings) => element.Value<string>();
public bool TryGetField(string name, JToken element, out JToken result)
{
result = element.SelectToken(name);
return result is not null;
}
public bool IsNullToken(JToken element) => element.Type == JTokenType.Null;
public bool IsUndefinedToken(JToken element) => element.Type == JTokenType.Undefined;
public string? GetNameDefinedByAttributes(PropertyInfo propertyInfo, Type baseType)
{
var s = propertyInfo.GetCustomAttribute<JsonPropertyAttribute>()?.PropertyName;
if (s != null)
{
return s;
}
string? name;
if (baseType.GetCustomAttribute<DataContractAttribute>() is not null)
{
name = propertyInfo.GetCustomAttribute<DataMemberAttribute>()?.Name ?? null;
}
else
{
name = null;
}
return name;
}
public IEnumerable<string> GetPossibleFieldName(JToken element, string basePropertyName, JsonSerializer options)
{
if (options is { ContractResolver: DefaultContractResolver { NamingStrategy: { } } dcr })
{
yield return dcr.NamingStrategy.GetPropertyName(basePropertyName, false);
yield break;
}
yield return basePropertyName;
}
public bool TryDeserialize(JToken element, JsonSerializer settings, Type? type, out object result)
{
result = null;
try
{
result = settings.Deserialize(element.CreateReader(), type);
return true;
}
catch (Exception)
{
//ignore
}
return false;
}
}
}
| 24,709
|
https://github.com/johnmbaughman/mvvm-dialogs/blob/master/samples/wpf/Demo.NonModalCustomDialog/CurrentTimeCustomDialog.cs
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
mvvm-dialogs
|
johnmbaughman
|
C#
|
Code
| 76
| 242
|
using System.Windows;
using System.Windows.Controls;
using MvvmDialogs;
namespace Demo.NonModalCustomDialog
{
public class CurrentTimeCustomDialog : IWindow
{
private readonly CurrentTimeDialog dialog;
public CurrentTimeCustomDialog()
{
dialog = new CurrentTimeDialog();
}
object IWindow.DataContext
{
get => dialog.DataContext;
set => dialog.DataContext = value;
}
bool? IWindow.DialogResult
{
get => dialog.DialogResult;
set => dialog.DialogResult = value;
}
ContentControl IWindow.Owner
{
get => dialog.Owner;
set => dialog.Owner = (Window)value;
}
bool? IWindow.ShowDialog()
{
return dialog.ShowDialog();
}
void IWindow.Show()
{
dialog.Show();
}
}
}
| 37,992
|
https://github.com/nidhineshnand/capisso/blob/master/client/src/components/utility/SnackbarMessage.tsx
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
capisso
|
nidhineshnand
|
TSX
|
Code
| 69
| 248
|
import React from 'react';
import Snackbar from '@material-ui/core/Snackbar';
import MuiAlert from '@material-ui/lab/Alert';
export interface ISnackbarMessageProps {
text: string;
severity: 'success' | 'info' | 'warning' | 'error';
isOpen: boolean;
setOpen: (isOpen: boolean) => void;
}
export const SnackbarMessage: React.FC<ISnackbarMessageProps> = ({
isOpen,
setOpen,
severity,
text,
}) => {
return (
<Snackbar
open={isOpen}
autoHideDuration={6000}
onClose={() => setOpen(false)}
>
<MuiAlert
elevation={6}
variant="filled"
severity={severity}
onClose={() => setOpen(false)}
>
{text}
</MuiAlert>
</Snackbar>
);
};
| 27,083
|
https://github.com/tdurieux/smartbugs-wild/blob/master/contracts/0x285088c75a8508664ad77df63e2d60a408e5284a.sol
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
smartbugs-wild
|
tdurieux
|
Solidity
|
Code
| 322
| 871
|
// File: @ensdomains/ens/contracts/ENS.sol
pragma solidity >=0.4.24;
interface ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external;
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
}
// File: contracts/Ownable.sol
pragma solidity ^0.5.0;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner {
require(isOwner(msg.sender));
_;
}
constructor() public {
owner = msg.sender;
}
function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function isOwner(address addr) public view returns (bool) {
return owner == addr;
}
}
// File: contracts/Controllable.sol
pragma solidity ^0.5.0;
contract Controllable is Ownable {
mapping(address=>bool) public controllers;
event ControllerChanged(address indexed controller, bool enabled);
modifier onlyController {
require(controllers[msg.sender]);
_;
}
function setController(address controller, bool enabled) public onlyOwner {
controllers[controller] = enabled;
emit ControllerChanged(controller, enabled);
}
}
// File: contracts/Root.sol
pragma solidity ^0.5.0;
contract Root is Ownable, Controllable {
bytes32 constant private ROOT_NODE = bytes32(0);
bytes4 constant private INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)"));
event TLDLocked(bytes32 indexed label);
ENS public ens;
mapping(bytes32=>bool) public locked;
constructor(ENS _ens) public {
ens = _ens;
}
function setSubnodeOwner(bytes32 label, address owner) external onlyController {
require(!locked[label]);
ens.setSubnodeOwner(ROOT_NODE, label, owner);
}
function setResolver(address resolver) external onlyOwner {
ens.setResolver(ROOT_NODE, resolver);
}
function lock(bytes32 label) external onlyOwner {
emit TLDLocked(label);
locked[label] = true;
}
function supportsInterface(bytes4 interfaceID) external pure returns (bool) {
return interfaceID == INTERFACE_META_ID;
}
}
| 14,745
|
https://github.com/justinhachemeister/NuGet.Lucene/blob/master/source/NuGet.Lucene.Web.Tests/MirroringPackageRepositoryFactoryTests.cs
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,017
|
NuGet.Lucene
|
justinhachemeister
|
C#
|
Code
| 108
| 541
|
using System;
using System.Net;
using Moq;
using NuGet.Lucene.Web.Models;
using NUnit.Framework;
namespace NuGet.Lucene.Web.Tests
{
[TestFixture]
public class MirroringPackageRepositoryFactoryTests
{
[SetUp]
public void SetUp()
{
EnvironmentUtility.SetRunningFromCommandLine();
}
[Test]
public void CreateWithoutOrigin()
{
var result = MirroringPackageRepositoryFactory.Create(new LocalPackageRepository("."), "", TimeSpan.Zero, false);
Assert.That(result.MirroringEnabled, Is.False, "MirroringEnabled");
}
[Test]
public void CreateWithOrigin()
{
var result = MirroringPackageRepositoryFactory.Create(new LocalPackageRepository("."),
"http://example.com/packages/", TimeSpan.Zero, false);
Assert.That(result.MirroringEnabled, Is.True, "MirroringEnabled");
}
[Test]
public void CreateWithAlwaysCheckMirrorSet()
{
var result = MirroringPackageRepositoryFactory.Create(new LocalPackageRepository("."),
"http://example.com/packages/", TimeSpan.Zero, true);
Assert.That(result, Is.InstanceOf<EagerMirroringPackageRepository>());
}
[Test]
public void OriginRepositorySendsCustomUserAgent()
{
var client = new Mock<IHttpClient>();
var request = (HttpWebRequest) WebRequest.Create("http://example.com/");
MirroringPackageRepositoryFactory.CreateDataServicePackageRepository(client.Object, TimeSpan.FromMilliseconds(1234));
client.Raise(c => c.SendingRequest += null, new WebRequestEventArgs(request));
Assert.That(request.UserAgent, Is.StringContaining("NuGet.Lucene.Web"));
Assert.That(request.Headers[RepositoryOperationNames.OperationHeaderName], Is.EqualTo(RepositoryOperationNames.Mirror));
Assert.That(request.Timeout, Is.EqualTo(1234));
}
}
}
| 4,094
|
https://github.com/disaster37/operator-elk-extra/blob/master/main.go
|
Github Open Source
|
Open Source
|
MIT
| null |
operator-elk-extra
|
disaster37
|
Go
|
Code
| 817
| 3,671
|
/*
Copyright 2022.
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 main
import (
"flag"
"os"
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
"k8s.io/client-go/dynamic"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"github.com/sirupsen/logrus"
core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
elkv1alpha1 "github.com/disaster37/operator-elk-extra/api/v1alpha1"
"github.com/disaster37/operator-elk-extra/controllers"
"github.com/disaster37/operator-elk-extra/pkg/helpers"
//+kubebuilder:scaffold:imports
)
var (
scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup")
version = "develop"
commit = ""
)
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(elkv1alpha1.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
utilruntime.Must(core.AddToScheme(scheme))
}
func main() {
var (
metricsAddr string
enableLeaderElection bool
probeAddr string
)
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
opts := zap.Options{
Development: true,
}
opts.BindFlags(flag.CommandLine)
flag.Parse()
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
log := logrus.New()
log.SetLevel(getLogrusLogLevel())
log.SetFormatter(&logrus.TextFormatter{
DisableQuote: true,
})
watchNamespace, err := getWatchNamespace()
var namespace string
var multiNamespacesCached cache.NewCacheFunc
if err != nil {
setupLog.Info("WATCH_NAMESPACES env variable not setted, the manager will watch and manage resources in all namespaces")
} else {
setupLog.Info("Manager look only resources on namespaces %s", watchNamespace)
watchNamespaces := helpers.StringToSlice(watchNamespace, ",")
if len(watchNamespaces) == 1 {
namespace = watchNamespace
} else {
multiNamespacesCached = cache.MultiNamespacedCacheBuilder(watchNamespaces)
}
}
printVersion(ctrl.Log, metricsAddr, probeAddr)
log.Infof("monitoring-operator version: %s - %s", version, commit)
cfg := ctrl.GetConfigOrDie()
timeout, err := getKubeClientTimeout()
if err != nil {
setupLog.Error(err, "KUBE_CLIENT_TIMEOUT must be a valid duration: %s", err.Error())
os.Exit(1)
}
cfg.Timeout = timeout
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "9275a4fc.k8s.webcenter.fr",
Namespace: namespace,
NewCache: multiNamespacesCached,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
os.Exit(1)
}
dinamicClient, err := dynamic.NewForConfig(cfg)
if err != nil {
setupLog.Error(err, "unable to init dinamic client")
os.Exit(1)
}
// License controller
licenseController := &controllers.LicenseReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
licenseController.SetLogger(log.WithFields(logrus.Fields{
"type": "LicenseController",
}))
licenseController.SetRecorder(mgr.GetEventRecorderFor("license-controller"))
licenseController.SetReconsiler(licenseController)
licenseController.SetDinamicClient(dinamicClient)
if err = licenseController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "License")
os.Exit(1)
}
// Secret controller
secretController := &controllers.SecretReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
secretController.SetLogger(log.WithFields(logrus.Fields{
"type": "SecretController",
}))
secretController.SetRecorder(mgr.GetEventRecorderFor("secret-controller"))
if err = secretController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Secret")
os.Exit(1)
}
// ILM controller
ilmController := &controllers.ElasticsearchILMReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
ilmController.SetLogger(log.WithFields(logrus.Fields{
"type": "ILMController",
}))
ilmController.SetRecorder(mgr.GetEventRecorderFor("ilm-controller"))
ilmController.SetReconsiler(ilmController)
ilmController.SetDinamicClient(dinamicClient)
if err = ilmController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ILM")
os.Exit(1)
}
// SLM controller
slmController := &controllers.ElasticsearchSLMReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
slmController.SetLogger(log.WithFields(logrus.Fields{
"type": "SLMController",
}))
slmController.SetRecorder(mgr.GetEventRecorderFor("slm-controller"))
slmController.SetReconsiler(slmController)
slmController.SetDinamicClient(dinamicClient)
if err = slmController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "SLM")
os.Exit(1)
}
// Snapshot repository controller
repositoryController := &controllers.ElasticsearchSnapshotRepositoryReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
repositoryController.SetLogger(log.WithFields(logrus.Fields{
"type": "RepositoryController",
}))
repositoryController.SetRecorder(mgr.GetEventRecorderFor("repository-controller"))
repositoryController.SetReconsiler(repositoryController)
repositoryController.SetDinamicClient(dinamicClient)
if err = repositoryController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Repository")
os.Exit(1)
}
// Component template controller
componentTemplateController := &controllers.ElasticsearchComponentTemplateReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
componentTemplateController.SetLogger(log.WithFields(logrus.Fields{
"type": "ComponentTemplateController",
}))
componentTemplateController.SetRecorder(mgr.GetEventRecorderFor("component-template-controller"))
componentTemplateController.SetReconsiler(componentTemplateController)
componentTemplateController.SetDinamicClient(dinamicClient)
if err = componentTemplateController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ComponentTemplate")
os.Exit(1)
}
// Index template controller
indexTemplateController := &controllers.ElasticsearchIndexTemplateReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
indexTemplateController.SetLogger(log.WithFields(logrus.Fields{
"type": "IndexTemplateController",
}))
indexTemplateController.SetRecorder(mgr.GetEventRecorderFor("index-template-controller"))
indexTemplateController.SetReconsiler(indexTemplateController)
indexTemplateController.SetDinamicClient(dinamicClient)
if err = indexTemplateController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "IndexTemplate")
os.Exit(1)
}
// Elasticsearch role controller
elasticsearchRoleController := &controllers.ElasticsearchRoleReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
elasticsearchRoleController.SetLogger(log.WithFields(logrus.Fields{
"type": "ElasticsearchRoleController",
}))
elasticsearchRoleController.SetRecorder(mgr.GetEventRecorderFor("es-role-controller"))
elasticsearchRoleController.SetReconsiler(elasticsearchRoleController)
elasticsearchRoleController.SetDinamicClient(dinamicClient)
if err = elasticsearchRoleController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ElasticsearchRole")
os.Exit(1)
}
// Role mapping controller
roleMappingController := &controllers.RoleMappingReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
roleMappingController.SetLogger(log.WithFields(logrus.Fields{
"type": "RoleMappingController",
}))
roleMappingController.SetRecorder(mgr.GetEventRecorderFor("role-mapping-controller"))
roleMappingController.SetReconsiler(roleMappingController)
roleMappingController.SetDinamicClient(dinamicClient)
if err = roleMappingController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "RoleMapping")
os.Exit(1)
}
// User controller
userController := &controllers.UserReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
userController.SetLogger(log.WithFields(logrus.Fields{
"type": "UserController",
}))
userController.SetRecorder(mgr.GetEventRecorderFor("user-controller"))
userController.SetReconsiler(userController)
userController.SetDinamicClient(dinamicClient)
if err = userController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "User")
os.Exit(1)
}
// Watch controller
watchController := &controllers.ElasticsearchWatcherReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}
watchController.SetLogger(log.WithFields(logrus.Fields{
"type": "WatchController",
}))
watchController.SetRecorder(mgr.GetEventRecorderFor("watch-controller"))
watchController.SetReconsiler(watchController)
watchController.SetDinamicClient(dinamicClient)
if err = watchController.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Watch")
os.Exit(1)
}
//+kubebuilder:scaffold:builder
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up health check")
os.Exit(1)
}
if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up ready check")
os.Exit(1)
}
setupLog.Info("starting manager")
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
setupLog.Error(err, "problem running manager")
os.Exit(1)
}
}
| 9,972
|
https://github.com/HaiBV/haibv.github.io/blob/master/gists/leetcode/51.N-Queens.js
|
Github Open Source
|
Open Source
|
CC0-1.0
| 2,023
|
haibv.github.io
|
HaiBV
|
JavaScript
|
Code
| 258
| 622
|
/**
* 51. N-Queens
* Array, Backtracking
*/
/**
* @param {number} n
* @return {string[][]}
*/
var solveNQueens = function (n) {
const board = new Array(n).fill().map(() => new Array(n).fill("."));
const result = [];
const pushToResult = () => result.push(board.map((row) => row.reduce((acc, val) => acc + val, "")));
const isQueenPlaced = (i, j) => {
if (i < 0 || j < 0) return false;
if (i >= n || j >= n) return false;
return board[i][j] !== ".";
};
const isAttacked = (i, j) => {
const isSameDiagonalLeft = () => {
let p = i;
let q = j;
while (p >= 0 && q >= 0) {
if (isQueenPlaced(p, q)) return true;
p -= 1;
q -= 1;
}
return false;
};
const isSameDiagonalRight = () => {
let p = i;
let q = j;
while (p >= 0 && q < n) {
if (isQueenPlaced(p, q)) return true;
p -= 1;
q += 1;
}
return false;
};
return isSameDiagonalLeft() || isSameDiagonalRight();
};
let rowsPlaced = {};
let colPlaced = {};
const backtrack = (i = 0, j = 0, queensPlaced = 0) => {
if (queensPlaced === n) return pushToResult();
if (i >= n || j >= n) return;
if (rowsPlaced[i]) return;
if (colPlaced[j]) return backtrack(i, j + 1, queensPlaced);
if (!isAttacked(i, j)) {
rowsPlaced[i] = true;
colPlaced[j] = true;
board[i][j] = "Q";
backtrack(i + 1, 0, queensPlaced + 1);
board[i][j] = ".";
colPlaced[j] = false;
rowsPlaced[i] = false;
}
return backtrack(i, j + 1, queensPlaced);
};
backtrack();
return result;
};
| 2,077
|
https://github.com/Geomatys/sis/blob/master/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ExpandableList.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
sis
|
Geomatys
|
Java
|
Code
| 2,171
| 4,544
|
/*
* 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.
*/
package org.apache.sis.gui.dataset;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.Collection;
import javafx.util.Callback;
import javafx.event.EventHandler;
import javafx.scene.input.MouseEvent;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.text.TextAlignment;
import javafx.collections.ListChangeListener;
import javafx.collections.transformation.TransformationList;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill;
import org.apache.sis.internal.util.UnmodifiableArrayList;
import org.apache.sis.internal.gui.Styles;
import org.apache.sis.feature.AbstractFeature;
/**
* Wraps a {@link FeatureList} with the capability to expand the multi-valued properties of
* a selected {@code Feature}. The expansion appears as additional rows below the feature.
* This view is used only if the feature type contains at least one property type with a
* maximum number of occurrence greater than 1.
*
* @author Martin Desruisseaux (Geomatys)
* @version 1.1
* @since 1.1
* @module
*/
final class ExpandableList extends TransformationList<AbstractFeature,AbstractFeature>
implements Callback<TableColumn<AbstractFeature,AbstractFeature>, TableCell<AbstractFeature,AbstractFeature>>,
EventHandler<MouseEvent>
{
/**
* The background of {@linkplain #expansion} rows header.
*/
private static final Background EXPANSION_HEADER =
new Background(new BackgroundFill(Styles.EXPANDED_ROW, null, null));
/**
* The icon for rows that can be expanded.
* Set to the Unicode supplementary character U+1F5C7 "Empty Note Pad".
*/
private static final String EXPANDABLE = "\uD83D\uDDC7";
/**
* The icon for rows that are expanded.
* Set to the Unicode supplementary character U+1F5CA "Note Pad".
*/
private static final String EXPANDED = "\uD83D\uDDCA";
/**
* Mapping from property names to index in the {@link ExpandedFeature#values} array.
* This map is shared by all {@link ExpandedFeature} instances contained in this list.
* It shall be modified only if this list has been cleared first.
*/
private final Map<String,Integer> nameToIndex;
/**
* View index of the first row of the currently expanded feature, {@link Integer#MAX_VALUE} if none.
* Expansion rows will be added or removed <em>below</em> this row; this row itself will not be removed.
*/
private int indexOfExpanded;
/**
* The rows of the expanded feature, or {@code null} if none. If non-null, this array shall never be empty.
* The reason why we do not allow empty arrays is because we will insert {@code expansion.length - 1} rows
* below the expanded feature. Consequently empty arrays cause negative indices that are more difficult to
* debug than {@link NullPointerException}, because they happen later.
*
* <p>If non-null, they array should have at least 2 elements. An array of only 1 element is not wrong,
* but is useless since it has no additional rows to show below the first row.</p>
*/
private ExpandedFeature[] expansion;
/**
* Creates a new expandable list for the given features.
*
* @param features the {@link FeatureList} list to wrap.
*/
ExpandableList(final FeatureList features) {
super(features);
nameToIndex = new LinkedHashMap<>();
indexOfExpanded = Integer.MAX_VALUE;
}
/**
* Specifies the names of properties that may be multi-valued. This method needs to be invoked
* only if the {@code FeatureType} changed. This method shall not be invoked if there is any
* {@link #expansion} rows. Normally this list will be empty at invocation time.
*
* @param columnNames names of properties that may contain multi-values.
*/
final void setMultivaluedColumns(final List<String> columnNames) {
assert expansion == null : indexOfExpanded;
nameToIndex.clear();
final int size = columnNames.size();
for (int i=0; i<size; i++) {
nameToIndex.putIfAbsent(columnNames.get(i), i);
}
}
/**
* Removes the expanded rows. This method does not fire change event;
* it is caller's responsibility to perform those tasks.
*
* <div class="note"><b>Note:</b> we return {@code null} instead of an empty list if
* there is no removed element because we want to force callers to perform a null check.
* The reason is that if there was no expansion rows, then {@link #indexOfExpanded} has an
* invalid value and using that value in {@link #nextRemove(int, List)} may be dangerous.
* A {@link NullPointerException} would intercept that error sooner.</div>
*
* @return the removed rows, or {@code null} if none.
*/
private List<AbstractFeature> shrink() {
final List<AbstractFeature> removed = (expansion == null) ? null
: UnmodifiableArrayList.wrap(expansion, 1, expansion.length);
expansion = null;
indexOfExpanded = Integer.MAX_VALUE;
return removed;
}
/**
* Clears all elements from this list. This method removes the expanded rows before to
* remove the rest of the list because otherwise, the {@code sourceChanged(…)} method in
* this class would have to expand the whole feature list for inserting removed elements.
*/
@Override
public void clear() {
final int removeAfter = indexOfExpanded;
final List<AbstractFeature> removed = shrink();
if (removed != null) {
beginChange();
nextUpdate(removeAfter);
nextRemove(removeAfter + 1, removed);
endChange();
}
getSource().clear();
}
/**
* Invoked when user clicked on the icon on the left of a row.
* The method sets the expanded rows to the ones containing the clicked cell.
* If that row is the currently expanded one, then it will be reduced to a single row.
*/
@Override
public void handle(final MouseEvent event) {
/*
* Remove the additional rows from this list. Before doing so, we need to remember
* what we are removing from this list view in order to send notification later.
*/
final IconCell cell = (IconCell) event.getSource();
final int index = getSourceIndex(cell.getIndex()); // Must be invoked before `shrink()`.
final int removeAfter = indexOfExpanded;
final List<AbstractFeature> removed = shrink();
// index = getViewIndex(index); // Not needed for current single-selection model.
/*
* If a new row is selected, extract now all properties. We need at least the number
* of properties anyway for determining the number of additional rows. But we store
* also the property values in arrays for convenience because we can not use indices
* on arbitrary collections (they may not be lists). This is okay on the assumption
* that the number of elements is not large.
*/
if (index != indexOfExpanded) {
expansion = ExpandedFeature.create(cell.getItem(), nameToIndex);
if (expansion != null) {
indexOfExpanded = index;
final int limit = Integer.MAX_VALUE - getSource().size();
if (expansion.length > limit) {
if (limit > 1) {
expansion = Arrays.copyOf(expansion, limit); // Drop last rows for avoiding integer overflow.
} else {
expansion = null; // Drop completely for avoiding integer overflow.
indexOfExpanded = Integer.MAX_VALUE;
}
}
}
}
/*
* Send change notifications only after all states have been updated.
*/
beginChange();
if (removed != null) {
nextUpdate(removeAfter);
nextRemove(removeAfter + 1, removed);
}
if (expansion != null) {
// An ArithmeticException below would be a bug in above limit adjustment.
nextAdd(indexOfExpanded + 1, Math.addExact(indexOfExpanded, expansion.length));
}
endChange();
}
/**
* Returns {@code true} if the given feature contains more than one row.
*/
private boolean isExpandable(final AbstractFeature feature) {
if (feature != null) {
for (final String name : nameToIndex.keySet()) {
final Object value = feature.getPropertyValue(name);
if (value instanceof Collection<?>) {
final int size = ((Collection<?>) value).size();
if (size >= 2) {
return true;
}
}
}
}
return false;
}
/**
* Returns the number of elements in this list.
*/
@Override
public int size() {
int size = getSource().size();
if (size != 0 && expansion != null) {
size += expansion.length - 1;
}
return size;
}
/**
* Returns the feature at the given index. This method forwards the request to the source,
* except if the given index is for an expanded row.
*/
@Override
public AbstractFeature get(int index) {
final int i = index - indexOfExpanded;
if (i >= 0) {
final int n = expansion.length; // A NullPointerException here would be an ExpandableList bug.
if (i < n) return expansion[i];
index -= n;
}
return getSource().get(index);
}
/**
* Given an index in this expanded list, returns the index of corresponding element in the feature list.
* All indices from {@link #indexOfExpanded} inclusive to <code>{@linkplain #indexOfExpanded} +
* {@linkplain #expansion}.length</code> exclusive map to the same {@link AbstractFeature} instance.
*
* @param index index in this expandable list.
* @return index of the corresponding element in {@link FeatureList}.
*/
@Override
public int getSourceIndex(int index) {
if (index > indexOfExpanded) {
index = Math.max(indexOfExpanded, index - (expansion.length - 1));
// A NullPointerException above would be an ExpandableList bug.
}
return index;
}
/**
* Given an index in the feature list, returns the index in this expandable list.
* If the given index maps the expanded feature, then the returned index will be
* for the first row. This is okay if the lower index inclusive or for upper index
* <em>exclusive</em> (it would not be okay for upper index inclusive).
*
* @param index index in the wrapped {@link FeatureList}.
* @return index of the corresponding element in this list.
*/
@Override
public int getViewIndex(int index) {
if (index > indexOfExpanded) {
index += expansion.length - 1;
// A NullPointerException above would be an ExpandableList bug.
}
return index;
}
/**
* Notifies all listeners that the list changed. This method expects an event from the wrapped
* {@link FeatureList} and converts source indices to indices of this expandable list.
*/
@Override
protected void sourceChanged(final ListChangeListener.Change<? extends AbstractFeature> c) {
fireChange(new ListChangeListener.Change<AbstractFeature>(this) {
@Override public void reset() {c.reset();}
@Override public boolean next() {return c.next();}
@Override public boolean wasAdded() {return c.wasAdded();}
@Override public boolean wasRemoved() {return c.wasRemoved();}
@Override public boolean wasReplaced() {return c.wasReplaced();}
@Override public boolean wasUpdated() {return c.wasUpdated();}
@Override public boolean wasPermutated() {return c.wasPermutated();}
@Override protected int[] getPermutation() {return null;} // Not invoked since we override the method below.
@Override public int getPermutation(int i) {return getViewIndex(c.getPermutation(getSourceIndex(i)));}
@Override public int getFrom() {return getViewIndex(c.getFrom());}
@Override public int getTo() {
// If remove only, must be where removed elements were positioned in the list.
return (wasAdded() || !wasRemoved()) ? getViewIndex(c.getTo()) : getFrom();
}
@Override
public int getRemovedSize() {
int removedSize = c.getRemovedSize();
if (overlapExpanded(c.getFrom(), removedSize)) {
removedSize += expansion.length - 1;
}
return removedSize;
}
@Override
@SuppressWarnings("unchecked")
public List<AbstractFeature> getRemoved() {
return (List<AbstractFeature>) expandRemoved(c.getFrom(), c.getRemoved());
}
});
}
/**
* Returns {@code true} if the given range of removed rows overlaps the expanded rows.
*/
private boolean overlapExpanded(final int sourceFrom, final int removedSize) {
return (sourceFrom <= indexOfExpanded && sourceFrom > indexOfExpanded - removedSize); // Use - for avoiding overflow.
}
/**
* If the range of removed elements overlaps the range of expanded rows, inserts values in the
* {@code removed} list for the expanded rows. Actually this insertion should never happens in
* the way we use {@link ExpandableList}, but we check as a safety.
*
* @param sourceFrom index of the first removed element in the source list.
* @param removed the removed elements provided by the {@link FeatureList}.
* @return the removed elements as seen by this {@code ExpandableList}.
*/
private List<? extends AbstractFeature> expandRemoved(final int sourceFrom, final List<? extends AbstractFeature> removed) {
if (!overlapExpanded(sourceFrom, removed.size())) {
return removed;
}
final int s = indexOfExpanded;
final int n = expansion.length; // A NullPointerException here would be an ExpandableList bug.
final AbstractFeature[] features = removed.toArray(new AbstractFeature[removed.size() + (n - 1)]);
System.arraycopy(features, s+1, features, s + n, features.length - (s+1));
System.arraycopy(expansion, 0, features, s, n);
return Arrays.asList(features);
}
/**
* Creates a new cell for an icon to show at the beginning of a row.
* This method is provided for allowing {@code ExpandableList} to be
* given to {@link TableColumn#setCellFactory(Callback)}.
*
* @param column the column where the cell will be shown.
*/
@Override
public TableCell<AbstractFeature,AbstractFeature> call(final TableColumn<AbstractFeature,AbstractFeature> column) {
return new IconCell();
}
/**
* The cell which represents whether a row is expandable or expanded.
* If visible, this is the first column in the table.
*/
private final class IconCell extends TableCell<AbstractFeature,AbstractFeature> {
/**
* Whether this cell is listening to mouse click events.
*/
private boolean isListening;
/**
* Creates a new cell for feature property value.
*/
IconCell() {
setTextAlignment(TextAlignment.CENTER);
}
/**
* Invoked when a new feature needs to be show. This method sets an icon depending on
* whether there is multi-valued properties, and whether the current row is expanded.
* The call will have a listener only if it has an icon.
*/
@Override
protected void updateItem(final AbstractFeature value, final boolean empty) {
super.updateItem(value, empty);
Background b = null;
String text = null;
if (value instanceof ExpandedFeature) {
/*
* If this is the selected row, put an icon only on the first row,
* not on additional rows showing the other collection elements.
*/
if (((ExpandedFeature) value).index == 0) {
text = EXPANDED;
} else {
b = EXPANSION_HEADER;
}
} else if (isExpandable(value)) {
text = EXPANDABLE;
}
setBackground(b);
setText(text);
if (isListening != (isListening = (text != null))) { // Check whether `isListening` changed.
if (isListening) {
addEventFilter(MouseEvent.MOUSE_CLICKED, ExpandableList.this);
} else {
removeEventFilter(MouseEvent.MOUSE_CLICKED, ExpandableList.this);
}
}
}
}
}
| 8,008
|
https://github.com/gravitee-lab/gravitee-management-rest-api/blob/master/gravitee-rest-api-service/src/main/java/io/gravitee/rest/api/service/impl/ApiMetadataServiceImpl.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
gravitee-management-rest-api
|
gravitee-lab
|
Java
|
Code
| 242
| 725
|
/**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* 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.gravitee.rest.api.service.impl;
import io.gravitee.rest.api.model.*;
import io.gravitee.rest.api.service.ApiMetadataService;
import org.springframework.stereotype.Component;
import java.util.List;
import static io.gravitee.repository.management.model.MetadataReferenceType.API;
import static java.util.stream.Collectors.toList;
/**
* @author Azize ELAMRANI (azize at graviteesource.com)
* @author GraviteeSource Team
*/
@Component
public class ApiMetadataServiceImpl extends AbstractReferenceMetadataService implements ApiMetadataService {
@Override
public List<ApiMetadataEntity> findAllByApi(final String apiId) {
final List<ReferenceMetadataEntity> allMetadata = findAllByReference(API, apiId, true);
return allMetadata.stream()
.map(m -> convert(m, apiId))
.collect(toList());
}
@Override
public ApiMetadataEntity findByIdAndApi(final String metadataId, final String apiId) {
return convert(findByIdAndReference(metadataId, API, apiId, true), apiId);
}
@Override
public void delete(final String metadataId, final String apiId) {
delete(metadataId, API, apiId);
}
@Override
public ApiMetadataEntity create(final NewApiMetadataEntity metadataEntity) {
return convert(create(metadataEntity, API, metadataEntity.getApiId(), true), metadataEntity.getApiId());
}
@Override
public ApiMetadataEntity update(final UpdateApiMetadataEntity metadataEntity) {
return convert(update(metadataEntity, API, metadataEntity.getApiId(), true), metadataEntity.getApiId());
}
private ApiMetadataEntity convert(ReferenceMetadataEntity m, String apiId) {
final ApiMetadataEntity apiMetadataEntity = new ApiMetadataEntity();
apiMetadataEntity.setKey(m.getKey());
apiMetadataEntity.setName(m.getName());
apiMetadataEntity.setFormat(m.getFormat());
apiMetadataEntity.setValue(m.getValue());
apiMetadataEntity.setDefaultValue(m.getDefaultValue());
apiMetadataEntity.setApiId(apiId);
return apiMetadataEntity;
}
}
| 26,839
|
https://github.com/XiaoMutt/ucbc/blob/master/experiments/uniform.py
|
Github Open Source
|
Open Source
|
MIT
| null |
ucbc
|
XiaoMutt
|
Python
|
Code
| 72
| 341
|
from experiments.basis import *
class UniformExperimentWithin(Experiment):
TITLE = "Uniform (Rewards within [0,1])"
def __init__(self, solvers: tp.List[tp.Type[Solver]]):
super(UniformExperimentWithin, self).__init__(
solvers=solvers,
bandit=UniformBandit([(0, 0.4), (0, .5), (0, 0.6)])
)
class UniformExperimentBeyond(Experiment):
TITLE = "Uniform (Rewards beyond [0,1])"
def __init__(self, solvers: tp.List[tp.Type[Solver]]):
super(UniformExperimentBeyond, self).__init__(
solvers=solvers,
bandit=UniformBandit([(0, 4), (0, 5), (0, 6)])
)
class UniformExperimentWithin10RandomArms(Experiment):
TITLE = "Uniform (Rewards Within [0,1] 10 random arms)"
def __init__(self, solvers: tp.List[tp.Type[Solver]]):
super(UniformExperimentWithin10RandomArms, self).__init__(
solvers=solvers,
bandit=UniformBandit([sorted(np.random.random(2)) for _ in range(10)])
)
| 16,525
|
https://github.com/snoussi/kie-docs/blob/master/doc-content/drools-docs/src/main/asciidoc/AuthoringAssets/test-scenarios-comparison-legacy-new-ref.adoc
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
kie-docs
|
snoussi
|
AsciiDoc
|
Code
| 785
| 1,534
|
[id='test-scenarios-comparison-legacy-new-ref']
= Feature comparison of legacy and new test scenario designer
{PRODUCT} supports both the new test scenario designer and the former test scenario (Legacy) designer.
The default designer is the new test scenario designer, which supports testing of both rules and DMN models, and provides an enhanced overall user experience with test scenarios. You can continue to use the legacy test scenario designer, which only supports rule-based test scenarios.
IMPORTANT: The new test scenario designer has an improved layout and feature set and continues to be developed. However, the legacy test scenario designer is deprecated with {PRODUCT} 7.3.0 and will be removed in a future {PRODUCT} release.
The following table highlights the main features of legacy and new test scenario designer, which are supported in {PRODUCT} to help you decide a suitable test scenario designer in your project.
* `+` indicates that the feature is present in the test scenario designer.
* `-` indicates that the feature is not present in the test scenario designer.
.Main features of legacy and new test scenario designer
[cols="40%,20%,20%,40%", options="header"]
|===
|Feature & highlights
|New designer
|Legacy designer
|Documentation
a|*Creating and running a test scenario*
* You can create test scenarios in {CENTRAL} to test the functionality of business rule data before deployment.
* A basic test scenario must have at least a related data objects, *GIVEN* facts, and *EXPECT* results.
* You can run the tests to validate your business rules and data.
|`+`
|`+`
a|
* For more information about creating rule and DMN-based test scenarios, see xref:test-designer-create-test-scenario-template-con[].
* For more information about running the test scenarios, see xref:test-designer-run-test-proc[].
* For more information about creating and running test scenarios (legacy), see xref:test-scenarios-legacy-create-proc[].
a|*Adding GIVEN facts in test scenarios*
* You can insert and verify the *GIVEN* facts for the test.
|`+`
|`+`
a|
* For more information about adding *GIVEN* facts in new test scenario designer, see xref:test-designer-create-test-scenario-template-con[].
* For more information about adding *GIVEN* facts in test scenarios (legacy), see xref:test-scenarios-legacy-GIVEN-proc[].
a|*Adding EXPECT results in test scenarios*
* The *EXPECT* section defines the expected results based on the *GIVEN* input facts.
* It represents the objects and their fields whose exact values are checked based on the provided information.
|`+`
|`+`
a|
* For more information about adding *EXPECT* results in new test scenario designer, see xref:test-designer-create-test-scenario-template-con[].
* For more information about adding *EXPECT* results in test scenarios (legacy), see xref:test-scenarios-legacy-EXPECT-proc[].
a|*KIE session*
* You can set KIE session on test scenario level settings.
|`+`
|`+`
|NA
a|*KIE base on test scenario level*
* You can set KIE base on test scenario level settings.
|`-`
|`+`
|NA
a|*KIE base on project level*
* You can set KIE base on project level settings.
|`+`
|`+`
|NA
a|*Simulated date and time*
* You can set a simulated date and time for the legacy test scenario designer.
|`-`
|`+`
|NA
a|*Rule flow group*
* You can specify a rule flow group to be activated to test all the rules within that group.
|`+`
|`+`
a|
* For more information about setting rule flow group in new test scenarios, see xref:test-designer-global-settings-panel-rule-based-proc[].
* For more information about setting rule flow group in test scenarios (legacy), xref:test-scenarios-legacy-GIVEN-proc[].
a|*Global variables*
* Global variables are named objects that are visible to the decision engine but are different from the objects for facts.
* Setting global variables for new test scenario is deprecated .
* In case you want to reuse data sets for different scenarios, you can use the *Background* instance.
|`-`
|`+`
a|
* For more information about *Background* instance in new test scenarios, see xref:test-scenarios-background-instance-con[].
* For more information about global variables in test scenarios (legacy), see xref:test-scenarios-legacy-create-proc[].
a|*Call method*
* You can use this to invoke a method from another fact when the rule execution is initiated.
* You can invoke any Java class methods from the Java library or from a JAR that was imported for the project.
|`+`
|`+`
a|
* For more information about calling a method in new test scenarios, see xref:test-designer-expressions-syntax-intro-ref[].
* For more information about calling a method in test scenarios (legacy), see xref:test-scenarios-legacy-create-proc[].
a|*Modify an existing fact*
* You can modify a previously inserted fact in the decision engine between executions of the scenario.
|`-`
|`+`
|For more information about modifying an existing fact in test scenarios (legacy), see xref:test-scenarios-legacy-GIVEN-proc[].
a|*Bound variable*
* You can set the value of a field to the fact bound to a selected variable.
* In the new test scenario designer, you can not define a variable inside a test scenario grid and reuse it inside *GIVEN* or *EXPECTED* cells.
|`-`
|`+`
|For more information about how to set bound variables in test scenarios (legacy), see xref:test-scenarios-legacy-GIVEN-proc[].
|===
| 12,546
|
https://github.com/NickPuchko/SwiftyWay-MoscowTravelHack/blob/master/TravelGuide/TravelGuide/Networkers/RouteNetworkService.swift
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
SwiftyWay-MoscowTravelHack
|
NickPuchko
|
Swift
|
Code
| 137
| 543
|
//
// RouteNetworkService.swift
// TravelGuide
//
// Created by Николай Пучко on 28.03.2021.
//
import Foundation
import Alamofire
class RouteNetworkService {
private lazy var decoder: JSONDecoder = {
var result = JSONDecoder()
result.keyDecodingStrategy = .convertFromSnakeCase
return result
}()
private func makeURL(tourUuid: String) -> URL? {
let token = "7c6c2db9-d237-4411-aa0e-f89125312494"
var result = URLComponents()
result.scheme = "https"
result.host = "api.izi.travel"
result.path = "/mtgobjects/\(tourUuid)"
result.query = "languages=ru,en&includes=all&except=translations,publisher,download&api_key=\(token)"
return result.url
}
//https://api.izi.travel/mtgobjects/91653357-ad92-4de8-9ab9-224ca1c96316?languages=ru,en&includes=all&except=translations,publisher,download&api_key=7c6c2db9-d237-4411-aa0e-f89125312494
func getRoute(tourUuid: String, completion: @escaping (Result<Route?, AFError>) -> Void) {
guard let url = makeURL(tourUuid: tourUuid) else {
completion(.failure(.otherError))
return
}
AF.request(url).response { response in
switch response.result {
case .failure(let error):
print(error)
completion(.failure(.getError))
case .success(let data):
guard let json = data else {
completion(.failure(.otherError))
return
}
do {
let routes = try self.decoder.decode([Route].self, from: json)
completion(.success(routes.first))
} catch let error {
print(error)
completion(.failure(.otherError))
}
}
}
}
}
| 14,536
|
https://github.com/tido64/rainbow/blob/master/build/ios/Rainbow/AppDelegate.h
|
Github Open Source
|
Open Source
|
BSD-3-Clause, MIT, Apache-2.0
| 2,021
|
rainbow
|
tido64
|
Objective-C
|
Code
| 37
| 98
|
// Copyright (c) 2010-present Bifrost Entertainment AS and Tommy Nguyen
// Distributed under the MIT License.
// (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property(strong, nonatomic) UIWindow *window;
@end
| 50,632
|
https://github.com/h5p/h5p-wordpress-plugin/blob/master/languages/h5p-nb_NO.po
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
h5p-wordpress-plugin
|
h5p
|
Gettext Catalog
|
Code
| 9,267
| 24,069
|
msgid ""
msgstr ""
"Project-Id-Version: H5P\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/h5p-wordpress-"
"plugin-master\n"
"POT-Creation-Date: 2022-03-02 16:26:07+00:00\n"
"PO-Revision-Date: \n"
"Last-Translator: Frode Petterson <frode.petterson@joubel.com>\n"
"Language-Team: Joubel <contact@joubel.com>\n"
"Language: nb\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
"_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
"t\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
"X-Poedit-SearchPathExcluded-1: .git\n"
#: admin/class-h5p-content-admin.php:185 admin/class-h5p-content-admin.php:697
#: admin/class-h5p-library-admin.php:215 admin/class-h5p-privacy-policy.php:431
msgid "Title"
msgstr "Tittel"
#: admin/class-h5p-content-admin.php:189 admin/class-h5p-content-admin.php:701
#: admin/class-h5p-privacy-policy.php:471
msgid "Content type"
msgstr "Innholdstype"
#: admin/class-h5p-content-admin.php:194 admin/class-h5p-content-admin.php:706
msgid "Author"
msgstr "Opphavsmann"
#: admin/class-h5p-content-admin.php:199 admin/class-h5p-content-admin.php:711
#: admin/views/new-content.php:98 admin/views/show-content.php:39
msgid "Tags"
msgstr "Stikkord"
#: admin/class-h5p-content-admin.php:204 admin/class-h5p-content-admin.php:716
msgid "Last modified"
msgstr "Sist modifisert"
#: admin/class-h5p-content-admin.php:208 admin/class-h5p-privacy-policy.php:373
#: admin/class-h5p-privacy-policy.php:427
msgid "ID"
msgstr "ID"
#: admin/class-h5p-content-admin.php:227 admin/class-h5p-content-admin.php:724
#: admin/views/select-content.php:31
msgid "No H5P content available. You must upload or create new content."
msgstr ""
"Intet H5P-innhold er tilgjengelig. Du må laste opp eller lage nytt innhold."
#: admin/class-h5p-content-admin.php:238
msgid "You are not allowed to view this content."
msgstr "Du har ikke lov til å se dette innholdet."
#: admin/class-h5p-content-admin.php:278
msgid "User"
msgstr "Bruker"
#: admin/class-h5p-content-admin.php:282 admin/class-h5p-plugin-admin.php:1042
#: admin/class-h5p-privacy-policy.php:264
msgid "Score"
msgstr "Poeng"
#: admin/class-h5p-content-admin.php:286 admin/class-h5p-plugin-admin.php:1046
#: admin/class-h5p-privacy-policy.php:268
msgid "Maximum Score"
msgstr "Maksimum poeng"
#: admin/class-h5p-content-admin.php:290 admin/class-h5p-plugin-admin.php:1050
#: admin/class-h5p-privacy-policy.php:272
msgid "Opened"
msgstr "Åpnet"
#: admin/class-h5p-content-admin.php:294 admin/class-h5p-plugin-admin.php:1054
#: admin/class-h5p-privacy-policy.php:276
msgid "Finished"
msgstr "Fullført"
#: admin/class-h5p-content-admin.php:297 admin/class-h5p-plugin-admin.php:1057
#: admin/class-h5p-privacy-policy.php:280
msgid "Time spent"
msgstr "Tid brukt"
#: admin/class-h5p-content-admin.php:300
msgid "There are no logged results for this content."
msgstr "Det er ingen loggede resultater for dette innholdet."
#: admin/class-h5p-content-admin.php:317 admin/class-h5p-library-admin.php:147
msgid "Unknown task."
msgstr "Ukjent oppgave."
#: admin/class-h5p-content-admin.php:352
msgid "You are not allowed to edit this content."
msgstr "Du har ikke lov til å redigere dette innholdet."
#: admin/class-h5p-content-admin.php:374
msgid "Invalid confirmation code, not deleting."
msgstr "Ugyldig bekreftelseskode, slettes ikke."
#: admin/class-h5p-content-admin.php:564
msgid "Invalid library."
msgstr "Ugyldig bibliotek."
#: admin/class-h5p-content-admin.php:569
msgid "Something unexpected happened. We were unable to save this content."
msgstr "Noe uventet har skjedd. Vi kunne ikke lagre dette innholdet."
#: admin/class-h5p-content-admin.php:576
msgid "No such library."
msgstr "Biblioteket finnes ikke."
#: admin/class-h5p-content-admin.php:587
msgid "Invalid parameters."
msgstr "Ugyldige parametere."
#: admin/class-h5p-content-admin.php:597 admin/class-h5p-content-admin.php:656
msgid "Missing %s."
msgstr "Mangler %s."
#: admin/class-h5p-content-admin.php:602
msgid "Title is too long. Must be 256 letters or shorter."
msgstr "Tittelen er for lang. Den må være 256 tegn eller kortere."
#: admin/class-h5p-content-admin.php:674
msgid "Insert interactive content"
msgstr "Sett inn interaktivt innhold"
#: admin/class-h5p-content-admin.php:676
msgid "Add H5P"
msgstr "Legg til H5P"
#: admin/class-h5p-content-admin.php:849
msgid "%s ago"
msgstr "%s siden"
#: admin/class-h5p-content-admin.php:907
msgid "Insert"
msgstr "Sett inn"
#: admin/class-h5p-content-admin.php:939 admin/class-h5p-privacy-policy.php:288
#: admin/views/new-content.php:21 admin/views/show-content.php:17
msgid "Results"
msgstr "Resultater"
#: admin/class-h5p-content-admin.php:948 admin/views/content-results.php:18
#: admin/views/new-content.php:18 admin/views/show-content.php:20
msgid "Edit"
msgstr "Rediger"
#: admin/class-h5p-content-admin.php:1044
msgid "Are you sure you wish to delete this content?"
msgstr "Er du sikker på at du ønsker å slette dette innholdet?"
#: admin/class-h5p-library-admin.php:62 admin/views/new-content.php:57
msgid "Delete"
msgstr "Slett"
#: admin/class-h5p-library-admin.php:65
msgid "Content Upgrade"
msgstr "Innholdsoppgradering"
#: admin/class-h5p-library-admin.php:102
msgid "Cannot find library with id: %d."
msgstr "Finner ikke biblioteket med id: %d."
#: admin/class-h5p-library-admin.php:167 admin/class-h5p-library-admin.php:379
msgid "N/A"
msgstr "Ikke tilgjengelig"
#: admin/class-h5p-library-admin.php:168
msgid "View library details"
msgstr "Vis detaljer for biblioteket"
#: admin/class-h5p-library-admin.php:169
msgid "Delete library"
msgstr "Slett biblioteket"
#: admin/class-h5p-library-admin.php:170
msgid "Upgrade library content"
msgstr "Oppgrader innhold"
#: admin/class-h5p-library-admin.php:216
msgid "Restricted"
msgstr "Begrenset"
#: admin/class-h5p-library-admin.php:218 admin/class-h5p-privacy-policy.php:479
msgid "Contents"
msgstr "Innhold"
#: admin/class-h5p-library-admin.php:222
msgid "Contents using it"
msgstr "Innhold som bruker det"
#: admin/class-h5p-library-admin.php:226
msgid "Libraries using it"
msgstr "Bibliotek som bruker det"
#: admin/class-h5p-library-admin.php:229 admin/views/new-content.php:47
msgid "Actions"
msgstr "Handlinger"
#: admin/class-h5p-library-admin.php:308
msgid ""
"This Library is used by content or other libraries and can therefore not be "
"deleted."
msgstr ""
"Dette biblioteket brukes av innhold eller andre biblioteker, og kan derfor "
"ikke slettes."
#: admin/class-h5p-library-admin.php:344
msgid "No content is using this library"
msgstr "Dette finnes ikke noe innhold som bruker dette biblioteket"
#: admin/class-h5p-library-admin.php:345
msgid "Content using this library"
msgstr "Innhold som bruker dette biblioteket"
#: admin/class-h5p-library-admin.php:346
msgid "Elements per page"
msgstr "Elementer per side"
#: admin/class-h5p-library-admin.php:347
msgid "Filter content"
msgstr "Filtrer innhold"
#: admin/class-h5p-library-admin.php:348
msgid "Page $x of $y"
msgstr "Side $x av $y"
#: admin/class-h5p-library-admin.php:376
msgid "Version"
msgstr "Versjon"
#: admin/class-h5p-library-admin.php:377
msgid "Fullscreen"
msgstr "Fullskjerm"
#: admin/class-h5p-library-admin.php:377 admin/class-h5p-library-admin.php:378
msgid "Yes"
msgstr "Ja"
#: admin/class-h5p-library-admin.php:377 admin/class-h5p-library-admin.php:378
#: admin/views/settings.php:131
msgid "No"
msgstr "Nei"
#: admin/class-h5p-library-admin.php:378
msgid "Content library"
msgstr "Innholdsbibliotek"
#: admin/class-h5p-library-admin.php:379
msgid "Used by"
msgstr "Brukt av"
#: admin/class-h5p-library-admin.php:379 admin/class-h5p-library-admin.php:430
msgid "1 content"
msgid_plural "%d contents"
msgstr[0] "1 innhold"
msgstr[1] "%d innhold"
#: admin/class-h5p-library-admin.php:419
msgid "There are no available upgrades for this library."
msgstr "Det finnes ingen tilgjengelige oppgraderinger for dette biblioteket."
#: admin/class-h5p-library-admin.php:426
msgid "There's no content instances to upgrade."
msgstr "Det finnes ikke noe innhold å oppgradere."
#: admin/class-h5p-library-admin.php:437
msgid "You are about to upgrade %s. Please select upgrade version."
msgstr "Du er i ferd med å oppgradere %s. Vennligst velg ønsket versjon."
#: admin/class-h5p-library-admin.php:438
msgid "Upgrading to %ver..."
msgstr "Oppgraderer til %ver..."
#: admin/class-h5p-library-admin.php:439
msgid "An error occurred while processing parameters:"
msgstr "Det oppstod en feil under behandling av parameterene:"
#: admin/class-h5p-library-admin.php:440
msgid "Could not load data for library %lib."
msgstr "Kunne ikke laste inn data for biblioteket %lib."
#: admin/class-h5p-library-admin.php:441
msgid "Could not upgrade content %id:"
msgstr "Kunne ikke oppgradere innhold %id:"
#: admin/class-h5p-library-admin.php:442
msgid "Could not load upgrades script for %lib."
msgstr "Kunne ikke laste oppgraderingsscript for %lib."
#: admin/class-h5p-library-admin.php:443
msgid "Parameters are broken."
msgstr "Parameterene er ødelagt."
#: admin/class-h5p-library-admin.php:444
msgid "Missing required library %lib."
msgstr "Mangler påkrevd bibliotek %lib."
#: admin/class-h5p-library-admin.php:445
msgid ""
"Parameters contain %used while only %supported or earlier are supported."
msgstr ""
"Parametrene innholder %used mens kun %supported eller tidligere er støttet."
#: admin/class-h5p-library-admin.php:446
msgid "Parameters contain %used which is not supported."
msgstr "Parametrene innholder %used som ikke er støttet."
#: admin/class-h5p-library-admin.php:447
msgid "You have successfully upgraded %s."
msgstr "Du har nå oppgradert %s."
#: admin/class-h5p-library-admin.php:447
msgid "Return"
msgstr "Tilbake"
#: admin/class-h5p-library-admin.php:457
msgid "Upgrade"
msgstr "Oppgrader"
#: admin/class-h5p-library-admin.php:532
msgid ""
"Not all content has gotten their cache rebuilt. This is required to be able "
"to delete libraries, and to display how many contents that uses the library."
msgstr ""
"Ikke alt innhold har fått mellomlageret sitt gjenoppbygd. Dette er nødvendig "
"for å være i stand til å slette biblioteker, og for å vise hvor mye innhold "
"som bruker et gitt biblioteket."
#: admin/class-h5p-library-admin.php:533
msgid "1 content need to get its cache rebuilt."
msgid_plural "%d contents needs to get their cache rebuilt."
msgstr[0] "1 innhold trenger å få mellomlageret sitt gjenoppbygd."
msgstr[1] "%d innhold trenger å få mellomlageret sitt gjenoppbygd."
#: admin/class-h5p-library-admin.php:534
msgid "Rebuild cache"
msgstr "Gjenoppbygg mellomlager"
#: admin/class-h5p-library-admin.php:546
msgid "Error, invalid security token!"
msgstr "Feil, ugyldig sikkerhetskode!"
#: admin/class-h5p-library-admin.php:552 admin/class-h5p-library-admin.php:671
msgid "Error, missing library!"
msgstr "Feil, mangler bibliotek!"
#: admin/class-h5p-library-admin.php:564 admin/class-h5p-library-admin.php:677
msgid "Error, invalid library!"
msgstr "Feil, ugyldig bibliotek!"
#: admin/class-h5p-plugin-admin.php:255
msgid "Content unavailable."
msgstr "Innhold utilgjengelig."
#: admin/class-h5p-plugin-admin.php:305
msgid "Thank you for choosing H5P."
msgstr "Takk for at du valgte H5P."
#: admin/class-h5p-plugin-admin.php:307
msgid ""
"You are ready to <a href=\"%s\">start creating</a> interactive content. "
"Check out our <a href=\"%s\" target=\"_blank\">Examples and Downloads</a> "
"page for inspiration."
msgstr ""
"Du er nå klar for å <a href=\"%s\">lage</a> interaktivtinnhold. Sjekk ut vår "
"<a href=\"%s\" target=\"_blank\">eksempler og nedlastinger</a>-side for "
"inspirasjon."
#: admin/class-h5p-plugin-admin.php:311
msgid "Thank you for staying up to date with H5P."
msgstr "Takk for at du holder deg oppdatert med H5P."
#: admin/class-h5p-plugin-admin.php:319
msgid ""
"You should <strong>upgrade your H5P content types!</strong> The old content "
"types still work, but the authoring tool's look and feel is greatly improved "
"with the new content types. Here's some more info about <a href=\"%s\" "
"target=\"_blank\">upgrading the content types</a>."
msgstr ""
"Du bør <strong>oppgradere H5P-innholdstypene dine!</strong> De gamle "
"innholdstypene vil fortsatt virke, men forfatterverktøyets utseende er mye "
"bedre med siste versjon av innholdstypene. Her er mer informasjon om <a href="
"\"%s\" target=\"_blank\">oppgradering av innholdstypene</a>."
#: admin/class-h5p-plugin-admin.php:325
msgid ""
"H5P now fetches content types directly from the H5P Hub. In order to do "
"this, the H5P plugin will communicate with H5P.org once per day to fetch "
"information about new and updated content types. It will send in anonymous "
"data to the hub about H5P usage. You may disable the data contribution and/"
"or the H5P Hub in the H5P settings."
msgstr ""
"H5P henter innholdstyper direkt fra H5P Hub. For å gjøre dette vil H5P-"
"utvidelsen kommunisere med H5P.org en gang om dagen for å hente informasjon "
"om nye og oppdaterte innholdstyper. Den vil sende inn anonyme data til Hub "
"om H5P bruk. Du kan skru av databidrag og/eller H5P Hub under H5P-"
"innstillinger."
#: admin/class-h5p-plugin-admin.php:338 admin/views/new-content.php:42
msgid ""
"If you need any help you can always file a <a href=\"%s\" target=\"_blank"
"\">Support Request</a>, check out our <a href=\"%s\" target=\"_blank"
"\">Forum</a> or join the conversation in the <a href=\"%s\" target=\"_blank"
"\">H5P Community Chat</a>."
msgstr ""
"Hvis du trenger hjelp kan du alltids sende inn en <a href=\"%s\" target="
"\"_blank\">henvendelse</a>, ta en titt på <a href=\"%s\" target=\"_blank"
"\">forumet</a> eller bli med i samtalen på <a href=\"%s\" target=\"_blank"
"\">H5P Community Chat</a>."
#: admin/class-h5p-plugin-admin.php:396 public/class-h5p-plugin.php:753
msgid "H5P Content"
msgstr "H5P-innhold"
#: admin/class-h5p-plugin-admin.php:399
msgid "All H5P Content"
msgstr "Alt H5P-innhold"
#: admin/class-h5p-plugin-admin.php:399
msgid "My H5P Content"
msgstr "Mitt H5P-innhold"
#: admin/class-h5p-plugin-admin.php:402
msgid "Add New"
msgstr "Legg til"
#: admin/class-h5p-plugin-admin.php:408
msgid "Libraries"
msgstr "Bibliotekene"
#: admin/class-h5p-plugin-admin.php:415 admin/views/my-results.php:14
msgid "My Results"
msgstr "Mine Resultater"
#: admin/class-h5p-plugin-admin.php:592
msgid ""
"You're trying to upload content of an older version of H5P. Please upgrade "
"the content on the server it originated from and try to upload again or turn "
"on the H5P Hub to have this server upgrade it for your automaticall."
msgstr ""
"Du prøver å laste opp eldre H5P-innhold. Vennligst oppgrader innholdet på "
"tjeneren som det kom fra eller skru på H5P Hub for å få det oppgradert "
"automatisk."
#: admin/class-h5p-plugin-admin.php:749
msgid "Invalid content"
msgstr "Ugyldig innhold"
#: admin/class-h5p-plugin-admin.php:753 admin/class-h5p-plugin-admin.php:1186
msgid "Invalid security token"
msgstr "Ugyldig sikkerhetskode"
#: admin/class-h5p-plugin-admin.php:982
msgid "Loading data."
msgstr "Laster data."
#: admin/class-h5p-plugin-admin.php:983
msgid "Failed to load data."
msgstr "Kunne ikke laste data."
#: admin/class-h5p-plugin-admin.php:984
msgid "There's no data available that matches your criteria."
msgstr "Det er ingen data tilgjengelig som passer med kriteriene dine."
#: admin/class-h5p-plugin-admin.php:985
msgid "Page $current of $total"
msgstr "Side $current av $total"
#: admin/class-h5p-plugin-admin.php:986
msgid "Next page"
msgstr "Neste side"
#: admin/class-h5p-plugin-admin.php:987
msgid "Previous page"
msgstr "Forrige side"
#: admin/class-h5p-plugin-admin.php:988
msgid "Search"
msgstr "Søk"
#: admin/class-h5p-plugin-admin.php:989
msgid "Remove"
msgstr "Fjern"
#: admin/class-h5p-plugin-admin.php:991
msgid "Show my content only"
msgstr "Vis kun mitt innhold"
#: admin/class-h5p-plugin-admin.php:1038 admin/class-h5p-privacy-policy.php:256
#: admin/class-h5p-privacy-policy.php:311
#: admin/class-h5p-privacy-policy.php:393
msgid "Content"
msgstr "Innhold"
#: admin/class-h5p-plugin-admin.php:1060
msgid "There are no logged results for your user."
msgstr "Det er ingen loggede resultater for din bruker."
#: admin/class-h5p-privacy-policy.php:55
msgid "xAPI"
msgstr "xAPI"
#: admin/class-h5p-privacy-policy.php:59
msgid "H5P tracking information"
msgstr "H5P-sporingsinformasjon"
#: admin/class-h5p-privacy-policy.php:63
msgid "Google's Privacy policy"
msgstr "Googles retningslinjer for personvern"
#: admin/class-h5p-privacy-policy.php:67
msgid "Twitter's Privacy policy"
msgstr "Twitters retningslinjer for personvern"
#: admin/class-h5p-privacy-policy.php:71
msgid "What personal data we collect and why we collect it"
msgstr "Hvilke personlige data vi samler inn og hvorfor vi samler det"
#: admin/class-h5p-privacy-policy.php:73
msgid "Suggested text (\"We\" and \"our\" mean \"you\", not \"us\"!):"
msgstr "Foreslått tekst (\"vi\" og \"vår\" betyr \"deg\", ikke \"oss\"!):"
#: admin/class-h5p-privacy-policy.php:74
msgid ""
"We may process and store personal data about your interactions using %s. We "
"use the data to learn about how well the interactions are designed and how "
"it could be adapted to improve the usability and your learning outcomes. The "
"data is processed and stored [on our platform|on an external platform] until "
"further notice."
msgstr ""
"Vi kan behandle og lagre personlige data om samspillet ditt med %s. Vi "
"bruker dataene til å lære om hvor godt interaktivitetene er utformet og "
"hvordan de kan tilpasses for å forbedre brukbarheten og læringsutbytteene "
"dine. Dataene behandles og lagres [på vår plattform|på en ekstern plattform] "
"inntil annet varsles."
#: admin/class-h5p-privacy-policy.php:75
msgid ""
"We may store the results of your interactions on our platform until further "
"notice. The results may contain your score, the maximum score possible, when "
"you started, when you finished, and how much time you used. We use the "
"results to learn about how well you performed and to help us give you "
"feedback."
msgstr ""
"Vi kan lagre resultatene av samspillet ditt på plattformen vår inntil annet "
"varsles. Resultatene kan inneholde poengsummen, maksimalpoengsummen, når du "
"startet, når du er ferdig, og hvor mye tid du brukte. Vi bruker resultatene "
"til å lære om hvor godt du har yt og for å hjelpe oss med å gi deg "
"tilbakemelding."
#: admin/class-h5p-privacy-policy.php:76
msgid ""
"We may store interactive content that you create on our platform. We also "
"may send anonymized reports about content creation without any personal data "
"to the plugin creators. Please consult the %s page for details."
msgstr ""
"Vi kan lagre interaktivt innhold som du oppretter på plattformen vår. Vi kan "
"også sende anonyme rapporter om innholdsopprettelse uten noen personlige "
"data til utvidelseskaperne. Vennligst se %s for detaljer."
#: admin/class-h5p-privacy-policy.php:77
msgid ""
"If you use interactive content that contains a video that is hosted on "
"YouTube, YouTube will set cookies on your computer. YouTube uses these "
"cookies to help them and their partners to analyze the traffic to their "
"websites. Please consult %s for details. It is our legitimate interest to "
"use YouTube, because we we need their services for our interactive content "
"and would not be able to provide you with their video content features "
"otherwise."
msgstr ""
"Hvis du bruker interaktivtinnhold som inneholder en video fra YouTube, vil "
"YouTube lagre informasjonskapsler på datamaskinen din. YouTube bruker disse "
"informasjonskapslene for å hjelpe dem og deres partnere til å analysere "
"trafikken til sine nettsteder. Vennligst rådfør %s for detaljer. Det er i "
"vår legitime interesse å bruke YouTube, fordi vi trenger deres tjenester for "
"vårt interaktive innhold, og vil ikke kunne gi deg videoinnholdsegenskapene "
"ellers."
#: admin/class-h5p-privacy-policy.php:78
msgid ""
"If you use interactive content that contains a Twitter feed, Twitter will "
"set a cookie on your computer. Twitter uses these cookies to help them and "
"their partners to make their advertizing more relevant to you. Please "
"consult %s for details. It is our legitimate interest to use Twitter, "
"because we need their services for our interactive content and would not be "
"able to provide you with it otherwise."
msgstr ""
"Hvis du bruker interaktivt innhold som inneholder en Twitter-feed, vil "
"Twitter sette en informasjonskapsel på datamaskinen. Twitter bruker disse "
"informasjonskapslene for å hjelpe dem og deres partnere til å gjøre "
"annonseringen mer relevant for deg. Vennligst rådfør %s for detaljer. Det er "
"i vår legitime interesse å bruke Twitter, fordi vi trenger deres tjenester "
"for vårt interaktive innhold og vil ikke vil kunne gi deg det ellers."
#: admin/class-h5p-privacy-policy.php:79
msgid ""
"If you use interactive content that contains speech recognition, Google "
"Cloud will process your voice for converting it to text. Please consult %s "
"for details. It is our legitimate interest to use Google Cloud, because we "
"we need their services for our interactive content and would not be able to "
"provide you with speech recognition features otherwise."
msgstr ""
"Hvis du bruker interaktivtinnhold som inneholder talegjenkjenning, vil "
"Google Cloud behandle stemmen din for å konvertere den til tekst. Vennligst "
"rådfør %s for detaljer. Det er i vår legitime interesse å bruke Google "
"Cloud, fordi vi trenger deres tjenester for vårt interaktive innhold og vil "
"ikke kunne gi deg talegjenkjenningsfunksjoner uten dem."
#: admin/class-h5p-privacy-policy.php:260
#: admin/class-h5p-privacy-policy.php:315
#: admin/class-h5p-privacy-policy.php:377
#: admin/class-h5p-privacy-policy.php:443
msgid "User ID"
msgstr "Bruker ID"
#: admin/class-h5p-privacy-policy.php:319
msgid "Subcontent ID"
msgstr "Sub-innholds ID"
#: admin/class-h5p-privacy-policy.php:323
msgid "Data ID"
msgstr "Data ID"
#: admin/class-h5p-privacy-policy.php:327
msgid "Data"
msgstr "Data"
#: admin/class-h5p-privacy-policy.php:331
msgid "Preload"
msgstr "Forhåndslast"
#: admin/class-h5p-privacy-policy.php:335
msgid "Invalidate"
msgstr "Invalider"
#: admin/class-h5p-privacy-policy.php:339
#: admin/class-h5p-privacy-policy.php:439
msgid "Updated at"
msgstr "Oppdatert"
#: admin/class-h5p-privacy-policy.php:346
msgid "Saved content state"
msgstr "Laget innholdstilstand"
#: admin/class-h5p-privacy-policy.php:381
#: admin/class-h5p-privacy-policy.php:435
msgid "Created at"
msgstr "Opprettet"
#: admin/class-h5p-privacy-policy.php:385
msgid "Type"
msgstr "Type"
#: admin/class-h5p-privacy-policy.php:389
msgid "Sub type"
msgstr "Sub-type"
#: admin/class-h5p-privacy-policy.php:397
#: admin/class-h5p-privacy-policy.php:447
msgid "Library"
msgstr "Bibliotek"
#: admin/class-h5p-privacy-policy.php:404
msgid "Events"
msgstr "Hendelser"
#: admin/class-h5p-privacy-policy.php:451
msgid "Parameters"
msgstr "Parameterene"
#: admin/class-h5p-privacy-policy.php:455
msgid "Filtered parameters"
msgstr "Filtrerte parametere"
#: admin/class-h5p-privacy-policy.php:459
msgid "Slug"
msgstr "Slug"
#: admin/class-h5p-privacy-policy.php:463
msgid "Embed type"
msgstr "Innbyggingstype"
#: admin/class-h5p-privacy-policy.php:467
msgid "Disable"
msgstr "Skru av"
#: admin/views/content-results.php:15
msgid "Results for \"%s\""
msgstr "Resultater for \"%s\""
#: admin/views/content-results.php:16 admin/views/new-content.php:19
msgid "View"
msgstr "Vis"
#: admin/views/content-results.php:22 admin/views/contents.php:16
#: admin/views/libraries.php:73 admin/views/my-results.php:16
msgid "Waiting for JavaScript."
msgstr "Venter på JavaScript."
#: admin/views/contents.php:14
msgid "Add new"
msgstr "Legg til"
#: admin/views/libraries.php:16
msgid "Content Type Cache"
msgstr "Innholdtypelager"
#: admin/views/libraries.php:20
msgid ""
"Making sure the content type cache is up to date will ensure that you can "
"view, download and use the latest libraries. This is different from updating "
"the libraries themselves."
msgstr ""
"Sørging for at innholdstypenlageret er oppdatert vil sikre at du kan vise, "
"laste ned og bruke de nyeste bibliotekene. Dette er forskjellig fra å "
"oppdatere bibliotekene segselv."
#: admin/views/libraries.php:24
msgid "Last update"
msgstr "Sist oppdatering"
#: admin/views/libraries.php:45 admin/views/new-content.php:59
msgid "Update"
msgstr "Oppdater"
#: admin/views/libraries.php:51
msgid "Upload Libraries"
msgstr "Last opp bibliotek"
#: admin/views/libraries.php:55
msgid ""
"Here you can upload new libraries or upload updates to existing libraries. "
"Files uploaded here must be in the .h5p file format."
msgstr ""
"Her kan du laste opp nye innholds-biblioteker eller oppdateringer til "
"allerede eksisterende biblioteker. Filer som lastes opp må være på .h5p-"
"formatet."
#: admin/views/libraries.php:58
msgid "Only update existing libraries"
msgstr "Kun oppdater eksisterende biblioteker"
#: admin/views/libraries.php:61 admin/views/new-content.php:33
msgid "Disable file extension check"
msgstr "Deaktiver filtype sjekk"
#: admin/views/libraries.php:62 admin/views/new-content.php:34
msgid ""
"Warning! This may have security implications as it allows for uploading php "
"files. That in turn could make it possible for attackers to execute "
"malicious code on your site. Please make sure you know exactly what you're "
"uploading."
msgstr ""
"Advarsel! Dette kan medføre sikkerhetsbrudd siden det gjør det mulig å laste "
"opp php-filer. Det i sin tur kan gjøre det mulig for angripere å kjøre "
"skadelig kode på nettstedet ditt. Vennligst sørg for at du vet nøyaktig hva "
"du laster opp."
#: admin/views/libraries.php:68 admin/views/new-content.php:49
msgid "Upload"
msgstr "Last opp"
#: admin/views/libraries.php:72
msgid "Installed Libraries"
msgstr "Installerte bibliotek"
#: admin/views/library-content-upgrade.php:15
msgid "Upgrade %s %d.%d.%d content"
msgstr "Oppgrader %s %d.%d.%d-innhold"
#: admin/views/library-content-upgrade.php:19
msgid "Please enable JavaScript."
msgstr "Vennligst skru på JavaScript."
#: admin/views/library-delete.php:16
msgid "Are you sure you wish to delete this H5P library?"
msgstr "Er du sikker på at du ønsker å slette dette H5P-biblioteket?"
#: admin/views/library-delete.php:18
msgid "Do it!"
msgstr "Gjør det!"
#: admin/views/new-content.php:38
msgid "Waiting for javascript..."
msgstr "Venter på JavaScript..."
#: admin/views/new-content.php:41
msgid ""
"It looks like there are no content types installed. You can get the ones you "
"want by using the small 'Download' button in the lower left corner on any "
"example from the <a href=\"%s\" target=\"_blank\">Examples and Downloads</a> "
"page and then you upload the file here."
msgstr ""
"Det ser ut til at ingen innholdstyper er installert. Du kan få de du ønsker "
"ved å bruke den lille 'Download'-knappen nede i venstre hjørne på et hvilket "
"som helst eksempel fra <a href=\"%s\" target=\"_blank\">Examples and "
"Downloads</a>-siden og deretter laste opp filen her."
#: admin/views/new-content.php:50 admin/views/new-content.php:59
msgid "Create"
msgstr "Opprett"
#: admin/views/new-content.php:64 admin/views/new-content.php:97
msgid "Toggle panel"
msgstr "Veksle panel"
#: admin/views/new-content.php:65
msgid "Display Options"
msgstr "Visningsinnstillinger"
#: admin/views/new-content.php:69
msgid "Display toolbar below content"
msgstr "Vis verktøylinje under innhold"
#: admin/views/new-content.php:74
msgid ""
"If checked a reuse button will always be displayed for this content and "
"allow users to download the content as an .h5p file"
msgstr ""
"Om avhuket vil gjenbruk-knappen alltid vises for dette innholdet og tillate "
"brukere å laste ned innholdet som en .h5p-fil"
#: admin/views/new-content.php:76
msgid "Allow users to download the content"
msgstr "Tillat brukere å laste ned innholdet"
#: admin/views/new-content.php:82 admin/views/settings.php:61
msgid "Display Embed button"
msgstr "Vis Innbyggings-knapp"
#: admin/views/new-content.php:88 admin/views/settings.php:86
msgid "Display Copyright button"
msgstr "Vis Opphavsrett-knapp"
#: admin/views/new-content.php:101
msgid "Separate tags with commas"
msgstr "Skill stikkord med komma"
#: admin/views/settings.php:17
msgid "Settings saved."
msgstr "Instillinger lagret."
#: admin/views/settings.php:24
msgid "Toolbar Below Content"
msgstr "Verktøylinje under innhold"
#: admin/views/settings.php:28 admin/views/settings.php:49
#: admin/views/settings.php:74 admin/views/settings.php:90
msgid "Controlled by author - on by default"
msgstr "Kontrolleres av forfatter - på som standard"
#: admin/views/settings.php:31
msgid ""
"By default, a toolbar with 4 buttons is displayed below each interactive "
"content."
msgstr ""
"Som standard, en verktøylinje med 4 knapper vises under hvert interaktivt "
"innhold."
#: admin/views/settings.php:36
msgid "Allow download"
msgstr "Tillat nedlasting"
#: admin/views/settings.php:40 admin/views/settings.php:65
msgid "Never"
msgstr "Aldri"
#: admin/views/settings.php:43 admin/views/settings.php:68
#: admin/views/settings.php:99
msgid "Always"
msgstr "Alltid"
#: admin/views/settings.php:46 admin/views/settings.php:71
msgid "Only for editors"
msgstr "Bare for redaktører"
#: admin/views/settings.php:52 admin/views/settings.php:77
msgid "Controlled by author - off by default"
msgstr "Kontrolleres av forfatter - av som standard"
#: admin/views/settings.php:56
msgid ""
"Setting this to 'Never' will reduce the amount of disk space required for "
"interactive content."
msgstr ""
"Ved å sette denne til 'Aldri' vil du redusere mengden diskplass som kreves "
"for interaktivt innhold."
#: admin/views/settings.php:81
msgid "Setting this to 'Never' will disable already existing embed codes."
msgstr ""
"Ved å sette denne til 'Aldri' vil eksisterende innbyggingskoder slutte å "
"virke."
#: admin/views/settings.php:95
msgid "Display About H5P button"
msgstr "Vis Om H5P-knapp"
#: admin/views/settings.php:104
msgid "User Results"
msgstr "Brukerresultater"
#: admin/views/settings.php:108
msgid "Log results for signed in users"
msgstr "Log resultater for påloggede brukere"
#: admin/views/settings.php:113
msgid "Save Content State"
msgstr "Lagre innholdsstatus"
#: admin/views/settings.php:117
msgid "Allow logged-in users to resume tasks"
msgstr "Tillatt påloggede brukere å fortsette med oppgaver"
#: admin/views/settings.php:120
msgid "Auto-save frequency (in seconds)"
msgstr "Auto-lagringsfrekvens (i sekunder)"
#: admin/views/settings.php:127
msgid "Show toggle switch for others' H5P contents"
msgstr "Vis vekslebryter for andres H5P-innhold"
#: admin/views/settings.php:134
msgid "Yes, show all contents by default"
msgstr "Ja, vis alt innhold som standard"
#: admin/views/settings.php:137
msgid "Yes, show only current user's contents by default"
msgstr "Ja, vis kun gjeldene brukers innhold som standard"
#: admin/views/settings.php:141
msgid ""
"Allow to restrict the view of H5P contents to the current user's content. "
"The setting has no effect if the user is not allowed to see other users' "
"content."
msgstr ""
"Tillat å begrense visningen av H5P-innhold til gjeldende brukers innhold. "
"Innstillingen har ingen effekt hvis brukeren ikke får lov til å se andre "
"brukeres innhold."
#: admin/views/settings.php:145
msgid "Add Content Method"
msgstr "Metode for innsetting"
#: admin/views/settings.php:148
msgid ""
"When adding H5P content to posts and pages using the \"Add H5P\" button:"
msgstr ""
"Når du setter inn H5P-innhold i innlegg og sider ved hjelp av \"Legg til H5P"
"\"-knappen:"
#: admin/views/settings.php:155
msgid "Reference content by id"
msgstr "Referer til innhold gjennom ID"
#: admin/views/settings.php:163
msgid "Reference content by <a href=\"%s\" target=\"_blank\">slug</a>"
msgstr ""
"Referer til innhold gjennom <a href=\"%s\" target=\"_blank\">lenkenavn</a>"
#: admin/views/settings.php:169
msgid "Content Types"
msgstr "Innholdstyper"
#: admin/views/settings.php:173
msgid "Enable LRS dependent content types"
msgstr "Vis innholdstyper som krever et LRS for å virke"
#: admin/views/settings.php:176
msgid ""
"Makes it possible to use content types that rely upon a Learning Record "
"Store to function properly, like the Questionnaire content type."
msgstr ""
"Gjør det mulig å bruke innholdstyper som er avhengig av en Learning Record "
"Store for å virke som de skal, slik som Questionnaire-innholdstypen."
#: admin/views/settings.php:185
msgid "Use H5P Hub"
msgstr "Bruk H5P Hub"
#: admin/views/settings.php:188
msgid ""
"It's strongly encouraged to keep this option <strong>enabled</strong>. The "
"H5P Hub provides an easy interface for getting new content types and keeping "
"existing content types up to date. In the future, it will also make it "
"easier to share and reuse content. If this option is disabled you'll have to "
"install and update content types through file upload forms."
msgstr ""
"Det er sterkt oppfordret til å holde dette alternativet <strong>aktivert</ "
"strong>. H5P Hub gir et enkelt grensesnitt for å få nye innholdstyper og "
"beholde eksisterende innholdstyper oppdatert. I fremtiden vil det også bli "
"enklere å dele og gjenbruke innhold. Hvis dette alternativet er deaktivert "
"må du installere og oppdatere innholdstyper gjennom opplastingskjema."
#: admin/views/settings.php:203
msgid "Usage Statistics"
msgstr "Bruksstatistikk"
#: admin/views/settings.php:207
msgid "Automatically contribute usage statistics"
msgstr "Bidra bruksstatistikk automatisk"
#: admin/views/settings.php:210
msgid ""
"Usage statistics numbers will automatically be reported to help the "
"developers better understand how H5P is used and to determine potential "
"areas of improvement. Read more about which <a href=\"%s\" target=\"_blank"
"\">data is collected on h5p.org</a>."
msgstr ""
"Bruksstatistikknumre blir automatisk rapportert for å hjelpe utviklerne med "
"å bedre forstå hvordan H5P brukes og for å fastslå potensielle "
"forbedringsområder. Les mer om hvilke <a href=\"%s\" target=\"_blank\">data "
"som samles på h5p.org</a>."
#: admin/views/show-content.php:30
msgid "Shortcode"
msgstr "Kortkode"
#: admin/views/show-content.php:32
msgid "What's next?"
msgstr "Hva nå?"
#: admin/views/show-content.php:33
msgid ""
"You can use the following shortcode to insert this interactive content into "
"posts, pages, widgets, templates etc."
msgstr ""
"Du kan bruke følgende kortkode for å sette inn dette interaktive innholdet i "
"innlegg, sider, widgeter, maler osv."
#: admin/views/show-content.php:42
msgid "No tags"
msgstr "Ingen stikkord"
#: admin/views/user-consent.php:15
msgid "Before you start"
msgstr "Før du begynner"
#: admin/views/user-consent.php:19
msgid ""
"To be able to start creating interactive content you must first install at "
"least one content type."
msgstr ""
"For å kunne begynne å lage interaktivtinnhold må du først installere minst "
"én innholdstype."
#: admin/views/user-consent.php:20
msgid ""
"The H5P Hub is here to simplify this process by automatically installing the "
"content types you choose and providing updates for those already installed."
msgstr ""
"H5P Hub er her for å forenkle denne prosessen ved å automatisk installere "
"innholdstyper du velger og gi oppdateringer for de som allerede er "
"installert."
#: admin/views/user-consent.php:22
msgid ""
"In order for the H5P Hub to be able to do this, communication with H5P.org "
"is required.<br/>\n"
" As this will provide H5P.org with anonymous data on how H5P is used "
"we kindly ask for your consent before proceeding.<br/>\n"
" You can read more on <a href=\"%s\" target=\"_blank\">the plugin "
"communication page</a>."
msgstr ""
"For at H5P Hub skal kunne gjøre dette er det nødvendig å kommunisere med H5P."
"org. <br/>\n"
" Siden dette vil gi H5P.org anonyme data om hvordan H5P brukes ber "
"vi om ditt samtykke før du fortsetter. <br/>\n"
" Du kan lese mer på <a href=\"%s\" target=\"_blank\">plugin-"
"kommunikasjonssiden</a>."
#: admin/views/user-consent.php:26
msgid "I consent, give me the Hub!"
msgstr "Jeg samtykker, gi meg H5P Hub!"
#: admin/views/user-consent.php:27
msgid "I disapprove"
msgstr "Jeg misliker"
#: public/class-h5p-plugin.php:867
msgid "Missing H5P identifier."
msgstr "Mangler H5P-identifikator."
#: public/class-h5p-plugin.php:875
msgid "Cannot find H5P content with id: %d."
msgstr "Kan ikke finne H5P-innhold med id: %d."
#: public/class-h5p-plugin.php:901
msgid "Database error: %s."
msgstr "Databasefeil: %s."
#: public/class-h5p-plugin.php:905
msgid "Cannot find H5P content with slug: %s."
msgstr "Kan ikke finne H5P-innhold med lenkenavn: %s."
#. Plugin Name of the plugin/theme
msgid "H5P"
msgstr ""
#. Plugin URI of the plugin/theme
msgid "http://h5p.org/wordpress"
msgstr ""
#. Description of the plugin/theme
msgid ""
"Allows you to upload, create, share and use rich interactive content on your "
"WordPress site."
msgstr ""
"Gjør det mulig for deg å laste opp, lage, dele og bruke rikt interaktivt "
"innhold på din WordPress-side."
#. Author of the plugin/theme
msgid "Joubel"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://joubel.com"
msgstr ""
#~ msgid "Confirmation action"
#~ msgstr "Bekreft handling"
#~ msgid "Do you still want to enable the hub ?"
#~ msgstr "Vil du fortsatt skru på Hub?"
#~ msgid "Cancel"
#~ msgstr "Avbryt"
#~ msgid "Confirm"
#~ msgstr "Bekreft"
#~ msgid "File not found on server. Check file upload settings."
#~ msgstr ""
#~ "Fil ikke funnet på serveren. Vennligst sjekk opplastingsinnstillinger."
#~ msgid "Could not get posted H5P."
#~ msgstr "Kunne ikke få innsendt H5P."
#~ msgid "Invalid security token."
#~ msgstr "Ugyldig sikkerhetsnøkkel."
#~ msgid "No content type was specified."
#~ msgstr "Ingen innholdstype var spesifisert."
#~ msgid "The chosen content type is invalid."
#~ msgstr "Den valgte innholdstypen er ugyldig."
#~ msgid ""
#~ "You do not have permission to install content types. Contact the "
#~ "administrator of your site."
#~ msgstr ""
#~ "Du har ikke tillatelse til å installere innholdstyper. Kontakt "
#~ "innehaveren av nettstedet."
#~ msgid "Could not parse post data."
#~ msgstr "Kunne ikke analysere innsendt data."
#~ msgid "Validating h5p package failed."
#~ msgstr "Validering av H5P-filen feilet."
#~ msgid "Failed to download the requested H5P."
#~ msgstr "Kunne ikke laste ned den etterspurte H5P-filen."
#~ msgid "A post message is required to access the given endpoint"
#~ msgstr "En innsendt beskjed er påkrevd for å få tilgang til endepunktet"
#~ msgid "The hub is disabled. You can enable it in the H5P settings."
#~ msgstr "Hub er avksrudd. Du kan skru den på gjennom H5P-innstillinger."
#~ msgid "Unable to get field type."
#~ msgstr "Finner ikke felttypen."
#~ msgid "File type isn't allowed."
#~ msgstr "Filtypen er ikke tillatt."
#~ msgid "Invalid field type."
#~ msgstr "Ugyldig felttype."
#~ msgid "Invalid image file format. Use jpg, png or gif."
#~ msgstr "Ugyldig bildeformat. Bruk jpg, png eller gif."
#~ msgid "File is not an image."
#~ msgstr "Filen er ikke et bilde."
#~ msgid "Invalid audio file format. Use mp3 or wav."
#~ msgstr "Ugyldig lydformat. Bruke mp3 eller wav."
#~ msgid "Invalid video file format. Use mp4 or webm."
#~ msgstr "Ugyldig videoformat. Bruk mp4 eller WebM."
#~ msgid "Your PHP version does not support ZipArchive."
#~ msgstr "Din PHP versjon støtter ikke ZipArchive."
#~ msgid ""
#~ "The mbstring PHP extension is not loaded. H5P need this to function "
#~ "properly"
#~ msgstr ""
#~ "PHP mangler 'mbstring'-utvidelsen. H5P trenger denne for å vaske innholdet"
#~ msgid ""
#~ "The file you uploaded is not a valid HTML5 Package (It does not have the ."
#~ "h5p file extension)"
#~ msgstr ""
#~ "Filen du lastet opp er ikke en gyldig H5P-fil (Den har ikke .h5p-"
#~ "filendelsen)"
#~ msgid ""
#~ "The file you uploaded is not a valid HTML5 Package (We are unable to "
#~ "unzip it)"
#~ msgstr ""
#~ "Filen du lastet opp er ikke en gyldig H5P-fil (Det er ikke mulig å pakke "
#~ "den ut)"
#~ msgid ""
#~ "One of the files inside the package exceeds the maximum file size "
#~ "allowed. (%file %used > %max)"
#~ msgstr ""
#~ "En av filene i pakken overskrider maksimalstørrelsen som er tillat. "
#~ "(%file %used > %max)"
#, php-format
#~ msgid ""
#~ "File \"%filename\" not allowed. Only files with the following extensions "
#~ "are allowed: %files-allowed."
#~ msgstr ""
#~ "Filen \"%filename\" er ikke tillatt. Bare filer med følgende filendelser "
#~ "er tillatt: %files-allowed."
#~ msgid ""
#~ "The total size of the unpacked files exceeds the maximum size allowed. "
#~ "(%used > %max)"
#~ msgstr ""
#~ "Den totale størrelsen på de utpakkede filene overskrider maksimal tillat "
#~ "størrelse. (%used > %max)"
#~ msgid "A valid content folder is missing"
#~ msgstr "Det mangler en gyldig innholdsmappe"
#~ msgid "A valid main h5p.json file is missing"
#~ msgstr "Det mangler en gyldig h5p.json-fil"
#~ msgid "The main h5p.json file is not valid"
#~ msgstr "Innholdet i h5p.json-filen er ikke gyldig"
#, php-format
#~ msgid "Unable to read file from the package: %fileName"
#~ msgstr "Kunne ikke lese fil fra pakken: %fileName"
#~ msgid ""
#~ "Library directory name must match machineName or machineName-majorVersion."
#~ "minorVersion (from library.json). (Directory: %directoryName , "
#~ "machineName: %machineName, majorVersion: %majorVersion, minorVersion: "
#~ "%minorVersion)"
#~ msgstr ""
#~ "Katalognavnet til biblioteket må samsvare med maskinnavn eller maskinnavn-"
#~ "storVersjon.litenVersjon (fra library.json). (Katalog: %directoryName , "
#~ "maskinnavn: %machineName, storVersjon: %majorVersion, litenVersjon: "
#~ "%minorVersion)"
#~ msgid "Missing required library @library"
#~ msgstr "Mangler påkrevd bibliotek @library"
#~ msgid ""
#~ "Note that the libraries may exist in the file you uploaded, but you're "
#~ "not allowed to upload new libraries. Contact the site administrator about "
#~ "this."
#~ msgstr ""
#~ "Merk at filen du lastet opp kan innholdet bibliotekene, men at du ikke "
#~ "har lov til å laste opp nye biblioteker. Kontakt administrator om dette."
#, php-format
#~ msgid "Unable to parse JSON from the package: %fileName"
#~ msgstr "Kunne ikke analysere JSON fra pakken: %fileName"
#~ msgid "Invalid library name: %name"
#~ msgstr "Ugyldig biblioteksnavn: %name"
#~ msgid ""
#~ "Could not find library.json file with valid json format for library %name"
#~ msgstr ""
#~ "Fant ikke en library.json-fil med gyldig JSON-format for biblioteket %name"
#~ msgid "Invalid semantics.json file has been included in the library %name"
#~ msgstr "En ugyldig semantics.json-fil er tatt med i biblioteket %name"
#~ msgid "Invalid language file %file in library %library"
#~ msgstr "Ugyldig språkfil %file i biblioteket %library"
#~ msgid ""
#~ "Invalid language file %languageFile has been included in the library %name"
#~ msgstr "Ugyldig språkfil %languageFile er tatt med i biblioteket %name"
#~ msgid "The file \"%file\" is missing from library: \"%name\""
#~ msgstr "Filen \"%file\" mangler fra biblioteket: \"%name\""
#~ msgid ""
#~ "The system was unable to install the <em>%component</em> component from "
#~ "the package, it requires a newer version of the H5P plugin. This site is "
#~ "currently running version %current, whereas the required version is "
#~ "%required or higher. You should consider upgrading and then try again."
#~ msgstr ""
#~ "Systemet klarte ikke å installere <em>%component</em>-komponenten fra "
#~ "pakken, den krever en nyere versjon av H5P-utvidelsen. Dette nettstedet "
#~ "bruker versjon %current, mens den nødvendige versjon er %required eller "
#~ "høyere. Du bør vurdere å oppgradere for så å prøve på nytt."
#~ msgid "Invalid data provided for %property in %library. Boolean expected."
#~ msgstr "Ugyldig data satt for %property i %library. Boolsk forventet."
#~ msgid "Invalid data provided for %property in %library"
#~ msgstr "Ugyldig data satt for %property i %library"
#~ msgid "Can't read the property %property in %library"
#~ msgstr "Kan ikke lese attributten %property i %library"
#~ msgid "The required property %property is missing from %library"
#~ msgstr "Den påkrevde attributten %property for %library"
#~ msgid "Illegal option %option in %library"
#~ msgstr "Ugyldig alternativ %option i %library"
#~ msgid "Added %new new H5P library and updated %old old one."
#~ msgstr "La til %new nytt H5P-bibliotek og oppdaterte %old eksisterende."
#~ msgid "Added %new new H5P library and updated %old old ones."
#~ msgstr "La til %new nytt H5P-bibliotek og oppdaterte %old eksisterende."
#~ msgid "Added %new new H5P libraries and updated %old old one."
#~ msgstr "La til %new nye H5P-biblioteker og oppdaterte %old eksisterende."
#~ msgid "Added %new new H5P libraries and updated %old old ones."
#~ msgstr "La til %new nye H5P-biblioteker og oppdaterte %old eksisterende."
#~ msgid "Added %new new H5P library."
#~ msgstr "La til %new nytt H5P-bibliotek."
#~ msgid "Added %new new H5P libraries."
#~ msgstr "La til %new nye H5P-bibliotek."
#, php-format
#~ msgid "Updated %old H5P library."
#~ msgstr "Oppdaterte %old H5P-bibliotek."
#, php-format
#~ msgid "Updated %old H5P libraries."
#~ msgstr "Oppdaterte %old H5P-biblioteker."
#~ msgid "Missing dependency @dep required by @lib."
#~ msgstr "Manglende avhengigheten @dep som kreves av @lib."
#~ msgid ""
#~ "Site could not be registered with the hub. Please contact your site "
#~ "administrator."
#~ msgstr ""
#~ "Siden kunne ikke bli registrert med Hub. Vennligst kontakt innehaveren av "
#~ "nettsted."
#~ msgid ""
#~ "The H5P Hub has been disabled until this problem can be resolved. You may "
#~ "still upload libraries through the \"H5P Libraries\" page."
#~ msgstr ""
#~ "H5P Hub har blitt skrudd av inntil problemet er løst. Du kan fortsatt "
#~ "laste opp biblioteker gjennom H5P Biblioteker-siden."
#~ msgid "Your site was successfully registered with the H5P Hub."
#~ msgstr "Registrering av siden din hos H5P Hub var vellykket."
#~ msgid "Couldn't communicate with the H5P Hub. Please try again later."
#~ msgstr "Kunne ikke kommunisere med H5P Hub. Vennligst prøv igjen senere."
#~ msgid ""
#~ "No content types were received from the H5P Hub. Please try again later."
#~ msgstr ""
#~ "Ingen innholdstyper ble mottatt fra H5P Hub. Vennligst prøv igjen senere."
#~ msgid "Library cache was successfully updated!"
#~ msgstr "Oppdatering av bibliotekslageret var vellykket!"
#~ msgid ""
#~ "The mbstring PHP extension is not loaded. H5P needs this to function "
#~ "properly"
#~ msgstr "PHP mangler 'mbstring'-utvidelsen. H5P trenger denne for å virke"
#~ msgid ""
#~ "Your PHP version is outdated. H5P requires version 5.2 to function "
#~ "properly. Version 5.6 or later is recommended."
#~ msgstr ""
#~ "PHP-versjonen din er utdatert. H5P krever versjon 5.2 for å virke "
#~ "ordentlig. Versjon 5.6 eller senere er anbefalt."
#~ msgid ""
#~ "A problem with the server write access was detected. Please make sure "
#~ "that your server can write to your data folder."
#~ msgstr ""
#~ "Et problem med serverens skrivetilgang ble oppdaget. Vennligst sørg for "
#~ "at serveren kan skrive til datamappen."
#~ msgid ""
#~ "Your PHP max upload size is quite small. With your current setup, you may "
#~ "not upload files larger than %number MB. This might be a problem when "
#~ "trying to upload H5Ps, images and videos. Please consider to increase it "
#~ "to more than 5MB."
#~ msgstr ""
#~ "Din PHP-max-opplastingsstørrelse er ganske liten. Med ditt nåværende "
#~ "oppsett kan du ikke laste opp filer større enn %number MB. Dette kan være "
#~ "et problem når du prøver å laste opp H5P-filer, bilder og videoer. "
#~ "Vennligst vurdere å øke den til mer enn 5 MB."
#~ msgid ""
#~ "Your PHP max post size is quite small. With your current setup, you may "
#~ "not upload files larger than %number MB. This might be a problem when "
#~ "trying to upload H5Ps, images and videos. Please consider to increase it "
#~ "to more than 5MB"
#~ msgstr ""
#~ "Din PHP-maksimal-innsendingsstørrelse er ganske liten. Med ditt nåværende "
#~ "oppsett kan du ikke laste opp filer større enn %number MB. Dette kan være "
#~ "et problem når du prøver å laste opp H5P-filer, bilder og videoer. "
#~ "Vennligst vurdere å øke den til mer enn 5 MB"
#~ msgid ""
#~ "Your PHP max upload size is bigger than your max post size. This is known "
#~ "to cause issues in some installations."
#~ msgstr ""
#~ "Din PHP-max-opplastingsstørrelse er større enn max-innsendingsstørrelse. "
#~ "Dette er kjent for å forårsake problemer i enkelte installasjoner."
#~ msgid ""
#~ "Your server does not have SSL enabled. SSL should be enabled to ensure a "
#~ "secure connection with the H5P hub."
#~ msgstr ""
#~ "Serveren din har ikke SSL aktivert. SSL bør være aktivert for en sikker "
#~ "forbindelse med H5P Hub."
#~ msgid ""
#~ "H5P hub communication has been disabled because one or more H5P "
#~ "requirements failed."
#~ msgstr ""
#~ "H5P Hub-kommunikasjon har blitt deaktivert fordi en eller flere H5P krav "
#~ "mislyktes."
#~ msgid ""
#~ "When you have revised your server setup you may re-enable H5P hub "
#~ "communication in H5P Settings."
#~ msgstr ""
#~ "Når du har revidert ditt server-oppsett du kan aktivere H5P Hub-"
#~ "kommunikasjon i H5P-innstillinger."
#~ msgid "Disable fullscreen"
#~ msgstr "Skru av fullskjerm"
#~ msgid "Download"
#~ msgstr "Last ned"
#~ msgid "Rights of use"
#~ msgstr "Bruksrett"
#~ msgid "Embed"
#~ msgstr "Innbygg"
#~ msgid "Size"
#~ msgstr "Størrelse"
#~ msgid "Show advanced"
#~ msgstr "Vis avansert"
#~ msgid "Hide advanced"
#~ msgstr "Skjul avansert"
#~ msgid ""
#~ "Include this script on your website if you want dynamic sizing of the "
#~ "embedded content:"
#~ msgstr ""
#~ "Inkluder dette skriptet på nettsiden din om du ønsker dynamisk størrelse "
#~ "på det innbygde innholdet:"
#~ msgid "Close"
#~ msgstr "Lukk"
#~ msgid "Year"
#~ msgstr "Årstall"
#~ msgid "Source"
#~ msgstr "Kilde"
#~ msgid "License"
#~ msgstr "Lisens"
#~ msgid "Thumbnail"
#~ msgstr "Miniatyrbilde"
#~ msgid "No copyright information available for this content."
#~ msgstr ""
#~ "Informasjon om opphavsrett er ikke tilgjengelig for dette innholdet."
#~ msgid "Reuse"
#~ msgstr "Gjenbruk"
#~ msgid "Reuse Content"
#~ msgstr "Gjenbruk Innhold"
#~ msgid "Reuse this content."
#~ msgstr "Gjenbruk dette innholdet."
#~ msgid "Download this content as a H5P file."
#~ msgstr "Last ned dette innholdet som en H5P-fil."
#~ msgid "View copyright information for this content."
#~ msgstr "Vis informasjon om opphavsrett for dette innholdet."
#~ msgid "View the embed code for this content."
#~ msgstr "Vis innbygg-koden for dette innholdet."
#~ msgid "Visit H5P.org to check out more cool content."
#~ msgstr "Besøk H5P.org for å finne mer kult innhold."
#~ msgid "This content has changed since you last used it."
#~ msgstr "Innholdet har endret seg siden sist."
#~ msgid "You'll be starting over."
#~ msgstr "Du starter nå på nytt."
#~ msgid "by"
#~ msgstr "av"
#~ msgid "Show more"
#~ msgstr "Vis mer"
#~ msgid "Show less"
#~ msgstr "Vis mindre"
#~ msgid "Sublevel"
#~ msgstr "Undernivå"
#~ msgid "Confirm action"
#~ msgstr "Bekreft handling"
#~ msgid ""
#~ "Please confirm that you wish to proceed. This action is not reversible."
#~ msgstr ""
#~ "Vennligst bekreft at du ønsker å fortsette. Denne handlingen kan ikke "
#~ "reverseres."
#~ msgid "Undisclosed"
#~ msgstr "Ikke oppgitt"
#~ msgid "Copyright"
#~ msgstr "Opphavsrett"
#~ msgid "Content Type"
#~ msgstr "Innholdstype"
#~ msgid "License Extras"
#~ msgstr "Lisensekstra"
#~ msgid "Changelog"
#~ msgstr "Endringslogg"
#~ msgid "Content is copied to the clipboard"
#~ msgstr "Innholdet er kopiert til utklippstavlen"
#~ msgid ""
#~ "Connection lost. Results will be stored and sent when you regain "
#~ "connection."
#~ msgstr ""
#~ "Tap av tilkobling. Resultater vil bli lagret og sendt når du gjenopptar "
#~ "tilkoblingen."
#~ msgid "Connection reestablished."
#~ msgstr "Tilkobling gjenopptatt."
#~ msgid "Attempting to submit stored results."
#~ msgstr "Prøver å sende lagrede resultater."
#~ msgid "Your connection to the server was lost"
#~ msgstr "Din tilkobling til tjeneren ble tapt"
#~ msgid ""
#~ "We were unable to send information about your completion of this task. "
#~ "Please check your internet connection."
#~ msgstr ""
#~ "Vi kunne ikke sende informasjon om din fullførelse av oppgaven. Vennligst "
#~ "sjekk din internett-tilkobling."
#~ msgid "Retrying in :num...."
#~ msgstr "Prøver igjen om :num..."
#~ msgid "Retry now"
#~ msgstr "Prøv nå"
#~ msgid "Successfully submitted results."
#~ msgstr "Sendingen av resultater var vellykket."
#~ msgid ""
#~ "Provided string is not valid according to regexp in semantics. (value: "
#~ "\"%value\", regexp: \"%regexp\")"
#~ msgstr ""
#~ "Den oppgitte streng er ikke gyldig i henhold til uttrykket i semantikken. "
#~ "(value: \"%value\", regexp: \"%regexp\")"
#~ msgid "Invalid selected option in multi-select."
#~ msgstr "Ugyldig valg i flervalgboks."
#~ msgid "Invalid selected option in select."
#~ msgstr "Ugyldig alternativ valgt i valgboks."
#~ msgid ""
#~ "H5P internal error: unknown content type \"@type\" in semantics. Removing "
#~ "content!"
#~ msgstr ""
#~ "H5P intern feil: ukjent innholdstype \"@type\" i semantikken. Fjerner "
#~ "innholdet!"
#~ msgid ""
#~ "The version of the H5P library %machineName used in this content is not "
#~ "valid. Content contains %contentLibrary, but it should be "
#~ "%semanticsLibrary."
#~ msgstr ""
#~ "Versjonen av H5P-biblioteket %machineName som brukes av dette innholdet "
#~ "er ikke gyldig. Innholdet bruker %contentLibrary, mens det det skal bruke "
#~ "er %semanticsLibrary."
#~ msgid "The H5P library %library used in the content is not valid"
#~ msgstr "H5P-biblioteket %library som brukes av innholdet er ikke gyldig"
#~ msgid "License Version"
#~ msgstr "Lisensversjon"
#~ msgid "Years (from)"
#~ msgstr "Årstall (fra)"
#~ msgid "Years (to)"
#~ msgstr "Årstall (til)"
#~ msgid "Author's name"
#~ msgstr "Redaktørens navn"
#~ msgid "Author's role"
#~ msgstr "Redaktørens rolle"
#~ msgid "Editor"
#~ msgstr "Redaktør"
#~ msgid "Licensee"
#~ msgstr "Rettighetshaver"
#~ msgid "Originator"
#~ msgstr "Opphavsmann"
#~ msgid "Any additional information about the license"
#~ msgstr "Eventuelle tilleggsinformasjon om lisensen"
#~ msgid "Date"
#~ msgstr "Dato"
#~ msgid "Changed by"
#~ msgstr "Endret av"
#~ msgid "Description of change"
#~ msgstr "Beskrivelse av endring"
#~ msgid "Photo cropped, text changed, etc."
#~ msgstr "Foto beskåret, tekst endret, etc."
#~ msgid "Author comments"
#~ msgstr "Redaktørkommentarer"
#~ msgid ""
#~ "Comments for the editor of the content (This text will not be published "
#~ "as a part of copyright info)"
#~ msgstr ""
#~ "Kommentarer til redaktøren av innholdet (Denne teksten vil ikke bli "
#~ "publisert som en del av opphavsrettsinformasjon)"
#~ msgid "Copyright information"
#~ msgstr "Opphavsrettinformasjon"
#~ msgid "Year(s)"
#~ msgstr "Årstall"
#~ msgid "Invalid json in semantics for %library"
#~ msgstr "Ugyldig JSON i semantikken til %library"
#~ msgid "Error, could not library semantics!"
#~ msgstr "Feil, kunne ikke laste semantikken til biblioteket!"
#~ msgid "Display Download button"
#~ msgstr "Vis Last ned-knapp"
#~ msgid "Could not parse the main h5p.json file"
#~ msgstr "Kunne ikke analysere innholdet i h5p.json-filen"
#~ msgid "Invalid content folder"
#~ msgstr "Ugyldig innholdsmappe"
#~ msgid "Could not find or parse the content.json file"
#~ msgstr "Kunne ikke finne eller analysere content.json-filen"
#~ msgid ""
#~ "H5P fetches content types directly from the H5P Hub. In order to do this, "
#~ "the H5P plugin will communicate with the Hub once a day to fetch "
#~ "information about new and updated content types. It will send in "
#~ "anonymous data to the Hub about H5P usage. Read more at <a href=\"%s"
#~ "\">the plugin communication page at H5P.org</a>."
#~ msgstr ""
#~ "H5P henter innholdstyper direkt fra H5P Hub. For å gjøre dette vil H5P-"
#~ "utvidelsen kommunisere med Hub en gang om dagen for å hente informasjon "
#~ "om nye og oppdaterte innholdstyper. Den vil sende inn anonyme data til "
#~ "Hub om H5P bruk. Les mer på <a href=\"%s\">utvidelseskommunikasjonssiden "
#~ "på H5P.org</a>."
#~ msgid "Enter title here"
#~ msgstr "Fyll inn tittel"
#~ msgid ""
#~ "Usage statistics numbers will automatically be reported to help the "
#~ "developers better understand how H5P is used and to determine potential "
#~ "areas of improvement."
#~ msgstr ""
#~ "Bruksstatistikk tallene vil automatisk bli rapportert for å hjelpe "
#~ "utviklerne med å bedre forstå hvordan H5P brukes og for å bestemme mulige "
#~ "forbedringsområder."
#~ msgid "Added %new new H5P libraries and updated %old old."
#~ msgstr "La til %new nye H5P-bibliotek og oppdaterte %old gamle."
#~ msgid "Unable to create content directory."
#~ msgstr "Kan ikke opprette innholdskatalog."
#~ msgid "Insert H5P Content"
#~ msgstr "Sett inn H5P-innhold"
#~ msgid "ago"
#~ msgstr "siden"
#~ msgid "Invalid security token. Please reload the editor."
#~ msgstr "Ugyldig sikkerhetskode. Vennligst last inn nettsiden på nytt."
#~ msgid ""
#~ "Unfortunately, we were unable to update your installed content types. You "
#~ "must manually download the update from <a href=\"%s\" target=\"_blank"
#~ "\">H5P.org</a>, and then upload it through the <em>Upload Libraries</em> "
#~ "section. If you need futher assistance, please file a <a href=\"%s\" "
#~ "target=\"_blank\">support request</a> or check out our <a href=\"%s\" "
#~ "target=\"_blank\">forum</a>."
#~ msgstr ""
#~ "Dessverre var det ikke mulig å oppdatere de innstallerte innholdstypene "
#~ "automatisk. Du må laste ned oppdateringen manuelt fra <a href=\"%s\" "
#~ "target=\"_blank\">H5P.org</a>, for så å laste dem opp via <em>Last opp "
#~ "biblioteker</em>-seksjon. Hvis du trenger mer hjelp, kan du sende inn en "
#~ "<a href=\"%s\" target=\"_blank\">henvendelse</a> eller sjekke <a href=\"%s"
#~ "\" target=\"_blank\">forumet</a> vårt."
#~ msgid ""
#~ "Head over to the <a href=\"%s\">Libraries</a> page and update your "
#~ "content types to the latest version."
#~ msgstr ""
#~ "Gå over til <a href=\"%s\">Biblioteks-siden</a> og oppdater innholdtypene "
#~ "dine til siste versjon."
#~ msgid ""
#~ "By default, H5P is set up to automatically fetch information regarding "
#~ "Content Type updates from H5P.org. When doing so, H5P will also "
#~ "contribute anonymous usage data to aid the development of H5P. This "
#~ "behaviour can be altered through the <a href=\"%s\">Settings</a> page."
#~ msgstr ""
#~ "Som standard er H5P-utvidelsen satt opp til å automatisk hente "
#~ "informasjon om oppdateringer til innholdstyper fra H5P.org. Når dette "
#~ "gjøres vil H5P-utvidelsen også bidra med anonyme bruksdata for å hjelpe "
#~ "utviklingen av H5P. Denne atferden kan endres gjennom siden for <a href="
#~ "\"%s\">Innstillinger </a>."
#~ msgid ""
#~ "Unfortunately, we were unable to automatically install the default "
#~ "content types. You must manually download the content types you wish to "
#~ "use from the <a href=\"%s\" target=\"_blank\">Examples and Downloads</a> "
#~ "page, and then upload them through the <a href=\"%s\">Libraries</a> page."
#~ msgstr ""
#~ "Dessverre var det ikke mulig å legge inn et sett med standard "
#~ "innholdstyper automatisk. Du må manuelt laste ned de innholdstypene du "
#~ "ønsker å bruke fra <a href=\"%s\" target=\"_blank\">Examples and "
#~ "Downloads</a>-siden, for så å laste dem opp til <a href=\"%s"
#~ "\">bibliotekene</a>-siden."
#~ msgid ""
#~ "We've automatically installed the default content types for your "
#~ "convenience. You can now <a href=\"%s\">start creating</a> your own "
#~ "interactive content!"
#~ msgstr ""
#~ "For å gjøre det enkelt har vi automatisk installert et sett med standard "
#~ "innholdstyper. Du kan nå <a href=\"%s\">begynne å lage</a> ditt eget "
#~ "interaktive innhold!"
#~ msgid "%s new update is available!"
#~ msgid_plural "%s new updates are available!"
#~ msgstr[0] "%s ny oppdatering er tilgjengelig!"
#~ msgstr[1] "%s nye oppdateringer er tilgjengelig!"
#~ msgid "Update All Libraries"
#~ msgstr "Oppdater alle bibliotek"
#~ msgid "There are updates available for your H5P content types."
#~ msgstr "Det finnes tilgjengelige oppdateringer for H5P-innholdstypene dine."
#~ msgid ""
#~ "You can read about why it's important to update and the benefits from "
#~ "doing so on the <a href=\"%s\" target=\"_blank\">Why Update H5P</a> page."
#~ msgstr ""
#~ "Du kan lese om hvorfor det er viktig å oppdatere og fordelene ved å gjøre "
#~ "det på <a href=\"%s\" target=\"_blank\">Why Update H5P</a>-siden."
#~ msgid ""
#~ "The page also list the different changelogs, where you can read about the "
#~ "new features introduced and the issues that have been fixed."
#~ msgstr ""
#~ "Denne siden lister også de forskjellige endringsloggene, hvor du kan lese "
#~ "om de nye egenskapene som er lagt til og hvilke saker som er fikset."
#~ msgid "The version you're running is from <strong>%s</strong>."
#~ msgstr "Versjonen du kjører er fra <strong>%s</strong>."
#~ msgid "The most recent version was released on <strong>%s</strong>."
#~ msgstr "Siste versjon ble sluppet <strong>%s</strong>."
#~ msgid ""
#~ "You can use the button below to automatically download and update all of "
#~ "your content types."
#~ msgstr ""
#~ "Du kan bruke knappen under til å automatisk laste ned og oppdatere alle "
#~ "dine innholdstyper."
#~ msgid "Download & Update"
#~ msgstr "Last ned og oppdater"
#~ msgid "External communication"
#~ msgstr "Ekstern kommunikasjon"
#~ msgid ""
#~ "I wish to aid in the development of H5P by contributing anonymous usage "
#~ "data"
#~ msgstr ""
#~ "Jeg ønsker å hjelpe til med utviklingen av H5P ved å bidra med anonyme "
#~ "bruksdata"
#~ msgid ""
#~ "Disabling this option will prevent your site from fetching the newest H5P "
#~ "updates."
#~ msgstr ""
#~ "Deaktivering av denne innstillingen vil hindre nettstedet ditt fra å "
#~ "hente de nyeste H5P-oppdateringene."
#~ msgid ""
#~ "You will have to manually download the Content Type updates from H5P.org "
#~ "and then upload them to your site."
#~ msgstr ""
#~ "Du må laste ned oppdateringene for innholdstypene manuelt fra H5P.org, "
#~ "for deretter å laste dem opp til nettstedet ditt."
#~ msgid ""
#~ "You can read more about <a href=\"%s\" target=\"_blank\">which data is "
#~ "collected</a> on h5p.org."
#~ msgstr ""
#~ "Du kan lese mer om <a href=\"%s\" target=\"_blank\">hvilke data som blir "
#~ "samlet</a> på h5p.org."
#~ msgid "Add content method"
#~ msgstr "\"Legg til H5P\"-methode"
#~ msgid "Unable to create directory."
#~ msgstr "Kan ikke opprette katalog."
#~ msgid "Could not save file."
#~ msgstr "Kunne ikke lagre filen."
#~ msgid "Could not copy file."
#~ msgstr "Kunne ikke kopiere filen."
#~ msgid "The following libraries are outdated and should be upgraded:"
#~ msgstr "Følgende biblioteker er utdatert og bør oppgraderes:"
#~ msgid "To upgrade all the installed libraries, do the following:"
#~ msgstr ""
#~ "For å oppgradere alle de installerte bibliotekene, gjør du følgende:"
#~ msgid "Download the H5P file from the %s page."
#~ msgstr "Last ned H5P-filen fra %s-siden."
#~ msgid "Select the downloaded <em> %s</em> file in the form below."
#~ msgstr "Velg den nedlastede <em>%s</ em>-filen i skjemaet nedenfor."
#~ msgid ""
#~ "Check off \"Only update existing libraries\" and click the <em>Upload</"
#~ "em> button."
#~ msgstr ""
#~ "Kryss av \"Kun oppdater eksisterende biblioteker\" og trykk på "
#~ "<em>Oppdater</em>-knappen."
#~ msgid ""
#~ "You should head over to the <a href=\"%s\">Libraries</a> page and update "
#~ "your content types to the latest version."
#~ msgstr ""
#~ "Du bør navigere til <a href=\"%s\">bibliotekene</a>-siden og oppdatere "
#~ "innholdstypene til siste versjon."
#~ msgid "Display buttons (download, embed and copyright)"
#~ msgstr "Vis knapper (last ned, embed og opphavsrett)"
#~ msgid "Download button"
#~ msgstr "Last ned-knapp"
#~ msgid "Embed button"
#~ msgstr "Embed-knapp"
#~ msgid "Copyright button"
#~ msgstr "Opphavsrett-knapp"
#~ msgid "Action bar"
#~ msgstr "Handlinger"
#~ msgid "About H5P button"
#~ msgstr "Om H5P-knapp"
#~ msgid ""
#~ "Library used in content is not a valid library according to semantics"
#~ msgstr ""
#~ "Biblioteket som brukes i innholdet er ikke gyldig i henhold til "
#~ "semantikken"
#~ msgid ""
#~ "The library \"%libraryName\" requires H5P %requiredVersion, but only H5P "
#~ "%coreApi is installed."
#~ msgstr ""
#~ "Biblioteket \"%library_name\" krever versjon %requiredVersion av H5P, men "
#~ "det er kunn versjon %coreApi som er innstallert."
#~ msgid "User Tracking"
#~ msgstr "Brukersporing"
#~ msgid "Library updates"
#~ msgstr "Biblioteksoppdateringer"
#~ msgid "Fetch information about updates for your H5P content types"
#~ msgstr "Hent informasjon om oppdateringer for H5P-innholdstyper"
#~ msgid "Unable to write to the content directory."
#~ msgstr "Kan ikke opprette innholdskatalog."
#~ msgid "Unable to write to the libraries directory."
#~ msgstr "Kan ikke opprette bibliotekskatalog."
#~ msgid "Unable to write to the temporary directory."
#~ msgstr "Kan ikke opprette midlertidigkatalog."
#~ msgid "Unable to write to the exports directory."
#~ msgstr "Kan ikke opprette eksportkatalog."
#~ msgid "Unable to copy file tree."
#~ msgstr "Klarer ikke kopiere filtreet."
#~ msgid "Content type upgrades are here!"
#~ msgstr "Oppdater innholdstypene dine!"
#~ msgid ""
#~ "If you've just upgraded you plugin, you should install the <a href=\"%s\" "
#~ "target=\"_blank\">lastest version</a> of your content types."
#~ msgstr ""
#~ "Hvis du akkurat har oppgradert plugin bør du innstallere <a href=\"%s\" "
#~ "target=\"_blank\">siste versjon</a> av innholdstypene du bruker."
#~ msgid ""
#~ "In order to take advantage of this plugin you must first select and "
#~ "download the H5P content types you wish to use."
#~ msgstr ""
#~ "For å kunne dra nytte av denne plugin må du først finne og laste ned de "
#~ "H5P-innholdstypene som du ønsker å bruke."
#~ msgid "Here is a short guide to get you started:"
#~ msgstr "Her er en kort guide for å komme i gang:"
#~ msgid "Download %s."
#~ msgstr "Last ned %s."
#~ msgid "Installed"
#~ msgstr "Installert"
| 16,103
|
https://github.com/SamanthaToet/mastering-shiny/blob/master/2-first-app/q1/app.R
|
Github Open Source
|
Open Source
|
CC0-1.0
| 2,020
|
mastering-shiny
|
SamanthaToet
|
R
|
Code
| 78
| 181
|
library(shiny)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Q1 - greet users by name"),
# Sidebar with a text input for name
sidebarLayout(
sidebarPanel(
textInput("name", "What's your name?")
),
# Show the name and phrase
mainPanel(
textOutput("greeting")
)
)
)
# Define server logic to print name
server <- function(input, output) {
output$greeting <- renderText({
paste0("Hello ", input$name)
})
}
# Run the application
shinyApp(ui = ui, server = server)
| 42,028
|
https://github.com/bigwater/Galois/blob/master/lonestar/analytics/gpu/spanningtree/mst.h
|
Github Open Source
|
Open Source
|
BSD-3-Clause
| 2,022
|
Galois
|
bigwater
|
C
|
Code
| 112
| 432
|
#pragma once
#include "component.h"
#include "moderngpu/kernel_reduce.hxx"
struct comp_data {
Shared<int> weight;
Shared<int> edge;
Shared<int> node;
Shared<int> level;
Shared<int> dstcomp;
int* lvl;
int* minwt;
int* minedge; // absolute
int* minnode;
int* mindstcomp;
};
static void dump_comp_data(struct comp_data comp, int n, int lvl);
static void dump_comp_data(struct comp_data comp, int n, int lvl) {
int *level, *minwt, *minedge, *minnode, *mindstcomp;
level = comp.level.cpu_rd_ptr();
minwt = comp.weight.cpu_rd_ptr();
minedge = comp.edge.cpu_rd_ptr();
minnode = comp.node.cpu_rd_ptr();
mindstcomp = comp.dstcomp.cpu_rd_ptr();
for (int i = 0; i < n; i++) {
if (level[i] == lvl) {
fprintf(stderr, "%d: (%d) node %d edge %d weight %d dstcomp %d\n", i,
level[i], minnode[i], minedge[i], minwt[i], mindstcomp[i]);
}
}
comp.level.gpu_wr_ptr();
comp.weight.gpu_wr_ptr();
comp.edge.gpu_wr_ptr();
comp.node.gpu_wr_ptr();
comp.dstcomp.gpu_wr_ptr();
}
| 6,677
|
https://github.com/dcecile/bitfontmake/blob/master/test.py
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
bitfontmake
|
dcecile
|
Python
|
Code
| 160
| 602
|
from fontmake.font_project import FontProject
from objects import BitFont, BitInfo, BitGlyph
from transforms import convert_to_font
import codepoints
from input import open_bit_font
def create_py_bit_font():
o = False
X = True
return BitFont(
size=(4, 6),
info=BitInfo(
family_name='Bit Font Make TestPy',
style_name='Regular',
weight=400,
designer='Ay Non',
designer_url='http://example.org',
copyright_year='2017',
major_version=0,
minor_version=1,
is_ofl=True),
glyphs=[
BitGlyph(
codepoint='A',
bits=[
o, X, X, o,
o, X, X, o,
X, o, o, X,
X, X, X, X,
X, o, o, X,
X, o, o, X,
]),
BitGlyph(
codepoint=' ',
bits=[
o, o, o, o,
o, o, o, o,
o, X, X, o,
o, X, X, o,
o, o, o, o,
o, o, o, o,
]),
BitGlyph(
codepoint=codepoints.replacement_character,
bits=[
X, o, X, o,
o, X, o, X,
X, o, X, o,
o, X, o, X,
X, o, X, o,
o, X, o, X,
]),
])
def test_bit_font(bit_font):
print(bit_font)
font = convert_to_font(bit_font)
font.save(
path=f'master_ufo/{bit_font.info.family_name}.ufo',
formatVersion=3)
project = FontProject()
project.build_ttfs(
[font],
remove_overlaps=True)
bit_fonts = [
create_py_bit_font(),
open_bit_font('test.png'),
open_bit_font('test.gif'),
]
for bit_font in bit_fonts:
test_bit_font(bit_font)
| 21,513
|
https://github.com/rdzudzar/friends_analysis/blob/master/Friends_sorry.py
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
friends_analysis
|
rdzudzar
|
Python
|
Code
| 253
| 1,281
|
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 9 10:43:10 2019
@author: Rob
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 5 23:32:37 2019
@author: Rob
"""
from bokeh.palettes import Spectral4
from bokeh.plotting import figure, output_file, show
from bokeh.models import ColumnDataSource, HoverTool, BoxSelectTool
from Friends_analysis import *
print(len(store_all_titles))
print(len(df_only_sorry.index))
def make_bokeh_line_plot():
source = ColumnDataSource(
data=dict(
x=df_only_sorry.index,
mon=df_only_sorry['SumMonica'],
rac=df_only_sorry['SumRachel'],
pho=df_only_sorry['SumPhoebe'],
joe=df_only_sorry['SumJoey'],
cha=df_only_sorry['SumChandler'],
ros=df_only_sorry['SumRoss'],
episode = df_only_sorry['Titles'],
)
)
hover = HoverTool(
tooltips=[
("Episode", "$index"),
("Title", "@episode")
]
)
p = figure(plot_width=1300, plot_height=700, tools=[hover, "pan,wheel_zoom,box_zoom,reset"])
p.title.text = 'Click on a Friend, Series analysis'
p.vbar(season_delim, top=num_delim, width=0.2, color='purple', legend='')
p.line('x','mon', source=source, line_width=4, color='lightgrey',
alpha=0.4, muted_color='#8c510a', muted_alpha=1, legend='Monica')
p.line('x', 'rac', source=source, line_width=4, color='lightgrey',
alpha=0.4, muted_color='#01665e', muted_alpha=1, legend='Rachel')
p.line('x', 'pho', source=source, line_width=4, color='lightgrey',
alpha=0.4, muted_color='#c51b7d', muted_alpha=1, legend='Phoebe')
p.line('x', 'joe', source=source, line_width=4, color='lightgrey',
alpha=0.4, muted_color='#4d4d4d', muted_alpha=1, legend='Joey')
p.line('x', 'cha', source=source, line_width=4, color='lightgrey',
alpha=0.4, muted_color='#762a83', muted_alpha=1, legend='Chandler')
p.line('x', 'ros', source=source, line_width=4, color='lightgrey',
alpha=0.4, muted_color='#b2182b', muted_alpha=1, legend='Ross')
x_positions = [7, 29.5, 53.5, 78.5, 99.5, 123.5, 146.5, 168.5, 192.5, 211.5]
season_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for i, each_label in enumerate(x_positions):
mytext = Label(x=each_label, y=0, text='Season {0}'.format(season_num[i]),
border_line_color='black', border_line_alpha=0.5,text_font_size="13pt")
p.add_layout(mytext)
p.legend.orientation = "horizontal"
p.legend.location = "top_center"
p.legend.click_policy="mute"
# Define axis labels and properties
p.xaxis.axis_label = 'Episode'
p.yaxis.axis_label = 'Sorry [counts]'
p.xaxis.axis_label_text_font_size = "15pt"
p.yaxis.axis_label_text_font_size = "15pt"
p.title.text_font_size = '18pt'
p.xaxis.major_label_text_font_size = "15pt"
p.yaxis.major_label_text_font_size = "15pt"
p.legend.label_text_font_size = '20pt'
#output_file("interactive_legend.html", title="interactive_legend.py example")
show(p)
return
###########################################
########### Handle the functions #################
##################################################
if __name__ == "__main__":
season_delim = np.cumsum(num_episodes).tolist()
num_delim = [4]*10
make_bokeh_line_plot()
| 43,102
|
https://github.com/padlocks/CustomOrigins/blob/master/src/main/java/io/github/padlocks/customorigins/impl/mixin/HookClientPlayerTick.java
|
Github Open Source
|
Open Source
|
MIT
| null |
CustomOrigins
|
padlocks
|
Java
|
Code
| 75
| 359
|
package io.github.padlocks.customorigins.impl.mixin;
import com.mojang.authlib.GameProfile;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.world.ClientWorld;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import io.github.padlocks.customorigins.player.PlayerTicker;
import static org.spongepowered.asm.mixin.injection.At.Shift.AFTER;
@Mixin(ClientPlayerEntity.class)
public abstract class HookClientPlayerTick extends AbstractClientPlayerEntity {
protected HookClientPlayerTick(final ClientWorld world, final GameProfile profile) {
super(world, profile);
}
@Inject(method = "tickMovement()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/input/Input;tick(Z)V", ordinal = 0, shift = AFTER))
private void afterInputTick(final CallbackInfo info) {
final ClientPlayerEntity player = (ClientPlayerEntity) (Object) this;
PlayerTicker.get(player).afterInputTick(player);
}
}
| 27,251
|
https://github.com/Zhofre/engineering/blob/master/src/Engineering.Expressions/BinaryExpression{T}.cs
|
Github Open Source
|
Open Source
|
MIT
| null |
engineering
|
Zhofre
|
C#
|
Code
| 74
| 223
|
namespace Engineering.Expressions
{
public abstract class BinaryExpression<T> : Expression<T>
where T : IExpressible
{
public BinaryExpression(Expression<T> lhs, Expression<T> rhs)
{
LeftHandSide = lhs;
RightHandSide = rhs;
}
public Expression<T> LeftHandSide { get; }
public Expression<T> RightHandSide { get; }
public override bool CanScale => LeftHandSide.CanScale && RightHandSide.CanScale;
public override string Representation
=> LeftHandSide.AutoBracketedRepresentation
+ OperatorSymbol
+ RightHandSide.AutoBracketedRepresentation;
protected abstract string OperatorSymbol { get; }
protected override int GetHashCodeImpl()
=> LeftHandSide.GetHashCode()*17 + RightHandSide.GetHashCode();
}
}
| 33,400
|
https://github.com/saleks/manage-project/blob/master/resources/js/App/Auth/vuex/mutations.js
|
Github Open Source
|
Open Source
|
MIT
| null |
manage-project
|
saleks
|
JavaScript
|
Code
| 60
| 235
|
// https://vuex.vuejs.org/en/mutations.html
import * as TYPES from './mutations-types'
/* eslint-disable no-param-reassign */
export default {
[TYPES.SET_USER](state, user) {
state.user = user
},
[TYPES.SET_TOKEN](state, token) {
state.token = token
},
[TYPES.SET_TOKEN_TYPE](state, token_type) {
state.token_type = token_type
},
[TYPES.SET_ROLES](state, roles) {
console.log('setRoles', roles);
state.roles = roles
},
[TYPES.SET_EXPIRES](state, expires) {
state.expires_in = expires
},
[TYPES.SET_IS_LOGIN](state, isLogin) {
state.is_login = isLogin
}
}
| 48,202
|
https://github.com/ebartz/legoino/blob/master/src/PoweredUpHub.cpp
|
Github Open Source
|
Open Source
|
MIT
| null |
legoino
|
ebartz
|
C++
|
Code
| 148
| 318
|
/*
* PoweredUpHub.cpp - Arduino Library for controlling PoweredUp hubs (Train, Batmobil)
*
* (c) Copyright 2019 - Cornelius Munz
* Released under MIT License
*
*/
#include "PoweredUpHub.h"
PoweredUpHub::PoweredUpHub(){};
/**
* @brief Set the motor speed on a defined port.
* @param [in] port Port of the Hub on which the speed of the motor will set (A, B, AB)
* @param [in] speed Speed of the Motor -100..0..100 negative values will reverse the rotation
*/
void PoweredUpHub::setMotorSpeed(Port port, int speed = 0)
{
byte setMotorCommand[6] = {0x81, port, 0x11, 0x51, 0x00, MapSpeed(speed)}; //train, batmobil
WriteValue(setMotorCommand, 6);
}
/**
* @brief Stop the motor on a defined port. If no port is set, all motors (AB) will be stopped
* @param [in] port Port of the Hub on which the motor will be stopped (A, B, AB)
*/
void PoweredUpHub::stopMotor(Port port = AB)
{
setMotorSpeed(port, 0);
}
| 16,116
|
https://github.com/AhmetOsmn/JS-Examples/blob/master/8. Getir Clone/node_modules/react-flags-select/build/components/Flags/Countries/Cy.d.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
JS-Examples
|
AhmetOsmn
|
TypeScript
|
Code
| 14
| 44
|
import * as React from "react";
declare function SvgCy(props: React.SVGProps<SVGSVGElement>): JSX.Element;
export default SvgCy;
| 11,272
|
https://github.com/ezeh2/Simple-OOXML-Package-Explorer/blob/master/src/PackageExplorer/View/UI/DocumentExplorer.Designer.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
Simple-OOXML-Package-Explorer
|
ezeh2
|
C#
|
Code
| 273
| 1,243
|
namespace PackageExplorer.View
{
partial class DocumentExplorer
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DocumentExplorer));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.documentPartView1 = new PackageExplorer.View.ExplorerTreeView();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(220, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(84, 22);
this.toolStripButton1.Text = "Show Relations";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// documentPartView1
//
this.documentPartView1.DisplayRelations = false;
this.documentPartView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.documentPartView1.ImageIndex = 0;
this.documentPartView1.ImageList = this.imageList1;
this.documentPartView1.Location = new System.Drawing.Point(0, 25);
this.documentPartView1.Name = "documentPartView1";
this.documentPartView1.SelectedImageIndex = 0;
this.documentPartView1.Size = new System.Drawing.Size(220, 526);
this.documentPartView1.TabIndex = 1;
this.documentPartView1.DisplayRelationsChanged += new System.EventHandler(this.documentPartView1_DisplayRelationsChanged);
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Magenta;
this.imageList1.Images.SetKeyName(0, "Package.PNG");
this.imageList1.Images.SetKeyName(1, "PackagePart.PNG");
//
// DocumentExplorer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.documentPartView1);
this.Controls.Add(this.toolStrip1);
this.Name = "DocumentExplorer";
this.Size = new System.Drawing.Size(220, 551);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private PackageExplorer.View.ExplorerTreeView documentPartView1;
private System.Windows.Forms.ImageList imageList1;
}
}
| 41,386
|
https://github.com/saynschuman/plaza/blob/master/src/scss/main.scss
|
Github Open Source
|
Open Source
|
MIT
| null |
plaza
|
saynschuman
|
SCSS
|
Code
| 1,203
| 4,719
|
@import "includes/variables";
@import "includes/fonts";
@import "vendors/bootstrap";
body {
font-family: GothaProReg;
font-size: 19px;
color: #000;
}
ul, menu, dir {
display: block;
list-style-type: disc;
-webkit-margin-before: 0;
-webkit-margin-after: 0;
-webkit-margin-start: 0;
-webkit-margin-end: 0;
-webkit-padding-start: 0;
}
.caret {
border-top: 8px dashed;
border-right: 6px solid transparent;
border-left: 6px solid transparent;
}
a:focus {
outline: none;
text-decoration: none;
}
a:hover {
text-decoration: none;
}
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border-color: transparent;
border: none;
}
.navbar-default {
background-color: $blue;
border-color: transparent;
border-radius: 0;
}
.navbar-collapse {
padding: 0;
}
header.header {
padding-top: 35px;
.logo {
display: block;
img {
width: auto;
display: block;
max-width: 100%;
}
}
.right-menu {
padding-top: 10px;
text-align: right;
li {
list-style: none;
line-height: 1.7;
a {
color: #000;
.multi-img {
padding: 0 2px;
}
}
.tel-num {
padding-left: 10px;
display: inline-block;
}
}
}
.navbar {
margin-bottom: 0;
margin-top: 20px;
margin-bottom: 10px;
.menu {
margin-bottom: 0;
border-top: 1px solid #aad5d6;
border-bottom: 1px solid #aad5d6;
}
li {
list-style: none;
display: inline-block;
float: left;
&.dropdown {
position: relative;
&::after {
content: '';
position: absolute;
}
}
a {
color: #fff;
font-size: 18px;
font-weight: 600;
padding: 17px 25px;
border-right: 1px solid #aad5d6;
display: block;
text-align: center;
}
&:last-child {
a {
border-right: none;
}
}
}
}
form {
padding: 11px 24px;
input[type="search"] {
border: none;
outline: none;
padding: 3px 0;
padding-left: 10px;
}
input[type="submit"] {
background-image: url(../img/s-b.png);
color: transparent;
border: none;
height: 33px;
width: 36px;
background-position: center center;
}
}
.dropdown-menu {
li {
float: none;
display: block;
padding-left: 20px;
a {
color: #000;
text-align: left;
line-height: 2;
border: none;
width: 100%;
display: block;
padding: 0;
&:hover {
background: #fff;
}
}
}
}
}
.main-screen {
.slider {
margin-bottom: 12px;
.item {
height: 416px;
width: 100%;
background-size: 100%;
}
}
.right-screen {
.block {
position: relative;
height: 207px;
display: block;
width: 100%;
background: #f7f7f7;
&:first-child {
border-bottom: 2px solid #e3e3e3;
}
&:last-child {
border-top: 2px solid #fff;
}
.inner {
position: absolute;
top: 50%;
transform: translateY(-50%);
margin: auto;
display: block;
width: 100%;
}
}
.title {
color: $blue;
text-align: center;
font-size: 22px;
margin-bottom: 25px;
}
a {
color: #1b1b1b;
background: #dedc00;
font-size: 16px;
text-transform: uppercase;
display: block;
width: 134px;
text-align: center;
margin: auto;
padding: 6px 0;
font-weight: 600;
}
}
}
.why {
position: relative;
&::before {
content: '';
position: absolute;
top: 0;
left: 13px;
width: calc(100% - 26px);
height: 72px;
background-image: url(../img/yellow-plank.png);
background-repeat: no-repeat;
background-size: 100%;
}
.title {
text-align: center;
text-transform: uppercase;
color: $blue;
font-size: 32px;
padding-bottom: 25px;
padding-top: 90px;
}
.left-bl {
.point {
font-size: 28px;
color: #0d0d0d;
span {
color: $blue;
font-size: 50px;
}
}
}
.map-bl {
background-image: url(../img/map.png);
background-size: 100%;
background-position: center center;
height: 343px;
background-repeat: no-repeat;
margin: 0 50px auto;
.city {
height: 14px;
width: 11px;
background-image: url(../img/mark.png);
background-size: 100%;
position: absolute;
background-repeat: no-repeat;
cursor: pointer;
&:hover {
.show-city {
display: block !important;
}
}
.show-city {
display: none !important;
position: absolute;
top: -98px;
width: 202px;
background: #fff;
padding: 1px 15px;
z-index: 1;
border: 1px solid $blue;
left: -96px;
a {
color: #000;
font-size: 17px;
width: 202px;
display: block;
}
.city-name {
text-align: center;
width: 100%;
color: $blue;
font-family: GothaProNarMed;
font-size: 22.25px;
position: relative;
&::after {
content: '';
position: absolute;
height: 40px;
width: 1px;
background: #48a5a8;
bottom: -66px;
left: 85px;
}
&::before {
content: '';
position: absolute;
height: 40px;
width: 100%;
background: transparent;
bottom: -66px;
left: 0;
}
}
}
&#London {
top: 92px;
left: 363px;
.show-city {
display: block;
}
}
&#Barcelona {
top: 119px;
left: 369px;
}
&#Berlin {
top: 97px;
left: 381px;
}
&#Kiev {
top: 100px;
left: 422px;
}
&#Kharkiv {
top: 97px;
left: 432px;
}
&#LA {
top: 135px;
left: 145px;
}
&#Toronto {
top: 105px;
left: 225px;
}
&#Singapore {
top: 201px;
left: 559px;
}
&#Omsk {
top: 91px;
left: 521px;
}
&#Chelyabinsk {
top: 92px;
left: 484px;
}
&#Tumen {
top: 79px;
left: 495px;
}
&#Riga {
top: 79px;
left: 410px;
}
&#Piter {
top: 74px;
left: 423px;
}
&#Moskow {
top: 82px;
left: 453px;
}
}
}
&.what {
&::before {
background-image: url(../img/blue-plank.png);
}
.what-block {
position: relative;
padding-bottom: 30px;
a {
color: $blue;
font-size: 21px;
text-align: center;
width: 100%;
text-transform: uppercase;
display: block;
padding-top: 15px;
margin: 0 auto;
}
.title {
font-size: 21px;
color: #000;
text-align: left;
text-transform: lowercase;
position: absolute;
top: -8px;
line-height: 1.1;
padding-bottom: 0;
padding-top: 0;
padding-left: 38px;
}
img {
margin: auto;
display: block;
}
}
}
.lamp {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
}
.want {
text-align: center;
background-image: url(../img/form-background.png);
background-repeat: no-repeat;
background-size: 100%;
padding-top: 30px;
.want-title {
color: #fff;
font-size: 33px;
font-family: GothaProBold;
}
.sub-title {
color: #fff;
font-size: 21px;
line-height: 1.2;
margin-bottom: 20px;
}
form {
input {
width: 100%;
display: block;
margin: auto;
margin-bottom: 10px;
text-align: center;
height: 40px;
&.topic {
max-width: 890px;
}
&.email {
max-width: 586px;
}
}
button {
width: 100%;
max-width: 341px;
height: 70px;
color: #000;
font-size: 24px;
border: none;
background: none;
background-color: #dedc00;
}
}
.reviews {
.rev-tit {
text-align: center;
text-transform: uppercase;
color: #48a5a8;
font-size: 32px;
padding-bottom: 25px;
padding-top: 50px;
}
.review {
color: #1b1b1b;
font-size: 16px;
text-align: justify;
a {
color: $blue;
font-size: 22.46px;
display: block;
margin-top: 5px;
border-top: 2px solid #48a5a8;
margin-bottom: 70px;
}
}
.look {
width: 880px;
display: block;
margin: auto;
margin-top: 30px;
.l {
text-align: left;
float: left;
height: 50px;
display: block;
padding-top: 13px;
background: $blue;
width: 50%;
color: #fff;
padding-left: 40px;
}
.r {
text-align: right;
float: right;
height: 50px;
display: block;
padding-top: 13px;
background: $blue;
width: 50%;
color: #fff;
padding-right: 40px;
}
}
}
}
.portfolio {
padding-top: 30px;
img {
margin-bottom: 26px;
width: 100%;
height: auto;
}
}
.text {
.sh-m {
text-transform: uppercase;
height: 56px;
width: 100%;
text-align: center;
background: linear-gradient(to top, #dedc00, transparent);
padding-top: 16px;
margin-top: -20px;
z-index: 2;
position: relative;
cursor: pointer;
}
p {
color: #1b1b1b;
font-size: 16px;
}
ul {
padding-left: 20px;
padding-bottom: 20px;
padding-top: 15px;
li {
font-size: 16px;
text-transform: uppercase;
line-height: 1.7;
}
}
}
footer.footer {
background: $blue;
padding: 50px 0;
margin-top: 25px;
form,
ul,
.footer-logo {
display: block;
float: none;
}
form {
input {
display: inline-block;
text-align: center;
border: none;
padding: 3px;
&[type="submit"] {
background: none;
background: #dedc00;
color: #000;
padding: 4px 20px;
font-family: GothaProNarMed;
}
}
}
.social {
position: relative;
padding: 0;
margin: 0;
padding-top: 30px;
margin-top: 25px;
margin-bottom: 30px;
&::before {
content: 'Мы в соцсетях:';
background: transparent;
position: absolute;
top: 0;
left: 0;
color: #fff;
}
img {
width: 29px;
height: 29px;
}
li {
display: inline-block;
list-style: none;
margin-top: 6px;
}
}
.logo {
display: block;
img {
width: auto;
display: block;
max-width: 100%;
}
}
.footer-menu {
padding: 0;
margin: 0;
li {
list-style: none;
&:first-child {
a {
padding-top: 0;
}
}
a {
color: #fff;
padding: 5px 0;
display: block;
font-size: 16.65px;
}
}
}
.contacts {
color: #fff;
padding-top: 0;
.cont-title {
font-size: 25.96px;
color: #dedc00;
line-height: 1;
margin-bottom: 20px;
padding-top: 0;
}
.contact {
margin-bottom: 20px;
font-size: 16.65px;
}
}
}
.sh-m {
display: none;
}
.mobile-search,
.map-mobile,
.sh-m,
.logo-mob,
.mob {
display: none;
}
.mobile-footer-form {
display: none !important;
}
.norm-size {
height: auto !important;
&::after {
display: none !important;
}
.sh-m {
display: none;
}
}
.up {
font-size: 21px;
color: $blue;
text-align: center;
text-transform: uppercase;
margin: 10px 0;
cursor: pointer;
}
| 25,026
|
https://github.com/servicecatalog/development/blob/master/oscm-i18n-intsvc/javasrc/org/oscm/i18nservice/local/ImageResourceServiceLocal.java
|
Github Open Source
|
Open Source
|
Apache-2.0, EPL-1.0, BSD-3-Clause, W3C, LGPL-3.0-only, CPL-1.0, CDDL-1.1, BSD-2-Clause, LicenseRef-scancode-proprietary-license, LGPL-2.1-or-later, CDDL-1.0, Apache-1.1, MIT, LicenseRef-scancode-unknown-license-reference, W3C-19980720, LGPL-2.1-only, PostgreSQL
| 2,020
|
development
|
servicecatalog
|
Java
|
Code
| 180
| 402
|
/*******************************************************************************
*
* Copyright FUJITSU LIMITED 2017
*
* Author: pock
*
* Creation Date: 06.11.2009
*
* Completion Time: 06.11.2009
*
*******************************************************************************/
package org.oscm.i18nservice.local;
import javax.ejb.Local;
import org.oscm.domobjects.ImageResource;
import org.oscm.internal.types.enumtypes.ImageType;
/**
* Internal interface providing the functionality to manage image resources in
* the database.
*
* @author pock
*
*/
@Local
public interface ImageResourceServiceLocal {
/**
* Deletes the image resource with the given image resource identifier.
*
* @param objectKey
* The key of the object the image belongs to.
* @param imageType
* The type of the image.
*/
public void delete(long objectKey, ImageType imageType);
/**
* Reads the image resource for the given object key and image type.
*
* @param objectKey
* The technical key of the object the image resource belongs to.
* @param imageType
* The image type of the image resource.
* @return the read image resource object
*/
public ImageResource read(long objectKey, ImageType imageType);
/**
* Stores (creates or upadates) the given image resource object.
*
* @param imageResource
* The ImageResource to store.
*/
public void save(ImageResource imageResource);
}
| 14,169
|
https://github.com/maddy-torqata/gokul-organics1/blob/master/node_modules/@fortawesome/pro-regular-svg-icons/faTh.js
|
Github Open Source
|
Open Source
|
MIT
| null |
gokul-organics1
|
maddy-torqata
|
JavaScript
|
Code
| 97
| 417
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'far';
var iconName = 'th';
var width = 512;
var height = 512;
var ligatures = [];
var unicode = 'f00a';
var svgPathData = 'M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM197.3 72h117.3v96H197.3zm0 136h117.3v96H197.3zm-40 232H52c-6.6 0-12-5.4-12-12v-84h117.3zm0-136H40v-96h117.3zm0-136H40V84c0-6.6 5.4-12 12-12h105.3zm157.4 272H197.3v-96h117.3v96zm157.3 0H354.7v-96H472zm0-136H354.7v-96H472zm0-136H354.7V72H472z';
exports.definition = {
prefix: prefix,
iconName: iconName,
icon: [
width,
height,
ligatures,
unicode,
svgPathData
]};
exports.faTh = exports.definition;
exports.prefix = prefix;
exports.iconName = iconName;
exports.width = width;
exports.height = height;
exports.ligatures = ligatures;
exports.unicode = unicode;
exports.svgPathData = svgPathData;
| 31,417
|
https://github.com/blockchainworkbench/plugin-solidity-exercises/blob/master/test/sol/Test_events.sol
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,018
|
plugin-solidity-exercises
|
blockchainworkbench
|
Solidity
|
Code
| 17
| 46
|
pragma solidity ^0.4.0;
contract Test {
event NoArgument();
event OneArgument(uint a);
event TwoArguments(address a, bool b);
}
| 18,608
|
https://github.com/anuragsen21/adult-lounge/blob/master/application/controllers/Login.php
|
Github Open Source
|
Open Source
|
MIT
| null |
adult-lounge
|
anuragsen21
|
PHP
|
Code
| 219
| 1,116
|
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . 'core/CommonController.php';
class Login extends CommonController {
public function index(){
$this->checkAge();
if($this->session->userdata('UserId')){
redirect(base_url());
}
$data['header'] = 'two';
$this->load->view('frontend/layout/header', $data);
$this->load->view('frontend/pages/login');
$this->load->view('frontend/layout/footer');
}
public function setAge(){
$this->session->set_userdata('setAge', 'Done');
}
public function signUp() {
$this->checkAge();
if($this->session->userdata('UserId')){
redirect(base_url());
}
$data['header'] = 'two';
$this->load->view('frontend/layout/header', $data);
$this->load->view('frontend/pages/signup');
$this->load->view('frontend/layout/footer');
}
public function doRegistration(){
$chk = $this->cm->get_all('users', array("email" => $this->input->post('reg_email')));
if(empty($chk)){
if($this->input->post('reg_type') == 1){
$status = 1;
$verified = 'Yes';
}else{
$status = 0;
$verified = 'No';
}
$in_array = [
'name' => $this->input->post('reg_name'),
'email' => $this->input->post('reg_email'),
'login_type' => $this->input->post('reg_type'),
'login_password' => md5($this->input->post('reg_pwd')),
'gender' => $this->input->post('reg_gender'),
'status' => $status,
'account_verified' => $verified
];
$insert_id = $this->cm->insert('users', $in_array);
if($insert_id){
$this->cm->insert('user_preference', array("user_id" => $insert_id));
print "ok";
}else{
print "notok";
}
}else{
print 'Sorry !!! User already exists with this email !!!';
}
}
public function doLogin(){
$chk = $this->cm->get_all('users', array("email" => $this->input->post('login_email'), "login_password" => md5($this->input->post('login_pwd'))));
if(empty($chk)){
print 'Sorry !!! Email & Password mismatch !!!';
}else{
if($chk[0]->status == 0){
print 'Sorry '.$chk[0]->name.'!!! Your account is not activated yet !!!';
}else{
$this->cm->update('users', array("id" => $chk[0]->id), array("isLogin" => 1, "login_time" => date('Y-m-d H:i:s')));
$this->session->set_userdata('UserId', $chk[0]->id);
$this->session->set_userdata('UserName', $chk[0]->name);
$this->session->set_userdata('UserType', $chk[0]->login_type);
$this->session->set_userdata('AccountVerified', $chk[0]->account_verified);
print 'ok';
}
}
}
public function logOut(){
$this->cm->update('users', array("id" => $this->session->userdata('UserId')), array("isLogin" => 0));
$this->session->set_userdata('UserId', '');
$this->session->set_userdata('UserName', '');
$this->session->set_userdata('UserType', '');
$this->session->set_userdata('AccountVerified', '');
$this->session->unset_userdata('UserId');
$this->session->unset_userdata('UserName');
$this->session->unset_userdata('UserType');
$this->session->unset_userdata('AccountVerified');
redirect(base_url());
}
}
| 18,203
|
https://github.com/collegescheduler/react-crane/blob/master/src/select/utils/DefaultProps.js
|
Github Open Source
|
Open Source
|
MIT
| null |
react-crane
|
collegescheduler
|
JavaScript
|
Code
| 214
| 685
|
import Arrow from '../Arrow'
import Clear from '../Clear'
import FocusPlaceholder from '../FocusPlaceholder'
import Input from '../Input'
import Loading from '../Loading'
import Menu from '../Menu'
import Option from '../Option'
import OptionGroup from '../OptionGroup'
import Value from '../Value'
import ValueGroup from '../ValueGroup'
import filterOptions from './filterOptions'
import getLabel from './getLabel'
import getOptionLabel from './getOptionLabel'
import getSelectValue from './getSelectValue'
export const simpleSelectDefaults = {
arrowComponent: Arrow,
arrowRenderer: null,
autoCloseMenu: true,
className: null,
clearComponent: Clear,
clearInputOnBlur: true,
clearInputOnSelect: true,
clearRenderer: null,
clearable: false,
disabled: false,
focusPlaceholderComponent: FocusPlaceholder,
getLabel,
getOptionLabel,
getSelectValue,
groupByKey: null,
groupTitleKey: null,
groupValueKey: null,
groups: [],
inputComponent: Input,
inputValue: '',
isLoading: false,
isMulti: false,
isOpen: false,
isSearchable: false,
labelKey: 'label',
loadingComponent: Loading,
loadingRenderer: null,
loadingText: 'Loading...',
menuComponent: Menu,
name: null,
noResultsText: 'No Results Found',
onBlur: null,
onChange: null,
onClose: null,
onFocus: null,
onInputChange: null,
onKeyDown: null,
onOpen: null,
onSelect: null,
openOnClick: true,
openOnEmptyInput: true,
optionComponent: Option,
optionDisabledKey: 'isDisabled',
optionGroupComponent: OptionGroup,
optionGroupRenderer: null,
optionRenderer: null,
options: [],
placeholder: 'Select value...',
showInput: false,
value: null,
valueComponent: Value,
valueGroupComponent: ValueGroup,
valueGroupRenderer: null,
valueKey: 'value',
valueRenderer: null
}
export const multiSelectDefaults = {
...simpleSelectDefaults,
autoCloseMenu: false,
allOption: {
value: 'Select All',
id: '*'
},
allowSelectAll: false,
allSelectedText: 'All Selected',
hideCheckboxes: false,
showValuesWhileFocused: false,
sort: true,
value: [],
valueLabelLimit: 3
}
export const filterSelectDefaults = {
...simpleSelectDefaults,
ignoreCase: true,
filterOptions
}
| 1,052
|
https://github.com/GCCFeli/LuaFormat/blob/master/LuaFormat/Grammar/Ast/LuaFieldNode.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
LuaFormat
|
GCCFeli
|
C#
|
Code
| 99
| 333
|
using Irony.Ast;
using Irony.Interpreter;
using Irony.Parsing;
using Lua.LanguageService.Format;
using System.Collections.Generic;
namespace Lua.LanguageService.Grammar.Ast
{
class LuaFieldNode : AstNode, IAstNode
{
public ParseTreeNode Node
{
get;
private set;
}
public AstNode Target;
public AstNode Expression;
public NodeType NodeType
{
get
{
return NodeType.LuaField;
}
}
public override void Init(ParsingContext context, ParseTreeNode treeNode)
{
base.Init(context, treeNode);
Node = treeNode;
if (treeNode.ChildNodes.Count > 1)
{
Target = AddChild("key", treeNode.ChildNodes[0]);
Expression = AddChild("value", treeNode.ChildNodes[2]);
AsString = "key/value field";
return;
}
Expression = AddChild("entry", treeNode.ChildNodes[0]);
AsString = "list field";
}
public void Indent(LuaIndentState indentState, Dictionary<SourceLocation, LuaTokenInfo> tokenMap)
{
// no indent needed
}
}
}
| 36,651
|
https://github.com/VsevolodKurochka/proportion/blob/master/static/src/sass/components/_variant.sass
|
Github Open Source
|
Open Source
|
MIT
| null |
proportion
|
VsevolodKurochka
|
Sass
|
Code
| 98
| 466
|
.variant
color: $color-black
margin-bottom: 30px
&__content
background-color: $color-white
border-radius: 4px
padding: 15px
margin-bottom: 15px
+min($sm)
padding: 30px
height: unquote("calc(100% - 150px)")
&__header
font-size: 20px
line-height: 1.1
font-family: $bold
text-align: center
color: $color-brand-2
margin-bottom: 30px
+min($md)
font-size: 24px
&__body
text-align: center
font-size: 14px
+min($md)
font-size: 17px
ul
list-style: none
li
padding-bottom: 15px
border-bottom: 2px solid #eff2fa
&:not(:last-child)
margin-bottom: 15px
&__footer
background-color: $color-white
border-radius: 4px
padding: 15px
&__prices
li
display: -webkit-flex
display: -moz-flex
display: -ms-flex
display: -o-flex
display: flex
flex-flow: row wrap
justify-content: space-between
align-items: center
&-time
+max($sm)
font-size: 13px
&-price
color: $color-brand-1
font-family: $bold
font-size: 18px
sup
font-size: 75%
| 16,957
|
https://github.com/Huawei/CloudEC_Client_API_Demo_Android/blob/master/sample/EC_SDK_Demo/Demo_Service/ContactService/src/main/java/com/huawei/opensdk/contactservice/eaddr/EntAddressBookInfo.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
CloudEC_Client_API_Demo_Android
|
Huawei
|
Java
|
Code
| 401
| 1,174
|
package com.huawei.opensdk.contactservice.eaddr;
import java.io.Serializable;
/**
* This class is about contact Information class.
* 企业通讯录联系人信息类
*/
public class EntAddressBookInfo implements Serializable {
/**
* User's account
* 联系人账号
*/
private String eaddrAccount;
/**
* User's name
* 联系人账号
*/
private String eaddrName;
/**
* User's terminal
* 用户的终端号码
*/
private String terminal;
/**
* User's department
* 用户所在的部门
*/
private String eaddrDept;
/**
* User's gender
* 用户的性别
*/
private String gender;
/**
* User's signature
* 用户的签名
*/
private String signature;
/**
* User's title
* 用户的职务
*/
private String title;
/**
* User's mobile
* 用户的手机号码
*/
private String mobile;
/**
* User's email
* 用户的邮箱
*/
private String email;
/**
* User's address
* 用户的地址
*/
private String address;
/**
* User's zip code
* 用户的邮编
*/
private String zipCode;
/**
* User's custom avatar path
* 用户的自定义头像路径
*/
private String headIconPath = "";
/**
* User's system Avatar ID
* 用户的系统头像id
*/
private int sysIconID = 0;
/**
* User's user id
* 用户的id
*/
private long userId;
public EntAddressBookInfo() {
}
public String getEaddrAccount() {
return eaddrAccount;
}
public void setEaddrAccount(String eaddrAccount) {
this.eaddrAccount = eaddrAccount;
}
public String getEaddrName() {
return eaddrName;
}
public void setEaddrName(String eaddrName) {
this.eaddrName = eaddrName;
}
public String getTerminal() {
return terminal;
}
public void setTerminal(String terminal) {
this.terminal = terminal;
}
public String getEaddrDept() {
return eaddrDept;
}
public void setEaddrDept(String eaddrDept) {
this.eaddrDept = eaddrDept;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getZipCode() {
return zipCode;
}
public void setZipCode(String zipCode) {
this.zipCode = zipCode;
}
public String getHeadIconPath() {
return headIconPath;
}
public void setHeadIconPath(String headIconPath) {
this.headIconPath = headIconPath;
}
public int getSysIconID() {
return sysIconID;
}
public void setSysIconID(int sysIconID) {
this.sysIconID = sysIconID;
}
public long getUserId() {
return userId;
}
public void setUserId(long userId) {
this.userId = userId;
}
}
| 27,943
|
https://github.com/edgarinvillegas/eslint-plugin-capture/blob/master/src/index.ts
|
Github Open Source
|
Open Source
|
MIT
| null |
eslint-plugin-capture
|
edgarinvillegas
|
TypeScript
|
Code
| 13
| 44
|
import explicitClosures from "./rules/explicit-closures";
export = {
rules: {
"explicit-closures": explicitClosures,
},
};
| 756
|
https://github.com/AntoniCasasM/BasicNLP/blob/master/src/main/java/com/basicNLP/stemmers/NullStem.java
|
Github Open Source
|
Open Source
|
MIT
| null |
BasicNLP
|
AntoniCasasM
|
Java
|
Code
| 19
| 64
|
package com.basicNLP.stemmers;
import com.basicNLP.stemmers.Stemmer;
class NullStem implements Stemmer {
@Override
public String stem(String s) {
return s;
}
}
| 32,434
|
https://github.com/dkharrat/NexusDialog/blob/master/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FormActivity.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
NexusDialog
|
dkharrat
|
Java
|
Code
| 224
| 629
|
package com.github.dkharrat.nexusdialog;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.ViewGroup;
import android.view.WindowManager;
/**
* <code>FormActivity</code> is provides a default Activity implementation for using NexusDialog. It provides simple APIs to quickly
* create and manage form fields. It also handles retaining the <code>FormModel</code> when the Activity is recreated. If you'd like the
* Activity to be based on <code>AppCompatActivity</code>, you can use {@link FormWithAppCompatActivity}
*/
public abstract class FormActivity extends FragmentActivity {
private FormModelFragment formModelFragment;
private FormController formController;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.form_activity);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE
| WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
this.formModelFragment = FragmentActivityHelper.getFormModelFragment(this);
this.formController = new FormController(this, formModelFragment.getModel());
initForm(formController);
recreateViews();
}
/**
* An abstract method that must be overridden by subclasses where the form fields are initialized.
*/
abstract public void initForm(FormController controller);
/**
* Returns the associated <code>FormController</code> that manages the form fields.
*/
public FormController getFormController() {
return formController;
}
/**
* Returns the associated model of this form.
*/
public FormModel getModel() {
return formModelFragment.getModel();
}
/**
* Sets the model to use for this form
*
* @param formModel the model to use
*/
public void setModel(FormModel formModel) {
this.formModelFragment.setModel(formModel);
formController.setModel(formModel);
}
/**
* Recreates the views for all the elements that are in the form. This method needs to be called when field are dynamically added or
* removed
*/
protected void recreateViews() {
ViewGroup containerView = (ViewGroup) this.findViewById(R.id.form_elements_container);
formController.recreateViews(containerView);
}
}
| 17,081
|
https://github.com/yankee14/reflow-oven-atmega328p/blob/master/waf/playground/pytest/src/foo/foo.py
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
reflow-oven-atmega328p
|
yankee14
|
Python
|
Code
| 35
| 79
|
#! /usr/bin/env python
# encoding: utf-8
# Calle Rosenquist, 2016 (xbreak)
import os
# Import the foo extension shared object
from foo import foo_ext
def sum(a, b):
return a + b
def ping():
return foo_ext.ping()
| 48,165
|
https://github.com/erikzhouxin/CSharpSolution/blob/master/NetSiteUtilities/AopApi/Response/AlipayEcoMycarDataserviceViolationinfoShareResponse.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
CSharpSolution
|
erikzhouxin
|
C#
|
Code
| 77
| 270
|
using System;
using System.Xml.Serialization;
namespace EZOper.NetSiteUtilities.AopApi
{
/// <summary>
/// AlipayEcoMycarDataserviceViolationinfoShareResponse.
/// </summary>
public class AlipayEcoMycarDataserviceViolationinfoShareResponse : AopResponse
{
/// <summary>
/// 车架号
/// </summary>
[XmlElement("body_num")]
public string BodyNum { get; set; }
/// <summary>
/// 发动机号
/// </summary>
[XmlElement("engine_num")]
public string EngineNum { get; set; }
/// <summary>
/// 车辆id
/// </summary>
[XmlElement("vehicle_id")]
public string VehicleId { get; set; }
/// <summary>
/// 车牌
/// </summary>
[XmlElement("vi_number")]
public string ViNumber { get; set; }
}
}
| 7,240
|
https://github.com/lamoichenzio/apollo-rest/blob/master/app/Http/Middleware/SurveyQuestionMiddleware.php
|
Github Open Source
|
Open Source
|
MIT
| null |
apollo-rest
|
lamoichenzio
|
PHP
|
Code
| 63
| 209
|
<?php
namespace App\Http\Middleware;
use Closure;
class SurveyQuestionMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle(\Illuminate\Http\Request $request, Closure $next)
{
$survey = $request->route('survey');
$questionGroup = $request->route('question_group');
if ($survey && $questionGroup && $survey->id != $questionGroup->survey_id) {
return response()->json(['error' => 'Question Group not in Survey'],
\Illuminate\Http\Response::HTTP_UNPROCESSABLE_ENTITY);
}
return $next($request);
}
}
| 14,551
|
https://github.com/vocho/vbs/blob/master/7z e.vbs
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
vbs
|
vocho
|
Visual Basic
|
Code
| 71
| 260
|
Set objFSO = CreateObject("Scripting.FileSystemObject")
Call ArgProc
Set objFSO = Nothing
Function ArgProc
For Each strArg In WScript.Arguments
If objFSO.FolderExists(strArg) Then
Call FolderProc(objFSO.GetFolder(strArg))
ElseIf objFSO.FileExists(strArg) Then
Call FileProc(objFSO.GetFile(strArg))
End If
Next
End Function
Function FolderProc(objFolder)
For Each objFile In objFolder.Files
Call FileProc(objFile)
Next
For Each objSubFolder In objFolder.SubFolders
Call FolderProc(objSubFolder)
Next
End Function
Function FileProc(objFile)
With CreateObject("WScript.Shell")
.CurrentDirectory = objFile.ParentFolder.Path
.Exec("C:\Program Files\7-Zip\7z.exe e """ & objFile.Path & """").StdOut.ReadAll
End With
End Function
| 34
|
https://github.com/cjunxiang/main/blob/master/src/test/java/seedu/divelog/model/ModelManagerTest.java
|
Github Open Source
|
Open Source
|
MIT
| null |
main
|
cjunxiang
|
Java
|
Code
| 164
| 723
|
package seedu.divelog.model;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static seedu.divelog.model.Model.PREDICATE_SHOW_ALL_DIVES;
import static seedu.divelog.testutil.TypicalDiveSessions.DIVE_AT_BALI;
import static seedu.divelog.testutil.TypicalDiveSessions.DIVE_AT_NIGHT;
import java.nio.file.Paths;
import java.util.Arrays;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import seedu.divelog.model.dive.LocationContainsKeywordPredicate;
import seedu.divelog.testutil.DiveLogBuilder;
public class ModelManagerTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
private ModelManager modelManager = new ModelManager();
@Test
public void getFilteredPersonList_modifyList_throwsUnsupportedOperationException() {
thrown.expect(UnsupportedOperationException.class);
modelManager.getFilteredDiveList().remove(0);
}
@Test
public void equals() {
DiveLog diveLog = new DiveLogBuilder().withDive(DIVE_AT_BALI).withDive(DIVE_AT_NIGHT).build();
DiveLog differentDiveLog = new DiveLog();
UserPrefs userPrefs = new UserPrefs();
// same values -> returns true
modelManager = new ModelManager(diveLog, userPrefs);
ModelManager modelManagerCopy = new ModelManager(diveLog, userPrefs);
assertTrue(modelManager.equals(modelManagerCopy));
// same object -> returns true
assertTrue(modelManager.equals(modelManager));
// null -> returns false
assertFalse(modelManager.equals(null));
// different types -> returns false
assertFalse(modelManager.equals(5));
// different diveLog -> returns false
assertFalse(modelManager.equals(new ModelManager(differentDiveLog, userPrefs)));
// different filteredList -> returns false
String[] keywords = {"Bali"};
modelManager.updateFilteredDiveList(new LocationContainsKeywordPredicate(Arrays.asList(keywords)));
assertFalse(modelManager.equals(new ModelManager(diveLog, userPrefs)));
// resets modelManager to initial state for upcoming tests
modelManager.updateFilteredDiveList(PREDICATE_SHOW_ALL_DIVES);
// different userPrefs -> returns true
UserPrefs differentUserPrefs = new UserPrefs();
differentUserPrefs.setDiveLogBookFilePath(Paths.get("differentFilePath"));
assertTrue(modelManager.equals(new ModelManager(diveLog, differentUserPrefs)));
}
}
| 35,046
|
https://github.com/sai25640/xlhb-VRProject-Career/blob/master/CareerVR/Assets/Resources.meta
|
Github Open Source
|
Open Source
|
MIT
| 2,017
|
xlhb-VRProject-Career
|
sai25640
|
Unity3D Asset
|
Code
| 14
| 72
|
fileFormatVersion: 2
guid: c767ad2b26c80a9468e91fa1e6664d90
folderAsset: yes
timeCreated: 1505275535
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
| 35,358
|
https://github.com/rasheedja/aston-animal-sanctuary/blob/master/staff_home.php
|
Github Open Source
|
Open Source
|
MIT
| null |
aston-animal-sanctuary
|
rasheedja
|
PHP
|
Code
| 323
| 1,104
|
<?php
session_start();
if (isset($_SESSION['name'])) {
// store the username in a variable
$username = $_SESSION['name'];
// connect to the database
$db = new PDO("mysql:dbname=rasheeja_db;host=localhost", "root", "***REMOVED***");
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// store user information in a variable
try {
$query = "SELECT * FROM users WHERE username = '$username'";
$result = $db->query($query);
$user = $result->fetch();
$user_id = $user['id'];
} catch (PDOException $e) {
echo "<p class='error'> Database Error Occurred: . $e->getMessage()</p>";
}
// redirect non staff users to standard home page
if ($user['staff'] == 0) {
header("Location: home.php");
}
include_once('display_animal.php');
} else {
header("Location: index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Aston Animal Sanctuary</title>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body>
<div id="main">
<div id = "nav-bar">
<ul id="nav">
<li>
<a href="staff_home.php">Home</a>
</li>
<li>
<a href="staff_animals.php">Animals</a>
</li>
<li>
<a href="staff_requests.php">Adoption Requests</a>
</li>
<li id="search">
<form action="search.php" method="get">
<input type="search" name="search_bar" id="search_bar">
</form>
</li>
<li id="greeting">
<a href="#">Hello, <?php echo $username; ?></a>
</li>
<li id="logout">
<a href="logout.php">Logout</a>
</li>
</ul>
</div>
<div id="inner-center">
<div class="animals">
<h3>Your Animals</h3>
<?php
// display the information on the animals owned by the user
try {
$query = "SELECT * FROM owns WHERE user_id = $user_id";
$result = $db->query($query);
} catch (PDOException $e) {
echo "<p class='error'> Database Error Occurred: . $e->getMessage()</p>";
}
$has_animal = false;
while ($animal = $result->fetch()) {
print_animal_info($animal, $db, false);
$has_animal = true;
}
if (!$has_animal) {
echo "<p class=error>You have no animals</p>";
}
?>
</div>
<div class="animals">
<h3>Adoption Requests</h3>
<?php
// display all pending adoption requests
try {
$query = "SELECT * FROM adoption_request WHERE approved=0";
$result = $db->query($query);
} catch (PDOException $e) {
echo "<p class='error'> Database Error Occurred: . $e->getMessage()</p>";
}
$has_adoption_request = false;
while ($animal = $result->fetch()) {
$adoption_id = $animal['adoption_id'];
$adopter = $animal['user_id'];
print_animal_info($animal, $db, "Approve", "Deny", "handle_request.php", "get", $adoption_id, $adopter);
$has_adoption_request = true;
}
if (!$has_adoption_request) {
echo "<p class=error>There are no adoption requests at the moment</p>";
}
?>
</div>
</div>
</div>
</body>
</html>
| 34,313
|
https://github.com/LeapBeyond/wasabi/blob/master/.gitignore
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
wasabi
|
LeapBeyond
|
Ignore List
|
Code
| 19
| 80
|
# Local .terraform directories
**/.terraform/*
**/env.rc
**/terraform.tfvars
**/*.zip
data
notes
# .tfstate files
**/*.tfstate
**/*.tfstate.*
.DS_Store
**/*.pem
**/*key
**/.idea/*
| 13,374
|
https://github.com/AndXD/JS-Sandbox/blob/master/src/SandboxException.js
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
JS-Sandbox
|
AndXD
|
JavaScript
|
Code
| 10
| 29
|
export default class SandboxException{
constructor(message){
this.message = message;
}
}
| 25,372
|
https://github.com/pavelmaksimov/python-data-transformer/blob/master/datagun/datagun.py
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
python-data-transformer
|
pavelmaksimov
|
Python
|
Code
| 3,192
| 10,298
|
# -*- coding: utf-8 -*-
import ast
import datetime as dt
import logging
import re
import sys
from collections.abc import Iterable
import pytz
from dateutil import parser as dt_parser
logging.basicConfig(level=logging.INFO)
ONLY_SERIES_ERROR = "Only Accepts Series"
NULL_VALUES = {None, "", "NULL", "none", "None", "null"}
class dtype_default_value:
def __repr__(self):
return "dtype_default_value"
def __str__(self):
return "dtype_default_value"
def deserialize_list(text):
"""Вытащит массив из строки"""
def _to_list(x):
x = re.sub(r"^\[", "", x)
x = re.sub(r"\]$", "", x)
x = x.replace("\\'", "'")
# This lexer takes a JSON-like 'array' string and converts single-quoted array items into escaped double-quoted items,
# then puts the 'array' into a python list
# Issues such as ["item 1", '","item 2 including those double quotes":"', "item 3"] are resolved with this lexer
items = [] # List of lexed items
item = "" # Current item container
dq = True # Double-quotes active (False->single quotes active)
bs = 0 # backslash counter
in_item = (
False
) # True if currently lexing an item within the quotes (False if outside the quotes; ie comma and whitespace)
for i, c in enumerate(x): # Assuming encasement by brackets
if c == "\\":
# if there are backslashes, count them! Odd numbers escape the quotes...
bs += 1
continue
if ((dq and c == '"') or (not dq and c == "'")) and (
not in_item or i + 1 == len(x) or x[i + 1] == ","
): # quote matched at start/end of an item
if (
bs & 1 == 1
): # if escaped quote, ignore as it must be part of the item
continue
else: # not escaped quote - toggle in_item
in_item = not in_item
if item != "": # if item not empty, we must be at the end
items += [item] # so add it to the list of items
item = "" # and reset for the next item
else:
if not in_item:
items.append("")
continue
if not in_item: # toggle of single/double quotes to enclose items
if dq and c == "'":
dq = False
in_item = True
elif not dq and c == '"':
dq = True
in_item = True
continue
if in_item: # character is part of an item, append it to the item
if not dq and c == '"': # if we are using single quotes
item += bs * "\\" + '"' # escape double quotes for JSON
else:
item += bs * "\\" + c
bs = 0
continue
return items
def _to_json(x):
try:
return ast.literal_eval(x)
except SyntaxError:
return _to_list(x)
return _to_json(text)
def read_text(
text,
sep="\t",
schema=None,
newline="\n",
skip_blank_lines=True,
skip_begin_lines=0,
skip_end_lines=0,
):
data = [i.split(sep) for i in text.split(newline)]
data = data[skip_begin_lines : -1 - skip_end_lines]
if skip_blank_lines:
data = [i for i in data if i]
return DataSet(data=data, schema=schema, orient="values")
class Gun:
# TODO: remove dtype_default_value
def __init__(
self,
func,
errors,
allow_null=False,
null_value=None,
default_value=dtype_default_value,
null_values=None,
clear_values=None,
**kwargs
):
self.default_value = default_value
self.allow_null = allow_null
self.null_value = null_value
self.errors = errors
self.error_values = {}
self.func = func
self._call_number = 0
self.null_values = null_values or NULL_VALUES
self.clear_values = clear_values or {}
def _process_error(self, value, except_):
if self.errors == "default":
if self.default_value == dtype_default_value:
raise Exception(
"When parameter errors = 'default', parameter default_value is required"
)
return self.default_value
elif self.errors == "raise":
raise except_
elif self.errors == "ignore":
return value
elif self.errors == "coerce":
return None
def shot(self, func, obj, *args, **kwargs):
if not isinstance(obj, Iterable) and obj in self.clear_values:
if self.default_value != dtype_default_value:
return self.default_value
else:
obj = self.null_value
if not isinstance(obj, Iterable) and obj in self.null_values:
if self.allow_null:
return self.null_value
else:
if self.default_value != dtype_default_value:
return self.default_value
try:
result = func(obj, *args, **kwargs)
except Exception as e:
self.error_values[self._call_number] = obj
return self._process_error(obj, e)
else:
return result
finally:
self._call_number += 1
def __call__(self, obj, *args, **kwargs):
return self.shot(self.func, obj, *args, **kwargs)
class SeriesMagicMethodMixin:
_schema = None
def data(self):
return []
def __add__(self, obj):
"Сложение."
if isinstance(obj, Series):
data = [val1 + val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value + obj for value in self.data()]
return Series(**self._schema, data=data)
def __sub__(self, obj):
"Вычитание."
if isinstance(obj, Series):
data = [val1 - val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value - obj for value in self.data()]
return Series(**self._schema, data=data)
def __mul__(self, obj):
"Умножение."
if isinstance(obj, Series):
data = [val1 * val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value * obj for value in self.data()]
return Series(**self._schema, data=data)
def __floordiv__(self, obj):
"Целочисленное деление, оператор //."
if isinstance(obj, Series):
data = [val1 // val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value // obj for value in self.data()]
return Series(**self._schema, data=data)
def __truediv__(self, obj):
"Деление, оператор /."
if isinstance(obj, Series):
data = [val1 / val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value / obj for value in self.data()]
return Series(**self._schema, data=data)
def __mod__(self, obj):
"Остаток от деления, оператор %."
if isinstance(obj, Series):
data = [val1 % val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value % obj for value in self.data()]
return Series(**self._schema, data=data)
def __pow__(self, obj):
"Возведение в степень, оператор **."
if isinstance(obj, Series):
data = [val1 ** val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value ** obj for value in self.data()]
return Series(**self._schema, data=data)
def __and__(self, obj):
"Двоичное И, оператор &."
if isinstance(obj, Series):
data = [all([val1, val2]) for val1, val2 in zip(self.data(), obj.data())]
else:
raise ValueError(ONLY_SERIES_ERROR)
return Series(**self._schema, data=data)
def __or__(self, obj):
"Двоичное ИЛИ, оператор |"
if isinstance(obj, Series):
data = [any([val1, val2]) for val1, val2 in zip(self.data(), obj.data())]
else:
raise ValueError(ONLY_SERIES_ERROR)
return Series(**self._schema, data=data)
def __invert__(self):
"Определяет поведение для инвертирования оператором ~."
data = [not value for value in self.data()]
return Series(**self._schema, data=data)
def __eq__(self, obj):
"""Определяет поведение оператора равенства, ==."""
if isinstance(obj, Series):
data = [val1 == val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value == obj for value in self.data()]
return Series(**self._schema, data=data)
def __ne__(self, obj):
"""Определяет поведение оператора неравенства, !=."""
if isinstance(obj, Series):
data = [val1 != val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value != obj for value in self.data()]
return Series(**self._schema, data=data)
def __lt__(self, obj):
"""Определяет поведение оператора меньше, <."""
if isinstance(obj, Series):
data = [val1 < val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value < obj for value in self.data()]
return Series(**self._schema, data=data)
def __gt__(self, obj):
"""Определяет поведение оператора больше, >."""
if isinstance(obj, Series):
data = [val1 > val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value > obj for value in self.data()]
return Series(**self._schema, data=data)
def __le__(self, obj):
"""Определяет поведение оператора меньше или равно, <=."""
if isinstance(obj, Series):
data = [val1 <= val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value <= obj for value in self.data()]
return Series(**self._schema, data=data)
def __ge__(self, obj):
"""Определяет поведение оператора больше, >=."""
if isinstance(obj, Series):
data = [val1 >= val2 for val1, val2 in zip(self.data(), obj.data())]
else:
data = [value >= obj for value in self.data()]
return Series(**self._schema, data=data)
def __reversed__(self):
return Series(**self._schema, data=list(reversed(self.data())))
def __iter__(self):
self._it = (i for i in self.data())
return self
def __next__(self):
return next(self._it)
class Series(SeriesMagicMethodMixin):
def __init__(
self,
data=None,
dtype=None,
errors="default",
allow_null=False,
null_value=None,
null_values=None,
dt_format=None,
timezone=None,
depth=0,
default_value=dtype_default_value,
name=None,
transform_func=None,
filter_func=None,
clear_values=None,
**kwargs
):
"""
:param data: str, list
:param dtype: str
:param default_value: any
:param errors: str, coerce|raise|ignore|default
:param is_array: bool
:param dt_format: None, str, timestamp|{datatime format}
:param depth: int
"""
if dtype not in (
None,
"string",
"array",
"int",
"uint",
"float",
"date",
"datetime",
"timestamp",
):
raise ValueError("{} = неверный dtype".format(dtype))
if errors not in ("coerce", "raise", "ignore", "default"):
raise ValueError("{} = неверный errors".format(errors))
# rename null_value to null_default_value
self.null_value = null_value
self.allow_null = allow_null or (
"nullable" in dtype.lower() if dtype else False
)
self.null_values = null_values or NULL_VALUES.union({null_value})
self.errors = errors
self.depth = depth or (dtype.lower().count("array") if dtype else depth)
self.name = name
self._default_value = default_value
self._dtype = self._parse_dtype(dtype)
self._dt_format = dt_format
self._timezone = timezone
self._data = data
self._clear_values = clear_values
self.error_values = kwargs.pop("error_values", {}) # TODO: wrap property
if transform_func is None:
self._transform_func = None
elif isinstance(transform_func, list):
self._transform_func = [
eval(f) if isinstance(f, str) else f for f in transform_func
]
elif isinstance(transform_func, str):
self._transform_func = [eval(transform_func)]
else:
self._transform_func = [transform_func]
if filter_func is None:
self._filter_func = None
elif isinstance(filter_func, list):
self._filter_func = [
eval(f) if isinstance(f, str) else f for f in filter_func
]
elif isinstance(filter_func, str):
self._filter_func = [eval(filter_func)]
else:
self._filter_func = [filter_func]
self._deserialize(data)
@staticmethod
def _parse_dtype(dtype):
if dtype and "(" in dtype:
index_open = "".join(reversed(dtype)).find("(")
index_close = dtype.find(")")
return dtype[-index_open:index_close]
else:
return dtype
@property
def _schema(self):
return {
"errors": self.errors,
"depth": self.depth,
"allow_null": self.allow_null,
"null_value": self.null_value,
"null_values": self.null_values,
"name": self.name,
}
def get_schema(self, **kwargs):
return {**self._schema, **kwargs}
def _deserialize(self, data):
if data is None:
return
elif isinstance(data, Series):
self._data = data.data()
self.error_values = data.error_values
return
elif not isinstance(data, list):
raise TypeError("Data parameter must be an list")
elif not data:
self._data = []
return
if self._dtype is not None:
method = getattr(Series, "to_{}".format(self._dtype))
if self._default_value == dtype_default_value:
series = method(self, errors=self.errors, depth=self.depth)
else:
series = method(
self,
errors=self.errors,
depth=self.depth,
default_value=self._default_value,
)
self._data = series.data()
self.error_values = series.error_values
else:
self._data = data
if self._clear_values:
self._data = self.replace_values(
self._clear_values, self.null_value
).data()
if self._transform_func is not None:
for func in self._transform_func:
self._data = self.applymap(func).data()
if self._filter_func is not None:
for func in self._transform_func:
self._data = self.filter(self.applymap(func)).data()
def applymap(
self, func, errors=None, default_value=dtype_default_value, depth=None
):
if depth is None:
depth = self.depth
if errors is None:
errors = self.errors
if default_value == dtype_default_value:
default_value = self._default_value
# TODO: Move logic to DataGun.
if depth == 0:
func_with_wrap = Gun(
**self.get_schema(
func=func,
errors=errors,
default_value=default_value,
clear_values=self._clear_values,
)
)
data = list(map(func_with_wrap, self._data[:]))
error_values = {**func_with_wrap.error_values, **self.error_values}
else:
error_values = {}
data = self._data[:]
for i, array in enumerate(self):
if not isinstance(array, list):
array = deserialize_list(array)
try:
series = Series(
**self.get_schema(
data=array,
dtype=None,
default_value=default_value,
errors=errors,
depth=depth - 1,
error_values=self.error_values,
clear_values=self._clear_values,
)
)
series = series.applymap(func)
except TypeError as ex:
if ex.args == ("Data parameter must be an list",):
raise TypeError("Arrays of different nesting levels")
raise
data[i] = series.data()
if series.error_values:
error_values[i] = array
return Series(
**self.get_schema(
data=data, depth=depth, errors=errors, error_values=error_values
)
)
def apply(self, func, errors=None, default_value=None):
return self.applymap(
func=func, errors=errors, default_value=default_value, depth=0
)
def to_string(self, errors=None, default_value="", **kwargs):
to_str_func = lambda obj: str(obj)
return self.applymap(
func=to_str_func, errors=errors, default_value=default_value, **kwargs
)
def to_int(self, errors=None, default_value=0, **kwargs):
to_int_func = lambda obj: int(obj)
return self.applymap(
func=to_int_func, errors=errors, default_value=default_value, **kwargs
)
def to_uint(self, errors=None, default_value=0, **kwargs):
def to_uint_func(obj):
x = int(obj)
if x < 0:
raise ValueError("Число {} меньше 0".format(x))
return x
return self.applymap(
func=to_uint_func, errors=errors, default_value=default_value, **kwargs
)
def to_float(self, errors=None, default_value=0.0, **kwargs):
to_float_func = lambda obj: float(obj)
return self.applymap(
func=to_float_func, errors=errors, default_value=default_value, **kwargs
)
def to_array(self, errors=None, default_value=list, **kwargs):
default_value = [] if default_value == list else default_value
def func(obj):
if not isinstance(obj, list):
return deserialize_list(obj)
else:
return obj
return self.applymap(
func=func, errors=errors, default_value=default_value, **kwargs
)
def to_datetime(
self,
dt_format=None,
timezone=None,
errors=None,
default_value=dt.datetime,
**kwargs
):
"""
:param dt_format: str, None
- "timestamp" = converts a number or number in a string to a date and time
- format = format for datetime.strptime function
- None = parse
:param errors: str, None
:param default_value: dt.datetime
:param kwargs:
:return: Series
"""
self._dt_format = dt_format or self._dt_format
self._timezone = timezone or self._timezone
if default_value == dt.datetime:
default_value = dt.datetime(1970, 1, 1, 0, 0, 0)
def to_datetime_func(obj):
if isinstance(obj, dt.datetime):
datetime = obj
elif isinstance(obj, dt.date):
datetime = dt.datetime.combine(obj, dt.datetime.min.time())
elif isinstance(obj, (int, float)):
datetime = dt.datetime.fromtimestamp(obj)
else:
if dt_format == "timestamp":
x = int(obj)
datetime = dt.datetime.fromtimestamp(x)
elif dt_format:
datetime = dt.datetime.strptime(obj, dt_format)
else:
datetime = dt_parser.parse(obj)
if self._timezone:
if not isinstance(self._timezone, pytz.tzinfo.BaseTzInfo):
self._timezone = pytz.timezone(self._timezone)
datetime = datetime.replace(tzinfo=self._timezone)
return datetime
return self.applymap(
func=to_datetime_func, errors=errors, default_value=default_value, **kwargs
)
def to_date(
self,
dt_format=None,
timezone=None,
errors=None,
default_value=dt.date,
**kwargs
):
if default_value == dt.datetime:
default_value = dt.datetime(1970, 1, 1)
series = self.to_datetime(dt_format=dt_format, timezone=timezone, errors=errors)
func = lambda dt_: dt_.date()
return series.applymap(
func=func, errors=errors, default_value=default_value, **kwargs
)
def to_timestamp(
self, dt_format=None, timezone=None, errors=None, default_value=0, **kwargs
):
"""Can only converted from datetime."""
series = self.to_datetime(dt_format=dt_format, timezone=timezone, errors=errors)
to_timestamp_func = lambda dt_: dt_.timestamp()
return series.applymap(
func=to_timestamp_func, errors=errors, default_value=default_value, **kwargs
)
def replace_str(self, old, new, count=None, **kwargs):
replace_func = lambda obj: str(obj).replace(old, new, count)
return self.applymap(func=replace_func, **kwargs)
def replace_values(self, old_values, new_value, **kwargs):
replace_func = lambda obj: new_value if obj in old_values else obj
return self.applymap(func=replace_func, **kwargs)
def has(self, value, **kwargs):
has_func = lambda obj: value in obj
return self.applymap(func=has_func, **kwargs)
def isin(self, value, **kwargs):
has_func = lambda obj: obj in value
return self.applymap(func=has_func, **kwargs)
def filter(self, series):
return Series(
**series.get_schema(
data=[i for i, f in zip(self.data(), series.data()) if f],
error_values=series.error_values,
)
)
def error_count(self):
return len(self.error_values)
def null_count(self):
return len(self.filter(self == None))
@property
def size(self):
return sys.getsizeof(self.data())
def append(self, series_):
if isinstance(series_, Series):
data = self._data + series_._data
error_values = {**self.error_values}
last_index = len(self)
for index in series_.error_values:
new_index = last_index + index
error_values[new_index] = series_.error_values[index]
return Series(**self.get_schema(data=data, error_values=error_values))
else:
raise TypeError(ONLY_SERIES_ERROR)
def data(self):
return self._data
def get_uniq_values(self):
return sorted(list(set(self._data)))
def clone(self, **kwargs):
return Series(data=self.data()[:], **self.get_schema(**kwargs))
def __len__(self):
return len(self._data)
def __getitem__(self, key):
data = self._data[key]
if isinstance(key, slice):
return Series(**self.get_schema(data=data, error_values=self.error_values))
else:
return data
def __setitem__(self, key, value):
self._data[key] = value
def __delitem__(self, key):
del self._data[key]
def __str__(self):
return str(self.data())
def __repr__(self):
if len(self) > 20:
return str(self.data()[:10] + ["..."] + self.data()[-10:])
return str(self.data())
def _repr_html_(self):
"""
Return a html representation for a particular DataSet.
Mainly for IPython notebook.
"""
return self.__repr__()
def __iter__(self):
self._it = (value for value in self._data)
return self
def __next__(self):
return next(self._it)
def __call__(self):
return self.data()
class DataSet:
def __init__(self, data=None, schema=None, orient="values", **kwargs):
self.error_rows = []
if data is None and schema:
data = [[] for i in range(len(schema))]
elif data is None:
data = []
elif orient == "series":
pass
elif not isinstance(data, (list, set)):
raise TypeError("Data parameter must be an list")
if schema:
self._schema = schema
else:
self._schema = []
if data:
if orient == "columns":
self._schema = [{} for i in range(len(data))]
elif orient == "values":
self._schema = [{} for i in range(len(data[0]))]
# Set params in all series schema.
series_params = {
"errors",
"depth",
"allow_null",
"null_value",
"null_values",
"clear_values",
"timezone",
}
default_series_params = set(kwargs.keys()).intersection(series_params)
for s in self._schema:
for param in default_series_params:
s[param] = s.pop(param, kwargs[param])
self._series = []
self._deserialize(data, orient)
@property
def schema(self):
return [series.get_schema() for series in self]
@property
def columns(self):
return [series.name for series in self]
def _get_error_index_rows(self):
"""Returns a list of indices of strings that had conversion errors."""
index_error_rows = set()
for series in self:
index_error_rows.update(set(series.error_values.keys()))
return sorted(list(index_error_rows))
def _dict_orient_data_to_columns(self, data):
if self._schema:
try:
column_names = [i["name"] for i in self._schema]
except KeyError:
raise KeyError(
"If the data is in the dict and there is a schema, "
"then the schema must contain the column names."
)
data_orient_column = [[] for i in range(len(column_names))]
for row in data:
for col_index, col_name in enumerate(column_names):
data_orient_column[col_index].append(row.get(col_name, None))
else:
data_orient_column = []
column_names = []
for row_index, row in enumerate(data):
for col_name, col_value in row.items():
# The appearance of a new column.
if col_name not in column_names:
# Adding a new column name.
column_names.append(col_name)
# Adding blank data to previous lines.
data_orient_column.append(
[None for i in range(row_index)] or []
)
col_index = column_names.index(col_name)
data_orient_column[col_index].append(col_value)
# Adding empty values to columns that are missing in a row.
for col_index, col_name in enumerate(column_names):
if col_name not in row.keys():
data_orient_column[col_index].append(None)
# TODO: Take out from this function.
self._schema = [{"name": col_name} for col_name in column_names]
return data_orient_column
def _rows_orient_data_to_columns(self, data):
count_columns = len(self._schema)
data_orient_column = [[] for i in range(count_columns)]
for row in data:
if len(row) != count_columns:
# Dropping a row where the number of columns is different.
self.error_rows.append(row)
else:
for col_index, value in enumerate(row):
data_orient_column[col_index].append(value)
return data_orient_column
def _deserialize(self, data, orient):
if orient == "series":
for i, series in enumerate(data):
series.name = series.name or str(i)
self._series.append(series)
return
# TODO: What if you don't put the data into columns? even limiting functionality?
elif data and orient == "values":
data = self._rows_orient_data_to_columns(data)
elif data and orient == "dict":
data = self._dict_orient_data_to_columns(data)
col_index_list = range(len(self._schema))
for col_index, values, series_schema in zip(col_index_list, data, self._schema):
series_schema["name"] = str(series_schema.get("name", col_index))
series_schema["dtype"] = series_schema.get("dtype", None)
if orient == "dict" and "null_values" in series_schema:
series_schema["null_values"] = (None, *set(series_schema["null_values"]))
self.add_or_update_series(Series(values, **series_schema))
self.print_stats(print_zero=False)
def rename_columns(self, new_columns):
"""
Renaming columns.
:param new_columns: dict : {..., "old_name": "new_name"}
:return: None
"""
for series in self:
if series.name in new_columns.keys():
series.name = new_columns[series.name]
def print_stats(self, print_zero=True):
if print_zero or len(self.error_rows) > 0:
logging.warning(
"Rows were not included because the number of columns in the row is different: {}".format(
len(self.error_rows)
)
)
for series in self:
if len(series.error_values) > 0:
logging.warning(
"Number of values converted to default: {}={}".format(
series.name, len(series.error_values)
)
)
def error_count(self):
return len(self.get_errors())
def get_errors(self):
index_error_rows = self._get_error_index_rows()
data = []
for index_row in index_error_rows:
index_columns = []
row = list(self[index_row : index_row + 1].to_values()[0])
for col_index, col_name in enumerate(self.columns):
error_value = self[col_name].error_values.get(index_row)
if error_value:
index_columns.append(col_index)
# We return the original value.
row[col_index] = error_value
data.append([index_columns, row])
for row in self.error_rows:
data.append([[], row])
return DataSet(
data,
schema=[{"name": "error_column_index"}, {"name": "row_data"}],
orient="values",
)
def T(self):
return DataSet(self.to_list(), orient="values")
def to_list(self):
return [series.data() for series in self]
def to_values(self):
return list(zip(*self.to_list()))
def to_dict(self):
return [dict(zip(self.columns, v)) for v in self.to_values()]
def to_series(self):
return list(self)
def to_dataframe(self, **kwargs):
from pandas import DataFrame
data = {series.name: series.data() for series in self}
return DataFrame(data, **kwargs)
def to_text(self, sep="\t", newline="\n", add_column_names=True, dump_func=str):
func = lambda row: sep.join(map(dump_func, row))
text = newline.join(map(func, self.to_values()))
if add_column_names:
columns = sep.join(self.columns)
return "{}{}{}".format(columns, newline, text)
else:
return text
def filter(self, filter_series):
ds = DataSet()
for series in self:
ds[series.name] = series.filter(filter_series).data()
return ds
def distinct(self):
return DataSet(set(zip(*self.to_list())), schema=self.schema, orient="values")
def append(self, other):
return self + other
@property
def size(self):
return sys.getsizeof(self._series)
@property
def num_rows(self):
return len(self)
@property
def empty(self):
return not bool(self.num_rows)
def add_or_update_series(self, series):
col_name = len(self.columns) if series.name is None else series.name
self[col_name] = series
def add_column(self, data, **kwargs):
if not isinstance(data, list):
raise Exception
elif len(data) != len(self):
raise Exception
self.add_or_update_series(Series(data=data, **kwargs))
def __add__(self, other_DataShot):
if not isinstance(other_DataShot, DataSet):
raise TypeError
if self.columns != other_DataShot.columns:
raise ValueError("Columns do not match")
ds = DataSet()
for series in self._series:
new_series = series.append(other_DataShot[series.name])
ds.add_or_update_series(new_series)
ds.error_rows = self.error_rows + other_DataShot.error_rows
return ds
def __len__(self):
"""Count rows."""
for series in self:
return len(series)
return 0
def __getitem__(self, key):
if isinstance(key, list):
if not set(self.columns).issuperset(set(key)):
raise ValueError()
ds = DataSet()
for col_name in key:
ds.add_or_update_series(self[col_name])
return ds
elif isinstance(key, slice):
ds = DataSet()
for series in self:
ds.add_or_update_series(series[key])
return ds
try:
return self._series[self.columns.index(key)]
except ValueError:
raise ValueError("There is no column with this name")
def __setitem__(self, col_name, data_or_series):
if len(self) == 0 or len(self) == len(data_or_series):
if isinstance(data_or_series, Series):
data_or_series = data_or_series.clone(name=col_name)
else:
data_or_series = Series(data=data_or_series, name=col_name)
if col_name in self.columns:
self._series[self.columns.index(col_name)] = data_or_series
else:
self._series.append(data_or_series)
else:
raise Exception(
"The number of lines does not match. "
"You can add a new column, only of the same length."
)
def __delitem__(self, key):
del self[key]
def iter_rows(self):
for row in zip(*self._series):
yield row
def __iter__(self):
self._it = (series for series in self._series)
return self
def __next__(self):
return next(self._it)
def __str__(self):
return self.to_text()
def __repr__(self):
cols = "\t".join(map(str, self.columns))
numbers = 10
if len(self) > numbers * 2:
return "{}\n{}\n...\n{}".format(
cols, str(self[:numbers]), str(self[-numbers:])
)
else:
if cols:
return "{}\n{}".format(cols, self.to_text())
else:
return "(empty)"
def _repr_html_(self):
"""
Return a html representation for a particular DataSet.
Mainly for IPython notebook.
"""
return self.__repr__()
| 48,714
|
https://github.com/Daio-io/trivapi-client-android/blob/master/trivapiclient/build.gradle
|
Github Open Source
|
Open Source
|
MIT
| 2,015
|
trivapi-client-android
|
Daio-io
|
Gradle
|
Code
| 47
| 212
|
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
testOptions {
unitTests.returnDefaultValues = true
}
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'com.googlecode.json-simple:json-simple:1.1.1'
compile 'com.android.support:appcompat-v7:23.1.0'
}
| 38,276
|
https://github.com/royswale/leetcode/blob/master/src/bin/number-of-1-bits.rs
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
leetcode
|
royswale
|
Rust
|
Code
| 48
| 94
|
fn main() {}
struct Solution;
impl Solution {
pub fn hammingWeight(n: u32) -> i32 {
let mut r = 0;
let mut n = n;
while n > 0 {
if n % 2 == 1 {
r += 1;
}
n /= 2;
}
r
}
}
| 4,601
|
https://github.com/johnvergilbulac93/alturush-admin/blob/master/resources/js/components/menu/Purchasing-Menu.vue
|
Github Open Source
|
Open Source
|
MIT
| null |
alturush-admin
|
johnvergilbulac93
|
Vue
|
Code
| 34
| 145
|
<template>
<Menu theme="light" style="width: 100%;" accordion>
<MenuItem name="1" to="/">
<Icon type="md-speedometer" />
Dashboard
</MenuItem>
<MenuItem name="2" to="/masterfile/store/product_list">
<Icon type="md-basket" />
Product Lists
</MenuItem>
<MenuItem name="3" to="/masterfile/store/export_product">
<Icon type="md-download" />
Export Product
</MenuItem>
</Menu>
</template>
| 47,056
|
https://github.com/networknt/light-bot/blob/master/exec-gitrepo-sync/build.gradle.kts
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
light-bot
|
networknt
|
Kotlin
|
Code
| 13
| 125
|
plugins {
java
}
dependencies {
compile(project(":exec-core"))
compile("org.slf4j:slf4j-api:1.7.25")
compile("com.networknt:config:1.6.5")
compile("com.networknt:service:1.6.5")
testCompile("junit:junit:4.12")
testCompile("ch.qos.logback:logback-classic:1.2.3")
}
| 25,783
|
https://github.com/buckaroo-it/BuckarooSdk_DotNet/blob/master/BuckarooSdk/Base/ResponseHandler.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
BuckarooSdk_DotNet
|
buckaroo-it
|
C#
|
Code
| 72
| 248
|
using System;
using System.Collections.Generic;
using BuckarooSdk.DataTypes.Response;
using BuckarooSdk.Services;
using static BuckarooSdk.Constants.Services;
namespace BuckarooSdk.Base
{
[Obsolete]
public class ResponseHandler
{
public void HandleResponse(RequestResponse transaction)
{
}
public static List<DataTypes.Response.Service> RetrieveServices(RequestResponse transactionResponse)
{
var services = transactionResponse.GetServices();
return new List<DataTypes.Response.Service>();
}
internal static ServiceNames ServiceSwitch(List<ServiceNames> services)
{
var specificService = new ServiceNames();
foreach (var service in services)
{
switch (service)
{
case ServiceNames.Ideal:
specificService = ServiceNames.Ideal;
break;
}
}
return specificService;
}
}
}
| 20,984
|
https://github.com/raincatcher-beta/raincatcher-demo-load-testing/blob/master/util/getCreatedRecord.js
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
raincatcher-demo-load-testing
|
raincatcher-beta
|
JavaScript
|
Code
| 75
| 251
|
'use strict';
const _ = require('lodash');
const Promise = require('bluebird');
function getCreatedRecordSyncLoop(syncRecordsFn, interval, timeout, initialSyncResult, initialClientRecs, compareFn) {
return new Promise(resolve => {
function next(previousResult, clientRecs) {
return syncRecordsFn(clientRecs)
.then(syncRecordsResponse => {
const record = compareFn(previousResult, syncRecordsResponse);
if (record) {
return resolve(record);
} else {
return Promise.delay(interval)
.then(() => next(previousResult, syncRecordsResponse.clientRecs));
}
});
}
return next(initialSyncResult, initialClientRecs);
})
.timeout(timeout);
}
module.exports = function(syncRecordsFn, syncResult, clientRecs, compareFn) {
return getCreatedRecordSyncLoop(syncRecordsFn, 5000, 300000, syncResult, clientRecs, compareFn);
};
| 50,191
|
https://github.com/l3kov9/ReactJsFundamentals/blob/master/ComponentsStatesLifecycle/components-demo/src/components/Header.js
|
Github Open Source
|
Open Source
|
MIT
| null |
ReactJsFundamentals
|
l3kov9
|
JavaScript
|
Code
| 23
| 83
|
import React, {Component} from 'react'
class Header extends Component{
render (){
return(
<div className='header'>
<h1>Menu</h1>
<h2>{this.props.menuItem}</h2>
</div>
)
}
}
export default Header
| 37,579
|
https://github.com/olen-d/mail-body-parser/blob/master/src/index.js
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
mail-body-parser
|
olen-d
|
JavaScript
|
Code
| 145
| 245
|
const generic = require("./generic");
// Currently the generic parser works fine, but in the future specific parsers may be needed for clients that send non-compliant messages.
/**
* Splits out individual parts of messages based on the email client the message was sent from
* @author Olen Daelhousen <mailbodyparser@olen.dev>
* @param {string} boundary - the multi-part boundary delimiter
* @param {string} header - the header of the email message
* @param {string} message - the body of the email message
* @returns {Promise} Promise object returns body parts
*/
const parseBody = async (boundary, header, message) => {
try {
// Use the generic parser
// As noted above, the generic parser currently handles everything, but in the future client-specific code could be inserted here
const result = await generic.parse(boundary, header, message);
return result;
} catch(error) {
return(error);
}
}
module.exports = { parseBody }
| 16,269
|
https://github.com/russiansmack/centrifugo/blob/master/misc/rpm/build.sh
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
centrifugo
|
russiansmack
|
Shell
|
Code
| 61
| 282
|
#!/bin/bash
if [ "$1" = "" ]
then
echo "Usage: $0 <version>"
exit 1
fi
if [ ! -f centrifugo-$1-linux-amd64.zip ]; then
echo "No Centrifugo release found in current directory"
exit 1
fi
cp centrifugo-$1-linux-amd64.zip ~/rpmbuild/SOURCES/centrifugo-$1-linux-amd64.zip
cp centrifugo.spec ~/rpmbuild/SPECS/centrifugo.spec
cp centrifugo.initd ~/rpmbuild/SOURCES/centrifugo.initd
cp centrifugo.nofiles.conf ~/rpmbuild/SOURCES/centrifugo.nofiles.conf
cp centrifugo.logrotate ~/rpmbuild/SOURCES/centrifugo.logrotate
cp centrifugo.config.json ~/rpmbuild/SOURCES/centrifugo.config.json
rpmbuild -bb ~/rpmbuild/SPECS/centrifugo.spec --define "version $1" --define "release `date +%s`"
| 3,066
|
https://github.com/tpriyanshukrishnan/systemscale/blob/master/images/image_processor.py
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
systemscale
|
tpriyanshukrishnan
|
Python
|
Code
| 36
| 103
|
# python3 -m pip install --upgrade pip
# python3 -m pip install --upgrade Pillow
# usage change image_resize & post value
image_resize='chart-preview.png'
post= 'post_img/'+'post2.png'
from PIL import Image
image = Image.open(image_resize)
new_image = image.resize((200, 200))
new_image.save(post)
| 6,198
|
https://github.com/lukeenterprise/aws-sdk-net/blob/master/sdk/test/Services/RoboMaker/UnitTests/Generated/Marshalling/RoboMakerMarshallingTests.cs
|
Github Open Source
|
Open Source
|
MS-PL, LicenseRef-scancode-proprietary-license, MIT, Apache-2.0, LicenseRef-scancode-public-domain, LicenseRef-scancode-unknown-license-reference
| 2,020
|
aws-sdk-net
|
lukeenterprise
|
C#
|
Code
| 2,994
| 14,662
|
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
/*
* Do not modify this file. This file is generated from the robomaker-2018-06-29.normal.json service model.
*/
using System;
using System.Globalization;
using System.IO;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Amazon.RoboMaker;
using Amazon.RoboMaker.Model;
using Amazon.RoboMaker.Model.Internal.MarshallTransformations;
using Amazon.Runtime.Internal.Transform;
using Amazon.Util;
using ServiceClientGenerator;
using AWSSDK_DotNet35.UnitTests.TestTools;
namespace AWSSDK_DotNet35.UnitTests.Marshalling
{
[TestClass]
public partial class RoboMakerMarshallingTests
{
static readonly ServiceModel service_model = Utils.LoadServiceModel("robomaker");
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void BatchDescribeSimulationJobMarshallTest()
{
var operation = service_model.FindOperation("BatchDescribeSimulationJob");
var request = InstantiateClassGenerator.Execute<BatchDescribeSimulationJobRequest>();
var marshaller = new BatchDescribeSimulationJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("BatchDescribeSimulationJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = BatchDescribeSimulationJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as BatchDescribeSimulationJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CancelDeploymentJobMarshallTest()
{
var operation = service_model.FindOperation("CancelDeploymentJob");
var request = InstantiateClassGenerator.Execute<CancelDeploymentJobRequest>();
var marshaller = new CancelDeploymentJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CancelDeploymentJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CancelDeploymentJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CancelDeploymentJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CancelSimulationJobMarshallTest()
{
var operation = service_model.FindOperation("CancelSimulationJob");
var request = InstantiateClassGenerator.Execute<CancelSimulationJobRequest>();
var marshaller = new CancelSimulationJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CancelSimulationJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CancelSimulationJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CancelSimulationJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CancelSimulationJobBatchMarshallTest()
{
var operation = service_model.FindOperation("CancelSimulationJobBatch");
var request = InstantiateClassGenerator.Execute<CancelSimulationJobBatchRequest>();
var marshaller = new CancelSimulationJobBatchRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CancelSimulationJobBatch", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CancelSimulationJobBatchResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CancelSimulationJobBatchResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CreateDeploymentJobMarshallTest()
{
var operation = service_model.FindOperation("CreateDeploymentJob");
var request = InstantiateClassGenerator.Execute<CreateDeploymentJobRequest>();
var marshaller = new CreateDeploymentJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CreateDeploymentJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CreateDeploymentJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CreateDeploymentJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CreateFleetMarshallTest()
{
var operation = service_model.FindOperation("CreateFleet");
var request = InstantiateClassGenerator.Execute<CreateFleetRequest>();
var marshaller = new CreateFleetRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CreateFleet", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CreateFleetResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CreateFleetResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CreateRobotMarshallTest()
{
var operation = service_model.FindOperation("CreateRobot");
var request = InstantiateClassGenerator.Execute<CreateRobotRequest>();
var marshaller = new CreateRobotRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CreateRobot", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CreateRobotResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CreateRobotResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CreateRobotApplicationMarshallTest()
{
var operation = service_model.FindOperation("CreateRobotApplication");
var request = InstantiateClassGenerator.Execute<CreateRobotApplicationRequest>();
var marshaller = new CreateRobotApplicationRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CreateRobotApplication", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CreateRobotApplicationResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CreateRobotApplicationResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CreateRobotApplicationVersionMarshallTest()
{
var operation = service_model.FindOperation("CreateRobotApplicationVersion");
var request = InstantiateClassGenerator.Execute<CreateRobotApplicationVersionRequest>();
var marshaller = new CreateRobotApplicationVersionRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CreateRobotApplicationVersion", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CreateRobotApplicationVersionResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CreateRobotApplicationVersionResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CreateSimulationApplicationMarshallTest()
{
var operation = service_model.FindOperation("CreateSimulationApplication");
var request = InstantiateClassGenerator.Execute<CreateSimulationApplicationRequest>();
var marshaller = new CreateSimulationApplicationRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CreateSimulationApplication", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CreateSimulationApplicationResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CreateSimulationApplicationResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CreateSimulationApplicationVersionMarshallTest()
{
var operation = service_model.FindOperation("CreateSimulationApplicationVersion");
var request = InstantiateClassGenerator.Execute<CreateSimulationApplicationVersionRequest>();
var marshaller = new CreateSimulationApplicationVersionRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CreateSimulationApplicationVersion", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CreateSimulationApplicationVersionResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CreateSimulationApplicationVersionResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void CreateSimulationJobMarshallTest()
{
var operation = service_model.FindOperation("CreateSimulationJob");
var request = InstantiateClassGenerator.Execute<CreateSimulationJobRequest>();
var marshaller = new CreateSimulationJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("CreateSimulationJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = CreateSimulationJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as CreateSimulationJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DeleteFleetMarshallTest()
{
var operation = service_model.FindOperation("DeleteFleet");
var request = InstantiateClassGenerator.Execute<DeleteFleetRequest>();
var marshaller = new DeleteFleetRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DeleteFleet", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DeleteFleetResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DeleteFleetResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DeleteRobotMarshallTest()
{
var operation = service_model.FindOperation("DeleteRobot");
var request = InstantiateClassGenerator.Execute<DeleteRobotRequest>();
var marshaller = new DeleteRobotRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DeleteRobot", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DeleteRobotResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DeleteRobotResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DeleteRobotApplicationMarshallTest()
{
var operation = service_model.FindOperation("DeleteRobotApplication");
var request = InstantiateClassGenerator.Execute<DeleteRobotApplicationRequest>();
var marshaller = new DeleteRobotApplicationRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DeleteRobotApplication", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DeleteRobotApplicationResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DeleteRobotApplicationResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DeleteSimulationApplicationMarshallTest()
{
var operation = service_model.FindOperation("DeleteSimulationApplication");
var request = InstantiateClassGenerator.Execute<DeleteSimulationApplicationRequest>();
var marshaller = new DeleteSimulationApplicationRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DeleteSimulationApplication", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DeleteSimulationApplicationResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DeleteSimulationApplicationResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DeregisterRobotMarshallTest()
{
var operation = service_model.FindOperation("DeregisterRobot");
var request = InstantiateClassGenerator.Execute<DeregisterRobotRequest>();
var marshaller = new DeregisterRobotRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DeregisterRobot", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DeregisterRobotResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DeregisterRobotResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DescribeDeploymentJobMarshallTest()
{
var operation = service_model.FindOperation("DescribeDeploymentJob");
var request = InstantiateClassGenerator.Execute<DescribeDeploymentJobRequest>();
var marshaller = new DescribeDeploymentJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DescribeDeploymentJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DescribeDeploymentJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DescribeDeploymentJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DescribeFleetMarshallTest()
{
var operation = service_model.FindOperation("DescribeFleet");
var request = InstantiateClassGenerator.Execute<DescribeFleetRequest>();
var marshaller = new DescribeFleetRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DescribeFleet", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DescribeFleetResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DescribeFleetResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DescribeRobotMarshallTest()
{
var operation = service_model.FindOperation("DescribeRobot");
var request = InstantiateClassGenerator.Execute<DescribeRobotRequest>();
var marshaller = new DescribeRobotRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DescribeRobot", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DescribeRobotResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DescribeRobotResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DescribeRobotApplicationMarshallTest()
{
var operation = service_model.FindOperation("DescribeRobotApplication");
var request = InstantiateClassGenerator.Execute<DescribeRobotApplicationRequest>();
var marshaller = new DescribeRobotApplicationRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DescribeRobotApplication", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DescribeRobotApplicationResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DescribeRobotApplicationResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DescribeSimulationApplicationMarshallTest()
{
var operation = service_model.FindOperation("DescribeSimulationApplication");
var request = InstantiateClassGenerator.Execute<DescribeSimulationApplicationRequest>();
var marshaller = new DescribeSimulationApplicationRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DescribeSimulationApplication", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DescribeSimulationApplicationResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DescribeSimulationApplicationResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DescribeSimulationJobMarshallTest()
{
var operation = service_model.FindOperation("DescribeSimulationJob");
var request = InstantiateClassGenerator.Execute<DescribeSimulationJobRequest>();
var marshaller = new DescribeSimulationJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DescribeSimulationJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DescribeSimulationJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DescribeSimulationJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void DescribeSimulationJobBatchMarshallTest()
{
var operation = service_model.FindOperation("DescribeSimulationJobBatch");
var request = InstantiateClassGenerator.Execute<DescribeSimulationJobBatchRequest>();
var marshaller = new DescribeSimulationJobBatchRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("DescribeSimulationJobBatch", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = DescribeSimulationJobBatchResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as DescribeSimulationJobBatchResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void ListDeploymentJobsMarshallTest()
{
var operation = service_model.FindOperation("ListDeploymentJobs");
var request = InstantiateClassGenerator.Execute<ListDeploymentJobsRequest>();
var marshaller = new ListDeploymentJobsRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("ListDeploymentJobs", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ListDeploymentJobsResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as ListDeploymentJobsResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void ListFleetsMarshallTest()
{
var operation = service_model.FindOperation("ListFleets");
var request = InstantiateClassGenerator.Execute<ListFleetsRequest>();
var marshaller = new ListFleetsRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("ListFleets", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ListFleetsResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as ListFleetsResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void ListRobotApplicationsMarshallTest()
{
var operation = service_model.FindOperation("ListRobotApplications");
var request = InstantiateClassGenerator.Execute<ListRobotApplicationsRequest>();
var marshaller = new ListRobotApplicationsRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("ListRobotApplications", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ListRobotApplicationsResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as ListRobotApplicationsResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void ListRobotsMarshallTest()
{
var operation = service_model.FindOperation("ListRobots");
var request = InstantiateClassGenerator.Execute<ListRobotsRequest>();
var marshaller = new ListRobotsRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("ListRobots", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ListRobotsResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as ListRobotsResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void ListSimulationApplicationsMarshallTest()
{
var operation = service_model.FindOperation("ListSimulationApplications");
var request = InstantiateClassGenerator.Execute<ListSimulationApplicationsRequest>();
var marshaller = new ListSimulationApplicationsRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("ListSimulationApplications", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ListSimulationApplicationsResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as ListSimulationApplicationsResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void ListSimulationJobBatchesMarshallTest()
{
var operation = service_model.FindOperation("ListSimulationJobBatches");
var request = InstantiateClassGenerator.Execute<ListSimulationJobBatchesRequest>();
var marshaller = new ListSimulationJobBatchesRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("ListSimulationJobBatches", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ListSimulationJobBatchesResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as ListSimulationJobBatchesResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void ListSimulationJobsMarshallTest()
{
var operation = service_model.FindOperation("ListSimulationJobs");
var request = InstantiateClassGenerator.Execute<ListSimulationJobsRequest>();
var marshaller = new ListSimulationJobsRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("ListSimulationJobs", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ListSimulationJobsResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as ListSimulationJobsResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void ListTagsForResourceMarshallTest()
{
var operation = service_model.FindOperation("ListTagsForResource");
var request = InstantiateClassGenerator.Execute<ListTagsForResourceRequest>();
var marshaller = new ListTagsForResourceRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ListTagsForResourceResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as ListTagsForResourceResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void RegisterRobotMarshallTest()
{
var operation = service_model.FindOperation("RegisterRobot");
var request = InstantiateClassGenerator.Execute<RegisterRobotRequest>();
var marshaller = new RegisterRobotRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("RegisterRobot", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = RegisterRobotResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as RegisterRobotResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void RestartSimulationJobMarshallTest()
{
var operation = service_model.FindOperation("RestartSimulationJob");
var request = InstantiateClassGenerator.Execute<RestartSimulationJobRequest>();
var marshaller = new RestartSimulationJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("RestartSimulationJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = RestartSimulationJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as RestartSimulationJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void StartSimulationJobBatchMarshallTest()
{
var operation = service_model.FindOperation("StartSimulationJobBatch");
var request = InstantiateClassGenerator.Execute<StartSimulationJobBatchRequest>();
var marshaller = new StartSimulationJobBatchRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("StartSimulationJobBatch", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = StartSimulationJobBatchResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as StartSimulationJobBatchResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void SyncDeploymentJobMarshallTest()
{
var operation = service_model.FindOperation("SyncDeploymentJob");
var request = InstantiateClassGenerator.Execute<SyncDeploymentJobRequest>();
var marshaller = new SyncDeploymentJobRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("SyncDeploymentJob", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = SyncDeploymentJobResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as SyncDeploymentJobResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void TagResourceMarshallTest()
{
var operation = service_model.FindOperation("TagResource");
var request = InstantiateClassGenerator.Execute<TagResourceRequest>();
var marshaller = new TagResourceRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = TagResourceResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as TagResourceResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void UntagResourceMarshallTest()
{
var operation = service_model.FindOperation("UntagResource");
var request = InstantiateClassGenerator.Execute<UntagResourceRequest>();
var marshaller = new UntagResourceRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = UntagResourceResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as UntagResourceResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void UpdateRobotApplicationMarshallTest()
{
var operation = service_model.FindOperation("UpdateRobotApplication");
var request = InstantiateClassGenerator.Execute<UpdateRobotApplicationRequest>();
var marshaller = new UpdateRobotApplicationRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("UpdateRobotApplication", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = UpdateRobotApplicationResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as UpdateRobotApplicationResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
[TestMethod]
[TestCategory("UnitTest")]
[TestCategory("Rest_Json")]
[TestCategory("RoboMaker")]
public void UpdateSimulationApplicationMarshallTest()
{
var operation = service_model.FindOperation("UpdateSimulationApplication");
var request = InstantiateClassGenerator.Execute<UpdateSimulationApplicationRequest>();
var marshaller = new UpdateSimulationApplicationRequestMarshaller();
var internalRequest = marshaller.Marshall(request);
TestTools.RequestValidator.Validate("UpdateSimulationApplication", request, internalRequest, service_model);
var webResponse = new WebResponseData
{
Headers = {
{"x-amzn-RequestId", Guid.NewGuid().ToString()},
{"x-amz-crc32","0"}
}
};
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = UpdateSimulationApplicationResponseUnmarshaller.Instance;
var response = unmarshaller.Unmarshall(context)
as UpdateSimulationApplicationResponse;
InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
}
}
}
| 47,860
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.