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/peter-janssen/finagle/blob/master/finagle-core/src/main/scala/com/twitter/finagle/pushsession/SentinelSession.scala
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
finagle
|
peter-janssen
|
Scala
|
Code
| 161
| 398
|
package com.twitter.finagle.pushsession
import com.twitter.finagle.Status
import com.twitter.util.{Future, Time}
import com.twitter.logging.Logger
private[finagle] object SentinelSession {
private[this] val log = Logger.get
/** Build a sentinel `PushSession`
*
* The resulting `PushSession` is only a place holder, a resource aware version
* of `null`, that is is never intended to receive events, and logs an error if
* it does while shutting down the pipeline.
*/
def apply[In, Out](handle: PushChannelHandle[In, Out]): PushSession[In, Out] =
new SentinelSession[In, Out](handle)
// The implementation
private final class SentinelSession[In, Out](handle: PushChannelHandle[In, Out])
extends PushSession[In, Out](handle) {
// Should never be called if this is used correctly, but if it does, get loud and shut things down.
def receive(message: In): Unit = {
val msg = s"${this.getClass.getSimpleName} received unexpected message: " +
s"${message.getClass.getSimpleName}. This is a bug and should be reported as we may be " +
"leaking resources!"
val ex = new IllegalStateException(msg)
log.error(ex, msg)
close()
}
def status: Status = handle.status
def close(deadline: Time): Future[Unit] = handle.close(deadline)
}
}
| 3,923
|
https://github.com/maxpark/ultra96-v2_design_mipicamera/blob/master/src/linux/headers/linux-headers-4.19.0-xlnx-v2019.1-zynqmp-fpga/arch/arm/mach-meson/Makefile
|
Github Open Source
|
Open Source
|
MIT, GPL-2.0-only
| 2,020
|
ultra96-v2_design_mipicamera
|
maxpark
|
Makefile
|
Code
| 6
| 32
|
obj-$(CONFIG_ARCH_MESON) += meson.o
obj-$(CONFIG_SMP) += platsmp.o
| 22,915
|
https://github.com/hasancse91/weather-app-android-mvp-dagger/blob/master/app/src/main/java/com/hellohasan/weatherappmvpdagger/features/weather_info_show/presenter/WeatherInfoShowPresenterImpl.kt
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
weather-app-android-mvp-dagger
|
hasancse91
|
Kotlin
|
Code
| 265
| 951
|
package com.hellohasan.weatherappmvpdagger.features.weather_info_show.presenter
import android.view.View
import com.hellohasan.weatherappmvpdagger.common.RequestCompleteListener
import com.hellohasan.weatherappmvpdagger.utils.kelvinToCelsius
import com.hellohasan.weatherappmvpdagger.utils.unixTimestampToDateTimeString
import com.hellohasan.weatherappmvpdagger.utils.unixTimestampToTimeString
import com.hellohasan.weatherappmvpdagger.features.weather_info_show.model.WeatherInfoShowModel
import com.hellohasan.weatherappmvpdagger.features.weather_info_show.model.data_class.City
import com.hellohasan.weatherappmvpdagger.features.weather_info_show.model.data_class.WeatherDataModel
import com.hellohasan.weatherappmvpdagger.features.weather_info_show.model.data_class.WeatherInfoResponse
import com.hellohasan.weatherappmvpdagger.features.weather_info_show.view.MainActivityView
import javax.inject.Inject
class WeatherInfoShowPresenterImpl @Inject constructor (
private var view: MainActivityView?,
private val model: WeatherInfoShowModel
) : WeatherInfoShowPresenter {
override fun fetchCityList() {
// call model's method for city list
model.getCityList(object : RequestCompleteListener<MutableList<City>> {
// if model successfully fetch the data from 'somewhere', this method will be called
override fun onRequestSuccess(data: MutableList<City>) {
view?.onCityListFetchSuccess(data) //let view know the formatted city list data
}
// if model failed to fetch data then this method will be called
override fun onRequestFailed(errorMessage: String) {
view?.onCityListFetchFailure(errorMessage) //let view know about failure
}
})
}
override fun fetchWeatherInfo(cityId: Int) {
view?.handleProgressBarVisibility(View.VISIBLE) // let view know about progress bar visibility
// call model's method for weather information
model.getWeatherInformation(cityId, object : RequestCompleteListener<WeatherInfoResponse> {
// if model successfully fetch the data from 'somewhere', this method will be called
override fun onRequestSuccess(data: WeatherInfoResponse) {
view?.handleProgressBarVisibility(View.GONE) // let view know about progress bar visibility
// data formatting to show on UI
val weatherDataModel = WeatherDataModel(
dateTime = data.dt.unixTimestampToDateTimeString(),
temperature = data.main.temp.kelvinToCelsius().toString(),
cityAndCountry = "${data.name}, ${data.sys.country}",
weatherConditionIconUrl = "http://openweathermap.org/img/w/${data.weather[0].icon}.png",
weatherConditionIconDescription = data.weather[0].description,
humidity = "${data.main.humidity}%",
pressure = "${data.main.pressure} mBar",
visibility = "${data.visibility/1000.0} KM",
sunrise = data.sys.sunrise.unixTimestampToTimeString(),
sunset = data.sys.sunset.unixTimestampToTimeString()
)
view?.onWeatherInfoFetchSuccess(weatherDataModel) //let view know the formatted weather data
}
// if model failed to fetch data then this method will be called
override fun onRequestFailed(errorMessage: String) {
view?.handleProgressBarVisibility(View.GONE) // let view know about progress bar visibility
view?.onWeatherInfoFetchFailure(errorMessage) //let view know about failure
}
})
}
override fun detachView() {
view = null
}
}
| 26,311
|
https://github.com/Hanul/SkyEngine-Canvas/blob/master/SkyEngine/BROWSER/Node/Image/Background.js
|
Github Open Source
|
Open Source
|
MIT
| null |
SkyEngine-Canvas
|
Hanul
|
JavaScript
|
Code
| 513
| 1,648
|
/*
* 배경 노드
*/
SkyEngine.Background = CLASS({
preset : () => {
return SkyEngine.FixedNode;
},
init : (inner, self, params) => {
//REQUIRED: params
//REQUIRED: params.src
//OPTIONAL: params.isNotToRepeatX
//OPTIONAL: params.isNotToRepeatY
//OPTIONAL: params.leftMargin
//OPTIONAL: params.rightMargin
//OPTIONAL: params.topMargin
//OPTIONAL: params.bottomMargin
let src = params.src;
let isNotToRepeatX = params.isNotToRepeatX;
let isNotToRepeatY = params.isNotToRepeatY;
let leftMargin = params.leftMargin;
let rightMargin = params.rightMargin;
let topMargin = params.topMargin;
let bottomMargin = params.bottomMargin;
if (leftMargin === undefined) {
leftMargin = 0;
}
if (rightMargin === undefined) {
rightMargin = 0;
}
if (topMargin === undefined) {
topMargin = 0;
}
if (bottomMargin === undefined) {
bottomMargin = 0;
}
let width;
let height;
let img = new Image();
img.onload = () => {
width = img.width;
height = img.height;
img.onload = undefined;
self.fireEvent('load');
};
img.src = src;
let draw;
OVERRIDE(self.draw, (origin) => {
draw = self.draw = (context) => {
if (width !== undefined) {
if (isNotToRepeatX === true && isNotToRepeatY === true) {
context.drawImage(
img,
-width / 2,
-height / 2,
width,
height);
}
else if (isNotToRepeatX === true) {
let _y = -height / 2;
let screenY = (SkyEngine.Screen.getCameraFollowY() - SkyEngine.Screen.getY()) / SkyEngine.Screen.getRealScaleY() / self.getRealScaleY();
let halfScreenHeight = SkyEngine.Screen.getHeight() / 2 / SkyEngine.Screen.getRealScaleY() / self.getRealScaleY();
while (screenY - halfScreenHeight < _y + self.getY()) {
_y -= topMargin + height + bottomMargin;
}
while (_y + self.getY() < screenY + halfScreenHeight) {
context.drawImage(
img,
-width / 2,
_y,
width,
height);
_y += topMargin + height + bottomMargin;
}
}
else if (isNotToRepeatY === true) {
let _x = -width / 2;
let screenX = (SkyEngine.Screen.getCameraFollowX() - SkyEngine.Screen.getX()) / SkyEngine.Screen.getRealScaleX() / self.getRealScaleX();
let halfScreenWidth = SkyEngine.Screen.getWidth() / 2 / SkyEngine.Screen.getRealScaleX() / self.getRealScaleX();
while (screenX - halfScreenWidth < _x + self.getX()) {
_x -= leftMargin + width + rightMargin;
}
while (_x + self.getX() < screenX + halfScreenWidth) {
context.drawImage(
img,
_x,
-height / 2,
width,
height);
_x += leftMargin + width + rightMargin;
}
}
else {
let _x = -width / 2;
let _y = -height / 2;
let screenX = (SkyEngine.Screen.getCameraFollowX() - SkyEngine.Screen.getX()) / SkyEngine.Screen.getRealScaleX() / self.getRealScaleX();
let screenY = (SkyEngine.Screen.getCameraFollowY() - SkyEngine.Screen.getY()) / SkyEngine.Screen.getRealScaleY() / self.getRealScaleY();
let halfScreenWidth = SkyEngine.Screen.getWidth() / 2 / SkyEngine.Screen.getRealScaleX() / self.getRealScaleX();
let halfScreenHeight = SkyEngine.Screen.getHeight() / 2 / SkyEngine.Screen.getRealScaleY() / self.getRealScaleY();
while (screenX - halfScreenWidth < _x + self.getX()) {
_x -= leftMargin + width + rightMargin;
}
while (screenY - halfScreenHeight < _y + self.getY()) {
_y -= topMargin + height + bottomMargin;
}
while (_y + self.getY() < screenY + halfScreenHeight) {
let _x2 = _x;
while (_x2 + self.getX() < screenX + halfScreenWidth) {
context.drawImage(
img,
_x2,
_y,
width,
height);
_x2 += leftMargin + width + rightMargin;
}
_y += topMargin + height + bottomMargin;
}
}
}
origin(context);
};
});
let remove;
OVERRIDE(self.remove, (origin) => {
remove = self.remove = () => {
img.onload = undefined;
img = undefined;
origin();
};
});
let getImg = inner.getImg = () => {
return img;
};
let getWidth = self.getWidth = () => {
return width;
};
let getHeight = self.getHeight = () => {
return height;
};
}
});
| 4,392
|
https://github.com/DeepLinkCode/GithubToGitlab/blob/master/mirror.php
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
GithubToGitlab
|
DeepLinkCode
|
PHP
|
Code
| 201
| 785
|
<?php
/**
* Github to Gitlab mirror
*
* Author: Deepender Choudhary
*
* License Mit https://choosealicense.com/licenses/mit
*/
ini_set('max_execution_time', INF); //SET EXECUTION TIME HERE IT'S INIFINITE
date_default_timezone_set('Asia/Kolkata'); // SET Your Timezone
$__DIR = str_replace('\\', '/', realpath(__DIR__ .'/')); //SCRIPT PATH
define('BASEPATH', $__DIR);
//set here which repository to fetch
define('SOURCE_REPOSITORY', 'git@github.com:example/example.git');
//set here which repository to push
define('TARGET_REPOSITORY', 'git@gitlab.com:user/example.git');
// local git cache directory
define('LOCAL_CACHE', BASEPATH.'/git-mirror-cache/repo.git');
define('GIT_LOGS', BASEPATH.'/gitlogs');
if (!file_exists(LOCAL_CACHE)) {
mkdir(LOCAL_CACHE);
}
if (!file_exists(GIT_LOGS)) {
mkdir(GIT_LOGS);
}
chdir(LOCAL_CACHE);
$commands = array();
if (!is_dir(sprintf('%s/%s', LOCAL_CACHE, 'refs'))) {
$commands[] = sprintf('git clone --mirror %s %s', SOURCE_REPOSITORY, LOCAL_CACHE);
} else {
$commands[] = sprintf('git fetch -p origin');
}
$commands[] = sprintf('git push --mirror %s', TARGET_REPOSITORY);
$out = []; $i =1;
foreach ($commands as $command) {
$out[$i] = "Executing $command ";
$tmp = pipeExecute($command.' 2>&1');
$i++;
$out[$i] = $tmp;
$i++;
}
$currentTime = date( 'd-m-Y--h-i-s-a', time () );
file_put_contents(BASEPATH.'/gitlogs/git-'.$currentTime.'.txt', var_export($out, true)."\n\n"); //git push mirror array logs
/**
* Execute cmds in shell
* @return array
*/
function pipeExecute($cmd, $input='') {
$proc = proc_open($cmd, array(
0 => array('pipe','r'),
1 => array('pipe','w'),
2 => array('pipe','w')
), $pipes);
fwrite($pipes[0], $input);
fclose($pipes[0]);
$stdout = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$stderr = stream_get_contents($pipes[2]);
fclose($pipes[2]);
$rtn = proc_close($proc);
return array(
'stdout'=>$stdout,
'stderr'=>$stderr,
'return'=>$rtn
);
}
| 43,852
|
https://github.com/achunpeace/free/blob/master/App/Admin/Controller/CateController.class.php
|
Github Open Source
|
Open Source
|
BSD-2-Clause
| 2,021
|
free
|
achunpeace
|
PHP
|
Code
| 211
| 1,390
|
<?php
namespace Admin\Controller;
use Think\Controller;
class CateController extends PublicController{
public function index(){
$this->view();
}
public function add(){
//从提交的post里获取菜单的id
$id = I('post.id');
//
$pid = !empty($id)?$id:0;
//查询菜单
$this->cate = M('Cate')->where("`pid`=$pid")->select();
//干掉所有标签
// print_r($this->menu);die;
$this->view();
}
//提交数据
public function addCate(){
//I接受表单post提交的数据
$data = I('post.');
if(!empty($data['name'])&&isset($data['pid'])){
//分类转数组
$namearr = explode('/',$data['name']);
//因为pid一样,pid另存一个新的数组
$add['pid'] = $data['pid'];
//添加成功的条数
$num = 0;
//有没有重名的分类名
$error = '';
foreach ($namearr as $value){
//将获取到的分类名赋值给分类表name一样的字段
$add['name'] = $value;
//使用验证
if(D('Cate')->create($add)){
//实例化数据库执行添加语句
$rows = D('Cate')->add($add);
$num++;
}else{
//拼接可能重复的名称
$error.=$value.',';
}
}
//如果分类名存在
if($error){
//XX已存在
$error.='已存在';
}
if($num>0){
$this->success('添加成功'.$num.'条数据'.$error,U('add'),1);
}else{
$this->error('添加失败'.$error,'add',1);
}
}
}
public function ajax(){
//从提交的get里获取分类的id
$id = I('post.id');
//
$pid = !empty($id)?$id:0;
//查询分类
$this->cate = M('Cate')->where("`pid`=$pid")->select();
//返回数据,ajax可以不用写json
$this->ajaxReturn($this->cate);
}
public function ajaxEdit(){
//从提交的get里获取分类的id
$id = I('post.id');
//
$pid = !empty($id)?$id:0;
//查询分类
$this->cate = M('Cate')->where("`pid`=$pid")->select();
//返回数据,ajax可以不用写json
$this->ajaxReturn($this->cate);
}
public function edit(){
//获取编辑数据的id
$id = I('get.id');
//查询该数据的信息
$this->one = M('Cate')->where("`id`=$id")->find();
//如果没有该数据就返回上一页
if(!$this->one){
echo '<script>history.go(-1)</script>';die;
}
$arr = array();
//声明一个数组接收自身
$father = $this->one;
// print_r($father);exit;
//循环查找该数据的父级
do{
//父级的id,也是同级的pid
$pid = $father['pid']*1;
//获取同级数据,用id当下标可以倒叙输出数组
$arr[$father['id']] = M('Cate')->where("`pid`=$pid")->select();
//获取父级
$father = M('Cate')->where("`id`=$pid")->find();
}while($pid!=0);
//倒叙输出数组
$arr = array_reverse($arr,true);
$this->assign('one',$this->one);
$this->assign('arr',$arr);
$this->view();
}
public function editData(){
$id = I('get.id');
//接收新修改的数据
$data = I('post.');
//增加一个id下标
$data['id'] = $id;
//实例化数据库执行添加语句
$rows = D('Cate')->save($data);
if($rows){
$this->redirect('index',array('cate_id'=>$this->cate_id));
}
}
public function delete(){
$id=I('get.id');
$row = D('Cate')->where("`id`=$id")->delete();
if($row){
$this->success('删除成功',U('index'),1);
}else{
$this->error('删除失败','index',1);
}
}
}
| 50,012
|
https://github.com/Kichiru69/Java_Course/blob/master/src/SecondCourse/Collections/Iterators.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
Java_Course
|
Kichiru69
|
Java
|
Code
| 81
| 279
|
package SecondCourse.Collections;
import java.util.*;
public class Iterators {
public static void main(String[] args) {
ArrayList<Integer> integerList = new ArrayList<>();
integerList.add(1);
integerList.add(5);
integerList.add(156);
Iterator<Integer> integerIterator = integerList.iterator();
while (integerIterator.hasNext()) {
System.out.println(integerIterator.next());
}
String s = "madam";
boolean b = true;
List<Character> stringList = new LinkedList<>();
for (char c: s.toCharArray()) {
stringList.add(c);
}
ListIterator<Character> iterator = stringList.listIterator();
ListIterator<Character> reverseIterator = stringList.listIterator(stringList.size());
while (iterator.hasNext() && reverseIterator.hasPrevious()) {
if (!iterator.next().equals(reverseIterator.previous())) {
b = false;
break;
}
}
System.out.println("Is polynothing - " + b);
}
}
| 20,657
|
https://github.com/gilles-stragier/quickmon/blob/master/src/main/java/be/fgov/caamihziv/services/quickmon/domain/samplers/ssh/JschSamplerBuilder.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,017
|
quickmon
|
gilles-stragier
|
Java
|
Code
| 65
| 299
|
package be.fgov.caamihziv.services.quickmon.domain.samplers.ssh;
import be.fgov.caamihziv.services.quickmon.domain.samplers.SamplerBuilder;
import be.fgov.caamihziv.services.quickmon.domain.samplers.http.HttpSampler;
import be.fgov.caamihziv.services.quickmon.domain.samplers.http.HttpSamplerBuilder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* Created by gs on 09.05.17.
*/
@JsonTypeName("ssh")
public class JschSamplerBuilder extends SamplerBuilder<JschSamplerBuilder, JschSampler> {
private String command;
public JschSamplerBuilder command(String val) {
this.command = val;
return this;
}
@Override
public String getType() {
return "ssh";
}
@Override
public JschSampler build() {
return new JschSampler(this);
}
public String getCommand() {
return command;
}
}
| 30,891
|
https://github.com/rafan/vespa/blob/master/searchlib/src/vespa/searchlib/diskindex/fusion.cpp
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,018
|
vespa
|
rafan
|
C++
|
Code
| 1,376
| 5,143
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "fusion.h"
#include "fieldreader.h"
#include "dictionarywordreader.h"
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/searchlib/util/filekit.h>
#include <vespa/searchlib/util/dirtraverse.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/searchlib/common/documentsummary.h>
#include <vespa/vespalib/util/error.h>
#include <sstream>
#include <vespa/log/log.h>
LOG_SETUP(".diskindex.fusion");
using search::FileKit;
using search::PostingPriorityQueue;
using search::common::FileHeaderContext;
using search::diskindex::DocIdMapping;
using search::diskindex::WordNumMapping;
using search::docsummary::DocumentSummary;
using search::index::PostingListParams;
using search::index::Schema;
using search::index::SchemaUtil;
using search::index::schema::DataType;
using vespalib::getLastErrorString;
namespace search::diskindex {
void
FusionInputIndex::setSchema(const Schema::SP &schema)
{
_schema = schema;
}
Fusion::Fusion(bool dynamicKPosIndexFormat,
const TuneFileIndexing &tuneFileIndexing,
const FileHeaderContext &fileHeaderContext)
: _schema(nullptr),
_oldIndexes(),
_docIdLimit(0u),
_numWordIds(0u),
_dynamicKPosIndexFormat(dynamicKPosIndexFormat),
_outDir("merged"),
_tuneFileIndexing(tuneFileIndexing),
_fileHeaderContext(fileHeaderContext)
{ }
Fusion::~Fusion()
{
ReleaseMappingTables();
}
void
Fusion::setSchema(const Schema *schema)
{
_schema = schema;
}
void
Fusion::setOutDir(const vespalib::string &outDir)
{
_outDir = outDir;
}
void
Fusion::SetOldIndexList(const std::vector<vespalib::string> &oldIndexList)
{
_oldIndexes.resize(oldIndexList.size());
OldIndexIterator oldIndexIt = _oldIndexes.begin();
uint32_t i = 0;
for (std::vector<vespalib::string>::const_iterator
it = oldIndexList.begin(), ite = oldIndexList.end();
it != ite;
++it, ++oldIndexIt, ++i) {
oldIndexIt->reset(allocOldIndex());
OldIndex &oi = **oldIndexIt;
oi.setPath(*it);
std::ostringstream tmpindexpath0;
tmpindexpath0 << _outDir;
tmpindexpath0 << "/tmpindex";
tmpindexpath0 << i;
oi.setTmpPath(tmpindexpath0.str());
}
}
bool
Fusion::openInputWordReaders(const SchemaUtil::IndexIterator &index,
std::vector<
std::unique_ptr<DictionaryWordReader> > &
readers,
PostingPriorityQueue<DictionaryWordReader> &heap)
{
for (auto &i : getOldIndexes()) {
OldIndex &oi = *i;
auto reader(std::make_unique<DictionaryWordReader>());
const vespalib::string &tmpindexpath = oi.getTmpPath();
const vespalib::string &oldindexpath = oi.getPath();
vespalib::string wordMapName = tmpindexpath + "/old2new.dat";
vespalib::string fieldDir(oldindexpath + "/" + index.getName());
vespalib::string dictName(fieldDir + "/dictionary");
const Schema &oldSchema = oi.getSchema();
if (!index.hasOldFields(oldSchema, false)) {
continue; // drop data
}
bool res = reader->open(dictName,
wordMapName,
_tuneFileIndexing._read);
if (!res) {
LOG(error, "Could not open dictionary %s to generate %s",
dictName.c_str(), wordMapName.c_str());
return false;
}
reader->read();
if (reader->isValid()) {
readers.push_back(std::move(reader));
heap.initialAdd(readers.back().get());
}
}
return true;
}
bool
Fusion::renumberFieldWordIds(const SchemaUtil::IndexIterator &index)
{
vespalib::string indexName = index.getName();
LOG(debug, "Renumber word IDs for field %s", indexName.c_str());
std::vector<std::unique_ptr<DictionaryWordReader>> readers;
PostingPriorityQueue<DictionaryWordReader> heap;
WordAggregator out;
if (!openInputWordReaders(index, readers, heap))
return false;
heap.merge(out, 4);
assert(heap.empty());
_numWordIds = out.getWordNum();
// Close files
for (auto &i : readers) {
i->close();
}
// Now read mapping files back into an array
// XXX: avoid this, and instead make the array here
if (!ReadMappingFiles(&index))
return false;
LOG(debug, "Finished renumbering words IDs for field %s",
indexName.c_str());
return true;
}
bool
Fusion::mergeFields()
{
typedef SchemaUtil::IndexIterator IndexIterator;
const Schema &schema = getSchema();
for (IndexIterator index(schema); index.isValid(); ++index) {
if (!mergeField(index.getIndex()))
return false;
}
return true;
}
bool
Fusion::mergeField(uint32_t id)
{
typedef SchemaUtil::IndexIterator IndexIterator;
typedef SchemaUtil::IndexSettings IndexSettings;
const Schema &schema = getSchema();
IndexIterator index(schema, id);
const vespalib::string &indexName = index.getName();
IndexSettings settings = index.getIndexSettings();
if (settings.hasError())
return false;
vespalib::string indexDir = _outDir + "/" + indexName;
if (FileKit::hasStamp(indexDir + "/.mergeocc_done"))
return true;
vespalib::mkdir(indexDir.c_str(), false);
LOG(debug, "mergeField for field %s dir %s",
indexName.c_str(), indexDir.c_str());
makeTmpDirs();
if (!renumberFieldWordIds(index)) {
LOG(error, "Could not renumber field word ids for field %s dir %s",
indexName.c_str(), indexDir.c_str());
return false;
}
// Tokamak
bool res = mergeFieldPostings(index);
if (!res) {
LOG(error, "Could not merge field postings for field %s dir %s",
indexName.c_str(), indexDir.c_str());
LOG_ABORT("should not be reached");
}
if (!FileKit::createStamp(indexDir + "/.mergeocc_done"))
return false;
vespalib::File::sync(indexDir);
if (!CleanTmpDirs())
return false;
LOG(debug, "Finished mergeField for field %s dir %s",
indexName.c_str(), indexDir.c_str());
return true;
}
template <class Reader, class Writer>
bool
Fusion::selectCookedOrRawFeatures(Reader &reader, Writer &writer)
{
bool rawFormatOK = true;
bool cookedFormatOK = true;
PostingListParams featureParams;
PostingListParams outFeatureParams;
vespalib::string cookedFormat;
vespalib::string rawFormat;
if (!reader.isValid())
return true;
{
writer.getFeatureParams(featureParams);
cookedFormat = featureParams.getStr("cookedEncoding");
rawFormat = featureParams.getStr("encoding");
if (rawFormat == "")
rawFormatOK = false; // Typically uncompressed file
outFeatureParams = featureParams;
}
{
reader.getFeatureParams(featureParams);
if (cookedFormat != featureParams.getStr("cookedEncoding"))
cookedFormatOK = false;
if (rawFormat != featureParams.getStr("encoding"))
rawFormatOK = false;
if (featureParams != outFeatureParams)
rawFormatOK = false;
if (!reader.allowRawFeatures())
rawFormatOK = false; // Reader transforms data
}
if (!cookedFormatOK) {
LOG(error,
"Cannot perform fusion, cooked feature formats don't match");
return false;
}
if (rawFormatOK) {
featureParams.clear();
featureParams.set("cooked", false);
reader.setFeatureParams(featureParams);
reader.getFeatureParams(featureParams);
if (featureParams.isSet("cookedEncoding") ||
rawFormat != featureParams.getStr("encoding"))
rawFormatOK = false;
if (!rawFormatOK) {
LOG(error, "Cannot perform fusion, raw format setting failed");
return false;
}
LOG(debug, "Using raw feature format for fusion of posting files");
}
return true;
}
bool
Fusion::openInputFieldReaders(const SchemaUtil::IndexIterator &index,
std::vector<std::unique_ptr<FieldReader> > &
readers)
{
vespalib::string indexName = index.getName();
for (auto &i : _oldIndexes) {
OldIndex &oi = *i;
const Schema &oldSchema = oi.getSchema();
if (!index.hasOldFields(oldSchema, false)) {
continue; // drop data
}
auto reader = FieldReader::allocFieldReader(index, oldSchema);
reader->setup(oi.getWordNumMapping(),
oi.getDocIdMapping());
if (!reader->open(oi.getPath() + "/" +
indexName + "/",
_tuneFileIndexing._read))
return false;
readers.push_back(std::move(reader));
}
return true;
}
bool
Fusion::openFieldWriter(const SchemaUtil::IndexIterator &index,
FieldWriter &writer)
{
vespalib::string dir = _outDir + "/" + index.getName();
if (!writer.open(dir + "/",
64,
262144,
_dynamicKPosIndexFormat,
index.getSchema(),
index.getIndex(),
_tuneFileIndexing._write,
_fileHeaderContext)) {
LOG(error, "Could not open output posocc + dictionary in %s",
dir.c_str());
LOG_ABORT("should not be reached");
return false;
}
return true;
}
bool
Fusion::setupMergeHeap(const std::vector<std::unique_ptr<FieldReader> > &
readers,
FieldWriter &writer,
PostingPriorityQueue<FieldReader> &heap)
{
for (auto &reader : readers) {
if (!selectCookedOrRawFeatures(*reader, writer))
return false;
if (reader->isValid())
reader->read();
if (reader->isValid())
heap.initialAdd(reader.get());
}
return true;
}
bool
Fusion::mergeFieldPostings(const SchemaUtil::IndexIterator &index)
{
std::vector<std::unique_ptr<FieldReader>> readers;
PostingPriorityQueue<FieldReader> heap;
/* OUTPUT */
FieldWriter fieldWriter(_docIdLimit, _numWordIds);
vespalib::string indexName = index.getName();
if (!openInputFieldReaders(index, readers))
return false;
if (!openFieldWriter(index, fieldWriter))
return false;
if (!setupMergeHeap(readers, fieldWriter, heap))
return false;
heap.merge(fieldWriter, 4);
assert(heap.empty());
for (auto &reader : readers) {
if (!reader->close())
return false;
}
if (!fieldWriter.close()) {
LOG(error, "Could not close output posocc + dictionary in %s/%s",
_outDir.c_str(), indexName.c_str());
LOG_ABORT("should not be reached");
}
return true;
}
bool
Fusion::ReadMappingFiles(const SchemaUtil::IndexIterator *index)
{
ReleaseMappingTables();
size_t numberOfOldIndexes = _oldIndexes.size();
for (uint32_t i = 0; i < numberOfOldIndexes; i++)
{
OldIndex &oi = *_oldIndexes[i];
WordNumMapping &wordNumMapping = oi.getWordNumMapping();
std::vector<uint32_t> oldIndexes;
const Schema &oldSchema = oi.getSchema();
if (!SchemaUtil::getIndexIds(oldSchema,
DataType::STRING,
oldIndexes))
return false;
if (oldIndexes.empty()) {
wordNumMapping.noMappingFile();
continue;
}
if (index && !index->hasOldFields(oldSchema, false)) {
continue; // drop data
}
// Open word mapping file
vespalib::string old2newname = oi.getTmpPath() + "/old2new.dat";
wordNumMapping.readMappingFile(old2newname, _tuneFileIndexing._read);
}
return true;
}
bool
Fusion::ReleaseMappingTables()
{
size_t numberOfOldIndexes = _oldIndexes.size();
for (uint32_t i = 0; i < numberOfOldIndexes; i++)
{
OldIndex &oi = *_oldIndexes[i];
oi.getWordNumMapping().clear();
}
return true;
}
void
Fusion::makeTmpDirs()
{
for (auto &i : getOldIndexes()) {
OldIndex &oi = *i;
// Make tmpindex directories
const vespalib::string &tmpindexpath = oi.getTmpPath();
vespalib::mkdir(tmpindexpath, false);
}
}
bool
Fusion::CleanTmpDirs()
{
uint32_t i = 0;
for (;;) {
std::ostringstream tmpindexpath0;
tmpindexpath0 << _outDir;
tmpindexpath0 << "/tmpindex";
tmpindexpath0 << i;
const vespalib::string &tmpindexpath = tmpindexpath0.str();
FastOS_StatInfo statInfo;
if (!FastOS_File::Stat(tmpindexpath.c_str(), &statInfo)) {
if (statInfo._error == FastOS_StatInfo::FileNotFound)
break;
LOG(error, "Failed to stat tmpdir %s", tmpindexpath.c_str());
return false;
}
i++;
}
while (i > 0) {
i--;
// Remove tmpindex directories
std::ostringstream tmpindexpath0;
tmpindexpath0 << _outDir;
tmpindexpath0 << "/tmpindex";
tmpindexpath0 << i;
const vespalib::string &tmpindexpath = tmpindexpath0.str();
search::DirectoryTraverse dt(tmpindexpath.c_str());
if (!dt.RemoveTree()) {
LOG(error, "Failed to clean tmpdir %s", tmpindexpath.c_str());
return false;
}
}
return true;
}
bool
Fusion::checkSchemaCompat()
{
return true;
}
bool
Fusion::readSchemaFiles()
{
OldIndexIterator oldIndexIt = _oldIndexes.begin();
OldIndexIterator oldIndexIte = _oldIndexes.end();
for(; oldIndexIt != oldIndexIte; ++oldIndexIt) {
OldIndex &oi = **oldIndexIt;
vespalib::string oldcfname = oi.getPath() + "/schema.txt";
Schema::SP schema(new Schema);
if (!schema->loadFromFile(oldcfname))
return false;
if (!SchemaUtil::validateSchema(*_schema))
return false;
oi.setSchema(schema);
}
/* TODO: Check compatibility */
bool res = checkSchemaCompat();
if (!res)
LOG(error, "Index fusion cannot continue due to incompatible indexes");
return res;
}
bool
Fusion::merge(const Schema &schema,
const vespalib::string &dir,
const std::vector<vespalib::string> &sources,
const SelectorArray &selector,
bool dynamicKPosOccFormat,
const TuneFileIndexing &tuneFileIndexing,
const FileHeaderContext &fileHeaderContext)
{
assert(sources.size() <= 255);
uint32_t docIdLimit = selector.size();
uint32_t trimmedDocIdLimit = docIdLimit;
// Limit docIdLimit in output based on selections that cannot be satisfied
uint32_t sourcesSize = sources.size();
while (trimmedDocIdLimit > 0 &&
selector[trimmedDocIdLimit - 1] >= sourcesSize)
--trimmedDocIdLimit;
FastOS_StatInfo statInfo;
if (!FastOS_File::Stat(dir.c_str(), &statInfo)) {
if (statInfo._error != FastOS_StatInfo::FileNotFound) {
LOG(error, "Could not stat \"%s\"", dir.c_str());
return false;
}
} else {
if (!statInfo._isDirectory) {
LOG(error, "\"%s\" is not a directory", dir.c_str());
return false;
}
search::DirectoryTraverse dt(dir.c_str());
if (!dt.RemoveTree()) {
LOG(error, "Failed to clean directory \"%s\"", dir.c_str());
return false;
}
}
vespalib::mkdir(dir, false);
schema.saveToFile(dir + "/schema.txt");
if (!DocumentSummary::writeDocIdLimit(dir, trimmedDocIdLimit)) {
LOG(error, "Could not write docsum count in dir %s: %s",
dir.c_str(), getLastErrorString().c_str());
return false;
}
std::unique_ptr<Fusion> fusion(new Fusion(dynamicKPosOccFormat,
tuneFileIndexing,
fileHeaderContext));
fusion->setSchema(&schema);
fusion->setOutDir(dir);
fusion->SetOldIndexList(sources);
if (!fusion->readSchemaFiles()) {
LOG(error, "Cannot read schema files for source indexes");
return false;
}
uint32_t idx = 0;
std::vector<std::shared_ptr<OldIndex> > &oldIndexes =
fusion->getOldIndexes();
for (OldIndexIterator i = oldIndexes.begin(), ie = oldIndexes.end();
i != ie; ++i, ++idx) {
OldIndex &oi = **i;
// Make tmpindex directories
const vespalib::string &tmpindexpath = oi.getTmpPath();
vespalib::mkdir(tmpindexpath, false);
DocIdMapping &docIdMapping = oi.getDocIdMapping();
if (!docIdMapping.readDocIdLimit(oi.getPath())) {
LOG(error, "Cannot determine docIdLimit for old index \"%s\"",
oi.getPath().c_str());
return false;
}
docIdMapping.setup(docIdMapping._docIdLimit,
&selector,
idx);
}
fusion->setDocIdLimit(trimmedDocIdLimit);
if (!fusion->mergeFields())
return false;
return true;
}
}
| 15,449
|
https://github.com/zhmz90/MINIGATK/blob/master/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/sam/SimplifyingSAMFileWriter.java
|
Github Open Source
|
Open Source
|
MIT
| 2,016
|
MINIGATK
|
zhmz90
|
Java
|
Code
| 343
| 728
|
/*
* Copyright 2012-2015 Broad Institute, Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.gatk.utils.sam;
import htsjdk.samtools.SAMFileHeader;
import htsjdk.samtools.SAMFileWriter;
import htsjdk.samtools.SAMRecord;
import htsjdk.samtools.util.ProgressLoggerInterface;
/**
* XXX
*/
public class SimplifyingSAMFileWriter implements SAMFileWriter {
final SAMFileWriter dest;
public SimplifyingSAMFileWriter(final SAMFileWriter finalDestination) {
this.dest = finalDestination;
}
public void addAlignment( SAMRecord read ) {
if ( keepRead(read) ) {
dest.addAlignment(simplifyRead(read));
}
}
/**
* Retrieves the header to use when creating the new SAM file.
* @return header to use when creating the new SAM file.
*/
public SAMFileHeader getFileHeader() {
return dest.getFileHeader();
}
/**
* @{inheritDoc}
*/
public void close() {
dest.close();
}
public static final boolean keepRead(SAMRecord read) {
return ! excludeRead(read);
}
public static final boolean excludeRead(SAMRecord read) {
return read.getReadUnmappedFlag() || read.getReadFailsVendorQualityCheckFlag() || read.getDuplicateReadFlag() || read.getNotPrimaryAlignmentFlag();
}
public static final SAMRecord simplifyRead(SAMRecord read) {
// the only attribute we keep is the RG
Object rg = read.getAttribute("RG");
read.clearAttributes();
read.setAttribute("RG", rg);
return read;
}
@Override
public void setProgressLogger(final ProgressLoggerInterface logger) {
dest.setProgressLogger(logger);
}
}
| 50,313
|
https://github.com/gadsbytom/docker_sentiment_etl/blob/master/tweet_collector/get_tweets.py
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
docker_sentiment_etl
|
gadsbytom
|
Python
|
Code
| 114
| 410
|
from tweepy import OAuthHandler, Cursor, API
from tweepy.streaming import StreamListener
import logging
import time
import pymongo
import os
conn = 'mongodb'
client = pymongo.MongoClient(conn)
db = client.tweets
API_KEY = os.getenv('API_KEY')
API_SECRET = os.getenv('API_SECRET')
def authenticate():
"""function for twitter authentication"""
auth = OAuthHandler(API_KEY, API_SECRET)
return auth
if __name__ == '__main__':
auth = authenticate()
api = API(auth)
while True:
cursor = Cursor(
api.user_timeline,
id = 'legaltech_news',
tweet_mode = 'extended')
for status in cursor.items(100):
time.sleep(1)
text = status.full_text
# take extended tweets into account
if 'extended_tweet' in dir(status):
text = status.extended_tweet.full_text
if 'retweeted_status' in dir(status):
r = status.retweeted_status
if 'extended_tweet' in dir(r):
text = r.extended_tweet.full_text
tweet = {
'text': text,
'username': status.user.screen_name,
'followers_count': status.user.followers_count
}
logging.critical(tweet)
db.collections.legaltech.insert_one(tweet)
| 41,975
|
https://github.com/danielft11/SGNWebCore/blob/master/Domain/Models/ModeloBase.cs
|
Github Open Source
|
Open Source
|
MIT
| null |
SGNWebCore
|
danielft11
|
C#
|
Code
| 66
| 181
|
using System;
using System.ComponentModel;
namespace Domain.Models
{
public abstract class ModeloBase
{
public int Id { get; set; }
[DisplayName("Data de Criação")]
public DateTime DataCriacao { get; set; } = DateTime.Now;
[DisplayName("Data de Alteração")]
public DateTime DataAlteracao { get; set; } = DateTime.Now;
public bool ShouldSerializeId()
{
return true;
}
public bool ShouldSerializeDataCriacao()
{
return false;
}
public bool ShouldSerializeDataAlteracao()
{
return false;
}
}
}
| 27,039
|
https://github.com/Amebus/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/ocl/engine/builder/plugins/reduce/DeserializationBPlugin.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
flink
|
Amebus
|
Java
|
Code
| 35
| 161
|
package org.apache.flink.streaming.api.ocl.engine.builder.plugins.reduce;
import org.apache.flink.streaming.api.ocl.engine.builder.plugins.DeserializationPlugin;
public class DeserializationBPlugin extends DeserializationPlugin
{
@Override
protected String getInputLogicalVarsKey()
{
return "input-logical-b-vars";
}
@Override
protected String getDataVariableName()
{
return "_localCache";
}
@Override
protected String getIndexVariableNAme()
{
return "_iTemp";
}
}
| 9,604
|
https://github.com/Paulo09/core-jcloudbpmn/blob/master/src/war/js/menu.js
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
core-jcloudbpmn
|
Paulo09
|
JavaScript
|
Code
| 27
| 125
|
<script type="text/javascript">
$(document).ready(
function()
{
$('#dock').Fisheye(
{
maxWidth: 50,
items: 'a',
itemsText: 'span',
container: '.dock-container',
itemWidth: 40,
proximity: 90,
halign : 'center'
}
)
}
);
</script>
| 2,426
|
https://github.com/stefanodgr/recadm/blob/master/app/Http/Controllers/ReporteController.php
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
recadm
|
stefanodgr
|
PHP
|
Code
| 1,458
| 6,264
|
<?php
namespace App\Http\Controllers;
use Barryvdh\DomPDF\PDF;
use Illuminate\Support\Arr;
use Faker\Provider\DateTime;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Http\Controllers\Controller;
use App\Estado; //IMPORTANTE NOMBRE DE LA CLASE
use App\Person; //IMPORTANTE NOMBRE DE LA CLASE
use App\Municipio; //IMPORTANTE NOMBRE DE LA CLASE
use App\Parroquia; //IMPORTANTE NOMBRE DE LA CLASE
use App\Centervote; //IMPORTANTE NOMBRE DE LA CLASE
use App\Division;
use App\Position;
use App\Personvote;
use App\Personstructure;
class ReporteController extends Controller
{
/* AUTENTICADOR DE SESSION */
public function __construct(){
$this->middleware('auth');
}
/**
* MUESTRA LA VISTA DE EL LISTADO DE MILITANTES
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$estados = Estado::orderBY('descripcion','asc')->pluck('descripcion','id')->toArray();
$divisions = Division::orderBY('descripcion','asc')->pluck('descripcion','id')->toArray();
$centervotes = Centervote::orderBY('descripcion','asc')->pluck('descripcion','id')->toArray();
return view('admin.reportes.reporteListPerson',compact('estados','divisions','centervotes'));
}
/**
* MUESTRA LA VISTA DE EL LISTADO DE CENTRO DE VOTACION
*
* @return \Illuminate\Http\Response
*/
public function indexCenter()
{
$estados = Estado::orderBY('descripcion','asc')->pluck('descripcion','id')->toArray();
$centervotes = Centervote::orderBY('descripcion','asc')->pluck('descripcion','id')->toArray();
return view('admin.reportes.reporteListCenter',compact('estados','centervotes'));
}
/**
* MUESTRA LA VISTA DE EL LISTADO DE CENTRO DE VOTACION
*
* @return \Illuminate\Http\Response
*/
public function indexPerson()
{
// $estados = Estado::orderBY('descripcion','asc')->pluck('descripcion','id')->toArray();
// $centervotes = Centervote::orderBY('descripcion','asc')->pluck('descripcion','id')->toArray();
return view('admin.reportes.reportePerson');
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
public function validateFiltro(Request $request){
// dd("llego Controller");
$estado = $request->Estado;
$municipio = $request->Municipio;
$parroquia = $request->Parroquia;
$division = $request->Division;
$position = $request->Position;
$centervote = $request->CenterVote;
if($estado == '' & $municipio == '' & $parroquia == '' & $position == '' & $division == '' & $centervote == '' ){
$estado == null;
$municipio == null;
$parroquia == null;
$division == null;
$position == null;
$centervote == null;
}
// DD($centervote);
// dd($municipio );
// dd($municipio);
// dd($centervote);
if ($centervote <> null || $centervote <> '' ){
// dd($division);
$estados = Estado::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$divisions = Division::all();
$positions = Position::all();
$personstructures = Personstructure::all();
$personsvotes = Personvote::all();
$persons =Person::all();
$personsCenterVotes = Person::getPersonCenterVote($centervote);
$ldate = date('d-m-Y H:i:s');
//retun view(,compact($person));
// return view('admin.reportes.showListPersonCenter',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','personsCenterVotes'));
// return \response()->json($person,200);
$pdf = \PDF::loadView('admin.reportes.showListPersonCenter',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','personsCenterVotes','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download("Centro_Votacion_militante.pdf");
// return $pdf->stream();
}
if ($position <> null ){
// dd($division);
$estados = Estado::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$divisions = Division::all();
$positions = Position::all();
$personstructures = Personstructure::all();
$personsvotes = Personvote::all();
// $persons =Personstructure::where('division_id',$division)->get();
// $personsDivisions = :getPersonDivisions($division);
$personsPositions = Person::getPersonPositions($position);
// $datos = Arr::collapse([$personsDivisions->id]);
// dd($personsPositions);
$persons =Person::all();
// $persons = Person::getPersonPdf($personsDivision->person_id);
// dd($personsPositions);
if(!is_null($persons)){
//retun view(,compact($person));
// return view('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','personsPositions'));
$pdf = \PDF::loadView('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','personsPositions','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download("Division_Listado_militante.pdf");
// return $pdf->stream();
}
}
if ($division <> null ){
// dd($division);
$estados = Estado::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$divisions = Division::all();
$positions = Position::all();
$personstructures = Personstructure::all();
$personsvotes = Personvote::all();
// $persons =Personstructure::where('division_id',$division)->get();
// $personsDivisions = :getPersonDivisions($division);
$personsDivisions = Person::getPersonDivisions($division);
$persons =Person::all();
$ldate = date('d-m-Y H:i:s');
// $persons = Person::getPersonPdf($personsDivision->person_id);
if(!is_null($persons)){
//retun view(,compact($person));
// return view('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','personsDivisions'));
$pdf = \PDF::loadView('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','personsDivisions','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download("Division_Listado_militante.pdf");
// return $pdf->stream();
}
}
if($estado == null && $municipio == null && $parroquia == null && $division == null && $position == null ){
$estados = Estado::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$divisions = Division::all();
$positions = Position::all();
$personstructures = Personstructure::all();
$personsvotes = Personvote::all();
$persons = Person::all();
$ldate = date('d-m-Y H:i:s');
// return view('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','ldate'));
$pdf = \PDF::loadView('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download("Todos_Listado_militante.pdf");
// return $pdf->stream();
}else if ($municipio == null){
$estados = Estado::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$personstructures = Personstructure::all();
$personsvotes = Personvote::all();
$persons = Person::getPersonPdfEstado($estado);
foreach ($estados as $estado){
if($estado->id == $estado->id){
$name_estado=$estado->descripcion;
}
}
$ldate = date('d-m-Y H:i:s');
// dd($nombre);
if(!is_null($persons)){
//retun view(,compact($person));
// return view('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions'));
$pdf = \PDF::loadView('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download($name_estado."_Listado_militante.pdf");
// return $pdf->stream();
}
}else if($parroquia == null){
$estados = Estado::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$personstructures = Personstructure::all();
$personsvotes = Personvote::all();
$divisions = Division::all();
$positions = Position::all();
$persons = Person::getPersonPdfMunicipio($estado,$municipio);
foreach ($estados as $estado){
if($estado->id == $estado->id){
$name_estado=$estado->descripcion;
}
}
foreach ($municipios as $municipio){
if($municipio->id == $municipio->id){
$name_municipio=$municipio->descripcion;
}
}
$ldate = date('d-m-Y H:i:s');
// dd($persons);
if(!is_null($persons)){
//retun view(,compact($person));
// return view('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions'));
// return \response()->json($person,200);
$pdf = \PDF::loadView('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download($name_estado."-".$name_municipio."_Listado_militante.pdf");
// return $pdf->stream();
}
}else if ($parroquia <> null){
$estados = Estado::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$divisions = Division::all();
$positions = Position::all();
$personstructures = Personstructure::all();
$personsvotes = Personvote::all();
$persons = Person::getPersonPdfParroquia($estado,$municipio,$parroquia);
foreach ($estados as $estado){
if($estado->id == $estado->id){
$name_estado=$estado->descripcion;
}
}
foreach ($municipios as $municipio){
if($municipio->id == $municipio->id){
$name_municipio=$municipio->descripcion;
}
}
foreach($persons as $person){
foreach ($parroquias as $parroquia){
if($person->parroquia_id == $parroquia->id){
$name_parroquia=$parroquia->descripcion;
}
}
}
$ldate = date('d-m-Y H:i:s');
// dd($persons);
if(!is_null($persons)){
//retun view(,compact($person));
// return view('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions'));
$pdf = \PDF::loadView('admin.reportes.showListPerson',compact('persons','personstructures','personsvotes','estados','municipios','parroquias','divisions','positions','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download($name_estado."-".$name_municipio."-".$name_parroquia."_Listado_militante.pdf");
// return $pdf->stream();
}
}
}
public function validateFiltroCentro(Request $request){
// dd("llego Controller");
$estado_filtro = $request->Estado;
$municipio_filtro = $request->Municipio;
$parroquia_filtro = $request->Parroquia;
if($estado_filtro == '' ){
$estado_filtro == null;
}
if($municipio_filtro == ''){
$municipio_filtro == null;
}
if($parroquia_filtro == ''){
$parroquia_filtro == null;
}
if($estado_filtro == null && $municipio_filtro == null && $parroquia_filtro == null ){
$estados = Estado::all();
$centervotes = Centervote::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$ldate = date('d-m-Y H:i:s');
// dd($persons);
$pdf = \PDF::loadView('admin.reportes.showListCenter',compact('centervotes','municipios','parroquias','estados','parroquia_filtro','estado_filtro','municipio_filtro','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download("Centro_Votacion_Todos.pdf");
// return $pdf->stream();
}else if($estado_filtro <> null && $municipio_filtro == null && $parroquia_filtro == null){
$estados = Estado::all();
$centervotes = Centervote::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$ldate = date('d-m-Y H:i:s');
$centro_estados = Centervote::getCenterVotesEstado($estado_filtro);
$estadoID= Estado::find($estado_filtro);
$pdf = \PDF::loadView('admin.reportes.showListCenter',compact('centervotes','municipios','parroquias','estados','parroquia_filtro','estado_filtro','municipio_filtro','centro_estados','ldate'));
// return view
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download("Centro_Votacion_".$estadoID->descripcion.".pdf");
// return $pdf->stream();
}else if($estado_filtro <> null && $municipio_filtro <> null && $parroquia_filtro == null){
$estados = Estado::all();
$centervotes = Centervote::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$centro_municipios = Centervote::getCenterVotesMunicipio($estado_filtro,$municipio_filtro);
$estadoID = Estado::find($estado_filtro);
$municipioID = Municipio::find($municipio_filtro);
$ldate = date('d-m-Y H:i:s');
$pdf = \PDF::loadView('admin.reportes.showListCenter',compact('centervotes','municipios','parroquias','estados','parroquia_filtro','estado_filtro','municipio_filtro','centro_municipios','ldate'));
// return view('admin.reportes.showListCenter',compact('centervotes','municipios','parroquias','estados','parroquia_filtro','estado_filtro','municipio_filtro','centro_municipios'));
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download("Centro_Votacion_".$estadoID->descripcion."_".$municipioID->descripcion.".pdf");
// return $pdf->stream();
}else if($estado_filtro <> null && $municipio_filtro <> null && $parroquia_filtro <> null){
$estados = Estado::all();
$centervotes = Centervote::all();
$municipios = Municipio::all();
$parroquias = Parroquia::all();
$centro_parroquias = Centervote::getCenterVotesParroquia($estado_filtro,$municipio_filtro,$parroquia_filtro);
$estadoID = Estado::find($estado_filtro);
$municipioID = Municipio::find($municipio_filtro);
$parroquiaID = Parroquia::find($parroquia_filtro);
$ldate = date('d-m-Y H:i:s');
// return view('admin.reportes.showListCenter',compact('centervotes','municipios','parroquias','estados','parroquia_filtro','estado_filtro','municipio_filtro','centro_parroquias'));
$pdf = \PDF::loadView('admin.reportes.showListCenter',compact('centervotes','municipios','parroquias','estados','parroquia_filtro','estado_filtro','municipio_filtro','centro_parroquias','ldate'));
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download("Centro_Votacion_".$estadoID->descripcion."_".$municipioID->descripcion."_".$parroquiaID->descripcion.".pdf");
// return $pdf->stream();
}
}
public function validatePersonFiltro(Request $request){
$cedula = $request->cedula;
$nacionalidad = $request->nacionalidad;
$documento = $nacionalidad."-".$cedula;
$ldate = date('d-m-Y H:i:s');
$personstrus = Personstructure::all();
$divisions = Division::all();
$positions = Position::all();
$personData = Person::getPersonExist($cedula,$nacionalidad);
$person = Person::find($personData->id);
if(!is_null($person)){
$pdf = \PDF::loadView('admin.reportes.showPerson', compact('person','personstrus','divisions','positions','ldate'));
// If you want to store the generated pdf to the server then you can use the store function
$pdf->save(storage_path().'_filename.pdf');
// // Finally, you can download the file using download function
return $pdf->download($documento."_militante.pdf");
// return $pdf->stream();
}else{
session()->flash('message',"Disculpe no hemos encontrado a la persona");
return back();
}
}
}
| 29,266
|
https://github.com/RobinK2/FRC/blob/master/FRC-FencingResultConverter/FRC-FencingResultConverter/FRCPouleRound.cs
|
Github Open Source
|
Open Source
|
MIT
| null |
FRC
|
RobinK2
|
C#
|
Code
| 1,443
| 4,015
|
#region PDFsharp - A .NET library for processing PDF
//
// Copyright (c) 2005-2012 empira Software GmbH, Troisdorf (Germany)
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FRC_FencingResultConverter
{
public class FRCPouleRound
{
//The round of the poule.
private int roundNumber;
//The amount of poules.
private int numOfPoules;
//The amount of fencer qualifying from this round of poule.
private int numOfQualifiers;
//List of all fencers during this poule round.
private List<FRCFencer> fencer = new List<FRCFencer>();
//List of all teams during this poule round.
private List<FRCTeam> team = new List<FRCTeam>();
//List of all poules during this poule round.
private List<FRCPoule> poule = new List<FRCPoule>();
//Index for list of fencers.
private int fencerIdx = -1;
//Index for list of teams.
private int teamIdx = -1;
//Index for list of poules.
private int pouleIdx = -1;
public FRCPouleRound()
{
}
public FRCPouleRound(int roundNumber, int numOfPoules, int numOfQualifiers)
{
this.roundNumber = roundNumber;
this.numOfPoules = numOfPoules;
this.numOfQualifiers = numOfQualifiers;
}
/// <summary>
/// Add a poule to the poule round.
/// </summary>
/// <param name="poule"></param>
public void addPoule(FRCPoule poule)
{
this.poule.Add(poule);
}
/// <summary>
/// Returns poule at current index.
/// </summary>
/// <returns></returns>
public FRCPoule getCurrentPoule()
{
if (pouleIdx >= poule.Count)
return null;
return poule[pouleIdx];
}
/// <summary>
/// Returns poule at next index. Starting at the first poule in the list.
/// </summary>
/// <returns></returns>
public FRCPoule getNextPoule()
{
pouleIdx++;
if (pouleIdx >= poule.Count)
pouleIdx = 0;
if (pouleIdx < poule.Count)
return poule[pouleIdx];
return null;
}
/// <summary>
/// Returns amount of poules.
/// </summary>
/// <returns></returns>
public int amountOfPoules()
{
return poule.Count;
}
/// <summary>
/// Returns true if the list of poules has next element.
/// </summary>
/// <returns></returns>
public bool hasNextPoule()
{
if (pouleIdx + 1 < poule.Count)
return true;
else
{
pouleIdx = -1;
return false;
}
}
/// <summary>
/// Add a team to the poule round.
/// </summary>
/// <param name="team"></param>
public void addTeam(FRCTeam team)
{
this.team.Add(team);
}
/// <summary>
/// Returns team at next index.
/// </summary>
/// <returns></returns>
public FRCTeam getNextTeam()
{
teamIdx++;
if (teamIdx >= team.Count)
teamIdx = 0;
if (teamIdx < team.Count)
return team[teamIdx];
return null;
}
/// <summary>
/// Returns amount of teams.
/// </summary>
/// <returns></returns>
public int amountOfTeams()
{
return team.Count;
}
/// <summary>
/// Sorts team after their ranking after this poule round (PhaseFinalRanking). Lowest number first.
/// </summary>
public void sortTeamPouleRanking()
{
for (int i = 0; i < team.Count - 1; i++)
for (int j = i + 1; j < team.Count; j++)
{
if (team[i].PhaseFinalRanking > team[j].PhaseFinalRanking)
{
FRCTeam tempteam = team[j];
team[j] = team[i];
team[i] = tempteam;
}
}
}
/// <summary>
/// Returns true if the list of teams has next element.
/// </summary>
/// <returns></returns>
public bool hasNextTeam()
{
if (teamIdx + 1 < team.Count)
return true;
else
{
teamIdx = -1;
return false;
}
}
/// <summary>
/// Resets teamIdx.
/// </summary>
public void resetTeamIndex()
{
teamIdx = -1;
}
/// <summary>
/// Add a fencer to the poule round.
/// </summary>
/// <param name="fenc"></param>
public void addFencer(FRCFencer fencer)
{
this.fencer.Add(fencer);
}
/*
/// <summary>
/// Returns fencer at current index.
/// </summary>
/// <returns></returns>
public FRCFencer getCurrentFencer()
{
if (fencerIdx >= fencer.Count)
return null;
return fencer[fencerIdx];
}
*/
/// <summary>
/// Copies poule result information from given fencer to fencer in this poule round.
/// </summary>
public void CopyPouleResult(FRCFencer fencer)
{
for (int i = 0; i < this.fencer.Count; i++)
{
if (fencer.ID == this.fencer[i].ID)
{
this.fencer[i].HitsGivenInPoule = fencer.HitsGivenInPoule;
this.fencer[i].HitsTakenInPoule = fencer.HitsTakenInPoule;
this.fencer[i].NumberOfMatchesInPoule = fencer.NumberOfMatchesInPoule;
this.fencer[i].NumberOfVictoriesInPoule = fencer.NumberOfVictoriesInPoule;
this.fencer[i].VM = fencer.VM;
this.fencer[i].Forfait = fencer.Forfait;
this.fencer[i].Abandoned = fencer.Abandoned;
this.fencer[i].Excluded = fencer.Excluded;
this.fencer[i].VM_String = fencer.VM_String;
break;
}
}
}
/// <summary>
/// Returns fencer at next index.
/// </summary>
/// <returns></returns>
public FRCFencer getNextFencer()
{
fencerIdx++;
if (fencerIdx >= fencer.Count)
fencerIdx = 0;
if (fencerIdx < fencer.Count)
return fencer[fencerIdx];
return null;
}
/// <summary>
/// Returns amount of fencers.
/// </summary>
/// <returns></returns>
public int amountOfFencers()
{
return fencer.Count;
}
/// <summary>
/// Calculates PhaseFinalRanking for all fencer in this poule. (This function adjusts PhaseFinalRanking to correct value)
/// Needed if the format is QualifyLastRankAll.
/// Since EnGarde changed the meaning of PhaseFinalRanking, it is good to use this function always in anyway. (In fact used always now)
/// </summary>
public void calculateFencerPouleRanking()
{
//Save excluded, scratched and abandoned fencers in this list.
List<FRCFencer> excScrAbbFencers = new List<FRCFencer>();
double highestVM;
int highestIND, highestHGiven;
int rank = 1;
//Does not use the element in these sorted list at all actually, the key is the only important part since it becomes sorted.
SortedList<double, FRCFencer> vmList = new SortedList<double, FRCFencer>();
SortedList<int, FRCFencer> indList = new SortedList<int, FRCFencer>();
SortedList<int, FRCFencer> hGivenList = new SortedList<int, FRCFencer>();
List<FRCFencer> tempFencer = new List<FRCFencer>();
for (int i = 0; i < fencer.Count; i++)
{
tempFencer.Add((FRCFencer) fencer[i].Clone());
}
while (tempFencer.Count > 0)
{
//Counts fencers with same ranking.
int sameRankCounter = 0;
//Searches for highest VM.
for (int i = 0; i < tempFencer.Count; i++)
{
tempFencer[i].VM = (double)tempFencer[i].NumberOfVictoriesInPoule /
(double)tempFencer[i].NumberOfMatchesInPoule;
//When the XML-file is weird 0/0 occurs.
if (double.IsNaN(tempFencer[i].VM))
tempFencer[i].VM = 0.0;
vmList[tempFencer[i].VM] = (FRCFencer)tempFencer[i].Clone();
}
highestVM = vmList.Keys[vmList.Count - 1];
//Searches for highest index.
for (int i = 0; i < tempFencer.Count; i++)
{
if (tempFencer[i].VM == highestVM)
{
tempFencer[i].Index = tempFencer[i].HitsGivenInPoule -
tempFencer[i].HitsTakenInPoule;
indList[tempFencer[i].Index] = (FRCFencer)tempFencer[i].Clone();
}
}
highestIND = indList.Keys[indList.Count - 1];
//Searches for highest given hits.
for (int i = 0; i < tempFencer.Count; i++)
{
if (tempFencer[i].VM == highestVM)
if (tempFencer[i].Index == highestIND)
{
hGivenList[tempFencer[i].HitsGivenInPoule] = (FRCFencer)tempFencer[i].Clone();
}
}
highestHGiven = hGivenList.Keys[hGivenList.Count - 1];
for (int i = 0; i < tempFencer.Count; i++)
{
if (tempFencer[i].VM == highestVM)
if (tempFencer[i].Index == highestIND)
if (tempFencer[i].HitsGivenInPoule == highestHGiven)
{
//The abandoned, excluded and scratched fencers must be added at the end of the list.
if (tempFencer[i].Abandoned || tempFencer[i].Excluded ||
tempFencer[i].Forfait)
{
excScrAbbFencers.Add(tempFencer[i]);
tempFencer.RemoveAt(i);
}
else
{
//tempFencer[i].PhaseFinalRanking = rank;
for (int j = 0; j < fencer.Count; j++)
{
if (fencer[j].ID == tempFencer[i].ID) {
fencer[j].PhaseFinalRanking = rank;
break;
}
}
tempFencer.RemoveAt(i);
sameRankCounter++;
}
}
}
vmList.Clear();
indList.Clear();
hGivenList.Clear();
rank += sameRankCounter;
}
//Add all abandoned, scratched and excluded fencers at the end.
for (int i = 0; i < excScrAbbFencers.Count; i++)
{
//excScrAbbFencers[i].PhaseFinalRanking = rank;
for (int j = 0; j < fencer.Count; j++)
{
if (fencer[j].ID == excScrAbbFencers[i].ID){
fencer[j].PhaseFinalRanking = rank;
break;
}
}
rank++;
}
excScrAbbFencers.Clear();
tempFencer.Clear();
}
/// <summary>
/// Sorts fencer after their ranking after this poule round (PhaseFinalRanking). Lowest number first.
/// </summary>
public void sortFencerPouleRanking()
{
for (int i = 0; i < fencer.Count - 1; i++)
for (int j = i + 1; j < fencer.Count; j++)
{
if (fencer[i].PhaseFinalRanking > fencer[j].PhaseFinalRanking)
{
FRCFencer tempFencer = fencer[j];
fencer[j] = fencer[i];
fencer[i] = tempFencer;
}
}
}
/// <summary>
/// Returns true if the list of fencers has next element.
/// </summary>
/// <returns></returns>
public bool hasNextFencer()
{
if (fencerIdx + 1 < fencer.Count)
return true;
else
{
fencerIdx = -1;
return false;
}
}
/// <summary>
/// Resets fencerIdx.
/// </summary>
public void resetFencerIndex()
{
fencerIdx = -1;
}
/// <summary>
/// Property for the round number.
/// </summary>
public int RoundNumber
{
set { roundNumber = value; }
get { return roundNumber; }
}
/// <summary>
/// Property for the amount of poules during the round.
/// </summary>
public int NumOfPoules
{
set { numOfPoules = value; }
get { return numOfPoules; }
}
/// <summary>
/// Property for amount fencers qualifying after this round.
/// </summary>
public int NumOfQualifiers
{
set { numOfQualifiers = value; }
get { return numOfQualifiers; }
}
}
}
| 23,703
|
https://github.com/WallysonGalvao/meals-to-go/blob/master/src/services/index.tsx
|
Github Open Source
|
Open Source
|
LicenseRef-scancode-unknown-license-reference, MIT
| 2,021
|
meals-to-go
|
WallysonGalvao
|
TSX
|
Code
| 56
| 194
|
import React from 'react';
import { AuthenticationProvider } from './authentication/authentication.context';
import { FavouritesProvider } from './favourites/favourites.context';
import { LocationProvider } from './location/location.context';
import { RestaurantsProvider } from './restaurants/restaurants.context';
import { CartContextProvider } from './cart/cart.context';
const AppProvider: React.FC = ({ children }) => (
<AuthenticationProvider>
<FavouritesProvider>
<LocationProvider>
<RestaurantsProvider>
<CartContextProvider>{children}</CartContextProvider>
</RestaurantsProvider>
</LocationProvider>
</FavouritesProvider>
</AuthenticationProvider>
);
export default AppProvider;
| 16,677
|
https://github.com/zihui89w/leigun/blob/master/modules/softgun/devices/i2c/pca9544.h
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
leigun
|
zihui89w
|
C
|
Code
| 24
| 80
|
/*
**********************************************************************************
*
* Interface definition for Emulation of PCA9544 4-channel I2C-Multiplexer
*
**********************************************************************************
*/
#include "i2c.h"
I2C_Slave *PCA9544_New(char *name);
typedef struct PCA9544 PCA9544;
| 35,577
|
https://github.com/TimWhiting/commons/blob/master/lib/html.dart
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
commons
|
TimWhiting
|
Dart
|
Code
| 191
| 597
|
//Copyright (C) 2015 Potix Corporation. All Rights Reserved.
//History: Sat Jun 27 23:11:53 CST 2015
// Author: tomyeh
library rikulo_html;
import "dart:html";
import "util.dart" show XmlUtil;
///An allow-everyting [NodeValidator].
class NullNodeValidator implements NodeValidator {
const NullNodeValidator();
@override
bool allowsElement(Element element) => true;
@override
bool allowsAttribute(Element element, String attributeName, String value) => true;
}
///An allow-everyting [NodeValidatorBuilder].
class NullNodeValidatorBuilder extends NullNodeValidator
implements NodeValidatorBuilder {
const NullNodeValidatorBuilder();
@override
void allowNavigation([UriPolicy? uriPolicy]) {}
@override
void allowImages([UriPolicy? uriPolicy]) {}
@override
void allowTextElements() {}
@override
void allowInlineStyles({String? tagName}) {}
@override
void allowHtml5({UriPolicy? uriPolicy}) {}
@override
void allowSvg() {}
@override
void allowCustomElement(String tagName,
{UriPolicy? uriPolicy,
Iterable<String>? attributes,
Iterable<String>? uriAttributes}) {}
@override
void allowTagExtension(String tagName, String baseName,
{UriPolicy? uriPolicy,
Iterable<String>? attributes,
Iterable<String>? uriAttributes}) {}
@override
void allowElement(String tagName, {UriPolicy? uriPolicy,
Iterable<String>? attributes,
Iterable<String>? uriAttributes}) {}
@override
void allowTemplating() {}
@override
void add(NodeValidator validator) {}
}
/// Set inner html with an empty tree sanitizer
void setUncheckedInnerHtml(Element element, String html,
{bool encode: false}) {
if (encode)
html = XmlUtil.encode(html);
element.setInnerHtml(html, treeSanitizer: NodeTreeSanitizer.trusted);
}
/// Creates an element with an empty tree sanitizer.
Element createUncheckedHtml(String html, {bool encode: false}) {
if (encode)
html = XmlUtil.encode(html);
return Element.html(html, treeSanitizer: NodeTreeSanitizer.trusted);
}
| 12,553
|
https://github.com/huangfeng19820712/hfast/blob/master/core/js/editors/TouchSpinEditor.js
|
Github Open Source
|
Open Source
|
MIT
| null |
hfast
|
huangfeng19820712
|
JavaScript
|
Code
| 131
| 573
|
/**
* @author: * @date: 2016/2/26
*/
define([
"core/js/CommonConstant",
"core/js/editors/Editor",
"bootstrap.touchspin"
], function ( CommonConstant, Editor) {
var TouchSpinEditor = Editor.extend({
xtype: $Component.TOUCHSPINEDITOR,
type: "component",
decimals: null,
step: 1,//增量或减量
stepinterval: null,
size: null,
prefix:null,
postfix:null,
/**
* 是否不显示up于down的按钮
*/
displayButtons: false,
_init$Input: function () {
//初始化input对象
if (!this.$input) {
this.$input = $($Template.Input.SIMPLE);
}
this._super();
this.$controlGroup.addClass("input-group touchSpin");
this.$controlGroup.attr("id", this.id + "-input-group");
},
/**
* 初始化组件
* @private
*/
_initWithPlugIn: function () {
var conf = {
maxboostedstep: 10000000,
prefix: this.prefix||'',
postfix:this.postfix ||''
};
if (this.min) {
conf.min = this.min || this.rules.min;
}
if (this.max) {
conf.max = this.max || this.rules.max;
}
if (this.decimals) {
conf.decimals = this.decimals;
}
this.$input.TouchSpin(conf);
if (this.displayButtons) {
this.$el.find(".bootstrap-touchspin-down").parent().css("display","none");
this.$el.find(".bootstrap-touchspin-up").parent().css("display","none");
this.$controlGroup.width("100%");
}
},
});
TouchSpinEditor.size = {
/**
*
*/
lg: "input-group-lg",
sm: "input-group-sm",
};
return TouchSpinEditor;
})
| 4,210
|
https://github.com/ronjb/float_column/blob/master/lib/src/wrappable_text.dart
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
float_column
|
ronjb
|
Dart
|
Code
| 749
| 1,668
|
// Copyright (c) 2021 Ron Booth. All rights reserved.
// Use of this source code is governed by a license that can be found in the
// LICENSE file.
import 'dart:ui' as ui show TextHeightBehavior;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'shared.dart';
///
/// An immutable span of inline content which forms a paragraph. Only useful as
/// a child of a `FloatColumn`, which provides the capability of wrapping the
/// paragraph around child widgets that "float" to the right or left.
///
@immutable
class WrappableText {
/// Creates a paragraph of rich text, that when used in a `FloatColumn` can
/// wrap around floated siblings.
///
/// The [text], [clear], [textAlign], [indent], and [textScaleFactor]
/// arguments must not be null.
///
/// The [textDirection], if null, defaults to the ambient `Directionality`,
/// which in that case must not be null.
const WrappableText({
this.key,
required this.text,
this.clear = FCClear.none,
this.textAlign,
this.textDirection,
this.textScaleFactor,
this.locale,
this.strutStyle,
this.textHeightBehavior,
this.indent = 0.0,
this.margin = EdgeInsets.zero,
this.padding = EdgeInsets.zero,
}) : assert(
text != null, // ignore: unnecessary_null_comparison
'A non-null TextSpan must be provided to a WrappableText.',
);
WrappableText copyWith({
Key? key,
TextSpan? text,
FCClear? clear,
TextAlign? textAlign,
TextDirection? textDirection,
double? textScaleFactor,
Locale? locale,
StrutStyle? strutStyle,
ui.TextHeightBehavior? textHeightBehavior,
double? indent,
EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
}) =>
WrappableText(
key: key ?? this.key,
text: text ?? this.text,
clear: clear ?? this.clear,
textAlign: textAlign ?? this.textAlign,
textDirection: textDirection ?? this.textDirection,
textScaleFactor: textScaleFactor ?? this.textScaleFactor,
locale: locale ?? this.locale,
strutStyle: strutStyle ?? this.strutStyle,
textHeightBehavior: textHeightBehavior ?? this.textHeightBehavior,
indent: indent ?? this.indent,
margin: margin ?? this.margin,
padding: padding ?? this.padding,
);
/// Unique key for this object.
final Key? key;
/// The text to display in this widget.
final TextSpan text;
/// Should this paragraph "clear" (i.e. be placed below) floated siblings?
/// And if so, should it be placed below floated siblings on just one side
/// (`left`, `right`, `start`, or `end`) or `both`? The default is `none`.
final FCClear clear;
/// How the text should be aligned horizontally.
final TextAlign? textAlign;
/// The directionality of the text.
///
/// This decides how [textAlign] values like [TextAlign.start] and
/// [TextAlign.end] are interpreted.
///
/// This is also used to disambiguate how to render bidirectional text. For
/// example, if the [text] is an English phrase followed by a Hebrew phrase,
/// in a [TextDirection.ltr] context the English phrase will be on the left
/// and the Hebrew phrase to its right, while in a [TextDirection.rtl]
/// context, the English phrase will be on the right and the Hebrew phrase
/// on its left.
///
/// Defaults to the ambient `Directionality`, if any. If there is no ambient
/// `Directionality`, then this must not be null.
final TextDirection? textDirection;
/// The number of font pixels for each logical pixel.
///
/// For example, if the text scale factor is 1.5, text will be 50% larger
/// than the specified font size.
///
/// The value given to the constructor as textScaleFactor. If null, will
/// use the [MediaQueryData.textScaleFactor] obtained from the ambient
/// [MediaQuery], or 1.0 if there is no [MediaQuery] in scope.
final double? textScaleFactor;
/// Used to select a font when the same Unicode character can be rendered
/// differently, depending on the locale.
///
/// It's rarely necessary to set this property. By default its value
/// is inherited from the enclosing app with Localizations.localeOf(context).
///
/// See [RenderParagraph.locale] for more information.
final Locale? locale;
/// {@macro flutter.painting.textPainter.strutStyle}
final StrutStyle? strutStyle;
/// {@macro flutter.dart:ui.textHeightBehavior}
final ui.TextHeightBehavior? textHeightBehavior;
/// First line indent value. Defaults to zero. If it is negative, the text is
/// laid out with a hanging indent.
final double indent;
/// Empty space to surround the paragraph. Similar to CSS, the top overlaps
/// the previous sibling's bottom margin, the bottom overlaps the next
/// sibling's top margin, and the left and right overlap floated siblings.
final EdgeInsetsGeometry margin;
/// Empty space to surround the paragraph that does not overlap siblings.
final EdgeInsetsGeometry padding;
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other.runtimeType != runtimeType) return false;
return other is WrappableText &&
other.key == key &&
other.text == text &&
other.clear == clear &&
other.textAlign == textAlign &&
other.textDirection == textDirection &&
other.textScaleFactor == textScaleFactor &&
other.locale == locale &&
other.strutStyle == strutStyle &&
other.textHeightBehavior == textHeightBehavior &&
other.indent == indent &&
other.margin == margin &&
other.padding == padding;
}
@override
int get hashCode => hashValues(
key,
text,
clear,
textAlign,
textDirection,
textScaleFactor,
locale,
strutStyle,
textHeightBehavior,
indent,
margin,
padding);
}
| 21,496
|
https://github.com/Solace-RND-Demo-Team1/demo-app/blob/master/Assets/Prefabs/MonsterTruckPlayerDamage.prefab
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
demo-app
|
Solace-RND-Demo-Team1
|
Unity3D Asset
|
Code
| 6,324
| 28,369
|
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1857226130382042}
m_IsPrefabParent: 1
--- !u!1 &1046544902985970
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4593123243770614}
- component: {fileID: 33499725693037430}
- component: {fileID: 23402186737512064}
m_Layer: 0
m_Name: TruckBody
m_TagString: Player
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1070891394675296
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4895753392556396}
- component: {fileID: 33895297106581732}
- component: {fileID: 65480946218316288}
- component: {fileID: 23659840325317622}
m_Layer: 0
m_Name: ColliderBody
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1085172318406224
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4826985682407860}
- component: {fileID: 33740977160727180}
- component: {fileID: 23521489994353434}
m_Layer: 0
m_Name: Tire_Back_R2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1156937635815710
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4319148401301890}
m_Layer: 0
m_Name: Tires
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1189333964202306
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4406269203410272}
- component: {fileID: 33917038044192288}
- component: {fileID: 65105583549259632}
- component: {fileID: 23087358167589530}
m_Layer: 0
m_Name: damage1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1197674135003698
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4945674020586434}
m_Layer: 0
m_Name: WheelsHubs
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1211557922848192
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4468202074437718}
- component: {fileID: 33402360564346072}
- component: {fileID: 65766350941787712}
- component: {fileID: 23723249130265990}
m_Layer: 0
m_Name: ColliderBodyDamage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1240645431737382
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4435688826682910}
- component: {fileID: 33672187417434540}
- component: {fileID: 65158388680007434}
- component: {fileID: 23245526824273628}
m_Layer: 0
m_Name: damage2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1243488340986224
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4264974231859590}
- component: {fileID: 33815737140750034}
- component: {fileID: 23674397279562138}
m_Layer: 0
m_Name: Tire_Front_L2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1310032646805766
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4514215577628240}
- component: {fileID: 33422554346592980}
- component: {fileID: 65908351738424000}
- component: {fileID: 23647784139769270}
m_Layer: 0
m_Name: ColliderBodyDamage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1336216216481782
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4358214856693892}
- component: {fileID: 33454934036444670}
- component: {fileID: 65502246075845822}
- component: {fileID: 23283799572250338}
m_Layer: 0
m_Name: BumperCollider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1387063847067234
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4376555506127498}
- component: {fileID: 146063661055033422}
- component: {fileID: 82871011334131398}
- component: {fileID: 114396446464560588}
m_Layer: 0
m_Name: WheelHubRearRight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1457849699718324
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4923659787192684}
m_Layer: 0
m_Name: Colliders
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1465508660025824
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4716344336611524}
- component: {fileID: 146728592086290882}
- component: {fileID: 82362021704552190}
- component: {fileID: 114425275050860992}
m_Layer: 0
m_Name: WheelHubRearLeft
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1474496948345704
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4229433679952698}
- component: {fileID: 146958425913048222}
- component: {fileID: 82854408235463576}
- component: {fileID: 114737130551786110}
m_Layer: 0
m_Name: WheelHubFrontLeft
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1514939199385624
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4464390724350388}
- component: {fileID: 146535371644503506}
- component: {fileID: 82349243801841746}
- component: {fileID: 114000975641147740}
m_Layer: 0
m_Name: WheelHubFrontRight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1599872247099710
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4478906517706370}
- component: {fileID: 33473641951565406}
- component: {fileID: 65615069345296470}
- component: {fileID: 23671616204650876}
m_Layer: 0
m_Name: BumperCollider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1678712245086072
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4005411319715288}
- component: {fileID: 33247143067274140}
- component: {fileID: 65564414693862018}
- component: {fileID: 23606883909975996}
m_Layer: 0
m_Name: damage3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1750729987499154
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4185526619490336}
- component: {fileID: 33217040370117572}
- component: {fileID: 23501451202958312}
m_Layer: 0
m_Name: Tire_Back_L2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1818914004592680
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4837406182121158}
- component: {fileID: 33981836943493718}
- component: {fileID: 65067532959555996}
- component: {fileID: 23361828628339078}
m_Layer: 0
m_Name: ColliderFront
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1857226130382042
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4729005500470268}
- component: {fileID: 54161230111937074}
- component: {fileID: 114794759077342572}
- component: {fileID: 114572692524163126}
- component: {fileID: 114341158047890102}
- component: {fileID: 114912630960119962}
- component: {fileID: 82309282660021480}
- component: {fileID: 82253751474767426}
- component: {fileID: 82579799010515750}
- component: {fileID: 82722421198234604}
- component: {fileID: 114385658851050544}
m_Layer: 0
m_Name: MonsterTruckPlayerDamage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1891961280013378
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4756136857004012}
- component: {fileID: 33189639815598188}
- component: {fileID: 65597730239171540}
- component: {fileID: 23848283662693136}
m_Layer: 0
m_Name: ColliderBottom
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1924722859767966
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4173158667000744}
- component: {fileID: 33539806340394506}
- component: {fileID: 23786824366511058}
m_Layer: 0
m_Name: Tire_Front_R2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4005411319715288
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1678712245086072}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.35, y: 3.3200004, z: 0}
m_LocalScale: {x: 1.0000001, y: 1.0000001, z: 1.0000001}
m_Children: []
m_Father: {fileID: 4729005500470268}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4173158667000744
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1924722859767966}
m_LocalRotation: {x: -0.9981867, y: -0, z: -0, w: 0.06019527}
m_LocalPosition: {x: 0.52100027, y: 0.28733295, z: 0.86499953}
m_LocalScale: {x: 2, y: 1.1, z: 1.1}
m_Children: []
m_Father: {fileID: 4319148401301890}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4185526619490336
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1750729987499154}
m_LocalRotation: {x: 0.9181084, y: -0, z: -0, w: 0.39632925}
m_LocalPosition: {x: -0.52300096, y: 0.43391606, z: -0.7139999}
m_LocalScale: {x: 2, y: 1.1, z: 1.1}
m_Children: []
m_Father: {fileID: 4319148401301890}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4229433679952698
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1474496948345704}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.524, y: -0.356, z: 0.739}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4945674020586434}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4264974231859590
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1243488340986224}
m_LocalRotation: {x: 0.26045293, y: 0.000000089406946, z: -1.7763564e-15, w: -0.9654865}
m_LocalPosition: {x: -0.5139999, y: 0.28733242, z: 0.8590004}
m_LocalScale: {x: 2, y: 1.1, z: 1.1}
m_Children: []
m_Father: {fileID: 4319148401301890}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4319148401301890
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1156937635815710}
m_LocalRotation: {x: 0.0000000110203855, y: -0.7071068, z: 0.0000000110203855, w: 0.7071068}
m_LocalPosition: {x: 0.36, y: -2.83, z: -0.03}
m_LocalScale: {x: 3, y: 3, z: 3}
m_Children:
- {fileID: 4185526619490336}
- {fileID: 4826985682407860}
- {fileID: 4264974231859590}
- {fileID: 4173158667000744}
m_Father: {fileID: 4593123243770614}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4358214856693892
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1336216216481782}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.0070002056, y: -0.167, z: 1.31}
m_LocalScale: {x: 0.9722914, y: 0.3442488, z: 0.032077603}
m_Children: []
m_Father: {fileID: 4923659787192684}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4376555506127498
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1387063847067234}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.503, y: -0.356, z: -0.834}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4945674020586434}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4406269203410272
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1189333964202306}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.06, y: 3.32, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4729005500470268}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4435688826682910
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1240645431737382}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.23, y: 3.3200002, z: 0}
m_LocalScale: {x: 1.0000001, y: 1.0000001, z: 1.0000001}
m_Children: []
m_Father: {fileID: 4729005500470268}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4464390724350388
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1514939199385624}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.511, y: -0.356, z: 0.745}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4945674020586434}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4468202074437718
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1211557922848192}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5, y: 0.19600004, z: 0.03}
m_LocalScale: {x: 0.04861482, y: 0.81000006, z: 2.052963}
m_Children: []
m_Father: {fileID: 4923659787192684}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4478906517706370
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1599872247099710}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.0070002056, y: -0.16700003, z: -1.289}
m_LocalScale: {x: 0.9722914, y: 0.3442494, z: 0.032076545}
m_Children: []
m_Father: {fileID: 4923659787192684}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4514215577628240
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1310032646805766}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.51, y: 0.19600001, z: -0.04}
m_LocalScale: {x: 0.048614595, y: 0.81000006, z: 2.052963}
m_Children: []
m_Father: {fileID: 4923659787192684}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4593123243770614
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1046544902985970}
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4319148401301890}
m_Father: {fileID: 4729005500470268}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!4 &4716344336611524
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1465508660025824}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.533, y: -0.356, z: -0.834}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4945674020586434}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4729005500470268
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -88.94, y: 1.18, z: -75.95}
m_LocalScale: {x: 1.35, y: 1.35, z: 1.35}
m_Children:
- {fileID: 4923659787192684}
- {fileID: 4945674020586434}
- {fileID: 4593123243770614}
- {fileID: 4406269203410272}
- {fileID: 4435688826682910}
- {fileID: 4005411319715288}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4756136857004012
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1891961280013378}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.003, y: -0.413, z: -0.013}
m_LocalScale: {x: 0.46845037, y: 0.5381249, z: 2.5624657}
m_Children: []
m_Father: {fileID: 4923659787192684}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4826985682407860
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1085172318406224}
m_LocalRotation: {x: -0.9854226, y: 0.000000029802319, z: -5.5511146e-16, w: 0.17012481}
m_LocalPosition: {x: 0.51299965, y: 0.28733304, z: -0.7140002}
m_LocalScale: {x: 2, y: 1.1, z: 1.1}
m_Children: []
m_Father: {fileID: 4319148401301890}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4837406182121158
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1818914004592680}
m_LocalRotation: {x: 0.17309815, y: 0, z: 0, w: 0.98490465}
m_LocalPosition: {x: -0.009, y: -0.105, z: 0.332}
m_LocalScale: {x: 0.48051658, y: 0.46999997, z: 1.9199998}
m_Children: []
m_Father: {fileID: 4923659787192684}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 19.936, y: 0, z: 0}
--- !u!4 &4895753392556396
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1070891394675296}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.007, y: 0.196, z: -0.009}
m_LocalScale: {x: 0.97229075, y: 0.81, z: 2.5662036}
m_Children: []
m_Father: {fileID: 4923659787192684}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4923659787192684
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1457849699718324}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 3, y: 3, z: 3}
m_Children:
- {fileID: 4895753392556396}
- {fileID: 4756136857004012}
- {fileID: 4837406182121158}
- {fileID: 4514215577628240}
- {fileID: 4468202074437718}
- {fileID: 4358214856693892}
- {fileID: 4478906517706370}
m_Father: {fileID: 4729005500470268}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4945674020586434
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1197674135003698}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 3, y: 3, z: 3}
m_Children:
- {fileID: 4464390724350388}
- {fileID: 4229433679952698}
- {fileID: 4376555506127498}
- {fileID: 4716344336611524}
m_Father: {fileID: 4729005500470268}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &23087358167589530
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1189333964202306}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c5fc4c62d5346c2499f1defb1b25362a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23245526824273628
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1240645431737382}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c5fc4c62d5346c2499f1defb1b25362a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23283799572250338
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1336216216481782}
m_Enabled: 0
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23361828628339078
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1818914004592680}
m_Enabled: 0
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23402186737512064
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1046544902985970}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 14592c1b3a22da04fbd2acfad625c31b, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23501451202958312
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1750729987499154}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 90184e0f3e509ce4986ae5d71252eb8e, type: 2}
- {fileID: 2100000, guid: b30627d9d472a5046996653074efbdb6, type: 2}
- {fileID: 2100000, guid: 43a15deaf1ae3f74ab368aac0937b30c, type: 2}
- {fileID: 2100000, guid: b3df519040922574596689ce22053d6e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23521489994353434
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1085172318406224}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 90184e0f3e509ce4986ae5d71252eb8e, type: 2}
- {fileID: 2100000, guid: b30627d9d472a5046996653074efbdb6, type: 2}
- {fileID: 2100000, guid: 43a15deaf1ae3f74ab368aac0937b30c, type: 2}
- {fileID: 2100000, guid: b3df519040922574596689ce22053d6e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23606883909975996
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1678712245086072}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c5fc4c62d5346c2499f1defb1b25362a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23647784139769270
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1310032646805766}
m_Enabled: 0
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23659840325317622
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1070891394675296}
m_Enabled: 0
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23671616204650876
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1599872247099710}
m_Enabled: 0
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23674397279562138
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1243488340986224}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 90184e0f3e509ce4986ae5d71252eb8e, type: 2}
- {fileID: 2100000, guid: b30627d9d472a5046996653074efbdb6, type: 2}
- {fileID: 2100000, guid: 43a15deaf1ae3f74ab368aac0937b30c, type: 2}
- {fileID: 2100000, guid: b3df519040922574596689ce22053d6e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23723249130265990
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1211557922848192}
m_Enabled: 0
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23786824366511058
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1924722859767966}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 90184e0f3e509ce4986ae5d71252eb8e, type: 2}
- {fileID: 2100000, guid: b30627d9d472a5046996653074efbdb6, type: 2}
- {fileID: 2100000, guid: 43a15deaf1ae3f74ab368aac0937b30c, type: 2}
- {fileID: 2100000, guid: b3df519040922574596689ce22053d6e, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23848283662693136
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1891961280013378}
m_Enabled: 0
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33189639815598188
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1891961280013378}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33217040370117572
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1750729987499154}
m_Mesh: {fileID: 4300026, guid: 3eed8165b861f444cbb8fe297fefedd7, type: 3}
--- !u!33 &33247143067274140
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1678712245086072}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33402360564346072
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1211557922848192}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33422554346592980
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1310032646805766}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33454934036444670
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1336216216481782}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33473641951565406
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1599872247099710}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33499725693037430
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1046544902985970}
m_Mesh: {fileID: 4300000, guid: c01bd727a056c2a4593a59cd53316c01, type: 3}
--- !u!33 &33539806340394506
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1924722859767966}
m_Mesh: {fileID: 4300020, guid: 3eed8165b861f444cbb8fe297fefedd7, type: 3}
--- !u!33 &33672187417434540
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1240645431737382}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33740977160727180
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1085172318406224}
m_Mesh: {fileID: 4300024, guid: 3eed8165b861f444cbb8fe297fefedd7, type: 3}
--- !u!33 &33815737140750034
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1243488340986224}
m_Mesh: {fileID: 4300022, guid: 3eed8165b861f444cbb8fe297fefedd7, type: 3}
--- !u!33 &33895297106581732
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1070891394675296}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33917038044192288
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1189333964202306}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33981836943493718
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1818914004592680}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!54 &54161230111937074
Rigidbody:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
serializedVersion: 2
m_Mass: 2200
m_Drag: 0.1
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!65 &65067532959555996
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1818914004592680}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65105583549259632
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1189333964202306}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65158388680007434
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1240645431737382}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65480946218316288
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1070891394675296}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65502246075845822
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1336216216481782}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65564414693862018
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1678712245086072}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65597730239171540
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1891961280013378}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65615069345296470
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1599872247099710}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65766350941787712
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1211557922848192}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65908351738424000
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1310032646805766}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!82 &82253751474767426
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: c4d8928c75c21af43998193f0f038429, type: 3}
m_PlayOnAwake: 1
m_Volume: 0
m_Pitch: 2.2708302
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 5
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82309282660021480
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 03e3bd08a6e70684dbe299a3e185fdd2, type: 3}
m_PlayOnAwake: 1
m_Volume: 0
m_Pitch: 0.56770754
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 5
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82349243801841746
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1514939199385624}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: bd9566abdbf08834281bfb4ea8b92a5d, type: 3}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1.2183075
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82362021704552190
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1465508660025824}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: bd9566abdbf08834281bfb4ea8b92a5d, type: 3}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82579799010515750
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 5699dddcce16c4543b95951c4ce0e092, type: 3}
m_PlayOnAwake: 1
m_Volume: 0.99185014
m_Pitch: 2.2708302
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 5
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82722421198234604
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 03bf91d88fce91c41995d27de63cc967, type: 3}
m_PlayOnAwake: 1
m_Volume: 0.17240347
m_Pitch: 0.56770754
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 5
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82854408235463576
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1474496948345704}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: bd9566abdbf08834281bfb4ea8b92a5d, type: 3}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!82 &82871011334131398
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1387063847067234}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: bd9566abdbf08834281bfb4ea8b92a5d, type: 3}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!114 &114000975641147740
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1514939199385624}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c62479c3465024b48b42983b1b2eeaaf, type: 3}
m_Name:
m_EditorClassIdentifier:
SkidTrailPrefab: {fileID: 400000, guid: 4b6aa99de5d21424eab6ae279f31475b, type: 2}
skidParticles: {fileID: 0}
--- !u!114 &114341158047890102
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7d11a13e75b23324cb1ec26495c88e99, type: 3}
m_Name:
m_EditorClassIdentifier:
playerId: 0
playerHealth: 10000
cube1: {fileID: 1189333964202306}
cube2: {fileID: 1240645431737382}
cube3: {fileID: 1678712245086072}
--- !u!114 &114385658851050544
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41d9bf583cacfbd4f8a15eefad6d23e5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114396446464560588
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1387063847067234}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c62479c3465024b48b42983b1b2eeaaf, type: 3}
m_Name:
m_EditorClassIdentifier:
SkidTrailPrefab: {fileID: 400000, guid: 4b6aa99de5d21424eab6ae279f31475b, type: 2}
skidParticles: {fileID: 0}
--- !u!114 &114425275050860992
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1465508660025824}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c62479c3465024b48b42983b1b2eeaaf, type: 3}
m_Name:
m_EditorClassIdentifier:
SkidTrailPrefab: {fileID: 400000, guid: 4b6aa99de5d21424eab6ae279f31475b, type: 2}
skidParticles: {fileID: 0}
--- !u!114 &114572692524163126
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b5b0ea758fdc04a449a42531707e8a15, type: 3}
m_Name:
m_EditorClassIdentifier:
engineSoundStyle: 1
lowAccelClip: {fileID: 8300000, guid: c4d8928c75c21af43998193f0f038429, type: 3}
lowDecelClip: {fileID: 8300000, guid: 5699dddcce16c4543b95951c4ce0e092, type: 3}
highAccelClip: {fileID: 8300000, guid: 03e3bd08a6e70684dbe299a3e185fdd2, type: 3}
highDecelClip: {fileID: 8300000, guid: 03bf91d88fce91c41995d27de63cc967, type: 3}
pitchMultiplier: 1
lowPitchMin: 1
lowPitchMax: 6
highPitchMultiplier: 0.25
maxRolloffDistance: 500
dopplerLevel: 1
useDoppler: 1
--- !u!114 &114737130551786110
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1474496948345704}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c62479c3465024b48b42983b1b2eeaaf, type: 3}
m_Name:
m_EditorClassIdentifier:
SkidTrailPrefab: {fileID: 400000, guid: 4b6aa99de5d21424eab6ae279f31475b, type: 2}
skidParticles: {fileID: 0}
--- !u!114 &114794759077342572
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 42d861cc31ccf36409cef47c19d5ac26, type: 3}
m_Name:
m_EditorClassIdentifier:
m_CarDriveType: 2
m_WheelColliders:
- {fileID: 146535371644503506}
- {fileID: 146958425913048222}
- {fileID: 146063661055033422}
- {fileID: 146728592086290882}
m_WheelMeshes:
- {fileID: 1924722859767966}
- {fileID: 1243488340986224}
- {fileID: 1085172318406224}
- {fileID: 1750729987499154}
m_WheelEffects:
- {fileID: 114000975641147740}
- {fileID: 114737130551786110}
- {fileID: 114396446464560588}
- {fileID: 114425275050860992}
m_CentreOfMassOffset: {x: 0, y: -3.5, z: 0}
m_MaximumSteerAngle: 30
m_SteerHelper: 0.7
m_TractionControl: 0.5
m_FullTorqueOverAllWheels: 50000
m_ReverseTorque: 3300
m_MaxHandbrakeTorque: 3.4028235e+38
m_Downforce: 102
m_SpeedType: 1
m_Topspeed: 100
m_RevRangeBoundary: 1
m_SlipLimit: 0.9
m_BrakeTorque: 20000
--- !u!114 &114912630960119962
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1857226130382042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4306489a1309f15498e8aa00cfc855a3, type: 3}
m_Name:
m_EditorClassIdentifier:
prefab: {fileID: 1857226130382042}
crashClip1: {fileID: 8300000, guid: 7e55735314867d744b0b3705a33dac03, type: 3}
--- !u!146 &146063661055033422
WheelCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1387063847067234}
m_Center: {x: 0, y: 0, z: 0}
m_Radius: 0.4
m_SuspensionSpring:
spring: 70000
damper: 3500
targetPosition: 0.1
m_SuspensionDistance: 0.3
m_ForceAppPointDistance: 0.1
m_Mass: 300
m_WheelDampingRate: 0.25
m_ForwardFriction:
m_ExtremumSlip: 0.2
m_ExtremumValue: 1
m_AsymptoteSlip: 0.8
m_AsymptoteValue: 0.5
m_Stiffness: 1
m_SidewaysFriction:
m_ExtremumSlip: 0.2
m_ExtremumValue: 1
m_AsymptoteSlip: 0.5
m_AsymptoteValue: 0.75
m_Stiffness: 1
m_Enabled: 1
--- !u!146 &146535371644503506
WheelCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1514939199385624}
m_Center: {x: 0, y: 0, z: 0}
m_Radius: 0.4
m_SuspensionSpring:
spring: 70000
damper: 3500
targetPosition: 0.1
m_SuspensionDistance: 0.3
m_ForceAppPointDistance: 0.1
m_Mass: 300
m_WheelDampingRate: 0.25
m_ForwardFriction:
m_ExtremumSlip: 0.2
m_ExtremumValue: 1
m_AsymptoteSlip: 0.8
m_AsymptoteValue: 0.5
m_Stiffness: 1
m_SidewaysFriction:
m_ExtremumSlip: 0.2
m_ExtremumValue: 1
m_AsymptoteSlip: 0.5
m_AsymptoteValue: 0.75
m_Stiffness: 1
m_Enabled: 1
--- !u!146 &146728592086290882
WheelCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1465508660025824}
m_Center: {x: 0, y: 0, z: 0}
m_Radius: 0.4
m_SuspensionSpring:
spring: 70000
damper: 3500
targetPosition: 0.1
m_SuspensionDistance: 0.3
m_ForceAppPointDistance: 0.1
m_Mass: 300
m_WheelDampingRate: 0.25
m_ForwardFriction:
m_ExtremumSlip: 0.2
m_ExtremumValue: 1
m_AsymptoteSlip: 0.8
m_AsymptoteValue: 0.5
m_Stiffness: 1
m_SidewaysFriction:
m_ExtremumSlip: 0.2
m_ExtremumValue: 1
m_AsymptoteSlip: 0.5
m_AsymptoteValue: 0.75
m_Stiffness: 1
m_Enabled: 1
--- !u!146 &146958425913048222
WheelCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1474496948345704}
m_Center: {x: 0, y: 0, z: 0}
m_Radius: 0.4
m_SuspensionSpring:
spring: 70000
damper: 3500
targetPosition: 0.1
m_SuspensionDistance: 0.3
m_ForceAppPointDistance: 0.1
m_Mass: 300
m_WheelDampingRate: 0.25
m_ForwardFriction:
m_ExtremumSlip: 0.2
m_ExtremumValue: 1
m_AsymptoteSlip: 0.8
m_AsymptoteValue: 0.5
m_Stiffness: 1
m_SidewaysFriction:
m_ExtremumSlip: 0.2
m_ExtremumValue: 1
m_AsymptoteSlip: 0.5
m_AsymptoteValue: 0.75
m_Stiffness: 1
m_Enabled: 1
| 26,062
|
https://github.com/kutschke/KinKal/blob/master/Trajectory/ClosestApproachData.cc
|
Github Open Source
|
Open Source
|
Apache-1.1
| null |
KinKal
|
kutschke
|
C++
|
Code
| 23
| 118
|
#include "KinKal/Trajectory/ClosestApproachData.hh"
namespace KinKal {
const std::vector<std::string> ClosestApproachData::statusNames_ = { "converged", "unconverged", "oscillating", "diverged","pocafailed", "invalid"};
std::string const& ClosestApproachData::statusName(TPStat status) { return statusNames_[static_cast<size_t>(status)];}
}
| 14,674
|
https://github.com/stangelandcl/dataframe/blob/master/include/dataframe/types.h
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
dataframe
|
stangelandcl
|
C
|
Code
| 22
| 211
|
#ifndef GUARD_72537C46_7CA7_44D3_B5B1_7DB27ACA5EA5
#define GUARD_72537C46_7CA7_44D3_B5B1_7DB27ACA5EA5
typedef enum
{
DataFrame_Type_DataFrame,
DataFrame_Type_ColumnInt8,
DataFrame_Type_ColumnInt16,
DataFrame_Type_ColumnInt32,
DataFrame_Type_ColumnInt64,
DataFrame_Type_ColumnUInt8,
DataFrame_Type_ColumnUInt16,
DataFrame_Type_ColumnUInt32,
DataFrame_Type_ColumnUInt64,
DataFrame_Type_ColumnFloat32,
DataFrame_Type_ColumnFloat64,
DataFrame_Type_ColumnString
} DataFrame_Type;
#endif
| 41,641
|
https://github.com/CodeMonkeySteve/dht/blob/master/server/views/application.sass
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
dht
|
CodeMonkeySteve
|
Sass
|
Code
| 18
| 71
|
body
font-family: verdana, sans-serif
.ui-button-text-only .ui-button-text
padding: 0 1em
input.ui-button
padding: 1px 1em
span.key
font-size: smaller
color: #888
| 45,529
|
https://github.com/statgen/demuxlet/blob/master/Makefile.am
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
demuxlet
|
statgen
|
Makefile
|
Code
| 111
| 387
|
## Additional flags to pass to aclocal when it is invoked automatically at
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment
## to provide a way for the user to supply additional arguments.
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_CPPFLAGS = -I ../htslib/ -I ../../htslib/htslib -pipe -D__STDC_LIMIT_MACROS -Wall -Wno-unused-local-typedefs -Wno-enum-compare -fpic -O2
noinst_HEADERS = \
Constant.h pException.h \
genomeLoci.h \
bcf_variant_key.h bcf_filter_arg.h bcftools.h
bin_PROGRAMS = demuxlet
## vcfast files
demuxlet_SOURCES = \
Error.cpp PhredHelper.cpp params.cpp \
hts_utils.cpp bcf_ordered_reader.cpp interval.cpp interval_tree.cpp utils.cpp genome_interval.cpp \
reference_sequence.cpp \
bcf_chunked_reader.cpp genomeChunk.cpp \
sam_filtered_reader.cpp sc_drop_seq.cpp \
bcf_filtered_reader.cpp \
filter.cpp \
tsv_reader.cpp \
cmd_cram_demuxlet.cpp
demuxlet_LDADD = ../htslib/libhts.a -lpthread -llzma -lz -lbz2 -lgomp -lcurl -lcrypto
| 16,693
|
https://github.com/MxBromelia/Miscelanea/blob/master/C++/CodePit/Contest0812/probH.cpp
|
Github Open Source
|
Open Source
|
MIT
| null |
Miscelanea
|
MxBromelia
|
C++
|
Code
| 55
| 167
|
#include <iostream>
using namespace std;
int mdc(int a, int b)
{
return (a%b ? mdc(b, a%b): b);
}
int main()
{
int i;
int nums[2], num;
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> nums[0] >> nums[1] >> num;
for(i=0; num > 0; i = (i+1)%2)
num -= mdc(num, nums[i]);
cout << ! i << '\n';
return 0;
}
| 5,863
|
https://github.com/Leonidas-from-XIV/dune/blob/master/test/blackbox-tests/test-cases/env/env-link_flags.t/run.t
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
dune
|
Leonidas-from-XIV
|
Perl
|
Code
| 55
| 140
|
$ cat >> dune-project <<EOF
> (lang dune 3.0)
> EOF
$ cat >> dune << EOF
> (library (name a)(modules a))
> (executable (name main) (modules main) (libraries a))
> (env (linkall-profile (link_flags (:standard -linkall))))
> EOF
$ dune exec ./main.exe
Starting main
$ dune exec ./main.exe --profile linkall-profile
'A' was linked
Starting main
| 38,167
|
https://github.com/rud9321/CoreAuth/blob/master/src/CoreAuth.Web/Views/Home/Authenticate.cshtml
|
Github Open Source
|
Open Source
|
MIT
| null |
CoreAuth
|
rud9321
|
C#
|
Code
| 2
| 15
|
<h1>Authenticate page..</h1>
| 2,162
|
https://github.com/SnehaSingh-8299/ONE-STATION-ALL-SOLUTION/blob/master/admin/admin.php
|
Github Open Source
|
Open Source
|
CC-BY-3.0
| null |
ONE-STATION-ALL-SOLUTION
|
SnehaSingh-8299
|
PHP
|
Code
| 250
| 1,555
|
<html>
<head><title>ADMIN PANEL</title></head>
</html>
<?php
session_start();
$admin=$_SESSION['sid'];
if(empty($admin))
{
header("location:aindex.php");
}
include("connect.php");
?>
<html>
<head>
<title>Dashboard</title>
<link href="boot/bootstrap.min.css" rel="stylesheet">
<script src="boot/jquery.min.js"></script>
<script src="boot/bootstrap.min.js"></script>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>-->
</head>
<body>
<main>
<header>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">One Station All Solution (OSAS)</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="admin.php">Home</a></li>
<li><a href="#">Change Password</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Welcome : <?=$admin;?></a></li>
<li><a href="logout.php"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
</ul>
</div>
</nav>
</header>
<div>
<aside class="col-sm-4">
<div class="list-group">
<a href="?page=signup" class="list-group-item">Sign Up Form Details</a>
<a href="?page=email" class="list-group-item">Email Details</a>
<a href="?page=scontact" class="list-group-item">Contact Details</a>
<!-- <a href="?page=addcat" class="list-group-item">Add Category</a>
<a href="?page=adpro" class="list-group-item">Add Product</a> -->
<a href="?page=showcat" class="list-group-item">Add Category</a>
<a href="?page=show" class="list-group-item">Add Product</a>
<a href="?page=showgallery" class="list-group-item">Gallery</a>
<a href="?page=video" class="list-group-item">Video</a>
<a href="?page=order" class="list-group-item">Order</a>
</div>
</aside>
<section class="col-sm-8">
<?php
if(!empty($_GET['page']))
{
switch($_GET['page'])
{
case 'signup' : include('signup.php');
break;
case 'email' : include("email.php");
break;
case 'addcat':include("addcategory.php");
break;
case 'ucat':include("updatecategory.php");
break;
case 'adpro' : include("addproduct.php");
break;
case 'show' : include("showpro.php");
break;
case 'showcat' : include("showcat.php");
break;
case 'ucat':include("updatecategory.php");
break;
case 'upro':include("updateproduct.php");
break;
case 'addgallery':include("addgallery.php");
break;
case 'showgallery':include("showgallery.php");
break;
case 'ugallery':include("updategallery.php");
break;
case 'video':include("video.php");
break;
case 'upvideo':include("updatevideo.php");
break;
case 'addvideo':include("addvideo.php");
break;
case 'demail':include("deleteemail.php");
break;
case 'single':include("single.php");
break;
case 'cright':include("centerright.php");
break;
case 'scontact':include("showcontact.php");
break;
case 'order':include("order.php");
break;
case 'view':include("view.php");
break;
case 'vieworder':include("status.php");
break;
case 'tempcart':include("tempcart.php");
break;
case 'check':include("checkout1.php");
break;
/* case 'addnew':include("addnews.php");
break; */
}
}
?>
</section>
</div>
</main>
</body>
</html>
<?php
// delete product
if(!empty($_GET['show&delid']))
{
$did=$_GET['show&delid'];
$imgname=$_GET['img'];
@unlink($imgname['img']);
$result=mysqli_query($con,"delete from category where id='$did'");
@unlink("uimages/".$imgname);
}
?>
<!--photo gallery -->
| 9,612
|
https://github.com/michielkalle/platform/blob/master/src/Storefront/Framework/Cache/CacheTracer.php
|
Github Open Source
|
Open Source
|
MIT
| null |
platform
|
michielkalle
|
PHP
|
Code
| 93
| 400
|
<?php declare(strict_types=1);
namespace Shopware\Storefront\Framework\Cache;
use Shopware\Core\Framework\Adapter\Cache\AbstractCacheTracer;
use Shopware\Storefront\Theme\ThemeConfigValueAccessor;
/**
* @extends AbstractCacheTracer<mixed|null>
*/
class CacheTracer extends AbstractCacheTracer
{
/**
* @var AbstractCacheTracer<mixed|null>
*/
private AbstractCacheTracer $decorated;
private ThemeConfigValueAccessor $themeConfigAccessor;
/**
* @internal
*
* @param AbstractCacheTracer<mixed|null> $decorated
*/
public function __construct(AbstractCacheTracer $decorated, ThemeConfigValueAccessor $themeConfigAccessor)
{
$this->decorated = $decorated;
$this->themeConfigAccessor = $themeConfigAccessor;
}
public function getDecorated(): AbstractCacheTracer
{
return $this->decorated;
}
public function trace(string $key, \Closure $param)
{
return $this->themeConfigAccessor->trace($key, function () use ($key, $param) {
return $this->getDecorated()->trace($key, $param);
});
}
public function get(string $key): array
{
return array_unique(array_merge(
$this->themeConfigAccessor->getTrace($key),
$this->getDecorated()->get($key)
));
}
}
| 2,137
|
https://github.com/koenw/fullstack-hello/blob/master/frontend/node_modules/.pnpm/@rsuite+icons@1.0.2_react-dom@17.0.2+react@17.0.2/node_modules/@rsuite/icons/es/utils/inBrowserEnv.js
|
Github Open Source
|
Open Source
|
Apache-2.0, MIT
| 2,021
|
fullstack-hello
|
koenw
|
JavaScript
|
Code
| 21
| 34
|
export default function () {
return typeof document !== 'undefined' && typeof window !== 'undefined' && typeof document.createElement === 'function';
}
| 26,175
|
https://github.com/aduranil/django-channels-react-multiplayer/blob/master/app/models.py
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
django-channels-react-multiplayer
|
aduranil
|
Python
|
Code
| 525
| 2,294
|
# Create your models here.
import json
import random
from collections import defaultdict
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.contrib.auth.models import User
class GetOrNoneManager(models.Manager):
"""Adds get_or_none method to objects"""
def get_or_none(self, **kwargs):
try:
return self.get(**kwargs)
except self.model.DoesNotExist:
return None
class Game(models.Model):
room_name = models.CharField(max_length=50)
game_status = models.CharField(max_length=50, default="active")
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
round_started = models.BooleanField(default=False)
is_joinable = models.BooleanField(default=True)
def as_json(self):
return dict(
id=self.id,
game_status=self.game_status,
is_joinable=self.is_joinable,
room_name=self.room_name,
round_started=self.round_started,
users=[u.as_json() for u in self.game_players.all()],
messages=[
m.as_json()
for m in self.messages.all()
.exclude(message_type="round_recap")
.order_by("created_at")
],
round_history=[
m.as_json()
for m in self.messages.all()
.filter(message_type="round_recap")
.order_by("created_at")
],
current_round=[r.as_json() for r in self.rounds.all().filter(started=True)],
)
def update_player_status(self, player_points):
winners = []
for player in self.game_players.all():
points = player_points[player.id]
updated_points = points + player.followers
# the floor is zero
if updated_points <= 0:
player.loser = True
loser = Winner.objects.get(winner_id=player.user.id)
loser.followers = loser.followers + 10
loser.save()
Message.objects.create(
message="{} lost".format(player.user.username),
message_type="round_recap",
username=player.user.username,
game=self,
)
else:
winners.append(player)
player.followers = updated_points
player.save()
return winners
def can_start_game(self):
"""See if the round can be started. Requires at least 3 players and
that all players in the room have started"""
if self.game_players.all().count() < 3:
self.round_started = False
self.save()
return False
for player in self.game_players.all():
if player.started is False:
return False
self.round_started = True
self.is_joinable = False # game is not joinable if the round started
self.save()
return True
def check_joinability(self):
if self.game_players.all().count() == 6:
self.is_joinable = False
elif self.round_started is True:
self.is_joinable = False
else:
self.is_joinable = True
self.save()
def set_players_as_not_having_started(self):
for player in self.game_players.all():
player.started = False
player.save()
class GamePlayer(models.Model):
followers = models.IntegerField(default=100)
selfies = models.IntegerField(default=3) # equivalent to licking a lolly
go_live = models.IntegerField(default=2) # equivalent to tattle
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
loser = models.BooleanField(default=False)
user = models.ForeignKey(
User,
related_name="game_players",
on_delete=models.CASCADE,
primary_key=False,
default="",
)
started = models.BooleanField(default=False)
game = models.ForeignKey(
Game, related_name="game_players", on_delete=models.CASCADE
)
winner = models.BooleanField(default=False)
objects = GetOrNoneManager()
def as_json(self):
return dict(
id=self.id,
winner=self.winner,
followers=self.followers,
selfies=self.selfies,
loser=self.loser,
go_live=self.go_live,
username=self.user.username,
started=self.started,
)
class Message(models.Model):
game = models.ForeignKey(Game, related_name="messages", on_delete=models.CASCADE)
username = models.CharField(max_length=200, default=None)
message = models.CharField(max_length=200)
created_at = models.DateTimeField(auto_now_add=True)
message_type = models.CharField(max_length=50, default=None)
def as_json(self):
return dict(
id=self.id,
message=self.message,
message_type=self.message_type,
created_at=json.dumps(self.created_at, cls=DjangoJSONEncoder),
username=self.username,
)
class Round(models.Model):
game = models.ForeignKey(Game, related_name="rounds", on_delete=models.CASCADE)
started = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
objects = GetOrNoneManager()
def as_json(self):
return dict(
id=self.id,
started=self.started,
moves=[m.as_json() for m in self.moves.all()],
)
def no_one_moved(self):
"if no one moved, we want to end the game"
for move in self.moves.all():
if move.action_type != "no_move":
return False
return True
def everyone_moved(self):
"use this function to know if we need to update the clock"
if (
self.moves.all().count()
== self.game.game_players.all().filter(loser=False).count()
):
return True
return False
def update_user_message(self, id, action_type, points, extra=None):
gp = GamePlayer.objects.get(id=id)
msg = Message.objects.filter(
game=self.game, message_type="round_recap", username=gp.user.username
).last()
msg.message = self.generate_new_message(
action_type, points, gp.user.username, extra
)
msg.save()
class Move(models.Model):
round = models.ForeignKey(Round, related_name="moves", on_delete=models.CASCADE)
action_type = models.CharField(max_length=200, default="no_move")
player = models.ForeignKey(
GamePlayer, related_name="game_player", on_delete=models.CASCADE
)
victim = models.ForeignKey(
GamePlayer,
related_name="victim",
blank=True,
null=True,
on_delete=models.CASCADE,
)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
objects = GetOrNoneManager()
def as_json(self):
return dict(
id=self.id,
action_type=self.action_type,
player=self.player.as_json() if self.player else None,
victim=self.victim.as_json() if self.victim else None,
)
class Winner(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
winner = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True)
followers = models.IntegerField(default=0)
def as_json(self):
return dict(followers=self.followers, username=self.winner.username)
| 38,438
|
https://github.com/kbaseattic/ui-common/blob/master/functional-site/communities/Retina/widgets/widget.login.js
|
Github Open Source
|
Open Source
|
MIT
| 2,016
|
ui-common
|
kbaseattic
|
JavaScript
|
Code
| 898
| 3,967
|
(function () {
widget = Retina.Widget.extend({
about: {
title: "MG-RAST Login",
name: "login",
author: "Tobias Paczian",
requires: [ 'jquery.cookie.js' ]
}
});
widget.setup = function () {
return [];
};
widget.callback = null;
widget.cookiename = "mgauth";
widget.authResources = RetinaConfig.authResources;
widget.helpEnabled = true;
widget.registerEnabled = false;
widget.registerEnabled = false;
widget.mydataEnabled = false;
widget.style = "black";
widget.display = function (wparams) {
widget = this;
var index = widget.index;
if (wparams && wparams.hasOwnProperty('authResources')) {
widget.authResources = wparams.authResources;
}
// append the modals to the body
var space = document.createElement('div');
space.innerHTML = widget.modals(index);
document.body.appendChild(space);
// put the login thing into the target space
var css = '\
.userinfo {\
position: absolute;\
top: 50px;\
right: 10px;\
width: 300px;\
height: 95px;\
padding: 10px;\
background-color: white;\
color: black;\
border: 1px solid gray;\
box-shadow: 4px 4px 4px #666666;\
border-radius: 6px 6px 6px 6px;\
z-index: 1000;\
}\
\
.userinfo > button {\
float: right;\
position: relative;\
bottom: 0px;\
margin-left: 10px;\
}\
\
.userinfo > img {\
height: 50px;\
float: left;\
margin-right: 10px;\
}';
var css_container = document.createElement('style');
css_container.innerHTML = css;
document.body.appendChild(css_container);
widget.target = wparams.target;
widget.target.innerHTML = widget.login_box(index);
if (wparams.callback && typeof(wparams.callback) == 'function') {
widget.callback = wparams.callback;
}
// check for a cookie
var udata = jQuery.cookie(widget.cookiename);
if (udata) {
udata = JSON.parse(udata);
if (udata.hasOwnProperty('user') && udata.user != null) {
var user = { login: udata.user.login,
firstname: udata.user.firstname,
lastname: udata.user.lastname,
email: udata.user.email,
};
stm.Authentication = udata.token;
Retina.WidgetInstances.login[index].target.innerHTML = Retina.WidgetInstances.login[index].login_box(index, user);
if (Retina.WidgetInstances.login[index].callback && typeof(Retina.WidgetInstances.login[index].callback) == 'function') {
Retina.WidgetInstances.login[index].callback.call(null, { 'action': 'login',
'result': 'success',
'token' : udata.token,
'user' : user });
}
}
}
};
widget.modals = function (index) {
widget = Retina.WidgetInstances.login[index];
var authResourceSelect = "";
var loginStyle = "";
if (Retina.keys(widget.authResources).length > 2) {
loginStyle = "class='span3' ";
var style = "<style>\
.selector {\
float: right;\
border: 1px solid #CCCCCC;\
border-radius: 4px;\
padding: 2px;\
margin-left: 5px;\
width: 40px;\
}\
.selectImage {\
width: 21px;\
margin: 1px;\
cursor: pointer;\
}\
.hiddenImage {\
display: none;\
}\
</style>";
authResourceSelect = style+"<div class='selector'><i class='icon-chevron-down' style='cursor: pointer;float: right;opacity: 0.2;margin-left: 1px;margin-top: 4px;' onclick=\"if(jQuery('.hiddenImage').css('display')=='none'){jQuery('.hiddenImage').css('display','block');}else{jQuery('.hiddenImage').css('display','none');}\"></i>";
for (var i in widget.authResources) {
if (i=="default") {
continue;
}
if (i==widget.authResources['default']) {
authResourceSelect += "<img class='selectImage' src='images/"+widget.authResources[i].icon+"' onclick=\"Retina.WidgetInstances.login["+index+"].authResources['default']='"+i+"';jQuery('.selectImage').toggleClass('hiddenImage', true);this.className='selectImage';jQuery('.hiddenImage').css('display','none');\">";
} else {
authResourceSelect += "<img class='selectImage hiddenImage' src='images/"+widget.authResources[i].icon+"' onclick=\"Retina.WidgetInstances.login["+index+"].authResources['default']='"+i+"';jQuery('.selectImage').toggleClass('hiddenImage', true);this.className='selectImage';jQuery('.hiddenImage').css('display','none');\">";
}
}
authResourceSelect += "</div>";
loginStyle = " style='width: 155px;'";
}
var html = '\
<div id="loginModal" class="modal show fade" tabindex="-1" style="width: 400px; display: none;" role="dialog" aria-labelledby="loginModalLabel" aria-hidden="true">\
<div class="modal-header">\
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>\
<h3 id="loginModalLabel">Authentication</h3>\
</div>\
<div class="modal-body">\
<p>Enter your credentials.</p>\
<div id="failure"></div>\
<table>\
<tr><th style="vertical-align: top;padding-top: 5px;width: 100px;text-align: left;">login</th><td><input type="text" '+loginStyle+'id="loginWidgetLoginField">'+authResourceSelect+'</td></tr>\
<tr><th style="vertical-align: top;padding-top: 5px;width: 100px;text-align: left;">password</th><td><input type="password" id="loginWidgetPasswordField" onkeypress="event = event || window.event;if(event.keyCode == 13) { Retina.WidgetInstances.login['+index+'].perform_login('+index+');}"></td></tr>\
</table>\
'+(widget.forgotEnabled ? ' <p style="text-align: right;">\
<a href="'+widget.forgotLink+'">I forgot my password</a>\
</p>\
' : '')+' </div>\
<div class="modal-footer">\
<button class="btn btn-danger pull-left" data-dismiss="modal" aria-hidden="true">cancel</button>\
<button class="btn btn-success" onclick="Retina.WidgetInstances.login['+index+'].perform_login('+index+');">log in</button>\
</div>\
</div>\
\
<div id="msgModal" class="modal hide fade" tabindex="-1" style="width: 400px;" role="dialog" aria-labelledby="msgModalLabel" aria-hidden="true" onkeypress="event = event || window.event;if(event.keyCode == 13) {document.getElementById(\'loginOKButton\').click();}">\
<div class="modal-header">\
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>\
<h3 id="msgModalLabel">Login Information</h3>\
</div>\
<div class="modal-body">\
<p>You have successfully logged in.</p>\
</div>\
<div class="modal-footer">\
<button class="btn btn-success" aria-hidden="true" data-dismiss="modal" id="loginOKButton">OK</button>\
</div>\
</div>';
return html;
};
widget.login_box = function (index, user) {
widget = Retina.WidgetInstances.login[index];
var html = "";
if (user) {
html ='\
<div style="float: right; margin-right: 20px; margin-top: 7px; color: gray;">\
<button class="btn'+(widget.style=='black' ? " btn-inverse" : "")+'" style="border-radius: 3px 0px 0px 3px; margin-right: -4px;" onclick="if(document.getElementById(\'userinfo\').style.display==\'none\'){document.getElementById(\'userinfo\').style.display=\'\';}else{document.getElementById(\'userinfo\').style.display=\'none\';}">\
<i class="icon-user'+(widget.style=='black' ? ' icon-white' : "")+'" style="margin-right: 5px;"></i>\
'+user.firstname+' '+user.lastname+'\
<span class="caret" style="margin-left: 5px;"></span>\
</button>\
'+(widget.helpEnabled ? ('<button class="btn'+(widget.style=='black' ? " btn-inverse" : "")+'" style="border-radius: 0px 3px 3px 0px;">?</button>') : "")+'\
</div>\
<div class="userinfo" id="userinfo" style="display: none;">\
<img src="Retina/images/user.png">\
<h4 style="margin-top: 5px;">'+user.firstname+' '+user.lastname+'</h4>\
<p style="margin-top: -10px;">'+(user.email || "<br>") +'</p>\
<button class="btn'+(widget.style=='black' ? " btn-inverse" : "")+'" onclick="document.getElementById(\'userinfo\').style.display=\'none\';Retina.WidgetInstances.login['+index+'].perform_logout('+index+');">logout</button>\
'+(widget.mydataEnabled ? '<button class="btn" style="float: left;">myData</button>' : '')+'\
</div>';
} else {
html ='\
<div style="float: right; margin-right: 20px; margin-top: 7px; color: gray;">\
<button class="btn'+(widget.style=='black' ? " btn-inverse" : "")+'" style="border-radius: 3px 0px 0px 3px; margin-right: -4px;" onclick="jQuery(\'#loginModal\').modal(\'show\');document.getElementById(\'loginWidgetLoginField\').focus();">\
Login\
</button>\
' + (widget.registerEnabled ? '<button class="btn'+(widget.style=='black' ? " btn-inverse" : "")+'" style="border-radius: 3px 0px 0px 3px; margin-right: -4px;" onclick="window.location=\''+widget.registerLink+'\';">\
Register\
</button>' : '') +(widget.helpEnabled ? '\
<button class="btn'+(widget.style=='black' ? " btn-inverse" : "")+'" style="border-radius: 0px 3px 3px 0px;" onclick="window.open(\''+widget.helpLink+'\');">?</button>\
' : "")+'</div>';
}
return html;
}
widget.perform_login = function (index) {
widget = Retina.WidgetInstances.login[index];
var login = document.getElementById('loginWidgetLoginField').value;
var pass = document.getElementById('loginWidgetPasswordField').value;
var auth_url = RetinaConfig.mgrast_api+'?auth='+widget.authResources[widget.authResources.default].prefix+Retina.Base64.encode(login+":"+pass);
jQuery.get(auth_url, function(d) {
if (d && d.token) {
var user = { login: d.login || login,
firstname: d.firstname || login,
lastname: d.lastname || "",
email: d.email || "",
};
stm.Authentication = d.token;
Retina.WidgetInstances.login[index].target.innerHTML = Retina.WidgetInstances.login[index].login_box(index, user);
document.getElementById('failure').innerHTML = "";
stm.Authentication = d.token;
jQuery('#loginModal').modal('hide');
jQuery('#msgModal').modal('show');
jQuery.cookie(Retina.WidgetInstances.login[1].cookiename, JSON.stringify({ "user": user,
"token": d.token }), { expires: 7 });
if (Retina.WidgetInstances.login[index].callback && typeof(Retina.WidgetInstances.login[index].callback) == 'function') {
Retina.WidgetInstances.login[index].callback.call(null, { 'action': 'login',
'result': 'success',
'token' : d.token,
'user' : user });
}
} else {
document.getElementById('failure').innerHTML = '<div class="alert alert-error"><button type="button" class="close" data-dismiss="alert">×</button><strong>Error:</strong> Login failed.</div>';
if (Retina.WidgetInstances.login[index].callback && typeof(Retina.WidgetInstances.login[index].callback) == 'function') {
Retina.WidgetInstances.login[index].callback.call(null, { 'action': 'login',
'result': 'failed',
'token' : null,
'user' : null });
}
}
}).fail(function() {
document.getElementById('failure').innerHTML = '<div class="alert alert-error"><button type="button" class="close" data-dismiss="alert">×</button><strong>Error:</strong> Login failed.</div>';
if (Retina.WidgetInstances.login[index].callback && typeof(Retina.WidgetInstances.login[index].callback) == 'function') {
Retina.WidgetInstances.login[index].callback.call(null, { 'action': 'login',
'result': 'failed',
'token': null,
'user': null });
}
});
};
widget.perform_logout = function (index) {
Retina.WidgetInstances.login[index].target.innerHTML = Retina.WidgetInstances.login[index].login_box(index);
stm.Authentication = null;
jQuery.cookie(Retina.WidgetInstances.login[1].cookiename, JSON.stringify({ "token": null,
"user": null }));
if (Retina.WidgetInstances.login[index].callback && typeof(Retina.WidgetInstances.login[index].callback) == 'function') {
Retina.WidgetInstances.login[index].callback.call(null, { 'action': 'logout' });
}
};
})();
| 39,159
|
https://github.com/fingoweb/react-custom-scrollbars/blob/master/.gitignore
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
react-custom-scrollbars
|
fingoweb
|
Ignore List
|
Code
| 7
| 32
|
node_modules
*.log
.DS_Store
coverage
examples/simple/static
.idea/
package-lock.json
| 42,200
|
https://github.com/Sn1KeRs385/school/blob/master/www/laravel/resources/js/components/Header/Header.vue
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
school
|
Sn1KeRs385
|
Vue
|
Code
| 95
| 545
|
<template>
<header class="app-header navbar">
<button class="navbar-toggler mobile-sidebar-toggler d-lg-none" type="button" @click="mobileSidebarToggle">
<span class="navbar-toggler-icon"></span>
</button>
<b-link class="navbar-brand d-flex justify-content-center align-items-center" to="#">MintAdmin</b-link>
<button class="navbar-toggler sidebar-toggler d-md-down-none" type="button" @click="sidebarToggle">
<span class="navbar-toggler-icon"></span>
</button>
<b-navbar-nav class="d-md-down-none">
</b-navbar-nav>
<b-navbar-nav class="ml-auto">
<HeaderDropdownAccnt/>
</b-navbar-nav>
</header>
</template>
<script>
import HeaderDropdownAccnt from './HeaderDropdownAccnt.vue'
import HeaderDropdownTasks from './HeaderDropdownTasks.vue'
import HeaderDropdownNotif from './HeaderDropdownNotif.vue'
import HeaderDropdownMssgs from './HeaderDropdownMssgs.vue'
export default {
name: 'header',
components: {
HeaderDropdownAccnt,
HeaderDropdownTasks,
HeaderDropdownNotif,
HeaderDropdownMssgs
},
methods: {
sidebarToggle (e) {
e.preventDefault()
document.body.classList.toggle('sidebar-hidden')
},
sidebarMinimize (e) {
e.preventDefault()
document.body.classList.toggle('sidebar-minimized')
},
mobileSidebarToggle (e) {
e.preventDefault()
document.body.classList.toggle('sidebar-mobile-show')
},
asideToggle (e) {
e.preventDefault()
document.body.classList.toggle('aside-menu-hidden')
}
}
}
</script>
| 25,954
|
https://github.com/GreenHill0/Rhino-X/blob/master/Assets/Demo/DemoScenes/GrabableDemo.unity
|
Github Open Source
|
Open Source
|
BSD-2-Clause
| 2,019
|
Rhino-X
|
GreenHill0
|
Unity3D Asset
|
Code
| 4,458
| 19,579
|
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657838, g: 0.49641234, b: 0.57481676, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &116377028
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 116377029}
- component: {fileID: 116377033}
- component: {fileID: 116377032}
- component: {fileID: 116377031}
- component: {fileID: 116377030}
m_Layer: 5
m_Name: btn Back
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &116377029
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 116377028}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.019354, y: 0.019354, z: 0.019354}
m_Children:
- {fileID: 1840574205}
m_Father: {fileID: 710763823}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -0.62}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!65 &116377030
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 116377028}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 165, y: 35, z: 10}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &116377031
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 116377028}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 116377032}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 710763819}
m_MethodName: BackToMainMenu
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &116377032
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 116377028}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!222 &116377033
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 116377028}
m_CullTransparentMesh: 0
--- !u!1 &132851275
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 132851280}
- component: {fileID: 132851279}
- component: {fileID: 132851278}
- component: {fileID: 132851277}
- component: {fileID: 132851276}
- component: {fileID: 132851281}
m_Layer: 5
m_Name: Grabable (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &132851276
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 132851275}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ec080ab92fda44dba4e6b83955f57e8, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!135 &132851277
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 132851275}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 1.2
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &132851278
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 132851275}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &132851279
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 132851275}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &132851280
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 132851275}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.56, y: 0.1, z: 0}
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &132851281
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 132851275}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fdf919f7205324930910a281ae962b53, type: 3}
m_Name:
m_EditorClassIdentifier:
NormalMaterial: {fileID: 2100000, guid: 8617044dce75948dc844c63daf0c1bff, type: 2}
HighLightMaterial: {fileID: 2100000, guid: b3ab15479de744c04a952b6cb9277d5f, type: 2}
--- !u!1 &259642502
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 259642507}
- component: {fileID: 259642506}
- component: {fileID: 259642505}
- component: {fileID: 259642504}
- component: {fileID: 259642503}
- component: {fileID: 259642508}
m_Layer: 5
m_Name: Grabable (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &259642503
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 259642502}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ec080ab92fda44dba4e6b83955f57e8, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!135 &259642504
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 259642502}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 1.2
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &259642505
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 259642502}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &259642506
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 259642502}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &259642507
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 259642502}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.434, y: 0.1, z: 0}
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &259642508
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 259642502}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fdf919f7205324930910a281ae962b53, type: 3}
m_Name:
m_EditorClassIdentifier:
NormalMaterial: {fileID: 2100000, guid: 8617044dce75948dc844c63daf0c1bff, type: 2}
HighLightMaterial: {fileID: 2100000, guid: b3ab15479de744c04a952b6cb9277d5f, type: 2}
--- !u!1 &684137934
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 684137937}
- component: {fileID: 684137936}
- component: {fileID: 684137935}
m_Layer: 0
m_Name: Ground Plane (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &684137935
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 684137934}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -2091853651, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RecenterMode: 0
m_Placement: 0
m_RecenterInterval: 1
m_VPUFrameDelay: 0.056
m_MinTrackedDistance: 0
m_MinTrackedAngle: 28
m_MaxTrackedDistance: 2
m_MinErrorHeadDistance: 0.5
m_MinErrorHeadDiffAngle: 30
m_DebugView: 0
m_DrawColor: {r: 0, g: 1, b: 0, a: 1}
--- !u!114 &684137936
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 684137934}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1930965261, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackableID: 67
OnVisibilityChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: Ximmerse.RhinoX.VisiblityChangeEvent, RhinoX-Unity, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=null
m_VerboseLog: 0
--- !u!4 &684137937
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 684137934}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &710763818
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 710763823}
- component: {fileID: 710763822}
- component: {fileID: 710763821}
- component: {fileID: 710763820}
- component: {fileID: 710763819}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &710763819
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 710763818}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1afb33d9ecca34d9f95f369a663f9539, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &710763820
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 710763818}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b333ccd1398d448d79df332c61889f0a, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ZDepth: 8
m_ForceEveryFrame: 0
m_AngleDiffError: 35
m_DockDelay: 0.15
m_DampTime: 0.2
PositionOffset: {x: 0, y: 0, z: 0}
--- !u!114 &710763821
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 710763818}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 2
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!223 &710763822
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 710763818}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &710763823
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 710763818}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1134206779}
- {fileID: 116377029}
- {fileID: 1690634116}
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 1}
m_SizeDelta: {x: 1, y: 1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &853969331
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 853969334}
- component: {fileID: 853969333}
- component: {fileID: 853969332}
m_Layer: 0
m_Name: Ground Plane (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &853969332
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 853969331}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -2091853651, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RecenterMode: 0
m_Placement: 0
m_RecenterInterval: 1
m_VPUFrameDelay: 0.056
m_MinTrackedDistance: 0
m_MinTrackedAngle: 28
m_MaxTrackedDistance: 2
m_MinErrorHeadDistance: 0.5
m_MinErrorHeadDiffAngle: 30
m_DebugView: 0
m_DrawColor: {r: 0, g: 1, b: 0, a: 1}
--- !u!114 &853969333
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 853969331}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1930965261, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackableID: 65
OnVisibilityChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: Ximmerse.RhinoX.VisiblityChangeEvent, RhinoX-Unity, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=null
m_VerboseLog: 0
--- !u!4 &853969334
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 853969331}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1048501720
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1048501721}
- component: {fileID: 1048501723}
- component: {fileID: 1048501722}
m_Layer: 0
m_Name: AR Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1048501721
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1048501720}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1284604317}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1048501722
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1048501720}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -1917612340, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackPosition: 1
m_TrackRotation: 1
m_EyePitch: 0
m_TrackingProfile: {fileID: 11400000, guid: badb98f40b5794c3392a552badfe171e, type: 2}
m_DebugView: 0
m_EnableReticle: 0
m_ReticleImage: {fileID: 2800000, guid: a4e5c7e6862cc4735a657a05b14d0b1f, type: 3}
m_ReticleInteractMask:
serializedVersion: 2
m_Bits: 32
--- !u!20 &1048501723
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1048501720}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.01
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!1 &1076021453
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1076021455}
- component: {fileID: 1076021454}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1076021454
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1076021453}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1076021455
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1076021453}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1001 &1077675539
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 918910405004392867, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_Name
value: RxController
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392871, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 918910405004392869, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_ApplyPrediction
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8778161317022048138, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_RenderRay
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8778161317022048138, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_RxRaycastingType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8778161317022048138, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_RaycastDistance
value: 1
objectReference: {fileID: 0}
- target: {fileID: 918910405782393389, guid: c847fb4b8919c49d587a190ae4df6c68,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c847fb4b8919c49d587a190ae4df6c68, type: 3}
--- !u!1 &1134206778
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1134206779}
- component: {fileID: 1134206782}
- component: {fileID: 1134206781}
- component: {fileID: 1134206780}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1134206779
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1134206778}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.008279039, y: 0.008279039, z: 0.008279039}
m_Children: []
m_Father: {fileID: 710763823}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 1.262}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1134206780
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1134206778}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
m_EffectDistance: {x: 3.74, y: 1.18}
m_UseGraphicAlpha: 1
--- !u!114 &1134206781
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1134206778}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 56
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 56
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: 'Demo : Grabable Object
Check the <color=yellow>Grabable.cs</color> script'
--- !u!222 &1134206782
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1134206778}
m_CullTransparentMesh: 0
--- !u!1 &1231448822
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1231448825}
- component: {fileID: 1231448824}
- component: {fileID: 1231448823}
m_Layer: 0
m_Name: Ground Plane (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1231448823
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1231448822}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -2091853651, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RecenterMode: 0
m_Placement: 0
m_RecenterInterval: 1
m_VPUFrameDelay: 0.056
m_MinTrackedDistance: 0
m_MinTrackedAngle: 28
m_MaxTrackedDistance: 2
m_MinErrorHeadDistance: 0.5
m_MinErrorHeadDiffAngle: 30
m_DebugView: 0
m_DrawColor: {r: 0, g: 1, b: 0, a: 1}
--- !u!114 &1231448824
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1231448822}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1930965261, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackableID: 66
OnVisibilityChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: Ximmerse.RhinoX.VisiblityChangeEvent, RhinoX-Unity, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=null
m_VerboseLog: 0
--- !u!4 &1231448825
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1231448822}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1284604316
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1284604317}
m_Layer: 0
m_Name: ARCameraRig
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1284604317
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1284604316}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1048501721}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1548600930
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1548600933}
- component: {fileID: 1548600932}
- component: {fileID: 1548600931}
m_Layer: 0
m_Name: RxEventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1548600931
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548600930}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 2044572189, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_PointerButton: 262144
m_AcceptAnyControllerButton: 0
--- !u!114 &1548600932
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548600930}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -998137568, guid: bdb9aecc998904ee283e788be911376d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1548600933
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548600930}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1690634115
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1690634116}
- component: {fileID: 1690634119}
- component: {fileID: 1690634118}
- component: {fileID: 1690634117}
m_Layer: 5
m_Name: Text (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1690634116
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1690634115}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.008279039, y: 0.008279039, z: 0.008279039}
m_Children: []
m_Father: {fileID: 710763823}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 2.07, y: 0.69}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1690634117
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1690634115}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1573420865, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
m_EffectDistance: {x: 3.74, y: 1.18}
m_UseGraphicAlpha: 1
--- !u!114 &1690634118
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1690634115}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 18
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 56
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: Grab the cube by pushing trigger !
--- !u!222 &1690634119
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1690634115}
m_CullTransparentMesh: 0
--- !u!1 &1840574204
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1840574205}
- component: {fileID: 1840574207}
- component: {fileID: 1840574206}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1840574205
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1840574204}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.2504027, y: 0.2504027, z: 0.2504027}
m_Children: []
m_Father: {fileID: 116377029}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1840574206
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1840574204}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.0064079626, g: 0.12593646, b: 0.4528302, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 56
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 70
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: Back to main menu
--- !u!222 &1840574207
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1840574204}
m_CullTransparentMesh: 0
--- !u!1 &2076524837
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2076524842}
- component: {fileID: 2076524841}
- component: {fileID: 2076524840}
- component: {fileID: 2076524839}
- component: {fileID: 2076524838}
- component: {fileID: 2076524843}
m_Layer: 5
m_Name: Grabable (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2076524838
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2076524837}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ec080ab92fda44dba4e6b83955f57e8, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!135 &2076524839
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2076524837}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 1.2
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &2076524840
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2076524837}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &2076524841
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2076524837}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &2076524842
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2076524837}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.1, z: 0}
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2076524843
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2076524837}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fdf919f7205324930910a281ae962b53, type: 3}
m_Name:
m_EditorClassIdentifier:
NormalMaterial: {fileID: 2100000, guid: 8617044dce75948dc844c63daf0c1bff, type: 2}
HighLightMaterial: {fileID: 2100000, guid: b3ab15479de744c04a952b6cb9277d5f, type: 2}
| 22,512
|
https://github.com/ScalablyTyped/Distribution/blob/master/m/material-ui__core/src/main/scala/typings/materialUiCore/badgeBadgeMod.scala
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
Distribution
|
ScalablyTyped
|
Scala
|
Code
| 485
| 2,703
|
package typings.materialUiCore
import org.scalablytyped.runtime.Shortcut
import typings.materialUiCore.anon.AnchorOrigin
import typings.materialUiCore.materialUiCoreStrings.bottom
import typings.materialUiCore.materialUiCoreStrings.div
import typings.materialUiCore.materialUiCoreStrings.left
import typings.materialUiCore.materialUiCoreStrings.right
import typings.materialUiCore.materialUiCoreStrings.top
import typings.materialUiCore.overridableComponentMod.OverridableComponent
import typings.materialUiCore.overridableComponentMod.OverrideProps
import typings.react.mod.ElementType
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}
object badgeBadgeMod extends Shortcut {
/**
*
* Demos:
*
* - [Avatars](https://mui.com/components/avatars/)
* - [Badges](https://mui.com/components/badges/)
*
* API:
*
* - [Badge API](https://mui.com/api/badge/)
*/
@JSImport("@material-ui/core/Badge/Badge", JSImport.Default)
@js.native
val default: OverridableComponent[BadgeTypeMap[js.Object, div]] = js.native
/* Rewritten from type alias, can be one of:
- typings.materialUiCore.materialUiCoreStrings.root
- typings.materialUiCore.materialUiCoreStrings.badge
- typings.materialUiCore.materialUiCoreStrings.colorPrimary
- typings.materialUiCore.materialUiCoreStrings.colorSecondary
- typings.materialUiCore.materialUiCoreStrings.colorError
- typings.materialUiCore.materialUiCoreStrings.dot
- typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightRectangle
- typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightRectangle
- typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftRectangle
- typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomLeftRectangle
- typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightCircle
- typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightCircle
- typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftCircle
- typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightRectangular
- typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightRectangular
- typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftRectangular
- typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomLeftRectangular
- typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightCircular
- typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightCircular
- typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftCircular
- typings.materialUiCore.materialUiCoreStrings.invisible
*/
trait BadgeClassKey extends StObject
object BadgeClassKey {
inline def anchorOriginBottomLeftRectangle: typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomLeftRectangle = "anchorOriginBottomLeftRectangle".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomLeftRectangle]
inline def anchorOriginBottomLeftRectangular: typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomLeftRectangular = "anchorOriginBottomLeftRectangular".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomLeftRectangular]
inline def anchorOriginBottomRightCircle: typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightCircle = "anchorOriginBottomRightCircle".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightCircle]
inline def anchorOriginBottomRightCircular: typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightCircular = "anchorOriginBottomRightCircular".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightCircular]
inline def anchorOriginBottomRightRectangle: typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightRectangle = "anchorOriginBottomRightRectangle".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightRectangle]
inline def anchorOriginBottomRightRectangular: typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightRectangular = "anchorOriginBottomRightRectangular".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginBottomRightRectangular]
inline def anchorOriginTopLeftCircle: typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftCircle = "anchorOriginTopLeftCircle".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftCircle]
inline def anchorOriginTopLeftCircular: typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftCircular = "anchorOriginTopLeftCircular".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftCircular]
inline def anchorOriginTopLeftRectangle: typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftRectangle = "anchorOriginTopLeftRectangle".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftRectangle]
inline def anchorOriginTopLeftRectangular: typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftRectangular = "anchorOriginTopLeftRectangular".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginTopLeftRectangular]
inline def anchorOriginTopRightCircle: typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightCircle = "anchorOriginTopRightCircle".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightCircle]
inline def anchorOriginTopRightCircular: typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightCircular = "anchorOriginTopRightCircular".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightCircular]
inline def anchorOriginTopRightRectangle: typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightRectangle = "anchorOriginTopRightRectangle".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightRectangle]
inline def anchorOriginTopRightRectangular: typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightRectangular = "anchorOriginTopRightRectangular".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.anchorOriginTopRightRectangular]
inline def badge: typings.materialUiCore.materialUiCoreStrings.badge = "badge".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.badge]
inline def colorError: typings.materialUiCore.materialUiCoreStrings.colorError = "colorError".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.colorError]
inline def colorPrimary: typings.materialUiCore.materialUiCoreStrings.colorPrimary = "colorPrimary".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.colorPrimary]
inline def colorSecondary: typings.materialUiCore.materialUiCoreStrings.colorSecondary = "colorSecondary".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.colorSecondary]
inline def dot: typings.materialUiCore.materialUiCoreStrings.dot = "dot".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.dot]
inline def invisible: typings.materialUiCore.materialUiCoreStrings.invisible = "invisible".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.invisible]
inline def root: typings.materialUiCore.materialUiCoreStrings.root = "root".asInstanceOf[typings.materialUiCore.materialUiCoreStrings.root]
}
trait BadgeOrigin extends StObject {
var horizontal: left | right
var vertical: top | bottom
}
object BadgeOrigin {
inline def apply(horizontal: left | right, vertical: top | bottom): BadgeOrigin = {
val __obj = js.Dynamic.literal(horizontal = horizontal.asInstanceOf[js.Any], vertical = vertical.asInstanceOf[js.Any])
__obj.asInstanceOf[BadgeOrigin]
}
@scala.inline
implicit open class MutableBuilder[Self <: BadgeOrigin] (val x: Self) extends AnyVal {
inline def setHorizontal(value: left | right): Self = StObject.set(x, "horizontal", value.asInstanceOf[js.Any])
inline def setVertical(value: top | bottom): Self = StObject.set(x, "vertical", value.asInstanceOf[js.Any])
}
}
type BadgeProps[D /* <: ElementType[Any] */, P] = OverrideProps[BadgeTypeMap[P, D], D]
trait BadgeTypeMap[P, D /* <: ElementType[Any] */] extends StObject {
var classKey: BadgeClassKey
var defaultComponent: D
var props: P & AnchorOrigin
}
object BadgeTypeMap {
inline def apply[P, D /* <: ElementType[Any] */](classKey: BadgeClassKey, defaultComponent: D, props: P & AnchorOrigin): BadgeTypeMap[P, D] = {
val __obj = js.Dynamic.literal(classKey = classKey.asInstanceOf[js.Any], defaultComponent = defaultComponent.asInstanceOf[js.Any], props = props.asInstanceOf[js.Any])
__obj.asInstanceOf[BadgeTypeMap[P, D]]
}
@scala.inline
implicit open class MutableBuilder[Self <: BadgeTypeMap[?, ?], P, D /* <: ElementType[Any] */] (val x: Self & (BadgeTypeMap[P, D])) extends AnyVal {
inline def setClassKey(value: BadgeClassKey): Self = StObject.set(x, "classKey", value.asInstanceOf[js.Any])
inline def setDefaultComponent(value: D): Self = StObject.set(x, "defaultComponent", value.asInstanceOf[js.Any])
inline def setProps(value: P & AnchorOrigin): Self = StObject.set(x, "props", value.asInstanceOf[js.Any])
}
}
type _To = OverridableComponent[BadgeTypeMap[js.Object, div]]
/* This means you don't have to write `default`, but can instead just say `badgeBadgeMod.foo` */
override def _to: OverridableComponent[BadgeTypeMap[js.Object, div]] = default
}
| 30,544
|
https://github.com/ToanDao2612/Sholo.HomeAssistant/blob/master/Source/Sholo.HomeAssistant.Mqtt/Entities/Climate/IClimate.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
Sholo.HomeAssistant
|
ToanDao2612
|
C#
|
Code
| 13
| 42
|
namespace Sholo.HomeAssistant.Mqtt.Entities.Climate
{
public interface IClimate : IEntity
{
// TODO
}
}
| 37,492
|
https://github.com/spidasoftware/apply/blob/master/test/01-start-server.js
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
apply
|
spidasoftware
|
JavaScript
|
Code
| 50
| 168
|
restify = require('restify');
assert = require('assert');
mongojs = require('mongojs');
console.log("FYI: You need a mongodb server running for these tests to work.")
before(function(done) {
require('../lib/apply').Apply("test");
var collections = ["jobs", "applications"]
var db = mongojs("test", collections);
db.jobs.runCommand('drop', function(err, res) {
// console.log(res);
});
db.applications.runCommand('drop', function(err, res) {
// console.log(res);
});
done();
});
| 15,880
|
https://github.com/benmalartre/STK/blob/master/projects/Tests/FourSine.cpp
|
Github Open Source
|
Open Source
|
TCL, DOC
| null |
STK
|
benmalartre
|
C++
|
Code
| 1,122
| 3,391
|
// foursine.cpp STK tutorial program
#include "Stk.h"
#include "BeeThree.h"
#include "Messager.h"
#include "Voicer.h"
#include "SKINImsg.h"
#include <algorithm>
#include "RtAudio.h"
using std::min;
using namespace stk;
#include "SineWave.h"
#include "Blit.h"
#include "BlitSquare.h"
#include "BlitSaw.h"
#include "Asymp.h"
#include "FileWvOut.h"
#include <cstdlib>
using namespace stk;
#define C0 16.35
#define Db0 17.32
#define D0 18.35
#define Eb0 19.45
#define E0 20.60
#define F0 21.83
#define Gb0 23.12
#define G0 24.50
#define Ab0 25.96
#define A0 27.50
#define Bb0 29.14
#define B0 30.87
#define C1 32.70
#define Db1 34.65
#define D1 36.71
#define Eb1 38.89
#define E1 41.20
#define F1 43.65
#define Gb1 46.25
#define G1 49.00
#define Ab1 51.91
#define A1 55.00
#define Bb1 58.27
#define B1 61.74
#define C2 65.41
#define Db2 69.30
#define D2 73.42
#define Eb2 77.78
#define E2 82.41
#define F2 87.31
#define Gb2 92.50
#define G2 98.00
#define Ab2 103.83
#define A2 110.00
#define Bb2 116.54
#define B2 123.47
#define C3 130.81
#define Db3 138.59
#define D3 146.83
#define Eb3 155.56
#define E3 164.81
#define F3 174.61
#define Gb3 185.00
#define G3 196.00
#define Ab3 207.65
#define A3 220.00
#define Bb3 233.08
#define B3 246.94
#define C4 261.63
#define Db4 277.18
#define D4 293.66
#define Eb4 311.13
#define E4 329.63
#define F4 349.23
#define Gb4 369.99
#define G4 392.00
#define Ab4 415.30
#define A4 440.00
#define Bb4 466.16
#define B4 493.88
#define C5 523.25
#define Db5 554.37
#define D5 587.33
#define Eb5 622.25
#define E5 659.25
#define F5 698.46
#define Gb5 739.99
#define G5 783.99
#define Ab5 830.61
#define A5 880.00
#define Bb5 932.33
#define B5 987.77
#define C6 1046.50
#define Db6 1108.73
#define D6 1174.66
#define Eb6 1244.51
#define E6 1318.51
#define F6 1396.91
#define Gb6 1479.98
#define G6 1567.98
#define Ab6 1661.22
#define A6 1760.00
#define Bb6 1864.66
#define B6 1975.53
#define C7 2093.00
#define Db7 2217.46
#define D7 2349.32
#define Eb7 2489.02
#define E7 2637.02
#define F7 2793.83
#define Gb7 2959.96
#define G7 3135.96
#define Ab7 3322.44
#define A7 3520.00
#define Bb7 3729.31
#define B7 3951.07
#define C8 4186.01
#define Db8 4434.92
#define D8 4698.63
#define Eb8 4978.03
#define E8 5274.04
#define F8 5587.65
#define Gb8 5919.91
#define G8 6271.93
#define Ab8 6644.88
#define A8 7040.00
#define Bb8 7458.62
#define B8 7902.13
#define NUM_NOTES 12
#define NUM_OCTAVES 9
StkFloat NOTES[NUM_OCTAVES][NUM_NOTES] = {
{ C0, Db0, D0, Eb0, E0, F0, Gb0, G0, Ab0, A0, Bb0, B0 },
{ C1, Db1, D1, Eb1, E1, F1, Gb1, G1, Ab1, A1, Bb1, B1 },
{ C2, Db2, D2, Eb2, E2, F2, Gb2, G2, Ab2, A2, Bb2, B2 },
{ C3, Db3, D3, Eb3, E3, F3, Gb3, G3, Ab3, A3, Bb3, B3 },
{ C4, Db4, D4, Eb4, E4, F4, Gb4, G4, Ab4, A4, Bb4, B4 },
{ C5, Db5, D5, Eb5, E5, F5, Gb5, G5, Ab5, A5, Bb5, B5 },
{ C6, Db6 ,D6, Eb6, E6, F6, Gb6, G6, Ab6, A6, Bb6, B6 },
{ C7, Db7, D7, Eb7, E7, F7, Gb7, G7, Ab7, A7, Bb7, B7 },
{ C8, Db8, D8, Eb8, E8, F8, Gb8, G8, Ab8, A8, Bb8, B8 }
};
/*
int currentNote = 0;
int currentOctave = 3;
int main()
{
// Set the global sample rate before creating class instances.
Stk::setSampleRate(44100.0);
int i;
FileWvOut output;
SineWave lfo;
lfo.setFrequency(3.0f);
SineWave generator;
// Set the sine wave frequency.
generator.setFrequency(64.0);
// Define and open a 16-bit, four-channel AIFF formatted output file
try {
output.openFile("onesine.wav", 1, FileWrite::FILE_WAV, Stk::STK_SINT16);
}
catch (StkError &) {
exit(1);
}
// Write two seconds of four sines to the output file
StkFrames frames(882000, 1);
// Now write the first sine to all four channels for two seconds
for (i = 0; i<882000; i++) {
output.tick(generator.tick() + lfo.tick() *0.25f);
if (i % 22050 == 0){
currentNote++;
if (currentNote >= NUM_NOTES){
currentNote = 0; currentOctave++;
}
generator.setFrequency(NOTES[currentOctave][currentNote]);
}
}
output.closeFile();
return 0;
}
*/
// The TickData structure holds all the class instances and data that
// are shared by the various processing functions.
struct TickData {
Voicer voicer;
Messager messager;
Skini::Message message;
int counter;
bool haveMessage;
bool done;
// Default constructor.
TickData()
: counter(0), haveMessage(false), done(false) {}
};
#define DELTA_CONTROL_TICKS 64 // default sample frames between control input checks
// The processMessage() function encapsulates the handling of control
// messages. It can be easily relocated within a program structure
// depending on the desired scheduling scheme.
void processMessage(TickData* data)
{
register StkFloat value1 = data->message.floatValues[0];
register StkFloat value2 = data->message.floatValues[1];
switch (data->message.type) {
case __SK_Exit_:
data->done = true;
return;
case __SK_NoteOn_:
std::cout << "RECIEVED NOTE ON..." << value2 << std::endl;
if (value2 == 0.0) // velocity is zero ... really a NoteOff
data->voicer.noteOff(value1, 64.0);
else { // a NoteOn
data->voicer.noteOn(value1, value2);
}
break;
case __SK_NoteOff_:
data->voicer.noteOff(value1, value2);
break;
case __SK_ControlChange_:
data->voicer.controlChange((int)value1, value2);
break;
case __SK_AfterTouch_:
data->voicer.controlChange(128, value1);
case __SK_PitchChange_:
data->voicer.setFrequency(value1);
break;
case __SK_PitchBend_:
data->voicer.pitchBend(value1);
} // end of switch
data->haveMessage = false;
return;
}
// This tick() function handles sample computation and scheduling of
// control updates. It will be called automatically when the system
// needs a new buffer of audio samples.
int tick(void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
double streamTime, RtAudioStreamStatus status, void *dataPointer)
{
TickData *data = (TickData *)dataPointer;
register StkFloat *samples = (StkFloat *)outputBuffer;
int counter, nTicks = (int)nBufferFrames;
while (nTicks > 0 && !data->done) {
if (!data->haveMessage) {
data->messager.popMessage(data->message);
if (data->message.type > 0) {
data->counter = (long)(data->message.time * Stk::sampleRate());
data->haveMessage = true;
std::cout << "GOT MESSAGE :)" << std::endl;
}
else
data->counter = DELTA_CONTROL_TICKS;
}
counter = min(nTicks, data->counter);
data->counter -= counter;
for (int i = 0; i<counter; i++) {
*samples++ = data->voicer.tick();
nTicks--;
}
if (nTicks == 0) break;
// Process control messages.
if (data->haveMessage) processMessage(data);
}
return 0;
}
int main()
{
// Set the global sample rate and rawwave path before creating class instances.
Stk::setSampleRate(44100.0);
Stk::setRawwavePath("../../../../rawwaves/");
int i;
TickData data;
RtAudio dac;
Instrmnt *instrument[3];
for (i = 0; i<3; i++) instrument[i] = 0;
// Figure out how many bytes in an StkFloat and setup the RtAudio stream.
RtAudio::StreamParameters parameters;
parameters.deviceId = dac.getDefaultOutputDevice();
parameters.nChannels = 1;
RtAudioFormat format = (sizeof(StkFloat) == 8) ? RTAUDIO_FLOAT64 : RTAUDIO_FLOAT32;
unsigned int bufferFrames = RT_BUFFER_SIZE;
try {
dac.openStream(¶meters, NULL, format, (unsigned int)Stk::sampleRate(), &bufferFrames, &tick, (void *)&data);
}
catch (RtAudioError &error) {
error.printMessage();
goto cleanup;
}
try {
// Define and load the BeeThree instruments
for (i = 0; i<3; i++)
instrument[i] = new BeeThree();
}
catch (StkError &) {
goto cleanup;
}
// "Add" the instruments to the voicer.
for (i = 0; i<3; i++)
data.voicer.addInstrument(instrument[i]);
if (data.messager.startStdInput() == false)
goto cleanup;
try {
dac.startStream();
}
catch (RtAudioError &error) {
error.printMessage();
goto cleanup;
}
// Block waiting until callback signals done.
while (!data.done)
Stk::sleep(100);
// Shut down the callback and output stream.
try {
dac.closeStream();
}
catch (RtAudioError &error) {
error.printMessage();
}
cleanup:
for (i = 0; i<3; i++) delete instrument[i];
return 0;
}
| 45,731
|
https://github.com/Asana/DefinitelyTyped/blob/master/angular-material/angular-material-0.8.3.d.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
DefinitelyTyped
|
Asana
|
TypeScript
|
Code
| 437
| 1,653
|
// Type definitions for Angular Material 0.8.3+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Matt Traynham <https://github.com/mtraynham>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare namespace angular.material {
interface MDBottomSheetOptions {
templateUrl?: string;
template?: string;
controller?: any;
locals?: {[index: string]: any};
targetEvent?: any;
resolve?: {[index: string]: angular.IPromise<any>}
controllerAs?: string;
parent?: Element;
disableParentScroll?: boolean;
}
interface MDBottomSheetService {
show(options: MDBottomSheetOptions): angular.IPromise<any>;
hide(response?: any): void;
cancel(response?: any): void;
}
interface MDPresetDialog<T> {
title(title: string): T;
content(content: string): T;
ok(content: string): T;
theme(theme: string): T;
}
interface MDAlertDialog extends MDPresetDialog<MDAlertDialog> {
}
interface MDConfirmDialog extends MDPresetDialog<MDConfirmDialog> {
cancel(reason?: string): MDConfirmDialog;
}
interface MDDialogOptions {
templateUrl?: string;
template?: string;
domClickEvent?: any;
disableParentScroll?: boolean;
clickOutsideToClose?: boolean;
hasBackdrop?: boolean;
escapeToClose?: boolean;
controller?: any;
locals?: {[index: string]: any};
bindToController?: boolean;
resolve?: {[index: string]: angular.IPromise<any>}
controllerAs?: string;
parent?: Element;
onComplete?: Function;
}
interface MDDialogService {
show(dialog: MDDialogOptions|MDPresetDialog<any>): angular.IPromise<any>;
confirm(): MDConfirmDialog;
alert(): MDAlertDialog;
hide(response?: any): angular.IPromise<any>;
cancel(response?: any): void;
}
interface MDIcon {
(path: string): angular.IPromise<Element>;
}
interface MDIconProvider {
icon(id: string, url: string, iconSize?: string): MDIconProvider;
iconSet(id: string, url: string, iconSize?: string): MDIconProvider;
defaultIconSet(url: string, iconSize?: string): MDIconProvider;
defaultIconSize(iconSize: string): MDIconProvider;
}
interface MDMedia {
(media: string): boolean;
}
interface MDSidenavObject {
toggle(): void;
open(): void;
close(): void;
isOpen(): boolean;
isLockedOpen(): boolean;
}
interface MDSidenavService {
(component: string): MDSidenavObject;
}
interface MDToastPreset<T> {
content(content: string): T;
action(action: string): T;
highlightAction(highlightAction: boolean): T;
capsule(capsule: boolean): T;
theme(theme: string): T;
hideDelay(delay: number): T;
}
interface MDSimpleToastPreset extends MDToastPreset<MDSimpleToastPreset> {
}
interface MDToastOptions {
templateUrl?: string;
template?: string;
hideDelay?: number;
position?: string;
controller?: any;
locals?: {[index: string]: any};
bindToController?: boolean;
resolve?: {[index: string]: angular.IPromise<any>}
controllerAs?: string;
parent?: Element;
}
interface MDToastService {
show(optionsOrPreset: MDToastOptions|MDToastPreset<any>): angular.IPromise<any>;
showSimple(): angular.IPromise<any>;
simple(): MDSimpleToastPreset;
build(): MDToastPreset<any>;
updateContent(): void;
hide(response?: any): void;
cancel(response?: any): void;
}
interface MDPalette {
0?: string;
50?: string;
100?: string;
200?: string;
300?: string;
400?: string;
500?: string;
600?: string;
700?: string;
800?: string;
900?: string;
A100?: string;
A200?: string;
A400?: string;
A700?: string;
contrastDefaultColor?: string;
contrastDarkColors?: string;
contrastStrongLightColors?: string;
}
interface MDThemeHues {
default?: string;
'hue-1'?: string;
'hue-2'?: string;
'hue-3'?: string;
}
interface MDThemePalette {
name: string;
hues: MDThemeHues;
}
interface MDThemeColors {
accent: MDThemePalette;
background: MDThemePalette;
primary: MDThemePalette;
warn: MDThemePalette;
}
interface MDThemeGrayScalePalette {
1: string;
2: string;
3: string;
4: string;
name: string;
}
interface MDTheme {
name: string;
colors: MDThemeColors;
foregroundPalette: MDThemeGrayScalePalette;
foregroundShadow: string;
accentPalette(name: string, hues?: MDThemeHues): MDTheme;
primaryPalette(name: string, hues?: MDThemeHues): MDTheme;
warnPalette(name: string, hues?: MDThemeHues): MDTheme;
backgroundPalette(name: string, hues?: MDThemeHues): MDTheme;
dark(isDark?: boolean): MDTheme;
}
interface MDThemingProvider {
theme(name: string, inheritFrom?: string): MDTheme;
definePalette(name: string, palette: MDPalette): MDThemingProvider;
extendPalette(name: string, palette: MDPalette): MDPalette;
setDefaultTheme(theme: string): void;
alwaysWatchTheme(alwaysWatch: boolean): void;
}
}
| 29,664
|
https://github.com/Squidex/squidex/blob/master/frontend/src/app/framework/angular/forms/error-validator.spec.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
squidex
|
Squidex
|
TypeScript
|
Code
| 418
| 1,442
|
/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { ErrorDto } from '@app/framework/internal';
import { ErrorValidator } from './error-validator';
describe('ErrorValidator', () => {
const validator = new ErrorValidator();
const control = new UntypedFormGroup({
nested1: new UntypedFormArray([
new UntypedFormGroup({
nested2: new UntypedFormControl(),
}),
]),
});
beforeEach(() => {
control.reset([]);
});
it('should return no message if error is null', () => {
validator.setError(null);
const error = validator.validator(control);
expect(error).toBeNull();
});
it('should return no message if error does not match', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'nested1Property: My Error.',
]));
const error = validator.validator(control.get('nested1')!);
expect(error).toBeNull();
});
it('should return matching error', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'other, nested1: My Error.',
]));
const error = validator.validator(control.get('nested1')!);
expect(error).toEqual({
custom: {
errors: ['My Error.'],
},
});
});
it('should return matching error twice if value does not change', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'nested1: My Error.',
]));
const error1 = validator.validator(control.get('nested1')!);
const error2 = validator.validator(control.get('nested1')!);
expect(error1).toEqual({
custom: {
errors: ['My Error.'],
},
});
expect(error2).toEqual({
custom: {
errors: ['My Error.'],
},
});
});
it('should not return matching error again if value has changed', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'nested1[1].nested2: My Error.',
]));
const nested = control.get('nested1.0.nested2');
nested?.setValue('a');
const error1 = validator.validator(nested!);
nested?.setValue('b');
const error2 = validator.validator(nested!);
expect(error1).toEqual({
custom: {
errors: ['My Error.'],
},
});
expect(error2).toBeNull();
});
it('should not return matching error again if value has changed to initial', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'nested1[1].nested2: My Error.',
]));
const nested = control.get('nested1.0.nested2');
nested?.setValue('a');
const error1 = validator.validator(nested!);
nested?.setValue('b');
const error2 = validator.validator(nested!);
nested?.setValue('a');
const error3 = validator.validator(nested!);
expect(error1).toEqual({
custom: {
errors: ['My Error.'],
},
});
expect(error2).toBeNull();
expect(error3).toBeNull();
});
it('should return matching errors', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'nested1: My Error1.',
'nested1: My Error2.',
]));
const error = validator.validator(control.get('nested1')!);
expect(error).toEqual({
custom: {
errors: ['My Error1.', 'My Error2.'],
},
});
});
it('should return deeply matching error', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'nested1[1].nested2: My Error.',
]));
const error = validator.validator(control.get('nested1.0.nested2')!);
expect(error).toEqual({
custom: {
errors: ['My Error.'],
},
});
});
it('should return partial matching error', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'nested1[1].nested2: My Error.',
]));
const error = validator.validator(control.get('nested1.0')!);
expect(error).toEqual({
custom: {
errors: ['nested2: My Error.'],
},
});
});
it('should return partial matching index error', () => {
validator.setError(new ErrorDto(500, 'Error', null, [
'nested1[1].nested2: My Error.',
]));
const error = validator.validator(control.get('nested1')!);
expect(error).toEqual({
custom: {
errors: ['[1].nested2: My Error.'],
},
});
});
});
| 35,370
|
https://github.com/johnblakey/ASCII-Bug-World/blob/master/PredatorVsPrey/src/com/github/johnblakey/bug/world/Plant.java
|
Github Open Source
|
Open Source
|
MIT
| null |
ASCII-Bug-World
|
johnblakey
|
Java
|
Code
| 149
| 390
|
package com.github.johnblakey.bug.world;
import java.util.HashSet;
import java.util.Iterator;
public class Plant extends Organism {
Plant(int x, int y) {
// TODO refactor to not have to enter a dummy value of 0
super(".", x, y, 15, 100, 0);
eatBehavior = new NoEat();
}
public boolean moveToEat(HashSet<Organism> organisms) {
return false;
}
public boolean move(HashSet<Organism> organisms) {
return false;
}
public boolean validReproduceSquare(HashSet<Organism> square) {
// Reproduce to an empty square
if (square.size() == 0) {
return true;
}
Iterator<Organism> i = square.iterator();
Organism next;
boolean hasPlant = false;
while (i.hasNext()) {
next = i.next();
if (next instanceof Plant) {
hasPlant = true;
}
}
// Do not reproduce to a square with a plant
if (!hasPlant)
return true;
else
return false;
}
public Organism createOffspring(SquareCoordinates squareCoordinates) {
return new Plant(squareCoordinates.getX(), squareCoordinates.getY());
}
// TODO refactor, hacky override should use a different design
@Override
public boolean getHasEaten() {
return true;
}
}
| 27,280
|
https://github.com/soyacen/goutils/blob/master/stringutils/blank.go
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
goutils
|
soyacen
|
Go
|
Code
| 120
| 254
|
package stringutils
import "strings"
// IsBlank Checks if a string is empty ("") or whitespace only.
func IsBlank(s string) bool {
return len(strings.TrimSpace(s)) == 0
}
// IsNotBlank Checks if a string is not empty ("") and not whitespace only.
func IsNotBlank(s string) bool {
return !IsBlank(s)
}
// IsAllBlank Checks if all of the CharSequences are empty ("") or whitespace only.
func IsAllBlank(ss ...string) bool {
for _, s := range ss {
if IsNotBlank(s) {
return false
}
}
return true
}
// IsAnyBlank Checks if any of the string are empty ("") or whitespace only.
func IsAnyBlank(ss ...string) bool {
for _, s := range ss {
if IsBlank(s) {
return true
}
}
return false
}
| 34,293
|
https://github.com/piscesdk/kglb/blob/master/kglb/control_plane/balancer.go
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
kglb
|
piscesdk
|
Go
|
Code
| 1,880
| 6,122
|
package control_plane
import (
"context"
"fmt"
"net"
"sync"
"sync/atomic"
"time"
"github.com/gogo/protobuf/proto"
"dropbox/dlog"
"dropbox/exclog"
"dropbox/kglb/common"
"dropbox/kglb/utils/discovery"
"dropbox/kglb/utils/dns_resolver"
"dropbox/kglb/utils/fwmark"
"dropbox/kglb/utils/health_manager"
pb "dropbox/proto/kglb"
"dropbox/vortex2/v2stats"
"godropbox/errors"
)
const (
DefaultWeightUp = uint32(1000)
DefaultWeightDown = uint32(0)
// default number of concurrent health checks.
DefaultCheckerConcurrency = 100
// default delay between updating state retry attempts in case of failed dns
// resolution.
DefaultUpdateRetryWaitTime = 5 * time.Second
)
type BalancerParams struct {
// Upstream configuration.
BalancerConfig *pb.BalancerConfig
// Discovery Resolver factory.
ResolverFactory DiscoveryFactory
// Health Checker factory.
CheckerFactory HealthCheckerFactory
// Dns Resolver.
DnsResolver dns_resolver.DnsResolver
// Channel where balancer will send updated states.
UpdatesChan chan *BalancerState
// global fwmark manager
FwmarkManager *fwmark.Manager
// wait time between updating state retry attempts in case of failed
// dns resolution.
UpdateRetryWaitTime time.Duration
}
// Discovers, health checks, resolves hostnames and generates []*pb.BalancerState
// during changes. Balancer provides updates of the state via UpdatesChan
// channel provided in BalancerParams, it doesn't create own to simplify
// monitoring changes across multiple Balancers.
type Balancer struct {
mutex sync.Mutex
// Upstream name.
name string
// VIP of the balancer.
vip string
// Health Manager.
healthMng *health_manager.HealthManager
// Fwmark Manager
fwmarkMng *fwmark.Manager
// Discovery Resolver.
resolver discovery.DiscoveryResolver
// Config update chan.
updatesConf chan struct{}
// latest successfully applied balancer config.
config *pb.BalancerConfig
params *BalancerParams
// latest balancer state.
state atomic.Value // *BalancerState
initialState bool
// v2 stats
statUpstreamsCount *v2stats.GaugeGroup
statBalancerState *v2stats.GaugeGroup
ctx context.Context
cancelFunc context.CancelFunc
// Weights of healthy reals.
weightUp uint32
}
func getAddressFamilyFromVip(vip string) pb.AddressFamily {
ip := net.ParseIP(vip)
if ip == nil {
// fwmark vip
return -1
}
if ip.To4() != nil {
return pb.AddressFamily_AF_INET
}
return pb.AddressFamily_AF_INET6
}
// for testing.
func newBalancer(
ctx context.Context,
params BalancerParams) (*Balancer, error) {
// use default timeout for updating state retry attempts wait time when
// it's not specified.
if params.UpdateRetryWaitTime == 0 {
params.UpdateRetryWaitTime = DefaultUpdateRetryWaitTime
}
// Balancer instance.
up := &Balancer{
name: params.BalancerConfig.GetName(),
config: params.BalancerConfig,
updatesConf: make(chan struct{}, 1),
params: ¶ms,
fwmarkMng: params.FwmarkManager,
initialState: true,
weightUp: params.BalancerConfig.GetWeightUp(),
// v2 stats
statBalancerState: v2stats.NewGaugeGroup(balancerStateGauge),
statUpstreamsCount: v2stats.NewGaugeGroup(upstreamsCountGauge),
}
if up.weightUp == 0 {
up.weightUp = DefaultWeightUp
}
up.ctx, up.cancelFunc = context.WithCancel(ctx)
// extracting vip.
vip, _, err := common.GetVipFromLbService(params.BalancerConfig.GetLbService())
if err != nil {
return nil, errors.Wrapf(
err,
"fails to extract vip: %+v: ",
params.BalancerConfig)
}
up.vip = vip
up.params = ¶ms
// 1. Creating discovery resolver.
discoveryConf := up.config.GetUpstreamDiscovery()
up.resolver, err = params.ResolverFactory.Resolver(
up.name,
up.params.BalancerConfig.SetupName,
discoveryConf)
if err != nil {
return nil, errors.Wrapf(err, "fails to create resolver: ")
}
// 2. Creating HealthChecker.
healthchecker, err := up.params.CheckerFactory.Checker(up.config)
if err != nil {
return nil, errors.Wrapf(err, "fails to create checker: ")
}
healthManagerParams := health_manager.HealthManagerParams{
Id: up.Name(),
Resolver: up.resolver,
DnsResolver: params.DnsResolver,
HealthChecker: healthchecker,
SetupName: up.params.BalancerConfig.SetupName,
ServiceName: up.Name(),
AddressFamily: getAddressFamilyFromVip(vip),
UpstreamCheckerAttributes: up.config.GetUpstreamChecker(),
}
up.healthMng, err = health_manager.NewHealthManager(up.ctx, healthManagerParams)
if err != nil {
return nil, errors.Wrapf(err, "fails to create health manager: ")
}
// balancer is in initial state since there was no any healthy upstreams.
up.state.Store(&BalancerState{
InitialState: true,
})
return up, nil
}
func NewBalancer(
ctx context.Context,
params BalancerParams) (*Balancer, error) {
up, err := newBalancer(ctx, params)
if err != nil {
return nil, err
}
up.updateBalancerStateGauge(1, "initial")
// starting update loop.
go up.updateLoop()
return up, nil
}
// Returns Balancer name.
func (u *Balancer) Name() string {
u.mutex.Lock()
defer u.mutex.Unlock()
return u.name
}
// Returns latest successfully applied config.
func (u *Balancer) GetConfig() *pb.BalancerConfig {
u.mutex.Lock()
defer u.mutex.Unlock()
return u.config
}
// Returns current state of the Balancer.
func (u *Balancer) GetState() *BalancerState {
return u.state.Load().(*BalancerState)
}
// Returns channel provided in params. Balancer sends new states into it when
// it's writable.
func (u *Balancer) Updates() <-chan *BalancerState {
return u.params.UpdatesChan
}
// Updates balancer.
// FIXME(oleg) Update() should never be used as with current implementation
// there is high probability of leaving Balancer in inconsistent state
// with partially applied changes.
// Instead Balancer should be recreated and swapped.
func (u *Balancer) Update(conf *pb.BalancerConfig) error {
// process single update at a time.
u.mutex.Lock()
defer u.mutex.Unlock()
// Going through BalancerConfig and update internals.
// 1. Sanity check (name and setup name in the config should match existent).
if u.name != conf.GetName() {
return errors.Newf("Updating balancer name is not allowed: %s -> %s",
u.name, conf.GetName())
}
if u.config.GetSetupName() != conf.GetSetupName() {
return errors.Newf("Updating balancer setup name is not allowed: %s -> %s",
u.config.GetSetupName(), conf.GetSetupName())
}
// checking vip.
vip, _, err := common.GetVipFromLbService(conf.GetLbService())
if err != nil {
return errors.Wrapf(err, "fails to extract vip: %+v: ", conf)
}
// changing vip is not allowed because it might affect stats.
if u.vip != vip {
return errors.Newf(
"Updating vip is not allowed: %s, %s -> %s",
u.name,
u.vip,
vip)
}
// 2. Updating discovery.
discoveryConf := conf.GetUpstreamDiscovery()
err = u.params.ResolverFactory.Update(u.resolver, discoveryConf)
if err == ErrResolverIncompatibleType {
resolver, err := u.params.ResolverFactory.Resolver(
u.name,
conf.SetupName,
discoveryConf)
if err != nil {
return errors.Wrapf(err, "fails to create resolver: ")
}
// update resolver.
u.healthMng.UpdateResolver(resolver)
// closing old resolver and updating reference.
u.resolver.Close()
u.resolver = resolver
} else if err != nil {
return errors.Wrapf(err, "fails to update resolver: ")
}
checkerConf := conf.GetUpstreamChecker()
// 3. Updating HealthChecker if configuration changed.
if !proto.Equal(u.healthMng.GetCheckerConfiguration(), checkerConf.GetChecker()) {
dlog.Info("creating new upstream checker: %+v", checkerConf)
checker, err := u.params.CheckerFactory.Checker(conf)
if err != nil {
return errors.Wrapf(err, "fails to create health checker: ")
}
// updating health manager.
u.healthMng.UpdateHealthChecker(checker)
}
// 4. Updating health thresholds.
if err := u.healthMng.Update(checkerConf); err != nil {
return errors.Wrapf(err, "failed to update health manager")
}
// 6. Update reference to the config.
u.config = conf
// updating healthy weight.
newWeightUp := conf.GetWeightUp()
if newWeightUp == 0 {
newWeightUp = DefaultWeightUp
}
if u.weightUp != newWeightUp {
u.weightUp = newWeightUp
// force regeneration balancer state, otherwise it will require update
// from health manager.
select {
case u.updatesConf <- struct{}{}:
default:
}
}
return nil
}
// Closes Balancer.
func (u *Balancer) Close() {
// "Reset" balancer state gauge
u.updateBalancerStateGauge(0, "shutdown")
// canceling context which will close manager and update channel.
u.cancelFunc()
u.resolver.Close()
}
func getAddressString(state *pb.UpstreamState) string {
ip := state.GetAddress()
switch ip.GetAddress().(type) {
case *pb.IP_Ipv4:
return ip.GetIpv4()
case *pb.IP_Ipv6:
return ip.GetIpv6()
default:
return ""
}
}
func (u *Balancer) manageFwmarkAllocations(upstreamStates []*pb.UpstreamState) {
// what have added:
balancerStates := u.GetState()
for _, state := range upstreamStates {
addr := getAddressString(state)
found := false
if len(balancerStates.States) > 0 {
for _, oldState := range balancerStates.States[0].Upstreams {
if addr == getAddressString(oldState) {
found = true
break
}
}
}
if !found {
// new upstream. we need to allocate new fwmark for it
_, err := u.fwmarkMng.AllocateFwmark(addr)
if err != nil {
exclog.Report(
errors.Newf("failed to allocate fwmark for: %s error: %s", state.Hostname, err.Error()),
exclog.Critical, "")
}
}
}
if len(balancerStates.States) > 0 {
// what was removed:
for _, oldState := range balancerStates.States[0].Upstreams {
addr := getAddressString(oldState)
found := false
for _, state := range upstreamStates {
if addr == getAddressString(state) {
found = true
break
}
}
if !found {
// hostname not in the list of backends anymore. release fwmark
err := u.fwmarkMng.ReleaseFwmark(addr)
if err != nil {
exclog.Report(
errors.Newf("failed to release fwmark for: %s error: %s", oldState.Hostname, err.Error()),
exclog.Critical, "")
}
}
}
}
}
func (u *Balancer) generateFwmarkService(
vip string,
upstreamState *pb.UpstreamState) *pb.BalancerState {
fwmarkVal, err := u.fwmarkMng.GetAllocatedFwmark(getAddressString(upstreamState))
if err != nil {
exclog.Report(
errors.Newf("failed to get allocated fwmark for: %s error: %s",
upstreamState.Hostname, err.Error()),
exclog.Critical, "")
return nil
}
return &pb.BalancerState{
Name: fmt.Sprintf("fwmark%d", fwmarkVal),
LbService: &pb.LoadBalancerService{
Service: &pb.LoadBalancerService_IpvsService{
IpvsService: &pb.IpvsService{
Attributes: &pb.IpvsService_FwmarkAttributes{
FwmarkAttributes: &pb.IpvsFwmarkAttributes{
Fwmark: fwmarkVal,
AddressFamily: common.KglbAddrToFamily(upstreamState.GetAddress()),
},
},
},
},
},
Upstreams: []*pb.UpstreamState{
{
Hostname: upstreamState.GetHostname(),
Port: uint32(0),
Address: upstreamState.GetAddress(),
// mark as UP, otherwise ipvs drops health checks
Weight: u.weightUp,
ForwardMethod: upstreamState.GetForwardMethod(),
},
},
}
}
// Updates manager's state.
func (u *Balancer) updateState(
state health_manager.HealthManagerState) {
u.mutex.Lock()
defer u.mutex.Unlock()
// generate UpstreamState based on provided HealthManagerState state.
upstreamStates := []*pb.UpstreamState{}
for _, entry := range state {
if !entry.HostPort.Enabled {
// skip hosts which are disabled in service discovery
continue
}
// getting ip.
ip, err := u.params.DnsResolver.ResolveHost(
entry.HostPort.Host,
u.config.GetUpstreamDiscovery().GetResolveFamily())
if err != nil {
exclog.Report(
errors.Wrapf(
err,
"fails to resolve %s in %s balancer: ",
entry.HostPort.Host,
u.name),
exclog.Critical, "")
// try to regenerate state in few seconds, otherwise it will not be
// happened until next update from health manager.
time.AfterFunc(u.params.UpdateRetryWaitTime, func() {
select {
case u.updatesConf <- struct{}{}:
dlog.Infof(
"will retry to update state of %s balancer in %v because "+
"of failed dns resolution.",
u.name,
u.params.UpdateRetryWaitTime)
default:
}
})
return
}
upstream := &pb.UpstreamState{
Hostname: entry.HostPort.Host,
Port: uint32(entry.HostPort.Port),
Address: ip,
// forward method.
ForwardMethod: u.config.GetUpstreamRouting().GetForwardMethod(),
}
if entry.Status.IsHealthy() {
upstream.Weight = u.weightUp
} else {
upstream.Weight = DefaultWeightDown
}
upstreamStates = append(upstreamStates, upstream)
}
// main state.
aliveRatio := common.AliveUpstreamsRatio(upstreamStates)
if u.initialState && aliveRatio > 0 {
u.initialState = false
}
// TODO(belyalov): remove v1 stat
upstreamCnt := len(upstreamStates)
// doesn't make sense to announce route without any upstreams.
if upstreamCnt == 0 {
dlog.Info(
"balancer doesn't have any upstreams: ",
u.name)
}
// marking all backends as healthy when all of them failing healthcheck,
// because it
if !u.initialState && aliveRatio == 0 && upstreamCnt > 0 {
dlog.Error("failsafe mode is enabled: ", u.name)
u.updateBalancerStateGauge(1, "failsafe")
for _, state := range upstreamStates {
state.Weight = u.weightUp
}
// updating alive ratio since weight was modified.
aliveRatio = common.AliveUpstreamsRatio(upstreamStates)
} else {
dlog.Info("failsafe mode is disabled: ", u.name)
if upstreamCnt == 0 {
u.updateBalancerStateGauge(1, "no_upstreams")
} else {
u.updateBalancerStateGauge(1, "available")
}
}
// Report alive/dead upstream counters
u.updateUpstreamCountGauge(upstreamStates)
balancerState := &BalancerState{
States: []*pb.BalancerState{
{
Name: u.name,
LbService: u.config.GetLbService(),
Upstreams: upstreamStates,
},
},
AliveRatio: aliveRatio,
InitialState: u.initialState,
}
// generate fwmark states.
var fwmarkStates []*pb.BalancerState
if u.config.GetEnableFwmarks() {
u.manageFwmarkAllocations(upstreamStates)
fwmarkStates = make([]*pb.BalancerState, len(upstreamStates))
i := 0
for _, upstreamState := range upstreamStates {
service := u.generateFwmarkService(u.vip, upstreamState)
if service != nil {
fwmarkStates[i] = service
i++
}
}
balancerState.States = append(
balancerState.States,
fwmarkStates[0:i]...)
}
// update state.
u.state.Store(balancerState)
// notify about the change.
select {
case u.params.UpdatesChan <- balancerState:
dlog.Infof(
"new state has been sent by Balancer: %+v",
balancerState)
default:
dlog.Infof(
"updateChan of Balancer is full: %s",
u.name)
}
}
// update loop to handle updates from health manager.
func (u *Balancer) updateLoop() {
for {
select {
case _, ok := <-u.healthMng.Updates():
if !ok {
exclog.Report(
errors.Newf("health manager balancer has been closed: %s: ", u.name),
exclog.Critical, "")
u.Close()
return
}
state := u.healthMng.GetState()
dlog.Infof("performing update by Balancer: %s, %+v", u.name, state)
u.updateState(state)
case <-u.ctx.Done():
dlog.Infof("Closing Balancer: %s", u.name)
u.Close()
return
case <-u.updatesConf:
// regenerate config because of Balancer change.
u.updateState(u.healthMng.GetState())
}
}
}
// Updates current state of balancer
func (u *Balancer) updateBalancerStateGauge(value float64, state string) {
tags := v2stats.KV{
"setup": u.params.BalancerConfig.SetupName,
"service": u.params.BalancerConfig.Name,
"state": state,
}
err := u.statBalancerState.PrepareToSet(value, tags)
if err != nil {
exclog.Report(errors.Wrapf(err,
"unable to set balancerState gauge (%v)", tags), exclog.Critical, "")
return
}
u.statBalancerState.SetAndReset()
}
// Updates current upstreams counts (alive/dead) v2 gauge
func (u *Balancer) updateUpstreamCountGauge(upstreams []*pb.UpstreamState) {
total := len(upstreams)
alive := 0
for _, u := range upstreams {
if u.Weight != 0 {
alive += 1
}
}
tags := v2stats.KV{
"setup": u.params.BalancerConfig.SetupName,
"service": u.params.BalancerConfig.Name,
"alive": "true",
}
err := u.statUpstreamsCount.PrepareToSet(float64(alive), tags)
if err != nil {
exclog.Report(errors.Wrapf(err,
"unable to set upstreamsCountGauge gauge (%v)", tags), exclog.Critical, "")
return
}
tags["alive"] = "false"
err = u.statUpstreamsCount.PrepareToSet(float64(total-alive), tags)
if err != nil {
exclog.Report(errors.Wrapf(err,
"unable to set upstreamsCountGauge gauge (%v)", tags), exclog.Critical, "")
return
}
u.statUpstreamsCount.SetAndReset()
}
| 48,706
|
https://github.com/BryanYen0619/MyKotlinExample/blob/master/app/src/main/java/com/example/bryanyen/kotlintest/model/PublicUtilityManagementItem.kt
|
Github Open Source
|
Open Source
|
MIT
| 2,017
|
MyKotlinExample
|
BryanYen0619
|
Kotlin
|
Code
| 173
| 589
|
package com.example.bryanyen.kotlintest.model
import android.os.Parcel
import android.os.Parcelable
/**
* Created by bryan.yen on 2017/5/8.
*/
class PublicUtilityManagementItem : Parcelable {
var id: String? = null
var name: String? = null
var description: String? = null
var img: String? = null
var length: String? = null
var unitMinutes: String? = null
var points: String? = null
var startAtWeekday: String? = null
var endAtWeekday: String? = null
var startAtWeekend: String? = null
var endAtWeekend: String? = null
constructor() {
}
constructor(parcel: Parcel) {
id = parcel.readString()
name = parcel.readString()
description = parcel.readString()
img = parcel.readString()
length = parcel.readString()
unitMinutes = parcel.readString()
points = parcel.readString()
startAtWeekday = parcel.readString()
endAtWeekday = parcel.readString()
startAtWeekend = parcel.readString()
endAtWeekend = parcel.readString()
}
override fun describeContents(): Int {
return 0
}
override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeString(id)
dest.writeString(name)
dest.writeString(description)
dest.writeString(img)
dest.writeString(length)
dest.writeString(unitMinutes)
dest.writeString(points)
dest.writeString(startAtWeekday)
dest.writeString(endAtWeekday)
dest.writeString(startAtWeekend)
dest.writeString(endAtWeekend)
}
companion object {
val CREATOR: Parcelable.Creator<PublicUtilityManagementItem> = object : Parcelable.Creator<PublicUtilityManagementItem> {
override fun createFromParcel(`in`: Parcel): PublicUtilityManagementItem {
return PublicUtilityManagementItem(`in`)
}
override fun newArray(size: Int): Array<PublicUtilityManagementItem?> {
return arrayOfNulls(size)
}
}
}
}
| 2,492
|
https://github.com/blackbaud/skyux/blob/master/libs/components/ag-grid/src/lib/modules/ag-grid/types/cell-editor-currency-params.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
skyux
|
blackbaud
|
TypeScript
|
Code
| 25
| 70
|
import { ICellEditorParams } from 'ag-grid-community';
import { SkyAgGridCurrencyProperties } from './currency-properties';
/**
* @internal
*/
export interface SkyCellEditorCurrencyParams extends ICellEditorParams {
skyComponentProperties?: SkyAgGridCurrencyProperties;
}
| 35,579
|
https://github.com/chenyg1119/fluid-simulation/blob/master/Fluid2d/experiments/Vortex/vortex.py
|
Github Open Source
|
Open Source
|
MIT
| null |
fluid-simulation
|
chenyg1119
|
Python
|
Code
| 882
| 2,750
|
"""
Vortex dynamics
Several initial states are provided: select one with 'vortex_config'
"""
import sys
try:
from param import Param
except:
print("[ERROR] unable to import the param module")
print("[INFO] you likely forgot to set $PYTHONPATH")
print("[INFO] depending on your shell")
print("> source ~/.fluid2d/activate.sh")
print("> source ~/.fluid2d/activate.csh")
print("> source ~/.fluid2d/activate.fish")
sys.exit()
from grid import Grid
from fluid2d import Fluid2d
import numpy as np
import ana_profiles as ap
# If the code immediately stops with
# Traceback (most recent call last):
# File "vortex.py", line 1, in <module>
# from param import Param
# ImportError: No module named param
# it means that you forgot to do
# source activate.sh in your terminal
param = Param('default.xml')
param.modelname = 'euler'
param.expname = 'vortex_00'
# domain and resolution
param.nx = 64*2
param.ny = param.nx
param.Ly = param.Lx
param.npx = 1
param.npy = 1
param.geometry = 'closed'
# time
param.tend = 10
param.cfl = 1.
param.adaptable_dt = True
param.dt = 0.01
param.dtmax = 100
# discretization
param.order = 3
param.timestepping = 'RK3_SSP'
param.exacthistime = True
# output
param.var_to_save = ['vorticity', 'psi', 'tracer']
param.list_diag = 'all'
param.freq_plot = 10
param.freq_his = .2
param.freq_diag = 0.02
# plot
param.freq_plot = 10
param.plot_interactive = True
param.plot_psi = True
param.plot_var = 'vorticity'
param.cax = np.array([-2, 2.])*5
param.colorscheme = 'imposed'
param.generate_mp4 = False
# physics
param.noslip = False
param.diffusion = False
param.additional_tracer = ['tracer']
grid = Grid(param)
param.Kdiff = 5e-2*grid.dx
xr, yr = grid.xr, grid.yr
# it's time to modify the mask and add obstacles if you wish, 0 is land
msk_config = 'none' # the other possibility is 'T-wall' or 'bay'
if msk_config == 'bay':
x0, y0, radius = 0.5, 0.35, 0.2
y1 = 0.5
msk2 = ap.vortex(xr, yr, param.Lx, param.Ly,
x0, y0, radius, 'step')
grid.msk[yr < y1] = 0
grid.msk += np.asarray(msk2, dtype=int)
grid.msk[grid.msk < 0] = 0
grid.msk[grid.msk > 1] = 1
grid.msk[0:1, :] = 0
grid.finalize_msk()
elif msk_config == 'T-wall':
i0, j0 = param.nx//2, param.ny//2
di = int(0.25*param.Lx/grid.dx)
grid.msk[:j0, i0] = 0
grid.msk[j0, i0-di:i0+di] = 0
grid.finalize_msk()
else:
# do nothing
pass
f2d = Fluid2d(param, grid)
model = f2d.model
vor = model.var.get('vorticity')
def vortex(param, grid, x0, y0, sigma,
vortex_type, ratio=1):
"""Setup a compact distribution of vorticity
at location x0, y0 vortex, width is sigma, vortex_type controls
the radial vorticity profile, ratio controls the x/y aspect ratio
(for ellipses)
"""
xr, yr = grid.xr, grid.yr
# ratio controls the ellipticity, ratio=1 is a disc
x = np.sqrt((xr-param.Lx*x0)**2+(yr-param.Ly*y0)**2*ratio**2)
y = x.copy()*0.
if vortex_type in ('gaussian', 'cosine', 'step'):
if vortex_type == 'gaussian':
y = np.exp(-x**2/(sigma**2))
elif vortex_type == 'cosine':
y = np.cos(x/sigma*np.pi/2)
y[x > sigma] = 0.
elif vortex_type == 'step':
y[x <= sigma] = 1.
else:
print('this kind of vortex (%s) is not defined' % vortex_type)
return y
# 2/ set an initial tracer field
vtype = 'gaussian'
# vortex width
sigma = 0.0*param.Lx
vortex_config = 'dipole2'
if vortex_config == 'single':
vtype = 'gaussian'
sigma = 0.03*param.Lx
vor[:] = vortex(param, grid, 0.4, 0.54, sigma,
vtype, ratio=1)
elif vortex_config == 'dipolebay':
vtype = 'gaussian'
sigma = 0.03*param.Lx
y2 = 0.53
vor[:] = vortex(param, grid, 0.15, y2, sigma,
vtype, ratio=1)
vor[:] -= vortex(param, grid, -0.15, y2, sigma,
vtype, ratio=1)
elif vortex_config == 'dipole2':
vtype = 'gaussian'
sigma = 0.05*param.Lx
x0 = 0.7
vor[:] = -vortex(param, grid, x0, 0.42, sigma,
vtype, ratio=1)
vor[:] += vortex(param, grid, x0, 0.58, sigma,
vtype, ratio=1)
elif vortex_config == 'rankine':
vtype = 'step'
ring_sigma = 0.2*param.Lx
ring_amp = 1.
vor[:] = ring_amp * vortex(param, grid, 0.5, 0.5, ring_sigma,
vtype, ratio=1)
# sigma ring, core = 0.2, 0.135 yields a tripole (with step distribution)
# sigma ring, core = 0.2, 0.12 yields a dipole (with step distribution)
core_sigma = 0.173*param.Lx
core_amp = ring_amp*(ring_sigma**2-core_sigma**2.)/core_sigma**2.
vor[:] -= (core_amp+ring_amp)*vortex(param, grid, 0.5, 0.5, core_sigma,
vtype, ratio=1)
elif vortex_config == 'dipole':
vtype = 'gaussian'
sigma = 0.04*param.Lx
vor[:] = vortex(param, grid, 0.3, 0.52, sigma, vtype)
vor[:] -= vortex(param, grid, 0.3, 0.48, sigma, vtype)
elif vortex_config == 'chasing':
sigma = 0.03*param.Lx
vtype = 'step'
vor[:] = vortex(param, grid, 0.3, 0.6, sigma, vtype)
vor[:] -= vortex(param, grid, 0.3, 0.4, sigma, vtype)
vor[:] += vortex(param, grid, 0.1, 0.55, sigma, vtype)
vor[:] -= vortex(param, grid, 0.1, 0.45, sigma, vtype)
elif vortex_config == 'corotating':
sigma = 0.06*param.Lx
dist = 0.25*param.Lx
vtype = 'gaussian'
vor[:] = vortex(param, grid, 0.5, 0.5+dist/2, sigma, vtype)
vor[:] += vortex(param, grid, 0.5, 0.5-dist/2, sigma, vtype)
elif vortex_config == 'collection':
vtype = 'cosine'
x0 = [0.3, 0.4, 0.6, 0.8]
y0 = [0.5, 0.5, 0.5, 0.5]
amplitude = [1, -2, -1, 2]
width = np.array([1, 0.5, 1, 0.5])*0.04*param.Lx
for x, y, a, s in zip(x0, y0, amplitude, width):
vor[:] += a*vortex(param, grid, x, y, s, vtype)
elif vortex_config == 'unequal':
# Melander, Zabusky, McWilliams 1987
# Asymmetric vortex merger in two dimensions: Which vortex is 'victorious'?
s1 = 0.04*param.Lx
a1 = 1.
s2 = 0.1*param.Lx
a2 = 0.2
vtype = 'cosine'
vor[:] = a1*vortex(param, grid, 0.5, 0.6, s1, vtype)
vor[:] += a2*vortex(param, grid, 0.5, 0.4, s2, vtype)
vor[:] = vor*grid.msk
if False:
np.random.seed(1) # this guarantees the results reproducibility
noise = np.random.normal(size=np.shape(yr))*grid.msk
noise -= grid.domain_integration(noise)*grid.msk/grid.area
grid.fill_halo(noise)
noise_amplitude = 1e-3
vor += noise*noise_amplitude
model.set_psi_from_vorticity()
state = model.var.get('tracer')
state[:] = np.round(xr*6) % 2 + np.round(yr*6) % 2
state *= grid.msk
# % normalization of the vorticity so that enstrophy == 1.
model.diagnostics(model.var, 0)
enstrophy = model.diags['enstrophy']
# print('enstrophy = %g' % enstrophy)
vor[:] = vor[:] / np.sqrt(enstrophy)
model.set_psi_from_vorticity()
f2d.loop()
| 27,309
|
https://github.com/pulumi/pulumi-alicloud/blob/master/sdk/java/src/main/java/com/pulumi/alicloud/cdn/outputs/GetRealTimeLogDeliveriesDelivery.java
|
Github Open Source
|
Open Source
|
Apache-2.0, MPL-2.0, BSD-3-Clause
| 2,023
|
pulumi-alicloud
|
pulumi
|
Java
|
Code
| 474
| 1,190
|
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.alicloud.cdn.outputs;
import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.Objects;
@CustomType
public final class GetRealTimeLogDeliveriesDelivery {
/**
* @return Real-Time Log Service Domain.
*
*/
private String domain;
/**
* @return The ID of the Real Time Log Delivery.
*
*/
private String id;
/**
* @return The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
*
*/
private String logstore;
/**
* @return The name of the Log Service project that is used for real-time log delivery.
*
*/
private String project;
/**
* @return The region where the Log Service project is deployed.
*
*/
private String slsRegion;
/**
* @return The status of the real-time log delivery feature. Valid Values: `online` and `offline`.
*
*/
private String status;
private GetRealTimeLogDeliveriesDelivery() {}
/**
* @return Real-Time Log Service Domain.
*
*/
public String domain() {
return this.domain;
}
/**
* @return The ID of the Real Time Log Delivery.
*
*/
public String id() {
return this.id;
}
/**
* @return The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
*
*/
public String logstore() {
return this.logstore;
}
/**
* @return The name of the Log Service project that is used for real-time log delivery.
*
*/
public String project() {
return this.project;
}
/**
* @return The region where the Log Service project is deployed.
*
*/
public String slsRegion() {
return this.slsRegion;
}
/**
* @return The status of the real-time log delivery feature. Valid Values: `online` and `offline`.
*
*/
public String status() {
return this.status;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(GetRealTimeLogDeliveriesDelivery defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private String domain;
private String id;
private String logstore;
private String project;
private String slsRegion;
private String status;
public Builder() {}
public Builder(GetRealTimeLogDeliveriesDelivery defaults) {
Objects.requireNonNull(defaults);
this.domain = defaults.domain;
this.id = defaults.id;
this.logstore = defaults.logstore;
this.project = defaults.project;
this.slsRegion = defaults.slsRegion;
this.status = defaults.status;
}
@CustomType.Setter
public Builder domain(String domain) {
this.domain = Objects.requireNonNull(domain);
return this;
}
@CustomType.Setter
public Builder id(String id) {
this.id = Objects.requireNonNull(id);
return this;
}
@CustomType.Setter
public Builder logstore(String logstore) {
this.logstore = Objects.requireNonNull(logstore);
return this;
}
@CustomType.Setter
public Builder project(String project) {
this.project = Objects.requireNonNull(project);
return this;
}
@CustomType.Setter
public Builder slsRegion(String slsRegion) {
this.slsRegion = Objects.requireNonNull(slsRegion);
return this;
}
@CustomType.Setter
public Builder status(String status) {
this.status = Objects.requireNonNull(status);
return this;
}
public GetRealTimeLogDeliveriesDelivery build() {
final var o = new GetRealTimeLogDeliveriesDelivery();
o.domain = domain;
o.id = id;
o.logstore = logstore;
o.project = project;
o.slsRegion = slsRegion;
o.status = status;
return o;
}
}
}
| 37,355
|
https://github.com/LightSun/android-study/blob/master/Study/app/src/main/java/study/heaven7/com/android_study/hybrid/action/ForwardHybridAction.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
android-study
|
LightSun
|
Java
|
Code
| 34
| 118
|
package study.heaven7.com.android_study.hybrid.action;
import android.content.Context;
import study.heaven7.com.android_study.hybrid.HybridAction;
/**
* Created by heaven7 on 2017/8/25 0025.
*/
public class ForwardHybridAction implements HybridAction{
@Override
public void onAction(Context context, String param, String callback, int hashOfWebView) {
}
}
| 17,865
|
https://github.com/soemsri/HeroMining/blob/master/ApplicationCore/Rig.cs
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
HeroMining
|
soemsri
|
C#
|
Code
| 33
| 104
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
namespace CryptoMining.ApplicationCore
{
[Serializable]
public class Rig
{
public Rig()
{
Chipsets = new List<GpuInfo>(5);
}
public List<GpuInfo> Chipsets { get; set; }
}
}
| 112
|
https://github.com/ilomilo98/aremi-tmy/blob/master/src/Tmy/Common.hs
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,017
|
aremi-tmy
|
ilomilo98
|
Haskell
|
Code
| 818
| 1,691
|
{-# LANGUAGE OverloadedStrings #-}
module Tmy.Common where
import Data.ByteString (ByteString, empty)
import Data.Csv
import Data.Maybe (fromMaybe)
import Data.Semigroup (Semigroup, Min(..), Max(..), (<>))
import Data.Text (Text, append)
import Data.Text.Encoding (encodeUtf8)
import Data.Time.LocalTime (LocalTime(..), TimeOfDay(..), localTimeOfDay, localDay, todHour, todMin)
import Tmy.Csv
data Stat a = Stat
{ stSum :: !a
, stMax :: !(Max a)
, stMin :: !(Min a)
, stCount :: !Int
, stFillCount :: !Int
} deriving (Show, Eq, Ord)
instance (Num a, Ord a) => Semigroup (Stat a) where
(Stat amean amax amin acnt afcnt) <> (Stat bmean bmax bmin bcnt bfcnt) =
Stat (amean + bmean)
(amax <> bmax)
(amin <> bmin)
(acnt + bcnt)
(afcnt + bfcnt)
data Mean a = Mean
{ sSum :: !a
, sCount :: !Int
, sFillCount :: !Int
} deriving (Show, Eq, Ord)
instance (Num a, Ord a) => Semigroup (Mean a) where
(Mean asum acount afcount) <> (Mean bsum bcount bfcount) =
Mean (asum + bsum) (acount + bcount) (afcount + bfcount)
statRecord :: (ToField a, Fractional a, Show a) => ByteString -> Maybe (Stat a) -> NamedRecord
statRecord prefix Nothing =
let col = (prefix <>)
in namedRecord
[ col " mean" .= empty
, col " max" .= empty
, col " min" .= empty
, col " count" .= empty
, col " fill count" .= empty
]
statRecord prefix (Just s@(Stat _ (Max smax) (Min smin) scount sfcount)) =
let col = (prefix <>)
in namedRecord
[ col " mean" .= statMean s
, col " max" .= smax
, col " min" .= smin
, col " count" .= scount
, col " fill count" .= sfcount
]
statMean :: Fractional a => Stat a -> a
statMean (Stat ssum _ _ scount sfcount) = (ssum / fromIntegral (scount + sfcount))
meanRecord :: (ToField a, Fractional a, Show a) => Text -> Maybe (Mean a) -> NamedRecord
meanRecord prefix Nothing =
let col = encodeUtf8 . append prefix
in namedRecord
[ col " mean" .= empty
, col " count" .= empty
, col " fill count" .= empty
]
meanRecord prefix (Just (Mean ssum scount sfcount)) =
let col = encodeUtf8 . append prefix
in namedRecord
[ col " mean" .= (ssum / fromIntegral (scount + sfcount))
, col " count" .= scount
, col " fill count" .= sfcount
]
mMean :: Fractional a => Mean a -> a
mMean (Mean ssum scount sfcount) = ssum / fromIntegral (scount + sfcount)
maybeStat :: (a -> Spaced (Maybe b))
-> (a -> Spaced (Maybe b))
-> (a -> Spaced (Maybe b))
-> a
-> Maybe (Stat b)
maybeStat meanF maxF minF a =
case maybeMean of
Just mean -> Just (mkStat mean (fromMaybe mean maybeMax) (fromMaybe mean maybeMin))
Nothing -> Nothing
where
maybeMean = unSpaced (meanF a)
maybeMax = unSpaced (maxF a)
maybeMin = unSpaced (minF a)
maybeQualStat :: (a -> Spaced Char)
-> (a -> Spaced (Maybe b))
-> (a -> Spaced (Maybe b))
-> (a -> Spaced (Maybe b))
-> a
-> Maybe (Stat b)
maybeQualStat meanQf meanF maxF minF a =
case qFilter meanQf meanF a of
Just _ -> maybeStat meanF maxF minF a
Nothing -> Nothing
qFilter :: (a -> Spaced Char)
-> (a -> Spaced (Maybe b))
-> a
-> Maybe b
qFilter qf vf a =
if unSpaced (qf a) `elem` ['Y','N','S','F']
then unSpaced (vf a)
else Nothing
mkStat :: a -> a -> a -> Stat a
mkStat smean smax smin = Stat smean (Max smax) (Min smin) 1 0
mkFillStat :: a -> a -> a -> Stat a
mkFillStat smean smax smin = Stat smean (Max smax) (Min smin) 0 1
mkMean :: a -> Mean a
mkMean a = Mean a 1 0
mkFillMean :: a -> Mean a
mkFillMean a = Mean a 0 1
hourGrouper :: (a -> LTime) -> a -> a -> Bool
hourGrouper f a b = floorMinute (f a) == floorMinute (f b)
floorMinute :: LTime -> LTime
floorMinute (LTime a) = LTime (LocalTime (localDay a) (TimeOfDay (todHour (localTimeOfDay a)) 0 0))
minute :: LTime -> Int
minute (LTime a) = (todMin . localTimeOfDay) a
mergeWith :: Ord c => (a -> c)
-> (b -> c)
-> (Maybe a -> Maybe b -> r)
-> [a] -> [b] -> [r]
mergeWith fa fb comb xs ys = go xs ys where
go [] [] = []
go [] bs = map (comb Nothing . Just) bs
go as [] = map (flip comb Nothing . Just) as
go aas@(a:as) bbs@(b:bs) = case compare (fa a) (fb b) of
LT -> comb (Just a) Nothing : go as bbs
EQ -> comb (Just a) (Just b) : go as bs
GT -> comb Nothing (Just b) : go aas bs
combine :: Semigroup b => (a -> b) -> a -> a -> b
combine f a b = f a <> f b
| 32,821
|
https://github.com/paulooosrj/-khiledin-chat/blob/master/packages/utils/__tests__/utils.test.js
|
Github Open Source
|
Open Source
|
MIT
| null |
-khiledin-chat
|
paulooosrj
|
JavaScript
|
Code
| 235
| 842
|
'use strict';
let sessionStorage, utils, document, $;
describe('khiledin-chat-utils', () => {
beforeEach(() => {
sessionStorage = {};
utils = require('..');
});
test('funcao gen_id()', () => {
expect(typeof utils.gen_id()).toBe('number');
});
test('funcao session(string, any) nula', () => {
utils.set('sessionStorage', {
getItem: () => {
return null;
}
});
expect(utils.session()).toEqual(null);
});
test('funcao session(string, any) string', () => {
utils.set('sessionStorage', {
getItem: () => {
return "test";
}
});
expect(utils.session('')).toEqual('test');
});
test('funcao session(string, any) setar valor', () => {
utils.set('sessionStorage', {
getItem: () => {
return null;
},
setItem: (key, value) => {
return {
key,
value
};
}
});
expect(utils.session('test', 'test')).toEqual(true);
});
test('funcao clear_input()', () => {
const $ = () => {
val: (key) => {}
};
utils.clear_input('test');
});
test('funcao user_on_exists()', () => {
const response = utils.user_on_exists({
nome: 'test'
});
expect(response({
peoples_add: ['test']
})).toEqual(true);
});
test('funcao to_scroll()', () => {
utils.set('document', {
querySelector: () => {
return {
scrollHeight: 100
}
}
});
const $ = () => {
animate: (key) => {}
};
utils.to_scroll();
});
test('funcao get_user()', () => {
const response = utils.get_user()({});
expect(response.nome).toEqual('');
});
test('funcao get_horario()', () => {
expect(utils.get_horario().includes(':')).toEqual(true);
});
test('funcao html_element()', () => {
utils.set('document', {
createElement: () => {
return {
innerHTML: '',
firstChild: 'test'
}
}
});
expect(utils.html_element('')).toEqual(null)
});
test('funcao removerAcentos(string)', () => {
expect(utils.removerAcentos('testé')).toBe('teste');
expect(utils.removerAcentos('têsté')).toBe('teste');
});
test('funcao bot_write()', () => {
utils.set('document', {
querySelector: () => {
return {};
}
});
expect(utils.bot_write({
innerHTML: ''
}, ['ola'])).toEqual(undefined)
});
});
| 40,198
|
https://github.com/akyei/html-sketchapp/blob/master/build/html2asketch/helpers/utils.js
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
html-sketchapp
|
akyei
|
JavaScript
|
Code
| 646
| 1,839
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RESIZING_CONSTRAINTS = exports.calculateResizingConstraintValue = exports.makeImageFill = exports.makeColorFill = exports.makeColorFromCSS = undefined;
exports.generateID = generateID;
var _normalizeCssColor = require('normalize-css-color');
var _normalizeCssColor2 = _interopRequireDefault(_normalizeCssColor);
var _sketchConstants = require('sketch-constants');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var lut = [];
for (var i = 0; i < 256; i += 1) {
lut[i] = (i < 16 ? '0' : '') + i.toString(16);
}
// http://stackoverflow.com/a/21963136
function e7() {
var d0 = Math.random() * 0xffffffff | 0;
var d1 = Math.random() * 0xffffffff | 0;
var d2 = Math.random() * 0xffffffff | 0;
var d3 = Math.random() * 0xffffffff | 0;
return String(lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff]) + '-' + String(lut[d1 & 0xff]) + String(lut[d1 >> 8 & 0xff]) + '-' + String(lut[d1 >> 16 & 0x0f | 0x40]) + String(lut[d1 >> 24 & 0xff]) + '-' + String(lut[d2 & 0x3f | 0x80]) + String(lut[d2 >> 8 & 0xff]) + '-' + String(lut[d2 >> 16 & 0xff]) + String(lut[d2 >> 24 & 0xff]) + String(lut[d3 & 0xff]) + String(lut[d3 >> 8 & 0xff]) + String(lut[d3 >> 16 & 0xff]) + String(lut[d3 >> 24 & 0xff]);
}
function generateID() {
return e7();
}
var safeToLower = function safeToLower(input) {
if (typeof input === 'string') {
return input.toLowerCase();
}
return input;
};
// Takes colors as CSS hex, name, rgb, rgba, hsl or hsla
var makeColorFromCSS = exports.makeColorFromCSS = function makeColorFromCSS(input) {
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var nullableColor = (0, _normalizeCssColor2['default'])(safeToLower(input));
var colorInt = nullableColor === null ? 0x00000000 : nullableColor;
var _normalizeColor$rgba = _normalizeCssColor2['default'].rgba(colorInt),
r = _normalizeColor$rgba.r,
g = _normalizeColor$rgba.g,
b = _normalizeColor$rgba.b,
a = _normalizeColor$rgba.a;
return {
_class: 'color',
red: r / 255,
green: g / 255,
blue: b / 255,
alpha: a * alpha
};
};
// Solid color fill
var makeColorFill = exports.makeColorFill = function makeColorFill(cssColor, alpha) {
return {
_class: 'fill',
isEnabled: true,
color: makeColorFromCSS(cssColor, alpha),
fillType: 0,
noiseIndex: 0,
noiseIntensity: 0,
patternFillType: 1,
patternTileScale: 1
};
};
var ensureBase64DataURL = function ensureBase64DataURL(url) {
var imageData = url.match(/data:(.+?)(;(.+))?,(.+)/i);
if (imageData && imageData[3] !== 'base64') {
// Solve for an NSURL bug that can't handle plaintext data: URLs
var type = imageData[1];
var data = decodeURIComponent(imageData[4]);
var encodingMatch = imageData[3] && imageData[3].match(/^charset=(.*)/);
var buffer = void 0;
if (encodingMatch) {
buffer = Buffer.from(data, encodingMatch[1]);
} else {
buffer = Buffer.from(data);
}
return 'data:' + String(type) + ';base64,' + String(buffer.toString('base64'));
}
return url;
};
// patternFillType - 0 1 2 3
var makeImageFill = exports.makeImageFill = function makeImageFill(url) {
var patternFillType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
return {
_class: 'fill',
isEnabled: true,
fillType: _sketchConstants.FillType.Pattern,
image: {
_class: 'MSJSONOriginalDataReference',
_ref_class: 'MSImageData',
_ref: 'images/' + String(generateID()),
url: url.indexOf('data:') === 0 ? ensureBase64DataURL(url) : url
},
noiseIndex: 0,
noiseIntensity: 0,
patternFillType: patternFillType,
patternTileScale: 1
};
};
var containsAllItems = function containsAllItems(needles, haystack) {
return needles.every(function (needle) {
return haystack.includes(needle);
});
};
var calculateResizingConstraintValue = exports.calculateResizingConstraintValue = function calculateResizingConstraintValue() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var noHeight = [RESIZING_CONSTRAINTS.TOP, RESIZING_CONSTRAINTS.BOTTOM, RESIZING_CONSTRAINTS.HEIGHT];
var noWidth = [RESIZING_CONSTRAINTS.LEFT, RESIZING_CONSTRAINTS.RIGHT, RESIZING_CONSTRAINTS.WIDTH];
var validValues = Object.values(RESIZING_CONSTRAINTS);
if (!args.every(function (arg) {
return validValues.includes(arg);
})) {
throw new Error('Unknown resizing constraint');
} else if (containsAllItems(noHeight, args)) {
throw new Error('Can\'t fix height when top & bottom are fixed');
} else if (containsAllItems(noWidth, args)) {
throw new Error('Can\'t fix width when left & right are fixed');
}
return args.length > 0 ? args.reduce(function (acc, item) {
return acc & item;
}, args[0]) : RESIZING_CONSTRAINTS.NONE;
};
var RESIZING_CONSTRAINTS = exports.RESIZING_CONSTRAINTS = {
TOP: 31,
RIGHT: 62,
BOTTOM: 55,
LEFT: 59,
WIDTH: 61,
HEIGHT: 47,
NONE: 63
};
| 25,834
|
https://github.com/richexp/XamarinComponents/blob/master/Android/VectorCompat/source/VectorCompat/VectorDrawable.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,016
|
XamarinComponents
|
richexp
|
C#
|
Code
| 25
| 89
|
using Android.Graphics;
using Android.Runtime;
namespace VectorCompat
{
abstract partial class DrawableCompatInvoker
{
[Register ("setColorFilter", "(Landroid/graphics/ColorFilter;)V", "GetSetColorFilter_Landroid_graphics_ColorFilter_Handler")]
public abstract override void SetColorFilter (ColorFilter cf);
}
}
| 27,754
|
https://github.com/kudchikarsk/SudokuSharp/blob/master/Tests/SolutionCreation/Program.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,017
|
SudokuSharp
|
kudchikarsk
|
C#
|
Code
| 257
| 578
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/*
* Output on my laptop running 10x10_000:
Timing the creation of 100,000 boards.
10,000 boards created in 0.73 seconds for 13707 boards per second.
10,000 boards created in 0.72 seconds for 13832 boards per second.
10,000 boards created in 0.70 seconds for 14265 boards per second.
10,000 boards created in 0.80 seconds for 12423 boards per second.
10,000 boards created in 0.71 seconds for 14034 boards per second.
10,000 boards created in 0.72 seconds for 13810 boards per second.
10,000 boards created in 0.73 seconds for 13753 boards per second.
10,000 boards created in 0.75 seconds for 13396 boards per second.
10,000 boards created in 0.71 seconds for 14073 boards per second.
10,000 boards created in 0.72 seconds for 13892 boards per second.
100,000 boards created in 7.30 seconds for 13692 boards per second.
Press any key to continue . . .
*/
namespace SolutionCreation
{
class Program
{
static void Main(string[] args)
{
int Batches = 10;
int BatchSize = 10000;
Console.WriteLine("Timing the creation of {0:N0} boards.", Batches*BatchSize);
var rnd = new Random(0);
TimeSpan elapsed;
var start = DateTime.Now;
for (int i=0; i< Batches; i++)
{
var bStart = DateTime.Now;
for (int j=0; j< BatchSize; j++)
{
SudokuSharp.Factory.Solution(rnd);
}
elapsed = DateTime.Now - bStart;
Console.WriteLine("{0:N0} boards created in {1:0.00} seconds for {2:N0} boards per second.", BatchSize, elapsed.TotalSeconds, BatchSize / elapsed.TotalSeconds);
}
elapsed = DateTime.Now - start;
Console.WriteLine("{0:N0} boards created in {1:0.00} seconds for {2:N0} boards per second.", Batches*BatchSize, elapsed.TotalSeconds, (Batches*BatchSize) / elapsed.TotalSeconds);
}
}
}
| 24,843
|
https://github.com/clahrc-wish/wish-core-src/blob/master/resources/sql/clahrc2_core_db.sql
|
Github Open Source
|
Open Source
|
LicenseRef-scancode-warranty-disclaimer, LicenseRef-scancode-unknown-license-reference, Apache-2.0
| 2,014
|
wish-core-src
|
clahrc-wish
|
SQL
|
Code
| 2,067
| 7,281
|
-- MySQL dump 10.13 Distrib 5.1.41, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: clahrc2
-- ------------------------------------------------------
-- Server version 5.1.41-3ubuntu12.7
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `clahrc2`
--
/*!40000 DROP DATABASE IF EXISTS `clahrc2`*/;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `clahrc2` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `clahrc2`;
--
-- User account owning 'clahrc2' DB
--
CREATE USER 'clahrc'@'localhost' IDENTIFIED BY 'clahrc';
GRANT ALL PRIVILEGES ON clahrc2 . * TO 'clahrc'@'localhost';
--
-- Table structure for table `comment`
--
DROP TABLE IF EXISTS `comment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comment` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Project_ID` int(11) NOT NULL,
`Event_Date` date NOT NULL,
`Comment` varchar(1000) DEFAULT NULL,
`User_ID` int(11) NOT NULL,
`Rc_Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`),
KEY `fk_comment_project_id` (`Project_ID`),
KEY `fk_comment_user_id` (`User_ID`),
CONSTRAINT `fk_comment_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`),
CONSTRAINT `fk_comment_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `login_audit`
--
DROP TABLE IF EXISTS `login_audit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `login_audit` (
`User_ID` int(11) NOT NULL,
`Session_ID` varchar(45) NOT NULL,
`IP_Address` varchar(15) NOT NULL,
`LoggedIn_DateTime` datetime NOT NULL,
`LoggedOut_DateTime` datetime DEFAULT NULL,
`SessionExpired_DateTime` datetime DEFAULT NULL,
PRIMARY KEY (`User_ID`,`Session_ID`,`IP_Address`,`LoggedIn_DateTime`),
UNIQUE KEY `uk_login_audit_session_id` (`Session_ID`),
CONSTRAINT `fk_login_audit_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `milestone`
--
DROP TABLE IF EXISTS `milestone`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `milestone` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Milestone_Date` date NOT NULL,
`Label` varchar(45) DEFAULT NULL,
`Description` varchar(45) DEFAULT NULL,
`Milestone_Type` varchar(45) NOT NULL,
`Rc_Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `pdsa`
--
DROP TABLE IF EXISTS `pdsa`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pdsa` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Project_ID` int(11) NOT NULL,
`Event_Date` date NOT NULL,
`Description` varchar(5000) DEFAULT NULL,
`Do_Description` varchar(5000) DEFAULT NULL,
`Study_Description` varchar(5000) DEFAULT NULL,
`Act_Description` varchar(5000) DEFAULT NULL,
`Plan_Team` varchar(5000) DEFAULT NULL,
`Study_Team` varchar(5000) DEFAULT NULL,
`Do_Team` varchar(5000) DEFAULT NULL,
`Act_Team` varchar(5000) DEFAULT NULL,
`Do_Date` date DEFAULT NULL,
`Study_Date` date DEFAULT NULL,
`Act_Date` date DEFAULT NULL,
`Cycle_Title` varchar(2000) DEFAULT NULL,
`User_ID` int(11) NOT NULL,
`Rc_Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`),
KEY `fk_pdsa_project_id` (`Project_ID`),
KEY `fk_pdsa_user_id` (`User_ID`),
CONSTRAINT `fk_pdsa_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`),
CONSTRAINT `fk_pdsa_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ppi`
--
DROP TABLE IF EXISTS `ppi`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ppi` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Entry_Date` date NOT NULL,
`Role` varchar(45) NOT NULL,
`Receptive` varchar(200) NOT NULL,
`Difference` varchar(200) NOT NULL,
`Plans` varchar(200) NOT NULL,
`Comments` varchar(1000) NOT NULL,
`User_ID` int(11) NOT NULL,
`Project_ID` int(11) NOT NULL,
`Rc_Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`),
KEY `fk_ppi_project_id` (`Project_ID`),
KEY `fk_ppi_user_id` (`User_ID`),
CONSTRAINT `fk_ppi_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`),
CONSTRAINT `fk_ppi_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `project_tables`
--
DROP TABLE IF EXISTS `project_tables`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_tables` (
`Project_ID` int(11) NOT NULL,
`Table_Name` varchar(45) NOT NULL,
`Table_Label` varchar(45) NOT NULL,
PRIMARY KEY (`Project_ID`,`Table_Name`),
UNIQUE KEY `uk_project_tables_table_name` (`Table_Name`),
UNIQUE KEY `uk_project_tables_table_label` (`Table_Label`),
KEY `fk_project_tables_project_id` (`Project_ID`),
CONSTRAINT `fk_project_tables_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `project_tables` WRITE;
/*!40000 ALTER TABLE `project_tables` DISABLE KEYS */;
INSERT INTO `project_tables` VALUES
(1,'clahrc_wish','clahrc_wish');
/*!40000 ALTER TABLE `project_tables` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `projects`
--
DROP TABLE IF EXISTS `projects`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `projects` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(45) NOT NULL,
`Start_Date` date DEFAULT NULL,
`Implementation_Start_Date` date DEFAULT NULL,
`End_Date` date DEFAULT NULL,
`Short_Name` varchar(45) NOT NULL,
`Description` varchar(10000) DEFAULT NULL,
`Host_Organization` varchar(45) DEFAULT NULL,
`Site_Structure` varchar(45) DEFAULT NULL,
`Type` varchar(45) DEFAULT NULL,
`Active` tinyint(1) NOT NULL,
`Grouping_ID` int(11) NOT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `uk_projects_name` (`Name`),
UNIQUE KEY `uk_projects_short_name` (`Short_Name`),
KEY `fk_projects_grouping_id` (`Grouping_ID`),
CONSTRAINT `fk_projects_grouping_id` FOREIGN KEY (`Grouping_ID`) REFERENCES `project_groupings` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `projects` WRITE;
/*!40000 ALTER TABLE `projects` DISABLE KEYS */;
INSERT INTO `projects` VALUES
(1,'CLAHRC_WISH',NULL,'2011-11-04',NULL,'CLAHRC_WISH','Dummy project to make top admin roles work - DO NOT DELETE.',NULL,NULL,NULL,0,'none');
/*!40000 ALTER TABLE `projects` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `project_groupings`
--
DROP TABLE IF EXISTS `project_groupings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_groupings` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(45) NOT NULL,
`Description` varchar(10000) DEFAULT NULL,
`Theme` varchar(45) NOT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `uk_project_groupings_name` (`Name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `project_groupings` WRITE;
/*!40000 ALTER TABLE `project_groupings` DISABLE KEYS */;
INSERT INTO `project_groupings` VALUES
(1,'none','Dummy grouping to make the WISH admin project work - DO NOT DELETE.','Administration');
/*!40000 ALTER TABLE `project_groupings` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `roles`
--
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(45) NOT NULL,
`Description` varchar(10000) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `uk_roles_name` (`Name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES
(1,'system_administrator','Top level admin role superseding all other roles.'),
(2,'programme_administrator','WRT admin role superseding project_admin role.'),
(3,'programme_lead','Programme user role for users responsible for those coordinating a number of projects. Higher access rights than project admin.'),
(4,'project_administrator','Project admin role superseding project_member role.'),
(5,'information_lead','Project user role for the local information lead. Higher access rights for managing project data.'),
(6,'project_member','Project user role for regular users.'),
(7,'programme_evaluator','Programme user role for users only entitled to view data and reports.'),
(8,'project_viewer','Project user role for users only entitled to view data and reports.');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sustainability`
--
DROP TABLE IF EXISTS `sustainability`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sustainability` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Project_ID` int(11) NOT NULL,
`Event_Date` date NOT NULL,
`Score_1` int(11) NOT NULL,
`Score_2` int(11) NOT NULL,
`Score_3` int(11) NOT NULL,
`Score_4` int(11) NOT NULL,
`Score_5` int(11) NOT NULL,
`Score_6` int(11) NOT NULL,
`Score_7` int(11) NOT NULL,
`Score_8` int(11) NOT NULL,
`Score_9` int(11) NOT NULL,
`Score_10` int(11) NOT NULL,
`Comment` varchar(1000) DEFAULT NULL,
`User_ID` int(11) NOT NULL,
`Rc_Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`),
KEY `fk_sustainability_project_id` (`Project_ID`),
KEY `fk_sustainability_user_id` (`User_ID`),
CONSTRAINT `fk_sustainability_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`),
CONSTRAINT `fk_sustainability_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user_messages`
--
DROP TABLE IF EXISTS `user_messages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_messages` (
`User_ID` int(11) NOT NULL,
`Project_ID` int(11) NOT NULL,
`Message` varchar(1000) NOT NULL,
`Comment_ID` int(11) DEFAULT NULL,
`Rc_Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`User_ID`,`Project_ID`,`Rc_Timestamp`),
KEY `fk_user_messages_project_id` (`Project_ID`),
KEY `fk_user_messages_user_id` (`User_ID`),
KEY `fk_user_messages_comment_id` (`Comment_ID`),
CONSTRAINT `fk_user_messages_comment_id` FOREIGN KEY (`Comment_ID`) REFERENCES `comment` (`ID`) ON DELETE SET NULL,
CONSTRAINT `fk_user_messages_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`),
CONSTRAINT `fk_user_messages_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user_project_role_requests`
--
DROP TABLE IF EXISTS `user_project_role_requests`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_project_role_requests` (
`User_ID` int(11) NOT NULL,
`Project_ID` int(11) NOT NULL,
`Role_ID` int(11) NOT NULL,
`Rc_Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`User_ID`,`Project_ID`),
KEY `fk_user_project_role_requests_user_id` (`User_ID`),
KEY `fk_user_project_role_requests_project_id` (`Project_ID`),
KEY `fk_user_project_role_requests_role_id` (`Role_ID`),
CONSTRAINT `fk_user_project_role_requests_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`),
CONSTRAINT `fk_user_project_role_requests_role_id` FOREIGN KEY (`Role_ID`) REFERENCES `roles` (`ID`),
CONSTRAINT `fk_user_project_role_requests_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user_project_roles`
--
DROP TABLE IF EXISTS `user_project_roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_project_roles` (
`User_ID` int(11) NOT NULL,
`Project_ID` int(11) NOT NULL,
`Role_ID` int(11) NOT NULL,
PRIMARY KEY (`User_ID`,`Project_ID`),
KEY `fk_user_project_roles_user_id` (`User_ID`),
KEY `fk_user_project_roles_project_id` (`Project_ID`),
KEY `fk_user_project_roles_role_id` (`Role_ID`),
CONSTRAINT `fk_user_project_roles_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`),
CONSTRAINT `fk_user_project_roles_role_id` FOREIGN KEY (`Role_ID`) REFERENCES `roles` (`ID`),
CONSTRAINT `fk_user_project_roles_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `user_project_roles` WRITE;
/*!40000 ALTER TABLE `user_project_roles` DISABLE KEYS */;
INSERT INTO `user_project_roles` VALUES
(1,1,1);
/*!40000 ALTER TABLE `user_project_roles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_project_roles_audit`
--
DROP TABLE IF EXISTS `user_project_roles_audit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_project_roles_audit` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`User_ID` int(11) NOT NULL,
`Project_ID` int(11) NOT NULL,
`Role_ID` int(11) NOT NULL,
`Req_Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Action` varchar(7) NOT NULL,
`Res_Timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`Admin_ID` int(11) NOT NULL,
PRIMARY KEY (`ID`),
KEY `fk_user_project_roles_audit_user_id` (`User_ID`),
KEY `fk_user_project_roles_audit_project_id` (`Project_ID`),
KEY `fk_user_project_roles_audit_role_id` (`Role_ID`),
KEY `fk_user_project_roles_audit_admin_id` (`Admin_ID`),
CONSTRAINT `fk_user_project_roles_audit_admin_id` FOREIGN KEY (`Admin_ID`) REFERENCES `users` (`ID`),
CONSTRAINT `fk_user_project_roles_audit_project_id` FOREIGN KEY (`Project_ID`) REFERENCES `projects` (`ID`),
CONSTRAINT `fk_user_project_roles_audit_role_id` FOREIGN KEY (`Role_ID`) REFERENCES `roles` (`ID`),
CONSTRAINT `fk_user_project_roles_audit_user_id` FOREIGN KEY (`User_ID`) REFERENCES `users` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`First_Name` varchar(45) NOT NULL,
`Last_Name` varchar(45) NOT NULL,
`Registration_Date` date NOT NULL,
`Active` tinyint(1) NOT NULL,
`Login_Name` varchar(45) NOT NULL,
`Password` varchar(45) NOT NULL,
`Email` varchar(45) NOT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `uk_users_login_name` (`Login_Name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES
(1,'WISH','Admin','2013-03-04',1,'wish.admin','changeme','clahrc-wrt@imperial.ac.uk');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clahrc_wish`
--
DROP TABLE IF EXISTS `clahrc_wish`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clahrc_wish` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Entry_Date` date NULL,
`Comment` varchar(45) NULL DEFAULT 'Dummy table to make the OAR report work',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Temporary table structure for view `users_user_project_roles`
--
DROP TABLE IF EXISTS `users_user_project_roles`;
/*!50001 DROP VIEW IF EXISTS `users_user_project_roles`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `users_user_project_roles` (
`ID` int(11),
`First_Name` varchar(45),
`Last_Name` varchar(45),
`Registration_Date` date,
`Active` tinyint(1),
`Login_Name` varchar(45),
`Password` varchar(45),
`Email` varchar(45),
`User_ID` int(11),
`Project_ID` int(11),
`Role_ID` int(11)
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Current Database: `clahrc2`
--
USE `clahrc2`;
--
-- Final view structure for view `users_user_project_roles`
--
/*!50001 DROP TABLE IF EXISTS `users_user_project_roles`*/;
/*!50001 DROP VIEW IF EXISTS `users_user_project_roles`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = latin1 */;
/*!50001 SET character_set_results = latin1 */;
/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`clahrc`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `users_user_project_roles` AS select `users`.`ID` AS `ID`,`users`.`First_Name` AS `First_Name`,`users`.`Last_Name` AS `Last_Name`,`users`.`Registration_Date` AS `Registration_Date`,`users`.`Active` AS `Active`,`users`.`Login_Name` AS `Login_Name`,`users`.`Password` AS `Password`,`users`.`Email` AS `Email`,`user_project_roles`.`User_ID` AS `User_ID`,`user_project_roles`.`Project_ID` AS `Project_ID`,`user_project_roles`.`Role_ID` AS `Role_ID` from (`users` join `user_project_roles`) where (`users`.`ID` = `user_project_roles`.`User_ID`) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2013-03-05 16:13:32
| 49,231
|
https://github.com/taoyuan/srpit/blob/master/src/index.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
srpit
|
taoyuan
|
TypeScript
|
Code
| 27
| 61
|
import * as bn from "./bignum";
import {computeVerifier, genKey} from "./srp";
export {bn, genKey, computeVerifier};
export * from "./client";
export * from "./server";
export * from "./params";
| 50,839
|
https://github.com/alex625051/-/blob/master/index-js.js
|
Github Open Source
|
Open Source
|
MIT
| null |
-
|
alex625051
|
JavaScript
|
Code
| 254
| 1,105
|
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$.widget("custom.search_terms", $.ui.autocomplete, {
_renderItem : function( ul, item) {
var re = new RegExp(this.term, "gi") ;
var t = item.label.replace(re,highlite_match);
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + t + "</a>" )
.appendTo( ul );
}
});
create_source_table(sample)
$("#autocomplete_box").append('<input id="autocomplete" title="type "a"">')
$("#autocomplete_box").append('<div id="autocomplete_full_description" style="width:50%"><div>')
$("#autocomplete").on('focus', function(){
$(this).select()
})
// $( "#autocomplete" ).autocomplete({
// source: sample,
// select: function(event, ui) {
// $("#autocomplete_full_description").html(ui.item.full_description).show();
// /*ui.item будет содержать выбранный элемент*/ },
// search: function(event, ui) {
// $("#autocomplete_full_description").hide();
// },
// open: function(event, ui) {
// console.log(ui)
// var expr = new RegExp('2', 'g');
// ui.item = ui.item.replace(expr, highlite_match);
// }
// });
$( "#autocomplete" ).search_terms({
minLength:0,
maxResults: 10,
//source: sample,
select: function(event, ui) {
$("#autocomplete_full_description").html(ui.item.full_description).show();
$("#autocomplete").select()
/*ui.item будет содержать выбранный элемент*/ },
search: function(event, ui) {
$("#autocomplete_full_description").hide();
},
source: function(request, response) {
var results = $.ui.autocomplete.filter(sample, request.term);
response(results.slice(0, this.options.maxResults));
}
});
/* $( "#autocomplete" ).catcomplete({
source:sample
}); */
//////////////FUNCTIONS
function create_source_table(sample_table){
sample_table.forEach (raw=> {
raw.label = raw.key + unpack_reformulation(raw.reformulation)
raw.value = raw.short_description
raw.full_description = raw.full_description.replace(/(http\S*(\.png)|(\.svg)|(\.jpg)|(\.jpeg))/g, replacer_screenshots);
//raw.full_description = raw.full_description.replace(/\(\((http.*?) Скриншот\)\)/g, replacer_screenshots);
})
}
function unpack_reformulation(reformulation) {
if (reformulation && reformulation.length ) {
return "; " +reformulation.join('; ')
} else {
return ""
}
}
function replacer_screenshots(str, p1, offset, s) {
return '<a href="'+p1+'" target="_blank"><img src="'+ p1 + '" width="100px" align="left"><a><br>'
}
function highlite_match(p1, pos, offset) {
return "<span style='font-weight:bold;color:Blue;'>" + p1 + "</span>"
}
| 50,176
|
https://github.com/zalf-rpm/csharpfbp/blob/master/MonicaFlow/Components/capnproto/CreateModelEnv2.cs
|
Github Open Source
|
Open Source
|
Artistic-2.0
| null |
csharpfbp
|
zalf-rpm
|
C#
|
Code
| 145
| 479
|
using System;
using System.Linq;
using Climate = Mas.Rpc.Climate;
using Soil = Mas.Rpc.Soil;
using Mgmt = Mas.Rpc.Management;
using Model = Mas.Rpc.Model;
using ST = Mas.Rpc.Common.StructuredText;
using Capnp.Rpc;
using FBPLib;
using System.Collections.Generic;
namespace Components
{
[InPort("IN", description = "Input containing all necessary data as attributes")]
[OutPort("OUT")]
[ComponentDescription("Create Model.Env<StructuredText> out of IPs received at IN.")]
class CreateModelEnv2 : Component
{
IInputPort _inPort;
OutputPort _outPort;
public override void Execute()
{
Packet p;
while ((p = _inPort.Receive()) != null)
{
if (p.Attributes.ContainsKey("rest") && p.Attributes["rest"] is ST rst)
{
Model.Env<ST> env = new() { Rest = rst };
if (p.Attributes.ContainsKey("time-series") && p.Attributes["time-series"] is Climate.ITimeSeries ts)
env.TimeSeries = ts;
if (p.Attributes.ContainsKey("soil-profile") && p.Attributes["soil-profile"] is Soil.Profile sp)
env.SoilProfile = sp;
if (p.Attributes.ContainsKey("mgmt-events") && p.Attributes["mgmt-events"] is IEnumerable<Mgmt.Event> mes)
env.MgmtEvents = mes.ToList();
var p2 = Create(env);
_outPort.Send(p2);
}
Drop(p);
}
}
public override void OpenPorts()
{
_inPort = OpenInput("IN");
_outPort = OpenOutput("OUT");
}
}
}
| 4,557
|
https://github.com/infinitecoder1729/maths-with-python/blob/master/Max and Min Number.py
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
maths-with-python
|
infinitecoder1729
|
Python
|
Code
| 81
| 180
|
'''Finding the Smallest and the Largest Number out of the Numbers given by the user (Doesn't Use inbuilt functions'''
n=int(input("Enter number of Numbers you want to compare : "))
if n > 1 :
p=eval(input("Enter a Number : "))
mn,mx=p,p
for a in range (1,n):
p=eval(input("Enter a Number : "))
if p>mx:
mx=p
elif p<mn:
mn=p
else :
mn=mn
mx=mx
print("Greater Number is : ",mx)
print("Smallest Number is : ",mn)
else :
print("Number of terms should be greater than 1 ")
| 20,989
|
https://github.com/PickavetAndreas/Grafana-PRTG-app/blob/master/Grafana-PRTG-app/src/datasource/ConfigEditor.tsx
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
Grafana-PRTG-app
|
PickavetAndreas
|
TSX
|
Code
| 139
| 537
|
import React from 'react';
import { LegacyForms } from '@grafana/ui';
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
import { PrtgDataSourceOptions } from './types';
const { FormField } = LegacyForms;
interface OptionProps extends DataSourcePluginOptionsEditorProps<PrtgDataSourceOptions> {}
export function PrtgConfigEditor(Props: OptionProps) {
const { onOptionsChange, options } = Props;
function handleHostnameChange(hostnameInput: any) {
const jsonData = {
...options.jsonData,
hostname: hostnameInput.target.value,
};
onOptionsChange({
...options,
jsonData,
});
}
function handleUsernameChange(usernameInput: any) {
const jsonData = {
...options.jsonData,
username: usernameInput.target.value,
};
onOptionsChange({
...options,
jsonData,
});
}
function handlePortChange(portInput: any) {
const jsonData = {
...options.jsonData,
port: portInput.target.value,
};
onOptionsChange({
...options,
jsonData,
});
}
function handlePasshashChange(passhashInput: any) {
const jsonData = {
...options.jsonData,
passhash: passhashInput.target.value,
};
onOptionsChange({
...options,
jsonData,
});
}
return (
<section style={{ margin: 5 }}>
<FormField label={'Hostname'} onChange={handleHostnameChange} value={options.jsonData.hostname}></FormField>
<FormField label={'Port'} onChange={handlePortChange} value={options.jsonData.port}></FormField>
<FormField label={'Username'} onChange={handleUsernameChange} value={options.jsonData.username}></FormField>
<FormField label={'Passhash'} onChange={handlePasshashChange} value={options.jsonData.passhash}></FormField>
</section>
);
}
| 26,455
|
https://github.com/AbeJLazaro/SeguimientoPacientes/blob/master/Disenio/Proyecto.mm
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
SeguimientoPacientes
|
AbeJLazaro
|
Objective-C++
|
Code
| 178
| 938
|
<map version="1.1.0">
<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
<node CREATED="1576705902201" ID="ID_999461569" MODIFIED="1576705955818" TEXT="Proyecto">
<edge COLOR="#8300ff" WIDTH="2"/>
<node CREATED="1576705969637" ID="ID_1374736834" MODIFIED="1576705975114" POSITION="right" TEXT="Acceso">
<node CREATED="1576705988778" ID="ID_464911770" MODIFIED="1576705996236" TEXT="Acceso enfermero"/>
<node CREATED="1576705996844" ID="ID_1657658350" MODIFIED="1576706001626" TEXT="Acceso administrador"/>
<node CREATED="1576706002795" ID="ID_1287893656" MODIFIED="1576706011907" TEXT="Pantalla inicial para cada caso"/>
<node CREATED="1576706015343" ID="ID_94890245" MODIFIED="1576706018746" TEXT="Control de cuentas"/>
</node>
<node CREATED="1576705957947" ID="ID_1167053453" MODIFIED="1576705981770" POSITION="right" TEXT="Control del paciente">
<node CREATED="1576706021847" ID="ID_1401415618" MODIFIED="1576706028812" TEXT="Registro de Paciente y actualización"/>
<node CREATED="1576706029669" ID="ID_1496199619" MODIFIED="1576706061432" TEXT="Registro de citas de paciente y actualización"/>
<node CREATED="1576706062170" ID="ID_1430044003" MODIFIED="1576706075585" TEXT="Registro de enfermeros/medicos y actualización"/>
<node CREATED="1576706076025" ID="ID_1578775503" MODIFIED="1576706105691" TEXT="Asignación del diagnostico del paciente y actualización"/>
<node CREATED="1576706108447" ID="ID_533682291" MODIFIED="1576706129586" TEXT="Asignación de resultados de laboratorio del paciente y actualización"/>
</node>
<node CREATED="1576705962970" ID="ID_1334831597" MODIFIED="1576705967577" POSITION="right" TEXT="Reportes">
<node CREATED="1576706134364" ID="ID_121004117" MODIFIED="1576706159745" TEXT="Reportes individuales"/>
<node CREATED="1576706160818" ID="ID_613526009" MODIFIED="1576706164245" TEXT="Reportes generales">
<node CREATED="1576706166838" ID="ID_1522399262" MODIFIED="1576706210414" TEXT="Sin estudios de laboratorio"/>
<node CREATED="1576706182993" ID="ID_1890030435" MODIFIED="1576706192972" TEXT="Aun sin diagnostico"/>
<node CREATED="1576706193340" ID="ID_526504655" MODIFIED="1576706202273" TEXT="Confirmados o descartados"/>
</node>
<node CREATED="1576706220919" ID="ID_726823911" MODIFIED="1576706265842" TEXT="Recordatorio de la cita para el paciente via Email"/>
</node>
</node>
</map>
| 35,103
|
https://github.com/jejacks0n/teaspoon/blob/master/spec/features/hooks_spec.rb
|
Github Open Source
|
Open Source
|
MIT, BSD-3-Clause
| 2,023
|
teaspoon
|
jejacks0n
|
Ruby
|
Code
| 76
| 264
|
require "spec_helper"
describe "Calling hooks" do
let(:app) { Dummy::Application }
before do
@expected = nil
set_teaspoon_suite do |c|
c.javascripts = [""]
c.hook(:before) { @expected = "before" }
c.hook(:after) { @expected = "after" }
c.hook(:with_params) { |params| @expected = "with_params: #{params.to_json}" }
end
end
it "allows calling them by name" do
post "/teaspoon/default/before"
expect(@expected).to eq("before")
post "/teaspoon/default/after"
expect(@expected).to eq("after")
end
it "allows providing params" do
post "/teaspoon/default/with_params", args: { message: "_teaspoon_hook_" }
expect(@expected).to eq(%{with_params: {"message":"_teaspoon_hook_"}})
end
end
| 1,311
|
https://github.com/lechium/tvOS135Headers/blob/master/usr/libexec/locationd/TRANSITPbTransitMacTile.h
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
tvOS135Headers
|
lechium
|
C
|
Code
| 219
| 840
|
//
// Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Jun 10 2020 10:03:13).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <ProtocolBuffer/PBCodable.h>
#import "NSCopying-Protocol.h"
@class NSMutableArray;
@interface TRANSITPbTransitMacTile : PBCodable <NSCopying>
{
double _generationTimeSecs; // 8 = 0x8
int _expirationAgeSecs; // 16 = 0x10
NSMutableArray *_macs; // 24 = 0x18
int _tileX; // 32 = 0x20
int _tileY; // 36 = 0x24
int _version; // 40 = 0x28
struct {
unsigned int generationTimeSecs:1;
unsigned int expirationAgeSecs:1;
unsigned int tileX:1;
unsigned int tileY:1;
unsigned int version:1;
} _has; // 44 = 0x2c
}
+ (Class)macsType; // IMP=0x00000001002c38cc
@property(retain, nonatomic) NSMutableArray *macs; // @synthesize macs=_macs;
@property(nonatomic) int expirationAgeSecs; // @synthesize expirationAgeSecs=_expirationAgeSecs;
@property(nonatomic) double generationTimeSecs; // @synthesize generationTimeSecs=_generationTimeSecs;
@property(nonatomic) int tileY; // @synthesize tileY=_tileY;
@property(nonatomic) int tileX; // @synthesize tileX=_tileX;
@property(nonatomic) int version; // @synthesize version=_version;
- (void)mergeFrom:(id)arg1; // IMP=0x00000001002c4980
- (unsigned long long)hash; // IMP=0x00000001002c4854
- (_Bool)isEqual:(id)arg1; // IMP=0x00000001002c4700
- (id)copyWithZone:(struct _NSZone *)arg1; // IMP=0x00000001002c44c4
- (void)copyTo:(id)arg1; // IMP=0x00000001002c4348
- (void)writeTo:(id)arg1; // IMP=0x00000001002c417c
- (_Bool)readFrom:(id)arg1; // IMP=0x00000001002c4174
- (id)dictionaryRepresentation; // IMP=0x00000001002c3958
- (id)description; // IMP=0x00000001002c38d8
- (id)macsAtIndex:(unsigned long long)arg1; // IMP=0x00000001002c38b4
- (unsigned long long)macsCount; // IMP=0x00000001002c389c
- (void)addMacs:(id)arg1; // IMP=0x00000001002c3848
- (void)clearMacs; // IMP=0x00000001002c3830
@property(nonatomic) _Bool hasExpirationAgeSecs;
@property(nonatomic) _Bool hasGenerationTimeSecs;
@property(nonatomic) _Bool hasTileY;
@property(nonatomic) _Bool hasTileX;
@property(nonatomic) _Bool hasVersion;
- (void)dealloc; // IMP=0x00000001002c363c
@end
| 33,269
|
https://github.com/rainleo/react-node-cms/blob/master/client/src/container/admin/user/UserIndex.tsx
|
Github Open Source
|
Open Source
|
MIT
| 2,016
|
react-node-cms
|
rainleo
|
TSX
|
Code
| 29
| 75
|
/**
* Created by XD on 2016/9/12.
*/
import * as React from 'react';
import {connect} from 'react-redux';
import RegistUser from "./RegistUser";
export default connect(
(state)=>{
return{};
}
)(RegistUser);
| 45,377
|
https://github.com/BGTCapital/hummingbot/blob/master/hummingbot/connector/exchange/digifinex/digifinex_global.py
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
hummingbot
|
BGTCapital
|
Python
|
Code
| 51
| 216
|
import aiohttp
from hummingbot.connector.exchange.digifinex.digifinex_auth import DigifinexAuth
from hummingbot.connector.exchange.digifinex.digifinex_rest_api import DigifinexRestApi
class DigifinexGlobal:
def __init__(self, key: str, secret: str):
self.auth = DigifinexAuth(key, secret)
self.rest_api = DigifinexRestApi(self.auth, self.http_client)
self._shared_client: aiohttp.ClientSession = None
async def http_client(self) -> aiohttp.ClientSession:
"""
:returns Shared client session instance
"""
if self._shared_client is None:
self._shared_client = aiohttp.ClientSession()
return self._shared_client
| 14,741
|
https://github.com/lhm7877/aws-sdk-java/blob/master/aws-java-sdk-appflow/src/main/java/com/amazonaws/services/appflow/model/CreateConnectorProfileRequest.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
aws-sdk-java
|
lhm7877
|
Java
|
Code
| 1,835
| 4,070
|
/*
* Copyright 2015-2020 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.
*/
package com.amazonaws.services.appflow.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/appflow-2020-08-23/CreateConnectorProfile" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateConnectorProfileRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your AWS account.
* </p>
*/
private String connectorProfileName;
/**
* <p>
* The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is
* required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here, Amazon
* AppFlow uses the Amazon AppFlow-managed KMS key.
* </p>
*/
private String kmsArn;
/**
* <p>
* The type of connector, such as Salesforce, Amplitude, and so on.
* </p>
*/
private String connectorType;
/**
* <p>
* Indicates the connection mode and specifies whether it is public or private. Private flows use AWS PrivateLink to
* route data over AWS infrastructure without exposing it to the public internet.
* </p>
*/
private String connectionMode;
/**
* <p>
* Defines the connector-specific configuration and credentials.
* </p>
*/
private ConnectorProfileConfig connectorProfileConfig;
/**
* <p>
* The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your AWS account.
* </p>
*
* @param connectorProfileName
* The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your AWS
* account.
*/
public void setConnectorProfileName(String connectorProfileName) {
this.connectorProfileName = connectorProfileName;
}
/**
* <p>
* The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your AWS account.
* </p>
*
* @return The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your AWS
* account.
*/
public String getConnectorProfileName() {
return this.connectorProfileName;
}
/**
* <p>
* The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your AWS account.
* </p>
*
* @param connectorProfileName
* The name of the connector profile. The name is unique for each <code>ConnectorProfile</code> in your AWS
* account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateConnectorProfileRequest withConnectorProfileName(String connectorProfileName) {
setConnectorProfileName(connectorProfileName);
return this;
}
/**
* <p>
* The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is
* required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here, Amazon
* AppFlow uses the Amazon AppFlow-managed KMS key.
* </p>
*
* @param kmsArn
* The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is
* required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here,
* Amazon AppFlow uses the Amazon AppFlow-managed KMS key.
*/
public void setKmsArn(String kmsArn) {
this.kmsArn = kmsArn;
}
/**
* <p>
* The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is
* required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here, Amazon
* AppFlow uses the Amazon AppFlow-managed KMS key.
* </p>
*
* @return The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This
* is required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything
* here, Amazon AppFlow uses the Amazon AppFlow-managed KMS key.
*/
public String getKmsArn() {
return this.kmsArn;
}
/**
* <p>
* The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is
* required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here, Amazon
* AppFlow uses the Amazon AppFlow-managed KMS key.
* </p>
*
* @param kmsArn
* The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is
* required if you do not want to use the Amazon AppFlow-managed KMS key. If you don't provide anything here,
* Amazon AppFlow uses the Amazon AppFlow-managed KMS key.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateConnectorProfileRequest withKmsArn(String kmsArn) {
setKmsArn(kmsArn);
return this;
}
/**
* <p>
* The type of connector, such as Salesforce, Amplitude, and so on.
* </p>
*
* @param connectorType
* The type of connector, such as Salesforce, Amplitude, and so on.
* @see ConnectorType
*/
public void setConnectorType(String connectorType) {
this.connectorType = connectorType;
}
/**
* <p>
* The type of connector, such as Salesforce, Amplitude, and so on.
* </p>
*
* @return The type of connector, such as Salesforce, Amplitude, and so on.
* @see ConnectorType
*/
public String getConnectorType() {
return this.connectorType;
}
/**
* <p>
* The type of connector, such as Salesforce, Amplitude, and so on.
* </p>
*
* @param connectorType
* The type of connector, such as Salesforce, Amplitude, and so on.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectorType
*/
public CreateConnectorProfileRequest withConnectorType(String connectorType) {
setConnectorType(connectorType);
return this;
}
/**
* <p>
* The type of connector, such as Salesforce, Amplitude, and so on.
* </p>
*
* @param connectorType
* The type of connector, such as Salesforce, Amplitude, and so on.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectorType
*/
public CreateConnectorProfileRequest withConnectorType(ConnectorType connectorType) {
this.connectorType = connectorType.toString();
return this;
}
/**
* <p>
* Indicates the connection mode and specifies whether it is public or private. Private flows use AWS PrivateLink to
* route data over AWS infrastructure without exposing it to the public internet.
* </p>
*
* @param connectionMode
* Indicates the connection mode and specifies whether it is public or private. Private flows use AWS
* PrivateLink to route data over AWS infrastructure without exposing it to the public internet.
* @see ConnectionMode
*/
public void setConnectionMode(String connectionMode) {
this.connectionMode = connectionMode;
}
/**
* <p>
* Indicates the connection mode and specifies whether it is public or private. Private flows use AWS PrivateLink to
* route data over AWS infrastructure without exposing it to the public internet.
* </p>
*
* @return Indicates the connection mode and specifies whether it is public or private. Private flows use AWS
* PrivateLink to route data over AWS infrastructure without exposing it to the public internet.
* @see ConnectionMode
*/
public String getConnectionMode() {
return this.connectionMode;
}
/**
* <p>
* Indicates the connection mode and specifies whether it is public or private. Private flows use AWS PrivateLink to
* route data over AWS infrastructure without exposing it to the public internet.
* </p>
*
* @param connectionMode
* Indicates the connection mode and specifies whether it is public or private. Private flows use AWS
* PrivateLink to route data over AWS infrastructure without exposing it to the public internet.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectionMode
*/
public CreateConnectorProfileRequest withConnectionMode(String connectionMode) {
setConnectionMode(connectionMode);
return this;
}
/**
* <p>
* Indicates the connection mode and specifies whether it is public or private. Private flows use AWS PrivateLink to
* route data over AWS infrastructure without exposing it to the public internet.
* </p>
*
* @param connectionMode
* Indicates the connection mode and specifies whether it is public or private. Private flows use AWS
* PrivateLink to route data over AWS infrastructure without exposing it to the public internet.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectionMode
*/
public CreateConnectorProfileRequest withConnectionMode(ConnectionMode connectionMode) {
this.connectionMode = connectionMode.toString();
return this;
}
/**
* <p>
* Defines the connector-specific configuration and credentials.
* </p>
*
* @param connectorProfileConfig
* Defines the connector-specific configuration and credentials.
*/
public void setConnectorProfileConfig(ConnectorProfileConfig connectorProfileConfig) {
this.connectorProfileConfig = connectorProfileConfig;
}
/**
* <p>
* Defines the connector-specific configuration and credentials.
* </p>
*
* @return Defines the connector-specific configuration and credentials.
*/
public ConnectorProfileConfig getConnectorProfileConfig() {
return this.connectorProfileConfig;
}
/**
* <p>
* Defines the connector-specific configuration and credentials.
* </p>
*
* @param connectorProfileConfig
* Defines the connector-specific configuration and credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateConnectorProfileRequest withConnectorProfileConfig(ConnectorProfileConfig connectorProfileConfig) {
setConnectorProfileConfig(connectorProfileConfig);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getConnectorProfileName() != null)
sb.append("ConnectorProfileName: ").append(getConnectorProfileName()).append(",");
if (getKmsArn() != null)
sb.append("KmsArn: ").append(getKmsArn()).append(",");
if (getConnectorType() != null)
sb.append("ConnectorType: ").append(getConnectorType()).append(",");
if (getConnectionMode() != null)
sb.append("ConnectionMode: ").append(getConnectionMode()).append(",");
if (getConnectorProfileConfig() != null)
sb.append("ConnectorProfileConfig: ").append(getConnectorProfileConfig());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateConnectorProfileRequest == false)
return false;
CreateConnectorProfileRequest other = (CreateConnectorProfileRequest) obj;
if (other.getConnectorProfileName() == null ^ this.getConnectorProfileName() == null)
return false;
if (other.getConnectorProfileName() != null && other.getConnectorProfileName().equals(this.getConnectorProfileName()) == false)
return false;
if (other.getKmsArn() == null ^ this.getKmsArn() == null)
return false;
if (other.getKmsArn() != null && other.getKmsArn().equals(this.getKmsArn()) == false)
return false;
if (other.getConnectorType() == null ^ this.getConnectorType() == null)
return false;
if (other.getConnectorType() != null && other.getConnectorType().equals(this.getConnectorType()) == false)
return false;
if (other.getConnectionMode() == null ^ this.getConnectionMode() == null)
return false;
if (other.getConnectionMode() != null && other.getConnectionMode().equals(this.getConnectionMode()) == false)
return false;
if (other.getConnectorProfileConfig() == null ^ this.getConnectorProfileConfig() == null)
return false;
if (other.getConnectorProfileConfig() != null && other.getConnectorProfileConfig().equals(this.getConnectorProfileConfig()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getConnectorProfileName() == null) ? 0 : getConnectorProfileName().hashCode());
hashCode = prime * hashCode + ((getKmsArn() == null) ? 0 : getKmsArn().hashCode());
hashCode = prime * hashCode + ((getConnectorType() == null) ? 0 : getConnectorType().hashCode());
hashCode = prime * hashCode + ((getConnectionMode() == null) ? 0 : getConnectionMode().hashCode());
hashCode = prime * hashCode + ((getConnectorProfileConfig() == null) ? 0 : getConnectorProfileConfig().hashCode());
return hashCode;
}
@Override
public CreateConnectorProfileRequest clone() {
return (CreateConnectorProfileRequest) super.clone();
}
}
| 4,059
|
https://github.com/androidx/androidx/blob/master/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/workaround/PreviewPixelHDRnet.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,023
|
androidx
|
androidx
|
Java
|
Code
| 237
| 732
|
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.camera.camera2.internal.compat.workaround;
import android.hardware.camera2.CaptureRequest;
import android.util.Rational;
import android.util.Size;
import androidx.annotation.NonNull;
import androidx.annotation.OptIn;
import androidx.annotation.RequiresApi;
import androidx.camera.camera2.impl.Camera2ImplConfig;
import androidx.camera.camera2.internal.compat.quirk.DeviceQuirks;
import androidx.camera.camera2.internal.compat.quirk.PreviewPixelHDRnetQuirk;
import androidx.camera.camera2.interop.ExperimentalCamera2Interop;
import androidx.camera.core.impl.SessionConfig;
/**
* Workaround that handles turning on the WYSIWYG preview on Pixel devices.
*
* @see PreviewPixelHDRnetQuirk
*/
@RequiresApi(21) // TODO(b/200306659): Remove and replace with annotation on package-info.java
public class PreviewPixelHDRnet {
public static final Rational ASPECT_RATIO_16_9 = new Rational(16, 9);
private PreviewPixelHDRnet() {
}
/**
* Turns on WYSIWYG viewfinder on Pixel devices
*/
@OptIn(markerClass = ExperimentalCamera2Interop.class)
public static void setHDRnet(
@NonNull Size resolution,
@NonNull SessionConfig.Builder sessionBuilder) {
final PreviewPixelHDRnetQuirk quirk = DeviceQuirks.get(PreviewPixelHDRnetQuirk.class);
if (quirk == null) {
return;
}
if (isAspectRatioMatch(resolution, ASPECT_RATIO_16_9)) {
return;
}
Camera2ImplConfig.Builder camera2ConfigBuilder = new Camera2ImplConfig.Builder();
camera2ConfigBuilder.setCaptureRequestOption(CaptureRequest.TONEMAP_MODE,
CaptureRequest.TONEMAP_MODE_HIGH_QUALITY);
sessionBuilder.addImplementationOptions(camera2ConfigBuilder.build());
}
private static boolean isAspectRatioMatch(
@NonNull Size resolution,
@NonNull Rational aspectRatio) {
return aspectRatio.equals(new Rational(resolution.getWidth(), resolution.getHeight()));
}
}
| 45,795
|
https://github.com/dance-show/fe/blob/master/src/pages/monitor/object/metricViews/graphStandardOptions/Hexbin.tsx
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,023
|
fe
|
dance-show
|
TSX
|
Code
| 393
| 1,232
|
/*
* Copyright 2022 Nightingale Team
*
* 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.
*
*/
import React from 'react';
import _ from 'lodash';
import { Menu, Dropdown, Switch, Row, Col, InputNumber } from 'antd';
import { DownOutlined } from '@ant-design/icons';
import { units } from '../config';
import ColorRangeMenu from '../../../../dashboard/Components/ColorRangeMenu';
import { colors } from '../../../../dashboard/Components/ColorRangeMenu/config';
interface IProps {
highLevelConfig: any;
setHighLevelConfig: (val: any) => void;
}
export default function GraphStandardOptions(props: IProps) {
const { highLevelConfig, setHighLevelConfig } = props;
const precisionMenu = (
<Menu
onClick={(e) => {
setHighLevelConfig({ ...highLevelConfig, unit: e.key });
}}
selectedKeys={[highLevelConfig.unit]}
>
{_.map(units, (item) => {
return <Menu.Item key={item.value}>{item.label}</Menu.Item>;
})}
</Menu>
);
return (
<div>
<div style={{ marginBottom: 5 }}>
Height:{' '}
<InputNumber
size='small'
value={highLevelConfig.chartheight}
onBlur={(e) => {
setHighLevelConfig({ ...highLevelConfig, chartheight: _.toNumber(e.target.value) });
}}
/>
</div>
<div style={{ marginBottom: 5 }}>
Color:{' '}
<Dropdown
overlay={
<ColorRangeMenu
onClick={(e) => {
setHighLevelConfig({ ...highLevelConfig, colorRange: _.split(e.key, ',') });
}}
selectedKeys={[_.join(highLevelConfig.colorRange, ',')]}
/>
}
>
<a className='ant-dropdown-link' onClick={(e) => e.preventDefault()}>
{_.get(
_.find(colors, (item) => {
return _.isEqual(item.value, highLevelConfig.colorRange);
}),
'label',
)}{' '}
<DownOutlined />
</a>
</Dropdown>
</div>
<div style={{ marginBottom: 5 }}>
Reverse color order:{' '}
<Switch
size='small'
checked={highLevelConfig.reverseColorOrder}
onChange={(checked) => {
setHighLevelConfig({ ...highLevelConfig, reverseColorOrder: checked });
}}
/>
</div>
<div style={{ marginBottom: 5 }}>
Auto min/max color values:{' '}
<Switch
size='small'
checked={highLevelConfig.colorDomainAuto}
onChange={(checked) => {
setHighLevelConfig({ ...highLevelConfig, colorDomainAuto: checked, colorDomain: [0, 100] });
}}
/>
</div>
{!highLevelConfig.colorDomainAuto && (
<div style={{ marginBottom: 5 }}>
<Row gutter={8}>
<Col span={12}>
<InputNumber
size='small'
addonBefore='min'
style={{ width: 110 }}
value={highLevelConfig.colorDomain[0]}
onChange={(val) => {
setHighLevelConfig({ ...highLevelConfig, colorDomain: [val, highLevelConfig.colorDomain[1]] });
}}
/>
</Col>
<Col span={12}>
<InputNumber
size='small'
addonBefore='max'
style={{ width: 110 }}
value={highLevelConfig.colorDomain[1]}
onChange={(val) => {
setHighLevelConfig({ ...highLevelConfig, colorDomain: [highLevelConfig.colorDomain[0], val] });
}}
/>
</Col>
</Row>
</div>
)}
<div>
Value format with:{' '}
<Dropdown overlay={precisionMenu}>
<a className='ant-dropdown-link' onClick={(e) => e.preventDefault()}>
{_.get(_.find(units, { value: highLevelConfig.unit }), 'label')} <DownOutlined />
</a>
</Dropdown>
</div>
</div>
);
}
| 49,374
|
https://github.com/artnum/kairos/blob/master/widgets/countList.js
|
Github Open Source
|
Open Source
|
BSD-2-Clause
| null |
kairos
|
artnum
|
JavaScript
|
Code
| 1,256
| 4,474
|
/* eslint-env amd, browser */
/* global Artnum, Address, DoWait, sjcl */
/* eslint no-template-curly-in-string: "off" */
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
'dojo/Evented',
'artnum/Doc',
'location/count'
], function (
djDeclare,
_dtWidgetBase,
djEvented,
Doc,
Count
) {
return djDeclare('location/countList', [ _dtWidgetBase, djEvented ], {
constructor: function () {
this.data = new Map()
this.inherited(arguments)
if (arguments[0].integrated) {
this.doc = new Doc({width: window.innerWidth - 740, style: 'background-color: #FFFFCF;'})
this.doc.close.closableIdx = KAIROS.stackClosable(this.doc.close.bind(this.doc))
this.doc.addEventListener('close', (event) => {
KAIROS.removeClosableByIdx(this.doc.close.closableIdx)
})
} else {
if (arguments[0].parent) {
this.doc = arguments[0].parent
} else {
this.doc = document.body
}
}
this.AddReservationToCount = null
if (arguments[0] && arguments[0].addReservation) {
this.AddReservationToCount = arguments[0].addReservation
}
this.run(arguments)
},
_toInputDate: function (date) {
var x = new Date(date)
x = x.toISOString()
return x.split('T')[0]
},
_shortDesc: function (text) {
var x = text.replace(/(?:[\r\n]+)/g, ', ')
if (x.length > 30) {
x = x.substr(0, 30)
x += ' ...'
}
return x
},
_toHtmlRange: function (d1, d2) {
if (d1 || d2) {
return (d1 ? (new Date(d1)).briefDate() : '') + ' - ' + (d2 ? (new Date(d2)).briefDate() : '')
}
return ''
},
run: function () {
let limit = 50
let offset = 0
if (arguments[0].limit && arguments[0].limit > 0) {
limit = arguments[0].limit
} else if (arguments[0].limit) {
limit = -1
} else {
limit = 50
}
if (arguments[0].offset) {
offset = arguments[0].offset
}
const url = new URL(`${KAIROS.getBase()}/store/Count`)
url.searchParams.set('search.deleted', '-')
url.searchParams.set('sort.id', 'DESC')
if (limit) {
url.searchParams.set('limit', `${offset},${limit}`)
}
const query = fetch(url)
.then(response => {
if (!response.ok) { return null }
return response.json()
})
const url2 = new URL(`${KAIROS.getBase()}/store/Count/.count`)
url2.searchParams = url.searchParams
const queryCount = fetch(url2)
.then(response =>{
if (!response.ok) { return null }
return response.json()
})
const div = document.createElement('DIV')
div.setAttribute('class', 'DocCount')
window.GEvent.listen('count.count-deleted', event => {
var id = String(event.detail.id)
var tbody = this.domNode.getElementsByTagName('TBODY')[0]
var node = tbody.firstElementChild
for (; node; node = node.nextElementSibling) {
if (node.getAttribute('data-count-id') === id) {
break
}
}
if (node) {
window.requestAnimationFrame(() => {
if (node.parentNode) {
node.parentNode.removeChild(node)
}
})
}
})
this.domNode = div
let lOption = ''
;['50', '100', '500', '1000', '-1'].forEach((n) => {
let s = ''
if (String(limit) === n) { s = 'selected' }
if (n === '-1') {
lOption += `<option value="-1" ${s}>∞</option>`
} else {
lOption += `<option value="${n}" ${s}>${n}</option>`
}
})
var txt = `<h1>Liste de décompte</h1><table>
<label for="paging">Afficher </label><select name="paging">${lOption}</select>
<thead><tr><th data-sort-type="integer">N°</th><th data-sort-type="boolean">Final</th><th data-sort-type="integer">Facture</th><th data-sort-value="integer">Réservation</th><th>Statut</th><th data-sort-type="date">Période</th><th>Référence client</th><th>Client</th><th>Remarque</th><th>Montant</th><th>Impression</th><th data-sort-type="no"></th></tr></thead>
<tbody></tbody></table>`
this.domNode.innerHTML = txt
var select = this.domNode.getElementsByTagName('SELECT')[0]
select.addEventListener('change', function (evt) {
this.run({limit: evt.target.value})
}.bind(this))
queryCount.then(n => {
if (!n) {return }
if (limit <= 0) { return }
let pselect = document.createElement('SELECT')
var pages = Math.floor(n.length / limit)
for (let i = 0; i < pages; i++) {
pselect.appendChild(document.createElement('OPTION'))
pselect.lastChild.setAttribute('value', i)
if (i * limit === offset) {
pselect.lastChild.setAttribute('selected', 'selected')
}
pselect.lastChild.appendChild(document.createTextNode(i + 1))
}
pselect.addEventListener('change', function (evt) {
this.run({limit: limit, offset: parseInt(evt.target.value) * limit})
}.bind(this))
window.requestAnimationFrame(() => {
select.parentNode.insertBefore(document.createTextNode(` page `), select.nextSibling)
select.parentNode.insertBefore(pselect, select.nextSibling.nextSibling)
select.parentNode.insertBefore(document.createTextNode(` sur ${pages}`), pselect.nextSibling)
})
})
var Tbody = this.domNode.getElementsByTagName('TBODY')[0]
var Table = this.domNode.getElementsByTagName('TABLE')[0]
this.dtable = new Artnum.DTable({table: Table, sortOnly: true})
query
.then(results => {
if (!results) { return }
const url = new URL(`${KAIROS.getBase()}/store/CountReservation`)
url.searchParams.append('sort.count', 'DESC')
let queryChain = Promise.resolve()
for (let i = 0; i < results.length; i++) {
const promise = new Promise((resolve, reject) => {
const count = results.data[i]
url.searchParams.set('search.count', count.id)
fetch(url)
.then(response => {
if (!response.ok) { return null }
return response.json()
})
.then(reservations => {
return new Promise((resolve, reject) => {
if (!reservations) { resolve([count, '', []]); return}
if (reservations.length <= 0) { resolve([count, '', []]); return }
const p = []
const table = []
const clients = []
const _clients = new Map()
for (let j = 0; j < reservations.length; j++) {
table.push(reservations.data[j].reservation)
if (_clients.has(reservations.data[j].reservation)) { continue; }
p.push(new Promise((resolve, reject) => {
fetch(new URL(`${KAIROS.getBase()}/store/DeepReservation/${reservations.data[j].reservation}`))
.then(response => {
if (!response.ok) { return null }
return response.json()
})
.then(t => {
if (!t) { resolve(); return }
if (t.length !== 1) { resolve(); return }
if (t.data.contacts && t.data.contacts['_client'] && t.data.contacts['_client'].length > 0) {
_clients.set(
reservations.data[j].reservation,
new Address(t.data.contacts['_client'][0]).toArray().slice(0, 2).join('<br />')
)
}
if (_clients.has(reservations.data[j].reservation)) {
clients.push(_clients.get(reservations.data[j].reservation))
}
resolve()
})
}))
}
Promise.all(p)
.then(_ => {
const c = []
for (const client of clients) {
if (c.indexOf(client) === -1) {
c.push(client)
}
}
resolve([count, table.join(', '), c])
})
})
})
.then(([count, reservations, clients]) => {
let tr = document.createElement('TR')
tr.setAttribute('data-url', `#DEC${String(count.id)}`)
tr.setAttribute('data-count-id', String(count.id))
tr.addEventListener('click', this.evtSelectTr.bind(this))
tr.innerHTML = `<td data-sort-value="${count.id}">${count.id}</td>
<td data-sort-value="${(count.state === 'FINAL' ? 'true' : 'false')}">${(count.state === 'FINAL' ? 'Oui' : 'Non')}</td>
<td tabindex data-edit="0" data-invoice="${(count.invoice ? count.invoice : '')}">${(count.invoice ? (count._invoice.winbiz ? count._invoice.winbiz : '') : '')}</td>
<td>${reservations}</td>
<td>${(count.status && count._status ? count._status.name : '')}</td>
<td data-sort-value="${count.begin}">${this._toHtmlRange(count.begin, count.end)}</td>
<td>${(count.reference ? count.reference : '')}</td>
<td>${clients.length > 0 ? clients.join('<hr>') : ''}</td>
<td>${(count.comment ? this._shortDesc(count.comment) : '')}</td>
<td>${(count.total ? count.total : '')}</td>
<td>${(count.printed ? (new Date(count.printed)).briefDate() : '')}</td>
<td data-op="delete"><i class="far fa-trash-alt action"></i></td>`
let n = Tbody.lastElementChild
let p = null
while (n &&
parseInt(tr.firstElementChild.dataset.sortValue) > parseInt(n.firstElementChild.dataset.sortValue)) {
p = n
n = n.previousSibling
}
window.requestAnimationFrame(() => { Tbody.insertBefore(tr, p); resolve() })
})
})
queryChain.then(_ => { return promise })
}
})
this.doc.content(this.domNode)
if (arguments[0].addReservation && String(arguments[0].addReservation) !== '0') {
this.AddReservationToCount = arguments[0].addReservation
}
},
evtSelectTr: async function (event) {
let tr = event.target
let td = event.target
while (tr && tr.nodeName !== 'TR') {
if (tr.nodeName === 'TD') { td = tr }
tr = tr.parentNode
}
if (td.dataset.invoice !== undefined) {
if (td.dataset.edit === '0') {
td.dataset.edit = '1'
td.dataset.previousValue = td.innerHTML
const fn = (event) => {
let td = event.target
while (td.nodeName !== 'TD') { td = td.parentNode }
if (event.target.value.trim() === '') {
td.dataset.edit = '0'
window.requestAnimationFrame(() => {
td.innerHTML = td.dataset.previousValue
})
return
}
const invoice = td.dataset.invoice
new Promise((resolve, reject ) => {
if (invoice) {
fetch(new URL(`${KAIROS.getBase()}/store/Invoice/${invoice}`),
{method: 'PATCH', body: JSON.stringify({id: invoice, winbiz: event.target.value.trim()})})
.then(response => {
if (!response.ok) { return null }
return response.json()
})
.then(result => {
if (!result) { resolve(null); return }
resolve(invoice)
})
} else {
let tr = event.target
while (tr.nodeName !== 'TR') { tr = tr.parentNode }
const countid = tr.dataset.countId
fetch(new URL(`${KAIROS.getBase()}/store/Invoice`), {method: 'POST', body: JSON.stringify({winbiz: event.target.value.trim()})})
.then(response => {
if (!response.ok) { return null }
return response.json()
}).then(result => {
if (!result) { resolve(null); return }
if (result.length <= 0) { resolve(null); return }
const invoice = Array.isArray(result.data) ? result.data[0] : result.data
td.dataset.invoice = invoice.invoice
fetch(new URL(`${KAIROS.getBase()}/store/Count/${countid}`), {method: 'PATCH', body: JSON.stringify({id: countid, invoice: invoice.id})})
.then(response => {
if (!response.ok) { return null }
return response.json()
})
.then(result => {
if (!result) { resolve(null); return }
resolve(invoice.id)
})
})
}
})
.then(result => {
if (!result) { return; }
td.dataset.edit = '0'
fetch(new URL(`${KAIROS.getBase()}/store/Invoice/${result}`))
.then(response => {
if (!response.ok) { return null }
return response.json()
})
.then(result => {
if (!result || !result.data) {
window.requestAnimationFrame(() => {
td.innerHTML = td.dataset.previousValue
})
return
}
window.requestAnimationFrame(() => {
td.innerHTML = Array.isArray(result.data) ? result.data[0].winbiz : result.data.winbiz
})
})
})
}
const input = document.createElement('INPUT')
input.value = td.innerHTML
input.addEventListener('blur', fn)
input.addEventListener('keypress', event => {
if (event.key === 'Enter') { fn(event); return }
if (event.key === 'Escape') {
let td = event.target
for (; td.nodeName !== 'TD'; td = td.parentNode) ;
td.innerHTML = td.dataset.previousValue
td.dataset.previousValue = null
}
})
window.requestAnimationFrame(function () {
td.innerHTML = ''
td.appendChild(input)
})
}
return
}
if (td.dataset.op) {
switch (td.dataset.op) {
case 'delete':
if (!tr.dataset.countId) { return }
fetch(new URL(`${KAIROS.getBase()}/store/Count/${tr.dataset.countId}`), {method: 'DELETE', body: JSON.stringify({id: tr.dataset.countId})})
.then(response => {
if (!response.ok) { return null }
return response.json()
}).then(result => {
if (!result) { return }
window.requestAnimationFrame(() => { tr.parentNode.removeChild(tr) })
})
break
}
return
}
new Count({'data-id': tr.dataset.countId, reservation: this.AddReservationToCount}) // eslint-disable-line
this.AddReservationToCount = null
}
})
})
| 12,123
|
https://github.com/Imohamedgabr/laravel-advanced-cart/blob/master/ext/ai-admin-jqadm/admin/jqadm/templates/common/partials/columns-default.php
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
laravel-advanced-cart
|
Imohamedgabr
|
PHP
|
Code
| 198
| 519
|
<?php
/**
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
* @copyright Aimeos (aimeos.org), 2017
*/
/**
* Renders the drop down for the available columns in the list views
*
* Available data:
* - data: Associative list of keys (e.g. "product.id") and translated names (e.g. "ID")
* - fields: List of columns that are currently shown
* - group: Parameter group if several lists are on one page
* - tabindex: Numerical index for tabbing through the fields and buttons
*/
$checked = function( array $list, $code ) {
return ( in_array( $code, $list ) ? 'checked="checked"' : '' );
};
$enc = $this->encoder();
$fields = $this->get( 'fields', [] );
$names = array_merge( (array) $this->get( 'group', [] ), ['fields', ''] );
?>
<div class="dropdown filter-columns">
<button class="btn act-columns fa" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" tabindex="<?= $this->get( 'tabindex', 1 ); ?>">
</button>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
<?php foreach( $this->get( 'data', [] ) as $key => $name ) : ?>
<li class="dropdown-item">
<label>
<input type="checkbox" tabindex="<?= $this->get( 'tabindex', 1 ); ?>"
name="<?= $enc->attr( $this->formparam( $names ) ); ?>"
value="<?= $enc->attr( $key ); ?>" <?= $checked( $fields, $key ); ?> />
<?= $enc->html( $name ); ?>
</label>
</li>
<?php endforeach; ?>
</ul>
</div>
| 7,225
|
https://github.com/SMG233/Undertale-Battle-Engine/blob/master/mod/dummy/Dummy/Draw.lua
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
Undertale-Battle-Engine
|
SMG233
|
Lua
|
Code
| 28
| 182
|
return function (self)
love.graphics.setColor(1, 1, 1, 1-self.Alpha)
love.graphics.push()
love.graphics.translate(self.x, self.y)
love.graphics.rotate(love.timer.getTime())
love.graphics.draw(self.Image, -self.Width/2, -self.Height/2)
love.graphics.pop()
love.graphics.setColor(.3, .3, .3, self.Alpha)
love.graphics.draw(self.Image, self.x-self.Width/2, self.y-self.Height/2)
love.graphics.setColor(1, 1, 1, 1)
self.Circle:draw()
end
| 48,118
|
https://github.com/MigueAJM/PruebaSymfony3/blob/master/src/ProductBundle/Resources/views/Default/create.html.twig
|
Github Open Source
|
Open Source
|
MIT
| null |
PruebaSymfony3
|
MigueAJM
|
Twig
|
Code
| 76
| 270
|
{% extends '::base.html.twig' %}
{% block title %}
Products || Home
{% endblock %}
{% block stitle %}
<h1 class="container">Agregar Productos</h1>
{% endblock %}
{% block body %}
<form class="container">
<div class="mb-3">
<label for="key" class="form-label">Clave Producto</label>
<input type="numeric" class="form-control" id="key" placeholder="38160">
</div>
<div class="mb-3">
<label for="name" class="form-label">Nombre</label>
<input type="text" class="form-control" id="name" placeholder="Ingrese el nombre del producto">
</div>
<div class="mb-3">
<label for="price" class="form-label">Precio</label>
<input type="numeric" class="form-control" id="price" placeholder="Ingrese el precio del producto">
</div>
<form>
{% endblock %}
| 27,912
|
https://github.com/golshidb93/sif-innsyn-api/blob/master/src/main/kotlin/no/nav/sifinnsynapi/dokument/DokumentService.kt
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
sif-innsyn-api
|
golshidb93
|
Kotlin
|
Code
| 29
| 132
|
package no.nav.sifinnsynapi.dokument
import no.nav.sifinnsynapi.http.DocumentNotFoundException
import org.springframework.stereotype.Service
import java.util.*
@Service
class DokumentService(
private val repo: DokumentRepository
) {
fun hentDokument(søknadId: UUID): DokumentDAO? {
return repo.findBySøknadId(søknadId) ?: throw DocumentNotFoundException(søknadId.toString())
}
}
| 46,760
|
https://github.com/morpheyesh/happy-mood-score/blob/master/spec/models/company_spec.rb
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
happy-mood-score
|
morpheyesh
|
Ruby
|
Code
| 401
| 1,082
|
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Company, type: :model do
subject { build(:company) }
it { is_expected.to belong_to :language }
it { is_expected.to have_many :rewards }
it { is_expected.to have_many :events }
it { is_expected.to have_many :employees }
it { is_expected.to have_many :teams }
it { is_expected.to have_many :votes }
it { is_expected.to have_many :polls }
it { is_expected.to have_many :historical_logs }
it { is_expected.to have_many(:users).through(:employees) }
it { is_expected.to have_many(:activities).through(:employees) }
it { is_expected.to validate_presence_of(:name) }
it { is_expected.to validate_presence_of(:email) }
it { is_expected.to validate_uniqueness_of(:slug).case_insensitive }
it { should define_enum_for(:frequency).with_values(%i[daily weekly monthly]) }
it { should define_enum_for(:weekday).with_values(%i[monday tuesday wednesday thursday friday]) }
describe 'after create' do
before { subject.save! }
context 'delivery information' do
its(:timezone) { is_expected.to eql 'London' }
its(:frequency) { is_expected.to eql 'weekly' }
its(:weekday) { is_expected.to eql 'friday' }
its(:hour) { is_expected.to eql '17:00' }
its(:next_request_at) { is_expected.to be_present }
end
end
describe 'before save' do
let(:next_request_at) {}
let(:company) { create(:company) }
before { company.update(next_request_at: next_request_at) }
subject { company.update(params) }
context 'when company does not have an active delivery' do
let(:params) { { weekday: 'monday' } }
it 'should not re-enqueue the current job' do
expect { subject }.to_not change { company.reload.next_request_at }
end
end
context 'when company has an active delivery' do
let(:next_request_at) { 123.days.from_now }
context 'when delivery params have changed' do
let(:params) { { frequency: 'monthly' } }
it 'should update the request date' do
expect { subject }.to change { company.reload.next_request_at }
end
end
context 'when delivery params have not changed' do
let(:params) { { name: 'In Flames' } }
it 'should not update the request date' do
expect { subject }.to_not change { company.reload.next_request_at }
end
end
end
end
describe '#slack_enabled?' do
let(:slack_token) {}
let(:slack_team_id) {}
let(:company) { create(:company, slack_token: slack_token, slack_team_id: slack_team_id) }
subject { company.slack_enabled? }
context 'when company does not have a token nor a team id' do
it { is_expected.to be false }
end
context 'when company has a token but not a team id' do
let(:slack_token) { 'token-doken' }
it { is_expected.to be false }
end
context 'when company does not have a token but has a team id' do
let(:slack_team_id) { 'Blut im Auge' }
it { is_expected.to be false }
end
context 'when company does not have a token but has a team id' do
let(:slack_token) { 'token-doken' }
let(:slack_team_id) { 'Blut im Auge' }
it { is_expected.to be true }
end
end
end
| 26,913
|
https://github.com/casionone/linkis-0225/blob/master/linkis-engineconn-plugins/linkis-engineconn-plugin-framework/linkis-engineconn-plugin-loader/src/main/java/org/apache/linkis/manager/engineplugin/manager/loaders/EngineConnPluginsLoader.java
|
Github Open Source
|
Open Source
|
ECL-2.0, Apache-2.0
| 2,022
|
linkis-0225
|
casionone
|
Java
|
Code
| 216
| 418
|
/*
* 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.linkis.manager.engineplugin.manager.loaders;
import org.apache.linkis.manager.engineplugin.common.loader.entity.EngineConnPluginInstance;
import org.apache.linkis.manager.label.entity.engine.EngineTypeLabel;
public interface EngineConnPluginsLoader {
/**
* Get plugin( will get from the cache first )
* @param engineTypeLabel engine type label
* @return enginePlugin and classloader (you must not to hold the instance, avoid OOM)
*/
EngineConnPluginInstance getEngineConnPlugin(EngineTypeLabel engineTypeLabel) throws Exception;
/**
* Load plugin without caching ( will force to update the cache )
* @param engineTypeLabel engine type label
* @return enginePlugin and classloader (you must not to hold the instance, avoid OOM)
*/
EngineConnPluginInstance loadEngineConnPlugin(EngineTypeLabel engineTypeLabel) throws Exception;
}
| 43,591
|
https://github.com/MTrop/WadMerge/blob/master/src/main/java/net/mtrop/doom/tools/gui/DoomToolsGUIMain.java
|
Github Open Source
|
Open Source
|
MIT
| null |
WadMerge
|
MTrop
|
Java
|
Code
| 751
| 2,893
|
package net.mtrop.doom.tools.gui;
import java.awt.Rectangle;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.util.Map;
import javax.swing.JFrame;
import net.mtrop.doom.tools.common.Common;
import net.mtrop.doom.tools.gui.apps.DoomMakeNewProjectApp;
import net.mtrop.doom.tools.gui.apps.DoomMakeOpenProjectApp;
import net.mtrop.doom.tools.gui.managers.DoomToolsLanguageManager;
import net.mtrop.doom.tools.gui.managers.DoomToolsLogger;
import net.mtrop.doom.tools.gui.managers.DoomToolsSettingsManager;
import net.mtrop.doom.tools.gui.swing.DoomToolsApplicationFrame;
import net.mtrop.doom.tools.gui.swing.DoomToolsMainWindow;
import net.mtrop.doom.tools.struct.SingletonProvider;
import net.mtrop.doom.tools.struct.swing.SwingUtils;
import net.mtrop.doom.tools.struct.util.EnumUtils;
import net.mtrop.doom.tools.struct.LoggingFactory.Logger;
/**
* Manages the DoomTools GUI window.
* @author Matthew Tropiano
*/
public final class DoomToolsGUIMain
{
/**
* Valid application names.
*/
public interface ApplicationNames
{
/** DoomMake - New Project. */
String DOOMMAKE_NEW = "doommake-new";
/** DoomMake - Open Project. */
String DOOMMAKE_OPEN = "doommake-open";
}
/**
* Supported GUI Themes
*/
public enum Theme
{
LIGHT("com.formdev.flatlaf.FlatLightLaf"),
DARK("com.formdev.flatlaf.FlatDarkLaf"),
INTELLIJ("com.formdev.flatlaf.FlatIntelliJLaf"),
DARCULA("com.formdev.flatlaf.FlatDarculaLaf");
public static final Map<String, Theme> MAP = EnumUtils.createCaseInsensitiveNameMap(Theme.class);
private final String className;
private Theme(String className)
{
this.className = className;
}
}
/** Logger. */
private static final Logger LOG = DoomToolsLogger.getLogger(DoomToolsGUIMain.class);
/** Instance socket. */
private static final int INSTANCE_SOCKET_PORT = 54666;
/** The instance encapsulator. */
private static final SingletonProvider<DoomToolsGUIMain> INSTANCE = new SingletonProvider<>(() -> new DoomToolsGUIMain());
/** Application starter linker. */
private static final DoomToolsApplicationStarter STARTER = new DoomToolsApplicationStarter()
{
@Override
public void startApplication(DoomToolsApplicationInstance applicationInstance)
{
DoomToolsGUIMain.startApplication(applicationInstance);
}
};
/** Instance socket. */
@SuppressWarnings("unused")
private static ServerSocket instanceSocket;
/**
* @return the singleton instance of this settings object.
*/
public static DoomToolsGUIMain get()
{
return INSTANCE.get();
}
/**
* @return true if already running, false if not.
*/
public static boolean isAlreadyRunning()
{
try {
instanceSocket = new ServerSocket(INSTANCE_SOCKET_PORT, 50, InetAddress.getByName(null));
return false;
} catch (IOException e) {
return true;
}
}
/**
* Starts an orphaned main GUI Application.
* Inherits the working directory and environment.
* @return the process created.
* @throws IOException if the application could not be created.
* @see Common#spawnJava(Class)
*/
public static Process startGUIAppProcess() throws IOException
{
return Common.spawnJava(DoomToolsGUIMain.class).exec();
}
/**
* Starts an orphaned GUI Application by name.
* Inherits the working directory and environment.
* @param appName the application name (see {@link ApplicationNames}).
* @param args optional addition arguments (some apps require them).
* @return the process created.
* @throws IOException if the application could not be created.
* @see Common#spawnJava(Class)
*/
public static Process startGUIAppProcess(String appName, String ... args) throws IOException
{
return Common.spawnJava(DoomToolsGUIMain.class).arg(appName).args(args).exec();
}
/* ==================================================================== */
/**
* Adds a new application instance to the main desktop.
* @param applicationInstance the application instance.
*/
private static void startApplication(final DoomToolsApplicationInstance applicationInstance)
{
final DoomToolsApplicationFrame frame = new DoomToolsApplicationFrame(applicationInstance, STARTER);
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter()
{
@Override
public void windowClosing(WindowEvent e)
{
if (applicationInstance.shouldClose())
{
frame.setVisible(false);
applicationInstance.onClose();
frame.dispose();
}
}
});
frame.setVisible(true);
}
/**
* Sets the preferred Look And Feel.
*/
public static void setLAF()
{
Theme theme = Theme.MAP.get(DoomToolsSettingsManager.get().getThemeName());
SwingUtils.setLAF(theme != null ? theme.className : Theme.LIGHT.className);
}
/* ==================================================================== */
/**
* Main method - check for running local instance. If running, do nothing.
* @param args command line arguments.
*/
public static void main(String[] args)
{
setLAF();
// no args - run main application.
if (args.length == 0)
{
if (isAlreadyRunning())
{
System.err.println("DoomTools is already running.");
System.exit(1);
return;
}
get().createAndDisplayMainWindow();
}
// run standalone application.
else
{
try
{
switch (args[0])
{
default:
{
SwingUtils.error("Expected valid application name.");
System.err.println("ERROR: Expected valid application name.");
System.exit(-1);
return;
}
case ApplicationNames.DOOMMAKE_NEW:
{
startApplication(new DoomMakeNewProjectApp(Common.arrayElement(args, 1)));
break;
}
case ApplicationNames.DOOMMAKE_OPEN:
{
String path = Common.arrayElement(args, 1);
// No path. Open file.
if (Common.isEmpty(path))
{
DoomMakeOpenProjectApp app;
if ((app = DoomMakeOpenProjectApp.openAndCreate(null, DoomToolsSettingsManager.get().getLastProjectDirectory())) != null)
startApplication(app);
}
else
{
File projectDirectory = new File(args[1]);
if (DoomMakeOpenProjectApp.isProjectDirectory(projectDirectory))
startApplication(new DoomMakeOpenProjectApp(projectDirectory));
else
SwingUtils.error(DoomToolsLanguageManager.get().getText("doommake.project.open.browse.baddir", projectDirectory.getAbsolutePath()));
}
break;
}
}
}
catch (ArrayIndexOutOfBoundsException e)
{
SwingUtils.error("Missing argument for application: " + e.getLocalizedMessage());
System.err.println("ERROR: Missing argument for application.");
System.exit(-1);
}
}
}
/** Settings singleton. */
private DoomToolsSettingsManager settings;
/** Language manager. */
private DoomToolsLanguageManager language;
/** The main window. */
private DoomToolsMainWindow window;
private DoomToolsGUIMain()
{
this.settings = DoomToolsSettingsManager.get();
this.language = DoomToolsLanguageManager.get();
this.window = null;
}
/**
* Creates and displays the main window.
*/
public void createAndDisplayMainWindow()
{
LOG.info("Creating main window...");
window = new DoomToolsMainWindow(this::attemptShutDown);
window.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
window.addWindowListener(new WindowAdapter()
{
@Override
public void windowClosing(WindowEvent e)
{
attemptShutDown();
}
});
Rectangle windowBounds;
if ((windowBounds = settings.getWindowBounds()) != null)
window.setBounds(windowBounds);
window.setVisible(true);
if (settings.getWindowMaximized())
window.setExtendedState(window.getExtendedState() | DoomToolsMainWindow.MAXIMIZED_BOTH);
LOG.info("Window created.");
}
// Attempts a shutdown, prompting the user first.
private boolean attemptShutDown()
{
LOG.debug("Shutdown attempted.");
if (SwingUtils.yesTo(window, language.getText("doomtools.quit")))
{
shutDown();
return true;
}
return false;
}
// Saves and quits.
private void shutDown()
{
LOG.info("Shutting down DoomTools GUI...");
LOG.info("Sending close to all open apps...");
window.shutDownApps();
LOG.debug("Disposing main window...");
settings.setWindowBounds(window.getX(), window.getY(), window.getWidth(), window.getHeight(),
(window.getExtendedState() & DoomToolsMainWindow.MAXIMIZED_BOTH) != 0
);
window.setVisible(false);
window.dispose();
LOG.debug("Main window disposed.");
LOG.info("Exiting JVM...");
System.exit(0);
}
}
| 38,666
|
https://github.com/Ashok-matrix/talent4startups/blob/master/tests/functional/Registration/StartUpSignUpCept.php
|
Github Open Source
|
Open Source
|
MIT
| 2,014
|
talent4startups
|
Ashok-matrix
|
PHP
|
Code
| 116
| 425
|
<?php
$I = new FunctionalTester($scenario);
$I->am('a guest');
$I->wantTo('sign up for a Talent4Startups account');
$I->amOnPage('/');
$I->click('Sign Up');
$I->click('#startup');
$I->click('#agree');
$I->click('Or sign up with email instead');
$I->sendAjaxPostRequest('/register',array('user_type'=>'S')); // send user type= startup to register route
$I->amOnPage('/register');
$I->fillField('#username', 'JohnDoe');
$I->fillField('#email', 'john@example.com');
$I->fillField('#password', 'demo');
$I->fillField('#password_confirmation', 'demo');
$I->click('#submit-registration'); // Since we have a "Sign Up" link on the top navigation bar and the submit button also has the text "Sign Up" we need to target the input by an ID instead.
$I->amOnPage('/profile');
$I->assertTrue(Auth::check());
$I->see('Welcome to Talent4Startups');
$I->seeRecord('users', [
'username' => 'JohnDoe',
'email' => 'john@example.com'
]);
$I->fillField('First Name:', 'Jane');
$I->fillField('Last Name:', 'Doe');
$I->selectOption('skills[]','1');
$I->click('#submit-profile');
$I->amOnPage('/projects/create'); //create project page if user is startup
$I->seeRecord('profiles', [
'first_name' => 'Jane',
'last_name' => 'Doe'
]);
?>
| 50,721
|
https://github.com/electric-eloquence/fepper-drupal/blob/master/backend/drupal/core/modules/file/tests/src/Kernel/MoveTest.php
|
Github Open Source
|
Open Source
|
GPL-2.0-only, LicenseRef-scancode-unknown-license-reference, LicenseRef-scancode-other-permissive, LicenseRef-scancode-other-copyleft, GPL-2.0-or-later, MIT
| 2,023
|
fepper-drupal
|
electric-eloquence
|
PHP
|
Code
| 850
| 2,583
|
<?php
namespace Drupal\Tests\file\Kernel;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Entity\EntityTypeManager;
use Drupal\Core\File\Exception\FileExistsException;
use Drupal\Core\File\Exception\InvalidStreamWrapperException;
use Drupal\Core\File\FileSystemInterface;
use Drupal\file\Entity\File;
use Drupal\file\FileRepository;
/**
* Tests the file move function.
*
* @coversDefaultClass \Drupal\file\FileRepository
* @group file
*/
class MoveTest extends FileManagedUnitTestBase {
/**
* The file repository service under test.
*
* @var \Drupal\file\FileRepository
*/
protected $fileRepository;
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->fileRepository = $this->container->get('file.repository');
}
/**
* Move a normal file.
*
* @covers ::move
*/
public function testNormal() {
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
$desired_filepath = 'public://' . $this->randomMachineName();
// Clone the object so we don't have to worry about the function changing
// our reference copy.
$result = $this->fileRepository->move(clone $source, $desired_filepath, FileSystemInterface::EXISTS_ERROR);
// Check the return status and that the contents changed.
$this->assertNotFalse($result, 'File moved successfully.');
$this->assertFileDoesNotExist($source->getFileUri());
$this->assertEquals($contents, file_get_contents($result->getFileUri()), 'Contents of file correctly written.');
// Check that the correct hooks were called.
$this->assertFileHooksCalled(['move', 'load', 'update']);
// Make sure we got the same file back.
$this->assertEquals($source->id(), $result->id(), new FormattableMarkup("Source file id's' %fid is unchanged after move.", ['%fid' => $source->id()]));
// Reload the file from the database and check that the changes were
// actually saved.
$loaded_file = File::load($result->id());
$this->assertNotEmpty($loaded_file, 'File can be loaded from the database.');
$this->assertFileUnchanged($result, $loaded_file);
}
/**
* Tests renaming when moving onto a file that already exists.
*
* @covers ::move
*/
public function testExistingRename() {
// Setup a file to overwrite.
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
$target = $this->createFile();
$this->assertDifferentFile($source, $target);
// Clone the object so we don't have to worry about the function changing
// our reference copy.
$result = $this->fileRepository->move(clone $source, $target->getFileUri());
// Check the return status and that the contents changed.
$this->assertNotFalse($result, 'File moved successfully.');
$this->assertFileDoesNotExist($source->getFileUri());
$this->assertEquals($contents, file_get_contents($result->getFileUri()), 'Contents of file correctly written.');
// Check that the correct hooks were called.
$this->assertFileHooksCalled(['move', 'load', 'update']);
// Compare the returned value to what made it into the database.
$this->assertFileUnchanged($result, File::load($result->id()));
// The target file should not have been altered.
$this->assertFileUnchanged($target, File::load($target->id()));
// Make sure we end up with two distinct files afterwards.
$this->assertDifferentFile($target, $result);
// Compare the source and results.
$loaded_source = File::load($source->id());
$this->assertEquals($result->id(), $loaded_source->id(), "Returned file's id matches the source.");
$this->assertNotEquals($source->getFileUri(), $loaded_source->getFileUri(), 'Returned file path has changed from the original.');
}
/**
* Tests replacement when moving onto a file that already exists.
*
* @covers ::move
*/
public function testExistingReplace() {
// Setup a file to overwrite.
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
$target = $this->createFile();
$this->assertDifferentFile($source, $target);
// Clone the object so we don't have to worry about the function changing
// our reference copy.
$result = $this->fileRepository->move(clone $source, $target->getFileUri(), FileSystemInterface::EXISTS_REPLACE);
// Look at the results.
$this->assertEquals($contents, file_get_contents($result->getFileUri()), 'Contents of file were overwritten.');
$this->assertFileDoesNotExist($source->getFileUri());
$this->assertNotEmpty($result, 'File moved successfully.');
// Check that the correct hooks were called.
$this->assertFileHooksCalled(['move', 'update', 'delete', 'load']);
// Reload the file from the database and check that the changes were
// actually saved.
$loaded_result = File::load($result->id());
$this->assertFileUnchanged($result, $loaded_result);
// Check that target was re-used.
$this->assertSameFile($target, $loaded_result);
// Source and result should be totally different.
$this->assertDifferentFile($source, $loaded_result);
}
/**
* Tests replacement when moving onto itself.
*
* @covers ::move
*/
public function testExistingReplaceSelf() {
// Setup a file to overwrite.
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
// Copy the file over itself. Clone the object so we don't have to worry
// about the function changing our reference copy.
try {
$result = $this->fileRepository->move(clone $source, $source->getFileUri(), FileSystemInterface::EXISTS_ERROR);
$this->fail('expected FileExistsException');
}
catch (FileExistsException $e) {
// expected exception.
$this->assertStringContainsString("could not be copied because a file by that name already exists in the destination directory", $e->getMessage());
}
$this->assertEquals($contents, file_get_contents($source->getFileUri()), 'Contents of file were not altered.');
// Check that no hooks were called while failing.
$this->assertFileHooksCalled([]);
// Load the file from the database and make sure it is identical to what
// was returned.
$this->assertFileUnchanged($source, File::load($source->id()));
}
/**
* Tests that moving onto an existing file fails when instructed to do so.
*
* @covers ::move
*/
public function testExistingError() {
$contents = $this->randomMachineName(10);
$source = $this->createFile();
$target = $this->createFile(NULL, $contents);
$this->assertDifferentFile($source, $target);
// Clone the object so we don't have to worry about the function changing
// our reference copy.
try {
$result = $this->fileRepository->move(clone $source, $target->getFileUri(), FileSystemInterface::EXISTS_ERROR);
$this->fail('expected FileExistsException');
}
// FileExistsException is a subclass of FileException.
catch (FileExistsException $e) {
// expected exception.
$this->assertStringContainsString("could not be copied because a file by that name already exists in the destination directory", $e->getMessage());
}
// Check the return status and that the contents did not change.
$this->assertFileExists($source->getFileUri());
$this->assertEquals($contents, file_get_contents($target->getFileUri()), 'Contents of file were not altered.');
// Check that no hooks were called while failing.
$this->assertFileHooksCalled([]);
// Load the file from the database and make sure it is identical to what
// was returned.
$this->assertFileUnchanged($source, File::load($source->id()));
$this->assertFileUnchanged($target, File::load($target->id()));
}
/**
* Tests for an invalid stream wrapper.
*
* @covers ::move
*/
public function testInvalidStreamWrapper() {
$this->expectException(InvalidStreamWrapperException::class);
$source = $this->createFile();
$this->fileRepository->move($source, 'foo://');
}
/**
* Tests for entity storage exception.
*
* @covers ::move
*/
public function testEntityStorageException() {
/** @var \Drupal\Core\Entity\EntityTypeManager $entityTypeManager */
$entityTypeManager = $this->prophesize(EntityTypeManager::class);
$entityTypeManager->getStorage('file')
->willThrow(EntityStorageException::class);
$fileRepository = new FileRepository(
$this->container->get('file_system'),
$this->container->get('stream_wrapper_manager'),
$entityTypeManager->reveal(),
$this->container->get('module_handler'),
$this->container->get('file.usage'),
$this->container->get('current_user')
);
$this->expectException(EntityStorageException::class);
$source = $this->createFile();
$target = $this->createFile();
$fileRepository->move($source, $target->getFileUri(), FileSystemInterface::EXISTS_REPLACE);
}
}
| 32,664
|
https://github.com/HengeSense/buddycloud-android/blob/master/src/com/buddycloud/utils/TextUtils.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,015
|
buddycloud-android
|
HengeSense
|
Java
|
Code
| 93
| 586
|
package com.buddycloud.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.text.Html;
import android.text.Spanned;
public class TextUtils {
private static final String LINKS_REGEX = new StringBuilder()
.append("(?:")
.append("\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]"
+ "{2,4}/)(?:[^\\s()<>]+|\\((?:[^\\s()<>]+|(?:\\([^\\s()<>]+\\)))*\\))+(?:\\((?:"
+ "[^\\s()<>]+|(?:\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:\'\".,<>?«»“”‘’]))\\b")
.append("|")
.append("\\b([\\w\\d][\\w\\d-_%&+<>.]+@[\\w\\d-]{3,}\\.[\\w\\d-]{2,}(?:\\.[\\w]{2,6})?)\\b")
.append(")").toString();
private static final Pattern LINKS_PATTERN = Pattern.compile(LINKS_REGEX);
public static Spanned anchor(String text) {
if (text == null) {
return null;
}
Matcher matcher = LINKS_PATTERN.matcher(text);
StringBuffer textBuffer = new StringBuffer();
while (matcher.find()) {
if (matcher.group(1) != null) {
matcher.appendReplacement(textBuffer, "<a href=\"$1\">$1</a>");
} else if (matcher.group(2) != null) {
matcher.appendReplacement(textBuffer, "<a href=\"buddycloud:$2\">$2</a>");
}
}
matcher.appendTail(textBuffer);
text = textBuffer.toString().replaceAll("\\n", "<br>");
return Html.fromHtml(text);
}
}
| 32,750
|
https://github.com/ansonauhk/keda/blob/master/pkg/scalers/aws_sqs_queue_test.go
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
keda
|
ansonauhk
|
Go
|
Code
| 379
| 1,867
|
package scalers
import (
"testing"
)
const (
testAWSSQSRoleArn = "none"
testAWSSQSAccessKeyID = "none"
testAWSSQSSecretAccessKey = "none"
testAWSSQSProperQueueURL = "https://sqs.eu-west-1.amazonaws.com/account_id/DeleteArtifactQ"
testAWSSQSImproperQueueURL1 = "https://sqs.eu-west-1.amazonaws.com/account_id"
testAWSSQSImproperQueueURL2 = "https://sqs.eu-west-1.amazonaws.com"
)
var testAWSSQSResolvedEnv = map[string]string{
"AWS_ACCESS_KEY": "none",
"AWS_SECRET_ACCESS_KEY": "none",
}
var testAWSSQSAuthentication = map[string]string{
"awsAccessKeyId": testAWSSQSAccessKeyID,
"awsSecretAccessKey": testAWSSQSSecretAccessKey,
}
type parseAWSSQSMetadataTestData struct {
metadata map[string]string
authParams map[string]string
isError bool
comment string
}
type awsSQSMetricIdentifier struct {
metadataTestData *parseAWSSQSMetadataTestData
name string
}
var testAWSSQSMetadata = []parseAWSSQSMetadataTestData{
{map[string]string{},
testAWSSQSAuthentication,
true,
"metadata empty"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "1",
"awsRegion": "eu-west-1"},
testAWSSQSAuthentication,
false,
"properly formed queue and region"},
{map[string]string{
"queueURL": testAWSSQSImproperQueueURL1,
"queueLength": "1",
"awsRegion": "eu-west-1"},
testAWSSQSAuthentication,
true,
"improperly formed queue, missing queueName"},
{map[string]string{
"queueURL": testAWSSQSImproperQueueURL2,
"queueLength": "1",
"awsRegion": "eu-west-1"},
testAWSSQSAuthentication,
true,
"improperly formed queue, missing path"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "1",
"awsRegion": ""},
testAWSSQSAuthentication,
true,
"properly formed queue, empty region"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "1",
"awsRegion": "eu-west-1"},
testAWSSQSAuthentication,
false,
"properly formed queue, integer queueLength"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "a",
"awsRegion": "eu-west-1"},
testAWSSQSAuthentication,
false,
"properly formed queue, invalid queueLength"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "1",
"awsRegion": "eu-west-1"},
map[string]string{
"awsAccessKeyId": testAWSSQSAccessKeyID,
"awsSecretAccessKey": testAWSSQSSecretAccessKey,
},
false,
"with AWS Credentials from TriggerAuthentication"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "1",
"awsRegion": "eu-west-1"},
map[string]string{
"awsAccessKeyId": "",
"awsSecretAccessKey": testAWSSQSSecretAccessKey,
},
true,
"with AWS Credentials from TriggerAuthentication, missing Access Key Id"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "1",
"awsRegion": "eu-west-1"},
map[string]string{
"awsAccessKeyId": testAWSSQSAccessKeyID,
"awsSecretAccessKey": "",
},
true,
"with AWS Credentials from TriggerAuthentication, missing Secret Access Key"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "1",
"awsRegion": "eu-west-1"},
map[string]string{
"awsRoleArn": testAWSSQSRoleArn,
},
false,
"with AWS Role from TriggerAuthentication"},
{map[string]string{
"queueURL": testAWSSQSProperQueueURL,
"queueLength": "1",
"awsRegion": "eu-west-1",
"identityOwner": "operator"},
map[string]string{
"awsAccessKeyId": "",
"awsSecretAccessKey": "",
},
false,
"with AWS Role assigned on KEDA operator itself"},
}
var awsSQSMetricIdentifiers = []awsSQSMetricIdentifier{
{&testAWSSQSMetadata[1], "AWS-SQS-Queue-DeleteArtifactQ"},
}
func TestSQSParseMetadata(t *testing.T) {
for _, testData := range testAWSSQSMetadata {
_, err := parseAwsSqsQueueMetadata(testData.metadata, testAWSSQSAuthentication, testData.authParams)
if err != nil && !testData.isError {
t.Errorf("Expected success because %s got error, %s", testData.comment, err)
}
if testData.isError && err == nil {
t.Errorf("Expected error because %s but got success, %#v", testData.comment, testData)
}
}
}
func TestAWSSQSGetMetricSpecForScaling(t *testing.T) {
for _, testData := range awsSQSMetricIdentifiers {
meta, err := parseAwsSqsQueueMetadata(testData.metadataTestData.metadata, testAWSSQSAuthentication, testData.metadataTestData.authParams)
if err != nil {
t.Fatal("Could not parse metadata:", err)
}
mockAWSSQSScaler := awsSqsQueueScaler{meta}
metricSpec := mockAWSSQSScaler.GetMetricSpecForScaling()
metricName := metricSpec[0].External.Metric.Name
if metricName != testData.name {
t.Error("Wrong External metric source name:", metricName)
}
}
}
| 20,513
|
https://github.com/dagood/roslyn/blob/master/src/Compilers/Core/RebuildTest/OptionRoundTripTests.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
roslyn
|
dagood
|
C#
|
Code
| 427
| 1,609
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.PortableExecutable;
using System.Text;
using System.Threading;
using BuildValidator;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.CodeAnalysis.VisualBasic;
using Microsoft.Extensions.Logging;
using Xunit;
namespace Microsoft.CodeAnalysis.Rebuild.UnitTests
{
public class OptionRoundTripTests : CSharpTestBase
{
public static readonly CSharpCompilationOptions BaseCSharpCompilationOptions = TestOptions.DebugExe.WithDeterministic(true);
public static readonly VisualBasicCompilationOptions BaseVisualBasicCompilationOptions = new VisualBasicCompilationOptions(
outputKind: OutputKind.ConsoleApplication,
deterministic: true);
public static readonly object[][] Platforms = ((Platform[])Enum.GetValues(typeof(Platform))).Select(p => new[] { (object)p }).ToArray();
private static void VerifyRoundTrip<TCompilation>(TCompilation original)
where TCompilation : Compilation
{
Assert.True(original.SyntaxTrees.All(x => !string.IsNullOrEmpty(x.FilePath)));
Assert.True(original.Options.Deterministic);
original.VerifyDiagnostics();
var originalBytes = original.EmitToArray(new EmitOptions(debugInformationFormat: DebugInformationFormat.Embedded));
var originalReader = new PEReader(originalBytes);
var originalPdbReader = originalReader.GetEmbeddedPdbMetadataReader();
var factory = LoggerFactory.Create(configure => { });
var logger = factory.CreateLogger("RoundTripVerification");
var optionsReader = new CompilationOptionsReader(logger, originalPdbReader, originalReader);
var assemblyFileName = original.AssemblyName!;
if (typeof(TCompilation) == typeof(CSharpCompilation))
{
var assemblyFileExtension = original.Options.OutputKind switch
{
OutputKind.DynamicallyLinkedLibrary => ".dll",
OutputKind.ConsoleApplication => ".exe",
_ => throw new InvalidOperationException(),
};
assemblyFileName += assemblyFileExtension;
}
var compilationFactory = CompilationFactory.Create(assemblyFileName, optionsReader);
var rebuild = compilationFactory.CreateCompilation(
original.SyntaxTrees.Select(x => compilationFactory.CreateSyntaxTree(x.FilePath, x.GetText())).ToImmutableArray(),
original.References.ToImmutableArray());
Assert.IsType<TCompilation>(rebuild);
VerifyCompilationOptions(original.Options, rebuild.Options);
using var rebuildStream = new MemoryStream();
var result = compilationFactory.Emit(
rebuildStream,
rebuild,
embeddedTexts: ImmutableArray<EmbeddedText>.Empty,
CancellationToken.None);
Assert.Empty(result.Diagnostics);
Assert.True(result.Success);
Assert.Equal(originalBytes.ToArray(), rebuildStream.ToArray());
}
#pragma warning disable 612
private static void VerifyCompilationOptions(CompilationOptions originalOptions, CompilationOptions rebuildOptions)
{
var type = originalOptions.GetType();
foreach (var propertyInfo in type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
{
switch (propertyInfo.Name)
{
case nameof(CompilationOptions.GeneralDiagnosticOption):
case nameof(CompilationOptions.Features):
case nameof(CompilationOptions.ModuleName):
case nameof(CompilationOptions.MainTypeName):
case nameof(CompilationOptions.ConcurrentBuild):
case nameof(CompilationOptions.WarningLevel):
// Can be different and are special cased
break;
case nameof(VisualBasicCompilationOptions.ParseOptions):
{
var originalValue = propertyInfo.GetValue(originalOptions)!;
var rebuildValue = propertyInfo.GetValue(rebuildOptions)!;
VerifyParseOptions((ParseOptions)originalValue, (ParseOptions)rebuildValue);
}
break;
default:
{
var originalValue = propertyInfo.GetValue(originalOptions);
var rebuildValue = propertyInfo.GetValue(rebuildOptions);
Assert.Equal(originalValue, rebuildValue);
}
break;
}
}
}
#pragma warning restore 612
private static void VerifyParseOptions(ParseOptions originalOptions, ParseOptions rebuildOptions)
{
var type = originalOptions.GetType();
foreach (var propertyInfo in type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
{
// Several options are expected to be different and they are special cased here.
if (propertyInfo.Name == nameof(VisualBasicParseOptions.SpecifiedLanguageVersion))
{
continue;
}
var originalValue = propertyInfo.GetValue(originalOptions);
var rebuildValue = propertyInfo.GetValue(rebuildOptions);
Assert.Equal(originalValue, rebuildValue);
}
}
[Theory]
[MemberData(nameof(Platforms))]
public void Platform_RoundTrip(Platform platform)
{
var original = CreateCompilation(
"class C { static void Main() { } }",
options: BaseCSharpCompilationOptions.WithPlatform(platform),
sourceFileName: "test.cs");
VerifyRoundTrip(original);
}
[Theory]
[MemberData(nameof(Platforms))]
public void Platform_RoundTrip_VB(Platform platform)
{
var original = CreateVisualBasicCompilation(
compilationOptions: BaseVisualBasicCompilationOptions.WithPlatform(platform).WithModuleName("test"),
encoding: Encoding.UTF8,
code: @"
Class C
Shared Sub Main()
End Sub
End Class",
assemblyName: "test",
sourceFileName: "test.vb");
VerifyRoundTrip(original);
}
}
}
| 13,711
|
https://github.com/wtgodbe/wcf/blob/master/src/System.Private.ServiceModel/src/System/ServiceModel/OperationContractAttribute.cs
|
Github Open Source
|
Open Source
|
MIT
| null |
wcf
|
wtgodbe
|
C#
|
Code
| 343
| 982
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Net.Security;
using System.Reflection;
using System.ServiceModel.Description;
using System.ServiceModel.Security;
namespace System.ServiceModel
{
[AttributeUsage(ServiceModelAttributeTargets.OperationContract)]
public sealed class OperationContractAttribute : Attribute
{
private string _name = null;
private string _action = null;
private string _replyAction = null;
private bool _asyncPattern = false;
private bool _isInitiating = true;
private bool _isTerminating = false;
private bool _isOneWay = false;
private ProtectionLevel _protectionLevel = ProtectionLevel.None;
private bool _hasProtectionLevel = false;
public string Name
{
get { return _name; }
set
{
if (value == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
if (value == "")
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value",
SR.SFxNameCannotBeEmpty));
}
_name = value;
}
}
internal const string ActionPropertyName = "Action";
public string Action
{
get { return _action; }
set
{
if (value == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
_action = value;
}
}
internal const string ProtectionLevelPropertyName = "ProtectionLevel";
public ProtectionLevel ProtectionLevel
{
get
{
return _protectionLevel;
}
set
{
if (!ProtectionLevelHelper.IsDefined(value))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value"));
_protectionLevel = value;
_hasProtectionLevel = true;
}
}
public bool HasProtectionLevel
{
get { return _hasProtectionLevel; }
}
internal const string ReplyActionPropertyName = "ReplyAction";
public string ReplyAction
{
get { return _replyAction; }
set
{
if (value == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
_replyAction = value;
}
}
public bool AsyncPattern
{
get { return _asyncPattern; }
set { _asyncPattern = value; }
}
public bool IsOneWay
{
get { return _isOneWay; }
set { _isOneWay = value; }
}
public bool IsInitiating
{
get { return _isInitiating; }
set { _isInitiating = value; }
}
public bool IsTerminating
{
get { return _isTerminating; }
set { _isTerminating = value; }
}
internal bool IsSessionOpenNotificationEnabled
{
get
{
return this.Action == OperationDescription.SessionOpenedAction;
}
}
internal void EnsureInvariants(MethodInfo methodInfo, string operationName)
{
if (this.IsSessionOpenNotificationEnabled)
{
if (!this.IsOneWay
|| !this.IsInitiating
|| methodInfo.GetParameters().Length > 0)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(
SR.Format(SR.ContractIsNotSelfConsistentWhenIsSessionOpenNotificationEnabled, operationName, "Action", OperationDescription.SessionOpenedAction, "IsOneWay", "IsInitiating")));
}
}
}
}
}
| 29,959
|
https://github.com/yarnaimo/reinainfo-next/blob/master/src/utils/html.tsx
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
reinainfo-next
|
yarnaimo
|
TypeScript
|
Code
| 28
| 63
|
import React from 'react'
export const bool = (value: any) => (value ? <b>{'*'}</b> : '')
export const textarea = {
textarea: true,
outlined: true,
rows: 2,
}
| 20,697
|
https://github.com/ahansb/homework/blob/master/Text-Files/P2-Concatenate-Text-Files/ConcatenateTextFiles.cs
|
Github Open Source
|
Open Source
|
MIT
| null |
homework
|
ahansb
|
C#
|
Code
| 89
| 282
|
//Problem 2. Concatenate text files
//Write a program that concatenates two text files into another text file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
class ConcatenateTextFiles
{
static void Main()
{
var srOne = new StreamReader(@"..\..\TextFile1.txt");
var srTwo = new StreamReader(@"..\..\TextFile2.txt");
var sw = new StreamWriter(@"..\..\Concat.txt");
using (srOne)
{
string line = srOne.ReadLine();
while (line!=null)
{
sw.WriteLine(line);
line = srOne.ReadLine();
}
}
using (srTwo)
{
string line = srTwo.ReadLine();
while (line != null)
{
sw.WriteLine(line);
line = srTwo.ReadLine();
}
}
sw.Close();
Console.WriteLine("Done");
}
}
| 34,968
|
https://github.com/SRI-CSL/Bliss/blob/master/ntt_variants/ntt_red256.c
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
Bliss
|
SRI-CSL
|
C
|
Code
| 527
| 1,920
|
/*
* NTT for Q=12289, n=256, using the Longa/Naehrig reduction method.
*/
#include "ntt_red256.h"
/*
* Input: two arrays a and b in standard order
*
* Result:
* - the product is stored in array c, in standard order.
* - arrays a and b are modified
*
* The input arrays must contain elements in the range [0, Q-1]
* The result is also in that range.
*/
void ntt_red256_product1(int32_t *c, int32_t *a, int32_t *b) {
shift_array(a, 256); // convert to [-(Q-1)/2, (Q-1)/2]
mul_reduce_array16(a, 256, ntt_red256_psi_powers);
ntt_red256_ct_std2rev(a);
reduce_array(a, 256);
shift_array(b, 256);
mul_reduce_array16(b, 256, ntt_red256_psi_powers);
ntt_red256_ct_std2rev(b);
reduce_array(b, 256);
// at this point:
// a = NTT(a) * 3, -524287 <= a[i] <= 536573
// b = NTT(b) * 3, -524287 <= b[i] <= 536573
mul_reduce_array(c, 256, a, b); // c[i] = 3 * a[i] * b[i]
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
// we have: -130 <= c[i] <= 12413
intt_red256_ct_rev2std(c);
mul_reduce_array16(c, 256, ntt_red256_scaled_inv_psi_powers);
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
correct(c, 256);
}
void ntt_red256_product2(int32_t *c, int32_t *a, int32_t *b) {
shift_array(a, 256); // convert to [-(Q-1)/2, (Q-1)/2]
mul_reduce_array16(a, 256, ntt_red256_psi_powers);
ntt_red256_gs_std2rev(a);
reduce_array(a, 256);
shift_array(b, 256);
mul_reduce_array16(b, 256, ntt_red256_psi_powers);
ntt_red256_gs_std2rev(b);
reduce_array(b, 256);
// at this point:
// a = NTT(a) * 3, -524287 <= a[i] <= 536573
// b = NTT(b) * 3, -524287 <= b[i] <= 536573
mul_reduce_array(c, 256, a, b); // c[i] = 3 * a[i] * b[i]
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
// we have: -130 <= c[i] <= 12413
intt_red256_ct_rev2std(c);
mul_reduce_array16(c, 256, ntt_red256_scaled_inv_psi_powers);
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
correct(c, 256);
}
void ntt_red256_product3(int32_t *c, int32_t *a, int32_t *b) {
shift_array(a, 256); // convert to [-(Q-1)/2, (Q-1)/2]
mul_reduce_array16(a, 256, ntt_red256_psi_powers);
ntt_red256_ct_std2rev(a);
reduce_array(a, 256);
shift_array(b, 256);
mul_reduce_array16(b, 256, ntt_red256_psi_powers);
ntt_red256_ct_std2rev(b);
reduce_array(b, 256);
// at this point:
// a = NTT(a) * 3, -524287 <= a[i] <= 536573
// b = NTT(b) * 3, -524287 <= b[i] <= 536573
mul_reduce_array(c, 256, a, b); // c[i] = 3 * a[i] * b[i]
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
// we have: -130 <= c[i] <= 12413
intt_red256_gs_rev2std(c);
mul_reduce_array16(c, 256, ntt_red256_scaled_inv_psi_powers);
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
correct(c, 256);
}
void ntt_red256_product4(int32_t *c, int32_t *a, int32_t *b) {
shift_array(a, 256); // convert to [-(Q-1)/2, (Q-1)/2]
mul_reduce_array16(a, 256, ntt_red256_psi_powers);
ntt_red256_gs_std2rev(a);
reduce_array(a, 256);
shift_array(b, 256);
mul_reduce_array16(b, 256, ntt_red256_psi_powers);
ntt_red256_gs_std2rev(b);
reduce_array(b, 256);
// at this point:
// a = NTT(a) * 3, -524287 <= a[i] <= 536573
// b = NTT(b) * 3, -524287 <= b[i] <= 536573
mul_reduce_array(c, 256, a, b); // c[i] = 3 * a[i] * b[i]
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
// we have: -130 <= c[i] <= 12413
intt_red256_gs_rev2std(c);
mul_reduce_array16(c, 256, ntt_red256_scaled_inv_psi_powers);
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
correct(c, 256);
}
void ntt_red256_product5(int32_t *c, int32_t *a, int32_t *b) {
shift_array(a, 256);
mulntt_red256_ct_std2rev(a);
reduce_array(a, 256);
shift_array(b, 256);
mulntt_red256_ct_std2rev(b);
reduce_array(b, 256);
mul_reduce_array(c, 256, a, b); // c[i] = 3 * a[i] * b[i]
reduce_array_twice(c, 256); // c[i] = 9 * c[i] mod Q
inttmul_red256_gs_rev2std(c);
scalar_mul_reduce_array(c, 256, ntt_red256_rescale8);
reduce_array_twice(c, 256);
correct(c, 256);
}
| 22,973
|
https://github.com/manix84/utils/blob/master/src/string/upperCaseFirst.js
|
Github Open Source
|
Open Source
|
MIT
| 2,012
|
utils
|
manix84
|
JavaScript
|
Code
| 51
| 133
|
/**
* @author Rob Taylor [manix84@gmail.com]
*/
define('string/upperCaseFirst', function () {
/**
* Capitalise the first letter of the string.
* @exports string/upperCaseFirst
*
* @param {String} string - String to be capitalised
* @returns {String}
*/
var upperCaseFirst = function (string) {
return string.charAt(0).toUpperCase() + string.slice(1);
};
return upperCaseFirst;
});
| 17,324
|
https://github.com/ElenaTrehub/well-fed-home/blob/master/database/migrations/2020_02_21_174926_create_ingredients.php
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
well-fed-home
|
ElenaTrehub
|
PHP
|
Code
| 58
| 260
|
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateIngredients extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ingredients', function (Blueprint $table) {
$table->bigIncrements('idIngredient');
$table->string('titleIngredient', 250);
$table->integer('count')->unsigned();
$table->bigInteger('idRecipe')->unsigned();
$table->foreign('idRecipe')->references('idRecipe')->on('recipes');
$table->bigInteger('idUnit')->unsigned();
$table->foreign('idUnit')->references('idUnit')->on('units');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ingredients');
}
}
| 8,762
|
https://github.com/venbacodes/AuctionSystem/blob/master/Tests/Application.UnitTests/Items/Queries/GetItemDetailsQueryHandlerTests.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
AuctionSystem
|
venbacodes
|
C#
|
Code
| 102
| 514
|
namespace Application.UnitTests.Items.Queries
{
using System;
using System.Threading;
using System.Threading.Tasks;
using Application.Items.Queries.Details;
using AutoMapper;
using Common.Exceptions;
using Common.Interfaces;
using Common.Models;
using FluentAssertions;
using Setup;
using Xunit;
[Collection("QueryCollection")]
public class GetItemDetailsQueryHandlerTests
{
private readonly IAuctionSystemDbContext context;
private readonly IMapper mapper;
public GetItemDetailsQueryHandlerTests(QueryTestFixture fixture)
{
this.context = fixture.Context;
this.mapper = fixture.Mapper;
}
[Theory]
[InlineData("0d0942f7-7ad3-4195-b712-c63d9a2cea30")]
[InlineData("8d3cc00e-7f8d-4da8-9a85-088acf728487")]
[InlineData("833eb36a-ea38-45e8-ae1c-a52caca13c56")]
public async Task GetItemDetails_Given_InvalidId_Should_Throw_NotFoundException(string id)
{
var handler = new GetItemDetailsQueryHandler(this.context, this.mapper);
await Assert.ThrowsAsync<NotFoundException>(() =>
handler.Handle(new GetItemDetailsQuery(Guid.Parse(id)), CancellationToken.None));
}
[Fact]
public async Task GetItemDetails_Should_Return_CorrectEntityAndModel()
{
var handler = new GetItemDetailsQueryHandler(this.context, this.mapper);
var result = await handler.Handle(new GetItemDetailsQuery(DataConstants.SampleItemId), CancellationToken.None);
result
.Should()
.BeOfType<Response<ItemDetailsResponseModel>>();
result
.Data
.Id
.Should()
.Be(DataConstants.SampleItemId);
}
}
}
| 42,628
|
https://github.com/mekanism/Mekanism/blob/master/src/main/java/mekanism/common/content/miner/MinerTagFilter.java
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
Mekanism
|
mekanism
|
Java
|
Code
| 199
| 772
|
package mekanism.common.content.miner;
import java.util.Objects;
import mekanism.api.NBTConstants;
import mekanism.common.base.TagCache;
import mekanism.common.content.filter.FilterType;
import mekanism.common.content.filter.ITagFilter;
import mekanism.common.lib.WildcardMatcher;
import mekanism.common.network.BasePacketHandler;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.level.block.state.BlockState;
public class MinerTagFilter extends MinerFilter<MinerTagFilter> implements ITagFilter<MinerTagFilter> {
private String tagName;
public MinerTagFilter(String tagName) {
this.tagName = tagName;
}
public MinerTagFilter() {
}
public MinerTagFilter(MinerTagFilter filter) {
super(filter);
tagName = filter.tagName;
}
@Override
public boolean canFilter(BlockState state) {
return state.getTags().anyMatch(tag -> WildcardMatcher.matches(tagName, tag));
}
@Override
public boolean hasBlacklistedElement() {
return TagCache.tagHasMinerBlacklisted(tagName);
}
@Override
public CompoundTag write(CompoundTag nbtTags) {
super.write(nbtTags);
nbtTags.putString(NBTConstants.TAG_NAME, tagName);
return nbtTags;
}
@Override
public void read(CompoundTag nbtTags) {
super.read(nbtTags);
tagName = nbtTags.getString(NBTConstants.TAG_NAME);
}
@Override
public void write(FriendlyByteBuf buffer) {
super.write(buffer);
buffer.writeUtf(tagName);
}
@Override
public void read(FriendlyByteBuf dataStream) {
super.read(dataStream);
tagName = BasePacketHandler.readString(dataStream);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tagName);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
} else if (o == null || getClass() != o.getClass() || !super.equals(o)) {
return false;
}
MinerTagFilter other = (MinerTagFilter) o;
return tagName.equals(other.tagName);
}
@Override
public MinerTagFilter clone() {
return new MinerTagFilter(this);
}
@Override
public FilterType getFilterType() {
return FilterType.MINER_TAG_FILTER;
}
@Override
public void setTagName(String name) {
tagName = name;
}
@Override
public String getTagName() {
return tagName;
}
}
| 47,957
|
https://github.com/buession/buession-springboot/blob/master/buession-springboot-captcha/src/main/java/com/buession/springboot/captcha/autoconfigure/ImageCaptchaFactoryBuilder.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
buession-springboot
|
buession
|
Java
|
Code
| 402
| 1,405
|
/*
* 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.
*
* =========================================================================================================
*
* This software consists of voluntary contributions made by many individuals on behalf of the
* Apache Software Foundation. For more information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2021 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.springboot.captcha.autoconfigure;
import com.buession.core.utils.RandomUtils;
import com.buession.core.validator.Validate;
import com.buession.security.captcha.background.BackgroundFactory;
import com.buession.security.captcha.background.SingleColorBackgroundFactory;
import com.buession.security.captcha.color.ColorFactory;
import com.buession.security.captcha.font.FontFactory;
import com.buession.security.captcha.font.RandomFontFactory;
import com.buession.security.captcha.font.SingleFontFactory;
import com.buession.security.captcha.handler.generator.Generator;
import com.buession.security.captcha.text.TextFactory;
import com.buession.security.captcha.word.RandomWordFactory;
import com.buession.security.captcha.word.WordFactory;
import java.awt.*;
/**
* @author Yong.Teng
* @since 1.0.0
*/
class ImageCaptchaFactoryBuilder {
private Image config;
private BackgroundFactory backgroundFactory;
private FontFactory fontFactory;
private ColorFactory colorFactory;
private WordFactory wordFactory;
private TextFactory textFactory;
private ImageCaptchaFactoryBuilder(final Image config){
this.config = config;
}
public static ImageCaptchaFactoryBuilder getInstance(final Image config){
return new ImageCaptchaFactoryBuilder(config);
}
public ImageCaptchaFactoryBuilder background(){
Image.Background background = config.getBackground();
backgroundFactory = new SingleColorBackgroundFactory(new Color(background.getColor().getR(),
background.getColor().getG(), background.getColor().getB()), background.getAlpha());
return this;
}
public ImageCaptchaFactoryBuilder font(){
Image.Font font = config.getFont();
if(Validate.isEmpty(font.getFamilies()) || font.getFamilies().size() == 1){
String fontName = SingleFontFactory.DEFAULT_FONT.getName();
int fontSize = RandomUtils.nextInt(font.getMinSize(), font.getMinSize());
fontFactory = new SingleFontFactory(fontName, fontSize, font.getStyle());
}else{
fontFactory = new RandomFontFactory(font.getFamilies(), font.getMinSize(), font.getMaxSize(),
font.getStyle());
}
Image.Color color = config.getFont().getColor();
colorFactory = ColorUtils.createColorFactory(color.getMinColor(), color.getMaxColor());
return this;
}
public ImageCaptchaFactoryBuilder word(){
Image.Word word = config.getWord();
if(Validate.hasText(word.getContent())){
wordFactory = new RandomWordFactory(word.getMinLength(), word.getMaxLength(), word.getContent());
}else if(word.getWordType() != null){
wordFactory = new RandomWordFactory(word.getMinLength(), word.getMaxLength(), word.getWordType());
}
return this;
}
public ImageCaptchaFactoryBuilder text() throws IllegalAccessException, InstantiationException{
Image.Text text = config.getText();
textFactory = text.getTextFactoryClass().newInstance();
textFactory.setTopMargin(text.getTopMargin());
textFactory.setBottomMargin(text.getBottomMargin());
textFactory.setLeftMargin(textFactory.getLeftMargin());
textFactory.setRightMargin(textFactory.getRightMargin());
return this;
}
public void build(Generator generator){
if(backgroundFactory != null){
generator.setBackgroundFactory(backgroundFactory);
}
if(wordFactory != null){
generator.setWordFactory(wordFactory);
}
if(textFactory != null){
if(fontFactory != null){
textFactory.setFontFactory(fontFactory);
}
if(colorFactory != null){
textFactory.setColorFactory(colorFactory);
}
generator.setTextFactory(textFactory);
}
}
}
| 29,194
|
https://github.com/SammyBloom/Nekome/blob/master/features/login/src/main/java/com/chesire/nekome/app/login/details/DetailsFragment.kt
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
Nekome
|
SammyBloom
|
Kotlin
|
Code
| 257
| 1,173
|
package com.chesire.nekome.app.login.details
import android.os.Bundle
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.annotation.StringRes
import androidx.core.widget.addTextChangedListener
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import com.chesire.nekome.app.login.R
import com.chesire.nekome.app.login.databinding.FragmentDetailsBinding
import com.chesire.nekome.core.extensions.hide
import com.chesire.nekome.core.extensions.hideSystemKeyboard
import com.chesire.nekome.core.extensions.setLinkedText
import com.chesire.nekome.core.extensions.show
import com.chesire.nekome.core.url.UrlHandler
import com.google.android.material.snackbar.Snackbar
import dagger.hilt.android.AndroidEntryPoint
import timber.log.Timber
import javax.inject.Inject
/**
* Fragment to allow the user to enter their login details for Kitsu.
*/
@AndroidEntryPoint
class DetailsFragment : Fragment(R.layout.fragment_details) {
@Inject
lateinit var urlHandler: UrlHandler
private val viewModel by viewModels<DetailsViewModel>()
private var _binding: FragmentDetailsBinding? = null
private val binding get() = requireNotNull(_binding) { "Binding not set" }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
_binding = FragmentDetailsBinding.bind(view)
binding.usernameText.addTextChangedListener { binding.usernameLayout.error = "" }
binding.passwordText.addTextChangedListener { binding.passwordLayout.error = "" }
binding.passwordText.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
activity?.hideSystemKeyboard()
if (viewModel.loginStatus.value != LoginStatus.Loading) {
executeLogin()
return@setOnEditorActionListener true
}
}
false
}
binding.loginButton.setOnClickListener { executeLogin() }
setupLinks()
viewModel.loginStatus.observe(viewLifecycleOwner) { loginStatusChanged(it) }
}
private fun setupLinks() {
binding.signUp.setLinkedText(R.string.login_sign_up, R.string.login_sign_up_link_target) {
urlHandler.launch(requireContext(), getString(R.string.login_sign_up_url))
}
binding.forgotPasswordButton.setOnClickListener {
urlHandler.launch(requireContext(), getString(R.string.login_forgot_password_url))
}
}
private fun executeLogin() {
viewModel.login(binding.usernameText.text.toString(), binding.passwordText.text.toString())
}
private fun loginStatusChanged(loginStatus: LoginStatus) {
Timber.i("LoginStatus updated with value [$loginStatus]")
if (loginStatus == LoginStatus.Loading) {
setLoading()
return
} else {
hideLoading()
}
when (loginStatus) {
LoginStatus.EmptyUsername ->
binding.usernameLayout.error = getString(R.string.login_error_empty_username)
LoginStatus.EmptyPassword ->
binding.passwordLayout.error = getString(R.string.login_error_empty_password)
LoginStatus.Error -> showSnackbar(R.string.login_error_generic)
LoginStatus.InvalidCredentials -> showSnackbar(R.string.login_error_credentials)
LoginStatus.Success -> {
activity?.hideSystemKeyboard()
findNavController().navigate(DetailsFragmentDirections.toSyncingFragment())
}
else -> Timber.w("Unexpected LoginStatus [$loginStatus]")
}
}
private fun showSnackbar(@StringRes id: Int) =
Snackbar.make(binding.detailsLayout, id, Snackbar.LENGTH_LONG).show()
private fun setLoading() {
binding.progressBar.show()
binding.loginButton.text = ""
binding.loginButton.isEnabled = false
}
private fun hideLoading() {
binding.progressBar.hide(true)
binding.loginButton.text = getString(R.string.login_login)
binding.loginButton.isEnabled = true
}
}
| 32,949
|
https://github.com/throneteki/throneteki/blob/master/test/server/cards/23-AHaH/AnyaWaynwood.spec.js
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
throneteki
|
throneteki
|
JavaScript
|
Code
| 232
| 1,484
|
describe('Anya Waynwood', function() {
integration(function() {
beforeEach(function() {
const deck = this.buildDeck('greyjoy', [
'Time of Plenty',
'Anya Waynwood', 'Lannisport Merchant', 'Lannisport Merchant', 'Lannisport Merchant', 'The Kingsroad'
]);
this.player1.selectDeck(deck);
this.player2.selectDeck(deck);
this.startGame();
this.keepStartingHands();
this.anya = this.player1.findCardByName('Anya Waynwood');
this.location = this.player1.findCardByName('The Kingsroad');
[this.merchant1, this.merchant2] = this.player1.filterCardsByName('Lannisport Merchant');
this.opponentAnya = this.player2.findCardByName('Anya Waynwood');
[this.opponentMerchant1, this.opponentMerchant2, this.opponentMerchant3] = this.player2.filterCardsByName('Lannisport Merchant');
this.opponentLocation = this.player2.findCardByName('The Kingsroad');
this.player1.clickCard(this.anya);
this.player1.clickCard(this.merchant1);
this.player1.clickCard(this.merchant2);
this.player2.clickCard(this.opponentAnya);
this.player2.clickCard(this.opponentMerchant1);
this.player2.clickCard(this.opponentMerchant2);
this.completeSetup();
this.selectFirstPlayer(this.player1);
this.player1.clickCard(this.location);
this.player1.clickPrompt('Done');
this.player2.clickCard(this.opponentMerchant3);
this.player2.clickCard(this.opponentLocation);
this.player2.clickPrompt('Done');
// Give power to each player to help determine winners
this.player1Object.faction.power = 1;
this.player2Object.faction.power = 1;
});
describe('when used against a non-participating character', function() {
it('contributes their STR to the challenge', function() {
this.player1.clickPrompt('Power');
this.player1.clickCard(this.merchant1);
this.player1.clickPrompt('Done');
this.skipActionWindow();
this.player2.clickCard(this.opponentMerchant1);
this.player2.clickCard(this.opponentMerchant2);
this.player2.clickPrompt('Done');
// Trigger ability
this.player1.clickMenu(this.anya, 'Contribute STR to challenge');
this.player1.clickCard(this.location);
this.player1.clickCard(this.opponentMerchant3);
this.player2.clickPrompt('Pass');
this.player1.clickPrompt('Pass');
this.player1.clickPrompt('Apply Claim');
expect(this.location.kneeled).toBe(true);
expect(this.player1Object.faction.power).toBe(2);
expect(this.player2Object.faction.power).toBe(0);
});
});
describe('when used early and the character is declared by opponent', function() {
it('the effect is overridden by declaring the character', function() {
this.player1.clickPrompt('Power');
this.player1.clickCard(this.merchant1);
this.player1.clickPrompt('Done');
// Trigger ability
this.player1.clickMenu(this.anya, 'Contribute STR to challenge');
this.player1.clickCard(this.location);
this.player1.clickCard(this.opponentMerchant1);
this.player2.clickPrompt('Pass');
this.player1.clickPrompt('Pass');
this.player2.clickCard(this.opponentMerchant1);
this.player2.clickCard(this.opponentMerchant2);
this.player2.clickPrompt('Done');
this.skipActionWindow();
expect(this.location.kneeled).toBe(true);
expect(this.player1Object.faction.power).toBe(1);
expect(this.player2Object.faction.power).toBe(1);
expect(this.player1).not.toHavePromptButton('Apply Claim');
});
});
describe('when used twice on the same character', function() {
it('the last effect takes precedence', function() {
this.player1.clickPrompt('Power');
this.player1.clickCard(this.merchant1);
this.player1.clickPrompt('Done');
// Trigger attacker ability
this.player1.clickMenu(this.anya, 'Contribute STR to challenge');
this.player1.clickCard(this.location);
this.player1.clickCard(this.opponentMerchant2);
// Trigger defender ability
this.player2.clickMenu(this.opponentAnya, 'Contribute STR to challenge');
this.player2.clickCard(this.opponentLocation);
this.player2.clickCard(this.opponentMerchant2);
this.skipActionWindow();
this.player2.clickCard(this.opponentMerchant1);
this.player2.clickPrompt('Done');
this.skipActionWindow();
expect(this.location.kneeled).toBe(true);
expect(this.player1Object.faction.power).toBe(1);
expect(this.player2Object.faction.power).toBe(1);
expect(this.player1).not.toHavePromptButton('Apply Claim');
});
});
});
});
| 9,912
|
https://github.com/RichardMShaw/Unity-Experimental-Project/blob/master/Assets/__Scripts/Targets/Subclasses/AllTargetAlliesTarget.cs
|
Github Open Source
|
Open Source
|
MIT
| null |
Unity-Experimental-Project
|
RichardMShaw
|
C#
|
Code
| 29
| 93
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "Project/Targets/All Target Allies")]
public class AllTargetAlliesTarget : Target
{
public override List<BattleCharacter> GetTargets(BattleCharacter caster, BattleCharacter target)
{
return target.allies;
}
}
| 9,822
|
https://github.com/PeterShevchuk/shop-react/blob/master/src/Components/Success/Success.js
|
Github Open Source
|
Open Source
|
MIT
| null |
shop-react
|
PeterShevchuk
|
JavaScript
|
Code
| 89
| 252
|
import React from "react";
import { useDispatch, useSelector } from "react-redux";
// Material UI
import Snackbar from "@material-ui/core/Snackbar";
import MuiAlert from "@material-ui/lab/Alert";
import { setSuccess } from "../../Redux/Slice";
function Alert(props) {
return <MuiAlert elevation={6} variant="filled" {...props} />;
}
const position = { vertical: "bottom", horizontal: "left" };
const Success = () => {
const dispatch = useDispatch();
const success = useSelector((state) => state.global.success);
return (
<Snackbar open={success ? true : false} anchorOrigin={position} autoHideDuration={6000} onClose={() => dispatch(setSuccess(null))}>
<Alert onClose={() => dispatch(setSuccess(null))} severity="success">
{success}
</Alert>
</Snackbar>
);
};
export default Success;
| 40,055
|
https://github.com/DigiArea/closurefx-builder/blob/master/src/com/digiarea/closure/model/controller/JSSourceSectionController.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,015
|
closurefx-builder
|
DigiArea
|
Java
|
Code
| 452
| 2,681
|
package com.digiarea.closure.model.controller;
import java.io.File;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.Control;
import javafx.scene.control.Label;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.control.TitledPane;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.RowConstraints;
import javafx.scene.layout.VBox;
import javafx.util.Callback;
import com.digiarea.closure.model.Source;
import com.digiarea.closure.model.SourceEntity;
import com.digiarea.closure.model.SourceEntry;
import com.digiarea.closure.model.bind.ModelFacade;
import com.digiarea.closure.model.controller.dialogs.DialogFactory;
import com.digiarea.closure.model.controller.dialogs.FolderDialogController;
import com.digiarea.closure.model.providers.BuildpathCell;
import com.digiarea.closurefx.IConstants;
import com.digiarea.closurefx.build.validation.IStatus.StatusType;
/**
* FXML Controller class
*
* @author daginno
*/
public class JSSourceSectionController extends ClosureController implements Initializable {
public JSSourceSectionController(ModelFacade modelFacade, ResourceBundle bundle) {
super(modelFacade, bundle);
}
@FXML
private ListView<Source> controlSource;
@FXML
private Button btnAdd;
private File lastFile;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
controlSource.setCellFactory(new Callback<ListView<Source>, ListCell<Source>>() {
@Override
public ListCell<Source> call(ListView<Source> list) {
return new BuildpathCell(bundle, modelFacade.getDocument().getPathResolver(), SourceEntry.SOURCE);
}
});
}
@FXML
private void handleAddButtonAction(ActionEvent event) {
FolderDialogController controller = DialogFactory.getFolderDialog(bundle, IConstants.SourceSection_Add_Title, IConstants.SourceSection_Add_Desc, modelFacade.getDocument().getFile().getParentFile(), true, true, (String[]) null);
if (controller != null && controller.getStatus().getSeverity() != StatusType.CANCEL) {
if (controller.getSelectedFile() != null) {
modelFacade.addSource(controller.getSelectedFile().getAbsolutePath(), SourceEntry.SOURCE, SourceEntity.JSC, false);
}
}
}
@FXML
private void handleAddExternalButtonAction(ActionEvent event) {
File file = UIUtils.chooseFolder(lastFile, bundle.getString(IConstants.SourceSection_Add_Title));
if (file != null) {
modelFacade.addSource(file.getAbsolutePath(), SourceEntry.SOURCE, SourceEntity.JSC, true);
lastFile = file;
}
}
@FXML
private void handleRemoveButtonAction(ActionEvent event) {
ObservableList<Source> sources = controlSource.getSelectionModel().getSelectedItems();
if (sources != null && !sources.isEmpty()) {
for (Source source : sources) {
modelFacade.removeSource(source, SourceEntity.JSC);
}
}
}
public Button getBtnAdd() {
return btnAdd;
}
public ListView<Source> getControlSource() {
return controlSource;
}
public AnchorPane create() throws Exception {
AnchorPane anchorPane26 = new AnchorPane();
anchorPane26.setId("AnchorPane");
anchorPane26.setMinHeight(Control.USE_PREF_SIZE);
anchorPane26.setMinWidth(Control.USE_PREF_SIZE);
anchorPane26.setPrefHeight(Control.USE_COMPUTED_SIZE);
anchorPane26.setPrefWidth(Control.USE_COMPUTED_SIZE);
TitledPane titledPane23 = new TitledPane();
titledPane23.setAnimated(false);
titledPane23.setCollapsible(false);
titledPane23.setPrefHeight(Control.USE_COMPUTED_SIZE);
titledPane23.setPrefWidth(Control.USE_COMPUTED_SIZE);
titledPane23.setText(bundle.getString("SourceSection"));
AnchorPane.setBottomAnchor(titledPane23, 0.0);
AnchorPane.setLeftAnchor(titledPane23, 0.0);
AnchorPane.setRightAnchor(titledPane23, 0.0);
AnchorPane.setTopAnchor(titledPane23, 0.0);
VBox vBox48 = new VBox();
vBox48.setPrefHeight(Control.USE_COMPUTED_SIZE);
vBox48.setPrefWidth(Control.USE_COMPUTED_SIZE);
Label label60 = new Label();
label60.setText(bundle.getString("SourceSection_Desc"));
label60.setWrapText(true);
vBox48.getChildren().add(label60);
HBox hBox11 = new HBox();
hBox11.setPrefHeight(100.0);
hBox11.setPrefWidth(200.0);
hBox11.setSpacing(5.0);
VBox.setVgrow(hBox11, Priority.ALWAYS);
controlSource = new ListView();
controlSource.setPrefHeight(Control.USE_COMPUTED_SIZE);
controlSource.setPrefWidth(Control.USE_COMPUTED_SIZE);
HBox.setHgrow(controlSource, Priority.ALWAYS);
hBox11.getChildren().add(controlSource);
GridPane gridPane55 = new GridPane();
gridPane55.setId("GridPane");
gridPane55.setMinWidth(Control.USE_PREF_SIZE);
gridPane55.setVgap(5.0);
btnAdd = new Button();
btnAdd.setMaxWidth(1.7976931348623157E308);
btnAdd.setMinWidth(Control.USE_PREF_SIZE);
btnAdd.setMnemonicParsing(false);
btnAdd.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
handleAddButtonAction(event);
}
});
btnAdd.setPrefHeight(Control.USE_COMPUTED_SIZE);
btnAdd.setPrefWidth(Control.USE_COMPUTED_SIZE);
btnAdd.setText(bundle.getString("Button_AddDotted"));
GridPane.setColumnIndex(btnAdd, 0);
GridPane.setRowIndex(btnAdd, 0);
gridPane55.getChildren().add(btnAdd);
Button btnAdd3 = new Button();
btnAdd3.setId("btnAdd");
btnAdd3.setMaxWidth(1.7976931348623157E308);
btnAdd3.setMinWidth(Control.USE_PREF_SIZE);
btnAdd3.setMnemonicParsing(false);
btnAdd3.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
handleAddExternalButtonAction(event);
}
});
btnAdd3.setPrefHeight(Control.USE_COMPUTED_SIZE);
btnAdd3.setPrefWidth(Control.USE_COMPUTED_SIZE);
btnAdd3.setText(bundle.getString("SourceSection_Add_External"));
GridPane.setColumnIndex(btnAdd3, 0);
GridPane.setRowIndex(btnAdd3, 1);
gridPane55.getChildren().add(btnAdd3);
Button button53 = new Button();
button53.setMaxWidth(1.7976931348623157E308);
button53.setMinWidth(Control.USE_PREF_SIZE);
button53.setMnemonicParsing(false);
button53.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
handleRemoveButtonAction(event);
}
});
button53.setPrefWidth(Control.USE_COMPUTED_SIZE);
button53.setText(bundle.getString("Button_Remove"));
GridPane.setColumnIndex(button53, 0);
GridPane.setRowIndex(button53, 2);
gridPane55.getChildren().add(button53);
ColumnConstraints columnConstraints123 = new ColumnConstraints();
columnConstraints123.setHgrow(Priority.SOMETIMES);
columnConstraints123.setMinWidth(10.0);
gridPane55.getColumnConstraints().add(columnConstraints123);
RowConstraints rowConstraints109 = new RowConstraints();
rowConstraints109.setMinHeight(Control.USE_PREF_SIZE);
rowConstraints109.setVgrow(Priority.NEVER);
gridPane55.getRowConstraints().add(rowConstraints109);
RowConstraints rowConstraints110 = new RowConstraints();
rowConstraints110.setMinHeight(Control.USE_PREF_SIZE);
rowConstraints110.setVgrow(Priority.NEVER);
gridPane55.getRowConstraints().add(rowConstraints110);
RowConstraints rowConstraints111 = new RowConstraints();
rowConstraints111.setMinHeight(Control.USE_PREF_SIZE);
rowConstraints111.setVgrow(Priority.NEVER);
gridPane55.getRowConstraints().add(rowConstraints111);
hBox11.getChildren().add(gridPane55);
vBox48.getChildren().add(hBox11);
Insets insets70 = new Insets(10.0, 10.0, 10.0, 10.0);
vBox48.setPadding(insets70);
titledPane23.setContent(vBox48);
anchorPane26.getChildren().add(titledPane23);
initialize(null, bundle);
return anchorPane26;
}
}
| 19,743
|
https://github.com/ottomossei/my-dart-lang-learning/blob/master/dart/class/basic.dart
|
Github Open Source
|
Open Source
|
MIT
| null |
my-dart-lang-learning
|
ottomossei
|
Dart
|
Code
| 212
| 557
|
// class
class Car {
// propaty
// late needs from Car.empty()
late String name;
late String year;
late String color;
// constructor
// Automatic field initialization
Car(this.name, this.year, this.color) {
print("Generate instance !");
// Assign parameters to property.
// The following can be omitted.
this.name = name;
this.year = year;
this.color = color;
}
// Car.empty() needs late
// because Automatic field initialization is NOT work.
Car.empty() {
name = "";
year = "";
color = "";
}
// Named Constructors
Car.withoutYearColor(this.name)
: year = "2000",
color = "Yellow";
// method
void Horn() {
print("$name : Poooo!");
}
}
// instance
Car generateBlack(String name, String year, String color) {
color = "Black";
return Car(name, year, color);
}
main() {
String carName = "BMW";
String carYear = "2010";
String carColor = "Blue";
// instance
Car myCar = Car(carName, carYear, carColor);
// BMW : 2020 : Blue
print("${myCar.name} : ${myCar.year} : ${myCar.color}");
// BMW : Poooo!
myCar.Horn();
// instance
Car emptyCar = Car.empty();
// : :
print("${emptyCar.name} : ${emptyCar.year} : ${emptyCar.color}");
// instance
Car yourCar = Car.withoutYearColor("Nissan");
// Nissan : 2000 : Yellow
print("${yourCar.name} : ${yourCar.year} : ${yourCar.color}");
// Nissan : Poooo!
yourCar.Horn();
// instance
Car blackCar = generateBlack("Suzuki", "1999", "White");
// Suzuki : 1999 : Black
print("${blackCar.name} : ${blackCar.year} : ${blackCar.color}");
}
| 29,465
|
https://github.com/czllfy/configcenter/blob/master/configcenter-biz/src/main/java/org/antframework/configcenter/biz/service/ComputeBranchMergenceService.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
configcenter
|
czllfy
|
Java
|
Code
| 263
| 1,406
|
/*
* 作者:钟勋 (e-mail:zhongxunking@163.com)
*/
/*
* 修订记录:
* @author 钟勋 2019-09-05 23:36 创建
*/
package org.antframework.configcenter.biz.service;
import lombok.AllArgsConstructor;
import org.antframework.common.util.facade.BizException;
import org.antframework.common.util.facade.CommonResultCode;
import org.antframework.common.util.facade.Status;
import org.antframework.configcenter.biz.util.Branches;
import org.antframework.configcenter.biz.util.Properties;
import org.antframework.configcenter.biz.util.Releases;
import org.antframework.configcenter.dal.dao.MergenceDao;
import org.antframework.configcenter.dal.entity.Mergence;
import org.antframework.configcenter.facade.info.BranchInfo;
import org.antframework.configcenter.facade.info.MergenceDifference;
import org.antframework.configcenter.facade.info.PropertiesDifference;
import org.antframework.configcenter.facade.info.ReleaseInfo;
import org.antframework.configcenter.facade.order.ComputeBranchMergenceOrder;
import org.antframework.configcenter.facade.result.ComputeBranchMergenceResult;
import org.bekit.service.annotation.service.Service;
import org.bekit.service.annotation.service.ServiceExecute;
import org.bekit.service.engine.ServiceContext;
import java.util.HashSet;
import java.util.Set;
/**
* 计算分支合并服务
*/
@Service
@AllArgsConstructor
public class ComputeBranchMergenceService {
// 合并dao
private final MergenceDao mergenceDao;
@ServiceExecute
public void execute(ServiceContext<ComputeBranchMergenceOrder, ComputeBranchMergenceResult> context) {
ComputeBranchMergenceOrder order = context.getOrder();
ComputeBranchMergenceResult result = context.getResult();
// 校验
BranchInfo branch = Branches.findBranch(order.getAppId(), order.getProfileId(), order.getBranchId());
if (branch == null) {
throw new BizException(Status.FAIL, CommonResultCode.INVALID_PARAMETER.getCode(), String.format("分支[appId=%s,profileId=%s,branchId=%s]不存在", order.getAppId(), order.getProfileId(), order.getBranchId()));
}
BranchInfo sourceBranch = Branches.findBranch(order.getAppId(), order.getProfileId(), order.getSourceBranchId());
if (sourceBranch == null) {
throw new BizException(Status.FAIL, CommonResultCode.INVALID_PARAMETER.getCode(), String.format("分支[appId=%s,profileId=%s,branchId=%s]不存在", order.getAppId(), order.getProfileId(), order.getSourceBranchId()));
}
// 计算最近的发布
ReleaseInfo recentRelease = computeRecentRelease(
order.getAppId(),
order.getProfileId(),
branch.getRelease().getVersion(),
sourceBranch.getRelease().getVersion());
// 计算变更的配置
MergenceDifference difference = computeDifference(recentRelease, sourceBranch.getRelease());
result.setDifference(difference);
}
// 计算最近的发布
private ReleaseInfo computeRecentRelease(String appId, String profileId, long targetVersion, long sourceVersion) {
Set<Long> versions = new HashSet<>();
versions.add(targetVersion);
long version = sourceVersion;
// 从targetVersion继承体系中,找到被targetVersion覆盖的最近的发布版本
while (!versions.contains(version)) {
long maxVersion = versions.stream().max(Long::compareTo).get();
if (maxVersion > version) {
// 计算targetVersion覆盖的区域
versions.remove(maxVersion);
ReleaseInfo release = Releases.findRelease(appId, profileId, maxVersion);
versions.add(release.getParentVersion());
Mergence mergence = mergenceDao.findByAppIdAndProfileIdAndReleaseVersion(appId, profileId, maxVersion);
if (mergence != null) {
versions.add(mergence.getSourceReleaseVersion());
}
} else {
// 计算sourceVersion的父版本
ReleaseInfo release = Releases.findRelease(appId, profileId, version);
version = release.getParentVersion();
}
}
return Releases.findRelease(appId, profileId, version);
}
// 计算需合并的配置集差异
private MergenceDifference computeDifference(ReleaseInfo startRelease, ReleaseInfo endRelease) {
MergenceDifference difference = new MergenceDifference();
PropertiesDifference propertiesDifference = Properties.compare(endRelease.getProperties(), startRelease.getProperties());
endRelease.getProperties().stream()
.filter(property -> propertiesDifference.getAddedKeys().contains(property.getKey())
|| propertiesDifference.getModifiedValueKeys().contains(property.getKey())
|| propertiesDifference.getModifiedScopeKeys().contains(property.getKey()))
.forEach(difference::addAddOrModifiedProperty);
propertiesDifference.getRemovedKeys().forEach(difference::addRemovedPropertyKey);
return difference;
}
}
| 33,785
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.