hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 98
values | lang stringclasses 21
values | max_stars_repo_path stringlengths 3 945 | max_stars_repo_name stringlengths 4 118 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 945 | max_issues_repo_name stringlengths 4 118 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 945 | max_forks_repo_name stringlengths 4 135 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1 1.03M | max_line_length int64 2 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dde5fd189774967cbf152727065fff5edbda7a67 | 729 | php | PHP | application/Common/Model/LogModel.class.php | TigoBackend/tigoadmin_tp3.2 | fc2a6ed90f62a1d73b6ab159bf5e1843656162e8 | [
"Apache-2.0"
] | null | null | null | application/Common/Model/LogModel.class.php | TigoBackend/tigoadmin_tp3.2 | fc2a6ed90f62a1d73b6ab159bf5e1843656162e8 | [
"Apache-2.0"
] | null | null | null | application/Common/Model/LogModel.class.php | TigoBackend/tigoadmin_tp3.2 | fc2a6ed90f62a1d73b6ab159bf5e1843656162e8 | [
"Apache-2.0"
] | null | null | null | <?php
namespace Common\Model;
use Common\Model\CommonModel;
class LogModel extends CommonModel
{
protected $_validate = array(
);
protected $_auto = array(
array('create_time','mGetDate',CommonModel:: MODEL_INSERT,'callback'),
);
//用于获取时间方法不能为private
function mGetDate() {
return time();
}
protected function _before_write(&$data) {
parent::_before_write($data);
}
// 查询成功后的回调方法
protected function _after_select(&$resultSet,$options) {
parent::_after_select($resultSet,$options);
//dump($status_arr);exit;
foreach ($resultSet as $key => $value) {
$resultSet[$key]['create_time'] = date("Y-m-d H:i:s",$value['create_time']);
}
//dump($resultSet);
}
}
| 21.441176 | 82 | 0.650206 |
d4e633770c29383baaefa07cb0bb4a8f652e1ba9 | 1,069 | sql | SQL | shop-order/src/main/resources/db/migration/V1__CreateOrder.sql | greek-zzf/shop | 8acab354c62e90be129cec1c122409b8fabed199 | [
"Apache-2.0"
] | null | null | null | shop-order/src/main/resources/db/migration/V1__CreateOrder.sql | greek-zzf/shop | 8acab354c62e90be129cec1c122409b8fabed199 | [
"Apache-2.0"
] | null | null | null | shop-order/src/main/resources/db/migration/V1__CreateOrder.sql | greek-zzf/shop | 8acab354c62e90be129cec1c122409b8fabed199 | [
"Apache-2.0"
] | null | null | null | CREATE TABLE ORDER_TABELE
(
ID BIGINT PRIMARY KEY AUTO_INCREMENT,
USER_ID BIGINT,
TOTAL_PRICE BIGINT, -- 单位 分
SHOP_ID BIGINT,
ADDRESS VARCHAR(1024),
EXPRESS_COMPANY VARCHAR(16),
EXPRESS_ID VARCHAR(128),
STATUS VARCHAR(16),
CREATED_AT TIMESTAMP NOT NULL DEFAULT NOW(),
UPDATED_AT TIMESTAMP NOT NULL DEFAULT NOW()
);
CREATE TABLE ORDER_GOODS
(
ID BIGINT PRIMARY KEY AUTO_INCREMENT,
ORDER_ID BIGINT,
GOODS_ID BIGINT,
NUMBER BIGINT
);
INSERT INTO ORDER_TABELE (ID, USER_ID, TOTAL_PRICE, ADDRESS, EXPRESS_COMPANY, EXPRESS_ID, STATUS, SHOP_ID)
VALUES (1, 1, 1400, '火星', '顺丰', '运单1234567', 'DELIVERED', 1);
INSERT INTO ORDER_GOODS(GOODS_ID, ORDER_ID, NUMBER)
VALUES (1, 1, 5),
(2, 1, 9);
INSERT INTO ORDER_TABELE (ID, USER_ID, TOTAL_PRICE, ADDRESS, EXPRESS_COMPANY, EXPRESS_ID, STATUS, SHOP_ID)
VALUES (2, 1, 700, '火星', null, null, 'PENDING', 1);
INSERT INTO ORDER_GOODS(GOODS_ID, ORDER_ID, NUMBER)
VALUES (1, 2, 3),
(2, 2, 4); | 29.694444 | 106 | 0.647334 |
1c06c61e69837fcbbb92f7c2088b89870da7a858 | 5,932 | asm | Assembly | coverage/PENDING_SUBMIT/amdvlk/0664-COVERAGE-lazy-value-info-1603/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | null | null | null | coverage/PENDING_SUBMIT/amdvlk/0664-COVERAGE-lazy-value-info-1603/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | 47 | 2021-03-11T07:42:51.000Z | 2022-03-14T06:30:14.000Z | coverage/PENDING_SUBMIT/amdvlk/0664-COVERAGE-lazy-value-info-1603/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | 4 | 2021-03-09T13:37:19.000Z | 2022-02-25T07:32:11.000Z | ; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 101
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %9 %40
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %9 "_GLF_color"
OpName %14 "buf1"
OpMemberName %14 0 "_GLF_uniform_int_values"
OpName %16 ""
OpName %24 "buf2"
OpMemberName %24 0 "injectionSwitch"
OpName %26 ""
OpName %40 "gl_FragCoord"
OpName %46 "buf0"
OpMemberName %46 0 "_GLF_uniform_float_values"
OpName %48 ""
OpName %59 "i"
OpDecorate %9 Location 0
OpDecorate %13 ArrayStride 16
OpMemberDecorate %14 0 Offset 0
OpDecorate %14 Block
OpDecorate %16 DescriptorSet 0
OpDecorate %16 Binding 1
OpMemberDecorate %24 0 Offset 0
OpDecorate %24 Block
OpDecorate %26 DescriptorSet 0
OpDecorate %26 Binding 2
OpDecorate %40 BuiltIn FragCoord
OpDecorate %45 ArrayStride 16
OpMemberDecorate %46 0 Offset 0
OpDecorate %46 Block
OpDecorate %48 DescriptorSet 0
OpDecorate %48 Binding 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeFloat 32
%7 = OpTypeVector %6 4
%8 = OpTypePointer Output %7
%9 = OpVariable %8 Output
%10 = OpTypeInt 32 1
%11 = OpTypeInt 32 0
%12 = OpConstant %11 3
%13 = OpTypeArray %10 %12
%14 = OpTypeStruct %13
%15 = OpTypePointer Uniform %14
%16 = OpVariable %15 Uniform
%17 = OpConstant %10 0
%18 = OpTypePointer Uniform %10
%23 = OpTypeVector %6 2
%24 = OpTypeStruct %23
%25 = OpTypePointer Uniform %24
%26 = OpVariable %25 Uniform
%27 = OpConstant %11 0
%28 = OpTypePointer Uniform %6
%31 = OpConstant %11 1
%34 = OpTypeBool
%39 = OpTypePointer Input %7
%40 = OpVariable %39 Input
%41 = OpTypePointer Input %6
%44 = OpConstant %11 2
%45 = OpTypeArray %6 %44
%46 = OpTypeStruct %45
%47 = OpTypePointer Uniform %46
%48 = OpVariable %47 Uniform
%54 = OpConstant %10 1
%58 = OpTypePointer Function %10
%71 = OpConstant %10 2
%81 = OpConstant %6 1
%97 = OpConstant %6 0
%98 = OpConstantComposite %7 %97 %97 %97 %97
%4 = OpFunction %2 None %3
%5 = OpLabel
%59 = OpVariable %58 Function
%19 = OpAccessChain %18 %16 %17 %17
%20 = OpLoad %10 %19
%21 = OpConvertSToF %6 %20
%22 = OpCompositeConstruct %7 %21 %21 %21 %21
OpStore %9 %22
%29 = OpAccessChain %28 %26 %17 %27
%30 = OpLoad %6 %29
%32 = OpAccessChain %28 %26 %17 %31
%33 = OpLoad %6 %32
%35 = OpFOrdGreaterThan %34 %30 %33
OpSelectionMerge %37 None
OpBranchConditional %35 %36 %38
%36 = OpLabel
OpBranch %37
%38 = OpLabel
%42 = OpAccessChain %41 %40 %27
%43 = OpLoad %6 %42
%49 = OpAccessChain %28 %48 %17 %17
%50 = OpLoad %6 %49
%51 = OpFOrdGreaterThanEqual %34 %43 %50
OpSelectionMerge %53 None
OpBranchConditional %51 %52 %53
%52 = OpLabel
%55 = OpAccessChain %28 %48 %17 %54
%56 = OpLoad %6 %55
%57 = OpCompositeConstruct %7 %56 %56 %56 %56
OpStore %9 %57
OpBranch %53
%53 = OpLabel
%60 = OpAccessChain %18 %16 %17 %17
%61 = OpLoad %10 %60
OpStore %59 %61
OpBranch %62
%62 = OpLabel
OpLoopMerge %64 %65 None
OpBranch %66
%66 = OpLabel
%67 = OpLoad %10 %59
%68 = OpAccessChain %18 %16 %17 %54
%69 = OpLoad %10 %68
%70 = OpSLessThan %34 %67 %69
OpBranchConditional %70 %63 %64
%63 = OpLabel
%72 = OpAccessChain %18 %16 %17 %71
%73 = OpLoad %10 %72
%74 = OpConvertSToF %6 %73
%75 = OpAccessChain %18 %16 %17 %17
%76 = OpLoad %10 %75
%77 = OpConvertSToF %6 %76
%78 = OpAccessChain %18 %16 %17 %17
%79 = OpLoad %10 %78
%80 = OpConvertSToF %6 %79
%82 = OpCompositeConstruct %7 %74 %77 %80 %81
OpStore %9 %82
%83 = OpAccessChain %41 %40 %31
%84 = OpLoad %6 %83
%85 = OpAccessChain %28 %48 %17 %17
%86 = OpLoad %6 %85
%87 = OpFOrdGreaterThanEqual %34 %84 %86
OpSelectionMerge %89 None
OpBranchConditional %87 %88 %89
%88 = OpLabel
%90 = OpAccessChain %28 %26 %17 %27
%91 = OpLoad %6 %90
%92 = OpAccessChain %28 %26 %17 %31
%93 = OpLoad %6 %92
%94 = OpFOrdGreaterThan %34 %91 %93
OpSelectionMerge %96 None
OpBranchConditional %94 %95 %96
%95 = OpLabel
OpStore %9 %98
OpBranch %96
%96 = OpLabel
OpBranch %89
%89 = OpLabel
OpBranch %65
%65 = OpLabel
%99 = OpLoad %10 %59
%100 = OpIAdd %10 %99 %54
OpStore %59 %100
OpBranch %62
%64 = OpLabel
OpBranch %37
%37 = OpLabel
OpReturn
OpFunctionEnd
| 35.520958 | 61 | 0.487694 |
8434e2adc85d609d11c78dd27a2265b6dafa1ca5 | 6,087 | html | HTML | example/index.html | gkjohnson/three-gpu-pathtracing | d6d9b151e678d1051cc559f5743ade04626bd9a1 | [
"MIT"
] | 51 | 2022-01-12T07:05:20.000Z | 2022-02-19T20:50:09.000Z | example/index.html | gkjohnson/three-gpu-pathtracing | d6d9b151e678d1051cc559f5743ade04626bd9a1 | [
"MIT"
] | 12 | 2022-01-12T05:58:35.000Z | 2022-03-06T18:52:30.000Z | example/index.html | gkjohnson/three-shader-pathtracing | d6d9b151e678d1051cc559f5743ade04626bd9a1 | [
"MIT"
] | 4 | 2022-01-12T12:45:28.000Z | 2022-02-02T09:46:30.000Z | <html>
<head>
<title>PBR Path Tracing</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<style>
html, body {
margin: 0;
padding: 0;
background-color: #111;
}
#info {
position: absolute;
bottom: 0;
left: 0;
font-family: 'Courier New', Courier, monospace;
color: white;
pointer-events: none;
}
#samples, #credits {
opacity: 0.5;
background-color: rgba( 0.0, 0.0, 0.0, 0.5 );
padding: 5px;
display: inline-block;
}
#loading {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: white;
font-family: 'Courier New', Courier, monospace;
}
</style>
</head>
<body>
<div id="loading">LOADING</div>
<div id="info">
<div>
<div id="samples">--</div>
</div>
<div>
<div id="credits">--</div>
</div>
</div>
<script>
window.MODEL_LIST = {
'M2020 Rover': {
url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/nasa-m2020/Perseverance.glb',
credit: 'Model credit NASA / JPL-Caltech',
},
'M2020 Helicopter': {
url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/nasa-m2020/Ingenuity.glb',
credit: 'Model credit NASA / JPL-Caltech',
},
'Gelatinous Cube': {
url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/gelatinous-cube/scene.gltf',
credit: 'Model by "glenatron" on Sketchfab.',
rotation: [ 0, - Math.PI / 8, 0.0 ],
opacityToTransmission: true,
bounces: 8,
postProcess( model ) {
const toRemove = [];
model.traverse( c => {
if ( c.material ) {
if ( c.material instanceof MeshPhysicalMaterial ) {
const material = c.material;
material.roughness *= 0.1;
material.metalness = 0.0;
material.ior = 1.2;
material.map = null;
c.geometry.computeVertexNormals();
} else if ( c.material.opacity < 1.0 ) {
toRemove.push( c );
}
}
} );
toRemove.forEach( c => {
c.parent.remove( c );
} );
}
},
'Octopus Tea': {
url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/octopus-tea/scene.gltf',
credit: 'Model by "AzTiZ" on Sketchfab.',
opacityToTransmission: true,
bounces: 8,
postProcess( model ) {
const toRemove = [];
model.traverse( c => {
if ( c.material ) {
if ( c.material instanceof MeshPhysicalMaterial ) {
const material = c.material;
material.metalness = 0.0;
if ( material.transmission === 1.0 ) {
material.roughness = 0.0;
material.metalness = 0.0;
// 29 === glass
// 27 === liquid top
// 23 === liquid
if ( c.name.includes( '29' ) ) {
c.geometry.index.array.reverse();
material.ior = 1.52;
material.color.set( 0xffffff );
} else {
material.ior = 1.2;
}
}
} else if ( c.material.opacity < 1.0 ) {
toRemove.push( c );
}
}
} );
toRemove.forEach( c => {
c.parent.remove( c );
} );
}
},
'Scifi Toad': {
url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/scifi-toad/scene.gltf',
credit: 'Model by "YuryTheCreator" on Sketchfab.',
opacityToTransmission: true,
bounces: 8,
postProcess( model ) {
model.traverse( c => {
if ( c.material && c.material instanceof MeshPhysicalMaterial ) {
const material = c.material;
material.metalness = 0.0;
material.roughness = 0.005;
material.ior = 1.645;
material.color.lerp( new Color( 0xffffff ), 0.65 );
}
} );
}
},
'Halo Twist Ring': {
url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/ring-twist-halo/scene.glb',
credit: 'Model credit NASA / JPL-Caltech',
opacityToTransmission: true,
bounces: 15,
postProcess( model ) {
model.traverse( c => {
if ( c.material ) {
if ( c.material instanceof MeshPhysicalMaterial ) {
if ( c.material.transmission === 1.0 ) {
const material = c.material;
material.roughness *= 0.1;
material.metalness = 0.0;
material.ior = 1.8;
material.color.set( 0xffffff );
} else {
c.material.roughness *= 0.1;
}
}
}
} );
}
},
'Damaged Helmet': {
url: 'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF/DamagedHelmet.gltf',
credit: 'glTF Sample Model.',
},
'Flight Helmet': {
url: 'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/FlightHelmet/glTF/FlightHelmet.gltf',
credit: 'glTF Sample Model.',
},
'Statue': {
url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/threedscans/Le_Transi_De_Rene_De_Chalon.glb',
credit: 'Model courtesy of threedscans.com.',
},
'Crab Sculpture': {
url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/threedscans/Elbow_Crab.glb',
rotation: [ 3.1 * Math.PI / 4, Math.PI, 0 ],
credit: 'Model courtesy of threedscans.com.',
},
// 'Astraia': {
// url: 'https://raw.githubusercontent.com/gkjohnson/3d-demo-data/main/models/astraia/scene.gltf',
// credit: 'Model by "Quentin Otani" on Sketchfab',
// removeEmission: true,
// postProcess( model ) {
// const toRemove = [];
// model.traverse( c => {
// if ( c.name.includes( 'ROND' ) ) {
// toRemove.push( c );
// }
// } );
// toRemove.forEach( c => {
// c.parent.remove( c );
// } );
// }
// },
};
</script>
<script src="./index.js" type="module"></script>
</body>
</html>
| 22.969811 | 127 | 0.556267 |
1c99196810391ffcfd3cc8eaad00761b9bd8da6c | 371 | css | CSS | public/styles/noticiaFull.css | JNCJcoder/devmedia-prova-nodejs | e94111e5fda7d5a842deb7510e66e4102abef99e | [
"MIT"
] | null | null | null | public/styles/noticiaFull.css | JNCJcoder/devmedia-prova-nodejs | e94111e5fda7d5a842deb7510e66e4102abef99e | [
"MIT"
] | null | null | null | public/styles/noticiaFull.css | JNCJcoder/devmedia-prova-nodejs | e94111e5fda7d5a842deb7510e66e4102abef99e | [
"MIT"
] | null | null | null | * {
margin: 0;
padding: 0;
}
.noticiaContainer {
display: flex;
flex-direction: column;
align-self: center;
padding: 25px;
background-color: #fff;
border: 1px solid #f8f8f8;
border-radius: 5px;
box-shadow: 0px 0px 9px 3px rgba(41,41,41,.25);
margin-left: 20px;
height: 70%;
width: 50%;
}
pre {
margin-top: 30px;
} | 16.863636 | 51 | 0.587601 |
6571dc393d28bc0c0a3f9eff0b4f71b45498a56b | 457 | dart | Dart | lib/utils.dart | amosogra/flutter_standard | 26b938b33e65321719a0c190a7a9a2ae555458d3 | [
"MIT"
] | 3 | 2021-11-10T00:56:22.000Z | 2022-03-21T13:05:54.000Z | lib/utils.dart | amosogra/flutter_standard | 26b938b33e65321719a0c190a7a9a2ae555458d3 | [
"MIT"
] | 7 | 2021-09-28T12:26:27.000Z | 2022-02-05T11:50:26.000Z | lib/utils.dart | amosogra/flutter_standard | 26b938b33e65321719a0c190a7a9a2ae555458d3 | [
"MIT"
] | 7 | 2021-10-21T23:49:15.000Z | 2022-03-09T11:04:46.000Z | class Utils {
static const DEFAULT_URL = "https://www.google.com";
static const _PROD_BASE_URL = "https://api.ravepay.co/v3/sdkcheckout/";
static const String STANDARD_PAYMENT = "payments";
static const _DEBUG_BASE_URL =
"https://ravesandboxapi.flutterwave.com/v3/sdkcheckout/";
/// Returns base url depending on test mode
static String getBaseUrl(final bool isTestMode) {
return isTestMode ? _DEBUG_BASE_URL : _PROD_BASE_URL;
}
}
| 32.642857 | 73 | 0.73523 |
24e8ca1149b8abb9cfc8c32747441f8f985a34c5 | 673 | go | Go | response.go | lnlwd/gremji | 0cd7cf9de173ca5fa54e193a628094bed6d3f8dd | [
"MIT"
] | null | null | null | response.go | lnlwd/gremji | 0cd7cf9de173ca5fa54e193a628094bed6d3f8dd | [
"MIT"
] | null | null | null | response.go | lnlwd/gremji | 0cd7cf9de173ca5fa54e193a628094bed6d3f8dd | [
"MIT"
] | 1 | 2018-03-02T02:52:31.000Z | 2018-03-02T02:52:31.000Z | package gremji
import (
"encoding/json"
"fmt"
)
type Response struct {
RequestId string `json:"requestId"`
Status *ResponseStatus `json:"status"`
Result *ResponseResult `json:"result"`
}
type ResponseStatus struct {
Code int `json:"code"`
Attributes map[string]interface{} `json:"attributes"`
Message string `json:"message"`
}
type ResponseResult struct {
Data json.RawMessage `json:"data"`
Meta map[string]interface{} `json:"meta"`
}
func (r Response) ToString() string {
return fmt.Sprintf("Response \nRequestId: %v, \nStatus: {%#v}, \nResult: {%#v}\n", r.RequestId, r.Status, r.Result)
}
| 24.035714 | 116 | 0.635958 |
fb27c7b31ad3aee03a18987fd26594d564d08acd | 7,966 | h | C | lib/am335x_sdk/ti/csl/src/ip/clec/V0/csl_clec.h | brandonbraun653/Apollo | a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce | [
"MIT"
] | 2 | 2021-12-27T10:19:01.000Z | 2022-03-15T07:09:06.000Z | lib/am335x_sdk/ti/csl/src/ip/clec/V0/csl_clec.h | brandonbraun653/Apollo | a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce | [
"MIT"
] | null | null | null | lib/am335x_sdk/ti/csl/src/ip/clec/V0/csl_clec.h | brandonbraun653/Apollo | a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce | [
"MIT"
] | null | null | null | /*
* Copyright (C) 2017 Texas Instruments Incorporated.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* \ingroup CSL_IP_MODULE
* \defgroup CSL_CLEC CLEC - Compute cluster Event Controller
*
* @{
*/
/**
* \file csl_clec.h
*
* \brief
* This is the include file for the CLEC CSL-FL module.
*/
#ifndef CSL_CLEC_H_
#define CSL_CLEC_H_
/* ========================================================================== */
/* Include Files */
/* ========================================================================== */
#include <stdint.h>
#include <ti/csl/cslr_clec.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
/* Macros */
/* ========================================================================== */
/**
* \brief Maximum number of input events supported by CLEC. This is just the
* maximum registers supported for programming. The actual event supported
* depends on the SOC.
*/
#define CSL_CLEC_MAX_EVT_IN (2047U)
/**
* \brief Maximum external events.
*/
#define CSL_CLEC_MAX_EXT_EVT_OUT (128U)
/**
* \brief Maximum C7x events.
*/
#define CSL_CLEC_MAX_C7X_EVT_OUT (64U)
/**
* \anchor CSL_ClecRouteMap
* \name CLEC route map - Determines where the event will be routed.
*
* Note: All the cores may not be present in a particular SOC. The CSL-FL
* is provided to support the IP feature and hence all possible setting is
* provided. Also the meaning of each core is SOC dependent. Refer to
* SOC information to know the exact mapping.
*
* @{
*/
/** \brief Send event to None */
#define CSL_CLEC_RTMAP_DISABLE ((uint32_t)((uint32_t) 0x0001U) << 0U)
/** \brief Send event to SOC as Compute Cluster interrupt output */
#define CSL_CLEC_RTMAP_SYS ((uint32_t)((uint32_t) 0x0001U) << 1U)
/** \brief Send event to CPU 0 - Typically reserved for ARM */
#define CSL_CLEC_RTMAP_CPU_0 ((uint32_t)((uint32_t) 0x0000U) << 2U)
/** \brief Send event to CPU 1 - Typically reserved for ARM */
#define CSL_CLEC_RTMAP_CPU_1 ((uint32_t)((uint32_t) 0x0001U) << 2U)
/** \brief Send event to CPU 2 - Typically reserved for ARM */
#define CSL_CLEC_RTMAP_CPU_2 ((uint32_t)((uint32_t) 0x0002U) << 2U)
/** \brief Send event to CPU 3 - Typically reserved for ARM */
#define CSL_CLEC_RTMAP_CPU_3 ((uint32_t)((uint32_t) 0x0003U) << 2U)
/** \brief Send event to CPU 4 - Typically C7x core starts from this */
#define CSL_CLEC_RTMAP_CPU_4 ((uint32_t)((uint32_t) 0x0004U) << 2U)
/** \brief Send event to CPU 5 */
#define CSL_CLEC_RTMAP_CPU_5 ((uint32_t)((uint32_t) 0x0005U) << 2U)
/** \brief Send event to CPU 6 */
#define CSL_CLEC_RTMAP_CPU_6 ((uint32_t)((uint32_t) 0x0006U) << 2U)
/** \brief Send event to CPU 7 */
#define CSL_CLEC_RTMAP_CPU_7 ((uint32_t)((uint32_t) 0x0007U) << 2U)
/** \brief Send event to CPU 8 */
#define CSL_CLEC_RTMAP_CPU_8 ((uint32_t)((uint32_t) 0x0008U) << 2U)
/** \brief Send event to CPU 9 */
#define CSL_CLEC_RTMAP_CPU_9 ((uint32_t)((uint32_t) 0x0009U) << 2U)
/** \brief Send event to CPU 10 */
#define CSL_CLEC_RTMAP_CPU_10 ((uint32_t)((uint32_t) 0x000AU) << 2U)
/** \brief Send event to All CPU */
#define CSL_CLEC_RTMAP_CPU_ALL ((uint32_t)((uint32_t) 0x000FU) << 2U)
/* @} */
/* ========================================================================== */
/* Structures and Enums */
/* ========================================================================== */
/** \brief This structure contains the parameters to setup a event. */
typedef struct
{
uint32_t secureClaimEnable;
/**< [IN] TRUE/FALSE.
* When set to TRUE, a non-secure read/write to MRR will generate a
* privilege error. */
uint32_t evtSendEnable;
/**< [IN] TRUE/FALSE. Controls whether ESR sends this event when written.
* When set to TRUE, write to ESR triggers the event. */
uint32_t rtMap;
/**< [IN] Route map bit field. Refer \ref CSL_ClecRouteMap. */
uint32_t extEvtNum;
/**< [IN] Encoded external event number to send when this event
* is triggered. Range 0 to (#CSL_CLEC_MAX_EXT_EVT_OUT - 1). */
uint32_t c7xEvtNum;
/**< [IN] C7x event number to send when this event is triggered.
* Range 0 to (#CSL_CLEC_MAX_C7X_EVT_OUT - 1). */
} CSL_ClecEventConfig;
/* ========================================================================== */
/* Function Declarations */
/* ========================================================================== */
/**
* \brief This API sets the event configuration.
*
* \param pRegs [IN] CLEC register base.
* \param evtNum [IN] CLEC event number 0 to (#CSL_CLEC_MAX_EVT_IN - 1).
* \param evtCfg [IN] Pointer to event configuration.
*
* \return \ref CSL_ErrType_t
*/
int32_t CSL_clecConfigEvent(CSL_CLEC_EVTRegs *pRegs,
uint32_t evtNum,
const CSL_ClecEventConfig *evtCfg);
/**
* \brief This API sends the event specified if the event send is enabled
* in the event configuration (evtSendEnable) and the output event generated
* depends on the rtMap, extEvtNum and c7xEvtNum.
*
* \param pRegs [IN] CLEC register base.
* \param evtNum [IN] CLEC event number 0 to (#CSL_CLEC_MAX_EVT_IN - 1).
*
* \return \ref CSL_ErrType_t
*/
int32_t CSL_clecSendEvent(CSL_CLEC_EVTRegs *pRegs, uint32_t evtNum);
/**
* \brief This API clear any level interrupt set for the event.
*
* \param pRegs [IN] CLEC register base.
* \param evtNum [IN] CLEC event number 0 to (#CSL_CLEC_MAX_EVT_IN - 1).
*
* \return \ref CSL_ErrType_t
*/
int32_t CSL_clecClearEvent(CSL_CLEC_EVTRegs *pRegs, uint32_t evtNum);
/* ========================================================================== */
/* Static Function Definitions */
/* ========================================================================== */
/* None */
#ifdef __cplusplus
}
#endif
#endif /* CSL_CLEC_H_ */
/** @} */
| 40.642857 | 80 | 0.580467 |
b116a5cac1cef8fa261cadfa6031e36902fac10e | 1,737 | sql | SQL | pgsql/NewJobs.sql | GSoares10/NewJobs | 4e988740137fb0fc8170a5afd9d29065f7de6e45 | [
"MIT"
] | null | null | null | pgsql/NewJobs.sql | GSoares10/NewJobs | 4e988740137fb0fc8170a5afd9d29065f7de6e45 | [
"MIT"
] | null | null | null | pgsql/NewJobs.sql | GSoares10/NewJobs | 4e988740137fb0fc8170a5afd9d29065f7de6e45 | [
"MIT"
] | null | null | null | CREATE DATABASE "NewJobs";
DROP TABLE IF EXISTS "Conta";
DROP TABLE IF EXISTS "Empresa";
DROP TABLE IF EXISTS "Endereco";
DROP TABLE IF EXISTS "Post";
CREATE TABLE "Conta" (
"codConta" serial,
"nome" varchar(250) NOT NULL,
"sexo" varchar(10) NOT NULL,
"dataNascimento" date NOT NULL,
"telefone" char(11) NOT NULL,
"tipo" varchar (12) NOT NULL,
"email" varchar(200) NOT NULL,
"senha" varchar(100) NOT NULL,
"fotoCapa" varchar(150),
"foto" varchar(150),
"descricao" text,
"curriculo" varchar(150),
CONSTRAINT "checkSexo" CHECK ("sexo" = 'Feminino' OR "sexo" = 'Masculino'),
CONSTRAINT "checkTipo" CHECK ("tipo" = 'Usuário' OR "tipo" = 'Empreendedor'),
CONSTRAINT "ContaPK" PRIMARY KEY ("codConta")
);
CREATE TABLE "Empresa" (
"cnpj" varchar(18) NOT NULL,
"codConta" int NOT NULL,
"nome" varchar(200) NOT NULL,
"tipo" varchar(100) NOT NULL,
CONSTRAINT "EmpresaPK" PRIMARY KEY ("cnpj"),
CONSTRAINT "EmpresaContaFK" FOREIGN KEY ("codConta")
REFERENCES "Conta" ("codConta")
ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE "Endereco" (
"codEndereco" serial,
"cnpj" varchar(18) NOT NULL,
"rua" varchar(200) NOT NULL,
"bairro" varchar(200) NOT NULL,
"numero" char(10) NOT NULL,
"cidade" varchar(150) NOT NULL,
"pais" varchar(100) NOT NULL,
CONSTRAINT "EnderecoPK" PRIMARY KEY ("codEndereco"),
CONSTRAINT "EnderecoEmpresaFK" FOREIGN KEY ("cnpj")
REFERENCES "Empresa"
ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE "Post" (
"codPost" serial,
"codConta" int NOT NULL,
"descricao" varchar(200),
"arquivo" varchar(150),
CONSTRAINT "PostPK" PRIMARY KEY ("codPost"),
CONSTRAINT "PostContaFK" FOREIGN KEY ("codConta")
REFERENCES "Conta" ("codConta")
ON UPDATE CASCADE ON DELETE CASCADE
);
| 28.47541 | 78 | 0.702936 |
af52bbb2d9b384d6bd049943bfc46f209876c5b7 | 350 | swift | Swift | IOS APP/FoodAI/NutritionAPIResponse.swift | Pencroff/ai-hackathon | baeddce57ab3e1f4aeae4029b9e4a63a7897e508 | [
"MIT"
] | null | null | null | IOS APP/FoodAI/NutritionAPIResponse.swift | Pencroff/ai-hackathon | baeddce57ab3e1f4aeae4029b9e4a63a7897e508 | [
"MIT"
] | null | null | null | IOS APP/FoodAI/NutritionAPIResponse.swift | Pencroff/ai-hackathon | baeddce57ab3e1f4aeae4029b9e4a63a7897e508 | [
"MIT"
] | null | null | null | //
// NutritionAPIResponse.swift
// FoodAI
//
// Created by Pablo on 2/19/17.
// Copyright © 2017 Pablo Carvalho. All rights reserved.
//
import Foundation
import Gloss
class NutritionAPIResponse : Decodable {
let nutrients: [Nutrient]
required init?(json: JSON) {
self.nutrients = ("nutrient_list" <~~ json)!
}
}
| 17.5 | 57 | 0.645714 |
50d7b384bb972ec097c699337ee4a41d86919109 | 342 | asm | Assembly | programs/oeis/158/A158569.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/158/A158569.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/158/A158569.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A158569: a(n) = Sum_{i=1..F(n)} F(i), n >= 1, where F(k) is A000045, Fibonacci numbers.
; 1,1,2,4,12,54,609,28656,14930351,365435296161,4660046610375530308,1454489111232772683678306641952
seq $0,71 ; a(n) = Fibonacci(n) - 1.
seq $0,78642 ; Numbers with two representations as the sum of two Fibonacci numbers.
mul $0,10
div $0,20
sub $0,1
| 38 | 99 | 0.707602 |
7504d579c855c6da18837ea2ab713c0e3d76990b | 8,511 | c | C | demo/wordy.c | KorfLab/genomikon | e3f9ee00d071c2aca3704834223ee0afda0f018f | [
"MIT"
] | null | null | null | demo/wordy.c | KorfLab/genomikon | e3f9ee00d071c2aca3704834223ee0afda0f018f | [
"MIT"
] | null | null | null | demo/wordy.c | KorfLab/genomikon | e3f9ee00d071c2aca3704834223ee0afda0f018f | [
"MIT"
] | null | null | null | /*****************************************************************************\
wordy.c
\*****************************************************************************/
#include <time.h>
#include "genomikon.h"
#define WORD_LENGTH 64
#define MAX_BOARD 8
struct DICTIONARY {
gkn_xtree tree;
int count[256];
float prob[256];
float ramp[256];
};
typedef struct DICTIONARY dictionary;
dictionary read_dictionary (const char *filename) {
char word[1024];
// blank dictionary
dictionary d;
d.tree = gkn_xtree_new();
for (int i = 0; i < 256; i++) {
d.count[i] = 0;
d.prob[i] = 0;
}
// read words
int total = 0;
gkn_pipe pipe = gkn_pipe_open(filename, "r");
while (fscanf(pipe->stream, "%s", word) != EOF) {
int length = strlen(word);
if (length >= WORD_LENGTH) gkn_exit("max word length exceeded");
for (int i = 0; i < length; i++) word[i] = tolower(word[i]);
gkn_xtree_set(d.tree, word, (void*)1);
for (int i = 0; i < length; i++) {
d.count[(int)word[i]]++;
total++;
}
}
gkn_pipe_close(pipe);
// symbol frequencies
for (int i = 0; i < 256; i++) {
d.prob[i] = (float)d.count[i] / (float)total;
}
double sum = 0;
for (int i = 0; i < 256; i++) {
d.ramp[i] = d.prob[i] + sum;
sum += d.prob[i];
}
return d;
}
char random_char(dictionary d) {
double r = random() / (double)RAND_MAX;
for (int i = 0; i < 256; i++) {
if (r < d.ramp[i]) {
return i;
}
}
return -1;
}
struct BOARD {
int size;
int matrix[MAX_BOARD][MAX_BOARD];
};
typedef struct BOARD * board;
void free_board(board b) {
free(b);
}
board new_board(int s) {
assert(s <= MAX_BOARD);
board b = malloc(sizeof(struct BOARD));
b->size = s;
for (int i = 0; i < b->size; i++) {
for (int j = 0; j < b->size; j++) {
b->matrix[i][j] = 0;
}
}
return b;
}
board random_board(int s, dictionary d) {
board b = new_board(s);
for (int i = 0; i < b->size; i++) {
for (int j = 0; j < b->size; j++) {
char c = random_char(d);
b->matrix[i][j] = c;
}
}
return b;
}
board copy_board (const board parent) {
board child = new_board(parent->size);
for (int i = 0; i < parent->size; i++) {
for (int j = 0; j < parent->size; j++) {
child->matrix[i][j] = parent->matrix[i][j];
}
}
return child;
}
void show_board (const board b) {
for (int x = 0; x < b->size +2; x++) printf("-");
printf("\n");
for (int y = 0; y < b->size; y++) {
printf("|");
for (int x = 0; x < b->size; x++) {
if (b->matrix[x][y] < 'a') printf("%d", b->matrix[x][y]);
else printf("%c", b->matrix[x][y]);
}
printf("|\n");
}
for (int x = 0; x < b->size +2; x++) printf("-");
printf("\n");
}
static const int MOVE[8][2] = {
{0,1}, {1,1}, {1,0}, {1,-1}, {0,-1}, {-1,-1}, {-1,0}, {-1,1}
};
static void find_words (const board b,
const dictionary d,
const int x0,
const int y0,
const board path,
const char *word,
int length,
gkn_tvec words)
{
char new_word[WORD_LENGTH];
if (gkn_xtree_get(d.tree, word)) {
gkn_tvec_push(words, word);
}
for (int i = 0; i < 8; i++) {
int x = MOVE[i][0] + x0;
int y = MOVE[i][1] + y0;
if (x < 0 || x == b->size) continue; // out of bounds
if (y < 0 || y == b->size) continue; // out of bounds
if (path->matrix[x][y]) continue; // already visited
strcpy(new_word, word);
new_word[length] = b->matrix[x][y];
new_word[length+1] = '\0';
if (!gkn_xtree_check(d.tree, new_word)) continue; // no words extend
board new_path = copy_board(path);
new_path->matrix[x][y] = 1;
find_words(b, d, x, y, new_path, new_word, length +1, words);
free_board(new_path);
}
}
gkn_tvec solve_board (const board b, const dictionary d, int min_word) {
gkn_tvec words = gkn_tvec_new();
for (int x = 0; x < b->size; x++) {
for (int y = 0; y < b->size; y++) {
board path = new_board(b->size);
path->matrix[x][y] = 1;
char word[2];
word[0] = b->matrix[x][y];
word[1] = '\0';
find_words(b, d, x, y, path, word, 1, words);
free_board(path);
}
}
// filter for length and redundancy
gkn_map unique = gkn_map_new();
for (int i = 0; i < words->size; i++) {
if (strlen(words->elem[i]) >= min_word) {
gkn_map_set(unique, words->elem[i], (void*)1);
}
}
gkn_tvec final = gkn_map_keys(unique);
// clean up
gkn_tvec_free(words);
gkn_map_free(unique);
return final;
}
struct BEING {
board genotype;
int fitness;
};
typedef struct BEING being;
static int fitness(board b, dictionary d, int min) {
gkn_tvec words = solve_board(b, d, min);
int fit = words->size;
gkn_tvec_free(words);
return fit;
}
static int wsort (const void *p1, const void *p2) {
char *a = *(char **) p1;
char *b = *(char **) p2;
return strcmp(a, b);
}
static int bsort (const void *p1, const void *p2) {
being *a = (being*) p1;
being *b = (being*) p2;
if (a->fitness > b->fitness) return -1;
if (b->fitness > a->fitness) return 1;
return 0;
}
static void mate(
const being p1,
const being p2,
being *child,
dictionary d,
int min,
float mut)
{
// recombination & mutation
for (int i = 0; i < p1.genotype->size; i++) {
for (int j = 0; j < p1.genotype->size; j++) {
if (rand()/RAND_MAX < 0.5)
child->genotype->matrix[i][j] = p1.genotype->matrix[i][j];
else
child->genotype->matrix[i][j] = p2.genotype->matrix[i][j];
if (rand() / RAND_MAX < mut)
child->genotype->matrix[i][j] = random_char(d);
}
}
// finalization
child->fitness = fitness(child->genotype, d, min);
}
static char *usage = "\
dusty - boggle solver demo\n\n\
usage: wordy <dictionary> [options]\n\
options:\n\
-size <int> size of board [4]\n\
-min <int> minimum word size [3]\n\
-pop <int> population size [1000]\n\
-gen <int> generations [100]\n\
-die <float> fraction that die each generation [0.5]\n\
-mut <float> mutation frequency [0.1]\n\
-seed <int> random seed [not set]\n\
-words show all words\n\
-verbose verbose progress reporting\n\
";
int main(int argc, char **argv) {
char *file = NULL; // path to dictionary file
int size = 4; // board size
int min = 3; // window size
int pop = 1000; // population size
int gen = 100; // generations
float die = 0.5; // fraction that die each gen
float mut = 0.1; // mutation frequency
int seed = 0; // random seed, 0 not used
int show_words = 0; // final report
int show_progress = 0; // intermediate report
// Command Line Interface
gkn_set_program_name(argv[0]);
gkn_register_option("-size", 1);
gkn_register_option("-min", 1);
gkn_register_option("-pop", 1);
gkn_register_option("-gen", 1);
gkn_register_option("-die", 1);
gkn_register_option("-mut", 1);
gkn_register_option("-seed", 1);
gkn_register_option("-words", 0);
gkn_register_option("-verbose", 0);
gkn_parse_options(&argc, argv);
if (argc == 1) gkn_exit("%s", usage);
file = argv[1];
if (gkn_option("-size")) size = atoi(gkn_option("-size"));
if (gkn_option("-min")) min = atoi(gkn_option("-min"));
if (gkn_option("-pop")) pop = atoi(gkn_option("-pop"));
if (gkn_option("-gen")) gen = atoi(gkn_option("-gen"));
if (gkn_option("-die")) die = atof(gkn_option("-die"));
if (gkn_option("-mut")) mut = atof(gkn_option("-mut"));
if (gkn_option("-seed")) seed = atoi(gkn_option("-seed"));
if (gkn_option("-words")) show_words = 1;
if (gkn_option("-verbose")) show_progress = 1;
// setup
dictionary d = read_dictionary(file);
if (seed) srand(seed);
else srand(time(NULL));
int half = pop * (1 - die);
// initial population
being *population = malloc(pop * sizeof(being));
for (int i = 0; i < pop; i++) {
population[i].genotype = random_board(size, d);
population[i].fitness = fitness(population[i].genotype, d, min);
}
// evolve
for (int g = 0; g < gen; g++) {
qsort(population, pop, sizeof(being), bsort);
if (show_progress)
printf("gen: %d, max: %d\n", g, population[0].fitness);
for (int i = half; i < pop; i++) {
int p1 = rand() / (double)RAND_MAX * half;
int p2 = rand() / (double)RAND_MAX * half;
mate(population[p1], population[p2], &population[i], d, min, mut);
}
}
// report
qsort(population, pop, sizeof(being), bsort);
board b = population[0].genotype;
gkn_tvec words = solve_board(b, d, min);
show_board(b);
printf("words: %d\n", words->size);
if (show_words) {
qsort(words->elem, words->size, sizeof(char*), wsort);
for (int i = 0; i < words->size; i++) {
printf("%s\n", words->elem[i]);
}
}
return 0;
}
| 24.813411 | 79 | 0.582423 |
baa76aae92d51e62f32918ea90dc01b3ec846817 | 15,786 | sql | SQL | librerias/ctasctes.sql | edgoca1962/ctasbcos | d5ece82e14c04cdde3bca8f69c70a54711666752 | [
"MIT"
] | null | null | null | librerias/ctasctes.sql | edgoca1962/ctasbcos | d5ece82e14c04cdde3bca8f69c70a54711666752 | [
"MIT"
] | null | null | null | librerias/ctasctes.sql | edgoca1962/ctasbcos | d5ece82e14c04cdde3bca8f69c70a54711666752 | [
"MIT"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 01, 2020 at 04:03 PM
-- Server version: 5.7.30
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `ctasctes`
--
-- --------------------------------------------------------
--
-- Table structure for table `bancos`
--
CREATE TABLE `bancos` (
`id` int(11) NOT NULL,
`nombre_banco` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`codigo_pais` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cuentas_bancarias`
--
CREATE TABLE `cuentas_bancarias` (
`id` int(11) NOT NULL,
`id_entidad` int(11) NOT NULL,
`id_usuario_apertura` int(11) NOT NULL,
`id_usuario_cierre` int(11) NOT NULL,
`id_banco` int(11) NOT NULL,
`iban` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`saldo_cuenta` decimal(15,2) NOT NULL,
`codigo_moneda` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`estatus_cuenta` tinyint(1) NOT NULL,
`fecha_registro` date NOT NULL,
`fecha_apertura` date NOT NULL,
`fecha_cierre` date NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Table structure for table `entidades`
--
CREATE TABLE `entidades` (
`id` int(11) NOT NULL,
`nombre_entidad` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Table structure for table `menues`
--
CREATE TABLE `menues` (
`id` int(11) NOT NULL,
`id_vista` int(11) NOT NULL,
`id_usuario` int(11) NOT NULL,
`tipo_usuario_menu` int(11) NOT NULL,
`descripcion` text COLLATE utf8_spanish_ci NOT NULL,
`orden` int(11) NOT NULL,
`nivel` int(11) NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Table structure for table `rubros`
--
CREATE TABLE `rubros` (
`id` int(11) NOT NULL,
`categoria` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`sub_categoria` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Table structure for table `rutas_proyecto`
--
CREATE TABLE `rutas_proyecto` (
`id` int(11) NOT NULL,
`ruta_descripcion` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`ruta` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Dumping data for table `rutas_proyecto`
--
INSERT INTO `rutas_proyecto` (`id`, `ruta_descripcion`, `ruta`, `fecha_proceso`) VALUES
(1, 'dominio', 'http://localhost/ctasctes/', '2020-11-23 15:18:52'),
(3, 'css', 'vistas/css/', '2020-11-23 15:18:52'),
(4, 'js', 'vistas/js/', '2020-11-23 15:18:52'),
(5, 'contenidos', 'vistas/contenidos/', '2020-11-23 15:18:52'),
(8, 'img_anuncios', 'vistas/img/anuncios/', '2020-11-23 15:18:52'),
(10, 'img_banners', 'vistas/img/banners/', '2020-11-23 15:18:52'),
(11, 'img_generales', 'vistas/img/generales/', '2020-11-23 15:18:52'),
(13, 'img_usrs', 'vistas/img/usuarios/', '2020-11-23 15:18:52');
-- --------------------------------------------------------
--
-- Table structure for table `sesiones`
--
CREATE TABLE `sesiones` (
`id` int(11) NOT NULL,
`id_usuario` int(11) NOT NULL,
`id_sesion` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`fecha_inicio` date NOT NULL,
`hora_inicio` varchar(20) COLLATE utf8_spanish_ci NOT NULL,
`fecha_salida` date DEFAULT NULL,
`hora_salida` varchar(20) COLLATE utf8_spanish_ci DEFAULT NULL,
`estado_sesion` tinyint(1) NOT NULL DEFAULT '0',
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Dumping data for table `sesiones`
--
INSERT INTO `sesiones` (`id`, `id_usuario`, `id_sesion`, `fecha_inicio`, `hora_inicio`, `fecha_salida`, `hora_salida`, `estado_sesion`, `fecha_proceso`) VALUES
(27, 2, 'e4090qki1uu8j8mvcjiiin2snv', '2020-11-25', '19:56:07', '2020-11-25', '20:01:28', 0, '2020-11-26 01:56:07'),
(28, 2, 'k7u7q82ulokmhtdcc1eq420ngh', '2020-11-25', '20:01:42', '2020-11-25', '20:12:40', 0, '2020-11-26 02:01:42'),
(29, 2, '137me01gk3t45laguas217nhbr', '2020-11-28', '13:25:34', '2020-11-28', '13:35:16', 0, '2020-11-28 19:25:34'),
(30, 2, 'epo8nng7328t3jogim8voleoqm', '2020-11-28', '13:35:32', '2020-11-28', '13:49:16', 0, '2020-11-28 19:35:32'),
(31, 2, '5ad4a6g19o1cck488d9m83dnmg', '2020-11-28', '13:49:27', '2020-11-28', '13:54:57', 0, '2020-11-28 19:49:27'),
(32, 2, 'iaji7dfiecv2rj1jq1ahcohrt5', '2020-11-29', '08:07:52', '2020-12-01', '10:48:53', 0, '2020-11-29 14:07:52'),
(33, 2, 'm3avu3dqg9u5p1ba4p4iiggigb', '2020-12-01', '10:49:05', '2020-12-01', '10:49:21', 0, '2020-12-01 16:49:05'),
(34, 2, 'rji5pjhgdcuvff9h0r7h66fsm4', '2020-12-01', '10:51:28', '2020-12-01', '10:52:28', 0, '2020-12-01 16:51:28'),
(35, 2, '6jr9t638rm2so1qrq3b02m7794', '2020-12-01', '10:53:34', '2020-12-01', '10:57:46', 0, '2020-12-01 16:53:34'),
(36, 2, 'phrodf25uioii0jmib7nrb2he7', '2020-12-01', '10:57:58', '2020-12-01', '10:58:06', 0, '2020-12-01 16:57:58'),
(37, 2, 'i2u1elg7jcft7l362icntl4por', '2020-12-01', '11:20:55', '2020-12-01', '11:21:08', 0, '2020-12-01 17:20:55'),
(38, 2, '21nldkude6o55bqhjqt69enfg2', '2020-12-01', '11:23:00', '2020-12-01', '11:26:37', 0, '2020-12-01 17:23:00'),
(39, 2, 'eivufeqd1usp57nsja92tpovlc', '2020-12-01', '11:27:08', '2020-12-01', '11:29:04', 0, '2020-12-01 17:27:08'),
(40, 2, '0v5lmsktv5g0cqv4ff9mkfi115', '2020-12-01', '11:29:28', '2020-12-01', '11:32:42', 0, '2020-12-01 17:29:28'),
(41, 2, 'ng9o1ipr45ivdiqgq6d428pu6c', '2020-12-01', '11:40:22', '2020-12-01', '11:40:33', 0, '2020-12-01 17:40:22'),
(42, 2, 'b897p8ikv2tk96ma85mma6i44o', '2020-12-01', '11:43:53', '2020-12-01', '11:43:58', 0, '2020-12-01 17:43:53'),
(43, 2, '77lom98e0o4gnm0mfril8tu3gg', '2020-12-01', '11:45:34', '2020-12-01', '11:45:38', 0, '2020-12-01 17:45:34'),
(44, 2, 'hb9p171mhjre12v4p3bd1e0947', '2020-12-01', '11:48:32', '2020-12-01', '11:48:35', 0, '2020-12-01 17:48:32'),
(45, 2, 'bfb2il9gaju27g4n1c7cd4deav', '2020-12-01', '11:52:46', '2020-12-01', '11:52:50', 0, '2020-12-01 17:52:46'),
(46, 2, '0rhfctknrr7mnloi73d6smhfp2', '2020-12-01', '12:00:03', '2020-12-01', '12:00:13', 0, '2020-12-01 18:00:03');
-- --------------------------------------------------------
--
-- Table structure for table `tipo_movimientos`
--
CREATE TABLE `tipo_movimientos` (
`id` int(11) NOT NULL,
`codigo_movimiento` varchar(3) COLLATE utf8_spanish_ci NOT NULL,
`descripcion` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Table structure for table `transacciones`
--
CREATE TABLE `transacciones` (
`id` int(11) NOT NULL,
`id_ctacte` int(11) NOT NULL,
`id_categoria` int(11) NOT NULL,
`id_tipo_movimiento` int(11) NOT NULL,
`fecha_movimiento` date NOT NULL,
`monto_movimiento` decimal(10,0) NOT NULL,
`id_usuario` int(11) NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Table structure for table `usuarios`
--
CREATE TABLE `usuarios` (
`id` int(11) NOT NULL,
`nombre_usuario` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`correo_usuario` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`clave` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`tipo_usuario` int(11) NOT NULL,
`foto_usuario` mediumtext COLLATE utf8_spanish_ci NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Dumping data for table `usuarios`
--
INSERT INTO `usuarios` (`id`, `nombre_usuario`, `correo_usuario`, `clave`, `tipo_usuario`, `foto_usuario`, `fecha_proceso`) VALUES
(1, 'Edwin González', 'edgoca1962@gmail.com', '$2y$10$if3oxWHAEYUG9UeIqlVzBOFvMI9jYjo260HYy/llo2lslIKfV9Fw6', 0, '', '2020-11-23 15:22:04'),
(2, 'Usuario Prueba', 'prueba@prueba.com', '$2y$10$KatAMAZSbHHeUIcg6BqIb.dkJ5M6xYP4g0.a6WkAHqCVni6lLm1ZO', 0, '', '2020-11-23 15:36:20');
-- --------------------------------------------------------
--
-- Table structure for table `vistas`
--
CREATE TABLE `vistas` (
`id` int(11) NOT NULL,
`nombre_vista` text COLLATE utf8_spanish_ci NOT NULL,
`titulo` text COLLATE utf8_spanish_ci NOT NULL,
`descripcion` text COLLATE utf8_spanish_ci NOT NULL,
`palabras_claves` text COLLATE utf8_spanish_ci NOT NULL,
`icono` text COLLATE utf8_spanish_ci NOT NULL,
`logo` text COLLATE utf8_spanish_ci NOT NULL,
`fecha_proceso` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Dumping data for table `vistas`
--
INSERT INTO `vistas` (`id`, `nombre_vista`, `titulo`, `descripcion`, `palabras_claves`, `icono`, `logo`, `fecha_proceso`) VALUES
(1, 'Plantilla', 'Inicio', 'Somos una comunidad multigeneracional apasionada por seguir a Jesús, equipándonos en Su Palabra y sumándonos a la restauración del mundo.', 'iglesia, congregación, semilla, semillaCR, semilla CR, amor, escritura, crecimiento, inclusividad, servicio, vulnerabilidad, compasión, generosidad', 'icono.png', 'Semilla.jpg', '2020-12-01 15:01:33'),
(2, 'Ingreso', 'Ingreso', 'Somos una comunidad multigeneracional apasionada por seguir a Jesús, equipándonos en Su Palabra y sumándonos a la restauración del mundo.', 'iglesia, congregación, semilla, semillaCR, semilla CR, amor, escritura, crecimiento, inclusividad, servicio, vulnerabilidad, compasión, generosidad', '', '', '2020-12-01 15:01:33'),
(3, 'Inicio', 'Inicio', 'Somos una comunidad multigeneracional apasionada por seguir a Jesús, equipándonos en Su Palabra y sumándonos a la restauración del mundo.', 'iglesia, congregación, semilla, semillaCR, semilla CR, amor, escritura, crecimiento, inclusividad, servicio, vulnerabilidad, compasión, generosidad', '', '', '2020-12-01 15:02:25');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bancos`
--
ALTER TABLE `bancos`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cuentas_bancarias`
--
ALTER TABLE `cuentas_bancarias`
ADD PRIMARY KEY (`id`),
ADD KEY `id_entidad` (`id_entidad`,`id_usuario_apertura`,`id_usuario_cierre`,`id_banco`),
ADD KEY `id_usuario_apertura` (`id_usuario_apertura`),
ADD KEY `id_usuario_cierre` (`id_usuario_cierre`),
ADD KEY `id_banco` (`id_banco`);
--
-- Indexes for table `entidades`
--
ALTER TABLE `entidades`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `menues`
--
ALTER TABLE `menues`
ADD PRIMARY KEY (`id`),
ADD KEY `id_vista` (`id_vista`),
ADD KEY `id_usuario` (`id_usuario`);
--
-- Indexes for table `rubros`
--
ALTER TABLE `rubros`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rutas_proyecto`
--
ALTER TABLE `rutas_proyecto`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sesiones`
--
ALTER TABLE `sesiones`
ADD PRIMARY KEY (`id`),
ADD KEY `id_usuario` (`id_usuario`);
--
-- Indexes for table `tipo_movimientos`
--
ALTER TABLE `tipo_movimientos`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `transacciones`
--
ALTER TABLE `transacciones`
ADD PRIMARY KEY (`id`),
ADD KEY `id_ctacte` (`id_ctacte`,`id_categoria`,`id_tipo_movimiento`),
ADD KEY `id_categoria` (`id_categoria`),
ADD KEY `id_tipo_movimiento` (`id_tipo_movimiento`);
--
-- Indexes for table `usuarios`
--
ALTER TABLE `usuarios`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `vistas`
--
ALTER TABLE `vistas`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `bancos`
--
ALTER TABLE `bancos`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cuentas_bancarias`
--
ALTER TABLE `cuentas_bancarias`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `entidades`
--
ALTER TABLE `entidades`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `menues`
--
ALTER TABLE `menues`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rubros`
--
ALTER TABLE `rubros`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rutas_proyecto`
--
ALTER TABLE `rutas_proyecto`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `sesiones`
--
ALTER TABLE `sesiones`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;
--
-- AUTO_INCREMENT for table `tipo_movimientos`
--
ALTER TABLE `tipo_movimientos`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `transacciones`
--
ALTER TABLE `transacciones`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `usuarios`
--
ALTER TABLE `usuarios`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `vistas`
--
ALTER TABLE `vistas`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `cuentas_bancarias`
--
ALTER TABLE `cuentas_bancarias`
ADD CONSTRAINT `cuentas_bancarias_ibfk_1` FOREIGN KEY (`id_usuario_apertura`) REFERENCES `usuarios` (`id`),
ADD CONSTRAINT `cuentas_bancarias_ibfk_2` FOREIGN KEY (`id_usuario_cierre`) REFERENCES `usuarios` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cuentas_bancarias_ibfk_3` FOREIGN KEY (`id_banco`) REFERENCES `bancos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cuentas_bancarias_ibfk_4` FOREIGN KEY (`id_entidad`) REFERENCES `entidades` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `menues`
--
ALTER TABLE `menues`
ADD CONSTRAINT `menues_ibfk_1` FOREIGN KEY (`id_vista`) REFERENCES `vistas` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `menues_ibfk_2` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `sesiones`
--
ALTER TABLE `sesiones`
ADD CONSTRAINT `sesiones_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `transacciones`
--
ALTER TABLE `transacciones`
ADD CONSTRAINT `transacciones_ibfk_1` FOREIGN KEY (`id_ctacte`) REFERENCES `cuentas_bancarias` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `transacciones_ibfk_2` FOREIGN KEY (`id_categoria`) REFERENCES `rubros` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `transacciones_ibfk_3` FOREIGN KEY (`id_tipo_movimiento`) REFERENCES `tipo_movimientos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!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 */;
| 36.041096 | 370 | 0.685861 |
e11c25ac91f92e7de14cb9e63b3225a064d7a729 | 4,564 | asm | Assembly | platforms/m3/prc_v9/debug/test_sleep_wakeup_fail/test_sleep_wakeup_fail.asm | lab11/M-ulator | 95b49c6194678c74accca4a20af71380efbcac5f | [
"Apache-2.0",
"MIT"
] | 19 | 2015-01-26T10:47:23.000Z | 2021-08-13T11:07:54.000Z | platforms/m3/prc_v9/debug/test_sleep_wakeup_fail/test_sleep_wakeup_fail.asm | lab11/M-ulator | 95b49c6194678c74accca4a20af71380efbcac5f | [
"Apache-2.0",
"MIT"
] | 14 | 2015-08-24T02:35:46.000Z | 2021-05-05T03:53:44.000Z | platforms/m3/prc_v9/debug/test_sleep_wakeup_fail/test_sleep_wakeup_fail.asm | lab11/M-ulator | 95b49c6194678c74accca4a20af71380efbcac5f | [
"Apache-2.0",
"MIT"
] | 9 | 2015-05-27T23:27:35.000Z | 2020-10-05T22:02:43.000Z |
test_sleep_wakeup_fail/test_sleep_wakeup_fail.elf: file format elf32-littlearm
Disassembly of section .text:
00000000 <hang-0x70>:
0: 00000c00 .word 0x00000c00
4: 00000075 .word 0x00000075
...
1c: 00000070 .word 0x00000070
20: 00000070 .word 0x00000070
24: 00000070 .word 0x00000070
28: 00000070 .word 0x00000070
...
34: 00000070 .word 0x00000070
...
00000070 <hang>:
70: e7fe b.n 70 <hang>
...
00000074 <_start>:
74: f000 f842 bl fc <main>
78: e7fc b.n 74 <_start>
Disassembly of section .text.delay:
0000007a <delay>:
7a: b500 push {lr}
7c: 2300 movs r3, #0
7e: e001 b.n 84 <delay+0xa>
80: 46c0 nop ; (mov r8, r8)
82: 3301 adds r3, #1
84: 4283 cmp r3, r0
86: d1fb bne.n 80 <delay+0x6>
88: bd00 pop {pc}
Disassembly of section .text.set_wakeup_timer:
0000008c <set_wakeup_timer>:
8c: b500 push {lr}
8e: 2900 cmp r1, #0
90: d003 beq.n 9a <set_wakeup_timer+0xe>
92: 2380 movs r3, #128 ; 0x80
94: 021b lsls r3, r3, #8
96: 4318 orrs r0, r3
98: e001 b.n 9e <set_wakeup_timer+0x12>
9a: 0440 lsls r0, r0, #17
9c: 0c40 lsrs r0, r0, #17
9e: 4b04 ldr r3, [pc, #16] ; (b0 <set_wakeup_timer+0x24>)
a0: 6018 str r0, [r3, #0]
a2: 2a00 cmp r2, #0
a4: d002 beq.n ac <set_wakeup_timer+0x20>
a6: 4b03 ldr r3, [pc, #12] ; (b4 <set_wakeup_timer+0x28>)
a8: 2201 movs r2, #1
aa: 601a str r2, [r3, #0]
ac: bd00 pop {pc}
ae: 46c0 nop ; (mov r8, r8)
b0: a2000010 .word 0xa2000010
b4: a2000014 .word 0xa2000014
Disassembly of section .text.write_mbus_message:
000000b8 <write_mbus_message>:
b8: 23a0 movs r3, #160 ; 0xa0
ba: 061b lsls r3, r3, #24
bc: 6018 str r0, [r3, #0]
be: 4b02 ldr r3, [pc, #8] ; (c8 <write_mbus_message+0x10>)
c0: 2000 movs r0, #0
c2: 6019 str r1, [r3, #0]
c4: 4770 bx lr
c6: 46c0 nop ; (mov r8, r8)
c8: a0000004 .word 0xa0000004
Disassembly of section .text.enumerate:
000000cc <enumerate>:
cc: 2280 movs r2, #128 ; 0x80
ce: 0600 lsls r0, r0, #24
d0: 0592 lsls r2, r2, #22
d2: 23a0 movs r3, #160 ; 0xa0
d4: 4302 orrs r2, r0
d6: 061b lsls r3, r3, #24
d8: 2000 movs r0, #0
da: 6018 str r0, [r3, #0]
dc: 4b01 ldr r3, [pc, #4] ; (e4 <enumerate+0x18>)
de: 601a str r2, [r3, #0]
e0: 4770 bx lr
e2: 46c0 nop ; (mov r8, r8)
e4: a0000004 .word 0xa0000004
Disassembly of section .text.sleep:
000000e8 <sleep>:
e8: 23a0 movs r3, #160 ; 0xa0
ea: 2201 movs r2, #1
ec: 061b lsls r3, r3, #24
ee: 601a str r2, [r3, #0]
f0: 4b01 ldr r3, [pc, #4] ; (f8 <sleep+0x10>)
f2: 2000 movs r0, #0
f4: 6018 str r0, [r3, #0]
f6: 4770 bx lr
f8: a0000004 .word 0xa0000004
Disassembly of section .text.startup.main:
000000fc <main>:
fc: 4a17 ldr r2, [pc, #92] ; (15c <main+0x60>)
fe: b508 push {r3, lr}
100: 230f movs r3, #15
102: 6013 str r3, [r2, #0]
104: 4a16 ldr r2, [pc, #88] ; (160 <main+0x64>)
106: 2064 movs r0, #100 ; 0x64
108: 6013 str r3, [r2, #0]
10a: f7ff ffb6 bl 7a <delay>
10e: 21fa movs r1, #250 ; 0xfa
110: 20aa movs r0, #170 ; 0xaa
112: f7ff ffd1 bl b8 <write_mbus_message>
116: 2064 movs r0, #100 ; 0x64
118: f7ff ffaf bl 7a <delay>
11c: 2004 movs r0, #4
11e: f7ff ffd5 bl cc <enumerate>
122: 2064 movs r0, #100 ; 0x64
124: f7ff ffa9 bl 7a <delay>
128: 21fa movs r1, #250 ; 0xfa
12a: 20aa movs r0, #170 ; 0xaa
12c: f7ff ffc4 bl b8 <write_mbus_message>
130: 480c ldr r0, [pc, #48] ; (164 <main+0x68>)
132: f7ff ffa2 bl 7a <delay>
136: 21fa movs r1, #250 ; 0xfa
138: 20aa movs r0, #170 ; 0xaa
13a: f7ff ffbd bl b8 <write_mbus_message>
13e: 2200 movs r2, #0
140: 2002 movs r0, #2
142: 2101 movs r1, #1
144: f7ff ffa2 bl 8c <set_wakeup_timer>
148: 4b07 ldr r3, [pc, #28] ; (168 <main+0x6c>)
14a: 2201 movs r2, #1
14c: 601a str r2, [r3, #0]
14e: 2200 movs r2, #0
150: 2368 movs r3, #104 ; 0x68
152: 601a str r2, [r3, #0]
154: f7ff ffc8 bl e8 <sleep>
158: e7fe b.n 158 <main+0x5c>
15a: 46c0 nop ; (mov r8, r8)
15c: e000e280 .word 0xe000e280
160: e000e100 .word 0xe000e100
164: 00004e20 .word 0x00004e20
168: a2000014 .word 0xa2000014
| 30.225166 | 82 | 0.565732 |
5fad20d26c4dc2a7b64ffe22356e94f8c4de1551 | 282 | sql | SQL | scripts/db_setup.sql | webclinic017/WallStreetBots | f4f73539b080ce7667b52ee8195919ec4e7b79b8 | [
"MIT"
] | 4 | 2021-11-12T02:04:30.000Z | 2022-01-03T22:56:41.000Z | scripts/db_setup.sql | webclinic017/WallStreetBots | f4f73539b080ce7667b52ee8195919ec4e7b79b8 | [
"MIT"
] | 5 | 2021-11-11T20:48:34.000Z | 2022-03-12T18:08:40.000Z | scripts/db_setup.sql | webclinic017/WallStreetBots | f4f73539b080ce7667b52ee8195919ec4e7b79b8 | [
"MIT"
] | 2 | 2021-11-15T14:23:36.000Z | 2021-11-27T19:44:38.000Z | DROP DATABASE IF EXISTS wsbots_db;
CREATE DATABASE wsbots_db;
DO
$do$
BEGIN
IF NOT EXISTS (
SELECT FROM pg_catalog.pg_roles -- SELECT list can be empty for this
WHERE rolname = 'wsbots') THEN
CREATE ROLE wsbots LOGIN PASSWORD 'password';
END IF;
END
$do$; | 21.692308 | 75 | 0.695035 |
df79cf15b95c3cefca7e1eba2d9f608505e6d480 | 2,081 | swift | Swift | tests/bench/binarytrees.swift | JLimperg/lean4 | 24fe2875c68549b5481f07c57eab4ad4a0ae5305 | [
"Apache-2.0"
] | 1,538 | 2019-04-25T11:00:03.000Z | 2022-03-30T02:35:48.000Z | tests/bench/binarytrees.swift | JLimperg/lean4 | 24fe2875c68549b5481f07c57eab4ad4a0ae5305 | [
"Apache-2.0"
] | 812 | 2019-05-20T09:15:21.000Z | 2022-03-31T16:36:04.000Z | tests/bench/binarytrees.swift | JLimperg/lean4 | 24fe2875c68549b5481f07c57eab4ad4a0ae5305 | [
"Apache-2.0"
] | 168 | 2019-04-25T12:49:34.000Z | 2022-03-29T05:07:14.000Z | // The Computer Language Benchmark Game
// https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
//
// contributed by Ralph Ganszky
// *reset*
import Dispatch
import Foundation
class TreeNode {
var left, right: TreeNode?
init(left: TreeNode?, right: TreeNode?) {
self.left = left
self.right = right
}
func check() -> Int {
if left != nil {
return left!.check() + right!.check() + 1
} else {
return 1
}
}
}
func createTree(_ depth: Int) -> TreeNode? {
if depth > 0 {
let node = TreeNode(left: createTree(depth-1),
right: createTree(depth-1))
return node
} else {
let node = TreeNode(left: nil, right: nil)
return node
}
}
let n: Int
if CommandLine.argc > 1 {
n = Int(CommandLine.arguments[1]) ?? 10
} else {
n = 10
}
let minDepth = 4
let maxDepth = (n > minDepth + 2) ? n : minDepth + 2
// Create big tree in first pool
let tree = createTree(maxDepth+1)
let check = tree!.check()
print("stretch tree of depth \(maxDepth+1)\t check: \(check)")
// Cleal first pool and allocate long living tree
let longLivingTree = createTree(maxDepth)
// Allocate binary trees of increasing depth up to maxDepth depth
let group = DispatchGroup()
let rq = DispatchQueue(label: "Result", attributes: [])
let queue = DispatchQueue(label: "Worker", attributes: .concurrent)
var results = [String](repeating: "", count: (maxDepth-minDepth)/2+1)
for currentDepth in stride(from: minDepth, through: maxDepth, by: 2) {
queue.async(group: group) {
let idx = (currentDepth - minDepth) / 2
let iterations = 1 << (maxDepth - currentDepth + minDepth)
var totalChecksum = 0
for i in 1...iterations {
let tree1 = createTree(currentDepth)
totalChecksum += tree1!.check()
}
rq.async{
results[idx] = "\(iterations)\t trees of depth \(currentDepth)\t check: \(totalChecksum)"
}
}
}
group.wait()
rq.sync {
for result in results {
print(result)
}
}
// Check long living tree and print out check info
print("long lived tree of depth \(maxDepth)\t check: \(longLivingTree!.check())")
| 24.482353 | 94 | 0.662182 |
8773c0ed000c86595bf41877eb7f387e01bc6608 | 12,835 | html | HTML | resources/views/layout/_quickmenu.antlers.html | xhevatziberi/vilazana | d8b734c1be8b7b7ee5dce8e9608e9de5b322160a | [
"MIT"
] | null | null | null | resources/views/layout/_quickmenu.antlers.html | xhevatziberi/vilazana | d8b734c1be8b7b7ee5dce8e9608e9de5b322160a | [
"MIT"
] | null | null | null | resources/views/layout/_quickmenu.antlers.html | xhevatziberi/vilazana | d8b734c1be8b7b7ee5dce8e9608e9de5b322160a | [
"MIT"
] | null | null | null | {{#
@name Quickmenu
@desc The sites quickmenu rendered on each page.
#}}
<!-- /layout/_quickmenu.antlers.html -->
<nav id="quickMenu">
<div id="quickTop">
<a href="/{{ locale }}" class="url_manager" id="quickLogoHead">
<div class="logo_container s">
<!-- <svg xmlns="http://www.w3.org/2000/svg" width="140" height="61" viewBox="0 0 140 61">
<path fill="none" class="transform_all has_transition_2000_inout" id="s_cover" stroke="#FFFFFF" stroke-width="10"
d="M96.3515625,3.67236328 C85.7677409,1.66129557 79.6084798,5.39086914 77.8737793,14.861084 C75.2717285,29.0664062 87.3730469,33.3125 87.3730469,45.3925781 C87.3730469,57.4726563 80.4951172,58.4614258 69.0698242,54.5131836" />
</svg> -->
<svg xmlns="http://www.w3.org/2000/svg" width="140" height="107" viewBox="0 0 105 80.25">
<path class="home_logo" id="ss_cover" fill="black" stroke="black" stroke-width=".5"
d="m 25.250706,33.07521 c -0.837576,0.28993 -0.86979,0.46711 -0.161073,0.773147 0.306038,0.128858 0.64429,0.338252 0.757041,0.483217 0.306037,0.354359 0.128857,1.900653 -0.547645,5.073777 l -0.740934,3.463054 c -0.322144,1.578509 -1.127506,5.186528 -1.530187,6.845572 -0.515431,2.174476 -0.515431,2.657693 -0.01611,2.979837 0.418788,0.273824 0.902005,0.225501 1.868439,-0.193286 0.837575,-0.35436 2.255012,-1.224151 2.255012,-1.369115 0,-0.08054 -0.28993,-0.08054 -0.64429,-0.03221 -0.837575,0.128858 -1.288578,-0.225502 -1.288578,-1.014756 0,-0.676503 1.642938,-9.116691 2.834872,-14.593148 0.24161,-1.030863 0.370467,-2.061726 0.322145,-2.287227 -0.09664,-0.386573 -0.161072,-0.402681 -1.272472,-0.386573 -0.628181,0 -1.465757,0.11275 -1.836223,0.257715 z m -6.79725,1.240257 c -0.805363,0.451002 -1.030864,1.401329 -0.483217,2.09394 0.257716,0.322144 0.46711,0.418788 0.934218,0.418788 0.740934,0 1.272472,-0.499325 1.417437,-1.3369 0.06443,-0.46711 0.01611,-0.64429 -0.322144,-0.982541 -0.46711,-0.46711 -0.950327,-0.515432 -1.546294,-0.193287 z m -8.214686,6.394569 c -0.4671101,0.289931 -0.5154318,0.386574 -0.4348957,0.837576 0.2416087,1.288579 0.2899297,2.673801 0.096643,3.269768 -0.4026805,1.272471 -1.6751516,3.140909 -2.8831936,4.268415 -0.6442891,0.612075 -1.3046856,1.111399 -1.4657578,1.111399 -0.5154314,0 -0.6442892,-0.853683 -0.6442892,-4.075129 0,-2.706014 -0.032214,-3.173123 -0.3382518,-3.994592 -0.4187876,-1.127506 -0.8214684,-1.594616 -1.4013286,-1.594616 -0.8053614,0 -2.93151554,1.175828 -2.93151554,1.62683 0,0.06443 0.30603732,0.161072 0.67650357,0.225501 0.77314707,0.128858 1.32079287,0.64429 1.78790237,1.691259 0.2577157,0.595968 0.3382518,1.256364 0.4510025,3.785199 0.1127505,2.995944 0.2738229,4.139558 0.5959673,4.461702 0.096643,0.09664 0.4671096,0.161073 0.8375759,0.161073 0.8214686,-0.01611 1.8523313,-0.724827 3.1892311,-2.255013 1.1275059,-1.288578 2.0295108,-2.754336 3.4791625,-5.669744 1.272471,-2.577157 1.401328,-3.124802 0.902004,-3.752984 -0.418788,-0.531539 -1.127506,-0.57986 -1.91676,-0.09664 z m 6.79725,-0.09664 c -0.950327,0.28993 -2.142261,1.014756 -2.142261,1.288579 0,0.177179 0.193286,0.241608 0.644289,0.241608 0.966433,0 1.353006,0.451002 1.208042,1.417436 -0.193287,1.3369 -1.04697,4.671096 -1.642938,6.362355 -0.740931,2.158369 -0.789252,2.416084 -0.434894,2.770443 0.40268,0.402681 1.530187,0.24161 2.995944,-0.451003 1.610722,-0.740931 2.174475,-1.465758 0.885897,-1.111398 -0.434896,0.128857 -0.64429,0.11275 -0.902006,-0.08054 -0.563752,-0.386573 -0.467108,-1.095291 0.853684,-6.652284 0.918111,-3.914056 0.708718,-4.477809 -1.465757,-3.785199 z m 36.740587,0.03222 c -0.660397,0.322145 -1.191935,1.272471 -1.191935,2.126155 0,0.773147 0.225501,0.853683 0.918112,0.28993 0.789254,-0.64429 1.240257,-0.869791 1.948974,-0.998648 0.757041,-0.128858 3.253661,0.04832 3.575805,0.241608 0.46711,0.28993 -0.09664,1.063077 -2.802657,3.833521 l -3.527484,3.65634 c -0.789254,0.853683 -1.707365,2.399976 -1.530187,2.593265 0.06443,0.04832 0.902005,0.112749 1.852333,0.128857 1.191933,0.01611 2.399976,0.161071 3.817412,0.467109 2.126155,0.451002 2.78655,0.451002 3.688555,0 0.628182,-0.322145 1.079184,-1.127506 1.079184,-1.948974 0,-0.837577 -0.177178,-0.853684 -1.288578,-0.11275 l -0.837575,0.563744 H 57.41684 c -2.142261,0 -3.060373,-0.177179 -3.060373,-0.612075 0,-0.853683 1.111398,-2.255011 4.735524,-5.991888 1.159722,-1.191935 2.383871,-2.512728 2.722122,-2.931516 0.740933,-0.902005 0.740933,-1.353007 0.03221,-1.304686 -0.273823,0.03221 -1.030862,0.09664 -1.691259,0.144966 -0.853683,0.06443 -1.610722,0.01611 -2.480514,-0.161073 -1.578504,-0.322145 -3.237547,-0.322145 -3.897944,0.01611 z m -18.748814,0.386573 c -1.562401,0.773147 -3.157016,2.432192 -3.994591,4.171772 -0.805363,1.659045 -1.030864,2.593264 -1.014757,4.236201 0,2.190583 0.950327,3.285874 2.689907,3.108695 0.998648,-0.08054 1.707367,-0.434895 3.25366,-1.610723 1.175828,-0.86979 1.642938,-0.998648 1.642938,-0.40268 0,0.161072 0.11275,0.595967 0.257715,0.950327 0.434895,1.063076 1.04697,1.224148 2.432193,0.579859 0.80536,-0.386573 1.288577,-0.918112 1.09529,-1.224149 -0.04832,-0.09664 -0.386572,-0.161072 -0.724825,-0.161072 -0.499324,0 -0.692611,-0.08054 -0.902005,-0.402682 -0.338252,-0.515431 -0.209393,-1.353006 0.805362,-5.556992 0.451003,-1.787903 0.773147,-3.543591 0.69261,-3.752985 -0.03221,-0.128858 -0.483217,-0.193287 -1.3369,-0.209394 -0.69261,0 -1.85233,-0.06443 -2.561049,-0.128858 -1.240256,-0.11275 -1.3369,-0.09664 -2.335548,0.402681 z m 3.205338,0.547646 c 0.724826,0.370466 0.902005,1.014755 0.660397,2.38387 -0.595968,3.382518 -1.948975,5.863031 -3.849628,7.071073 -1.401328,0.885897 -2.754336,0.451003 -3.01205,-0.950327 -0.193287,-0.998648 0.03221,-3.285874 0.418787,-4.316737 0.467109,-1.224149 1.610722,-2.979837 2.303333,-3.511376 1.079185,-0.821468 2.625478,-1.127506 3.479161,-0.676503 z m 31.634596,-0.821469 c -0.885897,0.28993 -2.577156,1.497972 -3.414731,2.464406 -1.353009,1.530187 -2.271121,4.010701 -2.271121,6.152961 0,2.496621 1.191935,3.60802 3.334197,3.092589 0.531538,-0.128859 1.272471,-0.547647 2.303333,-1.320794 0.837577,-0.612074 1.57851,-1.095291 1.659046,-1.063077 0.08054,0.01611 0.289929,0.515432 0.483217,1.079185 0.289929,0.837576 0.434895,1.079183 0.789253,1.191934 0.821468,0.289931 2.78655,-0.612075 2.78655,-1.272471 0,-0.257715 -0.144964,-0.338252 -0.644288,-0.40268 -0.35436,-0.04832 -0.740934,-0.144965 -0.837577,-0.209395 -0.467109,-0.289929 -0.128857,-2.72212 0.902006,-6.636177 0.193287,-0.708718 0.386572,-1.707366 0.451002,-2.206691 l 0.09664,-0.934219 -1.353009,0.03222 c -0.740932,0.01611 -1.85233,-0.03222 -2.480513,-0.08054 -0.773147,-0.08054 -1.336899,-0.04832 -1.804009,0.112751 z m 2.883194,1.079184 c 0.483217,0.46711 0.499324,0.531539 0.40268,1.562402 -0.144964,1.771795 -1.127505,4.526131 -2.110046,5.895244 -0.885897,1.240258 -2.271119,2.190585 -3.205339,2.190585 -1.191935,0 -1.723473,-0.853684 -1.723473,-2.786551 0.01611,-1.546294 0.209394,-2.351655 0.982541,-3.914057 1.079185,-2.20669 2.657693,-3.446947 4.381167,-3.446947 0.660395,0 0.853682,0.08054 1.27247,0.499324 z m 13.836108,-0.805361 c -0.57986,0.28993 -1.546294,0.998648 -2.190582,1.62683 -0.644289,0.595968 -1.272472,1.095292 -1.417436,1.095292 -0.17718,0 -0.257715,-0.257716 -0.306037,-1.111399 -0.06443,-1.369115 -0.370467,-1.787903 -1.256364,-1.787903 -0.773147,0 -1.546295,0.676504 -1.691259,1.481865 -0.08054,0.46711 -0.01611,0.740933 0.402681,1.481866 0.46711,0.805361 0.515431,1.030862 0.434894,1.755688 -0.04832,0.467109 -0.354358,1.594615 -0.676502,2.528834 -0.64429,1.884545 -0.708718,3.124802 -0.193287,3.930164 0.306037,0.451003 1.111398,0.595967 1.353006,0.209393 0.06443,-0.09664 0.386574,-1.208041 0.708718,-2.448299 0.950327,-3.608018 1.320793,-4.574451 2.287226,-5.943566 0.660398,-0.902004 1.86844,-1.948975 2.432193,-2.09394 0.547645,-0.128858 1.15972,0.128858 1.497972,0.644289 0.483217,0.740933 0.354358,2.029511 -0.676505,6.748929 -0.289929,1.353006 -0.306036,2.85098 -0.04832,3.108694 0.306037,0.306038 1.111398,0.225503 2.029509,-0.209393 l 0.869791,-0.402681 -0.499324,-0.418788 c -0.612074,-0.515431 -0.628181,-0.75704 -0.09664,-3.140909 1.095291,-4.832168 1.22415,-5.814709 0.86979,-6.475106 -0.434896,-0.789254 -0.75704,-0.982541 -1.804009,-1.04697 -0.86979,-0.04832 -1.127506,0.01611 -2.029511,0.46711 z m 12.885783,-0.322145 c -1.288578,0.386574 -3.36641,2.09394 -4.236201,3.463055 -0.998648,1.546294 -1.578508,3.446947 -1.578508,5.089883 0,2.432192 1.095291,3.624127 3.028159,3.269768 0.821468,-0.144965 1.594616,-0.563752 3.028159,-1.62683 0.660389,-0.499324 1.256359,-0.86979 1.304679,-0.805361 0.0644,0.06443 0.25772,0.563752 0.4349,1.111398 0.27382,0.789255 0.41879,1.030862 0.77315,1.143613 0.82146,0.289931 2.73822,-0.595968 2.83487,-1.320792 0.0483,-0.306038 -0.0161,-0.354359 -0.56376,-0.354359 -1.41743,-0.01611 -1.51407,-0.628182 -0.70871,-4.107343 l 0.43489,-1.771795 c 0.37047,-1.433544 0.80536,-3.785199 0.72483,-3.914057 -0.0644,-0.112751 -0.64429,-0.161072 -1.38522,-0.144965 -0.70872,0 -1.78791,-0.03221 -2.41609,-0.09664 -0.6604,-0.06443 -1.353004,-0.03222 -1.675148,0.06443 z m 2.818758,1.127506 c 0.40269,0.370466 0.41879,0.451003 0.33826,1.594616 -0.27383,3.881842 -3.02816,8.053615 -5.315386,8.053615 -1.191935,0 -1.723473,-0.853684 -1.723473,-2.73823 0,-3.881841 2.722121,-7.55429 5.444239,-7.361003 0.61208,0.04832 0.95033,0.161072 1.25636,0.451002 z"/>
</svg>
<!-- <img src="/images/logo/logo_s.png" /> -->
</div>
<div class="logo_container vilazana"><img class="has_transition_2000" src="/images/logo/logo.png" /></div>
<div class="logo_container star _1"><img class="has_transition_1500" src="/images/logo/star.png" /></div>
<div class="logo_container star _2"><img class="has_transition_1500" src="/images/logo/star.png" /></div>
<div class="logo_container star _3"><img class="has_transition_1500" src="/images/logo/star.png" /></div>
<div class="logo_container star _4"><img class="has_transition_1500" src="/images/logo/star.png" /></div>
<div class="logo_container star _5"><img class="has_transition_1500" src="/images/logo/star.png" /></div>
</a>
<div id="quickLangs" class="double_break">
<ul>
{{ locales }}
<li class="no_overflow {{ if is_current }}active{{ /if }}">
<a rel="{{ locale:short }}" class="lang_button has_transition_1500" href="{{ permalink }}">{{ locale:name }}</a>
</li>
{{ if not last }}
<li class="lang_separator no_overflow"><span class="has_transition_1500">/</span></li>
{{ /if }}
{{ /locales }}
</ul>
</div>
</div>
<div id="quickButtons">
<ul>
<li class="overview no_overflow"><span class="has_transition_1500">{{ "OVERVIEW" | trans }}</span></li>
<li class="spacer has_transition_800_inout"></li>
{{ nav:left_menu }}
{{ if children }}
<li class="no_overflow has_submenu" rel="{{ title | slugify }}"><a class="has_transition_1500">{{ title }}</a></li>
{{ else }}
{{ if title == 'spacer' }}
<li class="spacer has_transition_800_inout"></li>
{{ else }}
<li class="no_overflow"><a class="url_manager has_transition_1500" href="{{ url }}">{{ title }}</a></li>
{{ /if }}
{{ /if }}
{{ /nav:left_menu }}
</ul>
</div>
<a id="bookingLogo" href="{{ links:booking_link }}" target="_blank">
<img class="has_transition_1500" src="/images/svg/bookingcom.svg" />
</a>
<div id="quickSocials">
<ul>
<!-- <li class="separator has_transition_1500"></li> -->
<li class="no_overflow">
<a href="{{ links:facebook_link }}" target="_blank" class="fb has_transition_1500"><img src="/images/small_fb.png" /></a>
</li>
<li class="separator has_transition_1500"></li>
<li class="no_overflow">
<a href="{{ links:instagram_link }}" target="_blank" class="in has_transition_1500"><img src="/images/small_insta.png" /></a>
</li>
<!-- <li class="separator has_transition_1500"></li> -->
</ul>
</div>
<div id="quickSubMenu" class="no_visibility">
<div id="quickSubmenuBackground" class="no_width has_transition_1000_quint"></div>
{{ nav:left_menu }}
{{ if children }}
<div class="panel hidden" rel="{{ title | slugify }}">
<div class="panelContent">
<div class="panelTitle has_transition_800_quint">{{ title }}</div>
<div class="panelList">
{{ children }}
<a class="url_manager has_transition_800_quint left_single" href="{{ url }}">{{ title }}</a>
{{ /children }}
</div>
<div class="panelBorder no_height has_transition_1500_inout"></div>
</div>
</div>
{{ /if }}
{{ /nav:left_menu }}
<div id="submenuClose" class="menuCloseContainer">
<div class="menuCloseLine _1 no_width has_transition_1000"></div>
<div class="menuCloseLine _2 no_height has_transition_1000"></div>
</div>
</div>
</nav>
<!-- End: /layout/_quickmenu.antlers.html -->
| 122.238095 | 8,393 | 0.69365 |
f544c80f4bc6b42b12abccd2d970bd2718af1c74 | 117 | kt | Kotlin | compiler/testData/lineNumber/enum.kt | VISTALL/consulo-kotlin | 6b565de6042440386e6d0302d14824353e926848 | [
"Apache-2.0"
] | 5 | 2015-08-01T10:35:57.000Z | 2021-02-11T16:25:41.000Z | compiler/testData/lineNumber/enum.kt | VISTALL/consulo-kotlin | 6b565de6042440386e6d0302d14824353e926848 | [
"Apache-2.0"
] | null | null | null | compiler/testData/lineNumber/enum.kt | VISTALL/consulo-kotlin | 6b565de6042440386e6d0302d14824353e926848 | [
"Apache-2.0"
] | 1 | 2017-04-21T06:19:05.000Z | 2017-04-21T06:19:05.000Z | enum class E {
E1
fun foo() = {
test.lineNumber()
}
val prop = test.lineNumber()
}
| 11.7 | 32 | 0.452991 |
85d151ac965e83552cd0c66150721b2b26f5e344 | 3,571 | js | JavaScript | .vscode-insiders/extensions/ms-toolsai.jupyter-2020.12.414227025/out/ipywidgets/libembed.js | Guitaraholic/dotfiles | 9c43707434a724a2e5c7799f917f84573e93e0ec | [
"MIT"
] | 1 | 2020-08-07T16:09:57.000Z | 2020-08-07T16:09:57.000Z | .vscode/extensions/ms-toolsai.jupyter-2020.12.414227025/out/ipywidgets/libembed.js | cclint/dotfiles | 8dbd1b768add3fdb68e749f965ef3025ee9de4ed | [
"MIT"
] | null | null | null | .vscode/extensions/ms-toolsai.jupyter-2020.12.414227025/out/ipywidgets/libembed.js | cclint/dotfiles | 8dbd1b768add3fdb68e749f965ef3025ee9de4ed | [
"MIT"
] | null | null | null | // Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// tslint:disable: no-var-requires no-require-imports no-any
// eslint-disable-next-line prefer-const
__webpack_public_path__ = window.__jupyter_widgets_assets_path__ || __webpack_public_path__;
import '@phosphor/widgets/style/index.css';
import 'font-awesome/css/font-awesome.css';
import '@jupyter-widgets/controls/css/widgets.css';
// Load json schema validator
const Ajv = require('ajv');
const widget_state_schema = require('@jupyter-widgets/schema').v2.state;
const widget_view_schema = require('@jupyter-widgets/schema').v2.view;
const ajv = new Ajv();
const model_validate = ajv.compile(widget_state_schema);
const view_validate = ajv.compile(widget_view_schema);
/**
* Render the inline widgets inside a DOM element.
*
* @param managerFactory A function that returns a new WidgetManager
* @param element (default document.documentElement) The document element in which to process for widget state.
*/
export async function renderWidgets(managerFactory, element = document.documentElement) {
const tags = element.querySelectorAll('script[type="application/vnd.jupyter.widget-state+json"]');
await Promise.all(Array.from(tags).map(async (t) => renderManager(element, JSON.parse(t.innerHTML), managerFactory)));
}
/**
* Create a widget manager for a given widget state.
*
* @param element The DOM element to search for widget view state script tags
* @param widgetState The widget manager state
* @param managerFactory The widget manager factory
*
* #### Notes
*
* Widget view state should be in script tags with type
* "application/vnd.jupyter.widget-view+json". Any such script tag containing a
* model id the manager knows about is replaced with a rendered view.
* Additionally, if the script tag has a prior img sibling with class
* 'jupyter-widget', then that img tag is deleted.
*/
async function renderManager(element, widgetState, managerFactory) {
const valid = model_validate(widgetState);
if (!valid) {
throw new Error(`Model state has errors: ${model_validate.errors}`);
}
const manager = managerFactory();
const models = await manager.set_state(widgetState);
const tags = element.querySelectorAll('script[type="application/vnd.jupyter.widget-view+json"]');
await Promise.all(Array.from(tags).map(async (viewtag) => {
const widgetViewObject = JSON.parse(viewtag.innerHTML);
const valid2 = view_validate(widgetViewObject);
if (!valid2) {
throw new Error(`View state has errors: ${view_validate.errors}`);
}
const model_id = widgetViewObject.model_id;
const model = models.find((item) => item.model_id === model_id);
if (model !== undefined && viewtag.parentElement !== null) {
const prev = viewtag.previousElementSibling;
if (prev && prev.tagName === 'img' && prev.classList.contains('jupyter-widget')) {
viewtag.parentElement.removeChild(prev);
}
const widgetTag = document.createElement('div');
widgetTag.className = 'widget-subarea';
viewtag.parentElement.insertBefore(widgetTag, viewtag);
const view = await manager.create_view(model, { node: widgetTag });
manager.display_view('display_view', view, {}).catch((x) => {
window.console.error(x);
});
}
}));
}
//# sourceMappingURL=libembed.js.map | 49.597222 | 123 | 0.690283 |
059dd311564d0651147a1e61ab8ba84d883146b5 | 2,760 | rb | Ruby | dsvedit/color_effects_editor_dialog.rb | Iemnur/DSVEdit | 1f52feb6de8a47c7d223a17d739e69bb40aedd3f | [
"MIT"
] | 70 | 2017-02-25T15:06:47.000Z | 2022-03-16T03:05:35.000Z | dsvedit/color_effects_editor_dialog.rb | Iemnur/DSVEdit | 1f52feb6de8a47c7d223a17d739e69bb40aedd3f | [
"MIT"
] | 58 | 2017-03-12T21:34:50.000Z | 2022-01-31T17:22:36.000Z | dsvedit/color_effects_editor_dialog.rb | Iemnur/DSVEdit | 1f52feb6de8a47c7d223a17d739e69bb40aedd3f | [
"MIT"
] | 26 | 2017-03-04T16:35:13.000Z | 2021-11-24T20:52:19.000Z |
require_relative 'ui_color_effects_editor'
class ColorEffectsEditorDialog < Qt::Dialog
slots "button_box_clicked(QAbstractButton*)"
def initialize(main_window, room, color_effects)
super(main_window, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
@ui = Ui_ColorEffectsEditor.new
@ui.setup_ui(self)
@game = main_window.game
@room = room
@color_effects = color_effects
connect(@ui.buttonBox, SIGNAL("clicked(QAbstractButton*)"), self, SLOT("button_box_clicked(QAbstractButton*)"))
read_color_effects()
self.show()
end
def read_color_effects
@ui.t1_hud.checked = (@color_effects & 0x0001)
@ui.t1_layer_0.checked = (@color_effects & 0x0002)
@ui.t1_layer_1.checked = (@color_effects & 0x0004)
@ui.t1_layer_2.checked = (@color_effects & 0x0008)
@ui.t1_entities.checked = (@color_effects & 0x0010)
@ui.t1_backdrop.checked = (@color_effects & 0x0020)
@ui.effect_type.setCurrentIndex((@color_effects & 0x00C0) >> 6)
@ui.t2_hud.checked = (@color_effects & 0x0100)
@ui.t2_layer_0.checked = (@color_effects & 0x0200)
@ui.t2_layer_1.checked = (@color_effects & 0x0400)
@ui.t2_layer_2.checked = (@color_effects & 0x0800)
@ui.t2_entities.checked = (@color_effects & 0x1000)
@ui.t2_backdrop.checked = (@color_effects & 0x2000)
end
def save_color_effects
@color_effects = 0x0000
@color_effects |= ((1 << 0) & 0x0001) if @ui.t1_hud.checked
@color_effects |= ((1 << 1) & 0x0002) if @ui.t1_layer_0.checked
@color_effects |= ((1 << 2) & 0x0004) if @ui.t1_layer_1.checked
@color_effects |= ((1 << 3) & 0x0008) if @ui.t1_layer_2.checked
@color_effects |= ((1 << 4) & 0x0010) if @ui.t1_entities.checked
@color_effects |= ((1 << 5) & 0x0020) if @ui.t1_backdrop.checked
@color_effects |= ((@ui.effect_type.currentIndex << 6) & 0x00C0)
@color_effects |= ((1 << 8) & 0x0100) if @ui.t2_hud.checked
@color_effects |= ((1 << 9) & 0x0200) if @ui.t2_layer_0.checked
@color_effects |= ((1 << 10) & 0x0400) if @ui.t2_layer_1.checked
@color_effects |= ((1 << 11) & 0x0800) if @ui.t2_layer_2.checked
@color_effects |= ((1 << 12) & 0x1000) if @ui.t2_entities.checked
@color_effects |= ((1 << 13) & 0x2000) if @ui.t2_backdrop.checked
parent.set_color_effects(@color_effects)
end
def button_box_clicked(button)
if @ui.buttonBox.standardButton(button) == Qt::DialogButtonBox::Ok
save_color_effects()
self.close()
elsif @ui.buttonBox.standardButton(button) == Qt::DialogButtonBox::Cancel
self.close()
elsif @ui.buttonBox.standardButton(button) == Qt::DialogButtonBox::Apply
save_color_effects()
end
end
end
| 37.297297 | 115 | 0.663043 |
56dcd00f977b341663107aa0a48ee5bbdca85ee2 | 302 | go | Go | example/main.go | goroute/recover | 4ed9208c2a46ff4d289c48174af0126a9806bdc6 | [
"MIT"
] | null | null | null | example/main.go | goroute/recover | 4ed9208c2a46ff4d289c48174af0126a9806bdc6 | [
"MIT"
] | null | null | null | example/main.go | goroute/recover | 4ed9208c2a46ff4d289c48174af0126a9806bdc6 | [
"MIT"
] | null | null | null | package main
import (
"log"
"net/http"
"github.com/goroute/recover"
"github.com/goroute/route"
)
func main() {
mux := route.NewServeMux()
mux.Debug = true
mux.Use(recover.New())
mux.GET("/", func(c route.Context) error {
panic("ups")
})
log.Fatal(http.ListenAndServe(":9000", mux))
}
| 13.130435 | 45 | 0.645695 |
5110cde88a97deded32066d9a9f8a4531bd98028 | 680 | h | C | MinispanTree/MinispanTree/Graph/GraphType.h | DearlingZou8789/BaseDataStrue | c4b3673b50241aea7c1808aa5ccf16c170a84fe8 | [
"Unlicense"
] | null | null | null | MinispanTree/MinispanTree/Graph/GraphType.h | DearlingZou8789/BaseDataStrue | c4b3673b50241aea7c1808aa5ccf16c170a84fe8 | [
"Unlicense"
] | null | null | null | MinispanTree/MinispanTree/Graph/GraphType.h | DearlingZou8789/BaseDataStrue | c4b3673b50241aea7c1808aa5ccf16c170a84fe8 | [
"Unlicense"
] | null | null | null | //
// GraphType.h
// MinispanTree
//
// Created by qianfeng on 15/3/25.
// Copyright (c) 2015年 qianfeng. All rights reserved.
//
//保存图结构的基本数据类型及最大数组数
#ifndef GRAPHTYPE_H
#define GRAPHTYPE_H
#ifndef MAXVEX
#define MAXVEX 100 /*定义最大顶点树为100*/
#endif
#ifndef MAXEDGE
#define MAXEDGE ((MAXVEX)*(MAXVEX))
#endif
#ifndef INFINITY
#define INFINITY 65536 /*用65535来代表∞*/
#endif
#ifndef TRUE
#define TRUE 1 //定义true为真
#endif
#ifndef FALSE
#define FALSE 0 //定义false为假
#endif
typedef char VertexType; /*顶点类型应由用户定义*/
typedef int EdgeType; /*边上的权值类型应由用户定义*/
typedef int Boolean; //Boolean是布尔类型,其值是TRUE活FALSE;
Boolean visited[MAXVEX]; //访问标志的数组
#endif | 16.585366 | 57 | 0.702941 |
7ffe858bcdde00a7c9fd1467c60dca15f1715ac3 | 17,202 | go | Go | internal/schemaparser/custom_graphql_fields.go | sophiebits/ent | e6af06c25c879279c62bc4e2aca27d8ef8ca304b | [
"MIT"
] | null | null | null | internal/schemaparser/custom_graphql_fields.go | sophiebits/ent | e6af06c25c879279c62bc4e2aca27d8ef8ca304b | [
"MIT"
] | null | null | null | internal/schemaparser/custom_graphql_fields.go | sophiebits/ent | e6af06c25c879279c62bc4e2aca27d8ef8ca304b | [
"MIT"
] | null | null | null | package schemaparser
import (
"errors"
"fmt"
"go/ast"
"go/types"
"strings"
"sync"
"github.com/iancoleman/strcase"
"github.com/lolopinto/ent/internal/astparser"
"github.com/lolopinto/ent/internal/enttype"
"github.com/lolopinto/ent/internal/util"
"golang.org/x/tools/go/packages"
)
// Function represents a function that's parsed and needs to be represented in GraphQL
type Function struct {
// e.g. User/Contact etc
NodeName string
// GraphQLName is the name of the Field in GraphQL
GraphQLName string
// FunctionName is the function that should be called in codegen. It includes the package if not in the "graphql"
FunctionName string
// Args are the arguments to the function
Args []*Field
// Results shows the list of return values of the function.
Results []*Field
// PackagePath is the package path as used by the go/types package.
PackagePath string
// CommentGroup return the comments associated with this function
CommentGroup *GraphQLCommentGroup
}
// Field represents an item in an argument list or return list for a function
type Field struct {
// Name of the field in argument or return list
Name string
Type enttype.Type
goType types.Type
}
// FunctionMap is a Map of GraphQL Type to list of Functions that need to be added to GQL
type FunctionMap map[string][]*Function
// ParseCustomGQLResult is the result object of parsing the code path given
type ParseCustomGQLResult struct {
Functions FunctionMap
Error error
Objects []*Object
}
type Object struct {
Name string
GraphQLName string
PackagePath string
Fields []*Field
}
// this is used to make concurrent changes to the map
// TODO rename this...
type parsedList struct {
m sync.RWMutex
fns FunctionMap
objs []*Object
}
func (l *parsedList) addFunction(fn *Function) {
l.m.Lock()
defer l.m.Unlock()
if l.fns == nil {
l.fns = make(FunctionMap)
}
l.fns[fn.NodeName] = append(l.fns[fn.NodeName], fn)
}
func (l *parsedList) addObject(obj *Object) {
l.m.Lock()
defer l.m.Unlock()
l.objs = append(l.objs, obj)
}
// CustomCodeParser is used to configure the parsing process
type CustomCodeParser interface {
// ReceiverRequired validates if the receiver of a function is required or not
// e.g. can the function be a standalone function or does it have to be a method?
// To further process if the method is of a valid struct, see CustomCodeParserWithReceiver
// where we can evaluate to see that only methods of acceptable structs are parsed
// A return value of true indicates it's a method and not a function
ReceiverRequired() bool
// ProcessFileName is used to indicate if the filename should be evaluated.
// eg.. don't process these generated files since there wouldn't be any custom functions there
// A return value of true indicates the file will be processed
ProcessFileName(string) bool
// TODO document
CreatesComplexTypeForSingleResult() bool
}
// CustomCodeParserWithReceiver is for extra validation of the method
// see CustomCodeParser.ReceiverRequired
type CustomCodeParserWithReceiver interface {
CustomCodeParser
ValidateFnReceiver(name string) error
}
// ParseCustomGraphQLDefinitions takes a file Parser and a custom code Parser and returns
// a channel to the result
func ParseCustomGraphQLDefinitions(parser Parser, codeParser CustomCodeParser) chan ParseCustomGQLResult {
result := make(chan ParseCustomGQLResult)
go parseCustomGQL(parser, codeParser, result)
return result
}
func parseCustomGQL(parser Parser, codeParser CustomCodeParser, out chan ParseCustomGQLResult) {
pkgs := LoadPackagesX(parser)
l := &parsedList{}
var wg sync.WaitGroup
var errr error
for idx := range pkgs {
idx := idx
pkg := pkgs[idx]
for idx := range pkg.CompiledGoFiles {
idx := idx
filename := pkg.CompiledGoFiles[idx]
if !codeParser.ProcessFileName(filename) {
continue
}
wg.Add(1)
go func() {
defer wg.Done()
err := checkForCustom(parser, filename, pkg, pkg.Syntax[idx], codeParser, l)
if err != nil {
errr = err
}
}()
}
}
wg.Wait()
var result ParseCustomGQLResult
if errr != nil {
result.Error = errr
} else {
result.Functions = l.fns
result.Objects = l.objs
}
out <- result
}
func checkForCustom(
parser Parser,
filename string,
pkg *packages.Package,
file *ast.File,
codeParser CustomCodeParser,
l *parsedList,
) error {
var graphqlComments []*ast.CommentGroup
for _, cg := range file.Comments {
if doc := graphQLDoc(cg); doc != nil {
graphqlComments = append(graphqlComments, cg)
}
}
if len(graphqlComments) == 0 {
return nil
}
var inspectErr error
ast.Inspect(file, func(node ast.Node) bool {
// this gets custom types. logic for getting custom functions in those types is the same
// This gets struct, and public/exported fields
// For now, we only go find things in the "current" package path
// so graphql/* and models/
// Eventually, need to support traversing the import path and finding new structs as we see them
if t, ok := node.(*ast.TypeSpec); ok && t.Type != nil {
s, ok := t.Type.(*ast.StructType)
if ok {
inspectStruct(l, t, s, graphqlComments, pkg)
}
}
if fn, ok := node.(*ast.FuncDecl); ok {
if err := inspectFunc(
fn, parser, pkg, file, codeParser, l, graphqlComments,
); err != nil {
inspectErr = err
}
}
return true
})
return inspectErr
}
func inspectStruct(
l *parsedList,
t *ast.TypeSpec,
s *ast.StructType,
graphqlComments []*ast.CommentGroup,
pkg *packages.Package,
) {
if cg := commentAssociatedWithType(graphqlComments, t); cg != nil {
doc := graphQLDoc(cg)
if doc == nil {
panic("should not get here")
}
obj := &Object{
Name: t.Name.Name,
GraphQLName: doc.GetGraphQLType(),
PackagePath: pkg.PkgPath,
}
for _, f := range s.Fields.List {
fieldName := f.Names[0]
if !fieldName.IsExported() {
continue
}
// not a graphql comment bye
doc := graphQLDoc(f.Doc)
if doc == nil {
continue
}
field := &Field{
Name: strcase.ToLowerCamel(f.Names[0].Name),
}
val := doc.customValueFromLine()
// get overriden name if there's one
if val.name != "" {
field.Name = val.name
}
// set type
field.goType = pkg.TypesInfo.TypeOf(f.Type)
field.Type = enttype.GetNonNullableType(field.goType, val.forceRequired)
obj.Fields = append(obj.Fields, field)
}
l.addObject(obj)
}
}
func inspectFunc(
fn *ast.FuncDecl,
parser Parser,
pkg *packages.Package,
file *ast.File,
codeParser CustomCodeParser,
l *parsedList,
graphqlComments []*ast.CommentGroup,
) error {
graphqlNode := ""
validateFnParser, ok := codeParser.(CustomCodeParserWithReceiver)
if fn.Recv != nil {
for _, field := range fn.Recv.List {
info, err := astparser.ParseFieldType(field)
if err != nil {
return err
}
graphqlNode = info.IdentName
// TODO validate that this is not allowed if the type isn't valid...
if ok {
if err := validateFnParser.ValidateFnReceiver(info.IdentName); err != nil {
return err
}
}
break
}
}
// TODO this shouldn't be here. should be in CustomCodeParser
expectedFnNames := map[string]bool{
"GetPrivacyPolicy": true,
}
// hmm GetPrivacyPolicy and other overriden methods here
// where should this logic be?
if expectedFnNames[fn.Name.Name] {
return nil
}
if cg := commentAssociatedWithFn(graphqlComments, fn); cg != nil {
// fn is not a method and this is required return an error
// TODO this is conflating multiple things as of right now.
// Let's see how this changes and if we can come up with a generic term for this
if codeParser.ReceiverRequired() {
if fn.Recv == nil {
return fmt.Errorf("graphql function %s is not on a valid receiver", fn.Name.Name)
}
if !fn.Name.IsExported() {
return fmt.Errorf("graphql function %s is not exported", fn.Name.Name)
}
}
if err := addFunction(parser, codeParser, fn, pkg, cg, l, graphqlNode); err != nil {
return err
}
}
return nil
}
func addFunction(
parser Parser,
codeParser CustomCodeParser,
fn *ast.FuncDecl,
pkg *packages.Package,
cg *ast.CommentGroup,
l *parsedList,
graphqlNode string,
) error {
fnName := fn.Name.Name
doc := graphQLDoc(cg)
parsedFn := &Function{
NodeName: graphqlNode,
FunctionName: fnName,
// remove Get prefix if it exists
GraphQLName: strcase.ToLowerCamel(strings.TrimPrefix(fnName, "Get")),
CommentGroup: doc,
}
parsedFn.PackagePath = pkg.PkgPath
if err := modifyFunctionFromDoc(doc, parsedFn); err != nil {
return err
}
results := fn.Type.Results
if results != nil {
returnValues, err := doc.returnValues()
if err != nil {
return err
}
c := &configureResults{
returnValues: returnValues,
codeParser: codeParser,
}
fields, err := getFields(pkg, results.List, c)
if err != nil {
return err
}
parsedFn.Results = fields
}
fieldOverrides, err := doc.fieldOverrides()
if err != nil {
return err
}
fields, err := getFields(pkg, fn.Type.Params.List, &configureArgs{fieldOverrides: fieldOverrides})
if err != nil {
return err
}
parsedFn.Args = fields
l.addFunction(parsedFn)
return nil
}
type configureFields interface {
nameRequired() bool
fieldOverride(name string) string
}
type configureFieldsWithReturnValues interface {
fieldValues() []*customReturnValue
}
type configureArgs struct {
fieldOverrides map[string]string
}
func (c *configureArgs) nameRequired() bool {
return true
}
func (c *configureArgs) fieldOverride(name string) string {
return c.fieldOverrides[name]
}
type configureResults struct {
returnValues []*customReturnValue
codeParser CustomCodeParser
}
func (c *configureResults) fieldOverride(name string) string {
return ""
}
func (c *configureResults) nameRequired() bool {
// name required if we're creating a complex type for the return value e.g. an ent object that returns one item, don't need this
// if we're creating a complex type, e.g. an ent function that returns multiple items or a top level custom function, we need a name
return c.codeParser.CreatesComplexTypeForSingleResult()
}
func (c *configureResults) fieldValues() []*customReturnValue {
return c.returnValues
}
func fieldName(c configureFields, name string) string {
if c == nil {
return name
}
if n := c.fieldOverride(name); n != "" {
return n
}
return name
}
// returns a function that gets the next field name
func getNextCustomField(c configureFields) func() (*customReturnValue, error) {
cWithValues, ok := c.(configureFieldsWithReturnValues)
if !ok {
return nil
}
values := cWithValues.fieldValues()
if len(values) == 0 {
return nil
}
var i int
return func() (*customReturnValue, error) {
if i == len(values) {
return nil, errors.New("not enough @graphqlreturn names specified")
}
i++
return values[i-1], nil
}
}
func getFields(pkg *packages.Package, list []*ast.Field, c configureFields) ([]*Field, error) {
var fields []*Field
nextField := getNextCustomField(c)
for idx, item := range list {
paramType := pkg.TypesInfo.TypeOf(item.Type)
if len(item.Names) == 0 {
entType := enttype.GetType(paramType)
f := &Field{Type: entType, goType: paramType}
var name string
var expectedErrorType bool
if idx+1 == len(list) && enttype.IsErrorType(entType) {
expectedErrorType = true
}
// first see if we have a @graphqlreturn name (expected in the right order)
// don't do for last item since we don't send it to GraphQL and it shouldn't be exepcted to be there
if nextField != nil && !expectedErrorType {
val, err := nextField()
if err != nil {
return nil, err
}
name = val.name
if val.forceRequired {
f.Type = enttype.GetNonNullableType(paramType, val.forceRequired)
}
}
// then check default names
if name == "" {
defaultTyp, ok := entType.(enttype.DefaulFieldNameType)
if ok {
name = defaultTyp.DefaultGraphQLFieldName()
}
}
// only field with no name allowed is error type when last item in list
if name == "" && c.nameRequired() && !expectedErrorType {
return nil, fmt.Errorf("found field %T with no name", entType)
}
// append fields
f.Name = fieldName(c, name)
fields = append(fields, f)
} else {
if nextField != nil {
return nil, errors.New("cannot use both named return types and graphql comments")
}
// same type, we need to break this up as different fields if there's more than one
for _, name := range item.Names {
fields = append(fields, &Field{
Name: fieldName(c, name.Name),
Type: enttype.GetType(paramType),
goType: paramType,
})
}
}
}
return fields, nil
}
type GraphQLCommentGroup struct {
cg *ast.CommentGroup
lines []string
line string // line that the graphql comment is on
}
func (doc *GraphQLCommentGroup) GetGraphQLType() string {
parts := strings.Split(doc.line, " ")
if len(parts) != 2 {
return ""
}
if parts[0] != "@graphqltype" {
return ""
}
return parts[1]
}
// parseLines takes a prefix and a function that's called with line that matches prefix and lines separated by space
// function should returns a boolean to indicate if we should continue looking for more
func (doc *GraphQLCommentGroup) parseLines(prefix string, fn func(string, []string) (bool, error)) error {
var errs []error
for _, line := range doc.lines {
if strings.HasPrefix(line, prefix) {
parts := strings.Split(line, " ")
ret, err := fn(line, parts)
if err != nil {
errs = append(errs, err)
}
if !ret {
break
}
}
}
return util.CoalesceErr(errs...)
}
func (doc *GraphQLCommentGroup) DisableGraphQLInputType() bool {
var ret bool
doc.parseLines("@graphqlinputtype", func(line string, parts []string) (bool, error) {
// disable input type if line is "@graphqlinputtype false"
if len(parts) == 2 && parts[1] == "false" {
ret = true
}
// assume there's only one line ¯\_(ツ)_/¯
return false, nil
})
return ret
}
func (doc *GraphQLCommentGroup) fieldOverrides() (map[string]string, error) {
m := make(map[string]string)
err := doc.parseLines("@graphqlparam", func(line string, parts []string) (bool, error) {
var err error
if len(parts) != 3 {
err = fmt.Errorf("invalid @graphqlparam line %s", line)
} else {
m[parts[1]] = parts[2]
}
// we want all of them!
return true, err
})
if err != nil {
return nil, err
}
return m, nil
}
func (doc *GraphQLCommentGroup) customValueFromLine() *customReturnValue {
parts := strings.Split(doc.line, " ")
ret := &customReturnValue{}
if len(parts) == 1 {
return ret
}
for _, part := range parts {
if part == "@required" {
ret.forceRequired = true
break
}
}
// @graphql name @required
if (ret.forceRequired && len(parts) > 2) ||
// @graphql name
(!ret.forceRequired && len(parts) == 2) {
ret.name = parts[1]
}
return ret
}
type customReturnValue struct {
name string
forceRequired bool
}
func (doc *GraphQLCommentGroup) returnValues() ([]*customReturnValue, error) {
var results []*customReturnValue
err := doc.parseLines("@graphqlreturn", func(line string, parts []string) (bool, error) {
var err error
if len(parts) < 2 {
err = fmt.Errorf("invalid @graphqlreturn line %s", line)
} else {
val := &customReturnValue{
name: parts[1],
}
if len(parts) == 3 && parts[2] == "@required" {
val.forceRequired = true
}
results = append(results, val)
}
return true, err
})
if err != nil {
return nil, err
}
return results, nil
}
func graphQLDoc(cg *ast.CommentGroup) *GraphQLCommentGroup {
splits := strings.Split(cg.Text(), "\n")
for _, s := range splits {
if strings.HasPrefix(s, "@graphql") {
return &GraphQLCommentGroup{
cg: cg,
lines: splits,
line: s,
}
}
}
return nil
}
func commentAssociatedWithFn(graphqlComments []*ast.CommentGroup, fn *ast.FuncDecl) *ast.CommentGroup {
// allow one blank line there
// this is not the most efficient since we're doing a for loop
// TODO: optimize this and go through each comment one at a time?
// Decls not guaranteed to be sorted so we should sort both and go through each in order...
for _, cg := range graphqlComments {
diff := cg.End() + 2 - fn.Pos()
if diff >= 0 && diff <= 1 {
return cg
}
}
return nil
}
func commentAssociatedWithType(graphqlComments []*ast.CommentGroup, t *ast.TypeSpec) *ast.CommentGroup {
// TODO same issues as commentAssociatedWithFn
// TODO these comment issues may be why I need dst again.
for _, cg := range graphqlComments {
if cg.End()+6 == t.Pos() {
return cg
}
}
return nil
}
func modifyFunctionFromDoc(doc *GraphQLCommentGroup, fn *Function) error {
parts := strings.Split(doc.line, " ")
if len(parts) == 1 {
// nothing to do here
return nil
}
// override the name we should use
fn.GraphQLName = strcase.ToLowerCamel(parts[1])
if len(parts) > 2 {
if parts[2] != "Query" && parts[2] != "Mutation" {
return fmt.Errorf("invalid query/Mutation syntax %s", parts[2])
}
fn.NodeName = parts[2]
} else if fn.NodeName == "" {
// default to Query over mutation
fn.NodeName = "Query"
}
return nil
}
| 24.966618 | 133 | 0.687304 |
3d77d171acebf871915c4c2548b80b9979f505ac | 1,335 | rs | Rust | src/test/compile-fail/issue-23729.rs | aepsil0n/rust | 8025bc964c0f31726636811d97f9f46cd0d4c40f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2015-07-29T08:36:14.000Z | 2017-06-27T19:42:04.000Z | src/test/compile-fail/issue-23729.rs | aepsil0n/rust | 8025bc964c0f31726636811d97f9f46cd0d4c40f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2015-07-29T13:36:15.000Z | 2022-01-29T07:27:02.000Z | src/test/compile-fail/issue-23729.rs | aepsil0n/rust | 8025bc964c0f31726636811d97f9f46cd0d4c40f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-06-07T14:39:17.000Z | 2019-10-29T19:32:20.000Z | // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Regression test for #23729
fn main() {
let fib = {
struct Recurrence {
mem: [u64; 2],
pos: usize,
}
impl Iterator for Recurrence {
//~^ ERROR not all trait items implemented, missing: `Item` [E0046]
#[inline]
fn next(&mut self) -> Option<u64> {
if self.pos < 2 {
let next_val = self.mem[self.pos];
self.pos += 1;
Some(next_val)
} else {
let next_val = (self.mem[0] + self.mem[1]);
self.mem[0] = self.mem[1];
self.mem[1] = next_val;
Some(next_val)
}
}
}
Recurrence { mem: [0, 1], pos: 0 }
};
for e in fib.take(10) {
println!("{}", e)
}
}
| 30.340909 | 79 | 0.513858 |
2842e5c359f574063926ed31c4c6c69e69ef5986 | 2,891 | go | Go | rest/response.go | admpub/restful | 2e8d62d39607fea9957fd096a245c85e8bedc80c | [
"MIT"
] | 110 | 2017-06-28T20:21:30.000Z | 2022-03-21T00:53:56.000Z | rest/response.go | admpub/restful | 2e8d62d39607fea9957fd096a245c85e8bedc80c | [
"MIT"
] | 4 | 2019-11-23T18:25:26.000Z | 2022-02-27T21:08:11.000Z | rest/response.go | admpub/restful | 2e8d62d39607fea9957fd096a245c85e8bedc80c | [
"MIT"
] | 43 | 2017-06-13T17:14:47.000Z | 2022-02-10T01:07:40.000Z | package rest
import (
"container/list"
"encoding/json"
"encoding/xml"
"errors"
"net/http"
"net/http/httputil"
"strings"
"sync/atomic"
"time"
"unsafe"
)
// Response ...
type Response struct {
*http.Response
Err error
byteBody []byte
listElement *list.Element
skipListElement *skipListNode
ttl *time.Time
lastModified *time.Time
etag string
revalidate bool
cacheHit atomic.Value
}
func (r *Response) size() int64 {
size := int64(unsafe.Sizeof(*r))
size += int64(len(r.byteBody))
size += int64(unsafe.Sizeof(*r.listElement))
size += int64(unsafe.Sizeof(*r.skipListElement))
size += int64(unsafe.Sizeof(*r.ttl))
size += int64(unsafe.Sizeof(*r.lastModified))
size += int64(len(r.etag))
size += int64(len(r.Response.Proto))
size += int64(len(r.Response.Status))
/*r.Response.Header
r.Response.TLS
r.Response.Trailer
r.Response.TransferEncoding
r.Response.Request.Header
r.Response.Request.Host
r.Response.Request.Method
r.Response.Request.Proto
r.Response.Request.RemoteAddr
r.Response.Request.RequestURI
*/
return size
}
// String return the Respnse Body as a String.
func (r *Response) String() string {
return string(r.Bytes())
}
// Bytes return the Response Body as bytes.
func (r *Response) Bytes() []byte {
return r.byteBody
}
// FillUp set the *fill* parameter with the corresponding JSON or XML response.
// fill could be `struct` or `map[string]interface{}`
func (r *Response) FillUp(fill interface{}) error {
ctypeJSON := "application/json"
ctypeXML := "application/xml"
ctype := strings.ToLower(r.Header.Get("Content-Type"))
for i := 0; i < 2; i++ {
switch {
case strings.Contains(ctype, ctypeJSON):
return json.Unmarshal(r.byteBody, fill)
case strings.Contains(ctype, ctypeXML):
return xml.Unmarshal(r.byteBody, fill)
case i == 0:
ctype = http.DetectContentType(r.byteBody)
}
}
return errors.New("Response format neither JSON nor XML")
}
// CacheHit shows if a response was get from the cache.
func (r *Response) CacheHit() bool {
if hit, ok := r.cacheHit.Load().(bool); hit && ok {
return true
}
return false
}
// Debug let any request/response to be dumped, showing how the request/response
// went through the wire, only if debug mode is *on* on RequestBuilder.
func (r *Response) Debug() string {
var strReq, strResp string
if req, err := httputil.DumpRequest(r.Request, true); err != nil {
strReq = err.Error()
} else {
strReq = string(req)
}
if resp, err := httputil.DumpResponse(r.Response, false); err != nil {
strResp = err.Error()
} else {
strResp = string(resp)
}
const separator = "--------\n"
dump := separator
dump += "REQUEST\n"
dump += separator
dump += strReq
dump += "\n" + separator
dump += "RESPONSE\n"
dump += separator
dump += strResp
dump += r.String() + "\n"
return dump
}
| 21.10219 | 80 | 0.673123 |
ccf876bfc844e87a77222a22dbdbc8113001c7e7 | 396 | asm | Assembly | Chapter_6/Program 6.1/x86_64/Program_6.1_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 272 | 2016-12-28T02:24:21.000Z | 2022-03-30T21:05:37.000Z | Chapter_6/Program 6.1/x86_64/Program_6.1_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 1 | 2018-04-17T19:47:52.000Z | 2018-04-17T19:47:52.000Z | Chapter_6/Program 6.1/x86_64/Program_6.1_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 62 | 2017-02-02T14:39:37.000Z | 2022-01-04T09:02:07.000Z | ; Program 6.1
; Sum Program - NASM (64-bit)
; Copyright (c) 2020 Hall & Slonka
section .data
num1: dd 2
num2: dd 4
section .text
global _main, _sum
_main:
mov rax, 10
dec rax
mov rbx, 5
movsx rdi, DWORD [rel num1]
movsx rsi, DWORD [rel num2]
call _sum
add rax, rbx
dec rax
mov rax, 60
xor rdi, rdi
syscall
_sum:
push rbp
mov rbp, rsp
push rbx
mov rax, rdi
add rax, rsi
pop rbx
pop rbp
ret
| 10.702703 | 34 | 0.69697 |
dd6cac6b42e0182192812e383687e6e6eb32f105 | 3,246 | php | PHP | application/libraries/zendframework/zend-stdlib/vendor/athletic/athletic/tests/Athletic/Runners/ClassRunnerTest.php | SouthwaresSolutions/Jje | 8e8a8993c27e932d26015bbe7e58330c20f79056 | [
"MIT"
] | null | null | null | application/libraries/zendframework/zend-stdlib/vendor/athletic/athletic/tests/Athletic/Runners/ClassRunnerTest.php | SouthwaresSolutions/Jje | 8e8a8993c27e932d26015bbe7e58330c20f79056 | [
"MIT"
] | null | null | null | application/libraries/zendframework/zend-stdlib/vendor/athletic/athletic/tests/Athletic/Runners/ClassRunnerTest.php | SouthwaresSolutions/Jje | 8e8a8993c27e932d26015bbe7e58330c20f79056 | [
"MIT"
] | null | null | null | <?php
/**
* User: zach
* Date: 6/22/13
* Time: 8:25 PM
*/
namespace Athletic\Tests\Runners;
use Athletic\Runners\ClassRunner;
use Mockery as m;
use org\bovigo\vfs\vfsStream;
use PHPUnit_Framework_TestCase;
use ReflectionException;
class ClassRunnerTest extends PHPUnit_Framework_TestCase
{
private $root;
public function setUp()
{
$this->root = vfsStream::setup('root');
}
public function tearDown()
{
m::close();
}
public function testConstructor()
{
$class = 'abc';
$mockMethodFactory = m::mock('\Athletic\Factories\MethodResultsFactory');
$classRunner = new ClassRunner($mockMethodFactory, $class);
}
/**
* @expectedException ReflectionException
*/
public function testRunWithNonExistantClass()
{
$class = 'abc';
$mockMethodFactory = m::mock('\Athletic\Factories\MethodResultsFactory');
$classRunner = new ClassRunner($mockMethodFactory, $class);
$classRunner->run();
}
public function testRunWithAthleticClass()
{
$classFile = <<<'EOF'
<?php
namespace Athletic\Tests\Runners;
class TestRunWithAthleticClass extends \Athletic\AthleticEvent
{
public function setMethodFactory($method)
{
echo "setMethodFactory\n";
}
public function run()
{
echo "run\n";
return array('field' => 'value');
}
}
EOF;
$structure = array(
'classRunner' => array(
'testRunWithAthleticClass.php' => $classFile
)
);
vfsStream::create($structure, $this->root);
$path = vfsStream::url('root\classRunner\testRunWithAthleticClass.php');
include_once($path);
$class = 'Athletic\Tests\Runners\TestRunWithAthleticClass';
$mockMethodFactory = m::mock('\Athletic\Factories\MethodResultsFactory');
$classRunner = new ClassRunner($mockMethodFactory, $class);
$ret = $classRunner->run();
$expected = array('field' => 'value');
$this->expectOutputString("setMethodFactory\nrun\n");
$this->assertEquals($expected, $ret);
}
public function testRunWithNonAthleticClass()
{
$classFile = <<<'EOF'
<?php
namespace Athletic\Tests\Runners;
class TestRunWithNonAthleticClass
{
public function setMethodFactory($method)
{
echo "setMethodFactory\n";
}
public function run()
{
echo "run\n";
return array('field' => 'value');
}
}
EOF;
$structure = array(
'classRunner' => array(
'testRunWithNonAthleticClass.php' => $classFile
)
);
vfsStream::create($structure, $this->root);
$path = vfsStream::url('root\classRunner\testRunWithNonAthleticClass.php');
include_once($path);
$class = 'Athletic\Tests\Runners\TestRunWithNonAthleticClass';
$mockMethodFactory = m::mock('\Athletic\Factories\MethodResultsFactory');
$classRunner = new ClassRunner($mockMethodFactory, $class);
$ret = $classRunner->run();
$this->expectOutputString("");
$this->assertEmpty($ret);
}
} | 21.785235 | 83 | 0.603204 |
5ae391461943b46940fb7adaf8ef02e495b5336a | 1,402 | rs | Rust | jcli/src/jcli_app/certificate/new_stake_delegation.rs | lcgogo/jormungandr | fd2e5f761d87bd75aa056e93e458cda3498c4a3f | [
"Apache-2.0",
"MIT"
] | 1 | 2020-01-29T08:51:26.000Z | 2020-01-29T08:51:26.000Z | jcli/src/jcli_app/certificate/new_stake_delegation.rs | lcgogo/jormungandr | fd2e5f761d87bd75aa056e93e458cda3498c4a3f | [
"Apache-2.0",
"MIT"
] | null | null | null | jcli/src/jcli_app/certificate/new_stake_delegation.rs | lcgogo/jormungandr | fd2e5f761d87bd75aa056e93e458cda3498c4a3f | [
"Apache-2.0",
"MIT"
] | null | null | null | use crate::jcli_app::certificate::{weighted_pool_ids::WeightedPoolIds, write_cert, Error};
use crate::jcli_app::utils::key_parser::parse_pub_key;
use chain_crypto::{Ed25519, PublicKey};
use chain_impl_mockchain::certificate::{Certificate, StakeDelegation as Delegation};
use chain_impl_mockchain::transaction::UnspecifiedAccountIdentifier;
use jormungandr_lib::interfaces::Certificate as CertificateType;
use std::convert::TryInto;
use std::ops::Deref;
use std::path::PathBuf;
use structopt::StructOpt;
#[derive(StructOpt)]
pub struct StakeDelegation {
/// the public key used in the stake key registration
#[structopt(name = "STAKE_KEY", parse(try_from_str = "parse_pub_key"))]
stake_id: PublicKey<Ed25519>,
#[structopt(flatten)]
pool_ids: WeightedPoolIds,
/// write the output to the given file or print it to the standard output if not defined
#[structopt(short = "o", long = "output")]
output: Option<PathBuf>,
}
impl StakeDelegation {
pub fn exec(self) -> Result<(), Error> {
let content = Delegation {
account_id: UnspecifiedAccountIdentifier::from_single_account(self.stake_id.into()),
delegation: (&self.pool_ids).try_into()?,
};
let cert = Certificate::StakeDelegation(content);
write_cert(
self.output.as_ref().map(|x| x.deref()),
CertificateType(cert),
)
}
}
| 35.948718 | 96 | 0.698288 |
e529f2d54d861823584b73a0380f982b31b280ab | 1,372 | ts | TypeScript | src/app/features/post/shared/posts.service.ts | gsimantiras/ng-boilerplate-with-ngrx-store | 2b0b30382603c35ab427c9cd3037ca763d3619d1 | [
"MIT"
] | null | null | null | src/app/features/post/shared/posts.service.ts | gsimantiras/ng-boilerplate-with-ngrx-store | 2b0b30382603c35ab427c9cd3037ca763d3619d1 | [
"MIT"
] | 5 | 2021-03-10T17:28:25.000Z | 2022-03-02T08:34:15.000Z | src/app/features/post/shared/posts.service.ts | gsimantiras/ng-boilerplate-with-ngrx-store | 2b0b30382603c35ab427c9cd3037ca763d3619d1 | [
"MIT"
] | null | null | null | import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { delay, take, map } from 'rxjs/operators';
import { Post, Comment } from './post.model';
import { environment } from 'src/environments/environment';
const mockPosts: Post[] = [
{ id: 1, title: 'fake', body: 'fake body', userId: 1 },
];
const mockComments: Comment[] = [
{
id: 1,
postId: 1,
body: 'fake comment',
name: 'commenter',
email: 'comm@email.com',
},
];
const fakeDelay = 500;
@Injectable()
export class PostsService {
constructor(private http: HttpClient) {}
private url = environment.url;
private postsEndPoint = 'posts';
getAll(): Observable<Post[]> {
return this.http.get<Post[]>(`${this.url}/${this.postsEndPoint}`).pipe(
map((posts) => {
const arr1 = posts.slice(0, 5);
const arr2 = posts.slice(10, 15);
return [...arr1, ...arr2];
}),
delay(fakeDelay)
);
}
getPost(id: number): Observable<Post> {
return this.http
.get<Post>(`${this.url}/${this.postsEndPoint}/${id}`)
.pipe(delay(fakeDelay));
}
getPostComments(id: number): Observable<Comment[]> {
return of(mockComments);
// return this.http.get<Comment[]>(`${this.url}/${this.postsEndPoint}/${id}/comments`).pipe(delay(fakeDelay));
}
}
| 24.945455 | 114 | 0.61516 |
fb77216691dc02ff2eb99f57be9600583324f973 | 32,616 | h | C | tools/texturev/fs_texture_sdf.bin.h | Mirko-Salm/bgfx | 99363f8c26919beac68f63cdcb2b0a4621d81249 | [
"BSD-2-Clause"
] | null | null | null | tools/texturev/fs_texture_sdf.bin.h | Mirko-Salm/bgfx | 99363f8c26919beac68f63cdcb2b0a4621d81249 | [
"BSD-2-Clause"
] | null | null | null | tools/texturev/fs_texture_sdf.bin.h | Mirko-Salm/bgfx | 99363f8c26919beac68f63cdcb2b0a4621d81249 | [
"BSD-2-Clause"
] | null | null | null | static const uint8_t fs_texture_sdf_glsl[579] =
{
0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x75, // FSH............u
0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........
0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x69, 0x6e, 0x20, 0x76, 0x65, // ...........in ve
0x63, 0x33, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c3 v_texcoord0;.
0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x70, // uniform vec4 u_p
0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // arams0;.uniform
0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // sampler2D s_texC
0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, // olor;.void main
0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // ().{. vec4 tmpv
0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1
0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x28, 0x73, // = textureLod (s
0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // _texColor, v_tex
0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x2c, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, // coord0.xy, u_par
0x61, 0x6d, 0x73, 0x30, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // ams0.x);. float
0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_2;. tmp
0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x62, 0x73, 0x28, 0x64, 0x46, 0x64, // var_2 = (abs(dFd
0x78, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x29, 0x29, 0x20, 0x2b, // x(tmpvar_1.x)) +
0x20, 0x61, 0x62, 0x73, 0x28, 0x64, 0x46, 0x64, 0x79, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // abs(dFdy(tmpvar
0x5f, 0x31, 0x2e, 0x78, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // _1.x)));. float
0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, // edge0_3;. edge
0x30, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, // 0_3 = (0.5 - tmp
0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // var_2);. float
0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_4;. tmpv
0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, // ar_4 = clamp (((
0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, // tmpvar_1.x - edg
0x65, 0x30, 0x5f, 0x33, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x30, // e0_3) / (. (0
0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x0a, 0x20, // .5 + tmpvar_2).
0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x33, 0x29, 0x29, 0x2c, 0x20, 0x30, // - edge0_3)), 0
0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // .0, 1.0);. gl_F
0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x28, // ragColor = vec4(
0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // clamp ((tmpvar_4
0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x2a, 0x20, 0x0a, // * (tmpvar_4 * .
0x20, 0x20, 0x20, 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, // (3.0 - (2.0
0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x29, // * tmpvar_4)). )
0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x7d, // ), 0.0, 1.0));.}
0x0a, 0x0a, 0x00, // ...
};
static const uint8_t fs_texture_sdf_spv[1551] =
{
0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x75, // FSH............u
0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........
0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x02, // ...s_texColor0..
0x00, 0x00, 0x00, 0x00, 0x02, 0x1a, 0x00, 0xd0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, // .............#..
0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, // ................
0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...............G
0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, // LSL.std.450.....
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, // ................
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x82, // .......main.....
0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x10, // ................
0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, // ................
0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, // ...............m
0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x73, // ain........,...s
0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler
0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // ......./...s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, // ColorTexture....
0x00, 0x06, 0x00, 0x59, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // ...Y...UniformBl
0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, // ock........Y....
0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x00, 0x00, 0x00, 0x05, // ...u_params0....
0x00, 0x03, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x82, // ...[............
0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x00, // ...gl_FragCoord.
0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x85, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ...........v_col
0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x89, 0x00, 0x00, 0x00, 0x76, // or0............v
0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0x96, // _texcoord0......
0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, // ...bgfx_FragData
0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // 0..G...,..."....
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, // ...G...,...!....
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G.../..."....
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, // ...G.../...!....
0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, // ...H...Y.......#
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x59, 0x00, 0x00, 0x00, 0x02, // .......G...Y....
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, // ...G...[..."....
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, // ...G...[...!....
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x82, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, // ...G............
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x89, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, // ...G............
0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x96, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, // ...G............
0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, // ...........!....
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, // ................
0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x08, // ....... ........
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, // ................
0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, // ................
0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, // ................
0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, // ... ...........
0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3b, // ...+...........;
0x00, 0x04, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ...+...,.......
0x00, 0x04, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, // ...............;
0x00, 0x04, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, // ......./........
0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ...2... .......+
0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, // ...2...7........
0x00, 0x03, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, // ...;.......+....
0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x07, 0x00, 0x0e, // ...P.......,....
0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x50, // ...T...P...P...P
0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x56, // ...P...+.......V
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2c, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x57, // ......?,.......W
0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x56, // ...V...V...V...V
0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x59, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, // .......Y.......
0x00, 0x04, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x3b, // ...Z.......Y...;
0x00, 0x04, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, // ...Z...[........
0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, // ...b... .......+
0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, // ...b...c.......
0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, // ...d...........+
0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, // .......m......?
0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, // ...............;
0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, // ...............;
0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...............
0x00, 0x04, 0x00, 0x88, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3b, // ........... ...;
0x00, 0x04, 0x00, 0x88, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, // ...............
0x00, 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, // ...............;
0x00, 0x04, 0x00, 0x95, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, // ...............6
0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ................
0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, // ...........=....
0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, // ...-...,...=....
0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x20, // ...0.../...=...
0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, // ...........O....
0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x00, // ................
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x64, 0x00, 0x00, 0x00, 0xbe, // .......A...d....
0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x3d, // ...[...7...c...=
0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x56, // ...............V
0x00, 0x05, 0x00, 0x3b, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2d, // ...;.......0...-
0x00, 0x00, 0x00, 0x58, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0xdf, // ...X............
0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x51, // ...............Q
0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, // ................
0x00, 0x00, 0x00, 0xd1, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xc1, // ................
0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x6d, // ...............m
0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc9, // ................
0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, // ...m............
0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xc6, // ...........1....
0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, // ................
0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xcb, // ...........+....
0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0e, // ...P...V...P....
0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, // ................
0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xe8, // ................
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x57, // ...........T...W
0x00, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x96, 0x00, 0x00, 0x00, 0xe8, // .......>........
0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, // .......8.......
};
static const uint8_t fs_texture_sdf_dx9[544] =
{
0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0a, 0x73, // FSH............s
0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _texColor0......
0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x01, 0x00, // ....u_params0...
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, // ................
0xff, 0x2c, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, // .,.CTAB.........
0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, // ...............|
0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, // ...D...........P
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, // .......`........
0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...l.......s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // Color...........
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0
0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................
0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, // ...ps_3_0.Micros
0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, // oft (R) HLSL Sha
0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, // der Compiler 10.
0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, // 1..Q..........?.
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, // ......?....Q....
0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // .........@@.....
0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x00, 0x00, 0x03, 0x90, 0x1f, // ................
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, // ................
0x00, 0x07, 0x80, 0x01, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xc4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x00, // ................
0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x00, // ......._........
0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x5b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, // .......[........
0x00, 0x00, 0x80, 0x5c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, // ................
0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x8b, 0x00, 0x00, 0x55, 0x8b, 0x02, // .............U..
0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, 0x00, 0xaa, 0xa0, 0x02, // .........U......
0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x55, 0x81, 0x01, 0x00, 0xaa, 0xa0, 0x02, // .........U......
0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x00, 0x00, 0x55, 0x81, 0x00, 0x00, 0xe4, 0x80, 0x06, // .........U......
0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, // ................
0x00, 0x11, 0x80, 0x00, 0x00, 0x55, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, // .....U..........
0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x55, 0xa0, 0x05, // .............U..
0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, // ................
0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x55, 0x80, 0x01, // .............U..
0x00, 0x00, 0x02, 0x00, 0x08, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ................
};
static const uint8_t fs_texture_sdf_dx11[808] =
{
0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x09, 0x75, // FSH............u
0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // _params0........
0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x01, 0x00, // ...s_texColor0..
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // ........s_texCol
0x6f, 0x72, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, // or0.............
0x44, 0x58, 0x42, 0x43, 0x03, 0x0d, 0x91, 0x21, 0x8e, 0x75, 0xa6, 0x21, 0xba, 0xe2, 0x0d, 0xbb, // DXBC...!.u.!....
0xa4, 0xa3, 0xae, 0x51, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ...Q............
0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, // ,...........ISGN
0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, // l...........P...
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, // ............b...
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
0x07, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, // ....SV_POSITION.
0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, // COLOR.TEXCOORD..
0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // OSGN,...........
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ...............
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, // ........SV_TARGE
0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xf8, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // T...SHDR....@...
0x7e, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ~...Y...F. .....
0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....Z....`......
0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, // X....p......UU..
0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // b...2.......e...
0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, // . ......h.......
0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, // H...........F...
0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, // ....F~.......`..
0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... .........
0x0b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // ...."...........
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........B.......
0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, // ............"...
0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....*...........
0x1a, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, // ................
0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // B...............
0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, // .@.....?...."...
0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........A.......
0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x52, 0x00, 0x10, 0x00, // .@.....?....R...
0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....V...A.......
0x06, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, // ............"...
0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // .....@.....?...?
0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?...?*.......
0x38, 0x20, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // 8 ..............
0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, // ............2...
0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // "...............
0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, // .@.......@....@@
0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 8...............
0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8...
0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x0a, 0xf2, 0x20, 0x10, 0x00, // ........3.... ..
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // .............@..
0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // ...?...?...?...?
0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, // >.......
};
static const uint8_t fs_texture_sdf_mtl[904] =
{
0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x11, 0x73, // FSH............s
0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // _texColorSampler
0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, // ColorTexture....
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // .......u_params0
0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, // Color...........
0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, // ...#include <met
0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, 0x69, 0x6e, 0x63, 0x6c, // al_stdlib>.#incl
0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, // ude <simd/simd.h
0x3e, 0x0a, 0x0a, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, // >..using namespa
0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, // ce metal;..struc
0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // t _Global.{.
0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x30, // float4 u_params0
0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, // ;.};..struct xla
0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, // tMtlMain_out.{.
0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // float4 bgfx_F
0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ragData0 [[color
0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, // (0)]];.};..struc
0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, // t xlatMtlMain_in
0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, // .{. float3 v_
0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, // texcoord0 [[user
0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, // (locn1)]];.};..f
0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // ragment xlatMtlM
0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // ain_out xlatMtlM
0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, // ain(xlatMtlMain_
0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, // in in [[stage_in
0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, // ]], constant _Gl
0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, // obal& _mtl_u [[b
0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, // uffer(0)]], text
0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, // ure2d<float> s_t
0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // exColor [[textur
0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, // e(0)]], sampler
0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, // s_texColorSample
0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, // r [[sampler(0)]]
0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // ).{. xlatMtlM
0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, // ain_out out = {}
0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x32, 0x32, // ;. float4 _22
0x36, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, // 6 = s_texColor.s
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ample(s_texColor
0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // Sampler, in.v_te
0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x2c, 0x20, 0x6c, 0x65, 0x76, 0x65, // xcoord0.xy, leve
0x6c, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // l(_mtl_u.u_param
0x73, 0x30, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // s0.x));. floa
0x74, 0x20, 0x5f, 0x31, 0x39, 0x33, 0x20, 0x3d, 0x20, 0x5f, 0x32, 0x32, 0x36, 0x2e, 0x78, 0x3b, // t _193 = _226.x;
0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x31, 0x39, 0x35, 0x20, // . float _195
0x3d, 0x20, 0x66, 0x77, 0x69, 0x64, 0x74, 0x68, 0x28, 0x5f, 0x31, 0x39, 0x33, 0x29, 0x3b, 0x0a, // = fwidth(_193);.
0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, // out.bgfx_Fra
0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x28, 0x66, 0x6c, 0x6f, // gData0 = mix(flo
0x61, 0x74, 0x34, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // at4(0.0), float4
0x28, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x66, 0x61, // (1.0), float4(fa
0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x73, 0x6d, 0x6f, 0x6f, 0x74, 0x68, // st::clamp(smooth
0x73, 0x74, 0x65, 0x70, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x5f, 0x31, 0x39, 0x35, 0x2c, // step(0.5 - _195,
0x20, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x5f, 0x31, 0x39, 0x35, 0x2c, 0x20, 0x5f, 0x31, 0x39, // 0.5 + _195, _19
0x33, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x3b, // 3), 0.0, 1.0)));
0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out;
0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x30, 0x00, // .}....0.
};
extern const uint8_t* fs_texture_sdf_pssl;
extern const uint32_t fs_texture_sdf_pssl_size;
| 110.938776 | 116 | 0.5883 |
6202258517e31351f97e8627841968d677edc9bc | 1,650 | dart | Dart | lib/views/lock.dart | MikalaiR/yaOTP | 9aa10598421a68f2efe91045276ce7abdc1643b0 | [
"MIT"
] | null | null | null | lib/views/lock.dart | MikalaiR/yaOTP | 9aa10598421a68f2efe91045276ce7abdc1643b0 | [
"MIT"
] | null | null | null | lib/views/lock.dart | MikalaiR/yaOTP | 9aa10598421a68f2efe91045276ce7abdc1643b0 | [
"MIT"
] | null | null | null | import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart';
import 'package:yaotp/components/app_lock.dart';
import 'package:yaotp/components/screen_lock/screen_lock.dart';
import 'package:yaotp/generated/l10n.dart';
import 'package:yaotp/viewmodels/settings.dart';
class Lock extends StatelessWidget {
@override
Widget build(BuildContext context) {
return LockScreen(
title: S.of(context).pleaseEnterPinCode,
confirmTitle: S.of(context).pleaseConfirmPinCode,
cancelText: S.of(context).cancel,
correctString: null,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
onUnlocked: () {
AppLock.of(context).didUnlock();
},
backgroundColorOpacity: 1,
canCancel: false,
canBiometric: Provider.of<SettingsViewModel>(context).isBiometricsEnabled,
showBiometricFirst:
Provider.of<SettingsViewModel>(context).isBiometricsEnabled,
onValidate: (context, pin) async {
return await Provider.of<SettingsViewModel>(context, listen: false)
.checkPinCode(pin);
},
biometricAuthenticate: (context) async {
final localAuth = LocalAuthentication();
try {
final didAuthenticate = await localAuth.authenticateWithBiometrics(
localizedReason: S.current.pleaseAuthenticate, stickyAuth: true);
if (didAuthenticate) {
return true;
}
return false;
} on PlatformException catch (e) {
return false;
}
},
);
}
}
| 33 | 80 | 0.678788 |
fd54baf09c9961addcce6aa076f5d3bf1e4d4408 | 366 | h | C | JKTranstion/JKTranstionHeader.h | kaqise/JKTranstionDemo | 180771545a77e2dd190e4ca72ad5503543a51b72 | [
"MIT"
] | null | null | null | JKTranstion/JKTranstionHeader.h | kaqise/JKTranstionDemo | 180771545a77e2dd190e4ca72ad5503543a51b72 | [
"MIT"
] | null | null | null | JKTranstion/JKTranstionHeader.h | kaqise/JKTranstionDemo | 180771545a77e2dd190e4ca72ad5503543a51b72 | [
"MIT"
] | null | null | null | //
// JKTranstionHeader.h
// Demo_02
//
// Created by Jessica on 2018/8/21.
// Copyright © 2018年 Milton. All rights reserved.
//
#ifndef JKTranstionHeader_h
#define JKTranstionHeader_h
#import "JKSexPickerController.h"
#import "JKAddressPickerController.h"
#import "JKDatePickerController.h"
#import "JKAlertViewController.h"
#endif /* JKTranstionHeader_h */
| 20.333333 | 50 | 0.759563 |
6b32d7682bfa917de9d866ab91d4849e82aa79be | 154 | sql | SQL | teams-server/src/main/resources/db/migration/mysql/V13__add_memberships_indexes.sql | domgon/OpenConext-Teams-NG | 37481f1768f71a8d85b684fa7a4689a9b1e87bed | [
"Apache-2.0"
] | null | null | null | teams-server/src/main/resources/db/migration/mysql/V13__add_memberships_indexes.sql | domgon/OpenConext-Teams-NG | 37481f1768f71a8d85b684fa7a4689a9b1e87bed | [
"Apache-2.0"
] | 16 | 2019-01-10T11:36:51.000Z | 2022-02-28T04:38:11.000Z | teams-server/src/main/resources/db/migration/mysql/V13__add_memberships_indexes.sql | domgon/OpenConext-Teams-NG | 37481f1768f71a8d85b684fa7a4689a9b1e87bed | [
"Apache-2.0"
] | 10 | 2017-06-08T21:52:02.000Z | 2020-12-02T17:04:48.000Z | ALTER TABLE memberships
ADD INDEX memberships_urn_team_index (urn_team);
ALTER TABLE memberships
ADD INDEX memberships_urn_person_index (urn_person);
| 30.8 | 54 | 0.844156 |
d3496271d26f63d959a3487e031eba22e93b9884 | 393 | kt | Kotlin | Project_Footprint/app/src/main/java/com/haerokim/project_footprint/DataClass/Place.kt | Team-ESC/Footprint-Android-App | fd57e70e53fb6d89e4b6bf8d322308b00dee06a7 | [
"Apache-2.0"
] | 1 | 2020-10-26T14:06:22.000Z | 2020-10-26T14:06:22.000Z | Project_Footprint/app/src/main/java/com/haerokim/project_footprint/DataClass/Place.kt | Team-ESC/Footprint-Android-App | fd57e70e53fb6d89e4b6bf8d322308b00dee06a7 | [
"Apache-2.0"
] | null | null | null | Project_Footprint/app/src/main/java/com/haerokim/project_footprint/DataClass/Place.kt | Team-ESC/Footprint-Android-App | fd57e70e53fb6d89e4b6bf8d322308b00dee06a7 | [
"Apache-2.0"
] | null | null | null | package com.haerokim.project_footprint.DataClass
import kotlin.String
/** Place 정보를 담는 Object **/
data class Place(
var naverPlaceID: String,
var title: String?,
var category: String?,
var description: String?,
var businessHours: String?,
var location: String?,
var imageSrc: String?,
var menuName: ArrayList<String>,
var menuPrice: ArrayList<String>
) | 23.117647 | 48 | 0.694656 |
2828833ecb9c2afb07ba6b11c9026cd522f8b7bd | 3,877 | go | Go | math/matrix.go | Bruyswater/PWS | a8f5bad027320842d0fb14c3e2655417412510c9 | [
"MIT"
] | null | null | null | math/matrix.go | Bruyswater/PWS | a8f5bad027320842d0fb14c3e2655417412510c9 | [
"MIT"
] | null | null | null | math/matrix.go | Bruyswater/PWS | a8f5bad027320842d0fb14c3e2655417412510c9 | [
"MIT"
] | null | null | null | package math
import (
"errors"
"fmt"
"math"
"math/rand"
)
func Rand(y int, x int) [][]float64 {
out := make([][]float64, int(y))
for i := 0; i < x; i++ {
for m := 0; m < y; m++ {
out[m] = append(out[m], rand.Float64()-0.5)
}
}
return out
}
func Dot(x [][]float64, y [][]float64) (r [][]float64, err error) {
if len(x[0]) != len(y) {
//fmt.Println(x,y)
return nil, errors.New("Dimensions not valid %v %v")
}
out := make([][]float64, len(x))
for i := 0; i < len(x); i++ {
for j := 0; j < len(y[0]); j++ {
out[i] = append(out[i], 0)
for k := 0; k < len(x[0]); k++ {
out[i][j] += (x[i][k] * y[k][j])
}
}
}
return out, nil
}
func Transpose(slice [][]float64) [][]float64 {
xl := len(slice[0])
yl := len(slice)
result := make([][]float64, xl)
for i := range result {
result[i] = make([]float64, yl)
}
for i := 0; i < xl; i++ {
for j := 0; j < yl; j++ {
result[i][j] = slice[j][i]
}
}
return result
}
func Resize(matrix [][]float64, y int, x int) [][]float64 {
out := make([][]float64,y)
for i := range out {
out[i] = make([]float64, x)
}
flat := []float64{}
for _, i := range matrix {
for _, o := range i {
flat = append(flat, o)
}
}
//fmt.Print(flat)
for i := 0; i < y; i++ {
for o := 0; o < x; o++ {
//fmt.Println("AAAAAAAAAA",out, flat)
out[i][o] = flat[0]
flat = flat[1:]
}
}
return out
}
func Normalize(in [][][]float64) [][][]float64 {
smallest := math.Inf(1)
biggest := math.Inf(-1)
for _, a := range in {
for _, b := range a {
for _, c := range b {
if c < smallest {
smallest = c
}
}
}
}
for x, a := range in {
for y, b := range a {
for z, _ := range b {
in[x][y][z] -= smallest
}
}
}
for _, a := range in {
for _, b := range a {
for _, c := range b {
if c > biggest {
biggest = c
}
}
}
}
for x, a := range in {
for y, b := range a {
for z, _ := range b {
in[x][y][z] *= 1 / biggest
}
}
}
return in
}
func Closest(pred [][]float64, all [][][]float64, truevalue [][]float64) float64 {
in := false
for _, x := range all {
checkcurrent := true
for y, a := range x {
for z, _ := range a {
if truevalue[y][z] != x[y][z] {
checkcurrent = false
}
}
}
if checkcurrent {
in = true
}
}
if !in {
fmt.Printf("True value not in all values #{lol}")
return 0
}
smallest := float64(math.Inf(1))
smallesti := -1
for i, z := range all {
total := 0.0
for y, a := range z {
for x, _ := range a {
total += math.Abs(z[y][x] - pred[y][x])
}
}
if total < smallest {
smallest = total
smallesti = i
}
}
isTrue := true
for y, z := range all[smallesti] {
for x, _ := range z {
if all[smallesti][y][x] != truevalue[y][x] {
isTrue = false
}
}
}
if isTrue {
return 1
} else {
return 0
}
}
func MatriSubs(m1 [][]float64, m2 [][]float64) ([][]float64, error) {
if len(m1) != len(m2) || len(m1[0]) != len(m2[0]) {
//fmt.Println(len(m1),len(m2),len(m1[0]),len(m2[0]))
return nil, errors.New("Dimensions do not match. "+string(len(m1))+" is not "+string(len(m2))+" or "+string(len(m1[0]))+" is not "+string(len(m2[0])))
}
out := [][]float64{}
for y,ely := range m1 {
row := []float64{}
for x,_ := range ely {
row = append(row, m1[y][x] - m2[y][x])
}
out = append(out, row)
}
return out, nil
}
// Stacks two matrices horizontally
func VertStack(x [][]float64, y [][]float64) [][]float64 {
for _,row := range y {
x = append(x, row)
}
return x
}
func HorzStack(x [][]float64, y [][]float64) [][]float64 {
for i,_ := range y {
for ix,_ := range y[i] {
x[i] = append(x[i], y[i][ix])
}
}
return x
}
func Zeros(x int, y int) (out [][]float64) {
for i := 0; i < y; i++ {
row := []float64{}
for o := 0; o < x; o++ {
row = append(row, 0)
}
out = append(out, row)
}
return out
} | 18.116822 | 152 | 0.507609 |
2777252a06da99b02ed1834dab23c8bfa005b425 | 294 | lua | Lua | src/objects/LocalMap.lua | ttwings/Dwarf-Survival | 888bf221c19551b0aa8599e2a48bdbb7e2bd95a5 | [
"MIT"
] | 8 | 2018-08-26T15:44:22.000Z | 2022-02-23T20:04:30.000Z | src/objects/LocalMap.lua | ttwings/Dwarf-Survival | 888bf221c19551b0aa8599e2a48bdbb7e2bd95a5 | [
"MIT"
] | null | null | null | src/objects/LocalMap.lua | ttwings/Dwarf-Survival | 888bf221c19551b0aa8599e2a48bdbb7e2bd95a5 | [
"MIT"
] | 2 | 2020-08-27T19:33:29.000Z | 2021-08-28T21:07:32.000Z | ---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by apple.
--- DateTime: 2018/8/27 下午6:52
---
LocalMap = Object:extend()
function LocalMap:new(x,y,opts)
LocalMap.super.new(self,x,y,opts)
self.biome = opts.biome or "Mountain"
self.elevation = opts.elevation
end | 22.615385 | 52 | 0.683673 |
b92d5d40a93b6183b52972743a753b5c9dcc00c7 | 1,050 | asm | Assembly | routines/OverworldDistance.asm | Atari2/WhiteSnake | a69b56bbf4389b25b193b1fa8813ac8c5d393677 | [
"MIT"
] | null | null | null | routines/OverworldDistance.asm | Atari2/WhiteSnake | a69b56bbf4389b25b193b1fa8813ac8c5d393677 | [
"MIT"
] | 1 | 2020-06-27T09:12:40.000Z | 2020-07-03T23:21:26.000Z | routines/OverworldDistance.asm | Atari2/WhiteSnake | a69b56bbf4389b25b193b1fa8813ac8c5d393677 | [
"MIT"
] | null | null | null | ; void
; ->
; Y: mangled
; $00: absolute value of the distance between player and sprite, x axis
; $02: absolute value of the distance between player and sprite, y axis
; $06: distance between player and sprite, x axis
; $08: distance between player and sprite, y axis
LDA !ow_sprite_x_pos,x
CLC
ADC #$0008
LDY $0DD6|!Base2 ; Mario: 00 Luigi: 04
SEC
SBC $1F17|!Base2,y ; Mario/Luigi x position
STA $00
BPL +
EOR #$FFFF ; if distance is minus, do bit reverse
INC
+ STA $06 ; x distance between mario/luigi and sprite
LDA !ow_sprite_y_pos,x
CLC
ADC #$0008
LDY $0DD6|!Base2 ; Mario: 00 Luigi: 04
SEC
SBC $1F19|!Base2,y ; Mario/Luigi y position
STA $02
BPL +
EOR #$FFFF ; if distance is minus, do bit reverse
INC
+ STA $08 ; y distance between mario/luigi and sprite
RTL | 33.870968 | 76 | 0.526667 |
71ed4c92e0268521999756281d07f7e5afde732f | 402 | ts | TypeScript | integration/e2e/jasmine.ts | atscott/vscode-ng-language-service | b53eba9c1a1f0d6f5886feba45ea396a66ac61b9 | [
"MIT"
] | null | null | null | integration/e2e/jasmine.ts | atscott/vscode-ng-language-service | b53eba9c1a1f0d6f5886feba45ea396a66ac61b9 | [
"MIT"
] | null | null | null | integration/e2e/jasmine.ts | atscott/vscode-ng-language-service | b53eba9c1a1f0d6f5886feba45ea396a66ac61b9 | [
"MIT"
] | null | null | null | import Jasmine = require('jasmine');
export async function run(): Promise<void> {
const jasmine = new Jasmine({projectBaseDir: __dirname});
jasmine.loadConfig({
spec_files: [
'*_spec.js',
],
});
console.log(`Expecting to run ${jasmine.specFiles.length} specs.`);
if (jasmine.specFiles.length === 0) {
throw new Error('No specs found');
}
await jasmine.execute();
}
| 20.1 | 69 | 0.644279 |
d46168904ba23d6349bea9c9b7c110f87ec4d56f | 194 | kt | Kotlin | src/main/kotlin/anissia/domain/board/core/model/BoardPostCommand.kt | anissia-net/anissia-core | f2af520cace8185f443e0818b311cc567dae367b | [
"CC-BY-4.0"
] | 12 | 2019-11-17T04:20:10.000Z | 2022-03-01T17:02:29.000Z | src/main/kotlin/anissia/domain/board/core/model/BoardPostCommand.kt | anissia-net/anissia-core | f2af520cace8185f443e0818b311cc567dae367b | [
"CC-BY-4.0"
] | 4 | 2021-04-26T08:40:25.000Z | 2021-05-16T18:41:36.000Z | src/main/kotlin/anissia/domain/board/core/model/BoardPostCommand.kt | anissia-net/anissia-core | f2af520cace8185f443e0818b311cc567dae367b | [
"CC-BY-4.0"
] | 2 | 2021-03-29T00:08:48.000Z | 2021-03-31T05:53:06.000Z | package anissia.domain.board.core.model
import javax.validation.constraints.NotEmpty
data class BoardPostCommand (
@field:NotEmpty(message = "내용을 입력해주세요.")
var content: String = "",
)
| 21.555556 | 44 | 0.742268 |
c676c33be2cbda283a93f59be6db90c6c5b35308 | 24 | asm | Assembly | src/test/fixtures/sub.asm | nrkn/momo-vm | b0d8673e1585b0b277d594196addaecd4bdb13b1 | [
"MIT"
] | 1 | 2018-04-13T10:18:56.000Z | 2018-04-13T10:18:56.000Z | src/test/fixtures/sub.asm | nrkn/momo-vm | b0d8673e1585b0b277d594196addaecd4bdb13b1 | [
"MIT"
] | null | null | null | src/test/fixtures/sub.asm | nrkn/momo-vm | b0d8673e1585b0b277d594196addaecd4bdb13b1 | [
"MIT"
] | null | null | null | prog 1 2
add 0 1
sub 0 2 | 8 | 8 | 0.666667 |
884b3be904250ae8f8bae7c43af9802ae8643abc | 1,133 | asm | Assembly | _build/dispatcher/jmp_ippsGFpECESInit_SM2_a1eea20b.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsGFpECESInit_SM2_a1eea20b.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsGFpECESInit_SM2_a1eea20b.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsGFpECESInit_SM2:function
extern n8_ippsGFpECESInit_SM2:function
extern y8_ippsGFpECESInit_SM2:function
extern e9_ippsGFpECESInit_SM2:function
extern l9_ippsGFpECESInit_SM2:function
extern n0_ippsGFpECESInit_SM2:function
extern k0_ippsGFpECESInit_SM2:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpECESInit_SM2
.Larraddr_ippsGFpECESInit_SM2:
dq m7_ippsGFpECESInit_SM2
dq n8_ippsGFpECESInit_SM2
dq y8_ippsGFpECESInit_SM2
dq e9_ippsGFpECESInit_SM2
dq l9_ippsGFpECESInit_SM2
dq n0_ippsGFpECESInit_SM2
dq k0_ippsGFpECESInit_SM2
segment .text
global ippsGFpECESInit_SM2:function (ippsGFpECESInit_SM2.LEndippsGFpECESInit_SM2 - ippsGFpECESInit_SM2)
.Lin_ippsGFpECESInit_SM2:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpECESInit_SM2:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpECESInit_SM2]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpECESInit_SM2:
| 29.051282 | 103 | 0.805825 |
43a9ce439faa076b3d4b6e580694969f0169573b | 386 | go | Go | samples/samples_test.go | subratohld/config | aff5524499608c7238d9dfd12c98c29c03bf1ae8 | [
"MIT"
] | null | null | null | samples/samples_test.go | subratohld/config | aff5524499608c7238d9dfd12c98c29c03bf1ae8 | [
"MIT"
] | null | null | null | samples/samples_test.go | subratohld/config | aff5524499608c7238d9dfd12c98c29c03bf1ae8 | [
"MIT"
] | null | null | null | package samples
import (
"fmt"
"os"
"testing"
"github.com/subratohld/config"
)
func TestConfigReader(t *testing.T) {
// It will read from environment variable because no config file is passed
// It will look for FILE_PATh variable
configFile := os.Getenv("CONFIG_FILE")
config, err := config.New(configFile)
fmt.Println(err)
fmt.Println(config.GetString("server.port"))
}
| 19.3 | 75 | 0.727979 |
e9dd667998fec47511b77311243f57f951793f62 | 2,342 | go | Go | ctTime.go | moisespsena-go/bintb | 7de8d89a5be50ae787857946481d666deee3a690 | [
"Apache-2.0"
] | null | null | null | ctTime.go | moisespsena-go/bintb | 7de8d89a5be50ae787857946481d666deee3a690 | [
"Apache-2.0"
] | null | null | null | ctTime.go | moisespsena-go/bintb | 7de8d89a5be50ae787857946481d666deee3a690 | [
"Apache-2.0"
] | null | null | null | package bintb
import (
"bytes"
"io"
"github.com/moisespsena-go/aorm/types"
)
type TimeZero struct{ UnLimitColumnTool }
type CTtime struct{ UnLimitColumnTool }
func (CTtime) Zero() interface{} {
var t types.Time
return t
}
func (CTtime) Description() string {
return "Time. (15:04:05)"
}
func (CTtime) Decode(value string) (v interface{}, err error) {
var t types.Time
if err = t.Scan(value); err != nil {
return
}
return t, nil
}
func (CTtime) Encode(value interface{}) string {
return value.(types.Time).String()
}
func (CTtime) BinRead(r io.Reader) (v interface{}, err error) {
var h, m, s int8
if err = br(r, &h, &m, &s); err != nil {
return
}
return types.NewTime(int(h), int(m), int(s)), nil
}
func (CTtime) BinWrite(w io.Writer, v interface{}) (err error) {
t := v.(types.Time)
var buf bytes.Buffer
bw(&buf, int8(t.Hour()), int8(t.Minute()), int8(t.Second()))
_, err = w.Write(buf.Bytes())
return
}
type ToolZonedTimer interface {
Zone(value interface{}) (h, m int)
}
func IsZonedTimeTool(typ ColumnType) (ok bool) {
if tool := ColumnTypeTool.Get(typ); tool != nil {
_, ok = tool.(ToolZonedTimer)
}
return
}
type CTtimeZ struct{ UnLimitColumnTool }
func (CTtimeZ) Zone(value interface{}) (h, m int) {
return value.(types.TimeZ).Zone()
}
func (CTtimeZ) Zero() interface{} {
var t types.TimeZ
return t
}
func (CTtimeZ) Description() string {
return "Time with Zone: (15:04:05 -07:00)"
}
func (CTtimeZ) Decode(value string) (v interface{}, err error) {
var t types.TimeZ
if err = t.Scan(value); err != nil {
return
}
return t, nil
}
func (CTtimeZ) Encode(value interface{}) string {
return value.(types.TimeZ).String()
}
func (CTtimeZ) BinRead(r io.Reader) (v interface{}, err error) {
var h, m, s, zh, zm int8
if err = br(r, &h, &m, &s, &zh, &zm); err != nil {
return
}
return types.NewTimeZ(int(h), int(m), int(s), int(zh), int(zm)), nil
}
func (CTtimeZ) BinWrite(w io.Writer, v interface{}) (err error) {
t := v.(types.TimeZ)
var buf bytes.Buffer
zh, zm := t.Zone()
bw(&buf, int8(t.Hour()), int8(t.Minute()), int8(t.Second()), int8(zh), int8(zm))
_, err = w.Write(buf.Bytes())
return
}
const (
CtTime ColumnType = "t"
CtTimeZ ColumnType = "tz"
)
func init() {
ColumnTypeTool.Set(CtTime, CTtime{}, "time")
ColumnTypeTool.Set(CtTimeZ, CTtimeZ{}, "timez")
}
| 20.189655 | 81 | 0.647737 |
16e256d855a6394b6347d2b2369935f8c3ab59a2 | 55 | ts | TypeScript | shared/src/models/part.ts | justAdevTV/Phoenix-Parts | 337443f821d493d7d3a0496f28da58f84b40173d | [
"MIT"
] | 4 | 2018-06-01T10:21:04.000Z | 2020-04-05T22:02:22.000Z | shared/src/models/part.ts | justAdevTV/Phoenix-Parts | 337443f821d493d7d3a0496f28da58f84b40173d | [
"MIT"
] | 12 | 2016-07-01T04:44:20.000Z | 2022-02-13T09:49:27.000Z | shared/src/models/part.ts | justAdevTV/Phoenix-Parts | 337443f821d493d7d3a0496f28da58f84b40173d | [
"MIT"
] | null | null | null | interface Part {
partName: String,
status?: String,
} | 13.75 | 18 | 0.709091 |
850d14cced15adaf3251cf8b4d04df0541c2a950 | 2,254 | swift | Swift | TangemSdk/TangemSdk/Common/Extensions/String+.swift | megakoko/tangem-sdk-ios | bf328233215f5e6fbca5aa6de0952d3ba6b8a910 | [
"MIT"
] | 19 | 2019-11-25T10:14:37.000Z | 2021-04-08T08:12:11.000Z | TangemSdk/TangemSdk/Common/Extensions/String+.swift | megakoko/tangem-sdk-ios | bf328233215f5e6fbca5aa6de0952d3ba6b8a910 | [
"MIT"
] | 2 | 2021-01-02T12:55:32.000Z | 2021-04-07T14:42:51.000Z | TangemSdk/TangemSdk/Common/Extensions/String+.swift | megakoko/tangem-sdk-ios | bf328233215f5e6fbca5aa6de0952d3ba6b8a910 | [
"MIT"
] | 9 | 2020-04-24T02:43:22.000Z | 2021-03-30T08:16:28.000Z | //
// String+.swift
// TangemSdk
//
// Created by Alexander Osokin on 07/10/2019.
// Copyright © 2019 Tangem AG. All rights reserved.
//
import Foundation
public extension String {
var titleFormatted: String {
let separator = Array(repeating: "-", count: 16).joined()
return "\(separator) \(self) \(separator)"
}
func remove(_ substring: String) -> String {
return self.replacingOccurrences(of: substring, with: "")
}
@available(iOS 13.0, *)
func sha256() -> Data {
let data = Data(Array(utf8))
return data.getSha256()
}
@available(iOS 13.0, *)
func sha512() -> Data {
let data = Data(Array(utf8))
return data.getSha512()
}
internal func capitalizingFirst() -> String {
return prefix(1).capitalized + dropFirst()
}
internal func lowercasingFirst() -> String {
return prefix(1).lowercased() + dropFirst()
}
@available(iOS 13.0, *)
internal var localized: String {
Localization.getFormat(for: self)
}
internal func trim() -> String {
return trimmingCharacters(in: .whitespacesAndNewlines)
}
internal func camelCaseToSnakeCase() -> String {
let acronymPattern = "([A-Z]+)([A-Z][a-z]|[0-9])"
let normalPattern = "([a-z0-9])([A-Z])"
return self.processCamelCaseRegex(pattern: acronymPattern)?
.processCamelCaseRegex(pattern: normalPattern)?.lowercased() ?? self.lowercased()
}
private func processCamelCaseRegex(pattern: String) -> String? {
let regex = try? NSRegularExpression(pattern: pattern, options: [])
let range = NSRange(location: 0, length: count)
return regex?.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: "$1_$2")
}
}
@available(iOS 13.0, *)
extension DefaultStringInterpolation {
mutating func appendInterpolation(_ data: Data) {
appendLiteral(data.hexString)
}
mutating func appendInterpolation(_ byte: Byte) {
appendLiteral(byte.hexString)
}
}
extension String.SubSequence {
internal func trim() -> String {
return trimmingCharacters(in: .whitespacesAndNewlines)
}
}
| 28.175 | 106 | 0.6189 |
3c855792a08550985b480b02a5e0b33c18649228 | 3,972 | rs | Rust | src/engine/sound/mod.rs | gitcrtn/unrust | b8b062aa0e009f5d0e42215ca6d5347a595da387 | [
"Apache-2.0",
"MIT"
] | 258 | 2018-04-24T23:35:25.000Z | 2022-03-07T19:49:40.000Z | src/engine/sound/mod.rs | gitcrtn/unrust | b8b062aa0e009f5d0e42215ca6d5347a595da387 | [
"Apache-2.0",
"MIT"
] | 30 | 2018-02-28T18:12:08.000Z | 2018-04-24T14:54:09.000Z | src/engine/sound/mod.rs | gitcrtn/unrust | b8b062aa0e009f5d0e42215ca6d5347a595da387 | [
"Apache-2.0",
"MIT"
] | 22 | 2018-05-06T05:52:44.000Z | 2022-01-28T19:10:42.000Z | mod channel;
mod generator;
use std::cell::RefCell;
use std::rc::Rc;
use engine::{AssetError, AssetSystem};
use futures::Future;
use std::collections::BTreeSet;
use std::collections::HashMap;
use uni_snd::SoundDriver;
use self::generator::Generator;
const CHANNEL_COUNT: usize = 4;
#[derive(Debug, Clone, Copy, Ord, PartialOrd, Eq, PartialEq)]
pub struct SoundHandle(usize);
pub struct SoundSystem {
cache: HashMap<String, SoundHandle>,
loading: Rc<RefCell<BTreeSet<SoundHandle>>>,
pending_play: Vec<SoundPlayEvent>,
next_handle: usize,
driver: Rc<RefCell<SoundDriver<SoundEvent>>>,
asys: Box<AssetSystem>,
}
impl SoundSystem {
pub fn new(asys: Box<AssetSystem>) -> Self {
let mut driver = SoundDriver::new(Box::new(Generator::new(CHANNEL_COUNT)));
driver.start();
Self {
cache: HashMap::new(),
next_handle: 0,
driver: Rc::new(RefCell::new(driver)),
loading: Rc::new(RefCell::new(BTreeSet::new())),
pending_play: Vec::new(),
asys,
}
}
pub fn load_sound(&mut self, filepath: &str) -> SoundHandle {
let filepath = filepath.to_owned();
let buffer = self.cache.get(&filepath);
match buffer {
None => {
let id = self.next_handle;
self.next_handle += 1;
let f = self.asys.new_file(&filepath);
let driver = self.driver.clone();
let load_f = f.and_then({
let filepath = filepath.clone();
let loading = self.loading.clone();
move |mut fdata| {
driver.borrow_mut().send_event(SoundEvent::LoadBuffer(
id,
fdata.read_binary()?,
filepath,
));
loading.borrow_mut().remove(&SoundHandle(id));
Ok(())
}
});
self.asys
.execute(Box::new(load_f.map_err(|e| AssetError::FileIoError(e))));
self.cache.insert(filepath.clone(), SoundHandle(id));
self.loading.borrow_mut().insert(SoundHandle(id));
SoundHandle(id)
}
Some(buf) => *buf,
}
}
pub fn play_sound(
&mut self,
id: SoundHandle,
channel: Option<usize>,
do_loop: bool,
priority: usize,
volume: f32,
balance: f32,
) {
let evt = SoundPlayEvent {
id: id.0,
channel,
do_loop,
priority,
volume,
balance,
};
if self.loading.borrow().contains(&id) {
self.pending_play.push(evt);
return;
}
self.driver.borrow_mut().send_event(SoundEvent::Play(evt))
}
pub fn stop_channel(&mut self, channel: usize) {
self.driver
.borrow_mut()
.send_event(SoundEvent::StopChannel(channel));
}
pub fn step(&mut self) {
let pending: Vec<_> = self.pending_play.drain(0..).collect();
let pending = pending
.into_iter()
.filter(|evt| {
if self.loading.borrow().contains(&SoundHandle(evt.id)) {
return true;
} else {
self.driver.borrow_mut().send_event(SoundEvent::Play(*evt));
return false;
}
})
.collect();
self.pending_play = pending;
self.driver.borrow_mut().frame();
}
}
enum SoundEvent {
LoadBuffer(usize, Vec<u8>, String),
Play(SoundPlayEvent),
StopChannel(usize),
}
#[derive(Clone, Copy)]
pub struct SoundPlayEvent {
id: usize,
channel: Option<usize>,
do_loop: bool,
priority: usize,
volume: f32,
balance: f32,
}
| 26.657718 | 87 | 0.514854 |
ab0345118fd2b2aec4d544ff45f3f173243b16b3 | 1,342 | swift | Swift | Swift/Utilities/GCDMulticastDelegate.swift | colloquy/XMPPFramework | d52de9e2ca9f1a84ed377b42b5dba9ee5061e06a | [
"BSD-Source-Code"
] | 21 | 2015-01-06T03:20:53.000Z | 2022-01-10T15:59:10.000Z | Swift/Utilities/GCDMulticastDelegate.swift | gokulgovind/XMPPFramework | 1a40841a79eefd20da669a4c7a55b70b9f7d8904 | [
"BSD-Source-Code"
] | 1 | 2018-10-12T11:37:03.000Z | 2018-10-12T11:37:03.000Z | Swift/Utilities/GCDMulticastDelegate.swift | gokulgovind/XMPPFramework | 1a40841a79eefd20da669a4c7a55b70b9f7d8904 | [
"BSD-Source-Code"
] | 33 | 2015-03-03T09:16:11.000Z | 2020-08-09T12:03:30.000Z | //
// GCDMulticastDelegate.swift
// XMPPFramework
//
// Created by Chris Ballinger on 11/15/17.
// Copyright © 2017 XMPPFramework. All rights reserved.
//
import Foundation
/**
* This helper makes it slightly easier to call the MulticastDelegate
* with the caveat that you must create an empty GCDMulticastDelegate class extension
* for the protocols you'd like it to handle.
*
* For example, in a XMPPModule subclass called XMPPBookmarksModule
* with a multicast delegate called XMPPBookmarksDelegate, somewhere
* you will need to create an empty class extension like this:
*
* extension GCDMulticastDelegate: XMPPBookmarksDelegate {}
*
* This will prevent your code from crashing during the forced cast.
*/
extension GCDMulticastDelegate {
/**
* This is a helper mainly to provide better code completion.
*
* multicast.invoke(ofType: XMPPBookmarksDelegate.self, { (multicast) in
* multicast.xmppBookmarks!(self, didNotRetrieveBookmarks: obj as? XMPPIQ)
* })
*/
public func invoke<T>(ofType: T.Type, _ invocation: (_ multicast: T) -> ()) {
// Crashing here? See the documentation above.
// You must implement a stub extension on GCDMulticastDelegate conforming to the
// delegate type you are attempting to downcast.
invocation(self as! T)
}
}
| 33.55 | 88 | 0.713115 |
85cf88a613a811038f3fdf3aaa622b7f3bd4a6c2 | 639 | es6 | JavaScript | src/shader/split/params.es6 | dustybluebird/Paddle.js | ddbfd2cc50e473cb01ce621485bc5502d677afcd | [
"Apache-2.0"
] | 2 | 2021-05-14T23:03:15.000Z | 2022-02-09T07:28:32.000Z | src/shader/split/params.es6 | dustybluebird/Paddle.js | ddbfd2cc50e473cb01ce621485bc5502d677afcd | [
"Apache-2.0"
] | null | null | null | src/shader/split/params.es6 | dustybluebird/Paddle.js | ddbfd2cc50e473cb01ce621485bc5502d677afcd | [
"Apache-2.0"
] | 1 | 2022-01-26T09:41:53.000Z | 2022-01-26T09:41:53.000Z | /* eslint-disable */
/**
* @file split参数文件
* @author zhangjingyuan02
*/
export default `
// 常量
const int width_shape_origin = WIDTH_SHAPE_ORIGIN;
const int height_shape_origin = HEIGHT_SHAPE_ORIGIN;
const int length_shape_origin = LENGTH_SHAPE_ORIGIN;
const int width_texture_origin = WIDTH_TEXTURE_ORIGIN;
const int height_texture_origin = HEIGHT_TEXTURE_ORIGIN;
const int channel_origin = CHANNEL_ORIGIN;
const int total_shape_origin = TOTAL_SHAPE_ORIGIN;
const int total_shape_out = TOTAL_SHAPE_OUT;
const int dim = DIM;
const int num = NUM;
const int target_length = TARGET_LENGTH;
// 输入数据
uniform sampler2D texture_origin;
`;
| 23.666667 | 56 | 0.798122 |
cd9a07b43bbe6b5fd8c72a16b83d40d77a6f86c4 | 296 | rs | Rust | ocaml/tests/src/lib.rs | aaronsens/proof-systems | 52b859e9b5d81e94c4bc0e03cc66d4128419e7d6 | [
"Apache-2.0"
] | 75 | 2021-07-23T03:15:13.000Z | 2022-03-30T06:35:08.000Z | ocaml/tests/src/lib.rs | aaronsens/proof-systems | 52b859e9b5d81e94c4bc0e03cc66d4128419e7d6 | [
"Apache-2.0"
] | 258 | 2021-07-15T21:25:27.000Z | 2022-03-31T19:24:53.000Z | ocaml/tests/src/lib.rs | aaronsens/proof-systems | 52b859e9b5d81e94c4bc0e03cc66d4128419e7d6 | [
"Apache-2.0"
] | 23 | 2021-07-20T03:11:21.000Z | 2022-03-25T04:31:08.000Z | #[derive(ocaml::IntoValue, ocaml::FromValue, ocaml_gen::Struct)]
pub struct SingleTuple(String);
#[ocaml_gen::func]
#[ocaml::func]
pub fn new() -> SingleTuple {
SingleTuple(String::from("Hello"))
}
#[ocaml_gen::func]
#[ocaml::func]
pub fn print(s: SingleTuple) {
println!("{}", s.0);
}
| 19.733333 | 64 | 0.658784 |
dd7891d434507499751022b4326e164db4c0272c | 2,187 | php | PHP | src/MGC/AdminBundle/Entity/GameIconDocument.php | k-przybyszewski/mgc | e6057f33f880626ad5688330f975e6e36c9ffac6 | [
"MIT"
] | null | null | null | src/MGC/AdminBundle/Entity/GameIconDocument.php | k-przybyszewski/mgc | e6057f33f880626ad5688330f975e6e36c9ffac6 | [
"MIT"
] | null | null | null | src/MGC/AdminBundle/Entity/GameIconDocument.php | k-przybyszewski/mgc | e6057f33f880626ad5688330f975e6e36c9ffac6 | [
"MIT"
] | null | null | null | <?php
namespace MGC\AdminBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use MGC\AdminBundle\Validator\Constraints as MyAssert;
use MGC\AdminBundle\Entity\Document;
/**
* @ORM\Table(name="game_icon_document")
* @ORM\Entity(repositoryClass="MGC\AdminBundle\Entity\Repository\GameIconDocumentRepository")
* @ORM\HasLifecycleCallbacks
*/
class GameIconDocument extends Document
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\OneToOne(targetEntity="Game", inversedBy="icon")
* @ORM\JoinColumn(name="game_id", referencedColumnName="id")
*/
private $game;
/**
* @Assert\File(maxSize="150000", groups={"game"}, mimeTypes={
* "image/png",
* "image/jpg",
* "image/jpeg",
* "image/gif"
* })
* @MyAssert\MyImage(groups={"game"}, params={
* "maxWidth" = "20",
* "maxHeight" = "20"
* })
*/
protected $file;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $path;
protected $dir = 'game_icons';
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set path
*
* @param string $path
* @return GameIconDocument
*/
public function setPath($path)
{
$this->path = $path;
return $this;
}
/**
* Get path
*
* @return string
*/
public function getPath()
{
return $this->path;
}
/**
* Set game
*
* @param \MGC\AdminBundle\Entity\Game $game
* @return GameIconDocument
*/
public function setGame(\MGC\AdminBundle\Entity\Game $game = null)
{
$this->game = $game;
return $this;
}
/**
* Get game
*
* @return \MGC\AdminBundle\Entity\Game
*/
public function getGame()
{
return $this->game;
}
}
| 19.526786 | 94 | 0.541381 |
2a55771b02e37b710833fa031be10260411aa39a | 541 | java | Java | proj/cheese-emp-api/cheese_api(java)/src/main/java/com/pic2cheese/api/Review.java | youjeong2/EMP | 1afdf2789b09e55e4f6a2241a2cc2d0d1b607d9e | [
"MIT"
] | 1 | 2021-11-17T06:37:50.000Z | 2021-11-17T06:37:50.000Z | proj/cheese-emp-api/cheese_api(java)/src/main/java/com/pic2cheese/api/Review.java | youjeong2/EMP | 1afdf2789b09e55e4f6a2241a2cc2d0d1b607d9e | [
"MIT"
] | 1 | 2020-10-26T06:06:41.000Z | 2020-10-26T06:06:41.000Z | proj/cheese-emp-api/cheese_api(java)/src/main/java/com/pic2cheese/api/Review.java | youjeong2/EMP | 1afdf2789b09e55e4f6a2241a2cc2d0d1b607d9e | [
"MIT"
] | 8 | 2020-10-05T08:19:16.000Z | 2021-11-17T06:37:52.000Z | package com.pic2cheese.api;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.time.LocalDateTime;
@Entity
@Getter
@Setter
public class Review {
@Id
@GeneratedValue
@Column(name = "rewier_id")
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
private User user;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "cheese_id")
private Cheese cheese;
private LocalDateTime insertFnQ;
private LocalDateTime updateFnQ;
}
| 17.451613 | 38 | 0.704251 |
b9b10015a3c6575a586df1eebdb05f45ca037988 | 5,302 | h | C | offset_diff_drive_controller/include/offset_diff_drive_controller/offset_diff_drive_controller.h | devrt/offset-diff-drive-controller | 70eab6eee6ca6f4d5f3e0938ee0b088fc4ce8ba9 | [
"BSD-3-Clause"
] | null | null | null | offset_diff_drive_controller/include/offset_diff_drive_controller/offset_diff_drive_controller.h | devrt/offset-diff-drive-controller | 70eab6eee6ca6f4d5f3e0938ee0b088fc4ce8ba9 | [
"BSD-3-Clause"
] | 1 | 2020-07-10T04:58:12.000Z | 2020-07-10T04:59:01.000Z | offset_diff_drive_controller/include/offset_diff_drive_controller/offset_diff_drive_controller.h | devrt/offset-diff-drive-controller | 70eab6eee6ca6f4d5f3e0938ee0b088fc4ce8ba9 | [
"BSD-3-Clause"
] | null | null | null | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2020, MID Academic Promotions, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the MID Academic Promotions nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
/*
* Author: Yosuke Matsusaka
*/
#pragma once
#include <string>
#include <vector>
#include <control_msgs/JointTrajectoryControllerState.h>
#include <controller_interface/multi_interface_controller.h>
#include <offset_diff_drive_controller/dynamics.h>
#include <geometry_msgs/TwistStamped.h>
#include <hardware_interface/joint_command_interface.h>
#include <memory>
#include <nav_msgs/Odometry.h>
#include <pluginlib/class_list_macros.hpp>
#include <realtime_tools/realtime_buffer.h>
#include <realtime_tools/realtime_publisher.h>
#include <tf/tfMessage.h>
namespace offset_diff_drive_controller
{
class OffsetDiffDriveController
: public controller_interface::MultiInterfaceController<hardware_interface::PositionJointInterface, hardware_interface::VelocityJointInterface>
{
public:
OffsetDiffDriveController();
bool init(hardware_interface::RobotHW *hw,
ros::NodeHandle &root_nh,
ros::NodeHandle &controller_nh);
void update(const ros::Time &time, const ros::Duration &period);
void starting(const ros::Time &time);
void stopping(const ros::Time &time);
private:
std::string name_;
hardware_interface::RobotHW *robot_hw_;
// Parameters of the vehicle:
double wheel_separation_;
double wheel_radius_;
double wheel_offset_;
double vel_limit_steer_;
double vel_limit_wheel_;
state state_;
// Joint handles:
std::string wheel_left_name_;
std::string wheel_right_name_;
std::string steer_name_;
hardware_interface::JointHandle left_wheel_joint_;
hardware_interface::JointHandle right_wheel_joint_;
hardware_interface::JointHandle steer_joint_;
hardware_interface::JointHandle odom_x_loopback_;
hardware_interface::JointHandle odom_y_loopback_;
hardware_interface::JointHandle odom_r_loopback_;
// Odometry publishing:
ros::Duration publish_period_;
ros::Time last_state_publish_time_;
bool enable_odom_tf_;
bool enable_odom_loopback_;
std::shared_ptr<realtime_tools::RealtimePublisher<nav_msgs::Odometry>> odom_pub_;
std::shared_ptr<realtime_tools::RealtimePublisher<tf::tfMessage>> tf_odom_pub_;
struct Odometry
{
double x;
double y;
double ang;
Odometry() : x(0.0), y(0.0), ang(0.0) {}
};
Odometry odometry_;
std::string base_frame_id_;
std::string odom_frame_id_;
// Velocity command subscribing:
struct Command
{
double lin_x;
double lin_y;
double ang;
ros::Time stamp;
Command() : lin_x(0.0), lin_y(0.0), ang(0.0), stamp(0.0) {}
};
realtime_tools::RealtimeBuffer<Command> command_;
Command command_struct_;
ros::Subscriber sub_command_;
double cmd_vel_timeout_;
protected:
void cmdVelCallback(const geometry_msgs::Twist &command);
joint_param joint_param_;
cartesian_param cartesian_param_;
double desired_abs_dot_x_;
double desired_abs_dot_y_;
double desired_dot_r_;
double desired_steer_pos_;
};
PLUGINLIB_EXPORT_CLASS(offset_diff_drive_controller::OffsetDiffDriveController, controller_interface::ControllerBase);
} // namespace offset_diff_drive_controller | 36.565517 | 151 | 0.683704 |
b366d3b9ce8c74690d6b8c6b8be52fd0257bcb36 | 338 | rb | Ruby | lib/rango/ext/object_space.rb | deepj/rango | 93996d0cbc82eee9a1fb3c76376b8e23520fe1fa | [
"MIT"
] | 1 | 2016-05-09T10:45:25.000Z | 2016-05-09T10:45:25.000Z | lib/rango/ext/object_space.rb | deepj/rango | 93996d0cbc82eee9a1fb3c76376b8e23520fe1fa | [
"MIT"
] | null | null | null | lib/rango/ext/object_space.rb | deepj/rango | 93996d0cbc82eee9a1fb3c76376b8e23520fe1fa | [
"MIT"
] | null | null | null | # encoding: utf-8
module ObjectSpace
# Returns all classes existing in runtime
#
# @author Botanicus
# @since 0.0.3
# @return [Array<Class>] List of all classes loaded into runtime
def self.classes
Array.new.tap do |objects|
self.each_object(Class) do |object|
objects << object
end
end
end
end
| 19.882353 | 66 | 0.656805 |
4f998d13b31278cd4ca162914bc5ffcc9b53b373 | 5,089 | kt | Kotlin | app/src/main/java/com/smartsettings/ai/di/AppModule.kt | praslnx8/SmartSettings | 33811c305eba90406f934ffddfc0729a30e64fca | [
"MIT"
] | 5 | 2019-09-27T06:03:42.000Z | 2020-01-17T21:42:27.000Z | app/src/main/java/com/smartsettings/ai/di/AppModule.kt | praslnx8/SmartSettings | 33811c305eba90406f934ffddfc0729a30e64fca | [
"MIT"
] | 1 | 2019-11-10T18:42:24.000Z | 2019-11-20T03:07:35.000Z | app/src/main/java/com/smartsettings/ai/di/AppModule.kt | praslnx8/SmartSettings | 33811c305eba90406f934ffddfc0729a30e64fca | [
"MIT"
] | 1 | 2021-03-30T06:32:22.000Z | 2021-03-30T06:32:22.000Z | package com.smartsettings.ai.di
import android.content.Context
import android.media.AudioManager
import com.google.android.gms.location.FusedLocationProviderClient
import com.smartsettings.ai.core.SmartSettingRepository
import com.smartsettings.ai.core.smartSettingCreator.SmartSettingCreator
import com.smartsettings.ai.core.smartSettingSchemaProvider.SmartSettingSchemaProvider
import com.smartsettings.ai.core.smartSettingSchemaProvider.SmartSettingSchemaRepo
import com.smartsettings.ai.resources.cloud.ApiService
import com.smartsettings.ai.resources.cloud.ApiServiceProvider
import com.smartsettings.ai.resources.db.SmartSettingDao
import com.smartsettings.ai.resources.db.SmartSettingDatabase
import com.smartsettings.ai.resources.db.SmartSettingSchemaDao
object DependencyProvider {
private lateinit var abstractDependencyInjector: AbstractDependencyInjector
fun setInjector(abstractDependencyInjector: AbstractDependencyInjector) {
this.abstractDependencyInjector = abstractDependencyInjector
}
val getContext : Context get() = abstractDependencyInjector.provideContext()
val audioManager : AudioManager get() = abstractDependencyInjector.provideAudioManager()
val smartSettingRepository : SmartSettingRepository get() = abstractDependencyInjector.provideSmartSettingRepository()
val fusedLocationProviderClient : FusedLocationProviderClient get() = abstractDependencyInjector.provideFusedLocationProviderClient()
val apiService : ApiService get() = abstractDependencyInjector.provideApiService()
val smartSettingSchemaRepo : SmartSettingSchemaRepo get() = abstractDependencyInjector.provideSmartSettingSchemaRepo()
val smartsettingSchemaProvider : SmartSettingSchemaProvider get() = abstractDependencyInjector.provideSmartSettingSchemaProvider()
val smartSettingCreator : SmartSettingCreator get() = abstractDependencyInjector.provideSmartSettingCreator()
val smartSettingDao : SmartSettingDao get() = abstractDependencyInjector.provideSmartSettingDao()
val smartSettingSchemaDao : SmartSettingSchemaDao get() = abstractDependencyInjector.provideSmartSettingSchemaDao()
}
abstract class AbstractDependencyInjector {
abstract fun provideContext() : Context
abstract fun provideAudioManager() : AudioManager
abstract fun provideSmartSettingRepository() : SmartSettingRepository
abstract fun provideFusedLocationProviderClient() : FusedLocationProviderClient
abstract fun provideApiService() : ApiService
abstract fun provideSmartSettingSchemaRepo() : SmartSettingSchemaRepo
abstract fun provideSmartSettingCreator() : SmartSettingCreator
abstract fun provideSmartSettingDao() : SmartSettingDao
abstract fun provideSmartSettingSchemaDao() : SmartSettingSchemaDao
abstract fun provideSmartSettingSchemaProvider() : SmartSettingSchemaProvider
}
class DependencyInjector(val appContext: Context) : AbstractDependencyInjector() {
private val context : Context by lazy {
appContext
}
private val audioManager : AudioManager by lazy {
appContext.getSystemService(Context.AUDIO_SERVICE) as AudioManager
}
private val smartSettingDao : SmartSettingDao by lazy {
SmartSettingDatabase.getDb(appContext).getSmartSettingDao()
}
private val smartSettingSchemaDao : SmartSettingSchemaDao by lazy {
SmartSettingDatabase.getDb(appContext).getSmartSettingSchemaDao()
}
private val smartSettingRepository : SmartSettingRepository by lazy {
SmartSettingRepository()
}
private val fusedLocationProviderClient : FusedLocationProviderClient get() = FusedLocationProviderClient(appContext)
private val apiService : ApiService by lazy {
ApiServiceProvider.apiService
}
private val smartSettingSchemaRepo : SmartSettingSchemaRepo by lazy {
SmartSettingSchemaRepo()
}
private val smartSettingCreator : SmartSettingCreator by lazy {
SmartSettingCreator()
}
override fun provideContext(): Context {
return context
}
override fun provideAudioManager(): AudioManager {
return audioManager
}
override fun provideSmartSettingRepository(): SmartSettingRepository {
return smartSettingRepository
}
override fun provideFusedLocationProviderClient(): FusedLocationProviderClient {
return fusedLocationProviderClient
}
override fun provideApiService(): ApiService {
return apiService
}
override fun provideSmartSettingSchemaRepo(): SmartSettingSchemaRepo {
return smartSettingSchemaRepo
}
override fun provideSmartSettingCreator(): SmartSettingCreator {
return smartSettingCreator
}
override fun provideSmartSettingDao(): SmartSettingDao {
return smartSettingDao
}
override fun provideSmartSettingSchemaDao(): SmartSettingSchemaDao {
return smartSettingSchemaDao
}
override fun provideSmartSettingSchemaProvider(): SmartSettingSchemaProvider {
return SmartSettingSchemaProvider
}
}
| 35.340278 | 137 | 0.791315 |
174cd466acd6509193dc64fcb80892ffc5bc2a37 | 286 | html | HTML | src/Quest/App/Web/wwwroot/templates/metadata/level.dir.html | patrickCode/Quest | db9ab74f365cf99329d3be2ec4377943a0add8da | [
"MIT"
] | 1 | 2020-08-07T23:42:11.000Z | 2020-08-07T23:42:11.000Z | src/Quest/App/Web/wwwroot/templates/metadata/level.dir.html | patrickCode/Quest | db9ab74f365cf99329d3be2ec4377943a0add8da | [
"MIT"
] | 8 | 2017-03-07T15:03:49.000Z | 2017-03-16T23:12:16.000Z | src/Quest/App/Web/wwwroot/templates/metadata/level.dir.html | patrickCode/Quest | db9ab74f365cf99329d3be2ec4377943a0add8da | [
"MIT"
] | null | null | null | <button class="btn" ng-class='requiredLevel.levelClass' style="padding-top:0px; padding-bottom:0px;" title="{{requiredLevel.description}}">
<span ng-show="showIndex">
{{requiredLevel.levelIndex}} -
</span>
<span>
{{requiredLevel.name}}
</span>
</button> | 35.75 | 140 | 0.643357 |
1cfae43e83dc5f5047f262a0f59d1a0b5c453b56 | 1,509 | css | CSS | data/usercss/174558.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 118 | 2020-08-28T19:59:28.000Z | 2022-03-26T16:28:40.000Z | data/usercss/174558.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 38 | 2020-09-02T01:08:45.000Z | 2022-01-23T02:47:24.000Z | data/usercss/174558.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 21 | 2020-08-19T01:12:43.000Z | 2022-03-15T21:55:17.000Z | /* ==UserStyle==
@name Ask Fedora: Cleaner fixed-width fonts
@namespace USO Archive
@author Frank Dana
@description `Change the default fixed-width font on Ask Fedora. The built-in (and apparently un-modifiable) Discourse default, Consolas, has poor differentiation between some characters. (Most notably, the lowercase-l and the numeral 1.) That makes it a poor font for displaying code snippets and such, which is a pretty critical need for this site.`
@version 20190821.1.54
@license NO-REDISTRIBUTION
@preprocessor uso
@advanced dropdown default_font "Default font" {
default_font_liber "Liberation Mono*" <<<EOT "Liberation Mono", "Lucida Console", "DejaVu Sans Mono",
"Bitstream Vera Sans Mono", Menlo, Consolas, Monaco, "Courier New", monospace; EOT;
default_font_lucida "Lucida Console" <<<EOT "Lucida Console", "Liberation Mono", "DejaVu Sans Mono",
"Bitstream Vera Sans Mono", Menlo, Consolas, Monaco, "Courier New", monospace; EOT;
default_font_menlo "Menlo" <<<EOT Menlo, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono",
"Bitstream Vera Sans Mono", Consolas, Monaco, "Courier New", monospace; EOT;
default_font_monaco "Monaco" <<<EOT Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono",
"Bitstream Vera Sans Mono", Menlo, Consolas,"Courier New", monospace; EOT;
}
==/UserStyle== */
@-moz-document domain("ask.fedoraproject.org") {
code, pre {
font-family: /*[[default_font]]*/
}
} | 58.038462 | 354 | 0.705103 |
0be9141a51e95dae48a235b0aeb0475eeb992c3d | 308 | js | JavaScript | config/esdoc.js | awavering/trackomatic | 337f244c70ea743e27a6bedcd4cb10257f106084 | [
"Apache-2.0"
] | 36 | 2015-05-22T17:56:15.000Z | 2021-05-29T02:36:15.000Z | config/esdoc.js | awavering/trackomatic | 337f244c70ea743e27a6bedcd4cb10257f106084 | [
"Apache-2.0"
] | 36 | 2015-06-03T22:08:38.000Z | 2017-02-21T17:08:57.000Z | config/esdoc.js | awavering/trackomatic | 337f244c70ea743e27a6bedcd4cb10257f106084 | [
"Apache-2.0"
] | 4 | 2015-08-05T23:40:42.000Z | 2018-04-11T14:42:28.000Z | var project = require('../package')
module.exports = {
title: 'Trackomatic',
index: './DOCS.md',
source: './src',
destination: './docs',
plugins: [
{ name: 'esdoc-es7-plugin' }
],
test: {
type: 'mocha',
source: './src',
includes: [
'test\\.js$'
]
},
lint: true
}
| 15.4 | 35 | 0.50974 |
04cb0accee66e18f4fe0cf691179da2570bcefa3 | 687 | tab | SQL | table_parts/05_2019-12-10_LRK_flaring-2_new-A2_8-plates_L80-L87.tab | Adrian-Cantu/modELISA | 86665fe3f13e922f8b26094616f37c37ceb7593b | [
"MIT"
] | null | null | null | table_parts/05_2019-12-10_LRK_flaring-2_new-A2_8-plates_L80-L87.tab | Adrian-Cantu/modELISA | 86665fe3f13e922f8b26094616f37c37ceb7593b | [
"MIT"
] | null | null | null | table_parts/05_2019-12-10_LRK_flaring-2_new-A2_8-plates_L80-L87.tab | Adrian-Cantu/modELISA | 86665fe3f13e922f8b26094616f37c37ceb7593b | [
"MIT"
] | null | null | null | 1 2 3 4 5 6 7 8 9 10 11 12
0.0919 0.0666 0.0535 0.0492 2.2252 0.9035 0.4136 0.1816 2.1246 0.9035 0.4248 0.1837
0.2219 0.1533 0.1093 0.0796 0.2253 0.146 0.1046 0.0778 0.2153 0.1437 0.0973 0.0787
0.2321 0.1499 0.1005 0.0744 0.215 0.14 0.104 0.0773 0.2027 0.1371 0.0988 0.0828
0.1103 0.0737 0.0562 0.0516 0.1098 0.0714 0.0562 0.0502 0.1074 0.0713 0.0574 0.0518
0.1445 0.0787 0.0635 0.0573 0.1331 0.0777 0.0617 0.057 0.1345 0.0769 0.0631 0.0587
0.27 0.1684 0.1097 0.0853 0.2684 0.1734 0.1053 0.0791 0.2539 0.1692 0.1083 0.0815
0.7047 0.3391 0.1815 0.1073 0.7199 0.3354 0.17 0.1025 0.6283 0.3315 0.1745 0.11
0.2295 0.1125 0.0746 0.0577 0.2255 0.1101 0.0707 0.0561 0.2147 0.1149 0.0706 0.0628
| 68.7 | 83 | 0.703057 |
502da2ba3cf8b768ad1904bcd4ad24f02e91ddf9 | 345 | go | Go | WebApp/Example/main.go | Dmdv/GoPlayground | f77d0aaf8beecfe567ed3a8b3df45a6fd1eda7cd | [
"MIT"
] | null | null | null | WebApp/Example/main.go | Dmdv/GoPlayground | f77d0aaf8beecfe567ed3a8b3df45a6fd1eda7cd | [
"MIT"
] | null | null | null | WebApp/Example/main.go | Dmdv/GoPlayground | f77d0aaf8beecfe567ed3a8b3df45a6fd1eda7cd | [
"MIT"
] | null | null | null | package main
import (
"net/http"
"fmt"
)
type defaultHandler struct {
greeting string
}
func (handler defaultHandler) ServeHTTP(w http.ResponseWriter, r *http.Request){
w.Write([]byte (fmt.Sprintf("%v, world!", handler.greeting)))
}
func main() {
http.Handle("/", &defaultHandler{greeting:"Hello"})
http.ListenAndServe(":8001", nil)
}
| 17.25 | 80 | 0.698551 |
15a896e8ae13a78adbee9e41e845456476e1aa9b | 15,177 | swift | Swift | Sources/SwiftTaggerMP4/File/MetadataTagging/Tag.Accessors.R-S.swift | NCrusher74/SwiftTaggerMP4 | 6d966e3bd177f449d577e597d504b824cc5d60fe | [
"Apache-2.0"
] | 7 | 2020-10-16T13:46:55.000Z | 2022-01-20T00:19:24.000Z | Sources/SwiftTaggerMP4/File/MetadataTagging/Tag.Accessors.R-S.swift | NCrusher74/SwiftTaggerMP4 | 6d966e3bd177f449d577e597d504b824cc5d60fe | [
"Apache-2.0"
] | 3 | 2021-07-05T21:36:55.000Z | 2021-09-15T22:51:48.000Z | Sources/SwiftTaggerMP4/File/MetadataTagging/Tag.Accessors.R-S.swift | NCrusher74/SwiftTaggerMP4 | 6d966e3bd177f449d577e597d504b824cc5d60fe | [
"Apache-2.0"
] | 2 | 2021-07-12T12:11:47.000Z | 2022-01-20T00:15:15.000Z | //
// File.swift
//
//
// Created by Nolaine Crusher on 9/2/20.
//
import Foundation
extension Tag {
public var rating: Rating? {
get {
if let atom = metadataAtoms[.rating] as? IntegerMetadataAtom {
return Rating(rawValue: atom.intValue)
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try IntegerMetadataAtom(identifier: .rating, intValue: new.rawValue)
metadataAtoms[.rating] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(IntegerMetadataIdentifier.rating)")
}
} else {
metadataAtoms[.rating] = nil
}
}
}
public var showWorkAndMovement: Bool? {
get {
if let atom = metadataAtoms[.showWorkAndMovement] as? IntegerMetadataAtom {
if atom.intValue == 1 {
return true
} else {
return false
}
} else {
return nil
}
}
set {
if let new = newValue {
do {
if new == true {
let atom = try IntegerMetadataAtom(identifier: .showWorkAndMovement, intValue: 1)
metadataAtoms[.showWorkAndMovement] = atom
} else {
let atom = try IntegerMetadataAtom(identifier: .showWorkAndMovement, intValue: 0)
metadataAtoms[.showWorkAndMovement] = atom
}
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(IntegerMetadataIdentifier.showWorkAndMovement)")
}
} else {
metadataAtoms[.showWorkAndMovement] = nil
}
}
}
@available(OSX 10.12, iOS 12.0, *)
public var recordingDate: Date? {
get {
if let atom = metadataAtoms[.recordingDate] as? StringMetadataAtom {
let string = atom.stringValue
if let date = string.attemptDateFromString() {
return date
} else {
return nil
}
} else {
return nil
}
}
set {
if let new = newValue {
let formatter = ISO8601DateFormatter()
let timeZone = TimeZone(secondsFromGMT: 0) ?? .current
formatter.formatOptions = .withInternetDateTime
formatter.timeZone = timeZone
do {
let atom = try StringMetadataAtom(identifier: .recordingDate, stringValue: formatter.string(from: new))
metadataAtoms[.recordingDate] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.recordingDate)")
}
} else {
metadataAtoms[.recordingDate] = nil
}
}
}
@available(OSX 10.12, iOS 12.0, *)
public var releaseDate: Date? {
get {
if let atom = metadataAtoms[.releaseDate] as? StringMetadataAtom {
let string = atom.stringValue
if let date = string.attemptDateFromString() {
return date
} else {
return nil
}
} else {
return nil
}
}
set {
if let new = newValue {
let formatter = ISO8601DateFormatter()
let timeZone = TimeZone(secondsFromGMT: 0) ?? .current
formatter.formatOptions = .withInternetDateTime
formatter.timeZone = timeZone
do {
let atom = try StringMetadataAtom(identifier: .releaseDate, stringValue: formatter.string(from: new))
metadataAtoms[.releaseDate] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.releaseDate)")
}
} else {
metadataAtoms[.releaseDate] = nil
}
}
}
public var songwriterKeywords: [String]? {
get {
if let atom = metadataAtoms[.songwriterKeywords] as? StringMetadataAtom {
return atom.stringValue.toArray
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .songwriterKeywords, stringValue: new.toString)
metadataAtoms[.songwriterKeywords] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.songwriterKeywords)")
}
} else {
metadataAtoms[.songwriterKeywords] = nil
}
}
}
public var subtitleKeywords: [String]? {
get {
if let atom = metadataAtoms[.subtitleKeywords] as? StringMetadataAtom {
return atom.stringValue.toArray
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .subtitleKeywords, stringValue: new.toString)
metadataAtoms[.subtitleKeywords] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.subtitleKeywords)")
}
} else {
metadataAtoms[.subtitleKeywords] = nil
}
}
}
public var recordCompany: String? {
get {
if let atom = metadataAtoms[.recordCompany] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .recordCompany, stringValue: new)
metadataAtoms[.recordCompany] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.recordCompany)")
}
} else {
metadataAtoms[.recordCompany] = nil
}
}
}
public var recordCompanyUrl: String? {
get {
if let atom = metadataAtoms[.recordCompanyUrl] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .recordCompanyUrl, stringValue: new)
metadataAtoms[.recordCompanyUrl] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.recordCompanyUrl)")
}
} else {
metadataAtoms[.recordCompanyUrl] = nil
}
}
}
public var recordingCopyright: String? {
get {
if let atom = metadataAtoms[.recordingCopyright] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .recordingCopyright, stringValue: new)
metadataAtoms[.recordingCopyright] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.recordingCopyright)")
}
} else {
metadataAtoms[.recordingCopyright] = nil
}
}
}
public var requirements: String? {
get {
if let atom = metadataAtoms[.requirements] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .requirements, stringValue: new)
metadataAtoms[.requirements] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.requirements)")
}
} else {
metadataAtoms[.requirements] = nil
}
}
}
public var sellerID: String? {
get {
if let atom = metadataAtoms[.sellerID] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .sellerID, stringValue: new)
metadataAtoms[.sellerID] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.sellerID)")
}
} else {
metadataAtoms[.sellerID] = nil
}
}
}
public var soundEngineer: String? {
get {
if let atom = metadataAtoms[.soundEngineer] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .soundEngineer, stringValue: new)
metadataAtoms[.soundEngineer] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.soundEngineer)")
}
} else {
metadataAtoms[.soundEngineer] = nil
}
}
}
public var softwareVersion: String? {
get {
if let atom = metadataAtoms[.softwareVersion] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .softwareVersion, stringValue: new)
metadataAtoms[.softwareVersion] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.softwareVersion)")
}
} else {
metadataAtoms[.softwareVersion] = nil
}
}
}
public var soloist: String? {
get {
if let atom = metadataAtoms[.soloist] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .soloist, stringValue: new)
metadataAtoms[.soloist] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.soloist)")
}
} else {
metadataAtoms[.soloist] = nil
}
}
}
public var songDescription: String? {
get {
if let atom = metadataAtoms[.songDescription] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .songDescription, stringValue: new)
metadataAtoms[.songDescription] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.songDescription)")
}
} else {
metadataAtoms[.songDescription] = nil
}
}
}
public var songwriter: String? {
get {
if let atom = metadataAtoms[.songwriter] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .songwriter, stringValue: new)
metadataAtoms[.songwriter] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.songwriter)")
}
} else {
metadataAtoms[.songwriter] = nil
}
}
}
public var sourceCredit: String? {
get {
if let atom = metadataAtoms[.sourceCredit] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .sourceCredit, stringValue: new)
metadataAtoms[.sourceCredit] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.sourceCredit)")
}
} else {
metadataAtoms[.sourceCredit] = nil
}
}
}
public var subtitle: String? {
get {
if let atom = metadataAtoms[.subtitle] as? StringMetadataAtom {
return atom.stringValue
} else {
return nil
}
}
set {
if let new = newValue {
do {
let atom = try StringMetadataAtom(identifier: .subtitle, stringValue: new)
metadataAtoms[.subtitle] = atom
} catch {
fatalError("WARNING: Unable to initialize metadata atom with identifier \(StringMetadataIdentifier.subtitle)")
}
} else {
metadataAtoms[.subtitle] = nil
}
}
}
}
| 34.809633 | 142 | 0.48758 |
2d53329e25b3a410a4a0750701eddb67a8bd48b3 | 346 | kt | Kotlin | uiview/src/androidTest/java/com/app/base/BaseItemUIView.kt | angcyo/RLibrary | b4869afa5ca2522289942d438a99a160b1d60a40 | [
"Apache-2.0"
] | 8 | 2017-06-28T07:30:18.000Z | 2018-06-19T10:08:43.000Z | uiview/src/androidTest/java/com/app/base/BaseItemUIView.kt | angcyo/RLibrary | b4869afa5ca2522289942d438a99a160b1d60a40 | [
"Apache-2.0"
] | null | null | null | uiview/src/androidTest/java/com/app/base/BaseItemUIView.kt | angcyo/RLibrary | b4869afa5ca2522289942d438a99a160b1d60a40 | [
"Apache-2.0"
] | 10 | 2017-05-27T13:48:57.000Z | 2021-03-22T06:48:50.000Z | package com.app.base
import android.graphics.Color
import com.angcyo.uiview.base.SingleItem
import com.angcyo.uiview.base.UIItemUIView
/**
* Created by angcyo on 2018/02/13 23:09
*/
abstract class BaseItemUIView : UIItemUIView<SingleItem>() {
override fun getDefaultBackgroundColor(): Int {
return Color.WHITE
}
} | 24.714286 | 61 | 0.716763 |
7f64a1c64c4245876d03728cd0a11bb45b4cb523 | 13,451 | html | HTML | baoxiaoguanli.html | gaoShan3westSoft/table | 43ab05a62c18dee2a8b3a026366ab841c8a77db4 | [
"MIT"
] | null | null | null | baoxiaoguanli.html | gaoShan3westSoft/table | 43ab05a62c18dee2a8b3a026366ab841c8a77db4 | [
"MIT"
] | null | null | null | baoxiaoguanli.html | gaoShan3westSoft/table | 43ab05a62c18dee2a8b3a026366ab841c8a77db4 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加费用报销登记</title>
<link href="lib/bootstrap.min.css?v=3.4.0" rel="stylesheet">
<link href="lib/font-awesome.css?v=4.3.0" rel="stylesheet">
<link href="lib/animate.css" rel="stylesheet">
<link href="lib/style.css?v=3.0.0" rel="stylesheet">
<!--<link rel="stylesheet" href="./bootstrap-3.3.7-dist/css/bootstrap.min.css">-->
<!--<script src="./bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>-->
<style>
.form-control{
width: 300px;
}
.confrimInput{
margin-left: 20px;
}
.addInpu{
}
#toAdd{
margin-left: -6px;
}
</style>
</head>
<body>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>添加费用报销登记</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="">
<i class="fa fa-wrench"></i>
</a>
<!-- <ul class="dropdown-menu dropdown-user">
<li><a href="form_basic.html#">选项1</a>
</li>
<li><a href="form_basic.html#">选项2</a>
</li>
</ul> -->
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<form method="post" action="/center/reimbursement/save" class="form-horizontal m-t" id="commentForm">
<div class="form-group">
<label class="col-sm-2 control-label">管理类型选择</label>
<select class="col-sm-2 form-control" id="managerTypeSel" >
<option value="2">施工管理</option>
<option value="1">项目管理</option>
</select>
</div>
<div class="form-group" id="projectNum">
<label class="control-label col-sm-2">项目编号</label>
<input type="text" class="form-control col-sm-2" placeholder="请输入项目编号" id="projInput">
<input type="button" class="btn btn-primary confrimInput" value="确认" id="checkProjectNum">
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-2 control-label">项目费用id</label>
<div class="col-sm-3">
<input type="text" id="costId" name="costId" class="form-control" number="true" required="" aria-required="true" >
<span class="help-block m-b-none">说明:在项目详情费用列表最开头的数字</span>
</div>
</div>
<div id="project">
</div>
<div id="cost">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">报销人</label>
<div class="col-sm-2">
<input type="text" name="reimbursement" class="form-control" required="" aria-required="true" >
</div>
</div>
<!--<label class="col-sm-2 control-label">报销人</label>-->
<!--<div class="col-sm-2">-->
<!--<input type="text" name="reimbursement" class="form-control" required="" aria-required="true" >-->
<!--</div>-->
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-2 control-label">报销金额</label>
<div class="col-sm-2">
<input type="text" name="reimbursementAmount" class="form-control" number="true" required="" aria-required="true" >
</div>
</div>
<!--<div class="form-group">-->
<!--<label class="col-sm-2 control-label">报销金额</label>-->
<!--<div class="col-sm-2">-->
<!--<input type="text" name="reimbursementAmount" class="form-control" number="true" required="" aria-required="true" >-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<label class="col-sm-2 control-label">报销类别</label>
<div class="col-sm-4">
<select class="form-control m-b" name="type" required="" aria-required="true" id="bxSel">
<option value="" selected="selected">请选择</option>
<option value="CLSXJE">材料授信金额</option>
<option value="JJFY">基建费用</option>
<option value="AZFY">安装费用</option>
<option value="YSFY">运输费用</option>
<option value="XMGGFY">项目公关费用</option>
<option value="WXYT">维修预提</option>
<option value="CL">差旅</option>
<option value="ZBJ">质保金</option>
<option value="YWTC">业务提成</option>
<option value="CJ">差价</option>
<option value="QTFY">其它费用</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">内容详细</label>
<div class="col-sm-2">
<input type="text" name="contentDetail" class="form-control" required="" aria-required="true" >
</div>
</div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn btn-primary" id="submitContent" type="submit">保存内容</button>
<button class="btn btn-white" type="button">取消</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- 全局js -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script src="/js/jquery-2.1.1.min.js"></script>
<script src="/js/bootstrap.min.js?v=3.4.0"></script>
<!-- 自定义js -->
<script src="/js/content.js?v=1.0.0"></script>
<!-- jQuery Validation plugin javascript-->
<script src="/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/js/plugins/validate/messages_zh.min.js"></script>
<script src="/js/plugins/layer/laydate/laydate.js"></script>
<script>
//以下为修改jQuery Validation插件兼容Bootstrap的方法,没有直接写在插件中是为了便于插件升级
$.validator.setDefaults({
highlight: function (element) {
$(element).closest('.form-group').removeClass('has-success').addClass('has-error');
},
success: function (element) {
element.closest('.form-group').removeClass('has-error').addClass('has-success');
},
errorElement: "span",
errorPlacement: function (error, element) {
if (element.is(":radio") || element.is(":checkbox")) {
error.appendTo(element.parent().parent().parent());
} else {
error.appendTo(element.parent());
}
},
errorClass: "help-block m-b-none",
validClass: "help-block m-b-none"
});
$().ready(function () {
// validate the comment form when it is submitted
$("#commentForm").validate();
});
$('.btn-white').click(function(){
window.location.href="/center/reimbursement/list";
});
//查询项目
$("#costId").blur(function(){
var costId = $('#costId').val();
if(costId == null || costId == "" || costId == undefined){
alert("请输入项目编号");
return ;
}
$.ajax({
url:"/center/reimbursement/getProAndInstall",
data : {
"costId":costId
},
type:"post",
dataType : "json",
cache : false,
success : function(obj, textStatus) {
var projectName = obj.data.projectName;
var costName = obj.data.costName;
var htmlProject = '<div class="form-group">'+
'<label class="col-sm-2 control-label">报销的项目名称</label>'+
'<div class="col-sm-2">'+
'<input type="text" value="'+projectName+'" disabled="disabled" class="form-control">'+
'</div>'+
'</div>';
var htmlCost = '<div class="form-group">'+
'<label class="col-sm-2 control-label">项目费用类型</label>'+
'<div class="col-sm-2">'+
'<input type="text" value="'+costName+'" disabled="disabled" class="form-control">'+
'</div>'+
'</div>';
if (obj.status == 1) {
$('#project').html(htmlProject);
$('#cost').html(htmlCost);
$('#submitContent').attr("disabled",false);
}
else if(obj.status==2){
alert("未查到此id的项目费用,请重新输入有效的id");
$('#submitContent').attr("disabled",true);
}
else if(obj.status==3){
$('#project').html(htmlProject);
$('#cost').html(htmlCost);
alert("此费用类型下的报销已添过,请务必重复添加");
$('#submitContent').attr("disabled",true);
}
},
error : function(textStatus, e) {
alert("系统ajax交互错误: " + textStatus);
}
});
});
</script>
<script>
$('#managerTypeSel').change(function () {
$('#bxSel').empty()
var seloptArray=[]
var seloptValueArrya=[]
var selval = $('#managerTypeSel').val()
console.log("sel:",selval)
if(selval == 1){
//项目
$('#projectNum').hide()
seloptArray = ['差旅费','宴请','公关','油费','其它']
seloptValueArrya = ['CLF','YQ','GG','YF','QT']
}else {
//施工管理
$('#projectNum').show()
seloptArray = ['材料授信金额','基建费用','安装费用','运输费用','项目公关费用','维修预提','差旅','质保金','业务提成','差价','其它费用']
seloptValueArrya = ['CLSXJE','JJFY','AZFY','YSFY','XMGGFY','WXYT','CL','ZBJ','YWTC','CJ','QTFY']
}
for(var i=0;i<seloptArray.length;i++){
var value = seloptValueArrya[i]
var text = seloptArray[i]
//console.log(value,text)
$("#bxSel").append("<option value="+"/'"+value+"/'"+">"+text+"</option>")
console.log("<option value="+"/'"+value+"/'"+">"+text+"</option>")
}
});
$("#checkProjectNum").click(function(){
var projectNum = $('#projInput').val();
console.log("projectNum:"+projectNum)
if(projectNum == null || projectNum == "" || projectNum == undefined){
alert("请输入项目编号");
return ;
}
// $.ajax({
// url:"",
// data : {
// "costId":costId
// },
// type:"post",
// dataType : "json",
// cache : false,
// success : function(obj, textStatus) {
// if (textStatus == 200) {
//
// }
// }
// },
// error : function(textStatus, e) {
// alert("系统ajax交互错误: " + textStatus);
// }
if (true){
$('#toAdd').remove()
var projectName = '田总的项目'
var str = "<div class='form-group' id='toAdd'><div class='form-group'><label class='col-sm-2 control-label'></label><div class='col-sm-2'><input type=\"text\" value="+projectName+" disabled=\"disabled\" class=\"form-control\"></div></div></div>"
$('#projectNum').append(str)
// $('#projectNum').append('<input type="text" value="'+projectName+'" disabled="disabled" class="form-control">')
}else {
}
});
</script>
</body>
</html> | 45.751701 | 261 | 0.428072 |
1be39096bfb4bd1cb1562e5c7bc5c7bdb619032a | 264 | py | Python | Web/Member/FunctionForPI/Client.py | tratitude/BridgeMaster | e3916b077d96f3520d0a8ed9bb548d614465aa2e | [
"Apache-2.0"
] | 1 | 2021-01-05T14:40:08.000Z | 2021-01-05T14:40:08.000Z | Web/Member/FunctionForPI/Client.py | fdmdkw/BridgeMaster | e3916b077d96f3520d0a8ed9bb548d614465aa2e | [
"Apache-2.0"
] | 1 | 2021-10-19T08:05:06.000Z | 2021-10-19T08:05:06.000Z | Web/Member/FunctionForPI/Client.py | fdmdkw/BridgeMaster | e3916b077d96f3520d0a8ed9bb548d614465aa2e | [
"Apache-2.0"
] | 2 | 2019-10-21T15:25:37.000Z | 2021-03-17T06:59:09.000Z | from websocket import create_connection
ws = create_connection("ws://localhost:8000/Member/on_open/MGD4")
print("Sending 'Hello, World'...")
ws.send("Hello, World")
print("Sent")
print("Receiving...")
result = ws.recv()
print("Received '%s'" % result)
ws.close() | 26.4 | 65 | 0.708333 |
3d02e544f4c4f309055f98c0331cef9876356531 | 29,896 | go | Go | apis/route_handler_test.go | cloudfoundry/cf-k8s-api | d88c78e6562e06cb1e5984b068239d352fdf4c3a | [
"Apache-2.0"
] | 3 | 2021-09-27T18:22:13.000Z | 2021-10-17T21:29:35.000Z | apis/route_handler_test.go | cloudfoundry/cf-k8s-api | d88c78e6562e06cb1e5984b068239d352fdf4c3a | [
"Apache-2.0"
] | 109 | 2021-08-11T16:58:42.000Z | 2021-11-02T18:01:47.000Z | apis/route_handler_test.go | cloudfoundry/cf-k8s-api | d88c78e6562e06cb1e5984b068239d352fdf4c3a | [
"Apache-2.0"
] | 1 | 2021-09-24T09:37:28.000Z | 2021-09-24T09:37:28.000Z | package apis_test
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"strings"
. "code.cloudfoundry.org/cf-k8s-api/apis"
"code.cloudfoundry.org/cf-k8s-api/apis/fake"
"code.cloudfoundry.org/cf-k8s-api/repositories"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/client-go/rest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
)
var _ = Describe("RouteHandler", func() {
Describe("the GET /v3/routes/:guid endpoint", func() {
const (
testDomainGUID = "test-domain-guid"
testRouteGUID = "test-route-guid"
testRouteHost = "test-route-host"
testSpaceGUID = "test-space-guid"
)
var (
routeRepo *fake.CFRouteRepository
domainRepo *fake.CFDomainRepository
appRepo *fake.CFAppRepository
clientBuilder *fake.ClientBuilder
)
BeforeEach(func() {
routeRepo = new(fake.CFRouteRepository)
domainRepo = new(fake.CFDomainRepository)
appRepo = new(fake.CFAppRepository)
clientBuilder = new(fake.ClientBuilder)
routeRepo.FetchRouteReturns(repositories.RouteRecord{
GUID: testRouteGUID,
SpaceGUID: testSpaceGUID,
DomainRef: repositories.DomainRecord{
GUID: testDomainGUID,
},
Host: testRouteHost,
Protocol: "http",
CreatedAt: "create-time",
UpdatedAt: "update-time",
}, nil)
domainRepo.FetchDomainReturns(repositories.DomainRecord{
GUID: testDomainGUID,
Name: "example.org",
}, nil)
routeHandler := NewRouteHandler(
logf.Log.WithName("TestRouteHandler"),
*serverURL,
routeRepo,
domainRepo,
appRepo,
clientBuilder.Spy,
&rest.Config{}, // required for k8s client (transitive dependency from route repo)
)
routeHandler.RegisterRoutes(router)
var err error
req, err = http.NewRequest("GET", fmt.Sprintf("/v3/routes/%s", testRouteGUID), nil)
Expect(err).NotTo(HaveOccurred())
})
When("on the happy path", func() {
BeforeEach(func() {
router.ServeHTTP(rr, req)
})
It("returns status 200 OK", func() {
Expect(rr.Code).To(Equal(http.StatusOK), "Matching HTTP response code:")
})
It("returns Content-Type as JSON in header", func() {
contentTypeHeader := rr.Header().Get("Content-Type")
Expect(contentTypeHeader).To(Equal(jsonHeader), "Matching Content-Type header:")
})
It("returns the Route in the response", func() {
expectedBody := fmt.Sprintf(`{
"guid": "test-route-guid",
"port": null,
"path": "",
"protocol": "http",
"host": "test-route-host",
"url": "test-route-host.example.org",
"created_at": "create-time",
"updated_at": "update-time",
"destinations": [],
"relationships": {
"space": {
"data": {
"guid": "test-space-guid"
}
},
"domain": {
"data": {
"guid": "test-domain-guid"
}
}
},
"metadata": {
"labels": {},
"annotations": {}
},
"links": {
"self":{
"href": "%[1]s/v3/routes/test-route-guid"
},
"space":{
"href": "%[1]s/v3/spaces/test-space-guid"
},
"domain":{
"href": "%[1]s/v3/domains/test-domain-guid"
},
"destinations":{
"href": "%[1]s/v3/routes/test-route-guid/destinations"
}
}
}`, defaultServerURL)
Expect(rr.Body.String()).To(MatchJSON(expectedBody), "Response body matches response:")
})
It("fetches the correct route", func() {
Expect(routeRepo.FetchRouteCallCount()).To(Equal(1), "Repo FetchRoute was not called")
_, _, actualRouteGUID := routeRepo.FetchRouteArgsForCall(0)
Expect(actualRouteGUID).To(Equal(testRouteGUID), "FetchRoute was not passed the correct GUID")
})
It("fetches the correct domain", func() {
Expect(domainRepo.FetchDomainCallCount()).To(Equal(1), "Repo FetchDomain was not called")
_, _, actualDomainGUID := domainRepo.FetchDomainArgsForCall(0)
Expect(actualDomainGUID).To(Equal(testDomainGUID), "FetchDomain was not passed the correct GUID")
})
})
When("the route cannot be found", func() {
BeforeEach(func() {
routeRepo.FetchRouteReturns(repositories.RouteRecord{}, repositories.NotFoundError{Err: errors.New("not found")})
router.ServeHTTP(rr, req)
})
It("returns an error", func() {
expectNotFoundError("Route not found")
})
})
When("the route's domain cannot be found", func() {
BeforeEach(func() {
domainRepo.FetchDomainReturns(repositories.DomainRecord{}, repositories.NotFoundError{Err: errors.New("not found")})
router.ServeHTTP(rr, req)
})
It("returns an error", func() {
expectUnknownError()
})
})
When("there is some other error fetching the route", func() {
BeforeEach(func() {
routeRepo.FetchRouteReturns(repositories.RouteRecord{}, errors.New("unknown!"))
router.ServeHTTP(rr, req)
})
It("returns an error", func() {
expectUnknownError()
})
})
})
Describe("the GET /v3/routes endpoint", func() {
const (
testDomainGUID = "test-domain-guid"
testRouteGUID = "test-route-guid"
testRouteHost = "test-route-host"
testSpaceGUID = "test-space-guid"
)
var (
routeRepo *fake.CFRouteRepository
domainRepo *fake.CFDomainRepository
appRepo *fake.CFAppRepository
clientBuilder *fake.ClientBuilder
domainRecord *repositories.DomainRecord
routeRecord *repositories.RouteRecord
)
BeforeEach(func() {
routeRepo = new(fake.CFRouteRepository)
domainRepo = new(fake.CFDomainRepository)
appRepo = new(fake.CFAppRepository)
clientBuilder = new(fake.ClientBuilder)
routeRecord = &repositories.RouteRecord{
GUID: testRouteGUID,
SpaceGUID: testSpaceGUID,
DomainRef: repositories.DomainRecord{
GUID: testDomainGUID,
},
Host: testRouteHost,
Path: "/some_path",
Protocol: "http",
Destinations: nil,
Labels: nil,
Annotations: nil,
CreatedAt: "2019-05-10T17:17:48Z",
UpdatedAt: "2019-05-10T17:17:48Z",
}
routeRepo.FetchRouteListReturns([]repositories.RouteRecord{
*routeRecord,
}, nil)
domainRecord = &repositories.DomainRecord{
GUID: testDomainGUID,
Name: "example.org",
}
domainRepo.FetchDomainReturns(*domainRecord, nil)
routeHandler := NewRouteHandler(
logf.Log.WithName("TestRouteHandler"),
*serverURL,
routeRepo,
domainRepo,
appRepo,
clientBuilder.Spy,
&rest.Config{}, // required for k8s client (transitive dependency from route repo)
)
routeHandler.RegisterRoutes(router)
var err error
req, err = http.NewRequest("GET", "/v3/routes", nil)
Expect(err).NotTo(HaveOccurred())
})
JustBeforeEach(func() {
router.ServeHTTP(rr, req)
})
When("on the happy path", func() {
It("returns status 200 OK", func() {
Expect(rr.Code).To(Equal(http.StatusOK), "Matching HTTP response code:")
})
It("returns Content-Type as JSON in header", func() {
contentTypeHeader := rr.Header().Get("Content-Type")
Expect(contentTypeHeader).To(Equal(jsonHeader), "Matching Content-Type header:")
})
It("returns the Pagination Data and App Resources in the response", func() {
Expect(rr.Body.String()).To(MatchJSON(fmt.Sprintf(`{
"pagination": {
"total_results": 1,
"total_pages": 1,
"first": {
"href": "%[1]s/v3/routes?page=1"
},
"last": {
"href": "%[1]s/v3/routes?page=1"
},
"next": null,
"previous": null
},
"resources": [
{
"guid": "%[2]s",
"port": null,
"path": "%[3]s",
"protocol": "%[4]s",
"host": "%[5]s",
"url": "%[5]s.%[6]s%[3]s",
"created_at": "%[7]s",
"updated_at": "%[8]s",
"destinations": [],
"relationships": {
"space": {
"data": {
"guid": "%[9]s"
}
},
"domain": {
"data": {
"guid": "%[10]s"
}
}
},
"metadata": {
"labels": {},
"annotations": {}
},
"links": {
"self":{
"href": "%[1]s/v3/routes/%[2]s"
},
"space":{
"href": "%[1]s/v3/spaces/%[9]s"
},
"domain":{
"href": "%[1]s/v3/domains/%[10]s"
},
"destinations":{
"href": "%[1]s/v3/routes/%[2]s/destinations"
}
}
}
]
}`, defaultServerURL, routeRecord.GUID, routeRecord.Path, routeRecord.Protocol, routeRecord.Host, domainRecord.Name, routeRecord.CreatedAt, routeRecord.UpdatedAt, routeRecord.SpaceGUID, domainRecord.GUID)), "Response body matches response:")
})
})
When("no routes exist", func() {
BeforeEach(func() {
routeRepo.FetchRouteListReturns([]repositories.RouteRecord{}, nil)
})
It("returns status 200 OK", func() {
Expect(rr.Code).To(Equal(http.StatusOK), "Matching HTTP response code:")
})
It("returns Content-Type as JSON in header", func() {
contentTypeHeader := rr.Header().Get("Content-Type")
Expect(contentTypeHeader).To(Equal(jsonHeader), "Matching Content-Type header:")
})
It("returns an empty list in the response", func() {
expectedBody := fmt.Sprintf(`{
"pagination": {
"total_results": 0,
"total_pages": 1,
"first": {
"href": "%[1]s/v3/routes?page=1"
},
"last": {
"href": "%[1]s/v3/routes?page=1"
},
"next": null,
"previous": null
},
"resources": [
]
}`, defaultServerURL)
Expect(rr.Body.String()).To(MatchJSON(expectedBody), "Response body matches response:")
})
})
When("there is a failure Listing Routes", func() {
BeforeEach(func() {
routeRepo.FetchRouteListReturns([]repositories.RouteRecord{}, errors.New("unknown!"))
})
It("returns an error", func() {
expectUnknownError()
})
})
When("there is a failure finding a Domain", func() {
BeforeEach(func() {
domainRepo.FetchDomainReturns(repositories.DomainRecord{}, errors.New("unknown!"))
})
It("returns an error", func() {
expectUnknownError()
})
})
})
Describe("the POST /v3/routes endpoint", func() {
const (
testDomainGUID = "test-domain-guid"
testDomainName = "test-domain-name"
testRouteGUID = "test-route-guid"
testRouteHost = "test-route-host"
testRoutePath = "/test-route-path"
testSpaceGUID = "test-space-guid"
)
var (
routeRepo *fake.CFRouteRepository
domainRepo *fake.CFDomainRepository
appRepo *fake.CFAppRepository
clientBuilder *fake.ClientBuilder
)
makePostRequest := func(requestBody string) {
req, err := http.NewRequest("POST", "/v3/routes", strings.NewReader(requestBody))
Expect(err).NotTo(HaveOccurred())
router.ServeHTTP(rr, req)
}
BeforeEach(func() {
routeRepo = new(fake.CFRouteRepository)
domainRepo = new(fake.CFDomainRepository)
appRepo = new(fake.CFAppRepository)
clientBuilder = new(fake.ClientBuilder)
apiHandler := NewRouteHandler(
logf.Log.WithName("TestRouteHandler"),
*serverURL,
routeRepo,
domainRepo,
appRepo,
clientBuilder.Spy,
&rest.Config{}, // required for k8s client (transitive dependency from route repo)
)
apiHandler.RegisterRoutes(router)
})
When("the space exists and the route does not exist and", func() {
When("a plain POST test route request is sent without metadata", func() {
BeforeEach(func() {
appRepo.FetchNamespaceReturns(repositories.SpaceRecord{
Name: testSpaceGUID,
}, nil)
domainRepo.FetchDomainReturns(repositories.DomainRecord{
GUID: testDomainGUID,
Name: testDomainName,
}, nil)
routeRepo.CreateRouteReturns(repositories.RouteRecord{
GUID: testRouteGUID,
SpaceGUID: testSpaceGUID,
DomainRef: repositories.DomainRecord{
GUID: testDomainGUID,
},
Host: testRouteHost,
Path: testRoutePath,
Protocol: "http",
CreatedAt: "create-time",
UpdatedAt: "update-time",
}, nil)
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, testSpaceGUID, testDomainGUID, nil, nil)
makePostRequest(requestBody)
})
It("checks that the specified namespace exists", func() {
Expect(appRepo.FetchNamespaceCallCount()).To(Equal(1), "Repo FetchNamespace was not called")
_, _, actualSpaceGUID := appRepo.FetchNamespaceArgsForCall(0)
Expect(actualSpaceGUID).To(Equal(testSpaceGUID), "FetchNamespace was not passed the correct GUID")
})
It("checks that the specified domain exists", func() {
Expect(domainRepo.FetchDomainCallCount()).To(Equal(1), "Repo FetchDomain was not called")
_, _, actualDomainGUID := domainRepo.FetchDomainArgsForCall(0)
Expect(actualDomainGUID).To(Equal(testDomainGUID), "FetchDomain was not passed the correct GUID")
})
It("invokes repo CreateRoute with a random GUID", func() {
Expect(routeRepo.CreateRouteCallCount()).To(Equal(1), "Repo CreateRoute count was not called")
_, _, createRouteRecord := routeRepo.CreateRouteArgsForCall(0)
Expect(createRouteRecord.GUID).To(MatchRegexp("^[-0-9a-f]{36}$"), "CreateRoute record GUID was not a 36 character guid")
})
It("returns status 200 OK", func() {
Expect(rr.Code).To(Equal(http.StatusOK), "Matching HTTP response code:")
})
It("returns Content-Type as JSON in header", func() {
Expect(rr.Header().Get("Content-Type")).To(Equal(jsonHeader), "Matching Content-Type header:")
})
It("returns the created route in the response", func() {
Expect(rr.Body.String()).To(MatchJSON(fmt.Sprintf(`{
"guid": "test-route-guid",
"protocol": "http",
"port": null,
"host": "test-route-host",
"path": "/test-route-path",
"url": "test-route-host.test-domain-name/test-route-path",
"created_at": "create-time",
"updated_at": "update-time",
"destinations": [],
"metadata": {
"labels": {},
"annotations": {}
},
"relationships": {
"space": {
"data": {
"guid": "test-space-guid"
}
},
"domain": {
"data": {
"guid": "test-domain-guid"
}
}
},
"links": {
"self": {
"href": "%[1]s/v3/routes/test-route-guid"
},
"space": {
"href": "%[1]s/v3/spaces/test-space-guid"
},
"domain": {
"href": "%[1]s/v3/domains/test-domain-guid"
},
"destinations": {
"href": "%[1]s/v3/routes/test-route-guid/destinations"
}
}
}`, defaultServerURL)), "Response body mismatch")
})
})
When("a POST test route request is sent with metadata labels", func() {
var testLabels map[string]string
BeforeEach(func() {
testLabels = map[string]string{"label1": "foo", "label2": "bar"}
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, testSpaceGUID, testDomainGUID, testLabels, nil)
makePostRequest(requestBody)
})
It("should pass along the labels to CreateRoute", func() {
Expect(routeRepo.CreateRouteCallCount()).To(Equal(1), "Repo CreateRoute count was not invoked 1 time")
_, _, createRouteRecord := routeRepo.CreateRouteArgsForCall(0)
Expect(createRouteRecord.Labels).To(Equal(testLabels))
})
})
When("a POST test route request is sent with metadata annotations", func() {
var testAnnotations map[string]string
BeforeEach(func() {
testAnnotations = map[string]string{"annotation1": "foo", "annotation2": "bar"}
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, testSpaceGUID, testDomainGUID, nil, testAnnotations)
makePostRequest(requestBody)
})
It("should pass along the annotations to CreateRoute", func() {
Expect(routeRepo.CreateRouteCallCount()).To(Equal(1), "Repo CreateRoute count was not invoked 1 time")
_, _, createRouteRecord := routeRepo.CreateRouteArgsForCall(0)
Expect(createRouteRecord.Annotations).To(Equal(testAnnotations))
})
})
})
When("the request body is invalid JSON", func() {
BeforeEach(func() {
makePostRequest(`{`)
})
It("returns a status 400 Bad Request ", func() {
Expect(rr.Code).To(Equal(http.StatusBadRequest), "Matching HTTP response code:")
})
It("returns Content-Type as JSON in header", func() {
Expect(rr.Header().Get("Content-Type")).To(Equal(jsonHeader), "Matching Content-Type header:")
})
It("has the expected error response body", func() {
Expect(rr.Body.String()).To(MatchJSON(`{
"errors": [
{
"title": "CF-MessageParseError",
"detail": "Request invalid due to parse error: invalid request body",
"code": 1001
}
]
}`), "Response body matches response:")
})
})
When("the request body includes an unknown description field", func() {
BeforeEach(func() {
makePostRequest(`{"description" : "Invalid Request"}`)
})
It("returns an error", func() {
expectUnprocessableEntityError(`invalid request body: json: unknown field "description"`)
})
})
When("the host is missing", func() {
BeforeEach(func() {
makePostRequest(`{
"relationships": {
"domain": {
"data": {
"guid": "0b78dd5d-c723-4f2e-b168-df3c3e1d0806"
}
},
"space": {
"data": {
"guid": "0c78dd5d-c723-4f2e-b168-df3c3e1d0806"
}
}
}
}`)
})
It("returns an error", func() {
expectUnprocessableEntityError("Key: 'RouteCreate.Host' Error:Field validation for 'Host' failed on the 'hostname_rfc1123' tag")
})
})
When("the host is not a string", func() {
BeforeEach(func() {
makePostRequest(`{
"host": 12345,
"relationships": {
"space": {
"data": {
"guid": "2f35885d-0c9d-4423-83ad-fd05066f8576"
}
}
}
}`)
})
It("returns an error", func() {
expectUnprocessableEntityError("Host must be a string")
})
})
When("the host format is invalid", func() {
BeforeEach(func() {
makePostRequest(`{
"host": "!-invalid-hostname-!",
"relationships": {
"domain": {
"data": {
"guid": "0b78dd5d-c723-4f2e-b168-df3c3e1d0806"
}
},
"space": {
"data": {
"guid": "2f35885d-0c9d-4423-83ad-fd05066f8576"
}
}
}
}`)
})
It("returns an error", func() {
expectUnprocessableEntityError("Key: 'RouteCreate.Host' Error:Field validation for 'Host' failed on the 'hostname_rfc1123' tag")
})
})
When("the host too long", func() {
BeforeEach(func() {
makePostRequest(`{
"host": "a-really-long-hostname-that-is-not-valid-according-to-the-dns-rfc",
"relationships": {
"domain": {
"data": {
"guid": "0b78dd5d-c723-4f2e-b168-df3c3e1d0806"
}
},
"space": {
"data": {
"guid": "2f35885d-0c9d-4423-83ad-fd05066f8576"
}
}
}
}`)
})
It("returns an error", func() {
expectUnprocessableEntityError("Key: 'RouteCreate.Host' Error:Field validation for 'Host' failed on the 'hostname_rfc1123' tag")
})
})
When("the path is missing a leading /", func() {
BeforeEach(func() {
makePostRequest(`{
"host": "test-route-host",
"path": "invalid/path",
"relationships": {
"domain": {
"data": {
"guid": "0b78dd5d-c723-4f2e-b168-df3c3e1d0806"
}
},
"space": {
"data": {
"guid": "2f35885d-0c9d-4423-83ad-fd05066f8576"
}
}
}
}`)
})
It("returns an error", func() {
expectUnprocessableEntityError("Key: 'RouteCreate.Path' Error:Field validation for 'Path' failed on the 'routepathstartswithslash' tag")
})
})
When("the request body is missing the domain relationship", func() {
BeforeEach(func() {
makePostRequest(`{
"host": "test-route-host",
"relationships": {
"space": {
"data": {
"guid": "0c78dd5d-c723-4f2e-b168-df3c3e1d0806"
}
}
}
}`)
})
It("returns an error", func() {
expectUnprocessableEntityError("Data is a required field")
})
})
When("the request body is missing the space relationship", func() {
BeforeEach(func() {
makePostRequest(`{
"host": "test-route-host",
"relationships": {
"domain": {
"data": {
"guid": "0b78dd5d-c723-4f2e-b168-df3c3e1d0806"
}
}
}
}`)
})
It("returns an error", func() {
expectUnprocessableEntityError("Data is a required field")
})
})
When("the client cannot be built", func() {
BeforeEach(func() {
clientBuilder.Returns(nil, errors.New("failed to build client"))
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, testSpaceGUID, testDomainGUID, nil, nil)
makePostRequest(requestBody)
})
It("returns an error", func() {
expectUnknownError()
})
})
When("the space does not exist", func() {
BeforeEach(func() {
appRepo.FetchNamespaceReturns(repositories.SpaceRecord{},
repositories.PermissionDeniedOrNotFoundError{Err: errors.New("not found")})
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, "no-such-space", testDomainGUID, nil, nil)
makePostRequest(requestBody)
})
It("returns an error", func() {
expectUnprocessableEntityError("Invalid space. Ensure that the space exists and you have access to it.")
})
})
When("FetchNamespace returns an unknown error", func() {
BeforeEach(func() {
appRepo.FetchNamespaceReturns(repositories.SpaceRecord{},
errors.New("random error"))
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, "no-such-space", testDomainGUID, nil, nil)
makePostRequest(requestBody)
})
It("returns an error", func() {
expectUnknownError()
})
})
When("the domain does not exist", func() {
BeforeEach(func() {
appRepo.FetchNamespaceReturns(repositories.SpaceRecord{
Name: testSpaceGUID,
}, nil)
domainRepo.FetchDomainReturns(repositories.DomainRecord{},
repositories.PermissionDeniedOrNotFoundError{Err: errors.New("not found")})
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, testSpaceGUID, "no-such-domain", nil, nil)
makePostRequest(requestBody)
})
It("returns an error", func() {
expectUnprocessableEntityError("Invalid domain. Ensure that the domain exists and you have access to it.")
})
})
When("FetchDomain returns an unknown error", func() {
BeforeEach(func() {
appRepo.FetchNamespaceReturns(repositories.SpaceRecord{
Name: testSpaceGUID,
}, nil)
domainRepo.FetchDomainReturns(repositories.DomainRecord{},
errors.New("random error"))
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, testSpaceGUID, "no-such-domain", nil, nil)
makePostRequest(requestBody)
})
It("returns an error", func() {
expectUnknownError()
})
})
When("CreateRoute returns an unknown error", func() {
BeforeEach(func() {
appRepo.FetchNamespaceReturns(repositories.SpaceRecord{
Name: testSpaceGUID,
}, nil)
domainRepo.FetchDomainReturns(repositories.DomainRecord{
GUID: testDomainGUID,
Name: testDomainName,
}, nil)
routeRepo.CreateRouteReturns(repositories.RouteRecord{},
errors.New("random error"))
requestBody := initializeCreateRouteRequestBody(testRouteHost, testRoutePath, testSpaceGUID, "no-such-domain", nil, nil)
makePostRequest(requestBody)
})
It("returns an error", func() {
expectUnknownError()
})
})
})
Describe("the GET /v3/routes/:guid/destinations endpoint", func() {
const (
testDomainGUID = "test-domain-guid"
testRouteGUID = "test-route-guid"
testRouteHost = "test-route-host"
testSpaceGUID = "test-space-guid"
)
var (
routeRepo *fake.CFRouteRepository
appRepo *fake.CFAppRepository
clientBuilder *fake.ClientBuilder
routeRecord *repositories.RouteRecord
)
BeforeEach(func() {
routeRepo = new(fake.CFRouteRepository)
domainRepo := new(fake.CFDomainRepository)
appRepo = new(fake.CFAppRepository)
clientBuilder = new(fake.ClientBuilder)
routeRecord = &repositories.RouteRecord{
GUID: testRouteGUID,
SpaceGUID: testSpaceGUID,
DomainRef: repositories.DomainRecord{
GUID: testDomainGUID,
},
Host: testRouteHost,
Protocol: "http",
Destinations: []repositories.Destination{
{
GUID: "89323d4e-2e84-43e7-83e9-adbf50a20c0e",
AppGUID: "1cb006ee-fb05-47e1-b541-c34179ddc446",
ProcessType: "web",
Port: 8080,
},
{
GUID: "fbef10a2-8ee7-11e9-aa2d-abeeaf7b83c5",
AppGUID: "01856e12-8ee8-11e9-98a5-bb397dbc818f",
ProcessType: "api",
Port: 9000,
},
},
CreatedAt: "create-time",
UpdatedAt: "update-time",
}
routeRepo.FetchRouteReturns(*routeRecord, nil)
routeHandler := NewRouteHandler(
logf.Log.WithName("TestRouteHandler"),
*serverURL,
routeRepo,
domainRepo,
appRepo,
clientBuilder.Spy,
&rest.Config{}, // required for k8s client (transitive dependency from route repo)
)
routeHandler.RegisterRoutes(router)
var err error
req, err = http.NewRequest("GET", fmt.Sprintf("/v3/routes/%s/destinations", testRouteGUID), nil)
Expect(err).NotTo(HaveOccurred())
})
JustBeforeEach(func() {
router.ServeHTTP(rr, req)
})
When("On the happy path and", func() {
When("the Route has destinations", func() {
It("returns status 200 OK", func() {
Expect(rr.Code).To(Equal(http.StatusOK), "Matching HTTP response code:")
})
It("returns Content-Type as JSON in header", func() {
contentTypeHeader := rr.Header().Get("Content-Type")
Expect(contentTypeHeader).To(Equal(jsonHeader), "Matching Content-Type header:")
})
It("returns the Destinations in the response", func() {
expectedBody := fmt.Sprintf(`{
"destinations": [
{
"guid": "%[3]s",
"app": {
"guid": "%[4]s",
"process": {
"type": "%[5]s"
}
},
"weight": null,
"port": %[6]d,
"protocol": "http1"
},
{
"guid": "%[7]s",
"app": {
"guid": "%[8]s",
"process": {
"type": "%[9]s"
}
},
"weight": null,
"port": %[10]d,
"protocol": "http1"
}
],
"links": {
"self": {
"href": "%[1]s/v3/routes/%[2]s/destinations"
},
"route": {
"href": "%[1]s/v3/routes/%[2]s"
}
}
}`, defaultServerURL, testRouteGUID,
routeRecord.Destinations[0].GUID, routeRecord.Destinations[0].AppGUID, routeRecord.Destinations[0].ProcessType, routeRecord.Destinations[0].Port,
routeRecord.Destinations[1].GUID, routeRecord.Destinations[1].AppGUID, routeRecord.Destinations[1].ProcessType, routeRecord.Destinations[1].Port)
Expect(rr.Body.String()).To(MatchJSON(expectedBody), "Response body matches response:")
})
})
When("the Route has no destinations", func() {
BeforeEach(func() {
routeRepo.FetchRouteReturns(
repositories.RouteRecord{
GUID: testRouteGUID,
SpaceGUID: testSpaceGUID,
DomainRef: repositories.DomainRecord{
GUID: testDomainGUID,
},
Host: testRouteHost,
Protocol: "http",
Destinations: []repositories.Destination{},
CreatedAt: "create-time",
UpdatedAt: "update-time",
}, nil)
})
It("returns status 200 OK", func() {
Expect(rr.Code).To(Equal(http.StatusOK), "Matching HTTP response code:")
})
It("returns Content-Type as JSON in header", func() {
contentTypeHeader := rr.Header().Get("Content-Type")
Expect(contentTypeHeader).To(Equal(jsonHeader), "Matching Content-Type header:")
})
It("returns no Destinations in the response", func() {
expectedBody := fmt.Sprintf(`{
"destinations": [],
"links": {
"self": {
"href": "%[1]s/v3/routes/%[2]s/destinations"
},
"route": {
"href": "%[1]s/v3/routes/%[2]s"
}
}
}`, defaultServerURL, testRouteGUID)
Expect(rr.Body.String()).To(MatchJSON(expectedBody), "Response body matches response:")
})
})
})
When("the route cannot be found", func() {
BeforeEach(func() {
routeRepo.FetchRouteReturns(repositories.RouteRecord{}, repositories.NotFoundError{Err: errors.New("not found")})
})
It("returns an error", func() {
expectNotFoundError("Route not found")
})
})
When("there is some other issue fetching the route", func() {
BeforeEach(func() {
routeRepo.FetchRouteReturns(repositories.RouteRecord{}, errors.New("unknown!"))
})
It("returns an errror", func() {
expectUnknownError()
})
})
})
})
func initializeCreateRouteRequestBody(host, path string, spaceGUID, domainGUID string, labels, annotations map[string]string) string {
marshaledLabels, _ := json.Marshal(labels)
marshaledAnnotations, _ := json.Marshal(annotations)
return `{
"host": "` + host + `",
"path": "` + path + `",
"relationships": {
"domain": {
"data": {
"guid": "` + domainGUID + `"
}
},
"space": {
"data": {
"guid": "` + spaceGUID + `"
}
}
},
"metadata": {
"labels": ` + string(marshaledLabels) + `,
"annotations": ` + string(marshaledAnnotations) + `
}
}`
}
| 28.124177 | 245 | 0.6154 |
262a0a105961716ad95a5b55e12dd3f7ca2a1fce | 187 | sql | SQL | src/test/resources/sql/explain/4b0d63bb.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 66 | 2018-06-15T11:34:03.000Z | 2022-03-16T09:24:49.000Z | src/test/resources/sql/explain/4b0d63bb.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 13 | 2019-03-19T11:56:28.000Z | 2020-08-05T04:20:50.000Z | src/test/resources/sql/explain/4b0d63bb.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 28 | 2019-01-05T19:59:02.000Z | 2022-03-24T11:55:50.000Z | -- file:join.sql ln:895 expect:true
explain (costs off)
select * from
tenk1 join int4_tbl on f1 = twothousand,
int4(sin(1)) q1,
int4(sin(0)) q2
where q1 = thousand or q2 = thousand
| 23.375 | 42 | 0.695187 |
b6b320a6f7fcd1aa66e415e775f99e7eb6163b9d | 317 | rb | Ruby | Casks/vagrant.rb | chriswl/homebrew-cask | a5a6d480da9fe171c94e58663fd05843c30ca540 | [
"BSD-2-Clause"
] | null | null | null | Casks/vagrant.rb | chriswl/homebrew-cask | a5a6d480da9fe171c94e58663fd05843c30ca540 | [
"BSD-2-Clause"
] | null | null | null | Casks/vagrant.rb | chriswl/homebrew-cask | a5a6d480da9fe171c94e58663fd05843c30ca540 | [
"BSD-2-Clause"
] | null | null | null | class Vagrant < Cask
url 'http://files.vagrantup.com/packages/db8e7a9c79b23264da129f55cf8569167fc22415/Vagrant-1.3.3.dmg'
homepage 'http://www.vagrantup.com'
version '1.3.3'
sha1 '4787ce0786558b7b2b21577dbe7da7694b3caa4b'
install 'Vagrant.pkg'
uninstall :script => 'uninstall.tool', :input => %w[Yes]
end
| 35.222222 | 102 | 0.753943 |
abea24af39a87d2f8e120ceb64561015c9db5df8 | 3,708 | dart | Dart | test/run/package_api_test.dart | jakemac53/pub | 1218853e57594c2117b8acaf6a65a43f8698d8c7 | [
"BSD-3-Clause"
] | null | null | null | test/run/package_api_test.dart | jakemac53/pub | 1218853e57594c2117b8acaf6a65a43f8698d8c7 | [
"BSD-3-Clause"
] | null | null | null | test/run/package_api_test.dart | jakemac53/pub | 1218853e57594c2117b8acaf6a65a43f8698d8c7 | [
"BSD-3-Clause"
] | null | null | null | // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:path/path.dart' as p;
import 'package:scheduled_test/scheduled_test.dart';
import '../descriptor.dart' as d;
import '../test_pub.dart';
final _transformer = """
import 'dart:async';
import 'package:barback/barback.dart';
class MyTransformer extends Transformer {
MyTransformer.asPlugin();
String get allowedExtensions => '.in';
Future apply(Transform transform) async {
transform.addOutput(new Asset.fromString(
transform.primaryInput.id.changeExtension('.txt'),
await transform.primaryInput.readAsString()));
}
}
""";
final _script = """
import 'dart:isolate';
main() async {
print(await Isolate.packageRoot);
print(await Isolate.packageConfig);
print(await Isolate.resolvePackageUri(
Uri.parse('package:myapp/resource.txt')));
print(await Isolate.resolvePackageUri(
Uri.parse('package:foo/resource.txt')));
}
""";
main() {
integration('an untransformed application sees a file: package config', () {
d.dir("foo", [d.libPubspec("foo", "1.0.0")]).create();
d.dir(appPath, [
d.appPubspec({
"foo": {"path": "../foo"}
}),
d.dir("bin", [d.file("script.dart", _script)])
]).create();
pubGet();
var pub = pubRun(args: ["bin/script"]);
pub.stdout.expect("null");
pub.stdout
.expect(p.toUri(p.join(sandboxDir, "myapp/.packages")).toString());
pub.stdout.expect(
p.toUri(p.join(sandboxDir, "myapp/lib/resource.txt")).toString());
pub.stdout
.expect(p.toUri(p.join(sandboxDir, "foo/lib/resource.txt")).toString());
pub.shouldExit(0);
});
integration('a transformed application sees an http: package root', () {
serveBarback();
d.dir("foo", [d.libPubspec("foo", "1.0.0")]).create();
d.dir(appPath, [
d.pubspec({
"name": "myapp",
"transformers": ["myapp/src/transformer"],
"dependencies": {"barback": "any"}
}),
d.dir("lib", [
d.file("resource.in", "hello!"),
d.dir("src", [d.file("transformer.dart", _transformer)])
]),
d.dir("bin", [d.file("script.dart", _script)])
]).create();
pubGet();
var pub = pubRun(args: ["bin/script"]);
pub.stdout
.expect(allOf(startsWith("http://localhost:"), endsWith("/packages/")));
pub.stdout.expect("null");
pub.stdout.expect(allOf(startsWith("http://localhost:"),
endsWith("/packages/myapp/resource.txt")));
pub.stdout.expect(allOf(startsWith("http://localhost:"),
endsWith("/packages/foo/resource.txt")));
pub.shouldExit(0);
});
integration('a snapshotted application sees a file: package root', () {
servePackages((builder) {
builder.serve("foo", "1.0.0", contents: [
d.dir("bin", [d.file("script.dart", _script)])
]);
});
d.dir(appPath, [
d.appPubspec({"foo": "any"})
]).create();
pubGet(output: contains("Precompiled foo:script."));
var pub = pubRun(args: ["foo:script"]);
pub.stdout.expect("null");
pub.stdout
.expect(p.toUri(p.join(sandboxDir, "myapp/.packages")).toString());
pub.stdout.expect(
p.toUri(p.join(sandboxDir, "myapp/lib/resource.txt")).toString());
schedule(() async {
var fooResourcePath = p.join(
await globalPackageServer.pathInCache('foo', '1.0.0'),
"lib/resource.txt");
pub.stdout.expect(p.toUri(fooResourcePath).toString());
});
pub.shouldExit(0);
});
}
| 29.428571 | 80 | 0.61165 |
9fa5a23f6b23f844228208aeea138e3151f05269 | 1,824 | sql | SQL | sql/cdj_master/2018-8/2018-8-22.sql | Chiuchiuchiu/shop-own | 9737cb3affae3023a8f6e984688e233162b9d57e | [
"BSD-3-Clause"
] | null | null | null | sql/cdj_master/2018-8/2018-8-22.sql | Chiuchiuchiu/shop-own | 9737cb3affae3023a8f6e984688e233162b9d57e | [
"BSD-3-Clause"
] | null | null | null | sql/cdj_master/2018-8/2018-8-22.sql | Chiuchiuchiu/shop-own | 9737cb3affae3023a8f6e984688e233162b9d57e | [
"BSD-3-Clause"
] | null | null | null | -- ----------------------------
-- Table structure for pm_order_newwindow_pdf
-- ----------------------------
DROP TABLE IF EXISTS `pm_order_newwindow_pdf`;
CREATE TABLE `pm_order_newwindow_pdf` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`pm_order_fpzz_id` int(11) DEFAULT NULL COMMENT '关联fpzz_id',
`member_id` int(11) DEFAULT NULL COMMENT '关联member',
`bill_num` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '蓝字发票号码',
`bill_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '蓝字发票代码',
`bill_pdf_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发票PDF地址',
`bill_jpg_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发票JPG地址',
`ref_bill_num` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '红字发票号码',
`ref_bill_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '红字发票代码',
`ref_bill_pdf_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '红字发票PDF地址',
`ref_bill_jpg_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '红字发票JPG地址',
`save_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '保存路径',
`created_at` int(11) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `fpzz_id_idx`(`pm_order_fpzz_id`, `member_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '新视窗开具电子发票' ROW_FORMAT = Compact;
-- question_project添加状态并删除deleted_at字段
ALTER TABLE `question_project`
DROP COLUMN `deleted_at`,
ADD COLUMN `status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '问卷状态:1进行中2已结束' AFTER `type_isp`;
| 65.142857 | 133 | 0.770285 |
0cc3a8a874579737da43eb33ea49f8d945b089ac | 296 | sql | SQL | DBUpdate/1.0.0.4 Create table User.sql | dmzubr/testing-store | 5af60512010f10ea6e32477fbde4d83077b9013c | [
"MIT"
] | null | null | null | DBUpdate/1.0.0.4 Create table User.sql | dmzubr/testing-store | 5af60512010f10ea6e32477fbde4d83077b9013c | [
"MIT"
] | null | null | null | DBUpdate/1.0.0.4 Create table User.sql | dmzubr/testing-store | 5af60512010f10ea6e32477fbde4d83077b9013c | [
"MIT"
] | null | null | null | USE `Tester`;
CREATE TABLE IF NOT EXISTS `User` (
`UserId` int(11) NOT NULL AUTO_INCREMENT,
`Login` varchar(100) NOT NULL,
`Email` varchar(100) NOT NULL,
`LastName` varchar(45) NOT NULL,
`FirstName` varchar(45) NOT NULL,
PRIMARY KEY (`UserId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| 26.909091 | 43 | 0.695946 |
8cb8d9015f6980b080f605d33c6360f97d44a8e9 | 3,385 | swift | Swift | Example/WTestToolKit/RootGroup/RootViewController.swift | Jeffersons/WTestToolKit | c3dece9523e5b7fb724aae4b0ef4d17710c9ae42 | [
"MIT"
] | null | null | null | Example/WTestToolKit/RootGroup/RootViewController.swift | Jeffersons/WTestToolKit | c3dece9523e5b7fb724aae4b0ef4d17710c9ae42 | [
"MIT"
] | null | null | null | Example/WTestToolKit/RootGroup/RootViewController.swift | Jeffersons/WTestToolKit | c3dece9523e5b7fb724aae4b0ef4d17710c9ae42 | [
"MIT"
] | null | null | null | //
// RootViewController.swift
// WTestToolKit_Example
//
// Created by Jefferson de Souza Batista on 21/07/21.
// Copyright © 2021 CocoaPods. All rights reserved.
//
import UIKit
protocol RootDisplayLogic: AnyObject {
func displayRootList(result: [RootListCell.ViewModel])
func displaySegueTo(viewController: UIViewController)
}
struct Appearance {
let cellHeight: CGFloat = 80.0
}
class RootViewController: UIViewController {
fileprivate let appearance = Appearance()
private var viewModel: [RootListCell.ViewModel]?
lazy var contentView = RootListView(frame: UIScreen.main.bounds)
let interactor: RootBusinessLogic
let cellReuseId = "rootCell"
init(interactor: RootBusinessLogic) {
self.interactor = interactor
super.init(nibName: nil, bundle: nil)
}
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func loadView() {
view = contentView
}
override func viewDidLoad() {
super.viewDidLoad()
interactor.fetchRootList()
setupTableView()
}
func setupTableView() {
contentView.tableView.delegate = self
contentView.tableView.dataSource = self
contentView.tableView.register(RootListCell.self, forCellReuseIdentifier: cellReuseId)
}
override func viewWillAppear(_ animated: Bool) {
navigationController?.navigationBar.isHidden = true
}
override func viewWillDisappear(_ animated: Bool) {
navigationController?.navigationBar.isHidden = false
}
}
extension RootViewController: UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return viewModel?.count ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = contentView.tableView.dequeueReusableCell(withIdentifier: cellReuseId) as? RootListCell else {
return UITableViewCell()
}
guard let value = viewModel?[indexPath.row] else {
return cell
}
cell.titleLabel.text = value.title
cell.iconImage.image = value.image
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return appearance.cellHeight
}
}
extension RootViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let value = viewModel?[indexPath.row]
guard let result = RootType(rawValue: value?.title ?? "")else {
return
}
self.navigationController?.pushViewController(
RouterWTestToolKit.atomicDetailViewController(rootType:result),
animated: true
)
tableView.cellForRow(at: indexPath)?.isSelected = false
}
}
extension RootViewController: RootDisplayLogic {
func displayRootList(result: [RootListCell.ViewModel]) {
self.viewModel = result
contentView.tableView.reloadData()
}
func displaySegueTo(viewController: UIViewController) {
navigationController?.pushViewController(viewController, animated: true)
}
}
| 30.495495 | 119 | 0.680355 |
3e33f4699ecfdcfd3798021bf016febf21d32df3 | 7,543 | h | C | old_version/Source/Includes/Core/thread.h | Oxmose/RTLKIM | 27fe1a83b0c2127bb9bda8143cb1d2a51d0945ad | [
"MIT"
] | null | null | null | old_version/Source/Includes/Core/thread.h | Oxmose/RTLKIM | 27fe1a83b0c2127bb9bda8143cb1d2a51d0945ad | [
"MIT"
] | 1 | 2019-02-22T01:04:55.000Z | 2019-02-23T17:17:09.000Z | old_version/Source/Includes/Core/thread.h | Oxmose/RTLKIM | 27fe1a83b0c2127bb9bda8143cb1d2a51d0945ad | [
"MIT"
] | null | null | null | /***************************************************************************//**
* @file thread.h
*
* @author Alexy Torres Aurora Dugo
*
* @date 03/10/2017
*
* @version 2.0
*
* @brief Thread's structures definitions.
*
* @details Thread's structures definitions. The files sontins all the data
* relative to the thread's management in the system (thread structure, thread
* state).
*
* @copyright Alexy Torres Aurora Dugo
******************************************************************************/
#ifndef __THREAD_H_
#define __THREAD_H_
#include <Lib/stdint.h> /* Generic int types */
#include <Cpu/cpu_settings.h> /* KERNEL_CS KERNEL_DS */
#include <Core/kernel_queue.h> /* kernel_queue_node_t kernel_queue_t */
#include <Sync/critical.h> /* spinlock_t */
/* UTK configuration file */
#include <config.h>
/*******************************************************************************
* CONSTANTS
******************************************************************************/
/** @brief Thread's initial EFLAGS register value. */
#define THREAD_INIT_EFLAGS 0x202 /* INT | PARITY */
/** @brief Thread's initial EAX register value. */
#define THREAD_INIT_EAX 0
/** @brief Thread's initial EBX register value. */
#define THREAD_INIT_EBX 0
/** @brief Thread's initial ECX register value. */
#define THREAD_INIT_ECX 0
/** @brief Thread's initial EDX register value. */
#define THREAD_INIT_EDX 0
/** @brief Thread's initial ESI register value. */
#define THREAD_INIT_ESI 0
/** @brief Thread's initial EDI register value. */
#define THREAD_INIT_EDI 0
/** @brief Thread's initial CS register value. */
#define THREAD_INIT_CS THREAD_KERNEL_CS
/** @brief Thread's initial SS register value. */
#define THREAD_INIT_SS THREAD_KERNEL_DS
/** @brief Thread's initial DS register value. */
#define THREAD_INIT_DS THREAD_KERNEL_DS
/** @brief Thread's initial ES register value. */
#define THREAD_INIT_ES THREAD_KERNEL_DS
/** @brief Thread's initial FS register value. */
#define THREAD_INIT_FS THREAD_KERNEL_DS
/** @brief Thread's initial GS register value. */
#define THREAD_INIT_GS THREAD_KERNEL_DS
/*******************************************************************************
* STRUCTURES
******************************************************************************/
/** @brief Thread's scheduling state. */
enum THREAD_STATE
{
/** @brief Thread's scheduling state: running. */
THREAD_STATE_RUNNING,
/** @brief Thread's scheduling state: running to be elected. */
THREAD_STATE_READY,
/** @brief Thread's scheduling state: sleeping. */
THREAD_STATE_SLEEPING,
/** @brief Thread's scheduling state: dead. */
THREAD_STATE_DEAD,
/** @brief Thread's scheduling state: waiting to be joined. */
THREAD_STATE_ZOMBIE,
/** @brief Thread's scheduling state: joining a thread. */
THREAD_STATE_JOINING,
/** @brief Thread's scheduling state: waiting on an condition. */
THREAD_STATE_WAITING
};
/**
* @brief Defines THREAD_STATE_E type as a shorcut for enum THREAD_STATE.
*/
typedef enum THREAD_STATE THREAD_STATE_E;
/** @brief Thread waiting types. */
enum THREAD_WAIT_TYPE
{
/** @brief The thread is waiting to acquire a semaphore. */
THREAD_WAIT_TYPE_SEM,
/** @brief The thread is waiting to acquire a mutex. */
THREAD_WAIT_TYPE_MUTEX,
/** @brief The thread is waiting to acquire a keyboard entry. */
THREAD_WAIT_TYPE_IO_KEYBOARD
};
/**
* @brief Defines THREAD_WAIT_TYPE_E type as a shorcut for enum
* THREAD_WAIT_TYPE.
*/
typedef enum THREAD_WAIT_TYPE THREAD_WAIT_TYPE_E;
/** @brief Defines the possitble return state of a thread. */
enum THREAD_RETURN_STATE
{
/** @brief The thread returned normally. */
THREAD_RETURN_STATE_RETURNED,
/** @brief The thread was killed before exiting normally. */
THREAD_RETURN_STATE_KILLED
};
/**
* @brief Defines THREAD_RETURN_STATE_E type as a shorcut for enum
* THREAD_RETURN_STATE.
*/
typedef enum THREAD_RETURN_STATE THREAD_RETURN_STATE_E;
/** @brief Thread's abnomarl exit cause. */
enum THREAD_TERMINATE_CAUSE
{
/** @brief The thread returned normally. */
THREAD_TERMINATE_CORRECTLY,
/** @brief The thread was killed because of a division by zero. */
THREAD_TERMINATE_CAUSE_DIV_BY_ZERO,
/** @brief The thread was killed by a panic condition. */
THREAD_TERMINATE_CAUSE_PANIC
};
/**
* @brief Defines THREAD_TERMINATE_CAUSE_E type as a shorcut for enum
* THREAD_TERMINATE_CAUSE.
*/
typedef enum THREAD_TERMINATE_CAUSE THREAD_TERMINATE_CAUSE_E;
/**
* @brief Define the thread's types in the kernel.
*/
enum THREAD_TYPE
{
/** @brief Kernel thread type, create by and for the kernel. */
THREAD_TYPE_KERNEL,
/** @brief User thread type, created by the kernel for the user. */
THREAD_TYPE_USER
};
/**
* @brief Defines THREAD_TYPE_e type as a shorcut for enum THREAD_TYPE.
*/
typedef enum THREAD_TYPE THREAD_TYPE_E;
/** @brief This is the representation of the thread for the kernel. */
struct kernel_thread
{
/** @brief Thread's SSE storage. */
uint8_t fxsave_reg[528];
/** @brief Thread's identifier. */
int32_t tid;
/** @brief Thread's parent identifier. */
int32_t ptid;
/** @brief Thread's name. */
char name[THREAD_MAX_NAME_LENGTH];
/** @brief Thread's type. */
THREAD_TYPE_E type;
/** @brief Thread's priority assigned at creation. */
uint32_t init_prio;
/** @brief Thread's current priority. */
uint32_t priority;
/** @brief Thread's current state. */
THREAD_STATE_E state;
/** @brief Thread's wait type. This is inly relevant when the thread's state
* is THREAD_STATE_WAITING.
*/
THREAD_WAIT_TYPE_E block_type;
/** @brief Thread's return state. This is only relevant when the thread
* returned.
*/
THREAD_RETURN_STATE_E return_state;
/** @brief Thread's return state. This is only relevant when when
* return state is not THREAD_RETURN_STATE_RETURNED.
*/
THREAD_TERMINATE_CAUSE_E return_cause;
/** @brief Thread's start arguments. */
void* args;
/** @brief Thread's routine. */
void* (*function)(void*);
/** @brief Thread's return value. */
void* ret_val;
virtual_cpu_context_t cpu_context;
/** @brief Thread's stack. */
uint32_t* stack;
/** @brief Thread's stack size. */
uint32_t stack_size;
/** @brief Thread's free page table address. */
uint32_t free_page_table;
/** @brief Wake up time limit for the sleeping thread. */
uint64_t wakeup_time;
/** @brief Pointer to the joining thread's node in the threads list. */
kernel_queue_node_t* joining_thread;
/** @brief Thread's children list. */
kernel_queue_t* children;
/** @brief Thread's start time. */
uint32_t start_time;
/** @brief Thread's end time. */
uint32_t end_time;
/** @brief Thread's CPU affinity. */
uint32_t cpu_affinity;
#if MAX_CPU_COUNT > 1
/** @brief Thread's concurency lock. */
spinlock_t lock;
#endif
};
/**
* @brief Defines kernel_thread_t type as a shorcut for struct kernel_thread_t.
*/
typedef struct kernel_thread kernel_thread_t;
/**
* @brief Defines the user's thread type.
*/
typedef kernel_thread_t* thread_t;
/*******************************************************************************
* FUNCTIONS
******************************************************************************/
#endif /* __THREAD_H_ */ | 30.538462 | 80 | 0.632507 |
aa0d2aa33c8543230ab2cf5054545a241db07949 | 69 | dart | Dart | lib/Tokenizer.dart | regenvanwalbeek/ThreeDart | 0ad2d3bb83f17cff6861a07778f6c4ef9a295bbe | [
"BSD-3-Clause"
] | null | null | null | lib/Tokenizer.dart | regenvanwalbeek/ThreeDart | 0ad2d3bb83f17cff6861a07778f6c4ef9a295bbe | [
"BSD-3-Clause"
] | null | null | null | lib/Tokenizer.dart | regenvanwalbeek/ThreeDart | 0ad2d3bb83f17cff6861a07778f6c4ef9a295bbe | [
"BSD-3-Clause"
] | null | null | null | library ThreeDart.Tokenizer;
export 'src/Tokenizer/Tokenizer.dart';
| 17.25 | 38 | 0.811594 |
2166f45e5e3b7fc93962841fd49e08b381412004 | 1,012 | rs | Rust | sos21-use-case/src/model/project_query.rs | sohosai/sos21-backend | f1883844b0e5c68d6b3f9d159c9268142abc81b4 | [
"Apache-2.0",
"MIT"
] | 10 | 2021-03-01T05:27:59.000Z | 2022-03-27T11:52:11.000Z | sos21-use-case/src/model/project_query.rs | sohosai/sos21-backend | f1883844b0e5c68d6b3f9d159c9268142abc81b4 | [
"Apache-2.0",
"MIT"
] | 39 | 2021-03-01T05:03:10.000Z | 2021-11-28T17:56:44.000Z | sos21-use-case/src/model/project_query.rs | sohosai/sos21-backend | f1883844b0e5c68d6b3f9d159c9268142abc81b4 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-11-10T13:12:50.000Z | 2021-11-10T13:12:50.000Z | use crate::model::project::{ProjectAttribute, ProjectCategory};
use sos21_domain::model::project_query as entity;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ProjectQueryConjunction {
pub category: Option<ProjectCategory>,
pub attributes: Vec<ProjectAttribute>,
}
impl ProjectQueryConjunction {
pub fn from_entity(conj: entity::ProjectQueryConjunction) -> Self {
ProjectQueryConjunction {
category: conj.category().map(ProjectCategory::from_entity),
attributes: conj
.attributes()
.map(ProjectAttribute::from_entity)
.collect(),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ProjectQuery(pub Vec<ProjectQueryConjunction>);
impl ProjectQuery {
pub fn from_entity(query: entity::ProjectQuery) -> Self {
ProjectQuery(
query
.into_conjunctions()
.map(ProjectQueryConjunction::from_entity)
.collect(),
)
}
}
| 28.111111 | 72 | 0.634387 |
63febe0d943fd1d1571eaf81e4332effca3b3d2f | 6,817 | swift | Swift | realmPagination/CollectionViewController.swift | strawberrycode/RealmPagination | d2e28f06914711923f9617be39f26d61a75714e5 | [
"MIT"
] | 10 | 2016-05-29T22:58:18.000Z | 2021-06-15T05:22:56.000Z | realmPagination/CollectionViewController.swift | strawberrycode/RealmPagination | d2e28f06914711923f9617be39f26d61a75714e5 | [
"MIT"
] | 2 | 2016-06-10T22:42:59.000Z | 2017-09-06T21:59:00.000Z | realmPagination/CollectionViewController.swift | strawberrycode/RealmPagination | d2e28f06914711923f9617be39f26d61a75714e5 | [
"MIT"
] | null | null | null | //
// CollectionViewController.swift
// realmPagination
//
// Created by Catherine Schwartz on 25/10/2015.
// Copyright © 2015 Catherine Schwartz. All rights reserved.
//
import UIKit
import RealmSwift
private let reuseIdentifier = "CollectionCell"
class CollectionViewController: UICollectionViewController {
let realm = try! Realm()
let translator = Translator()
var notificationToken: NotificationToken?
// var countries = try! Realm().objects(Country).sorted("id") // if used, no need to do the query in refreshData()
var countries = Results<Country>?()
let preloadMargin = 5
var lastLoadedPage = 0
override func viewDidLoad() {
super.viewDidLoad()
// Uncomment the following line to preserve selection between presentations
self.clearsSelectionOnViewWillAppear = false
// Register cell classes
// self.collectionView!.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: reuseIdentifier)
// self.collectionView!.registerNib(UINib(nibName: "CollectionViewCell", bundle: nil), forCellWithReuseIdentifier: reuseIdentifier)
// Do any additional setup after loading the view.
if let cvl = self.collectionView?.collectionViewLayout as? UICollectionViewFlowLayout {
let cellWidth = UIScreen.mainScreen().bounds.width / 2
cvl.estimatedItemSize = CGSize(width: cellWidth, height: cellWidth)
cvl.minimumInteritemSpacing = 0
cvl.minimumLineSpacing = 0
}
// clean DB
try! realm.write {
self.realm.deleteAll()
}
notificationToken = realm.addNotificationBlock { [unowned self] note, realm in
self.reloadData()
}
getData()
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
self.collectionView?.layer.borderColor = UIColor.redColor().CGColor
self.collectionView?.layer.borderWidth = 1
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Data stuff
func getData(page: Int = 0) {
lastLoadedPage = page
let countriesToSave = translator.getJsonDataForPage(page)
// print("countries - page: \(page) \n\(countriesToSave) \n----------")
translator.saveCountries(countriesToSave)
}
func reloadData() {
countries = realm.objects(Country).sorted("id")
// print("savedCountries: \(countries)")
collectionView?.reloadSections(NSIndexSet(index: 0))
// self.collectionView?.reloadData()
}
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
if (segue.identifier == "showCountryDetails") {
let cvc = segue.destinationViewController as! CountryViewController
if let countries = self.countries,
tag = sender!.tag {
cvc.country = countries[tag]
}
}
}
// MARK: UICollectionViewDataSource
override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of items
if let countries = countries {
print("countries.count: \(countries.count)")
return countries.count
}
return 0
}
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! CollectionViewCell
// Configure the cell
let nextPage: Int = Int(indexPath.item / pageSize) + 1
let preloadIndex = nextPage * pageSize - preloadMargin
// print("indexPath.row: \(indexPath.item) - nextPage: \(nextPage) - lastLoadedPage: \(lastLoadedPage) - preloadIndex: \(preloadIndex)")
if (indexPath.item >= preloadIndex && lastLoadedPage < nextPage) {
print("get next page : \(nextPage)")
getData(nextPage)
}
if let countries = self.countries {
let country = countries[indexPath.item] //as Country
// cell.index!.text = "\(indexPath.item)"
// cell.configureCellForCountryAtIndexPath(country, indexPath: indexPath)
print("index: \(indexPath.item) - country: \(country.name) - \(country.code) - \(cell.frame)")
cell.indexLabel.text = "\(indexPath.item)"
cell.countryLabel.text = country.name
cell.codeLabel.text = country.code
cell.tag = indexPath.item
}
cell.setBorder(UIColor.blueColor())
cell.backgroundColor = UIColor.whiteColor()
return cell
}
// MARK: UICollectionViewDelegate
/*
// Uncomment this method to specify if the specified item should be highlighted during tracking
override func collectionView(collectionView: UICollectionView, shouldHighlightItemAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
*/
/*
// Uncomment this method to specify if the specified item should be selected
override func collectionView(collectionView: UICollectionView, shouldSelectItemAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
*/
/*
// Uncomment these methods to specify if an action menu should be displayed for the specified item, and react to actions performed on the item
override func collectionView(collectionView: UICollectionView, shouldShowMenuForItemAtIndexPath indexPath: NSIndexPath) -> Bool {
return false
}
override func collectionView(collectionView: UICollectionView, canPerformAction action: Selector, forItemAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) -> Bool {
return false
}
override func collectionView(collectionView: UICollectionView, performAction action: Selector, forItemAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) {
}
*/
}
| 35.878947 | 185 | 0.657914 |
f12939fdf77a448499a95f88b3493a67169a087d | 1,388 | rb | Ruby | app/helpers/dataset_helper.rb | quintel/etlocal | 698ae4127406d08566353eee7e10ef43ca61ebc0 | [
"MIT"
] | 1 | 2018-01-18T13:54:22.000Z | 2018-01-18T13:54:22.000Z | app/helpers/dataset_helper.rb | quintel/etlocal | 698ae4127406d08566353eee7e10ef43ca61ebc0 | [
"MIT"
] | 208 | 2017-02-28T08:56:16.000Z | 2022-03-29T12:36:19.000Z | app/helpers/dataset_helper.rb | quintel/etlocal | 698ae4127406d08566353eee7e10ef43ca61ebc0 | [
"MIT"
] | null | null | null | module DatasetHelper
def version_options
versions = @dataset_clones
options_from_collection_for_select(versions, 'id', 'creator').prepend(
"<option value='' disabled='disabled'>#{I18n.t('datasets.commit.switch_dataset')}</option>".html_safe
)
end
def has_dataset_edit_by_robot?(dataset_edit)
dataset_edit.latest.present? && dataset_edit.latest.user == User.robot
end
def download_button_disabled?(dataset)
!Transformer::DatasetCast.new(dataset.editable_attributes.as_json).valid?
end
def default_unit_for(key)
if key =~ /share/
"%"
else
''
end
end
def conversions_for(key)
{
to: I18n.t("units.#{ key }.to"),
from: I18n.t("units.#{ key }.from", default: I18n.t("units.#{ key }.to")).html_safe
}
end
# Public: Takes a GitFiles::GitFile and returns the URL to view the file on GitHub.
def github_file_path(file)
"https://github.com/quintel/etsource/tree/master/#{file.real_relative_path}"
end
def format_file_description(description)
# rubocop:disable Rails/OutputSafety
simple_format(description).gsub('<br />', '').html_safe
# rubocop:enable Rails/OutputSafety
end
def git_file_info_path(dataset, element, file)
git_file_info_dataset_path(
id: dataset.geo_id,
interface_element_key: element.key,
file_key: file.relative_path
)
end
end
| 26.692308 | 107 | 0.693084 |
53bc9db634bdf6fb20aab6c9a494f0d30d95faa3 | 2,652 | swift | Swift | OnTheMap2/AddLocationViewController.swift | Pac12Run8000/OnTheMap2 | 179d48904c13d97143845e02e1d91faa125d47c4 | [
"Unlicense"
] | null | null | null | OnTheMap2/AddLocationViewController.swift | Pac12Run8000/OnTheMap2 | 179d48904c13d97143845e02e1d91faa125d47c4 | [
"Unlicense"
] | null | null | null | OnTheMap2/AddLocationViewController.swift | Pac12Run8000/OnTheMap2 | 179d48904c13d97143845e02e1d91faa125d47c4 | [
"Unlicense"
] | null | null | null | //
// AddLocationViewController.swift
// OnTheMap2
//
// Created by Michelle Grover on 9/9/17.
// Copyright © 2017 Norbert Grover. All rights reserved.
//
import UIKit
class AddLocationViewController: UIViewController {
@IBOutlet weak var findLocationButton: UIButton!
@IBOutlet weak var locationTextField: UITextField!
@IBOutlet weak var websiteTextField: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.title = "Add Location"
findLocationButton.layer.cornerRadius = 6
findLocationButton.layer.masksToBounds = true
let dismissButton = UIBarButtonItem(title: "cancel", style: .plain, target: self, action: #selector(dismissButtonPressed))
navigationItem.leftBarButtonItems = [dismissButton]
}
@IBAction func findLocationButtonPressed(_ sender: Any) {
guard let location = locationTextField.text else {
return
}
guard let url = websiteTextField.text else {
return
}
if (location.isEmpty || location == "") {
showAlert(messageText: "Please enter a location.")
} else if (url.isEmpty || url == "") {
showAlert(messageText: "Enter a url.")
} else if (!validateUrl(urlString: url as NSString)) {
showAlert(messageText: "The website url entered is not valid.")
} else {
let locationDetailViewController = self.storyboard?.instantiateViewController(withIdentifier: "LocationDetailViewController") as! LocationDetailViewController
locationDetailViewController.mapString = location
locationDetailViewController.mediaUrl = url
navigationController?.pushViewController(locationDetailViewController, animated: true)
}
}
func dismissButtonPressed() {
dismiss(animated: true, completion: nil)
}
func showAlert(messageText:String) {
let alert = UIAlertController(title: "", message: messageText, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Dismiss", style: .default, handler: { (action) in
alert.dismiss(animated: true, completion: nil)
}))
self.present(alert, animated: true , completion: nil)
}
func validateUrl (urlString: NSString) -> Bool {
let urlRegEx = "((?:http|https)://)?(?:www\\.)?[\\w\\d\\-_]+\\.\\w{2,3}(\\.\\w{2})?(/(?<=/)(?:[\\w\\d\\-./_]+)?)?"
return NSPredicate(format: "SELF MATCHES %@", urlRegEx).evaluate(with: urlString)
}
}
| 34.894737 | 170 | 0.625566 |
85d99d3e3b9c229df279ee2ffadb9dbeffdc0513 | 635 | h | C | Cheetah_mPaaSSDK/Frameworks/AntUI.framework/Headers/AUAmountValidator.h | hyissogood/Cheetah_mPaaSSDK | 30f6c22fa051ba702028b5bbc814baf957b53a26 | [
"MIT"
] | 232 | 2019-08-16T03:07:29.000Z | 2020-11-18T06:10:19.000Z | Cheetah_mPaaSSDK/Frameworks/AntUI.framework/Headers/AUAmountValidator.h | hyissogood/Cheetah_mPaaSSDK | 30f6c22fa051ba702028b5bbc814baf957b53a26 | [
"MIT"
] | 42 | 2019-08-20T11:44:51.000Z | 2020-11-06T00:37:15.000Z | mpaas_nebula_demo/mpaas_nebula_demo_ios/MPaaS/Frameworks/AntUI.framework/Headers/AUAmountValidator.h | alipay/mpaas-demo | 3efc4e383913a11d1bf231f63bb7be0c0decccdf | [
"Apache-2.0"
] | 41 | 2019-08-16T07:30:31.000Z | 2020-11-13T01:56:03.000Z | #import "AUUILoadDefine.h"//程序自动生成
#ifdef ANTUI_UI_amountInputBox//程序自动生成
//
// AUAmountValidator.h
// AntUI
//
// Created by zhaolei on 2017/8/23.
// Copyright © 2017年 Alipay. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol AUAmountValidatorProtocol <NSObject>
@optional
- (BOOL)checkNumberOfDigits:(NSString *) amount;
- (NSString *)formatAmount:(NSString *) amount;
@end
@interface AUAmountDefaultValidator : NSObject <AUAmountValidatorProtocol>
//用于输入位数校验(包括小数点,amount.length < = maxNumberOfDigits则合法),默认NSUIntegerMax
@property (nonatomic, assign) NSUInteger maxNumberOfDigits;
@end
#endif//程序自动生成
| 21.166667 | 74 | 0.765354 |
d267a3153dd6dc9274f968c6483c94c7637c3b6a | 374 | php | PHP | src/SingletonInterface.php | ncou/Chiron-Container | 9f3f31251e9a4674422c58919734974b48b55ff4 | [
"MIT"
] | 1 | 2018-12-11T12:39:37.000Z | 2018-12-11T12:39:37.000Z | src/SingletonInterface.php | ncou/Chiron-Container | 9f3f31251e9a4674422c58919734974b48b55ff4 | [
"MIT"
] | 1 | 2018-09-12T23:06:53.000Z | 2018-09-12T23:06:53.000Z | src/SingletonInterface.php | ncou/Chiron-Container | 9f3f31251e9a4674422c58919734974b48b55ff4 | [
"MIT"
] | null | null | null | <?php
declare(strict_types=1);
namespace Chiron\Container;
/**
* Classes implemented this interface will be treated as singleton (will only be constructed once in the container).
*/
// TODO : class à renommer BindSingletonInterface pour que cela soit plus simple à comprendre en lisant son nom. ou éventuellement SharedServiceInterface
interface SingletonInterface
{
}
| 26.714286 | 153 | 0.791444 |
657124e58596e9b0f98bdb62035428c17075e0e7 | 4,865 | dart | Dart | lib/models/items/throwable.dart | battle-buddy/battlebuddy-android | dcb5321665bdd80db0ead5f46118a6e1de44c15c | [
"MIT"
] | 2 | 2021-06-16T14:16:42.000Z | 2022-02-11T13:24:11.000Z | lib/models/items/throwable.dart | battle-buddy/battlebuddy-android | dcb5321665bdd80db0ead5f46118a6e1de44c15c | [
"MIT"
] | 14 | 2021-02-02T15:39:07.000Z | 2022-02-08T23:04:11.000Z | lib/models/items/throwable.dart | battle-buddy/battlebuddy-android | dcb5321665bdd80db0ead5f46118a6e1de44c15c | [
"MIT"
] | null | null | null | import 'package:cloud_firestore/cloud_firestore.dart';
import 'item.dart';
enum ThrowableType {
fragmentation,
flash,
smoke,
undefined,
}
extension ThrowableTypeExt on ThrowableType {
static const Map<ThrowableType, String> _displayName = {
ThrowableType.fragmentation: 'Fragmentation',
ThrowableType.flash: 'Flash',
ThrowableType.smoke: 'Smoke',
ThrowableType.undefined: 'Undefined',
};
String get displayName => _displayName[this]!;
}
extension Format on ThrowableType {
String get string {
switch (this) {
case ThrowableType.fragmentation:
return 'fragmentation';
case ThrowableType.flash:
return 'flash';
case ThrowableType.smoke:
return 'smoke';
case ThrowableType.undefined:
return 'undefined';
}
}
}
extension StringParsing on String {
ThrowableType get parseThrowableType {
switch (this) {
case 'frag':
return ThrowableType.fragmentation;
case 'flash':
return ThrowableType.flash;
case 'smoke':
return ThrowableType.smoke;
default:
return ThrowableType.undefined;
}
}
}
class Throwable extends Item implements ExplorableSectionItem {
final ThrowableType throwableType;
final Duration delay;
final int fragCount;
final Length minDistance;
final Length maxDistance;
final Length contusionDistance;
final double strength;
final Duration emitTime;
Throwable.fromMap(Map<String, dynamic> map, {DocumentReference? reference})
: assert(map['type'] != null),
assert(map['delay'] != null),
assert(map['fragCount'] != null),
assert(map['minDistance'] != null),
assert(map['maxDistance'] != null),
assert(map['contusionDistance'] != null),
assert(map['strength'] != null),
assert(map['emitTime'] != null),
throwableType = map['type'].toString().parseThrowableType,
delay =
Duration(milliseconds: (map['delay'].toDouble() * 1000).toInt()),
fragCount = map['fragCount'].toInt(),
minDistance = Length(meter: map['minDistance'].toDouble()),
maxDistance = Length(meter: map['maxDistance'].toDouble()),
contusionDistance = Length(meter: map['contusionDistance'].toDouble()),
strength = map['strength'].toDouble(),
emitTime =
Duration(milliseconds: (map['emitTime'].toDouble() * 1000).toInt()),
super.fromMap(map, reference: reference);
Throwable.fromSnapshot(DocumentSnapshot snapshot)
: this.fromMap(snapshot.data() as Map<String, dynamic>,
reference: snapshot.reference);
@override
ItemType get type => ItemType.throwable;
@override
String get sectionValue => throwableType.displayName;
@override
List<PropertySection> get propertySections => [
PropertySection(
title: 'Properties',
properties: <DisplayProperty>[
DisplayProperty(
name: 'Type',
value: throwableType.displayName,
),
DisplayProperty(
name: 'Delay',
value: '${delay.inMilliseconds / 1000} sec.',
),
...throwableType == ThrowableType.fragmentation
? [
DisplayProperty(
name: 'Explosion Radius',
value: '${minDistance.meter} - ${maxDistance.meter} m',
),
DisplayProperty(
name: 'Fragmentation Count',
value: '$fragCount',
)
]
: [],
...throwableType == ThrowableType.smoke
? [
DisplayProperty(
name: 'Burn Time',
value: '${emitTime.inMilliseconds / 1000} sec.',
)
]
: [],
...throwableType == ThrowableType.flash
? [
DisplayProperty(
name: 'Contusion Distance',
value: contusionDistance.toString(),
)
]
: []
],
),
];
@override
List<ComparableProperty> get comparableProperties => [
ComparableProperty('Delay', delay.inMilliseconds,
isLowerBetter: true,
displayValue: '${delay.inMilliseconds / 1000} sec.'),
ComparableProperty(
'Maximum Radius',
throwableType == ThrowableType.flash
? contusionDistance.meter
: maxDistance.meter,
displayValue: throwableType == ThrowableType.flash
? contusionDistance.toString()
: maxDistance.meter.toString(),
),
ComparableProperty('Fragments', fragCount),
];
}
| 31.185897 | 80 | 0.569168 |
c7dfc699a97adaf95f70bca597e4f6d78e07aa8f | 4,827 | py | Python | Server/socketServer.py | crew/dds-client | 5d530f053955df07b75410807816241a10b567d3 | [
"MIT"
] | null | null | null | Server/socketServer.py | crew/dds-client | 5d530f053955df07b75410807816241a10b567d3 | [
"MIT"
] | null | null | null | Server/socketServer.py | crew/dds-client | 5d530f053955df07b75410807816241a10b567d3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import socket
import select
import json
import thread
from Classes.socketlist import socketList
from Classes.message import Message
from WPHandler import wpListenerStart
def connect(**kwargs):
"""
Handles any new connections
@param kwargs: Needed information for the connection
@type kwargs: Dictionary
@return: The updated parameters of the parameters used to call it
@rtype: Dictionary
"""
pie = kwargs["currentMessage"]["src"]
kwargs["connection"].mapPie(kwargs["sock"], pie)
return kwargs
def main_socketServer_thread(inputQueue, Queues, runtimeVars):
"""
Socket Server Primary Thread Function
@param inputQueue: Socket server's message queue (Unused, included to conform to plugin thread API)
@type inputQueue: Queue.Queue
@param Queues: Global queue list
@type Queues: QueueDict
@param runtimeVars: User-defined configurations
@type runtimeVars: Dictionary
@return: None
@rtype: NoneType
@copyright: Northeastern University Crew 2014
"""
# List to keep track of socket descriptors
RECV_BUFFER = 4096 # Advisable to keep it as a power of 2
PORT = int(runtimeVars["port"])
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_socket.bind(("0.0.0.0", PORT))
server_socket.listen(10)
# Add server socket to the list of readable connections
connection = socketList(server_socket)
connection.addSocket(server_socket)
wpListenerStart(Queues["socketServer"])
log(Queues["Logging"], "Socket server started on port " + str(PORT))
thread.start_new_thread(socketServer, (connection, Queues, server_socket, RECV_BUFFER))
while True:
if not Queues["socketServer"].empty():
log(Queues["Logging"], "Message in Queue")
currentMessage = Queues["socketServer"].get()
connection.sendMessage(connection.getSock(currentMessage.dest), currentMessage.toJSON() + "\v")
def socketServer(connection, Queues, server_socket, RECV_BUFFER):
"""
The socket server implementation
@param connection: The socketServer's socket connection
@type connection: socketList
@param Queues: The global list of queues
@type Queues: QueueDict
@param server_socket: The server's local socket
@type server_socket: Socket
@param RECV_BUFFER: The socket read buffer size
@type RECV_BUFFER: Integer
@return: None
@rtype: NoneType
"""
# Wrapper to log to Logging Queue
write_log = lambda s: log(Queues["Logging"], str(s) + '\n')
while True:
write_log("pieMap: " + str(connection.pieMap))
write_log("sockList: " + str(connection.sockList))
read_sockets, write_sockets, error_sockets = select.select(connection.sockList, [], [])
for sock in read_sockets:
write_log(read_sockets)
if sock == server_socket:
# Handle the case in which there is a new connections
# received through server_socket
sockfd, addr = server_socket.accept()
connection.addSocket(sockfd)
write_log("Client Connected " + str(addr))
else:
data = sock.recv(RECV_BUFFER)
write_log(data)
if data == "":
write_log("No Data Received on Socket %s. Removing." % str(sock))
connection.removeSocket(sock)
else:
messages = filter(lambda s: s != "",
data.split('\v'))
for rawMessage in messages:
print rawMessage
currentMessage = json.loads(rawMessage)
if not currentMessage["pluginDest"] == "socketServer":
write_log("Placing message in destination: " + currentMessage["pluginDest"])
Queues[currentMessage["pluginDest"]].put(Message.fromJSON(currentMessage))
else:
write_log("Connecting")
connect(connection=connection, currentMessage=currentMessage, pieMap=connection.pieMap,
sock=sock)
write_log("Finished connection...")
# TODO: Deal with the fact that we have multiple log() definitions across our codebase...
def log(queue, mes):
"""
Logs the given message
@param queue: The Logger's message queue
@type queue: Queue.Queue
@param mes: The message to log
@return: None
@rtype: None
"""
newLog = Message("Socket", "Logging", "Logger", "log", {})
newLog.add_content("1", mes)
queue.put(newLog)
| 38.007874 | 115 | 0.629584 |
005467bf5aeec0666cb1c740af5665a251dad8c6 | 47 | sql | SQL | init.sql | rodrigorpo/postgres-dump-restore | f5385d13bd70e7036fb8bac5c827fe10cb8bbcd0 | [
"MIT"
] | null | null | null | init.sql | rodrigorpo/postgres-dump-restore | f5385d13bd70e7036fb8bac5c827fe10cb8bbcd0 | [
"MIT"
] | null | null | null | init.sql | rodrigorpo/postgres-dump-restore | f5385d13bd70e7036fb8bac5c827fe10cb8bbcd0 | [
"MIT"
] | null | null | null | CREATE DATABASE k8s;
\c k8s;
CREATE SCHEMA k8s; | 15.666667 | 20 | 0.765957 |
2706603006dffdea5c3c70f944341c121331dd03 | 2,804 | h | C | PrivateFrameworks/ITMLKit.framework/IKJSPlayer.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 36 | 2016-04-20T04:19:04.000Z | 2018-10-08T04:12:25.000Z | PrivateFrameworks/ITMLKit.framework/IKJSPlayer.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | null | null | null | PrivateFrameworks/ITMLKit.framework/IKJSPlayer.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 10 | 2016-06-16T02:40:44.000Z | 2019-01-15T03:31:45.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/ITMLKit.framework/ITMLKit
*/
@interface IKJSPlayer : IKJSEventListenerObject <IKJSPlayer> {
NSMutableDictionary * _boundaryListeners;
IKAppPlayerBridge * _bridge;
bool _holdingSelfReference;
NSMutableDictionary * _observedMetadataKeys;
long long _playerState;
IKJSPlaylist * _playlist;
NSMutableDictionary * _timeListeners;
}
@property (nonatomic, readonly) IKAppPlayerBridge *bridge;
@property (nonatomic, readonly) IKJSMediaItem *currentMediaItem;
@property (nonatomic, readonly) NSDate *currentMediaItemDate;
@property (nonatomic, readonly) NSNumber *currentMediaItemDuration;
@property (nonatomic) bool modalOverlayDismissable;
@property (nonatomic, retain) IKDOMDocument *modalOverlayDocument;
@property (nonatomic, readonly) IKJSMediaItem *nextMediaItem;
@property (nonatomic, retain) IKDOMDocument *overlayDocument;
@property (nonatomic) double playbackRate;
@property (nonatomic, readonly) NSString *playbackState;
@property (nonatomic, retain) IKJSPlaylist *playlist;
@property (nonatomic, readonly) IKJSMediaItem *previousMediaItem;
- (void).cxx_destruct;
- (void)_addManagedReference;
- (void)_removeManagedReference;
- (void)addEventListener:(id)arg1 :(id)arg2 :(id)arg3;
- (id)bridge;
- (void)changeToMediaAtIndex:(unsigned long long)arg1;
- (id)currentMediaItem;
- (id)currentMediaItemDate;
- (id)currentMediaItemDuration;
- (void)currentMediaItemDurationDidChange:(double)arg1;
- (void)dealloc;
- (id)init;
- (id)initWithAppContext:(id)arg1 bridge:(id)arg2;
- (void)mediaItemDidChange:(long long)arg1;
- (void)mediaItemWillChange:(long long)arg1;
- (bool)modalOverlayDismissable;
- (id)modalOverlayDocument;
- (void)next;
- (id)nextMediaItem;
- (id)overlayDocument;
- (void)pause;
- (void)play;
- (void)playbackDidStall:(double)arg1;
- (void)playbackError:(id)arg1 shouldStopDueToError:(bool)arg2;
- (double)playbackRate;
- (id)playbackState;
- (id)playlist;
- (void)present;
- (void)previous;
- (id)previousMediaItem;
- (void)removeEventListener:(id)arg1 :(id)arg2;
- (bool)requestSeekToTime:(double*)arg1 currentTime:(double)arg2;
- (void)seekToTime:(double)arg1;
- (void)setModalOverlayDismissable:(bool)arg1;
- (void)setModalOverlayDocument:(id)arg1;
- (void)setOverlayDocument:(id)arg1;
- (void)setPlaybackRate:(double)arg1;
- (void)setPlaylist:(id)arg1;
- (bool)shouldChangeToMediaAtIndex:(unsigned long long)arg1;
- (bool)shouldHandleStateEvent:(id)arg1;
- (long long)state;
- (void)stateDidChange:(id)arg1;
- (void)stateWillChange:(id)arg1;
- (void)stop;
- (void)timeBoundaryDidCross:(double)arg1;
- (void)timeIntervalElapsed:(double)arg1 time:(double)arg2;
- (void)timedMetadataDidChange:(id)arg1 value:(id)arg2;
- (void)transportBarVisibilityDidChange:(bool)arg1;
@end
| 35.948718 | 69 | 0.775321 |
f75e356a1f4a3a7dc510f2c2203bb6ef792403d2 | 283 | c | C | Unix Family/Linux.Sneaky-Sneaky.a/decoy.c | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:13.000Z | 2022-03-16T09:11:05.000Z | Unix Family/Linux.Sneaky-Sneaky.a/decoy.c | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | null | null | null | Unix Family/Linux.Sneaky-Sneaky.a/decoy.c | fengjixuchui/Family | 2abe167082817d70ff2fd6567104ce4bcf0fe304 | [
"MIT"
] | 3 | 2021-05-15T15:57:15.000Z | 2022-01-08T20:51:04.000Z | #include <unistd.h>
#include <stdio.h>
long getrandom(int,int);
int ICMP_sp_send(char *,int,unsigned long ,int,int);
int decoy(unsigned long ip,char *payload)
{
int tmp;
extern int delay;
sleep(getrandom(0,delay));
tmp = ICMP_sp_send(payload,0,ip,0,0);
return tmp;
}
| 16.647059 | 52 | 0.689046 |
2f3118d521fa7842207a268c426e972c5d1e084c | 5,256 | php | PHP | resources/views/penjelajahan(old).blade.php | yogamahhendra/Codingan-TA | 229bf5169fe4b883e08aab798270ab3299640b7b | [
"MIT"
] | null | null | null | resources/views/penjelajahan(old).blade.php | yogamahhendra/Codingan-TA | 229bf5169fe4b883e08aab798270ab3299640b7b | [
"MIT"
] | null | null | null | resources/views/penjelajahan(old).blade.php | yogamahhendra/Codingan-TA | 229bf5169fe4b883e08aab798270ab3299640b7b | [
"MIT"
] | null | null | null | @extends('layouts.main')
@section('head')
@endsection
@section('content')
<div class="mx-auto w-11/12 lg:w-10/12 laptopl:w-9/12">
{{-- Penjelajahan --}}
<div class="h-full pt-10">
{{-- accordion --}}
<form action="" method="GET">
<div class="mb-3">
<p class="mb-2"><label class="font-semibold text-lg" for="penjelajahan">Penjelajahan</label></p>
<div class="flex">
<select class="w-max px-6 pb-1 h-10 rounded-md border-2 border-bali-400" name="penjelajahan"
id="penjelajahan">
<option value="" disabled selected>Jelajahi berdasarkan</option>
<option value="tingkatan" {{ $value === 'tingkatan' ? 'selected' : '' }}>Tingkatan Bahasa</option>
<option value="bentuk" {{ $value === 'bentuk' ? 'selected' : '' }}>Bentuk Kata</option>
<option value="kategori" {{ $value === 'kategori' ? 'selected' : '' }}>Kategori Kata</option>
</select>
<div class="flex ml-5 gap-4">
<button class="bg-bali-200 py-2 px-6 hover:bg-bali-300 text-bali-700 rounded-md" type="submit"
name="cari" value="cari">Cari</button>
{{-- <button class="bg-bali-600 py-2 px-6 hover:bg-bali-500 text-bali-100 rounded-md" type="submit"
name="reset" value="reset">Reset</button> --}}
</div>
</div>
</div>
</form>
<div class="bg-gray-50 flex">
<div class="">
<div class="w-full mx-auto z-0">
<ul class="shadow-box">
{{-- bali sor --}}
@foreach ($penjelajahan as $key => $value)
<li class="relative" x-data="{ selected: 1 }">
<button type="button" class="w-max py-4 text-left "
@click="selected !== 1 ? selected = 1 : selected = null">
<div class="flex items-center justify-between text-bali-500 ">
<span :class="selected == 1 ? 'fa-chevron-down' : 'fa-chevron-right'"
class="fas"></span>
<span class=" ml-3 text-bali-500 text-sm md:text-base font-bold">
{{ $key }} </span>
</div>
</button>
<div class="relative overflow-hidden transition-all max-h-0 duration-700 ml-6 bg-white text-black"
style="" x-ref="container1"
x-bind:style="selected == 1 ? 'max-height: ' + $refs.container1.scrollHeight + 'px' : ''">
<ul class="listSearch">
<div
class="p-6 grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-x-7 gap-y-10 text-sm md:text-base">
@foreach ($value as $item)
<a class="w-max transition ease-in-out hover:translate-x-0 hover:scale-105 duration-75 hover:text-bali-500 hover:font-semibold"
href="/detail/{{ $item}}">{{ ucfirst(strstr($item, '.', true)) }}</a>
@endforeach
</div>
</ul>
</div>
</li>
@endforeach
{{-- hide --}}
<p class="invisible">b b b b b b b bb b bb b b b b b b b b b b b b b b b b b b b b b b b b
b b b b b b b b b b b bb bb bb b b b b b bb b b b b b b b b b b bb bb b b b b b b
b b b b b b b b b b b b b</p>
</ul>
</div>
</div>
</div>
{{-- End Accordion --}}
</div>
</div>
@endsection
@section('script')
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
$(document).ready(function($) {
$('.listSearch p').each(function() {
$(this).attr('searchData', $(this).text().toLowerCase());
});
$('.boxSearch').on('keyup', function() {
var dataList = $(this).val().toLowerCase();
$('.listSearch p').each(function() {
if ($(this).filter('[searchData *= ' + dataList + ']').length > 0 || dataList
.length < 1) {
$(this).show();
} else {
$(this).hide();
}
});
});
});
</script>
@endsection
| 53.090909 | 176 | 0.388508 |
86d01e8ce801700b91b0ea3d0fc066390b64c319 | 933 | asm | Assembly | oeis/273/A273409.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/273/A273409.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/273/A273409.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A273409: Partial sums of the number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 678", based on the 5-celled von Neumann neighborhood.
; 1,6,11,28,37,66,87,152,177,254,291,404,453,602,687,944,1033,1302,1403,1708,1821,2162,2311,2760,2921,3406,3603,4196,4429,5130,5471,6496,6841,7878,8235,9308,9677,10786,11191,12408,12825,14078,14531,15892,16381,17850,18447,20240,20849,22678,23323,25260,25941,27986,28775,31144,31969,34446,35379,38180,39221,42346,43711,47808,49177,53286,54667,58812,60205,64386,65815,70104,71545,75870,77347,81780,83293,87834,89455,94320,95953,100854,102523,107532,109237,114354,116167,121608,123457,129006,130963
lpb $0
mov $2,$0
sub $0,1
seq $2,79317 ; Number of ON cells after n generations of cellular automaton on square grid in which cells which share exactly one edge with an ON cell change their state.
add $1,$2
lpe
add $1,1
mov $0,$1
| 77.75 | 495 | 0.778135 |
d5aaae49653569d8718bcd361894a48e3d7bcc86 | 688 | sql | SQL | _/chapter-16/nuxt-php/user.sql | paullewallencom/nuxt-978-1-7899-5269-8 | 860331d92f9ca72af4f958428d9b74ac8af693cd | [
"Apache-2.0"
] | 30 | 2020-07-06T18:46:09.000Z | 2022-03-13T10:33:13.000Z | _/chapter-16/nuxt-php/user.sql | paullewallencom/nuxt-978-1-7899-5269-8 | 860331d92f9ca72af4f958428d9b74ac8af693cd | [
"Apache-2.0"
] | 24 | 2020-06-23T13:59:30.000Z | 2022-03-08T23:26:34.000Z | _/chapter-16/nuxt-php/user.sql | paullewallencom/nuxt-978-1-7899-5269-8 | 860331d92f9ca72af4f958428d9b74ac8af693cd | [
"Apache-2.0"
] | 26 | 2020-07-04T06:20:09.000Z | 2022-03-22T10:26:54.000Z | -- Adminer 4.3.1 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`uuid` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`created_on` int(10) unsigned NOT NULL,
`updated_on` int(10) unsigned NOT NULL,
UNIQUE KEY `slug` (`slug`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `user` (`uuid`, `name`, `slug`, `created_on`, `updated_on`) VALUES
('bcfa5b45-54f0-3b76-9da0-36045d9c2119', 'Jane', 'jane', 1567967422, 0),
('1ffb35b5-06c7-33d2-9c9c-0de5ea6b5a3e', 'John', 'john', 1567996348, 0);
-- 2019-09-09 14:14:34
| 29.913043 | 78 | 0.690407 |
e724d1da6a6759e8c86afdeb251f7045228348e0 | 907 | js | JavaScript | src/reducers/userReducer.js | shashankcm/React-Redux-Application-along-with-Google-Maps-API | 198eb80aae70f297ac39c20ef3bbc72202ef8e39 | [
"MIT"
] | null | null | null | src/reducers/userReducer.js | shashankcm/React-Redux-Application-along-with-Google-Maps-API | 198eb80aae70f297ac39c20ef3bbc72202ef8e39 | [
"MIT"
] | null | null | null | src/reducers/userReducer.js | shashankcm/React-Redux-Application-along-with-Google-Maps-API | 198eb80aae70f297ac39c20ef3bbc72202ef8e39 | [
"MIT"
] | null | null | null | import constants from '../constants'
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
This is a sample reducer or user management. If you remove
and use your own reducers, remember to update the store
file (../stores/index.js) with your reducers.
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
var initialState = {
all: null,
currentUser: null // signed in user
}
export default (state = initialState, action) => {
let newState = Object.assign({}, state)
switch (action.type) {
case constants.CURRENT_USER_RECEIVED:
newState['currentUser'] = action.data
return newState
case constants.USERS_RECEIVED:
newState['all'] = action.data
return newState
case constants.USER_CREATED:
let array = (newState.all) ? Object.assign([], newState.all) : []
array.unshift(action.data)
newState['all'] = array
return newState
default:
return state
}
} | 23.25641 | 68 | 0.615215 |
b2bd1fc6f7777c13168c679b65bd978ef82ec6d2 | 164 | py | Python | pbxproj/pbxsections/PBXResourcesBuildPhase.py | JoliChen/mod-pbxproj | 24994416eec9cec838dce696c3cc9262c01ba883 | [
"MIT"
] | 1 | 2020-01-16T08:33:38.000Z | 2020-01-16T08:33:38.000Z | pbxproj/pbxsections/PBXResourcesBuildPhase.py | JoliChen/mod-pbxproj | 24994416eec9cec838dce696c3cc9262c01ba883 | [
"MIT"
] | null | null | null | pbxproj/pbxsections/PBXResourcesBuildPhase.py | JoliChen/mod-pbxproj | 24994416eec9cec838dce696c3cc9262c01ba883 | [
"MIT"
] | null | null | null | from pbxproj.pbxsections.PBXGenericBuildPhase import *
class PBXResourcesBuildPhase(PBXGenericBuildPhase):
def _get_comment(self):
return 'Resources'
| 23.428571 | 54 | 0.786585 |
85b5cc0cd9046691fda9200029f908cf3917ea36 | 476 | js | JavaScript | frontend/src/actions/user.action.js | bharadhwaj/employee-rating | 449d4b02a6d939036ef5d725a36062489ca0be97 | [
"MIT"
] | null | null | null | frontend/src/actions/user.action.js | bharadhwaj/employee-rating | 449d4b02a6d939036ef5d725a36062489ca0be97 | [
"MIT"
] | 4 | 2021-03-11T06:58:36.000Z | 2022-02-27T01:17:24.000Z | frontend/src/actions/user.action.js | bharadhwaj/employee-rating | 449d4b02a6d939036ef5d725a36062489ca0be97 | [
"MIT"
] | null | null | null | import { USER } from '../constants/actions';
export function updateBasicUserInfo(userInfo) {
return { type: USER.UPDATE_BASIC_DATA, payload: { userInfo } };
}
export function resetUserInfo() {
return { type: USER.RESET_USER_DATA };
}
export function getUsersOfCurrentOrganisation() {
return { type: USER.GET_USERS_OF_CURRENT_ORG };
}
export function updateUserOfCurrentOrganisation(users) {
return { type: USER.UPDATE_USERS_OF_CURRENT_ORG, payload: { users } };
}
| 26.444444 | 72 | 0.75 |
e722d48b7e8203f05a5921012d1b382435bf7890 | 2,679 | js | JavaScript | src/Disp/Tooltips/WrinklerTooltips.js | benblank/CookieMonster | 809bd4d35d4e17815331a515a22b2a15b6f209f6 | [
"MIT"
] | 332 | 2015-01-31T16:21:24.000Z | 2021-04-17T13:14:18.000Z | src/Disp/Tooltips/WrinklerTooltips.js | benblank/CookieMonster | 809bd4d35d4e17815331a515a22b2a15b6f209f6 | [
"MIT"
] | 501 | 2015-02-02T23:43:34.000Z | 2021-05-01T21:28:26.000Z | src/Disp/Tooltips/WrinklerTooltips.js | benblank/CookieMonster | 809bd4d35d4e17815331a515a22b2a15b6f209f6 | [
"MIT"
] | 199 | 2015-01-10T16:55:54.000Z | 2021-04-27T03:48:08.000Z | import { SimObjects } from '../../Sim/VariablesAndData';
import Beautify from '../BeautifyAndFormatting/Beautify';
import {
TooltipWrinkler,
TooltipWrinklerArea,
TooltipWrinklerBeingShown,
} from '../VariablesAndData';
/**
* This function checks and create a tooltip for the wrinklers
* It is called by CM.Disp.Draw()
* As wrinklers are not appended to the DOM we us a different system than for other tooltips
*/
export function CheckWrinklerTooltip() {
if (
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipWrink === 1 &&
TooltipWrinklerArea === 1
) {
// Latter is set by CM.Main.AddWrinklerAreaDetect
let showingTooltip = false;
Object.keys(Game.wrinklers).forEach((i) => {
const me = Game.wrinklers[i];
if (me.phase > 0 && me.selected) {
showingTooltip = true;
if (TooltipWrinklerBeingShown[i] === 0 || TooltipWrinklerBeingShown[i] === undefined) {
const placeholder = document.createElement('div');
const wrinkler = document.createElement('div');
wrinkler.style.minWidth = '120px';
wrinkler.style.marginBottom = '4px';
const div = document.createElement('div');
div.style.textAlign = 'center';
div.id = 'CMTooltipWrinkler';
wrinkler.appendChild(div);
placeholder.appendChild(wrinkler);
Game.tooltip.draw(this, escape(placeholder.innerHTML));
TooltipWrinkler = i;
TooltipWrinklerBeingShown[i] = 1;
}
} else {
TooltipWrinklerBeingShown[i] = 0;
}
});
if (!showingTooltip) {
Game.tooltip.hide();
}
}
}
/**
* This function updates the amount to be displayed by the wrinkler tooltip created by CM.Disp.CheckWrinklerTooltip()
* It is called by CM.Disp.Draw()
* As wrinklers are not appended to the DOM we us a different system than for other tooltips
*/
export function UpdateWrinklerTooltip() {
if (
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TooltipWrink === 1 &&
l('CMTooltipWrinkler') !== null
) {
let { sucked } = Game.wrinklers[TooltipWrinkler];
let toSuck = 1.1;
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
if (Game.wrinklers[TooltipWrinkler].type === 1) toSuck *= 3; // Shiny wrinklers
sucked *= toSuck;
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
if (SimObjects.Temple.minigameLoaded) {
const godLvl = Game.hasGod('scorn');
if (godLvl === 1) sucked *= 1.15;
else if (godLvl === 2) sucked *= 1.1;
else if (godLvl === 3) sucked *= 1.05;
}
l('CMTooltipWrinkler').textContent = Beautify(sucked);
}
}
| 36.202703 | 117 | 0.652109 |
4704e29807a85c406f3ff4dbd3140b298bc0a29d | 1,010 | sql | SQL | queries/stackoverflow/q16/aec57a9b7ee7a2fdee97d8a46d3932a60ac7dcbd.sql | christophanneser/Bao-for-Presto | b1d93689025d51cdea1a2e81edb8f077df8afcc1 | [
"MIT"
] | null | null | null | queries/stackoverflow/q16/aec57a9b7ee7a2fdee97d8a46d3932a60ac7dcbd.sql | christophanneser/Bao-for-Presto | b1d93689025d51cdea1a2e81edb8f077df8afcc1 | [
"MIT"
] | null | null | null | queries/stackoverflow/q16/aec57a9b7ee7a2fdee97d8a46d3932a60ac7dcbd.sql | christophanneser/Bao-for-Presto | b1d93689025d51cdea1a2e81edb8f077df8afcc1 | [
"MIT"
] | null | null | null | SELECT COUNT(*)
FROM site AS s,
so_user AS u1,
tag AS t1,
tag_question AS tq1,
question AS q1,
badge AS b1,
account AS acc
WHERE s.site_id = u1.site_id
AND s.site_id = b1.site_id
AND s.site_id = t1.site_id
AND s.site_id = tq1.site_id
AND s.site_id = q1.site_id
AND t1.id = tq1.tag_id
AND q1.id = tq1.question_id
AND q1.owner_user_id = u1.id
AND acc.id = u1.account_id
AND b1.user_id = u1.id
AND (q1.favorite_count >= 0)
AND (q1.favorite_count <= 1)
AND s.site_name = 'stackoverflow'
AND (t1.name in ('bouncycastle',
'ejb-3.0',
'field',
'inline',
'keras',
'parameter-passing',
'plugins',
'prototype',
'row',
'sequence',
'sorting',
'swagger',
'upload',
'workflow'))
AND (LOWER(acc.website_url) LIKE ('%en')) | 28.055556 | 43 | 0.492079 |
12622ece3e91c27f60bccd5e0b49332c868b598d | 1,726 | h | C | submodules/LegacyComponents/PublicHeaders/LegacyComponents/TGCheckButtonView.h | Sergey70/Telegram-iOS | 331b51ee204b92bb4c3aa8d4006a5070d4644770 | [
"AML"
] | null | null | null | submodules/LegacyComponents/PublicHeaders/LegacyComponents/TGCheckButtonView.h | Sergey70/Telegram-iOS | 331b51ee204b92bb4c3aa8d4006a5070d4644770 | [
"AML"
] | null | null | null | submodules/LegacyComponents/PublicHeaders/LegacyComponents/TGCheckButtonView.h | Sergey70/Telegram-iOS | 331b51ee204b92bb4c3aa8d4006a5070d4644770 | [
"AML"
] | null | null | null | #import <UIKit/UIKit.h>
typedef enum
{
TGCheckButtonStyleDefault,
TGCheckButtonStyleDefaultBlue,
TGCheckButtonStyleBar,
TGCheckButtonStyleMedia,
TGCheckButtonStyleGallery,
TGCheckButtonStyleShare,
TGCheckButtonStyleChat,
TGCheckButtonStyleCompact
} TGCheckButtonStyle;
@interface TGCheckButtonPallete : NSObject
@property (nonatomic, readonly) UIColor *defaultBackgroundColor;
@property (nonatomic, readonly) UIColor *accentBackgroundColor;
@property (nonatomic, readonly) UIColor *defaultBorderColor;
@property (nonatomic, readonly) UIColor *mediaBorderColor;
@property (nonatomic, readonly) UIColor *chatBorderColor;
@property (nonatomic, readonly) UIColor *checkColor;
@property (nonatomic, readonly) UIColor *blueColor;
@property (nonatomic, readonly) UIColor *barBackgroundColor;
+ (instancetype)palleteWithDefaultBackgroundColor:(UIColor *)defaultBackgroundColor accentBackgroundColor:(UIColor *)accentBackgroundColor defaultBorderColor:(UIColor *)defaultBorderColor mediaBorderColor:(UIColor *)mediaBorderColor chatBorderColor:(UIColor *)chatBorderColor checkColor:(UIColor *)checkColor blueColor:(UIColor *)blueColor barBackgroundColor:(UIColor *)barBackgroundColor;
@end
@interface TGCheckButtonView : UIButton
- (instancetype)initWithStyle:(TGCheckButtonStyle)style;
- (instancetype)initWithStyle:(TGCheckButtonStyle)style pallete:(TGCheckButtonPallete *)pallete;
- (void)setSelected:(bool)selected animated:(bool)animated;
- (void)setSelected:(bool)selected animated:(bool)animated bump:(bool)bump;
- (void)setSelected:(bool)selected animated:(bool)animated bump:(bool)bump completion:(void (^)())completion;
- (void)setNumber:(NSUInteger)number;
+ (void)resetCache;
@end
| 39.227273 | 389 | 0.811124 |
7bb59e49f99821f1699e382dd6ff4a0ff65d8250 | 2,600 | swift | Swift | SwiftExtension/TestNativeApp/NativeWidget/NativeWidget.swift | t9mike/xamarin-ios-swift-extension | dbeb29102bf2f64e1929dcf4c9821cdb61b3ec52 | [
"MIT"
] | 26 | 2020-07-10T07:26:31.000Z | 2022-01-07T14:58:36.000Z | SwiftExtension/TestNativeApp/NativeWidget/NativeWidget.swift | t9mike/xamarin-ios-swift-extension | dbeb29102bf2f64e1929dcf4c9821cdb61b3ec52 | [
"MIT"
] | 3 | 2020-09-23T15:17:37.000Z | 2021-11-16T09:46:01.000Z | SwiftExtension/TestNativeApp/NativeWidget/NativeWidget.swift | t9mike/xamarin-ios-swift-extension | dbeb29102bf2f64e1929dcf4c9821cdb61b3ec52 | [
"MIT"
] | 6 | 2020-09-04T23:54:46.000Z | 2021-09-27T20:44:41.000Z | //
// NativeWidget.swift
// NativeWidget
//
// Created by Chris Hamons on 6/30/20.
//
import WidgetKit
import SwiftUI
import Intents
struct Provider: IntentTimelineProvider {
public func placeholder(in context: Context) -> DataEntry {
return DataEntry(value: "0.0", delta: "0.0", date: Date(), configuration: Provider.Intent.init())
}
public func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (DataEntry) -> Void) {
let entry = DataEntry(value: "0.0", delta: "0.0", date: Date(), configuration: configuration)
completion(entry)
}
public func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline<DataEntry>) -> Void) {
var entries: [DataEntry] = []
let jsonData = readTestData();
for entry in jsonData.data {
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX") // set locale to reliable US_POSIX
dateFormatter.dateFormat = "yyyy-MM-dd"
let date = dateFormatter.date(from: entry.self.key);
entries.append(DataEntry(value: entry.value.value, delta: entry.value.delta, date: date!, configuration: configuration))
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
typealias Entry = DataEntry
typealias Intent = ConfigurationIntent
}
struct DataEntry: TimelineEntry {
public let value: String
public let delta: String
public let date: Date
public let configuration: ConfigurationIntent
}
struct PlaceholderView : View {
var body: some View {
VStack {
Text("")
}
}
}
struct NativeWidgetEntryView : View {
var entry: Provider.Entry
var body: some View {
VStack {
Text("Xamarin.iOS + SwiftUI")
Text(entry.date, style: .date)
Text(entry.value)
Text(entry.delta)
}
}
}
@main
struct NativeWidget: Widget {
private let kind: String = "NativeWidget"
public var body: some WidgetConfiguration {
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in
NativeWidgetEntryView(entry: entry)
}
.configurationDisplayName("Xamarin.iOS Example")
.description("This is an example widget embedded in Xamarin.iOS Container.")
.supportedFamilies([.systemSmall, .systemMedium, .systemLarge])
}
}
| 30.588235 | 143 | 0.643077 |
12bf66c0703d7c96e492015af3074233b2341722 | 672 | html | HTML | src/main/resources/static/f/c/11/sql_exe/sql_build.html | am-tasclin/amwf004 | 95f0be810789c2523133765555f398e21dd47d76 | [
"Apache-2.0"
] | null | null | null | src/main/resources/static/f/c/11/sql_exe/sql_build.html | am-tasclin/amwf004 | 95f0be810789c2523133765555f398e21dd47d76 | [
"Apache-2.0"
] | 1 | 2020-07-04T17:14:57.000Z | 2020-07-04T17:14:57.000Z | src/main/resources/static/f/c/11/sql_exe/sql_build.html | am-tasclin/amwf004 | 95f0be810789c2523133765555f398e21dd47d76 | [
"Apache-2.0"
] | 1 | 2020-07-01T17:28:20.000Z | 2020-07-01T17:28:20.000Z | <div class="w3-border-bottom">
{{ctrl.eMap[ctrl.sql_exe.rs2_id].r1value}}
<div data-ng-repeat="e in ctrl.eMap[ctrl.sql_exe.rs2_id].children" data-ng-switch="e.reference">
<span title="id:{{e.doc_id}}, r:{{e.reference}}"> {{e.r1value}} </span>
<span data-ng-switch-when="372183">()</span>
<span data-ng-switch-when="372181" data-ng-switch="e.doctype">
<span data-ng-switch-when="22">string</span>
<span data-ng-switch-when="23">integer</span>
</span>
<span data-ng-switch-when="371992" data-ng-repeat="e1 in e.children">
{{e1.r1value}} = {{e1.reference2}}
</span>
</div>
</div> | 48 | 100 | 0.587798 |
6ba093d8c94e5a16648adbb5eb0c0bc15baf4452 | 158 | h | C | src/Plugins/hardlight/WriterAdapter.h | cwaldren/HL-engine | 0a303759eaed6331e4e0022f59d71fd2cc5c4379 | [
"MIT"
] | 8 | 2019-01-18T04:39:08.000Z | 2020-05-16T01:11:54.000Z | src/Plugins/hardlight/WriterAdapter.h | cwaldren/HL-engine | 0a303759eaed6331e4e0022f59d71fd2cc5c4379 | [
"MIT"
] | null | null | null | src/Plugins/hardlight/WriterAdapter.h | cwaldren/HL-engine | 0a303759eaed6331e4e0022f59d71fd2cc5c4379 | [
"MIT"
] | 4 | 2019-01-18T21:20:32.000Z | 2020-06-29T14:34:06.000Z | #pragma once
class WriterAdapter {
public:
virtual void start() = 0;
virtual void stop() = 0;
virtual std::size_t total_bytes_written() const = 0;
};
| 12.153846 | 53 | 0.683544 |
3a17de98ac02d41a39ec3140af6e77c52bf9c227 | 814 | swift | Swift | tools/MIOTool/Sources/main.swift | MIOLabs/MIOJSLibs | 3750211d178e496e18e47acfcf08d37777c068ef | [
"Apache-2.0"
] | 3 | 2016-12-01T12:00:46.000Z | 2018-02-23T12:08:02.000Z | tools/MIOTool/Sources/main.swift | MIOLabs/MIOJSLibs | 3750211d178e496e18e47acfcf08d37777c068ef | [
"Apache-2.0"
] | 14 | 2020-01-28T16:26:54.000Z | 2022-03-02T07:08:26.000Z | tools/MIOTool/Sources/main.swift | MIOLabs/MIOJSLibs | 3750211d178e496e18e47acfcf08d37777c068ef | [
"Apache-2.0"
] | 1 | 2020-12-17T18:04:13.000Z | 2020-12-17T18:04:13.000Z | //
// main.swift
// MIOTool
//
// Created by GodShadow on 27/02/2017.
// Copyright © 2017 MIO Research Labs. All rights reserved.
//
import Foundation
if (ArgsCount() == 1) {
print("MIOTool v1.2\n");
print("Not enough params!\n");
}
var cmd:Command? = nil;
while let token = NextArg() {
switch (token) {
case "create":
cmd = Create();
case "deploy":
cmd = Deploy();
default:
if (token.hasPrefix("--")){
let value = NextArg();
if (value != nil) {
SetOption(token: token, value: value!);
}
}
else {
print("Argument not implemented!!")
}
}
}
if (cmd != nil) {
cmd?.execute();
}
| 17.695652 | 60 | 0.448403 |
7627a0d74e556b64580bcef4df752a4b102389a6 | 2,872 | kt | Kotlin | matrix/services/crypto/src/main/kotlin/app/dapk/st/matrix/crypto/internal/ShareRoomKeyUseCase.kt | ShadowJonathan/small-talk | 2ab2253e7a1335f8c25b5e69be0dc1ec9c254958 | [
"Apache-2.0"
] | 33 | 2022-03-05T00:34:11.000Z | 2022-03-28T12:09:52.000Z | matrix/services/crypto/src/main/kotlin/app/dapk/st/matrix/crypto/internal/ShareRoomKeyUseCase.kt | ShadowJonathan/small-talk | 2ab2253e7a1335f8c25b5e69be0dc1ec9c254958 | [
"Apache-2.0"
] | 12 | 2022-02-27T22:30:11.000Z | 2022-03-24T05:38:07.000Z | matrix/services/crypto/src/main/kotlin/app/dapk/st/matrix/crypto/internal/ShareRoomKeyUseCase.kt | ShadowJonathan/small-talk | 2ab2253e7a1335f8c25b5e69be0dc1ec9c254958 | [
"Apache-2.0"
] | 1 | 2022-03-18T18:11:34.000Z | 2022-03-18T18:11:34.000Z | package app.dapk.st.matrix.crypto.internal
import app.dapk.st.matrix.common.*
import app.dapk.st.matrix.common.extensions.toJsonString
import app.dapk.st.matrix.crypto.Olm
import app.dapk.st.matrix.device.DeviceService
import app.dapk.st.matrix.device.ToDevicePayload
private val ALGORITHM_OLM = AlgorithmName("m.olm.v1.curve25519-aes-sha2")
private val ALGORITHM_MEGOLM = AlgorithmName("m.megolm.v1.aes-sha2")
internal typealias ShareRoomKeyUseCase = suspend (room: Olm.RoomCryptoSession, List<Olm.DeviceCryptoSession>, RoomId) -> Unit
internal class ShareRoomKeyUseCaseImpl(
private val credentialsStore: CredentialsStore,
private val deviceService: DeviceService,
private val logger: MatrixLogger,
private val olm: Olm,
) : ShareRoomKeyUseCase {
override suspend fun invoke(roomSessionToShare: Olm.RoomCryptoSession, olmSessionsToEncryptMessage: List<Olm.DeviceCryptoSession>, roomId: RoomId) {
val credentials = credentialsStore.credentials()!!
logger.crypto("creating megolm payloads for $roomId: ${olmSessionsToEncryptMessage.map { it.userId to it.deviceId }}")
val toMessages = olmSessionsToEncryptMessage.map {
val payload = mapOf(
"type" to "m.room_key",
"content" to mapOf(
"algorithm" to ALGORITHM_MEGOLM.value,
"room_id" to roomId.value,
"session_id" to roomSessionToShare.id.value,
"session_key" to roomSessionToShare.key,
"chain_index" to roomSessionToShare.messageIndex,
),
"sender" to credentials.userId.value,
"sender_device" to credentials.deviceId.value,
"keys" to mapOf(
"ed25519" to roomSessionToShare.accountCryptoSession.fingerprint.value
),
"recipient" to it.userId.value,
"recipient_keys" to mapOf(
"ed25519" to it.fingerprint.value
)
)
val result = with(olm) { it.encrypt(payload.toJsonString()) }
DeviceService.ToDeviceMessage(
senderId = it.userId,
deviceId = it.deviceId,
ToDevicePayload.EncryptedToDevicePayload(
algorithmName = ALGORITHM_OLM,
senderKey = roomSessionToShare.accountCryptoSession.senderKey,
cipherText = mapOf(
it.identity to ToDevicePayload.EncryptedToDevicePayload.Inner(
cipherText = result.cipherText,
type = result.type,
)
)
),
)
}
logger.crypto("sharing keys")
deviceService.sendRoomKeyToDevice(roomSessionToShare.id, toMessages)
}
} | 44.184615 | 152 | 0.616295 |
4918ec42847a1bf1b1d53c62a095ffc8c55c0833 | 5,443 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1856.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1856.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1856.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x17ba7, %r8
nop
nop
nop
nop
nop
and %r13, %r13
mov $0x6162636465666768, %r12
movq %r12, %xmm1
movups %xmm1, (%r8)
nop
nop
inc %r9
lea addresses_normal_ht+0xb2df, %rsi
lea addresses_D_ht+0x10a7, %rdi
dec %r11
mov $62, %rcx
rep movsq
cmp $41464, %r8
lea addresses_WT_ht+0x97f7, %r9
nop
nop
sub %r11, %r11
mov (%r9), %r13
nop
cmp $49566, %rcx
lea addresses_normal_ht+0x1cea7, %rsi
lea addresses_UC_ht+0x1c4b7, %rdi
nop
nop
sub $51989, %r8
mov $53, %rcx
rep movsq
nop
nop
xor $1583, %r11
lea addresses_WT_ht+0x50df, %r12
nop
nop
nop
nop
cmp $46150, %rcx
mov $0x6162636465666768, %r8
movq %r8, (%r12)
nop
nop
and %rdi, %rdi
lea addresses_normal_ht+0xc627, %r8
nop
nop
inc %rdi
vmovups (%r8), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r9
nop
add %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %rbp
push %rdx
// Faulty Load
lea addresses_A+0x17627, %rbp
nop
nop
nop
nop
cmp $50325, %r10
mov (%rbp), %r12w
lea oracles, %r10
and $0xff, %r12
shlq $12, %r12
mov (%r10,%r12,1), %r12
pop %rdx
pop %rbp
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 44.614754 | 2,999 | 0.661216 |
0bc674ff5b220af2ad921daaa63df5bb644d2616 | 642 | js | JavaScript | services/madoc-ts/webpack.frontend.js | NLW-paulm/madoc-platform | eae9c5ea1b03da26d715a1629eedd0c19db39ed0 | [
"MIT"
] | null | null | null | services/madoc-ts/webpack.frontend.js | NLW-paulm/madoc-platform | eae9c5ea1b03da26d715a1629eedd0c19db39ed0 | [
"MIT"
] | null | null | null | services/madoc-ts/webpack.frontend.js | NLW-paulm/madoc-platform | eae9c5ea1b03da26d715a1629eedd0c19db39ed0 | [
"MIT"
] | null | null | null | module.exports = {
mode: process.env.NODE_ENV || 'development',
devtool: 'inline-source-map',
output: {
filename: 'bundle.js',
pathinfo: false,
publicPath: '/s/default/madoc/assets/admin/',
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('ts-loader'),
options: {
transpileOnly: true,
experimentalWatchApi: true,
},
},
],
},
],
},
resolve: {
extensions: ['.js', '.ts', '.tsx'],
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
};
| 19.454545 | 49 | 0.459502 |
5d35de6518e039a8d40fc9a4cd8602180c8892f2 | 1,585 | asm | Assembly | programs/oeis/273/A273368.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/273/A273368.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/273/A273368.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A273368: Numbers k such that 10*k+9 is a perfect square.
; 0,4,16,28,52,72,108,136,184,220,280,324,396,448,532,592,688,756,864,940,1060,1144,1276,1368,1512,1612,1768,1876,2044,2160,2340,2464,2656,2788,2992,3132,3348,3496,3724,3880,4120,4284,4536,4708,4972,5152,5428,5616,5904,6100,6400,6604,6916,7128,7452,7672,8008,8236,8584,8820,9180,9424,9796,10048,10432,10692,11088,11356,11764,12040,12460,12744,13176,13468,13912,14212,14668,14976,15444,15760,16240,16564,17056,17388,17892,18232,18748,19096,19624,19980,20520,20884,21436,21808,22372,22752,23328,23716,24304,24700,25300,25704,26316,26728,27352,27772,28408,28836,29484,29920,30580,31024,31696,32148,32832,33292,33988,34456,35164,35640,36360,36844,37576,38068,38812,39312,40068,40576,41344,41860,42640,43164,43956,44488,45292,45832,46648,47196,48024,48580,49420,49984,50836,51408,52272,52852,53728,54316,55204,55800,56700,57304,58216,58828,59752,60372,61308,61936,62884,63520,64480,65124,66096,66748,67732,68392,69388,70056,71064,71740,72760,73444,74476,75168,76212,76912,77968,78676,79744,80460,81540,82264,83356,84088,85192,85932,87048,87796,88924,89680,90820,91584,92736,93508,94672,95452,96628,97416,98604,99400,100600,101404,102616,103428,104652,105472,106708,107536,108784,109620,110880,111724,112996,113848,115132,115992,117288,118156,119464,120340,121660,122544,123876,124768,126112,127012,128368,129276,130644,131560,132940,133864,135256,136188,137592,138532,139948,140896,142324,143280,144720,145684,147136,148108,149572,150552,152028,153016,154504,155500
mul $0,5
div $0,2
add $0,2
bin $0,2
mov $1,$0
div $1,5
mul $1,4
| 144.090909 | 1,460 | 0.811987 |