text
stringlengths 31
1.04M
|
---|
example
example: size
"self example: 100"
"Sort a random collection of a certain size."
| aCollection random |
aCollection := OrderedCollection new.
random := Random new.
size
timesRepeat: [aCollection add: (random next * size) rounded].
^ self new active sort: aCollection |
accessing
opacity
"Return my transparency degree.
@see BlElement>>#opacity: for more information"
<return: #Number>
^ opacity |
=head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2018] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
package SeqStoreConverter::vega::HomoSapiens;
use strict;
use warnings;
use SeqStoreConverter::HomoSapiens;
use SeqStoreConverter::vega::VBasicConverter;
use vars qw(@ISA);
@ISA = qw(SeqStoreConverter::HomoSapiens SeqStoreConverter::vega::VBasicConverter);
1;
|
BEGIN {
FS=","
error = 0
}
{
if ( FNR == 1 )
{
fields = NF
print "File should have " fields " fields"
}
if ( NF != fields)
{
error = error + 1
print "Line " FNR " has " NF " fields"
}
}
END { print "Completed. Found " error " errors" }
|
grammar TodoLangGrammar;
todoExpressions : (addExpression)* (completeExpression)*;
addExpression : ADD TODO STRING;
completeExpression : COMPLETE TODO STRING;
ADD : 'ADD';
TODO : 'TODO';
COMPLETE: 'COMPLETE';
STRING: '"' ~ ["]* '"';
EOL: [\r\n] + -> skip;
WS: [ \t] -> skip; |
<?xml version="1.0" encoding="utf-8" ?>
<dataset Transactions="1"><dataset_header DisableRI="yes" DatasetObj="1004928896.09" DateFormat="mdy" FullHeader="no" SCMManaged="yes" YearOffset="1950" DatasetCode="RYCSO" NumericFormat="AMERICAN" NumericDecimal="." OriginatingSite="91" NumericSeparator=","/>
<dataset_records><dataset_transaction TransactionNo="1" TransactionType="DATA"><contained_record DB="icfdb" Table="ryc_smartobject" version_date="09/30/2002" version_time="23755" version_user="admin" deletion_flag="no" entity_mnemonic="rycso" key_field_value="3000032522.09" record_version_obj="3000032523.09" version_number_seq="4.09" secondary_key_value="gsteltrigd#CHR(1)#0" import_version_number_seq="4.09"><smartobject_obj>3000032522.09</smartobject_obj>
<object_filename>gsteltrigd</object_filename>
<customization_result_obj>0</customization_result_obj>
<object_type_obj>493</object_type_obj>
<product_module_obj>1000000129.39</product_module_obj>
<layout_obj>1003516362</layout_obj>
<object_description>gsteltrigd.p</object_description>
<object_path>icf/trg</object_path>
<object_extension>p</object_extension>
<static_object>yes</static_object>
<generic_object>no</generic_object>
<template_smartobject>no</template_smartobject>
<system_owned>no</system_owned>
<deployment_type>SRV</deployment_type>
<design_only>no</design_only>
<runnable_from_menu>no</runnable_from_menu>
<container_object>no</container_object>
<disabled>no</disabled>
<run_persistent>yes</run_persistent>
<run_when>ANY</run_when>
<shutdown_message_text></shutdown_message_text>
<required_db_list></required_db_list>
<sdo_smartobject_obj>0</sdo_smartobject_obj>
<extends_smartobject_obj>0</extends_smartobject_obj>
<security_smartobject_obj>3000032522.09</security_smartobject_obj>
<object_is_runnable>yes</object_is_runnable>
</contained_record>
</dataset_transaction>
</dataset_records>
</dataset> |
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<div data-toggle="topjui-layout" data-options="fit:true">
<div data-options="region:'center',title:'',fit:true,border:false,bodyCls:'border_right_bottom'">
<div data-toggle="topjui-tabs" data-options="fit:true,border:false">
<!-- 物材采购单入库 -->
<div title="物材采购单入库" data-options="iconCls:'fa fa-th'">
<div data-toggle="topjui-layout" style="width: 100%;height: 100%">
<table class="editTable">
<tr>
<td class="label1">选择要入库的物材采购单</td>
<td>
<input type="text" name="user"
data-toggle="topjui-combogrid"
data-options="id:'user',
idField: 'userNameId',
textField: 'userName',
url:remoteHost+'/system/user/getPageSetData',
columns:[[
{field: 'userName', title: '客户名称'},
]]">
</td>
</tr>
<tr>
<td class="label">物材名称</td>
<td>
<input type="text" name="making_name" data-toggle="topjui-textbox" data-options="required:true">
</td>
<td class="label">规格</td>
<td>
<input type="text" name="making_spec"
data-toggle="topjui-combobox"
data-options="required:true,data:[
{
text: 'A级',
value: 'A级'
},
{
text: 'B级',
value: 'B级'
},
{
text: 'C级',
value: 'C级'
}
],panelHeight:100">
<!-- <input type="text" name="spec"
data-toggle="topjui-combobox"
data-options="required:true,panelWidth:200,valueField:'code',
url:_ctx + '/json/dictionary/models.json'"> -->
</td>
</tr>
<tr>
<td class="label">入库数量</td>
<td><input type="text" name="num" data-toggle="topjui-numberspinner" data-options="required:true"></td><!-- data-options="precision:3" 小数点 -->
<td class="label">单价</td>
<td><input type="text" name="price" data-toggle="topjui-numberspinner" data-options="required:true,precision:2"></td><!-- data-options="precision:3" 小数点 -->
</tr>
<tr>
<td class="label">入库库区位置</td>
<td>
<input type="text" name="storge_name"
data-toggle="topjui-combobox"
data-options="data:[
{
text: 'A库',
value: 'A库'
},
{
text: 'B库',
value: 'B库'
},
{
text: 'C库',
value: 'C库'
}
],panelHeight:100">
<!-- <input type="text" name="spec"
data-toggle="topjui-combobox"
data-options="required:true,panelWidth:200,valueField:'code',
url:_ctx + '/json/dictionary/models.json'"> -->
</td>
</tr>
</table>
</div>
</div>
<!-- 物材采购单入库 -->
<!-- 物材无采购单入库 -->
<div title="物材入库" data-options="iconCls:'fa fa-th'">
<div data-toggle="topjui-layout" style="width: 100%;height: 100%">
<input type="hidden" id="uuid" name="uuid">
<table class="editTable">
<tr>
<td class="label">物材名称</td>
<td>
<input type="text" name="making_name" data-toggle="topjui-textbox" data-options="required:true">
</td>
<td class="label">规格</td>
<td>
<input type="text" name="making_spec"
data-toggle="topjui-combobox"
data-options="required:true,data:[
{
text: 'A级',
value: 'A级'
},
{
text: 'B级',
value: 'B级'
},
{
text: 'C级',
value: 'C级'
}
],panelHeight:100">
<!-- <input type="text" name="spec"
data-toggle="topjui-combobox"
data-options="required:true,panelWidth:200,valueField:'code',
url:_ctx + '/json/dictionary/models.json'"> -->
</td>
</tr>
<tr>
<td class="label">入库数量</td>
<td><input type="text" name="num" data-toggle="topjui-numberspinner" data-options="required:true"></td><!-- data-options="precision:3" 小数点 -->
<td class="label">单价</td>
<td><input type="text" name="price" data-toggle="topjui-numberspinner" data-options="required:true,precision:2"></td><!-- data-options="precision:3" 小数点 -->
</tr>
<tr>
<td class="label">入库库区位置</td>
<td>
<input type="text" name="storge_name"
data-toggle="topjui-combobox"
data-options="data:[
{
text: 'A库',
value: 'A库'
},
{
text: 'B库',
value: 'B库'
},
{
text: 'C库',
value: 'C库'
}
],panelHeight:100">
<!-- <input type="text" name="spec"
data-toggle="topjui-combobox"
data-options="required:true,panelWidth:200,valueField:'code',
url:_ctx + '/json/dictionary/models.json'"> -->
</td>
</tr>
</table>
</div>
</div>
<!-- 物材无采购单入库 -->
</div>
</div>
</div>
<script>
$(function () {
var grid = {
type: 'datagrid',
id: 'airplaneDataTable'
};
var grid1 = {
type: 'datagrid',
id: 'netCompanyDataTable'
};
var _ctx = '${pageContext.request.contextPath}';
/* $("." + grid1.id).iDatagrid({
rownumbers: false,
remoteFilter: true,
url: '/json/datagrid/wldl.json',
onClickRow: function (index, row) {
selectLevel2Proxy(row);
},
columns: [[
{field: 'id', title: '', checkbox: true},
{field: 'name', title: '订单号', sortable: false, width: 100},
{field: 'remark', title: '产品名称', sortable: false, width: 100},
{field: 'remark', title: '客户名称', sortable: false, width: 100},
{field: 'remark', title: '业务员', sortable: false, width: 100},
{field: 'leader', title: '材质', sortable: false, width: 100},
{field: 'leaderPhone', title: '楞型', sortable: false, width: 100},
{field: 'remark', title: '订单数量', sortable: false, width: 100},
{field: 'address', title: '尺寸', sortable: false, width: 100, hidden: true},
]],
filter: [
{
field: 'status',
type: 'label'
}
]
}); */
});
// 选择航空代理
function selectFlight(row) {
$("#carrierFlightId").html("");
$("#flightId").val("");
$("#carrierFlightId").html("<span style='font-weight:bold;font-size:18px'>【航空代理】:</span><span style='font-size:18px'>" + row.name + " " + row.leader + " " + row.leaderPhone + " " + row.address + " " + row.remark + "</span>");
$("#flightId").val(row.id);
}
// 选择二级网络代理
function selectLevel2Proxy(row) {
$("#carrierLevel2ProxyId").html("");
$("#level2ProxyId").val("");
$("#carrierLevel2ProxyId").html("<span style='font-weight:bold;font-size:18px '>【网络代理】:</span><span style='font-size:18px'>" + row.name + " " + row.leader + " " + row.leaderPhone + " " + row.address + " " + row.remark + "</span>");
$("#level2ProxyId").val(row.id);
}
</script> |
syntax = "proto3";
package ticket.service.item.v1;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.goproto_enum_prefix_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option go_package = "v1";
// The area service definition.
service Area {
rpc AreaInfo (AreaInfoRequest) returns (AreaInfoReply) {}
rpc DeleteArea (DeleteAreaRequest) returns (DeleteAreaReply) {}
}
// The response message containing the area info
message AreaInfo {
int64 id = 1 [(gogoproto.jsontag) = "id", (gogoproto.customname)= "ID"];
string a_id = 2 [(gogoproto.jsontag) = "a_id", (gogoproto.customname)= "AID"];
string name = 3 [(gogoproto.jsontag) = "name"];
int32 seat_num = 4 [(gogoproto.jsontag) = "seat_num"];
int32 width = 5 [(gogoproto.jsontag) = "width"];
int32 height = 6 [(gogoproto.jsontag) = "height"];
int64 place = 7 [(gogoproto.jsontag) = "place"];
int32 col_start = 8 [(gogoproto.jsontag) = "col_start"];
int32 col_type = 9 [(gogoproto.jsontag) = "col_type"];
int32 col_direction = 10 [(gogoproto.jsontag) = "col_direction"];
string row_list = 11 [(gogoproto.jsontag) = "row_list"];
string seat_start = 12 [(gogoproto.jsontag) = "seat_start"];
}
// areaInfo接口请求
message AreaInfoRequest {
// 待修改区域的ID(为0表示创建)
int64 ID = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "validate:\"min=0\""];
// 区域自定义编号
string AID = 2 [(gogoproto.jsontag) = "a_id", (gogoproto.moretags) = "validate:\"min=1,max=16\""];
// 区域名
string Name = 3 [(gogoproto.jsontag) = "name", (gogoproto.moretags) = "validate:\"min=1,max=16\""];
// 所属场地ID
int64 Place = 4 [(gogoproto.jsontag) = "place", (gogoproto.moretags) = "validate:\"min=1\""];
// 区域坐标
string Coordinate = 5 [(gogoproto.jsontag) = "coordinate", (gogoproto.moretags) = "validate:\"min=1\""];
}
// areaInfo接口返回
message AreaInfoReply {
// 操作结果
bool Success = 1 [(gogoproto.jsontag) = "success"];
// 操作区域ID
int64 ID = 2 [(gogoproto.jsontag) = "id"];
// 场地坐标
string Coordinate = 3 [(gogoproto.jsontag) = "coordinate"];
}
// deleteArea接口请求
message DeleteAreaRequest {
// 待删除区域的ID
int64 ID = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "validate:\"min=1\""];
}
// deleteArea接口返回
message DeleteAreaReply {
// 操作结果
bool Success = 1 [(gogoproto.jsontag) = "success"];
}
|
%!TEX root = ../../../main.tex
%
% Font set: Lucida
%
\setmainfont{LucidaEF}
\setmathfont{Lucida Math}
\setsansfont{LucidaSansEF}
\linespread{1.05} |
{-# OPTIONS --without-K --safe #-}
-- There are really all 'private' sub-pieces of
-- Categories.Category.Monoidal.Closed.IsClosed, but that is taking
-- forever to typecheck, so the idea is to split things into pieces and
-- hope that that will help.
open import Categories.Category using (Category)
open import Categories.Category.Monoidal
open import Categories.Category.Monoidal.Closed using (Closed)
module Categories.Category.Monoidal.Closed.IsClosed.Identity
{o ℓ e} {C : Category o ℓ e} {M : Monoidal C} (Cl : Closed M) where
open import Function using (_$_) renaming (_∘_ to _∙_)
open import Categories.Category.Monoidal.Utilities M
open import Categories.Morphism C using (Iso)
open import Categories.Morphism.Properties C using (Iso-resp-≈)
open import Categories.Morphism.Reasoning C using (pullʳ; pullˡ; pushˡ; cancelʳ)
open import Categories.Functor using (Functor) renaming (id to idF)
open import Categories.Functor.Bifunctor
open import Categories.Functor.Bifunctor.Properties
open import Categories.NaturalTransformation hiding (id)
open import Categories.NaturalTransformation.Dinatural
using (Extranaturalʳ; extranaturalʳ; DinaturalTransformation)
open import Categories.NaturalTransformation.NaturalIsomorphism
using (NaturalIsomorphism)
import Categories.Category.Closed as Cls
open Closed Cl
open Category C -- most of it is used
open HomReasoning
open adjoint renaming (unit to η; counit to ε; Ladjunct to 𝕃)
private
λ⇒ = unitorˡ.from
λ⇐ = unitorˡ.to
ρ⇒ = unitorʳ.from
ρ⇐ = unitorʳ.to
identity : NaturalIsomorphism idF [ unit ,-]
identity = record
{ F⇒G = F∘id⇒F ∘ᵥ ([ unit ,-] ∘ˡ (unitorʳ-natural.F⇒G)) ∘ᵥ η
; F⇐G = ε ∘ᵥ (unitorʳ-natural.F⇐G ∘ʳ [ unit ,-]) ∘ᵥ F⇒id∘F
; iso = λ X → Iso-resp-≈ (iso X) (⟺ identityˡ) (⟺ (∘-resp-≈ʳ identityʳ))
}
where
open Functor
iso : ∀ X → Iso (𝕃 unitorʳ.from) (ε.η X ∘ unitorʳ.to)
iso X = record
{ isoˡ = begin
(ε.η X ∘ ρ⇐) ∘ 𝕃 ρ⇒ ≈⟨ pullʳ unitorʳ-commute-to ⟩
ε.η X ∘ 𝕃 ρ⇒ ⊗₁ id ∘ ρ⇐ ≈⟨ sym-assoc ⟩
Radjunct (𝕃 ρ⇒) ∘ ρ⇐ ≈⟨ RLadjunct≈id ⟩∘⟨refl ⟩
ρ⇒ ∘ ρ⇐ ≈⟨ unitorʳ.isoʳ ⟩
id ∎
; isoʳ = begin
𝕃 ρ⇒ ∘ ε.η X ∘ ρ⇐ ≈⟨ pullʳ (η.commute _) ⟩
[ id , ρ⇒ ]₁ ∘ 𝕃 ((ε.η X ∘ ρ⇐) ⊗₁ id) ≈˘⟨ pushˡ (homomorphism [ unit ,-]) ⟩
𝕃 (ρ⇒ ∘ (ε.η X ∘ ρ⇐) ⊗₁ id) ≈⟨ F-resp-≈ [ unit ,-] unitorʳ-commute-from ⟩∘⟨refl ⟩
𝕃 ((ε.η X ∘ ρ⇐) ∘ ρ⇒) ≈⟨ F-resp-≈ [ unit ,-] (cancelʳ unitorʳ.isoˡ) ⟩∘⟨refl ⟩
𝕃 (ε.η X) ≈⟨ zag ⟩
id ∎
}
module identity = NaturalIsomorphism identity
diagonal : Extranaturalʳ unit [-,-]
diagonal = extranaturalʳ (λ X → 𝕃 λ⇒)
$ λ {X Y f} → begin
[ id , f ]₁ ∘ 𝕃 λ⇒ ≈˘⟨ pushˡ (homomorphism [ X ,-]) ⟩
[ id , f ∘ λ⇒ ]₁ ∘ η.η unit ≈˘⟨ F-resp-≈ [ X ,-] unitorˡ-commute-from ⟩∘⟨refl ⟩
[ id , λ⇒ ∘ id ⊗₁ f ]₁ ∘ η.η unit ≈⟨ homomorphism [ X ,-] ⟩∘⟨refl ⟩
([ id , λ⇒ ]₁ ∘ [ id , id ⊗₁ f ]₁) ∘ η.η unit ≈⟨ pullʳ (mate.commute₁ f) ⟩
[ id , λ⇒ ]₁ ∘ [ f , id ]₁ ∘ η.η unit ≈⟨ pullˡ [ [-,-] ]-commute ⟩
([ f , id ]₁ ∘ [ id , λ⇒ ]₁) ∘ η.η unit ≈⟨ assoc ⟩
[ f , id ]₁ ∘ 𝕃 λ⇒ ∎
where open Functor
module diagonal = DinaturalTransformation diagonal
|
package nextflow.plugin
import spock.lang.Specification
/**
*
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com>
*/
class PluginSpecTest extends Specification {
def 'should parse plugins spec' () {
when:
def spec = PluginSpec.parse(FQID)
then:
spec.id == ID
spec.version == VER
where:
FQID | ID | VER
'foo@1.0' | 'foo' | '1.0'
}
def 'should compare specs' () {
given:
def spec1 = new PluginSpec('nf-alpha','1.0.0')
def spec2 = new PluginSpec('nf-alpha','1.0.0')
def spec3 = new PluginSpec('nf-delta','2.0.0')
expect:
spec1 == spec2
spec1 != spec3
and:
spec1 < spec3
and:
spec1.hashCode() == spec2.hashCode()
spec1.hashCode() != spec3.hashCode()
}
}
|
syntax = "proto3";
package form_schema_version;
import "flowable_service_sdk/model/flowable_service/form_schema_version.proto";
/*
UpdateFormSchemaVersion请求
*/
message UpdateFormSchemaVersionRequest {
/*
表单实例Id
*/
string formId = 1 ;
/*
表单版本实例Id
*/
string versionId = 2 ;
/*
表单版本是否已完成(true表示已完成,false未完成)
*/
bool isDone = 3 ;
/*
版本状态(unfinished 未完成, done已完成),存为草稿传unfinished,保存传done
*/
string state = 4 ;
/*
版本名称
*/
string versionName = 5 ;
/*
版本描述
*/
string versionMemo = 6 ;
/*
前台的表单控件属性
*/
string formDefinition = 7 ;
/*
表单名称
*/
string name = 8 ;
/*
表单说明
*/
string memo = 9 ;
/*
表单类别
*/
string category = 10 ;
}
/*
UpdateFormSchemaVersion返回
*/
message UpdateFormSchemaVersionResponse {
/*
最新版本
*/
flowable_service.FormSchemaVersion lastestVersion = 1 ;
/*
表单实例id
*/
string instanceId = 2 ;
/*
表单名称
*/
string name = 3 ;
/*
表单类别
*/
string category = 4 ;
/*
表单说明
*/
string memo = 5 ;
/*
表单作者
*/
string creator = 6 ;
/*
创建时间
*/
string ctime = 7 ;
}
/*
UpdateFormSchemaVersionApi返回
*/
message UpdateFormSchemaVersionResponseWrapper {
/*
返回码
*/
int32 code = 1 ;
/*
返回码解释
*/
string codeExplain = 2 ;
/*
错误详情
*/
string error = 3 ;
/*
返回数据
*/
form_schema_version.UpdateFormSchemaVersionResponse data = 4 ;
}
|
2 28 0.0104360790160268
3 29 0.0108087961237421
6 49 0.018263138278047
8 50 0.0186358553857622
9 923 0.34401789042117
10 929 0.346254193067462
16 1844 0.68729034662691
17 2181 0.812896011926947
18 2231 0.83153186731271
25 2482 0.925083861349236
32 2500 0.93179276928811
33 2511 0.935892657472978
63 2680 0.998881848676854
64 2683 1
|
namespace OpenAPI.Model
open System
open System.Collections.Generic
module GenericResource =
//#region GenericResource
type GenericResource = {
Class : string;
DisplayName : string;
DurationInMillis : int;
Id : string;
Result : string;
StartTime : string;
}
//#endregion
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Program.Nodes.Infix_Operators is
function Create
(Left : Program.Elements.Expressions.Expression_Access;
Operator : not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access;
Right : not null Program.Elements.Expressions.Expression_Access)
return Infix_Operator is
begin
return Result : Infix_Operator :=
(Left => Left, Operator => Operator, Right => Right,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Left : Program.Elements.Expressions.Expression_Access;
Operator : not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access;
Right : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Infix_Operator is
begin
return Result : Implicit_Infix_Operator :=
(Left => Left, Operator => Operator, Right => Right,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Left
(Self : Base_Infix_Operator)
return Program.Elements.Expressions.Expression_Access is
begin
return Self.Left;
end Left;
overriding function Operator
(Self : Base_Infix_Operator)
return not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access is
begin
return Self.Operator;
end Operator;
overriding function Right
(Self : Base_Infix_Operator)
return not null Program.Elements.Expressions.Expression_Access is
begin
return Self.Right;
end Right;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Infix_Operator)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Infix_Operator)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Infix_Operator)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize (Self : aliased in out Base_Infix_Operator'Class) is
begin
if Self.Left.Assigned then
Set_Enclosing_Element (Self.Left, Self'Unchecked_Access);
end if;
Set_Enclosing_Element (Self.Operator, Self'Unchecked_Access);
Set_Enclosing_Element (Self.Right, Self'Unchecked_Access);
null;
end Initialize;
overriding function Is_Infix_Operator_Element
(Self : Base_Infix_Operator)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Infix_Operator_Element;
overriding function Is_Expression_Element
(Self : Base_Infix_Operator)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Expression_Element;
overriding procedure Visit
(Self : not null access Base_Infix_Operator;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Infix_Operator (Self);
end Visit;
overriding function To_Infix_Operator_Text
(Self : aliased in out Infix_Operator)
return Program.Elements.Infix_Operators.Infix_Operator_Text_Access is
begin
return Self'Unchecked_Access;
end To_Infix_Operator_Text;
overriding function To_Infix_Operator_Text
(Self : aliased in out Implicit_Infix_Operator)
return Program.Elements.Infix_Operators.Infix_Operator_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Infix_Operator_Text;
end Program.Nodes.Infix_Operators;
|
// @generated SignedSource<<e5a3f1522abb6cf81f38b31677358f30>>
// DO NOT EDIT THIS FILE MANUALLY!
// This file is a mechanical copy of the version in the configerator repo. To
// modify it, edit the copy in the configerator repo instead and copy it over by
// running the following in your fbcode directory:
//
// configerator-thrift-updater glean/service.thrift
// Copyright (c) Facebook, Inc. and its affiliates.
namespace cpp2 facebook.glean
namespace hs Glean
namespace py glean.service
namespace py3 glean
namespace php glean
namespace rust glean_service
struct HostPort {
1: string host
2: i32 port
}
union Service {
1: string tier
2: HostPort hostPort
} (hs.nonempty)
|
{
"spriteId": null,
"solid": false,
"visible": true,
"spriteMaskId": null,
"persistent": false,
"parentObjectId": {
"name": "ParentPlayerBullet",
"path": "objects/ParentPlayerBullet/ParentPlayerBullet.yy",
},
"physicsObject": false,
"physicsSensor": false,
"physicsShape": 1,
"physicsGroup": 1,
"physicsDensity": 0.5,
"physicsRestitution": 0.1,
"physicsLinearDamping": 0.1,
"physicsAngularDamping": 0.1,
"physicsFriction": 0.2,
"physicsStartAwake": true,
"physicsKinematic": false,
"physicsShapePoints": [],
"eventList": [],
"properties": [],
"overriddenProperties": [],
"parent": {
"name": "Objects",
"path": "folders/Objects.yy",
},
"resourceVersion": "1.0",
"name": "ParentPlayerWeaponExplosion",
"tags": [],
"resourceType": "GMObject",
} |
(setq 4gl-keywords
`(
("\\s." . font-lock-type-face)
("\\s(\\|\\s)" . font-lock-builtin-face)
("^REPORT .*(\\(.*\\))" (1 font-lock-variable-name-face))
("^FUNCTION .*(\\(.*\\))" (1 font-lock-variable-name-face))
("LET \\(\\sw+\\)" (1 font-lock-variable-name-face))
("REPORT \\(\\sw+\\)(" (1 font-lock-function-name-face))
("FUNCTION \\(\\sw+\\)(" (1 font-lock-function-name-face))
(, (regexp-opt (split-string "ABORT ABS ABSOLUTE ACCEPT ACCESS ACOS ADD AFTER ALL SFMT
ALLOCATE ALTER AND ANSI ANY APPEND ARG_VAL ARRAY ARR_COUNT
ARR_CURR AS ASC ASCENDING ASCII ASIN AT ATAN ATAN2 ATTACH
ATTRIBUTE ATTRIBUTES AUDIT AUTHORIZATION AUTO AUTONEXT AVERAGE AVG
BEFORE BEGIN BETWEEN BLACK BLINK BLUE BOLD BORDER BOTH BOTTOM
BREAK BUFFERED BY BYTE
CALL CASCADE CASE CHAR CHARACTER CHARACTER_LENGTH CHAR_LENGTH
CHECK CLASS_ORIGIN CLEAR CLIPPED CLOSE CLUSTER COLOR
COLUMN COLUMNS COMMAND COMMENT COMMENTS COMMIT COMMITTED
COMPOSITES COMPRESS CONCURRENT CONNECT CONNECTION
CONNECTION_ALIAS CONSTRAINED CONSTRAINT CONSTRAINTS CONSTRUCT
CONTINUE CONTROL COS COUNT CREATE CURRENT CURSOR CYAN
DATA DATABASE DATASKIP DATE DATETIME DAY DBA DBINFO DBSERVERNAME
DEALLOCATE DEBUG DEC DECIMAL DECLARE DEFAULT DEFAULTS DEFER
DEFERRED DEFINE DELETE DELIMITER DELIMITERS DESC DESCENDING
DESCRIBE DESCRIPTOR DETACH DIAGNOSTICS DIM DIRTY DISABLED
DISCONNECT DISPLAY DISTINCT DISTRIBUTIONS DO DORMANT DOUBLE
DOWN DOWNSHIFT DROP
EACH ELIF ELSE ENABLED END ENTRY ERROR ERRORLOG ERR_GET
ERR_PRINT ERR_QUIT ESC ESCAPE EVERY EXCEPTION EXCLUSIVE
EXEC EXECUTE EXISTS EXIT EXP EXPLAIN EXPRESSION EXTEND EXTENT
EXTERN EXTERNAL
F1 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F2 F20 F21 F22 F23
F24 F25 F26 F27 F28 F29 F3 F30 F31 F32 F33 F34 F35 F36 F37 F38
F39 F4 F40 F41 F42 F43 F44 F45 F46 F47 F48 F49 F5 F50 F51 F52
F53 F54 F55 F56 F57 F58 F59 F6 F60 F61 F62 F63 F64 F7 F8 F9
FALSE FETCH FGL_GETENV FGL_KEYVAL FGL_LASTKEY FIELD FIELD_TOUCHED
FILE FILLFACTOR FILTERING FINISH FIRST FLOAT FLUSH FOR
FOREACH FOREIGN FORM FORMAT FORMONLY FORTRAN FOUND FRACTION
FRAGMENT FREE FROM FUNCTION GET_FLDBUF GLOBAL GLOBALS GO GOTO
GRANT GREEN GROUP HAVING HEADER HELP HEX HIDE HIGH HOLD HOUR
IDATA IF ILENGTH IMMEDIATE IN INCLUDE INDEX INDEXES INDICATOR
INFIELD INIT INITIALIZE INPUT INSERT INSTRUCTIONS INT INTEGER
INTERRUPT INTERVAL INTO INT_FLAG INVISIBLE IS ISAM ISOLATION
ITYPE
KEY LABEL
LANGUAGE LAST LEADING LEFT LENGTH LET LIKE LINE
LINENO LINES LOAD LOCATE LOCK LOG LOG10 LOGN LONG LOW
MAGENTA MAIN MARGIN MATCHES MAX MDY MEDIUM MEMORY MENU MESSAGE
MESSAGE_LENGTH MESSAGE_TEXT MIN MINUTE MOD MODE MODIFY MODULE
MONEY MONTH MORE
NAME NCHAR NEED NEW NEXT NEXTPAGE NO NOCR NOENTRY NONE NORMAL
NOT NOTFOUND NULL NULLABLE NUMBER NUMERIC NUM_ARGS NVARCHAR
OCTET_LENGTH OF OFF OLD ON ONLY OPEN OPTIMIZATION OPTION OPTIONS
OR ORDER OTHERWISE OUTER OUTPUT
PAGE PAGENO PAUSE PDQPRIORITY PERCENT PICTURE PIPE POW PRECISION
PREPARE PREVIOUS PREVPAGE PRIMARY PRINT PRINTER PRIOR PRIVATE
PRIVILEGES PROCEDURE PROGRAM PROMPT PUBLIC PUT
QUIT QUIT_FLAG
RAISE RANGE READ READONLY REAL RECORD RECOVER RED REFERENCES
REFERENCING REGISTER RELATIVE REMAINDER REMOVE RENAME REOPTIMIZATION
REPEATABLE REPORT REQUIRED RESOLUTION RESOURCE RESTRICT
RESUME RETURN RETURNED_SQLSTATE RETURNING REVERSE REVOKE RIGHT
ROBIN ROLE ROLLBACK ROLLFORWARD ROOT ROUND ROW ROWID ROWIDS
ROWS ROW_COUNT RUN
SCALE SCHEMA SCREEN SCROLL SCR_LINE SECOND SECTION SELECT
SERIAL SERIALIZABLE SERVER_NAME SESSION SET SET_COUNT SHARE
SHORT SHOW SITENAME SIZE SIZEOF SKIP SLEEP SMALLFLOAT SMALLINT
SOME SPACE SPACES SQL SQLAWARN SQLCA SQLCODE SQLERRD SQLERRM
SQLERROR SQLERRP SQLSTATE SQLWARNING SQRT STABILITY START
STARTLOG STATIC STATISTICS STATUS STDEV STEP STOP STRING STRUCT
SUBCLASS_ORIGIN SUM SWITCH SYNONYM SYSTEM
SysBlobs SysChecks SysColAuth SysColDepend SysColumns
SysConstraints SysDefaults SysDepend SysDistrib SysFragAuth
SysFragments SysIndexes SysObjState SysOpClstr SysProcAuth
SysProcBody SysProcPlan SysProcedures SysReferences SysRoleAuth
SysSynTable SysSynonyms SysTabAuth SysTables SysTrigBody
SysTriggers SysUsers SysViews SysViolations
TAB TABLE TABLES TAN TEMP TEXT THEN THROUGH THRU TIME TO
TODAY TOP TOTAL TRACE TRAILER TRAILING TRANSACTION TRIGGER
TRIGGERS TRIM TRUE TRUNC TYPE TYPEDEF
UNCOMMITTED UNCONSTRAINED UNDERLINE UNION UNIQUE UNITS UNLOAD
UNLOCK UNSIGNED UP UPDATE UPSHIFT USER USING
VALIDATE VALUE VALUES VARCHAR VARIABLES VARIANCE VARYING
VERIFY VIEW VIOLATIONS
WAIT WAITING WARNING WEEKDAY WHEN WHENEVER WHERE WHILE WHITE
WINDOW WITH WITHOUT WORDWRAP WORK WRAP WRITE
YEAR YELLOW
ZEROFILL")'words ) . font-lock-keyword-face)
;;(,(regex-opt (split-string " ") 'word) . font-lock-face)
))
(setq 4gl-mode-syntax-table
(let ((synTable (make-syntax-table)))
(modify-syntax-entry ?\( "()" synTable)
(modify-syntax-entry ?\) ")(" synTable)
(modify-syntax-entry ?\_ "w" synTable)
(modify-syntax-entry ?\' "\"" synTable)
(modify-syntax-entry ?\" "\"" synTable)
(modify-syntax-entry ?+ "." synTable)
(modify-syntax-entry ?- "." synTable)
(modify-syntax-entry ?% "." synTable)
(modify-syntax-entry ?& "." synTable)
(modify-syntax-entry ?| "." synTable)
(modify-syntax-entry ?^ "." synTable)
(modify-syntax-entry ?! "." synTable)
(modify-syntax-entry ?= "." synTable)
(modify-syntax-entry ?< "." synTable)
(modify-syntax-entry ?> "." synTable)
;; { } as multi-line comments
(modify-syntax-entry ?\{ "< 1n" synTable)
(modify-syntax-entry ?\} "> 4n" synTable)
;; # python style comments
(modify-syntax-entry ?# "< b" synTable)
(modify-syntax-entry ?\n "> b " synTable)
;; -- SQL style comments
;; also uses the new line comment ender above
(modify-syntax-entry ?\- ". 12b" synTable)
synTable))
(define-derived-mode 4gl-mode text-mode
:syntax-table 4gl-mode-syntax-table
(setq mode-name "4gl")
(setq font-lock-defaults '(4gl-keywords))
(setq comment-start "# ")
(setq comment-end "")
(set-syntax-table 4gl-mode-syntax-table)
(setq tab-width 4)
(electric-indent-mode 1)
(setq indent-tabs-mode t)
)
(provide '4gl-mode)
|
package alston.samuel.dtm;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("alston.samuel.dtm", appContext.getPackageName());
}
}
|
begin_version
3
end_version
begin_metric
0
end_metric
10
begin_variable
var0
-1
2
Atom door-open(door0)
NegatedAtom door-open(door0)
end_variable
begin_variable
var1
-1
5
Atom grasped(cup0, left_arm)
Atom grasped(cup1, left_arm)
Atom grasped(cup2, left_arm)
Atom grasped(cup3, left_arm)
Atom hand-free(left_arm)
end_variable
begin_variable
var2
-1
6
Atom grasped(cup0, right_arm)
Atom grasped(cup1, right_arm)
Atom grasped(cup2, right_arm)
Atom grasped(cup3, right_arm)
Atom grasped-sponge(right_arm)
Atom hand-free(right_arm)
end_variable
begin_variable
var3
-1
3
Atom on(cup0, table0)
Atom on(cup0, table1)
<none of those>
end_variable
begin_variable
var4
-1
3
Atom on(cup1, table0)
Atom on(cup1, table1)
<none of those>
end_variable
begin_variable
var5
-1
3
Atom on(cup2, table0)
Atom on(cup2, table1)
<none of those>
end_variable
begin_variable
var6
-1
3
Atom on(cup3, table0)
Atom on(cup3, table1)
<none of those>
end_variable
begin_variable
var7
-1
2
Atom robot-in-room(room0)
Atom robot-in-room(room1)
end_variable
begin_variable
var8
-1
2
Atom wiped(wipe0)
NegatedAtom wiped(wipe0)
end_variable
begin_variable
var9
-1
2
Atom wiped(wipe1)
NegatedAtom wiped(wipe1)
end_variable
7
begin_mutex_group
4
1 0
2 0
3 0
3 1
end_mutex_group
begin_mutex_group
5
1 0
1 1
1 2
1 3
1 4
end_mutex_group
begin_mutex_group
6
2 0
2 1
2 2
2 3
2 4
2 5
end_mutex_group
begin_mutex_group
4
1 1
2 1
4 0
4 1
end_mutex_group
begin_mutex_group
4
1 2
2 2
5 0
5 1
end_mutex_group
begin_mutex_group
4
1 3
2 3
6 0
6 1
end_mutex_group
begin_mutex_group
2
7 0
7 1
end_mutex_group
begin_state
1
4
5
1
1
1
0
1
1
1
end_state
begin_goal
6
3 0
4 0
5 0
6 0
8 0
9 0
end_goal
40
begin_operator
drive-through-door door0 room0 room1
2
0 0
7 0
2
0
1
0 7 0 1
0
end_operator
begin_operator
drive-through-door door0 room1 room0
2
0 0
7 1
2
0
1
0 7 1 0
0
end_operator
begin_operator
open-door room0 door0 left_arm
3
0 1
1 4
7 0
2
0
1
0 0 1 0
0
end_operator
begin_operator
open-door room1 door0 left_arm
3
0 1
1 4
7 1
2
0
1
0 0 1 0
0
end_operator
begin_operator
pickup-object room0 cup0 table1 left_arm
3
1 4
3 1
7 0
2
0
2
0 1 4 0
0 3 1 2
0
end_operator
begin_operator
pickup-object room0 cup0 table1 right_arm
3
2 5
3 1
7 0
2
0
2
0 2 5 0
0 3 1 2
0
end_operator
begin_operator
pickup-object room0 cup1 table1 left_arm
3
1 4
4 1
7 0
2
0
2
0 1 4 1
0 4 1 2
0
end_operator
begin_operator
pickup-object room0 cup1 table1 right_arm
3
2 5
4 1
7 0
2
0
2
0 2 5 1
0 4 1 2
0
end_operator
begin_operator
pickup-object room0 cup2 table1 left_arm
3
1 4
5 1
7 0
2
0
2
0 1 4 2
0 5 1 2
0
end_operator
begin_operator
pickup-object room0 cup2 table1 right_arm
3
2 5
5 1
7 0
2
0
2
0 2 5 2
0 5 1 2
0
end_operator
begin_operator
pickup-object room0 cup3 table1 left_arm
3
1 4
6 1
7 0
2
0
2
0 1 4 3
0 6 1 2
0
end_operator
begin_operator
pickup-object room0 cup3 table1 right_arm
3
2 5
6 1
7 0
2
0
2
0 2 5 3
0 6 1 2
0
end_operator
begin_operator
pickup-object room1 cup0 table0 left_arm
3
1 4
3 0
7 1
2
0
2
0 1 4 0
0 3 0 2
0
end_operator
begin_operator
pickup-object room1 cup0 table0 right_arm
3
2 5
3 0
7 1
2
0
2
0 2 5 0
0 3 0 2
0
end_operator
begin_operator
pickup-object room1 cup1 table0 left_arm
3
1 4
4 0
7 1
2
0
2
0 1 4 1
0 4 0 2
0
end_operator
begin_operator
pickup-object room1 cup1 table0 right_arm
3
2 5
4 0
7 1
2
0
2
0 2 5 1
0 4 0 2
0
end_operator
begin_operator
pickup-object room1 cup2 table0 left_arm
3
1 4
5 0
7 1
2
0
2
0 1 4 2
0 5 0 2
0
end_operator
begin_operator
pickup-object room1 cup2 table0 right_arm
3
2 5
5 0
7 1
2
0
2
0 2 5 2
0 5 0 2
0
end_operator
begin_operator
pickup-object room1 cup3 table0 left_arm
3
1 4
6 0
7 1
2
0
2
0 1 4 3
0 6 0 2
0
end_operator
begin_operator
pickup-object room1 cup3 table0 right_arm
3
2 5
6 0
7 1
2
0
2
0 2 5 3
0 6 0 2
0
end_operator
begin_operator
pickup-sponge right_arm
1
2 5
2
0
1
0 2 5 4
0
end_operator
begin_operator
putdown-object room0 cup0 table1 left_arm
2
1 0
7 0
2
0
2
0 1 0 4
0 3 -1 1
0
end_operator
begin_operator
putdown-object room0 cup0 table1 right_arm
2
2 0
7 0
2
0
2
0 2 0 5
0 3 -1 1
0
end_operator
begin_operator
putdown-object room0 cup1 table1 left_arm
2
1 1
7 0
2
0
2
0 1 1 4
0 4 -1 1
0
end_operator
begin_operator
putdown-object room0 cup1 table1 right_arm
2
2 1
7 0
2
0
2
0 2 1 5
0 4 -1 1
0
end_operator
begin_operator
putdown-object room0 cup2 table1 left_arm
2
1 2
7 0
2
0
2
0 1 2 4
0 5 -1 1
0
end_operator
begin_operator
putdown-object room0 cup2 table1 right_arm
2
2 2
7 0
2
0
2
0 2 2 5
0 5 -1 1
0
end_operator
begin_operator
putdown-object room0 cup3 table1 left_arm
2
1 3
7 0
2
0
2
0 1 3 4
0 6 -1 1
0
end_operator
begin_operator
putdown-object room0 cup3 table1 right_arm
2
2 3
7 0
2
0
2
0 2 3 5
0 6 -1 1
0
end_operator
begin_operator
putdown-object room1 cup0 table0 left_arm
2
1 0
7 1
2
0
2
0 1 0 4
0 3 -1 0
0
end_operator
begin_operator
putdown-object room1 cup0 table0 right_arm
2
2 0
7 1
2
0
2
0 2 0 5
0 3 -1 0
0
end_operator
begin_operator
putdown-object room1 cup1 table0 left_arm
2
1 1
7 1
2
0
2
0 1 1 4
0 4 -1 0
0
end_operator
begin_operator
putdown-object room1 cup1 table0 right_arm
2
2 1
7 1
2
0
2
0 2 1 5
0 4 -1 0
0
end_operator
begin_operator
putdown-object room1 cup2 table0 left_arm
2
1 2
7 1
2
0
2
0 1 2 4
0 5 -1 0
0
end_operator
begin_operator
putdown-object room1 cup2 table0 right_arm
2
2 2
7 1
2
0
2
0 2 2 5
0 5 -1 0
0
end_operator
begin_operator
putdown-object room1 cup3 table0 left_arm
2
1 3
7 1
2
0
2
0 1 3 4
0 6 -1 0
0
end_operator
begin_operator
putdown-object room1 cup3 table0 right_arm
2
2 3
7 1
2
0
2
0 2 3 5
0 6 -1 0
0
end_operator
begin_operator
putdown-sponge right_arm
1
2 4
2
0
1
0 2 4 5
0
end_operator
begin_operator
wipe room0 wipe0 table1 right_arm
3
2 4
7 0
8 1
2
0
1
0 8 1 0
0
end_operator
begin_operator
wipe room0 wipe1 table1 right_arm
3
2 4
7 0
9 1
2
0
1
0 9 1 0
0
end_operator
0
|
(*
-- This example ask uses the parses to process a Lean string that
-- contains a nested script block. The nexted script block will
-- invoke the leanlua_state recursively. It also demonstrates that we
-- need to use std::recursive_mutex instead of std::mutex at
-- leanlua_state. Otherwise, it will deadlock trying to get a lock on
-- the mutex.
code = "(" .. "*" .. "print('hello')" .. "*" .. ")"
print("executing: " .. code)
parse_lean_cmds(code)
*)
|
--------------------------------
-- @module Repeat
-- @extend ActionInterval
-- @parent_module cc
--------------------------------
--
-- @function [parent=#Repeat] setInnerAction
-- @param self
-- @param #cc.FiniteTimeAction action
--------------------------------
--
-- @function [parent=#Repeat] getInnerAction
-- @param self
-- @return FiniteTimeAction#FiniteTimeAction ret (return value: cc.FiniteTimeAction)
--------------------------------
-- creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30)
-- @function [parent=#Repeat] create
-- @param self
-- @param #cc.FiniteTimeAction action
-- @param #unsigned int times
-- @return Repeat#Repeat ret (return value: cc.Repeat)
--------------------------------
--
-- @function [parent=#Repeat] startWithTarget
-- @param self
-- @param #cc.Node target
--------------------------------
--
-- @function [parent=#Repeat] reverse
-- @param self
-- @return Repeat#Repeat ret (return value: cc.Repeat)
--------------------------------
--
-- @function [parent=#Repeat] clone
-- @param self
-- @return Repeat#Repeat ret (return value: cc.Repeat)
--------------------------------
--
-- @function [parent=#Repeat] stop
-- @param self
--------------------------------
--
-- @function [parent=#Repeat] update
-- @param self
-- @param #float dt
--------------------------------
--
-- @function [parent=#Repeat] isDone
-- @param self
-- @return bool#bool ret (return value: bool)
return nil
|
#!/usr/bin/env bash
rm -rf faults
mkdir faults
python3 run.py -na 2 -rs -c 1000000 --output_dir train
rm -rf faults
mkdir faults
python3 run.py -na 2 -rs -c 100 --output_dir val
rm -rf faults
mkdir faults
python3 run.py -na 2 -rs -c 1000 --output_dir test
zip dataset.zip -r train val test
|
-----------------------------------
-- Area: Batallia Downs [S]
-- Mob: Smilodon
-- Note: PH for La Velue
-----------------------------------
local ID = require("scripts/zones/Batallia_Downs_[S]/IDs")
require("scripts/globals/mobs")
-----------------------------------
function onMobDeath(mob, player, isKiller)
end
function onMobDespawn(mob)
tpz.mob.phOnDespawn(mob, ID.mob.LA_VELUE_PH, 10, 3600) -- 1 hour
end
|
// Copyright 2018 The go-hpb Authors
// Modified based on go-ethereum, which Copyright (C) 2014 The go-ethereum Authors.
//
// The go-hpb is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-hpb is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-hpb. If not, see <http://www.gnu.org/licenses/>.
// Package hpbapi implements the general Hpb API functions.
package hpbapi
import (
"context"
"math/big"
accounts "github.com/hpb-project/go-hpb/account"
bc "github.com/hpb-project/go-hpb/blockchain"
"github.com/hpb-project/go-hpb/blockchain/state"
hpbdb "github.com/hpb-project/go-hpb/blockchain/storage"
"github.com/hpb-project/go-hpb/blockchain/types"
"github.com/hpb-project/go-hpb/common"
"github.com/hpb-project/go-hpb/config"
"github.com/hpb-project/go-hpb/event/sub"
"github.com/hpb-project/go-hpb/hvm/evm"
"github.com/hpb-project/go-hpb/network/rpc"
"github.com/hpb-project/go-hpb/synctrl"
)
// Backend interface provides the common API services (that are provided by
// both full and light clients) with access to necessary functions.
type Backend interface {
// general Hpb API
Downloader() *synctrl.Syncer
ProtocolVersion() int
SuggestPrice(ctx context.Context) (*big.Int, error)
ChainDb() hpbdb.Database
EventMux() *sub.TypeMux
AccountManager() *accounts.Manager
RPCGasCap() uint64 // global gas cap for hpb_call over rpc: DoS protection
// BlockChain API
SetHead(number uint64)
HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)
BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)
BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)
StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error)
StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)
GetBlock(ctx context.Context, blockHash common.Hash) (*types.Block, error)
GetReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error)
GetTd(blockHash common.Hash) *big.Int
GetEVM(ctx context.Context, msg types.Message, state *state.StateDB, header *types.Header, vmCfg evm.Config) (*evm.EVM, func() error, error)
SubscribeChainEvent(ch chan<- bc.ChainEvent) sub.Subscription
SubscribeChainHeadEvent(ch chan<- bc.ChainHeadEvent) sub.Subscription
SubscribeChainSideEvent(ch chan<- bc.ChainSideEvent) sub.Subscription
// TxPool API
SendTx(ctx context.Context, signedTx *types.Transaction) error
GetPoolTransactions() (types.Transactions, error)
GetPoolTransaction(txHash common.Hash) *types.Transaction
GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)
Stats() (pending int, queued int)
TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)
//SubscribeTxPreEvent(chan<- bc.TxPreEvent) sub.Subscription
ChainConfig() *config.ChainConfig
CurrentBlock() *types.Block
}
func GetAPIs(apiBackend Backend) []rpc.API {
nonceLock := new(AddrLocker)
return []rpc.API{
{
Namespace: "hpb",
Version: "1.0",
Service: NewPublicHpbAPI(apiBackend),
Public: true,
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicHpbAPI(apiBackend),
Public: true,
},
{
Namespace: "hpb",
Version: "1.0",
Service: NewPublicBlockChainAPI(apiBackend),
Public: true,
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicBlockChainAPI(apiBackend),
Public: true,
},
{
Namespace: "hpb",
Version: "1.0",
Service: NewPublicTransactionPoolAPI(apiBackend, nonceLock),
Public: true,
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicTransactionPoolAPI(apiBackend, nonceLock),
Public: true,
},
{
Namespace: "txpool",
Version: "1.0",
Service: NewPublicTxPoolAPI(apiBackend),
Public: true,
}, {
Namespace: "debug",
Version: "1.0",
Service: NewPublicDebugAPI(apiBackend),
Public: true,
}, {
Namespace: "debug",
Version: "1.0",
Service: NewPrivateDebugAPI(apiBackend),
}, {
Namespace: "hpb",
Version: "1.0",
Service: NewPublicAccountAPI(apiBackend.AccountManager()),
Public: true,
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicAccountAPI(apiBackend.AccountManager()),
Public: true,
}, {
Namespace: "personal",
Version: "1.0",
Service: NewPrivateAccountAPI(apiBackend, nonceLock),
Public: false,
},
}
}
|
Shader "TheStudyOfProceduralNoise/ClassicPerlinNoise3D"
{
Properties
{
_NoiseFrequency("Noise Frequency", Float) = 1.0
_NoiseSpeed ("Noise Speed", Float) = 1.0
}
CGINCLUDE
#include "UnityCG.cginc"
#include "ProceduralNoise/ClassicPerlinNoise3D.cginc"
uniform float _NoiseFrequency;
uniform float _NoiseSpeed;
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(appdata v)
{
v2f o = (v2f)0;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag(v2f i) : SV_Target
{
fixed4 col = (fixed4)0.0;
float n = 0.5 + 0.5 * perlinNoise(float3(i.uv.xy * _NoiseFrequency, _Time.y * _NoiseSpeed));
col.rgb = n;
col.a = 1.0;
return col;
}
ENDCG
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Cull Back
ZWrite On
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
ENDCG
}
}
}
|
.mainContainer {
background-color: #5a6ad4;
width: 80%;
height: auto;
border: 1px solid gray;
border-radius: 5px;
}
.gridItem {
/* border: 3px solid gray; */
border-radius: 5px;
padding: 5px;
margin: 13px;
background-color: white;
width: 90%;
transition: all 0.5s;
font-size: 25px;
border-bottom: 2px solid gray;
}
.gridItem:hover {
background-color: whitesmoke;
cursor: pointer;
margin: 20px;
}
.agreeAndProceed {
margin: 20px;
float: right;
}
|
{
"id": "06cb40aa-2652-4370-aa50-17d8ebcd31a2",
"modelName": "GMSprite",
"mvc": "1.12",
"name": "spr_elfman",
"For3D": false,
"HTile": false,
"VTile": false,
"bbox_bottom": 59,
"bbox_left": 17,
"bbox_right": 41,
"bbox_top": 19,
"bboxmode": 2,
"colkind": 1,
"coltolerance": 0,
"edgeFiltering": false,
"frames": [
{
"id": "befee652-f75b-44b6-8519-62f497fc8ee9",
"modelName": "GMSpriteFrame",
"mvc": "1.0",
"SpriteId": "06cb40aa-2652-4370-aa50-17d8ebcd31a2",
"compositeImage": {
"id": "e013e1c9-7eeb-435d-b8ab-8edfca983748",
"modelName": "GMSpriteImage",
"mvc": "1.0",
"FrameId": "befee652-f75b-44b6-8519-62f497fc8ee9",
"LayerId": "00000000-0000-0000-0000-000000000000"
},
"images": [
{
"id": "63c89427-a865-47ab-a4ac-ac274d7a0047",
"modelName": "GMSpriteImage",
"mvc": "1.0",
"FrameId": "befee652-f75b-44b6-8519-62f497fc8ee9",
"LayerId": "f28aa598-c409-4d88-a8ff-5dc40187d273"
}
]
},
{
"id": "6b91f27a-ea94-4a2b-9d00-08bc625eb453",
"modelName": "GMSpriteFrame",
"mvc": "1.0",
"SpriteId": "06cb40aa-2652-4370-aa50-17d8ebcd31a2",
"compositeImage": {
"id": "16c72cb4-dc89-4d89-a085-dc4ffee4ba2e",
"modelName": "GMSpriteImage",
"mvc": "1.0",
"FrameId": "6b91f27a-ea94-4a2b-9d00-08bc625eb453",
"LayerId": "00000000-0000-0000-0000-000000000000"
},
"images": [
{
"id": "05b0dcb1-1ad3-490a-972d-8b54971c752e",
"modelName": "GMSpriteImage",
"mvc": "1.0",
"FrameId": "6b91f27a-ea94-4a2b-9d00-08bc625eb453",
"LayerId": "f28aa598-c409-4d88-a8ff-5dc40187d273"
}
]
},
{
"id": "769a2b6e-d61f-4581-8518-a7a3bd2be68c",
"modelName": "GMSpriteFrame",
"mvc": "1.0",
"SpriteId": "06cb40aa-2652-4370-aa50-17d8ebcd31a2",
"compositeImage": {
"id": "1bd0c5a6-6a9b-448b-8229-2b017348b402",
"modelName": "GMSpriteImage",
"mvc": "1.0",
"FrameId": "769a2b6e-d61f-4581-8518-a7a3bd2be68c",
"LayerId": "00000000-0000-0000-0000-000000000000"
},
"images": [
{
"id": "8ff2e1e4-e457-47d3-9800-a7ad4aa08d14",
"modelName": "GMSpriteImage",
"mvc": "1.0",
"FrameId": "769a2b6e-d61f-4581-8518-a7a3bd2be68c",
"LayerId": "f28aa598-c409-4d88-a8ff-5dc40187d273"
}
]
}
],
"gridX": 0,
"gridY": 0,
"height": 64,
"layers": [
{
"id": "f28aa598-c409-4d88-a8ff-5dc40187d273",
"modelName": "GMImageLayer",
"mvc": "1.0",
"SpriteId": "06cb40aa-2652-4370-aa50-17d8ebcd31a2",
"blendMode": 0,
"isLocked": false,
"name": "default",
"opacity": 100,
"visible": true
}
],
"origin": 9,
"originLocked": false,
"playbackSpeed": 10,
"playbackSpeedType": 0,
"premultiplyAlpha": false,
"sepmasks": false,
"swatchColours": [
4278190335,
4278255615,
4278255360,
4294967040,
4294901760,
4294902015,
4294967295,
4293717228,
4293059298,
4292335575,
4291677645,
4290230199,
4287993237,
4280556782,
4278252287,
4283540992,
4293963264,
4287770926,
4287365357,
4287203721,
4286414205,
4285558896,
4284703587,
4283782485,
4281742902,
4278190080,
4286158839,
4286688762,
4287219453,
4288280831,
4288405444,
4288468131,
4288465538,
4291349882,
4294430829,
4292454269,
4291466115,
4290675079,
4290743485,
4290943732,
4288518390,
4283395315,
4283862775,
4284329979,
4285068799,
4285781164,
4285973884,
4286101564,
4290034460,
4294164224,
4291529796,
4289289312,
4289290373,
4289291432,
4289359601,
4286410226,
4280556782,
4280444402,
4280128760,
4278252287,
4282369933,
4283086137,
4283540992,
4288522496,
4293963264,
4290540032,
4289423360,
4289090560,
4287770926,
4287704422,
4287571858,
4287365357,
4284159214,
4279176094,
4279058848,
4278870691,
4278231211,
4281367321
],
"swfPrecision": 2.525,
"textureGroupId": "1225f6b0-ac20-43bd-a82e-be73fa0b6f4f",
"type": 0,
"width": 64,
"xorig": 27,
"yorig": 35
} |
lexer grammar LuminaryLexer;
// Special Symbols
ASTERISK: '*';
CLOSING_CURLY_BRACKET: '}';
CLOSING_PARENTHESIS: ')';
CLOSING_SQUARE_BRACKET: ']';
COLON: ':';
COMMA: ',';
EQUALS_SIGN: '=';
GREATER_THAN_SIGN: '>';
LESS_THAN_SIGN: '<';
OPENING_CURLY_BRACKET: '{';
OPENING_PARENTHESIS: '(';
OPENING_SQUARE_BRACKET: '[';
ELLIPSIS: '...';
PERIOD: '.';
QUESTION_MARK: '?';
SEMICOLON: ';';
// Keywords
AS: 'as';
CLASS: 'class';
CONST: 'const';
DECORATOR: 'decorator';
ENUM: 'enum';
FALSE: 'false';
GET: 'get';
IMPORT: 'import';
INTERFACE: 'interface';
NAMESPACE: 'namespace';
NULL: 'null';
OPTION: 'option';
OVERRIDE: 'override';
SET: 'set';
TRUE: 'true';
TYPEOF: 'typeof';
VOID: 'void';
FINAL: 'final';
// Literals
STRING_LITERAL: '"' CHARACTERS? '"';
CHAR_LITERAL: '\'' CHARACTER '\'';
INTEGRAL_LITERAL: '-'? INTEGRAL_LITERAL_DIGITS ( 'i64' | 'i32'? | 'i16' | 'i8' ) |
INTEGRAL_LITERAL_DIGITS ( 'u64' | 'u32' | 'u16' | 'u8' );
BINARY_FLOATING_POINT_LITERAL: '-'? DEC_DIGITS PERIOD DEC_DIGITS? EXPONENT_PART? '-'* FLOATING_TYPE_SUFFIX? |
'-'? PERIOD DEC_DIGITS EXPONENT_PART? '-'* FLOATING_TYPE_SUFFIX? |
'-'? DEC_DIGITS EXPONENT_PART '-'* FLOATING_TYPE_SUFFIX? |
'-'? DEC_DIGITS '-'* FLOATING_TYPE_SUFFIX;
DECIMAL_FLOATING_POINT_LITERAL: '-'? DEC_DIGITS PERIOD DEC_DIGITS? EXPONENT_PART? '-'* DECIMAL_TYPE_SUFFIX |
'-'? PERIOD DEC_DIGITS EXPONENT_PART? '-'* DECIMAL_TYPE_SUFFIX |
'-'? DEC_DIGITS EXPONENT_PART '-'* DECIMAL_TYPE_SUFFIX |
'-'? DEC_DIGITS '-'* DECIMAL_TYPE_SUFFIX;
// Identifier
IDENTIFIER: [a-zA-Z] [_a-zA-Z0-9]*;
// Whitespaces and Comments
WHITESPACE: [ \t]+ -> skip;
NEW_LINE: ('\r' '\n' | '\n') -> skip;
DOCUMENTATION_COMMENTS: '///' ~[\r\n]* -> channel(HIDDEN);
SINGLE_LINE_COMMENT: '//' ~[\r\n]* -> skip;
MULTI_LINE_COMMENT: '/*' .*? '*/' -> skip;
// Fragments
fragment EXPONENT_PART: ('e'|'E')? DEC_INTEGER;
fragment FLOATING_TYPE_SUFFIX: ('f64' | 'f32');
fragment DECIMAL_TYPE_SUFFIX: ('d64');
fragment INTEGRAL_LITERAL_DIGITS: HEX_INTEGER | DEC_INTEGER | OCT_INTEGER | BIN_INTEGER;
fragment DEC_DIGITS: [0-9][0-9_]*;
fragment HEX_INTEGER: '0x' [0-9a-fA-F_]+;
fragment DEC_INTEGER: ('0' | [1-9][0-9_]*);
fragment OCT_INTEGER: '0o' [0-7_]+;
fragment BIN_INTEGER: '0b' [0-1_]+;
fragment CHARACTERS: (~[\\\r\n"] | '\\' ['"?abfnrtv\\])*;
fragment CHARACTER: (~[\\\r\n\'] | '\\' ['"?abfnrtv\\]);
|
/*
A labeled transition system (LTS) is comprised by States, a sub-set
of which are Initial, connected by transitions, here represented by
Events.
*/
sig State {
trans : Event -> State
}
sig Init in State {}
sig Event {}
/*
The LTS does not contain deadlocks, ie, each state has at least a
transition.
*/
pred inv1 {
all s: State | some s.trans --correct
-- all s : State | some State.trans --incorrect 1
-- all s : State | some trans --incorrect 2
-- all s1, s2:State | some e:Event | (s1->e->s2 in trans and s1 != s2) --incorrect 3
-- all s1, s2:State | some e:Event | s1->e->s2 in trans --incorrect 4
-- all s1, s2:State | some e:Event | s1->e->s2 in trans implies s1!=s2 --incorrect 5
-- all s:State , e:Event | some e->s --incorrect 6
-- all s:State | lone s.trans --incorrect 7
-- all s:State | some trans --incorrect 8
-- all x : State | some x.trans.Event --incorrect 9
-- lone State.trans --incorrect 10
-- some State.trans --incorrect 11
-- some State.trans & Event->State --incorrect 12
-- some State.trans.State --incorrect 13
-- some State<:trans --incorrect 14
-- some trans --incorrect 15
-- some trans.State --incorrect 16
}
/*
There is a single initial state.
*/
pred inv2 {
one Init --correct
-- all s1,s2:Init | s1=s2 --incorrect 1
-- all s1,s2:State | s1 in Init and s2 in Init implies s1=s2 --incorrect 2
-- all s:State | no s.trans --incorrect 3
-- all x, y : Init | some x implies x = y --incorrect 4
-- all x, y : Init | x = y --incorrect 5
-- all x, y : Init | x = y and some x --incorrect 6
-- lone Init --incorrect 7
-- one s : State | no trans.s --incorrect 8
-- one State --incorrect 9
-- one State && all s:State | no s.trans --incorrect 10
-- one State && no trans --incorrect 11
}
/*
The LTS is deterministic, ie, each state has at most a transition for each event.
*/
pred inv3 {
all s : State, e : Event | lone e.(s.trans) --correct
-- ((State.trans).Event) in State --incorrect 1
-- (Event.(State.trans)) in State --incorrect 2
-- all y : Event | lone trans.y --incorrect 3
-- all y : State | lone y.trans --incorrect 4
-- all e : Event | lone e<:(State.trans) --incorrect 5
-- all e : Event | lone e<:(State.trans.State) --incorrect 6
-- all e:Event, s:State | lone e --incorrect 7
-- all s : State | lone s.trans --incorrect 8
-- all s : State | lone s.trans.State --incorrect 9
-- all s : State | one s.trans --incorrect 10
-- all s : State, e : Event | lone s.(e.trans) --incorrect 11
-- all s : State, e : Event | one e.(s.trans) --incorrect 12
-- all s : State, e : Event | one s.(e.trans) --incorrect 13
-- all s,s1:State,e:Event | s->e->s1 in trans --incorrect 14
-- all s1, s2:State | one e:Event | lone s1->e->s2 --incorrect 15
-- all s1, s2:State, e:Event | lone s1->e->s2 --incorrect 16
-- all s:State | all e1,e2:Event | e1->s in s.trans and e2->s in s.trans implies e1=e2 --incorrect 17
-- all s:State | all e:Event | e->s in s.trans --incorrect 18
-- all s:State | Event = s.trans.State --incorrect 19
-- all s:State | lone (s.trans) --incorrect 20
-- all s:State | lone (State-s).trans --incorrect 21
-- all s:State | lone e:Event | e->s in s.trans --incorrect 22
-- all s:State | lone s.trans --incorrect 23
-- all s:State | lone s.trans.Event --incorrect 24
-- all s:State | lone s.trans.State --incorrect 25
-- all s:State | lone State.~(s.trans) --incorrect 26
-- all s:State | lone trans.s --incorrect 27
-- all s:State | one e:Event | e->s in s.trans --incorrect 28
-- all s:State | s.trans.State in Event --incorrect 29
-- all s:State, e:Event | lone s.trans --incorrect 30
-- all s:State, e:Event | lone s.trans.e --incorrect 31
-- all s:State, s1:State, e:Event | lone e->s1 --incorrect 32
-- all s:State,e:Event | lone s.trans --incorrect 33
-- all s:State,e:Event | lone s.trans.e --incorrect 34
-- all s:State,e:Event | lone s.trans.Event --incorrect 35
-- all s:State| lone Event->State & s.trans --incorrect 36
-- all x : Event, y : State | lone y.trans.x --incorrect 37
-- all x : State | lone x.trans --incorrect 38
-- all x : State, y : Event | lone (x.trans).y --incorrect 39
-- all x : State, y : Event | lone x.trans.y --incorrect 40
-- lone State.trans.State --incorrect 41
-- lone trans --incorrect 42
-- lone trans.State --incorrect 43
}
/*
All states are reachable from an initial state.
*/
pred inv4 {
let tr = { s1, s2 : State | some e : Event | s1->e->s2 in trans } |
State in Init.^tr --correct
-- all e:Event | State in e.^(Init.trans) --incorrect 1
-- all i : Init, s : State | s in i.*(trans[Event]) --incorrect 2
-- all i:Init | i.trans in State.trans --incorrect 3
-- all i:Init | State in Event.(i.trans) --incorrect 4
-- all i:Init | State in Event.^(i.trans) --incorrect 5
-- all i:Init, s:State, e:Event | i!=s and i->e->s in trans --incorrect 6
-- all i:Init, s:State, e:Event | i->e->s in trans --incorrect 7
-- all s : State | one Init --incorrect 8
-- all s : State | s in Init.^(Event.trans) --incorrect 9
-- all s : State | some (Init <: trans).s --incorrect 10
-- all s : State | some (Init.trans).s --incorrect 11
-- all s : State | some Init.( s.trans) --incorrect 12
-- all s : State | some Init.(s<:trans) --incorrect 13
-- all s : State | some Init.*(s.trans) --incorrect 14
-- all s : State | some Init<:(s.trans) --incorrect 15
-- all s : State | some s.(Init . trans) --incorrect 16
-- all s : State | some s.(Init.trans) --incorrect 17
-- all s : State | some s.(Init<:trans) --incorrect 18
-- all s : State | some s.(Init<:trans:>State) --incorrect 19
-- all s : State | State in Init.*(s.trans) --incorrect 20
-- all s : State | State in Init.^(s.trans) --incorrect 21
-- all s : State, e : Event | State in e.^(s.trans) --incorrect 22
-- all s : State, e : Event| State in e.^(s.trans) --incorrect 23
-- all s : State, i : Init | some (i <: trans).s --incorrect 24
-- all s : State, i : Init | some s.(i <: trans) --incorrect 25
-- all s: State | s in Init.^(Event.trans) --incorrect 26
-- all s:(State-Init) | s in Event.(Init.trans) --incorrect 27
-- all s:(State-Init) | s in Event.^(Init.trans) --incorrect 28
-- all s:(State-Init) | s in Init.(Event.trans) --incorrect 29
-- all s:State | Init->Event->(s-Init) in trans --incorrect 30
-- all s:State | Init->Event->s in trans --incorrect 31
-- all s:State | s in Event.(Init.trans) --incorrect 32
-- all s:State | s in Event.^(Init.trans) --incorrect 33
-- all s:State | s.^(s.trans) = State --incorrect 34
-- all s:State | some s.trans --incorrect 35
-- all s:State | State in s.trans.Event --incorrect 36
-- all s:State, s1:State, e:Event | e->s1 in s.trans --incorrect 37
-- all s:State, s1:State, e:Event | lone s.trans.Event --incorrect 38
-- all x : Event | State in *(Init.trans).x --incorrect 39
-- all x : Event | State in Init.(*(trans.x)) --incorrect 40
-- all x : Event | State in Init.*(trans.x) --incorrect 41
-- all x : Init | State in (*(x.trans)).Event --incorrect 42
-- all x : Init | State in (x.trans).Event --incorrect 43
-- all x : Init | State in Event.*(x.trans) --incorrect 44
-- all x : Init | State in Event.*(x.trans) + x --incorrect 45
-- all x : Init | State in x.trans.Event --incorrect 46
-- all x : Init, y : Event | State in *(x.trans).y --incorrect 47
-- all x : Init, y : Event | State in x.*(trans.y) --incorrect 48
-- all x : Init, y : Event | State in y.(x.trans) --incorrect 49
-- all x : Init, y : Event | State in y.*(x.trans) --incorrect 50
-- all x : Init, y : Event | State in y.*(x.trans) + x --incorrect 51
-- all x : Init, y : Event | State in y.^(x.trans) --incorrect 52
-- all x : Init, y : State | State in y.(x.trans) --incorrect 53
-- all x : Init, y : State | State in y.^(x.trans) --incorrect 54
-- all x : State | State in Event.*(x.trans) --incorrect 55
-- Init in Event --incorrect 56
-- Init in State --incorrect 57
-- Init.*(Event.trans) in State --incorrect 58
-- Init.trans.Event = State --incorrect 59
-- no trans[Event] --incorrect 60
-- some (Event.(Init.trans)) --incorrect 61
-- some *(Init.trans) --incorrect 62
-- some ^(Init.trans) --incorrect 63
-- some Event.(Init.trans) --incorrect 64
-- some Event.^(Init.trans) --incorrect 65
-- some Init.trans --incorrect 66
-- some Init.trans.Event --incorrect 67
-- State in (Event.(Init.trans) + Init) --incorrect 68
-- State in Event.(*(Init.trans)) --incorrect 69
-- State in Event.(Init.trans) --incorrect 70
-- State in Event.(Init.trans) + Init --incorrect 71
-- State in Event.*(Init.trans) --incorrect 72
-- State in Event.^(Init.trans) --incorrect 73
-- State in Init.(Event.trans) --incorrect 74
-- State in Init.*(Event.trans) --incorrect 75
-- State in Init.trans.Event --incorrect 76
-- State.(Event.trans) in Init.*(Event.trans) --incorrect 77
}
/*
All the states have the same events available.
*/
pred inv5 {
-- all s:State, s1:State | s.trans.State = s1.trans.State --correct
-- all s : State | Event = s.(State->Event) --incorrect 1
-- all s : State | Event in s.(State->Event) --incorrect 2
-- all s : State | Event in s.(trans.Event) --incorrect 3
-- all s : State | Event.(s.trans) in Event.(State.trans) --incorrect 4
-- all s : State | s.trans = State.trans --incorrect 5
-- all s : State | s.trans in State.trans --incorrect 6
-- all s : State | some (s.trans).Event --incorrect 7
-- all s : State | some Event.(s.trans) --incorrect 8
-- all s : State | some Event.(s<:trans) --incorrect 9
-- all s : State | some s->Event --incorrect 10
-- all s : State, e : Event | e.(s.trans) in Event.(State.trans) --incorrect 11
{#m#() all s : State, e : Event | some (s.trans).e } --incorrect 12
-- all s : State, e : Event | some e.(s.trans) --incorrect 13
-- all s,s1:State,e:Event | s->e->s1 in trans --incorrect 14
-- all s,s1:State,e:Event|some s2,s3:State | s->e->s2 in trans implies s1->e->s3 in trans --incorrect 15
-- all s1, s2 : State | s1.trans = s2.trans --incorrect 16
-- all s1, s2:State, e:Event | s1->e->s2 in trans --incorrect 17
-- all s1, s2:State, e:Event | s1->e->s2 in trans and s1->e->s1 in trans --incorrect 18
-- all s1,s2 : State, e : Event | e.(s1.trans) = e.(s2.trans) --incorrect 19
-- all s1,s2:State |some e:Event |some e.(s1.trans) implies some e.(s2.trans) --incorrect 20
-- all s1,s2:State|some e:Event | some e.(s1.trans) implies some e.(s2.trans) --incorrect 21
-- all s:State | all e:Event | some e<:s.trans --incorrect 22
-- all s:State | all e:Event | e in State.~(s.trans) --incorrect 23
-- all s:State | Event in Event.~(s.trans) --incorrect 24
-- all s:State | Event in s.~(State.trans) --incorrect 25
-- all s:State | Event in State.~(s.trans) --incorrect 26
-- all s:State | Event.~(s.trans) in Event --incorrect 27
-- all s:State | s.~(State.trans) in Event --incorrect 28
-- all s:State | State.(s.trans) in Event --incorrect 29
-- all s:State | State.~(s.trans) in Event --incorrect 30
-- all s:State, e:Event | s->e->s in trans --incorrect 31
-- all x : State | (x.trans).Event in Event --incorrect 32
-- all x : State | (x.trans.State) in Event --incorrect 33
-- all x : State | (x.trans.x) in Event --incorrect 34
-- all x : State | Event in x<:Event --incorrect 35
-- all x : State | Event.(trans.x) in Event --incorrect 36
-- all x : State | Event.(x.trans) in Event --incorrect 37
-- all x : State | some (x->Event->State) --incorrect 38
-- all x : State | some (x.trans) --incorrect 39
-- all x : State | some e : Event | x.trans = State.trans --incorrect 40
-- all x : State | some x->Event->State --incorrect 41
-- all x : State | some y : State | some x->Event->y --incorrect 42
-- all x : State | State in x:>Event --incorrect 43
-- all x : State | State.(x.trans) in Event --incorrect 44
-- all x : State | State.trans in x.trans --incorrect 45
-- all x : State | x.trans = State.trans --incorrect 46
-- all x : State | x.trans in State.trans --incorrect 47
-- all x : State, e : Event | some x->e->State --incorrect 48
-- all x : State, e : Event | some x->Event --incorrect 49
-- all x : State, e : Event | x->e->State in trans --incorrect 50
-- all x, y : State | all e : Event | some x->e->y implies some y->e->y --incorrect 51
-- all x, y : State | all e : Event | x->e->y in trans and y->e->y in trans --incorrect 52
-- all x, y : State | some e : Event | some x->e->y implies some y->e->y --incorrect 53
-- all x, y : State | some e : Event | x->e->State in trans implies y->e->State in trans --incorrect 54
-- all x, y : State | some e : Event | x->e->y in trans --incorrect 55
-- all x, y : State | some e : Event | x->e->y in trans implies y->e->y in trans --incorrect 56
-- all x, y : State | some e : Event | x->Event->y in trans --incorrect 57
-- all x, y : State | some x->Event implies some y->Event --incorrect 58
-- all x, y : State | some x.trans & y.trans --incorrect 59
-- all x, y : State | x->Event->y in trans --incorrect 60
-- all x, y : State | x->Event->y in trans implies y->Event->y in trans --incorrect 61
-- all x, y : State | x.trans in y.trans --incorrect 62
-- all x, y : State | x.trans in State.trans --incorrect 63
-- all x, y : State, e : Event | some x->e implies some y->e --incorrect 64
-- all x, y : State, e : Event | x->e->y in trans --incorrect 65
-- all x, y, z : State | some e : Event | x->e->y in trans implies y->e->x in trans --incorrect 66
-- Event in (Event.(State.trans)) --incorrect 67
-- one State->Event --incorrect 68
-- some State->Event->State --incorrect 69
-- State in Event.(State.trans) --incorrect 70
-- State in State.(trans.Event) --incorrect 71
-- State->Event in iden --incorrect 72
-- State.~(State.trans) in Event --incorrect 73
}
/*
Each event is available in at least a state.
*/
pred inv6 {
all e:Event | some s1,s2:State | s1->e->s2 in trans --correct
}
/*
The LTS is reversible, ie, from a reacheable state it is always possible
to return to an initial state.
*/
pred inv7 {
let tr = { s1, s2 : State | some e : Event | s1->e->s2 in trans } |
all s : Init.^tr | some i : Init | i in s.^tr --correct
-- (State.trans).~(State.trans) in iden --incorrect 1
-- all e:Event,s1,s2:State | s1->e->s2 in trans implies s2->e->s1 in trans --incorrect 2
-- all e:Event,s1,s2:State |some e1:Event| s1->e->s2 in trans implies s2->e1->s1 in trans --incorrect 3
-- all s1, s2:State, e:Event | s1->e->s2 in trans implies s2->e->s1 in trans --incorrect 4
-- all s1,s2:State | some e1,e2:Event | s1->e1->s2 in trans implies s2->e2->s1 in trans --incorrect 5
-- all s1,s2:State, e1,e2,e3,e4:Event | s1->e1->s2 in trans implies s2->e2->s1 in trans --incorrect 6
-- all s1,s2:State, e1,e2:Event | s1->e1->s2 in trans implies s2->e2->s1 in trans --incorrect 7
-- all s1,s2:State, e1,e2:Event | s1->e1->s2 in trans implies s2->e2->s1 in trans all s:State,e1,e2:Event | s->e1->s in trans implies s->e1->s in trans --incorrect 8
-- all s1,s2:State, e1,e2:Event | s1->e1->s2 in trans implies s2->e2->s1 in trans all s:State,e1,e2:Event | s->e1->s in trans implies s->e2->s in trans --incorrect 9
-- all s1,s2:State, e1,e2:Event | s1->e1->s2 in trans implies s2->e2->s1 in trans and s1 in e2.(s1.trans) --incorrect 10
-- all s1,s2:State, e1,e2:Event | s1->e1->s2 in trans implies s2->e2->s1 in trans or s1->e2->s1 in trans --incorrect 11
-- all x : Event | (trans.x) in State one -> one Init --incorrect 12
-- all x : Event | (trans.x) in State one -> one State --incorrect 13
-- all x : Event | some (*(~(trans.x))).Init --incorrect 14
-- all x : Event | some Init.(*(~(trans.x))) --incorrect 15
-- all x : Event | some Init.(^(~(trans.x))) --incorrect 16
-- all x : Init | (x.trans) in Event one -> one State --incorrect 17
-- all x : State | (no iden & (x.trans)) and some ((*(~(x.trans))).Init) --incorrect 18
-- all x : State | (x.trans) in Event one -> one State --incorrect 19
-- all x : State | no iden & (x.trans) --incorrect 20
-- all x : State | some (*(~(x.trans))).Init --incorrect 21
-- all x : State | some Init.(*(~(x.trans))) --incorrect 22
-- all x : State, y : Init, z : Event | (trans in y one -> one z one -> one x) and x != y --incorrect 23
-- all x : State, y : Init, z : Event | (trans in y one -> one z one -> one x) implies x != y --incorrect 24
-- all x : State, y : Init, z : Event | trans in y one -> one z one -> one x --incorrect 25
-- all x : State, y : Init, z : Event | trans in y one -> one z one -> one x and x != y --incorrect 26
-- all x : State, y : Init, z : Event | trans in y one -> one z one -> one x and z != y --incorrect 27
-- some (Event.(State.trans)) --incorrect 28
-- some trans.(Event.(State.trans)) --incorrect 29
-- ~(State.trans).(State.trans) in iden --incorrect 30
}
/*======== IFF PERFECT ORACLE ===============*/
pred inv1_OK {
all s: State | some s.trans --correct
}
assert inv1_Repaired {
inv1[] iff inv1_OK[]
}
---------
pred inv2_OK {
one Init --correct
}
assert inv2_Repaired {
inv2[] iff inv2_OK[]
}
--------
pred inv3_OK {
all s : State, e : Event | lone e.(s.trans) --correct
}
assert inv3_Repaired {
inv3[] iff inv3_OK[]
}
--------
pred inv4_OK {
let tr = { s1, s2 : State | some e : Event | s1->e->s2 in trans } |
State in Init.^tr --correct
}
assert inv4_Repaired {
inv4[] iff inv4_OK[]
}
--------
pred inv5_OK {
all s:State, s1:State | s.trans.State = s1.trans.State --correct
}
assert inv5_Repaired {
inv5[] iff inv5_OK[]
}
--------
pred inv7_OK {
let tr = { s1, s2 : State | some e : Event | s1->e->s2 in trans } |
all s : Init.^tr | some i : Init | i in s.^tr --correct
}
assert inv7_Repaired {
inv7[] iff inv7_OK[]
}
--------
--- PerfectOracleCommands
check inv1_Repaired expect 0
check inv2_Repaired expect 0
check inv3_Repaired expect 0
check inv4_Repaired expect 0
check inv5_Repaired expect 0
check inv7_Repaired expect 0
|
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?film_label
WHERE
{
?takeshi rdfs:label "ビートたけし"@ja .
?takeshi ^dbpedia-owl:director / rdfs:label ?film_label .
} |
<?xml version="1.0" encoding="UTF-8" ?>
<!--
****************************************************************
DITA to WordprocessingML Stylesheet
Module: Stylesheet constants.
Copyright © 2009-2017 Antenna House, Inc. All rights reserved.
Antenna House is a trademark of Antenna House, Inc.
URL : http://www.antennahouse.com/
E-mail : info@antennahouse.com
****************************************************************
-->
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ahf="http://www.antennahouse.com/names/XSLT/Functions/Document"
exclude-result-prefixes="#all">
<!-- ***************************************
Constants
***************************************-->
<!-- External Parameter yes/no value -->
<xsl:variable name="cYes" select="'yes'" as="xs:string" static="yes"/>
<xsl:variable name="cNo" select="'no'" as="xs:string" static="yes"/>
<!-- Inner flag/attribute value: true/false -->
<xsl:variable name="true" select="'true'" as="xs:string"/>
<xsl:variable name="false" select="'false'" as="xs:string"/>
<xsl:variable name="NaN" select="'NaN'" as="xs:string"/>
<xsl:variable name="lf" select="'
'" as="xs:string"/>
<xsl:variable name="doubleApos" as="xs:string" select="''''''"/>
<!-- Width type -->
<xsl:variable name="cTwip" as="xs:string" select="'dxa'"/>
<xsl:variable name="cPercent" as="xs:string" select="'pct'"/>
<xsl:variable name="cAuto" as="xs:string" select="'auto'"/>
<!-- Code -->
<xsl:variable name="cNbSp" as="xs:string" select="' '"/>
<!-- null element -->
<xsl:variable name="cElemNull" as="element()">
<_null/>
</xsl:variable>
</xsl:stylesheet>
|
tests
testPrintShowingDecimalPlaces2
"This tests problems related to Float>>rounded and Float>>roundTo::
- Float>>#rounded is inexact
- Float>>#roundTo: might overflow"
"5000000000000001.0 asTrueFraction = 5000000000000001.
5000000000000001 highBit = 53.
This number is represented exactly asFloat, it should print exactly"
self assert: (5000000000000001.0 printShowingDecimalPlaces: 0) = '5000000000000001'. "50000000000001.25 asTrueFraction = (200000000000005/4).
200000000000005 highBit = 48, 4 isPowerOfTwo,
So this number is also represented exactly as Float, it should print exactly.
Beware: (50000000000001.25 / 0.01) rounded exhibit the same problem as above."
self assert: (50000000000001.25 printShowingDecimalPlaces: 2) = '50000000000001.25'. "This number is close to maximum float value"
1.0e306 printShowingDecimalPlaces: 3 |
package Paws::AppSync::DeleteApiKeyResponse;
use Moose;
has _request_id => (is => 'ro', isa => 'Str');
1;
### main pod documentation begin ###
=head1 NAME
Paws::AppSync::DeleteApiKeyResponse
=head1 ATTRIBUTES
=head2 _request_id => Str
=cut
|
log close _all
clear all
discard
cap cls
cap pr drop _all
* Dependencies
/*
cap ado uninstall ftools
net install ftools, from("C:/git/ftools/src")
ftools, check
ftools, compile
*/
* Uninstall reghdfe
cap ado uninstall reghdfe
* Check that the .mata files don't have compile-time errors
* (inspect by hand for the word "unused")
cd "../src"
do reghdfe.mata
cd "../test"
* Reininstall and compile reghdfe
* Note: this has to be hardcoded!
net install reghdfe , from("c:/git/reghdfe/src/")
reghdfe, compile
noi di as text "reghdfe has been reinstalled from local, and recompiled"
exit
|
/*
Chris Daigle
Panel Data
Midterm 24 Oct 2018
*/
clear all
cd ~/Git/PanelDataWithStata/Midterm
use murder.dta
/* Question 11 */
describe
* Answer: 51
/* Question 12 */
describe
* Answer: 7
/* Question 13 */
sort mrdrte
list state mrdrte
list state in 17
* Answer: CT
* Note: Since CT and RI are tied at 16 and 17, depending on the ranking system,
* there is either no 17th and both CT and RI are 16 with AK being 18, or CT and
* RI are both 16 and AK is 17. I emailed you about this so I'm going to stick
* with CT/RI being 17th lowest.
/* Question 14 */
sum mrdrte, detail
* Answers: 7.4%. 4.7%
/* Question 15 */
* Submit do file
|
.inputtext {
border-bottom: 1px solid #ccc;
}
.inputtext .input-dummy {
position: absolute;
bottom: -1px;
color: transparent;
border-bottom: 2px solid #000;
}
.ui.form .inputtext input[type=text],
.inputtext input[type=text],
.inputtext input[type=text]:focus {
background: transparent;
padding: 5px 0;
border: none;
} |
(*****************************************************************************)
(* *)
(* Open Source License *)
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
(* and/or sell copies of the Software, and to permit persons to whom the *)
(* Software is furnished to do so, subject to the following conditions: *)
(* *)
(* The above copyright notice and this permission notice shall be included *)
(* in all copies or substantial portions of the Software. *)
(* *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
(* DEALINGS IN THE SOFTWARE. *)
(* *)
(*****************************************************************************)
type cors = Resto_cohttp.Cors.t = {
allowed_headers : string list ;
allowed_origins : string list ;
}
include Resto_cohttp.Server.Make(RPC_encoding)(RPC_logging)
|
{
"id": "ad0580bd-3f8a-405e-9899-c3976ffefa8a",
"modelName": "GMObject",
"mvc": "1.0",
"name": "obj_refresh_small",
"eventList": [
{
"id": "939233b8-ce46-4136-b823-a873e1165274",
"modelName": "GMEvent",
"mvc": "1.0",
"IsDnD": false,
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"enumb": 0,
"eventtype": 0,
"m_owner": "ad0580bd-3f8a-405e-9899-c3976ffefa8a"
},
{
"id": "b4700e61-6339-48ce-954c-2a9f2b73f204",
"modelName": "GMEvent",
"mvc": "1.0",
"IsDnD": false,
"collisionObjectId": "00000000-0000-0000-0000-000000000000",
"enumb": 0,
"eventtype": 3,
"m_owner": "ad0580bd-3f8a-405e-9899-c3976ffefa8a"
}
],
"maskSpriteId": "00000000-0000-0000-0000-000000000000",
"overriddenProperties": null,
"parentObjectId": "00000000-0000-0000-0000-000000000000",
"persistent": false,
"physicsAngularDamping": 0.1,
"physicsDensity": 0.5,
"physicsFriction": 0.2,
"physicsGroup": 0,
"physicsKinematic": false,
"physicsLinearDamping": 0.1,
"physicsObject": false,
"physicsRestitution": 0.1,
"physicsSensor": false,
"physicsShape": 1,
"physicsShapePoints": null,
"physicsStartAwake": true,
"properties": null,
"solid": false,
"spriteId": "cd0821c5-b72a-43a5-8a55-3431f116247a",
"visible": true
} |
/*******************************************************************
* NC_SID_2011_DX_PR_GRPS.SAS:
* THE SAS CODE SHOWN BELOW WILL LOAD THE ASCII
* INPATIENT STAY DX_PR_GRPS FILE INTO SAS
*******************************************************************/
***********************************************;
* Create SAS informats for missing values ;
***********************************************;
PROC FORMAT;
INVALUE N2PF
'-9' = .
'-8' = .A
'-6' = .C
'-5' = .N
OTHER = (|2.|)
;
INVALUE N3PF
'-99' = .
'-88' = .A
'-66' = .C
OTHER = (|3.|)
;
INVALUE N4PF
'-999' = .
'-888' = .A
'-666' = .C
OTHER = (|4.|)
;
INVALUE N4P1F
'-9.9' = .
'-8.8' = .A
'-6.6' = .C
OTHER = (|4.1|)
;
INVALUE N5PF
'-9999' = .
'-8888' = .A
'-6666' = .C
OTHER = (|5.|)
;
INVALUE N5P2F
'-9.99' = .
'-8.88' = .A
'-6.66' = .C
OTHER = (|5.2|)
;
INVALUE N6PF
'-99999' = .
'-88888' = .A
'-66666' = .C
OTHER = (|6.|)
;
INVALUE N6P2F
'-99.99' = .
'-88.88' = .A
'-66.66' = .C
OTHER = (|6.2|)
;
INVALUE N7P2F
'-999.99' = .
'-888.88' = .A
'-666.66' = .C
OTHER = (|7.2|)
;
INVALUE N7P4F
'-9.9999' = .
'-8.8888' = .A
'-6.6666' = .C
OTHER = (|7.4|)
;
INVALUE N8PF
'-9999999' = .
'-8888888' = .A
'-6666666' = .C
OTHER = (|8.|)
;
INVALUE N8P2F
'-9999.99' = .
'-8888.88' = .A
'-6666.66' = .C
OTHER = (|8.2|)
;
INVALUE N9PF
'-99999999' = .
'-88888888' = .A
'-66666666' = .C
OTHER = (|9.|)
;
INVALUE N9P2F
'-99999.99' = .
'-88888.88' = .A
'-66666.66' = .C
OTHER = (|9.2|)
;
INVALUE N10PF
'-999999999' = .
'-888888888' = .A
'-666666666' = .C
OTHER = (|10.|)
;
INVALUE N10P4F
'-9999.9999' = .
'-8888.8888' = .A
'-6666.6666' = .C
OTHER = (|10.4|)
;
INVALUE N10P5F
'-999.99999' = .
'-888.88888' = .A
'-666.66666' = .C
OTHER = (|10.5|)
;
INVALUE DATE10F
'-999999999' = .
'-888888888' = .A
'-666666666' = .C
OTHER = (|MMDDYY10.|)
;
INVALUE N11PF
'-9999999999' = .
'-8888888888' = .A
'-6666666666' = .C
OTHER = (|11.|)
;
INVALUE N12P2F
'-99999999.99' = .
'-88888888.88' = .A
'-66666666.66' = .C
OTHER = (|12.2|)
;
INVALUE N12P5F
'-99999.99999' = .
'-88888.88888' = .A
'-66666.66666' = .C
OTHER = (|12.5|)
;
INVALUE N13PF
'-999999999999' = .
'-888888888888' = .A
'-666666666666' = .C
OTHER = (|13.|)
;
INVALUE N15P2F
'-99999999999.99' = .
'-88888888888.88' = .A
'-66666666666.66' = .C
OTHER = (|15.2|)
;
RUN;
*******************************;
* Data Step *;
*******************************;
DATA NC_SIDC_2011_DX_PR_GRPS;
INFILE 'NC_SID_2011_DX_PR_GRPS.ASC' LRECL = 795;
*** Variable attribute ***;
ATTRIB
CHRON1 LENGTH=3
LABEL="Chronic condition indicator 1"
CHRON2 LENGTH=3
LABEL="Chronic condition indicator 2"
CHRON3 LENGTH=3
LABEL="Chronic condition indicator 3"
CHRON4 LENGTH=3
LABEL="Chronic condition indicator 4"
CHRON5 LENGTH=3
LABEL="Chronic condition indicator 5"
CHRON6 LENGTH=3
LABEL="Chronic condition indicator 6"
CHRON7 LENGTH=3
LABEL="Chronic condition indicator 7"
CHRON8 LENGTH=3
LABEL="Chronic condition indicator 8"
CHRON9 LENGTH=3
LABEL="Chronic condition indicator 9"
CHRON10 LENGTH=3
LABEL="Chronic condition indicator 10"
CHRON11 LENGTH=3
LABEL="Chronic condition indicator 11"
CHRON12 LENGTH=3
LABEL="Chronic condition indicator 12"
CHRON13 LENGTH=3
LABEL="Chronic condition indicator 13"
CHRON14 LENGTH=3
LABEL="Chronic condition indicator 14"
CHRON15 LENGTH=3
LABEL="Chronic condition indicator 15"
CHRON16 LENGTH=3
LABEL="Chronic condition indicator 16"
CHRON17 LENGTH=3
LABEL="Chronic condition indicator 17"
CHRON18 LENGTH=3
LABEL="Chronic condition indicator 18"
CHRON19 LENGTH=3
LABEL="Chronic condition indicator 19"
CHRON20 LENGTH=3
LABEL="Chronic condition indicator 20"
CHRON21 LENGTH=3
LABEL="Chronic condition indicator 21"
CHRON22 LENGTH=3
LABEL="Chronic condition indicator 22"
CHRON23 LENGTH=3
LABEL="Chronic condition indicator 23"
CHRON24 LENGTH=3
LABEL="Chronic condition indicator 24"
CHRON25 LENGTH=3
LABEL="Chronic condition indicator 25"
CHRONB1 LENGTH=3
LABEL="Chronic condition body system 1"
CHRONB2 LENGTH=3
LABEL="Chronic condition body system 2"
CHRONB3 LENGTH=3
LABEL="Chronic condition body system 3"
CHRONB4 LENGTH=3
LABEL="Chronic condition body system 4"
CHRONB5 LENGTH=3
LABEL="Chronic condition body system 5"
CHRONB6 LENGTH=3
LABEL="Chronic condition body system 6"
CHRONB7 LENGTH=3
LABEL="Chronic condition body system 7"
CHRONB8 LENGTH=3
LABEL="Chronic condition body system 8"
CHRONB9 LENGTH=3
LABEL="Chronic condition body system 9"
CHRONB10 LENGTH=3
LABEL="Chronic condition body system 10"
CHRONB11 LENGTH=3
LABEL="Chronic condition body system 11"
CHRONB12 LENGTH=3
LABEL="Chronic condition body system 12"
CHRONB13 LENGTH=3
LABEL="Chronic condition body system 13"
CHRONB14 LENGTH=3
LABEL="Chronic condition body system 14"
CHRONB15 LENGTH=3
LABEL="Chronic condition body system 15"
CHRONB16 LENGTH=3
LABEL="Chronic condition body system 16"
CHRONB17 LENGTH=3
LABEL="Chronic condition body system 17"
CHRONB18 LENGTH=3
LABEL="Chronic condition body system 18"
CHRONB19 LENGTH=3
LABEL="Chronic condition body system 19"
CHRONB20 LENGTH=3
LABEL="Chronic condition body system 20"
CHRONB21 LENGTH=3
LABEL="Chronic condition body system 21"
CHRONB22 LENGTH=3
LABEL="Chronic condition body system 22"
CHRONB23 LENGTH=3
LABEL="Chronic condition body system 23"
CHRONB24 LENGTH=3
LABEL="Chronic condition body system 24"
CHRONB25 LENGTH=3
LABEL="Chronic condition body system 25"
DXMCCS1 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 1"
DXMCCS2 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 2"
DXMCCS3 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 3"
DXMCCS4 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 4"
DXMCCS5 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 5"
DXMCCS6 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 6"
DXMCCS7 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 7"
DXMCCS8 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 8"
DXMCCS9 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 9"
DXMCCS10 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 10"
DXMCCS11 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 11"
DXMCCS12 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 12"
DXMCCS13 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 13"
DXMCCS14 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 14"
DXMCCS15 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 15"
DXMCCS16 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 16"
DXMCCS17 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 17"
DXMCCS18 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 18"
DXMCCS19 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 19"
DXMCCS20 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 20"
DXMCCS21 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 21"
DXMCCS22 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 22"
DXMCCS23 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 23"
DXMCCS24 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 24"
DXMCCS25 LENGTH=$11
LABEL="Multi-Level CCS: Diagnosis 25"
E_MCCS1 LENGTH=$11
LABEL="Multi-Level CCS: E Code 1"
E_MCCS2 LENGTH=$11
LABEL="Multi-Level CCS: E Code 2"
E_MCCS3 LENGTH=$11
LABEL="Multi-Level CCS: E Code 3"
E_MCCS4 LENGTH=$11
LABEL="Multi-Level CCS: E Code 4"
E_MCCS5 LENGTH=$11
LABEL="Multi-Level CCS: E Code 5"
E_MCCS6 LENGTH=$11
LABEL="Multi-Level CCS: E Code 6"
E_MCCS7 LENGTH=$11
LABEL="Multi-Level CCS: E Code 7"
E_MCCS8 LENGTH=$11
LABEL="Multi-Level CCS: E Code 8"
E_MCCS9 LENGTH=$11
LABEL="Multi-Level CCS: E Code 9"
E_MCCS10 LENGTH=$11
LABEL="Multi-Level CCS: E Code 10"
INJURY LENGTH=3
LABEL=
"Injury diagnosis reported on record (1:DX1 is an injury; 2:DX2+ is an injury; 0
:No injury)"
INJURY_CUT LENGTH=3
LABEL="Injury by cutting or piercing (by E codes)"
INJURY_DROWN LENGTH=3
LABEL="Injury by drowning or submersion (by E codes)"
INJURY_FALL LENGTH=3
LABEL="Injury by falling (by E codes)"
INJURY_FIRE LENGTH=3
LABEL="Injury by fire, flame or hot object (by E codes)"
INJURY_FIREARM LENGTH=3
LABEL="Injury by firearm (by E codes)"
INJURY_MACHINERY LENGTH=3
LABEL="Injury by machinery (by E codes)"
INJURY_MVT LENGTH=3
LABEL="Injury involving motor vehicle traffic (by E codes)"
INJURY_NATURE LENGTH=3
LABEL="Injury involving nature or environmental factors (by E codes)"
INJURY_POISON LENGTH=3
LABEL="Injury by poison (by E codes)"
INJURY_STRUCK LENGTH=3
LABEL="Injury from being struck by or against (by E codes)"
INJURY_SUFFOCATION LENGTH=3
LABEL="Injury by suffocation (by E codes)"
INTENT_ASSAULT LENGTH=3
LABEL="Injury by assault indicated on the record (by E codes)"
INTENT_SELF_HARM LENGTH=3
LABEL=
"Intentional self harm indicated on the record (by diagnosis and/or E codes)"
INTENT_UNINTENTIONAL LENGTH=3
LABEL="Unintentional injury indicated on the record (by E codes)"
KEY LENGTH=8 FORMAT=Z18.
LABEL="HCUP record identifier"
MULTINJURY LENGTH=3
LABEL="More than one injury diagnosis reported on record"
PCLASS1 LENGTH=3
LABEL="Procedure class 1"
PCLASS2 LENGTH=3
LABEL="Procedure class 2"
PCLASS3 LENGTH=3
LABEL="Procedure class 3"
PCLASS4 LENGTH=3
LABEL="Procedure class 4"
PCLASS5 LENGTH=3
LABEL="Procedure class 5"
PCLASS6 LENGTH=3
LABEL="Procedure class 6"
PCLASS7 LENGTH=3
LABEL="Procedure class 7"
PCLASS8 LENGTH=3
LABEL="Procedure class 8"
PCLASS9 LENGTH=3
LABEL="Procedure class 9"
PCLASS10 LENGTH=3
LABEL="Procedure class 10"
PCLASS11 LENGTH=3
LABEL="Procedure class 11"
PCLASS12 LENGTH=3
LABEL="Procedure class 12"
PCLASS13 LENGTH=3
LABEL="Procedure class 13"
PCLASS14 LENGTH=3
LABEL="Procedure class 14"
PCLASS15 LENGTH=3
LABEL="Procedure class 15"
PCLASS16 LENGTH=3
LABEL="Procedure class 16"
PCLASS17 LENGTH=3
LABEL="Procedure class 17"
PCLASS18 LENGTH=3
LABEL="Procedure class 18"
PCLASS19 LENGTH=3
LABEL="Procedure class 19"
PCLASS20 LENGTH=3
LABEL="Procedure class 20"
PRMCCS1 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 1"
PRMCCS2 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 2"
PRMCCS3 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 3"
PRMCCS4 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 4"
PRMCCS5 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 5"
PRMCCS6 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 6"
PRMCCS7 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 7"
PRMCCS8 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 8"
PRMCCS9 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 9"
PRMCCS10 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 10"
PRMCCS11 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 11"
PRMCCS12 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 12"
PRMCCS13 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 13"
PRMCCS14 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 14"
PRMCCS15 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 15"
PRMCCS16 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 16"
PRMCCS17 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 17"
PRMCCS18 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 18"
PRMCCS19 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 19"
PRMCCS20 LENGTH=$8
LABEL="Multi-Level CCS: Procedure 20"
U_BLOOD LENGTH=3
LABEL="Utilization Flag: Blood"
U_CATH LENGTH=3
LABEL="Utilization Flag: Cardiac Catheterization Lab"
U_CCU LENGTH=3
LABEL="Utilization Flag: Coronary Care Unit (CCU)"
U_CHESTXRAY LENGTH=3
LABEL="Utilization Flag: Chest X-Ray"
U_CTSCAN LENGTH=3
LABEL="Utilization Flag: Computed Tomography Scan"
U_DIALYSIS LENGTH=3
LABEL="Utilization Flag: Renal Dialysis"
U_ECHO LENGTH=3
LABEL="Utilization Flag: Echocardiology"
U_ED LENGTH=3
LABEL="Utilization Flag: Emergency Room"
U_EEG LENGTH=3
LABEL="Utilization Flag: Electroencephalogram"
U_EKG LENGTH=3
LABEL="Utilization Flag: Electrocardiogram"
U_EPO LENGTH=3
LABEL="Utilization Flag: EPO"
U_ICU LENGTH=3
LABEL="Utilization Flag: Intensive Care Unit (ICU)"
U_LITHOTRIPSY LENGTH=3
LABEL="Utilization Flag: Lithotripsy"
U_MHSA LENGTH=3
LABEL="Utilization Flag: Mental Health and Substance Abuse"
U_MRT LENGTH=3
LABEL="Utilization Flag: Medical Resonance Technology"
U_NEWBN2L LENGTH=3
LABEL="Utilization Flag: Nursery Level II"
U_NEWBN3L LENGTH=3
LABEL="Utilization Flag: Nursery Level III"
U_NEWBN4L LENGTH=3
LABEL="Utilization Flag: Nursery Level IV"
U_NUCMED LENGTH=3
LABEL="Utilization Flag: Nuclear Medicine"
U_OBSERVATION LENGTH=3
LABEL="Utilization Flag: Observation Room"
U_OCCTHERAPY LENGTH=3
LABEL="Utilization Flag: Occupational Therapy"
U_ORGANACQ LENGTH=3
LABEL="Utilization Flag: Organ Acquisition"
U_OTHIMPLANTS LENGTH=3
LABEL="Utilization Flag: Other Implants"
U_PACEMAKER LENGTH=3
LABEL="Utilization Flag: Pacemaker"
U_PHYTHERAPY LENGTH=3
LABEL="Utilization Flag: Physical Therapy"
U_RADTHERAPY LENGTH=3
LABEL=
"Utilization Flag: Radiology - Therapeutic and/or Chemotherapy Administration"
U_RESPTHERAPY LENGTH=3
LABEL="Utilization Flag: Respiratory Services"
U_SPEECHTHERAPY LENGTH=3
LABEL="Utilization Flag: Speech - Language Pathology"
U_STRESS LENGTH=3
LABEL="Utilization Flag: Cardiac Stress Test"
U_ULTRASOUND LENGTH=3
LABEL="Utilization Flag: Ultrasound"
;
*** Input the variables from the ASCII file ***;
INPUT
@1 CHRON1 N2PF.
@3 CHRON2 N2PF.
@5 CHRON3 N2PF.
@7 CHRON4 N2PF.
@9 CHRON5 N2PF.
@11 CHRON6 N2PF.
@13 CHRON7 N2PF.
@15 CHRON8 N2PF.
@17 CHRON9 N2PF.
@19 CHRON10 N2PF.
@21 CHRON11 N2PF.
@23 CHRON12 N2PF.
@25 CHRON13 N2PF.
@27 CHRON14 N2PF.
@29 CHRON15 N2PF.
@31 CHRON16 N2PF.
@33 CHRON17 N2PF.
@35 CHRON18 N2PF.
@37 CHRON19 N2PF.
@39 CHRON20 N2PF.
@41 CHRON21 N2PF.
@43 CHRON22 N2PF.
@45 CHRON23 N2PF.
@47 CHRON24 N2PF.
@49 CHRON25 N2PF.
@51 CHRONB1 N2PF.
@53 CHRONB2 N2PF.
@55 CHRONB3 N2PF.
@57 CHRONB4 N2PF.
@59 CHRONB5 N2PF.
@61 CHRONB6 N2PF.
@63 CHRONB7 N2PF.
@65 CHRONB8 N2PF.
@67 CHRONB9 N2PF.
@69 CHRONB10 N2PF.
@71 CHRONB11 N2PF.
@73 CHRONB12 N2PF.
@75 CHRONB13 N2PF.
@77 CHRONB14 N2PF.
@79 CHRONB15 N2PF.
@81 CHRONB16 N2PF.
@83 CHRONB17 N2PF.
@85 CHRONB18 N2PF.
@87 CHRONB19 N2PF.
@89 CHRONB20 N2PF.
@91 CHRONB21 N2PF.
@93 CHRONB22 N2PF.
@95 CHRONB23 N2PF.
@97 CHRONB24 N2PF.
@99 CHRONB25 N2PF.
@101 DXMCCS1 $CHAR11.
@112 DXMCCS2 $CHAR11.
@123 DXMCCS3 $CHAR11.
@134 DXMCCS4 $CHAR11.
@145 DXMCCS5 $CHAR11.
@156 DXMCCS6 $CHAR11.
@167 DXMCCS7 $CHAR11.
@178 DXMCCS8 $CHAR11.
@189 DXMCCS9 $CHAR11.
@200 DXMCCS10 $CHAR11.
@211 DXMCCS11 $CHAR11.
@222 DXMCCS12 $CHAR11.
@233 DXMCCS13 $CHAR11.
@244 DXMCCS14 $CHAR11.
@255 DXMCCS15 $CHAR11.
@266 DXMCCS16 $CHAR11.
@277 DXMCCS17 $CHAR11.
@288 DXMCCS18 $CHAR11.
@299 DXMCCS19 $CHAR11.
@310 DXMCCS20 $CHAR11.
@321 DXMCCS21 $CHAR11.
@332 DXMCCS22 $CHAR11.
@343 DXMCCS23 $CHAR11.
@354 DXMCCS24 $CHAR11.
@365 DXMCCS25 $CHAR11.
@376 E_MCCS1 $CHAR11.
@387 E_MCCS2 $CHAR11.
@398 E_MCCS3 $CHAR11.
@409 E_MCCS4 $CHAR11.
@420 E_MCCS5 $CHAR11.
@431 E_MCCS6 $CHAR11.
@442 E_MCCS7 $CHAR11.
@453 E_MCCS8 $CHAR11.
@464 E_MCCS9 $CHAR11.
@475 E_MCCS10 $CHAR11.
@486 INJURY N2PF.
@488 INJURY_CUT N2PF.
@490 INJURY_DROWN N2PF.
@492 INJURY_FALL N2PF.
@494 INJURY_FIRE N2PF.
@496 INJURY_FIREARM N2PF.
@498 INJURY_MACHINERY N2PF.
@500 INJURY_MVT N2PF.
@502 INJURY_NATURE N2PF.
@504 INJURY_POISON N2PF.
@506 INJURY_STRUCK N2PF.
@508 INJURY_SUFFOCATION N2PF.
@510 INTENT_ASSAULT N2PF.
@512 INTENT_SELF_HARM N2PF.
@514 INTENT_UNINTENTIONAL N2PF.
@516 KEY 18.
@534 MULTINJURY N2PF.
@536 PCLASS1 N2PF.
@538 PCLASS2 N2PF.
@540 PCLASS3 N2PF.
@542 PCLASS4 N2PF.
@544 PCLASS5 N2PF.
@546 PCLASS6 N2PF.
@548 PCLASS7 N2PF.
@550 PCLASS8 N2PF.
@552 PCLASS9 N2PF.
@554 PCLASS10 N2PF.
@556 PCLASS11 N2PF.
@558 PCLASS12 N2PF.
@560 PCLASS13 N2PF.
@562 PCLASS14 N2PF.
@564 PCLASS15 N2PF.
@566 PCLASS16 N2PF.
@568 PCLASS17 N2PF.
@570 PCLASS18 N2PF.
@572 PCLASS19 N2PF.
@574 PCLASS20 N2PF.
@576 PRMCCS1 $CHAR8.
@584 PRMCCS2 $CHAR8.
@592 PRMCCS3 $CHAR8.
@600 PRMCCS4 $CHAR8.
@608 PRMCCS5 $CHAR8.
@616 PRMCCS6 $CHAR8.
@624 PRMCCS7 $CHAR8.
@632 PRMCCS8 $CHAR8.
@640 PRMCCS9 $CHAR8.
@648 PRMCCS10 $CHAR8.
@656 PRMCCS11 $CHAR8.
@664 PRMCCS12 $CHAR8.
@672 PRMCCS13 $CHAR8.
@680 PRMCCS14 $CHAR8.
@688 PRMCCS15 $CHAR8.
@696 PRMCCS16 $CHAR8.
@704 PRMCCS17 $CHAR8.
@712 PRMCCS18 $CHAR8.
@720 PRMCCS19 $CHAR8.
@728 PRMCCS20 $CHAR8.
@736 U_BLOOD N2PF.
@738 U_CATH N2PF.
@740 U_CCU N2PF.
@742 U_CHESTXRAY N2PF.
@744 U_CTSCAN N2PF.
@746 U_DIALYSIS N2PF.
@748 U_ECHO N2PF.
@750 U_ED N2PF.
@752 U_EEG N2PF.
@754 U_EKG N2PF.
@756 U_EPO N2PF.
@758 U_ICU N2PF.
@760 U_LITHOTRIPSY N2PF.
@762 U_MHSA N2PF.
@764 U_MRT N2PF.
@766 U_NEWBN2L N2PF.
@768 U_NEWBN3L N2PF.
@770 U_NEWBN4L N2PF.
@772 U_NUCMED N2PF.
@774 U_OBSERVATION N2PF.
@776 U_OCCTHERAPY N2PF.
@778 U_ORGANACQ N2PF.
@780 U_OTHIMPLANTS N2PF.
@782 U_PACEMAKER N2PF.
@784 U_PHYTHERAPY N2PF.
@786 U_RADTHERAPY N2PF.
@788 U_RESPTHERAPY N2PF.
@790 U_SPEECHTHERAPY N2PF.
@792 U_STRESS N2PF.
@794 U_ULTRASOUND N2PF.
;
RUN;
|
import mynat.le
import solutions.world2_multiplication
import tactic.interactive
-- #check tactic.interactive.rintro
meta def less_leaky.interactive.rintro := tactic.interactive.rintro
namespace mynat
theorem le_refl (a : mynat) : a ≤ a :=
begin
use 0,
rw add_zero,
end
-- ignore this; it's making the "refl" tactic work with goals of the form a ≤ a
attribute [_refl_lemma] le_refl
theorem le_succ {a b : mynat} (h : a ≤ b) : a ≤ (succ b) :=
begin
cases h with c hc,
use (succ c),
rw add_succ,
rw hc,
end
example : one ≤ one := le_refl one
lemma zero_le (a : mynat) : 0 ≤ a :=
begin
use a,
rw' zero_add a,
refl
end
lemma le_zero {a : mynat} : a ≤ 0 → a = 0 :=
begin
intro h,
cases h with c hc,
rw add_comm at hc,
cases a with b,
refl,
exfalso,
rw add_succ at hc,
rw eq_comm at hc,
exact succ_ne_zero hc,
end
theorem le_trans ⦃a b c : mynat⦄ (hab : a ≤ b) (hbc : b ≤ c) : a ≤ c :=
begin
-- again no induction
cases hab with x hx,
cases hbc with y hy,
use (x + y),
rw ←add_assoc,
rw ←hx,
assumption,
end
instance : preorder mynat := by structure_helper
theorem lt_iff_le_not_le {a b : mynat} : a < b ↔ a ≤ b ∧ ¬ b ≤ a := iff.rfl
theorem le_antisymm : ∀ {{a b : mynat}}, a ≤ b → b ≤ a → a = b :=
begin
intros a b hab hba,
cases hab with c hc,
cases hba with d hd,
rw hc at hd,
rw add_assoc at hd,
rw eq_comm at hd,
have H := eq_zero_of_add_right_eq_self hd,
rw eq_comm at hc,
convert hc,
symmetry,
convert add_zero a,
exact add_right_eq_zero H,
end
instance : partial_order mynat := by structure_helper
theorem lt_iff_le_and_ne ⦃a b : mynat⦄ : a < b ↔ a ≤ b ∧ a ≠ b :=
begin
split,
{ intro h,
rw lt_iff_le_not_le at h,
cases h with hab hba,
split, exact hab,
intro h,
apply hba,
rw' h,
apply le_refl,
},
{ intro h,
cases h with hab hne,
rw lt_iff_le_not_le,
split, assumption,
intro hba,
apply hne,
apply le_antisymm hab hba,
}
end
lemma succ_le_succ {a b : mynat} (h : a ≤ b) : succ a ≤ succ b :=
begin
cases h with c hc,
use c,
rw succ_add,
rw hc,
end
theorem le_total (a b : mynat) : a ≤ b ∨ b ≤ a :=
begin
revert a,
induction' b with c hc,
intro a, right, apply zero_le,
intro a,
induction' a with d hd,
left, apply zero_le,
cases hc d with h h,
left, exact succ_le_succ h,
right, exact succ_le_succ h,
end
instance : linear_order mynat := by structure_helper
theorem add_le_add_right (a b : mynat) : a ≤ b → ∀ t, (a + t) ≤ (b + t) :=
begin
intros h t,
induction' t with d hd,
{
rw add_zero, rw add_zero,
assumption
},
{
rw add_succ,
rw add_succ,
exact succ_le_succ hd
}
end
theorem le_succ_self (a : mynat) : a ≤ succ a :=
begin
apply le_succ,
apply le_refl
end
theorem le_of_succ_le_succ {a b : mynat} : succ a ≤ succ b → a ≤ b :=
begin
intro h,
cases h with c hc,
use c,
rw succ_add at hc,
exact succ_inj hc,
end
theorem not_succ_le_self {{d : mynat}} (h : succ d ≤ d) : false :=
begin
cases h with c hc,
rw ←add_one_eq_succ at hc,
rw add_assoc at hc,
rw eq_comm at hc,
have h := eq_zero_of_add_right_eq_self hc,
rw add_comm at h,
rw add_one_eq_succ at h,
apply zero_ne_succ c,
symmetry,
assumption,
end
theorem add_le_add_left :
∀ (a b : mynat), a ≤ b → ∀ (c : mynat), c + a ≤ c + b :=
begin
intros a b hab c,
rw add_comm,
rw add_comm c,
apply add_le_add_right,
assumption
end
def succ_le_succ_iff (a b : mynat) : succ a ≤ succ b ↔ a ≤ b :=
begin
split,
{ intro h,
cases h with c hc,
use c,
apply succ_inj,
convert hc,
rw' succ_add,
refl
},
{ intro h,
cases h with c hc,
use c,
rw succ_add,
rw' hc,
refl,
}
end
def succ_lt_succ_iff (a b : mynat) : succ a < succ b ↔ a < b :=
begin
rw lt_iff_le_not_le,
rw lt_iff_le_not_le,
split,
intro h,
cases h,
split,
rwa succ_le_succ_iff at h_left,
intro h, apply h_right,
rwa succ_le_succ_iff,
intro h,
cases h,
split,
rwa succ_le_succ_iff,
intro h, apply h_right,
rwa succ_le_succ_iff at h,
end
theorem lt_of_add_lt_add_left : ∀ {{a b c : mynat}}, a + b < a + c → b < c :=
begin
intros a b c,
intro h,
rw add_comm at h,
rw add_comm a at h,
revert b c,
induction a with d hd,
intros a b h, exact h,
intros b c h,
rw [add_succ, add_succ] at h,
apply hd,
rwa succ_lt_succ_iff at h,
end
theorem zero_ne_one : (0 : mynat) ≠ 1 :=
begin
symmetry,
rw one_eq_succ_zero,
apply succ_ne_zero,
end
instance : ordered_comm_monoid mynat := by structure_helper
theorem le_of_add_le_add_left ⦃ a b c : mynat⦄ : a + b ≤ a + c → b ≤ c :=
begin
intro h,
cases h with d hd,
use d,
rw add_assoc at hd,
exact add_left_cancel hd
end
instance : ordered_cancel_comm_monoid mynat := by structure_helper
theorem mul_le_mul_of_nonneg_left ⦃a b c : mynat⦄ : a ≤ b → 0 ≤ c → c * a ≤ c * b :=
begin
intro hab,
intro hc,
cases hab with d hd,
rw hd,
use c * d,
rw' mul_add,
refl
end
theorem mul_le_mul_of_nonneg_right ⦃a b c : mynat⦄ : a ≤ b → 0 ≤ c → a * c ≤ b * c :=
begin
rw mul_comm,
rw mul_comm b,
apply mul_le_mul_of_nonneg_left
end
theorem ne_zero_of_pos ⦃a : mynat⦄ : 0 < a → a ≠ 0 :=
begin
intro ha,
intro h,
rw h at ha,
rw lt_iff_le_and_ne at ha,
cases ha with h1 h2,
apply h2,
refl,
end
theorem mul_lt_mul_of_pos_left ⦃a b c : mynat⦄ : a < b → 0 < c → c * a < c * b :=
begin
intros hab hc,
cases' hab with hab hba,
rw lt_iff_le_and_ne,
split,
{ cases hab with d hd,
use c * d,
rw hd,
rw' mul_add,
refl,
},
{ intro h,
apply hba,
have h2 := mul_left_cancel (ne_zero_of_pos hc) h,
rw' h2,
refl
}
end
theorem mul_lt_mul_of_pos_right ⦃a b c : mynat⦄ : a < b → 0 < c → a * c < b * c :=
begin
rw mul_comm,
rw mul_comm b,
apply mul_lt_mul_of_pos_left,
end
instance : ordered_semiring mynat := by structure_helper
theorem not_lt_zero ⦃a : mynat⦄ : ¬(a < 0) :=
begin [less_leaky]
-- rintro ⟨ha, hna⟩, -- *TODO* -- rintro doesn't work??
intro h,
cases h with ha hna,
apply hna, clear hna,
--apply le_zero at ha,
replace ha := le_zero ha,
rw ha,
refl,
end
/-
nat.lt_succ_iff : ∀ {m n : ℕ}, m < nat.succ n ↔ m ≤ n
-/
theorem lt_succ_self (n : mynat) : n < succ n :=
begin [less_leaky]
rw lt_iff_le_and_ne,
split,
use 1,
apply succ_eq_add_one,
intro h,
exact ne_succ_self n h
end
theorem lt_succ_iff (m n : mynat) : m < succ n ↔ m ≤ n :=
begin [less_leaky]
rw lt_iff_le_and_ne,
split,
{ rintro ⟨h1, h2⟩,
cases h1 with c hc,
cases c with d,
exfalso,
apply h2,
rw hc,
rw add_zero,refl,
use d,
apply succ_inj,
rw hc,
apply add_succ,
},
{ rintro ⟨c, hc⟩,
split,
{ use succ c,
rw hc,
rw add_succ,
refl
},
{ rw hc,
apply ne_of_lt,
rw lt_iff_le_and_ne,
split,
use succ c,
rw add_succ,
refl,
intro h,
rw [succ_eq_add_one, add_assoc] at h,
-- doesn't' work yet
-- symmetry at h,
rw eq_comm at h,
replace h := eq_zero_of_add_right_eq_self h,
apply zero_ne_succ c,
rw ←h,
apply add_one_eq_succ
}
}
end
-- is this right?
@[elab_as_eliminator]
theorem strong_induction (P : mynat → Prop)
(IH : ∀ m : mynat, (∀ d : mynat, d < m → P d) → P m) :
∀ n, P n :=
begin [less_leaky]
let Q : mynat → Prop := λ m, ∀ d < m, P d,
have hQ : ∀ n, Q n,
{ intro n,
induction n with d hd,
{ intros m hm,
exfalso,
exact not_lt_zero hm,
},
{ intro m,
intro hm,
rw lt_succ_iff at hm,
apply IH,
intros e he,
apply hd,
exact lt_of_lt_of_le he hm,
}
},
intro n,
apply hQ (succ n),
apply lt_succ_self
end
lemma lt_irrefl (a : mynat) : ¬ (a < a) :=
begin
intro h,
rw lt_iff_le_and_ne at h,
cases h with h1 h2,
apply h2,
refl,
end
end mynat
/-
instance : canonically_ordered_comm_semiring mynat :=
{ add := (+),
add_assoc := add_assoc,
zero := 0,
zero_add := zero_add,
add_zero := add_zero,
add_comm := add_comm,
le := (≤),
le_refl := le_refl,
le_trans := le_trans,
le_antisymm := le_antisymm,
add_le_add_left := add_le_add_left,
lt_of_add_lt_add_left := lt_of_add_lt_add_left,
bot := 0,
bot_le := zero_le,
le_iff_exists_add := le_iff_exists_add,
mul := (*),
mul_assoc := mul_assoc,
one := 1,
one_mul := one_mul,
mul_one := mul_one,
left_distrib := left_distrib,
right_distrib := right_distrib,
zero_mul := zero_mul,
mul_zero := mul_zero,
mul_comm := mul_comm,
zero_ne_one := zero_ne_one,
mul_eq_zero_iff := mul_eq_zero_iff }
-/
|
/*
* All GTAS code is Copyright 2016, The Department of Homeland Security (DHS), U.S. Customs and Border Protection (CBP).
*
* Please see LICENSE.txt for details.
*/
package gov.gtas.job.config;
import gov.gtas.config.CommonServicesConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
/**
* Concrete class that register a DispatcherServlet configured with
*
* @Configuration annotation
*
*/
public class JobSchedulerWebInitializer extends
AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class<?>[] { CommonServicesConfig.class,
JobSchedulerConfig.class };
}
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class<?>[] {};
}
@Override
protected String[] getServletMappings() {
return new String[] {};
}
}
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- 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 Vadim Godunko, IE 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 --
-- HOLDER 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. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A destroy object action is an action that destroys objects.
------------------------------------------------------------------------------
with AMF.UML.Actions;
limited with AMF.UML.Input_Pins;
package AMF.UML.Destroy_Object_Actions is
pragma Preelaborate;
type UML_Destroy_Object_Action is limited interface
and AMF.UML.Actions.UML_Action;
type UML_Destroy_Object_Action_Access is
access all UML_Destroy_Object_Action'Class;
for UML_Destroy_Object_Action_Access'Storage_Size use 0;
not overriding function Get_Is_Destroy_Links
(Self : not null access constant UML_Destroy_Object_Action)
return Boolean is abstract;
-- Getter of DestroyObjectAction::isDestroyLinks.
--
-- Specifies whether links in which the object participates are destroyed
-- along with the object.
not overriding procedure Set_Is_Destroy_Links
(Self : not null access UML_Destroy_Object_Action;
To : Boolean) is abstract;
-- Setter of DestroyObjectAction::isDestroyLinks.
--
-- Specifies whether links in which the object participates are destroyed
-- along with the object.
not overriding function Get_Is_Destroy_Owned_Objects
(Self : not null access constant UML_Destroy_Object_Action)
return Boolean is abstract;
-- Getter of DestroyObjectAction::isDestroyOwnedObjects.
--
-- Specifies whether objects owned by the object are destroyed along with
-- the object.
not overriding procedure Set_Is_Destroy_Owned_Objects
(Self : not null access UML_Destroy_Object_Action;
To : Boolean) is abstract;
-- Setter of DestroyObjectAction::isDestroyOwnedObjects.
--
-- Specifies whether objects owned by the object are destroyed along with
-- the object.
not overriding function Get_Target
(Self : not null access constant UML_Destroy_Object_Action)
return AMF.UML.Input_Pins.UML_Input_Pin_Access is abstract;
-- Getter of DestroyObjectAction::target.
--
-- The input pin providing the object to be destroyed.
not overriding procedure Set_Target
(Self : not null access UML_Destroy_Object_Action;
To : AMF.UML.Input_Pins.UML_Input_Pin_Access) is abstract;
-- Setter of DestroyObjectAction::target.
--
-- The input pin providing the object to be destroyed.
end AMF.UML.Destroy_Object_Actions;
|
/**************************************************************************************************************************************************/
/** S&P456 SCRIPT **/
/**************************************************************************************************************************************************/
/** Database import : S&P500 400 and 600 assets **/
proc import datafile="C:\Lucas_M1\M1_Eco_Stats\M1_S1\SAS_DP\Memoire\PTF_2008\S&P456.xlsx"
out=ptf456
dbms=xlsx
replace;
getname=yes;
run;
/**************************************************************************************************************************************************/
/** Data standardization: GARCH Studentized **/
%macro garch (table, resultsp, var=, condvar=);
proc autoreg data= ptf456;
model &var.= / garch=(q=1, p=1) dist = t;
output out = &resultsp. r=epsilon cev=&condvar. p=prevision alphacli=0.05
lcl = lower ucl = upper;
proc iml;
varNames = {&var. &condvar.};
use &resultsp.; read all var varNames into X; close &resultsp.;
do i=1 to nrow(X);
Z = Z // X[i,1];
A = X[:];
B = B // X[i,2];
end;
varNames = {"Date"};
use ptf456; read all var varNames into Date; close ptf456;
free norm;
norm = (Z-A)/ sqrt(B);
M = B || Z || norm || Date;
Create &table. var {Date norm};
append;
close &table.;
proc means data=&table.;
var norm;
run;
%mend garch;
%garch(tab1,resultsp1, var=ACIW, condvar=condvar1);
%garch(tab2,resultsp2, var=ADS, condvar=condvar2);
%garch(tab3,resultsp3, var=BOH, condvar=condvar3);
%garch(tab4,resultsp4, var=CBT, condvar=condvar4);
%garch(tab5,resultsp5, var=CLGX, condvar=condvar5);
%garch(tab6,resultsp6, var=CREE, condvar=condvar6);
%garch(tab7,resultsp7, var=FL, condvar=condvar7);
%garch(tab8,resultsp8, var=HOG, condvar=condvar8);
%garch(tab9,resultsp9, var=HXL, condvar=condvar9);
%garch(tab10,resultsp10, var=ICUI, condvar=condvar10);
%garch(tab11,resultsp11, var=KBH, condvar=condvar11);
%garch(tab12,resultsp12, var=OSK, condvar=condvar12);
%garch(tab13,resultsp13, var=PNM, condvar=condvar13);
%garch(tab14,resultsp14, var=RS, condvar=condvar14);
%garch(tab15,resultsp15, var=PZZA, condvar=condvar15);
%garch(tab16,resultsp16, var=AAPL, condvar=condvar16);
%garch(tab17,resultsp17, var=AMGN, condvar=condvar17);
%garch(tab18,resultsp18, var=BA, condvar=condvar18);
%garch(tab19,resultsp19, var=CAT, condvar=condvar19);
%garch(tab20,resultsp20, var=DIS, condvar=condvar20);
%garch(tab21,resultsp21, var=GS, condvar=condvar21);
%garch(tab22,resultsp22, var=HD, condvar=condvar22);
%garch(tab23,resultsp23, var=KO, condvar=condvar23);
%garch(tab24,resultsp24, var=MCD, condvar=condvar24);
%garch(tab25,resultsp25, var=MMM, condvar=condvar25);
%garch(tab26,resultsp26, var=MSFT, condvar=condvar26);
%garch(tab27,resultsp27, var=TRV, condvar=condvar27);
%garch(tab28,resultsp28, var=UNH, condvar=condvar28);
%garch(tab29,resultsp29, var=VZ, condvar=condvar29);
%garch(tab30,resultsp30, var=WMT, condvar=condvar30);
%garch(tab31,resultsp31, var=AFG, condvar=condvar31);
%garch(tab32,resultsp32, var=AMED, condvar=condvar32);
%garch(tab33,resultsp33, var=ANF, condvar=condvar33);
%garch(tab34,resultsp34, var=ASH, condvar=condvar34);
%garch(tab35,resultsp35, var=CRS, condvar=condvar35);
%garch(tab36,resultsp36, var=DIN, condvar=condvar36);
%garch(tab37,resultsp37, var=GHC, condvar=condvar37);
%garch(tab38,resultsp38, var=IDA, condvar=condvar38);
%garch(tab39,resultsp39, var=JLL, condvar=condvar39);
%garch(tab40,resultsp40, var=LAD, condvar=condvar40);
%garch(tab41,resultsp41, var=LDL, condvar=condvar41);
%garch(tab42,resultsp42, var=MGPI, condvar=condvar42);
%garch(tab43,resultsp43, var=PTC, condvar=condvar43);
%garch(tab44,resultsp44, var=UTHR, condvar=condvar44);
%garch(tab45,resultsp45, var=WDFC, condvar=condvar45);
/** Construction of the final portfolio with all data centered and reduced Studentized **/
data ptf_final456;
merge tab1 (rename=(NORM=ACIW)) tab2 (rename=(NORM=ADS)) tab3 (rename=(NORM=BOH)) tab4 (rename=(NORM=CBT)) tab5 (rename=(NORM=CLGX))
tab6 (rename=(NORM=CREE)) tab7 (rename=(NORM=FL)) tab8 (rename=(NORM=HOG)) tab9 (rename=(NORM=HXL)) tab10 (rename=(NORM=ICUI))
tab11 (rename=(NORM=KBH)) tab12 (rename=(NORM=OSK)) tab13 (rename=(NORM=PNM)) tab14 (rename=(NORM=RS)) tab15 (rename=(NORM=PZZA))
tab16 (rename=(NORM=AAPL)) tab17 (rename=(NORM=AMGN)) tab18 (rename=(NORM=BA)) tab19 (rename=(NORM=CAT)) tab20 (rename=(NORM=DIS))
tab21 (rename=(NORM=GS)) tab22 (rename=(NORM=HD)) tab23 (rename=(NORM=KO)) tab24 (rename=(NORM=MCD)) tab25 (rename=(NORM=MMM))
tab26 (rename=(NORM=MSFT)) tab27 (rename=(NORM=TRV)) tab28 (rename=(NORM=UNH)) tab29 (rename=(NORM=VZ)) tab30 (rename=(NORM=WMT))
tab31 (rename=(NORM=AFG)) tab32 (rename=(NORM=AMED)) tab33 (rename=(NORM=ANF)) tab34 (rename=(NORM=ASH)) tab35 (rename=(NORM=CRS))
tab36 (rename=(NORM=DIN)) tab37 (rename=(NORM=GHC)) tab38 (rename=(NORM=IDA)) tab39 (rename=(NORM=JLL)) tab40 (rename=(NORM=LAD))
tab41 (rename=(NORM=LDL)) tab42 (rename=(NORM=MGPI)) tab43 (rename=(NORM=PTC)) tab44 (rename=(NORM=UTHR)) tab45 (rename=(NORM=WDFC));
by Date;
run;
/**************************************************************************************************************************************************/
/** Printing Heatmaps **/
%Macro macro_heatmap(tab, start, end);
/* Number of trading days in a month */
%let date1=1;
%let date2=22;
%do n=&start. %to &end.; /* You can choose the rolling time window */
Data &tab.;
set ptf_final456(firstobs=&date1. obs=&date2.);
run;
proc iml;
/* Covariance */
varNames = {"ACIW" "ADS" "BOH" "CBT" "CLGX" "CREE" "FL" "HOG" "HXL" "ICUI" "KBH" "OSK" "PNM" "RS" "PZZA" "AAPL" "AMGN" "BA" "CAT" "DIS" "GS" "HD" "KO" "MCD" "MMM" "MSFT" "TRV" "UNH" "VZ" "WMT" "AFG" "AMED" "ANF" "ASH" "CRS" "DIN" "GHC" "IDA" "JLL" "LAD" "LDL" "MGPI" "PTC" "UTHR" "WDFC"};
use &tab.; read all var varNames into X; close &tab.;
call HeatmapCont(corr(X)) xvalues=varNames yvalues=varNames
colorramp="threeColor" range={-1.01 1.01}
title='Correlation Matrix ';
/* Recovering the lambda max */
lambda=(&date1.||&date2.||max(eigval(corr(X))));
print lambda;
%let date1=%eval(&date1+1);
%let date2=%eval(&date2+1);
%end;
run;
%mend macro_heatmap;
%macro_heatmap(tab, 1, 897);
/**************************************************************************************************************************************************/
/** Printing of the empirical distribution of eigenvalues **/
proc iml;
/* Correlations and rolling windows: taken from a normal law. In practice, if you are doing RMT, normalize each variable E[x]=0 et V[x]=1 */
varNames = {"ACIW" "ADS" "BOH" "CBT" "CLGX" "CREE" "FL" "HOG" "HXL" "ICUI" "KBH" "OSK" "PNM" "RS" "PZZA" "AAPL" "AMGN" "BA" "CAT" "DIS" "GS" "HD" "KO" "MCD" "MMM" "MSFT" "TRV" "UNH" "VZ" "WMT" "AFG" "AMED" "ANF" "ASH" "CRS" "DIN" "GHC" "IDA" "JLL" "LAD" "LDL" "MGPI" "PTC" "UTHR" "WDFC"};
use ptf_final456; read all var varNames into X; close ptf_final456;
free lambda;
wind=6*22;/* Rolling time window */
do t=1 to nrow(X)-wind ;
X1=X[t:t+wind,];/* Matrix partition selection */
C=corr(X1);
do i=1 to ncol(C);
corrcoef456 = corrcoef456 // C[,i];
end;
lambda=lambda//(t||t+wind||max(eigval(corr(X1))));
SP456 = SP456 // max(eigval(corr(X1)));
lam = lam // eigval(corr(X1));
end;
varNames = {"Date"};
use ptf456; read all var varNames into Date; close ptf456;
mattrib Lambda[colname={'Start','End','Lambda max'}];
call series(Lambda[,2],Lambda[,3]);
call histogram (lam);
call QNTL(q,lam,0.95);
print q;
call histogram(SP400);
call QNTL(q,SP400,0.95);
print q;
Create Coeffcorr456 var {corrcoef456};
append;
close;
Create SP_456 var {Date SP456};
append;
close SP_456;
/**************************************************************************************************************************************************/
/** Printing of empirical distributions of correlation coefficients **/
data correlation456; set Coeffcorr456;
if CORRCOEF456 = 1 then delete;
run;
proc iml;
varNames = {"CORRCOEF"};
use correlation; read all var varNames into correlation; close correlation;
call histogram(correlation) density={'kernel'}
scale="count";
/**************************************************************************************************************************************************/
/** Preparation of the tables to print the plots **/
data graph;
merge SP_456 VIX indiceSP500;
by Date;
run;
data graph2;
merge graph indiceSP500;
by Date2;
run;
/**************************************************************************************************************************************************/
|
class Pulumi < Formula
desc "Cloud native development platform"
homepage "https://pulumi.io/"
url "https://github.com/pulumi/pulumi.git",
:tag => "v0.17.17",
:revision => "54cbda80c19b499387b07ad7a8856817c3e19c29"
bottle do
cellar :any_skip_relocation
sha256 "1faff15a8615358cd31442dea64b681027e426b75ec1e6e6eb210f9cf486f786" => :mojave
sha256 "37be9bfab1c8474161827561e9b3ef29017b6c89953c8d20633b098ecd31b880" => :high_sierra
sha256 "86a62cff32a36106108d0050b2e518b8347f5483409511d414171b4e1bdfa938" => :sierra
sha256 "84a497b2fb6bcbf522c0912e465aae26e45c06184983f3661c386e8231be6eb7" => :x86_64_linux
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
ENV["GO111MODULE"] = "on"
dir = buildpath/"src/github.com/pulumi/pulumi"
dir.install buildpath.children
cd dir do
system "go", "mod", "vendor"
system "make", "dist"
bin.install Dir["#{buildpath}/bin/*"]
prefix.install_metafiles
# Install bash completion
output = Utils.popen_read("#{bin}/pulumi gen-completion bash")
(bash_completion/"pulumi").write output
# Install zsh completion
output = Utils.popen_read("#{bin}/pulumi gen-completion zsh")
(zsh_completion/"_pulumi").write output
end
end
test do
ENV["PULUMI_ACCESS_TOKEN"] = "local://"
ENV["PULUMI_TEMPLATE_PATH"] = testpath/"templates"
system "#{bin}/pulumi", "new", "aws-typescript", "--generate-only",
"--force", "-y"
assert_predicate testpath/"Pulumi.yaml", :exist?, "Project was not created"
end
end
|
object _3_Auth_IM_Client_Form: T_3_Auth_IM_Client_Form
Left = 0
Top = 0
BorderStyle = bsDialog
BorderWidth = 10
Caption = 'Auth IM Client - create by.qq600585'
ClientHeight = 434
ClientWidth = 918
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
TextHeight = 13
object Label1: TLabel
Left = 8
Top = 47
Width = 48
Height = 13
Caption = #25910#21040#28040#24687
end
object Label2: TLabel
Left = 255
Top = 47
Width = 72
Height = 13
Caption = #28155#21152#22909#21451#35831#27714
end
object Label3: TLabel
Left = 502
Top = 47
Width = 72
Height = 13
Caption = #22909#21451#22312#32447#36890#30693
end
object Label4: TLabel
Left = 749
Top = 47
Width = 72
Height = 13
Caption = #25105#30340#22909#21451#21015#34920
end
object LoginInfoLabel: TLabel
Left = 8
Top = 17
Width = 64
Height = 13
Caption = #30331#24405#20449#24687':...'
end
object Memo: TMemo
Left = 0
Top = 262
Width = 918
Height = 172
Align = alBottom
TabOrder = 0
WordWrap = False
end
object sendMsgButton: TButton
Left = 255
Top = 8
Width = 89
Height = 33
Caption = #21457#36865#28040#24687
TabOrder = 1
OnClick = sendMsgButtonClick
end
object msgMemo: TMemo
Left = 8
Top = 63
Width = 241
Height = 185
ScrollBars = ssBoth
TabOrder = 2
WordWrap = False
end
object RequestFriendMemo: TMemo
Left = 255
Top = 63
Width = 241
Height = 185
ScrollBars = ssBoth
TabOrder = 3
WordWrap = False
end
object OnlineMemo: TMemo
Left = 502
Top = 63
Width = 241
Height = 185
ScrollBars = ssBoth
TabOrder = 4
WordWrap = False
end
object FriendListMemo: TMemo
Left = 749
Top = 63
Width = 155
Height = 185
ScrollBars = ssBoth
TabOrder = 5
WordWrap = False
end
object RequestFriendButton: TButton
Left = 350
Top = 8
Width = 81
Height = 33
Caption = #28155#21152#22909#21451
TabOrder = 6
OnClick = RequestFriendButtonClick
end
object ReponseAddFriendButton: TButton
Left = 437
Top = 8
Width = 91
Height = 33
Caption = #21709#24212#22909#21451#35831#27714
TabOrder = 7
OnClick = ReponseAddFriendButtonClick
end
object refreshFriendButton: TButton
Left = 749
Top = 8
Width = 155
Height = 33
Caption = #21047#26032#25105#30340#22909#21451#21015#34920
TabOrder = 8
OnClick = refreshFriendButtonClick
end
object removeFriendButton: TButton
Left = 534
Top = 8
Width = 74
Height = 33
Caption = #31227#38500#22909#21451
TabOrder = 9
OnClick = removeFriendButtonClick
end
object NetTimer: TTimer
Interval = 10
OnTimer = NetTimerTimer
Left = 144
Top = 280
end
end
|
---
title: Gatsby Starter CV
github: https://github.com/santosfrancisco/gatsby-starter-cv
demo: https://santosfrancisco.github.io/gatsby-starter-cv/
author: Francisco Santos
ssg:
- Gatsby
cms:
- No Cms
date: 2018-12-24T00:05:49.000Z
description: >-
A simple starter to get up and developing your digital curriculum with
GatsbyJS
stale: false
---
|
precision mediump float;
uniform vec4 u_color;
void main() {
gl_FragColor = u_color;
} |
/*** ゲーム状態 ***/
GAMESTART = 2
GAMEPLAY = 4
GAMEPAUSE = 8
GAMEOVER = 16
GAMESTATE = GAMESTART // 現在状態
/*** イベント管理クラス ***/
sdl.EventManager = ${}
setmetatable(sdl.EventManager, ${
__call = def(){
local @ = ${m_events = ${}}
setmetatable(@, ${__index = sdl.EventManager})
return @
}
})
/* イベント発生条件を満たした時一度だけ実行する関数をセット */
// condition: イベント実行条件
// 数値なら condition & GAMESTATE == GAMESTATE のとき(conditionのビットフラグが立っている時)実行
// 文字列ならそれを条件式とする
def sdl.EventManager->append(condition, func){
if !@.m_events[condition]{
@.m_events[condition] = ${running = false}
if type(condition) == "string"{
@.m_events[condition].condition = assert(loadstring("return "..condition))
}else{
@.m_events[condition].condition = def(){
return b_and(condition, GAMESTATE) == GAMESTATE
}
}
}
@.m_events[condition].event = func
return @
}
/* イベント発生条件を満たしている限り実行し続ける関数をセット */
def sdl.EventManager->appendLoop(condition, func){
if !@.m_events[condition]{
@.m_events[condition] = ${running = false}
if type(condition) == "string"{
@.m_events[condition].condition = assert(loadstring("return "..condition))
}else{
@.m_events[condition].condition = def(){
return b_and(condition, GAMESTATE) == GAMESTATE
}
}
}
@.m_events[condition].loopEvent = func
return @
}
/* イベントを指定ルーチンにセット */
def sdl.EventManager->set(id, routine){
if !routine{routine = sdl.App.routine}
routine->append(id, def(){
while true{
for cond, evt in pairs(@.m_events){
if evt.condition(){
if !evt.running{ // イベント発生
evt.running = true
if evt.event{evt.event()}
}else{ // イベント発生中
if evt.loopEvent{evt.loopEvent()}
}
}else{
evt.running = false
}
}
routine->update()
}
})
}
|
event handling
click: event
"check for right click (menu)"
(self isYellowButtonReallyPressed: event)
ifTrue: [ self showMenuForPosition: event cursorPoint ] |
set CommandName "snap"
source RBC.stripchart.$CommandName.M.tcl
source ../StripchartRunAllSupportMethods.tcl
ExecuteCommandSequenceNoCommand $CommandName |
===============================
All "password" input elements require a valid "tabindex" attribute
===============================
*Severity code:* Severe error
.. php:class:: inputPasswordHasTabIndex
All <code>input elements of type "password" should have a "tabindex" attribute to help navigate the form with a keyboard alone.
|
//! Specifies logic to create a "pragmatic" solution and write it into json format.
mod model;
pub use self::model::*;
pub(crate) mod activity_matcher;
mod geo_serializer;
pub use self::geo_serializer::serialize_solution_as_geojson;
mod initial_reader;
pub use self::initial_reader::read_init_solution;
mod extensions;
mod writer;
pub use self::writer::create_solution;
pub use self::writer::PragmaticSolution;
|
"
Synchronize repos
"
Class {
#name : #GoferSynchronize,
#superclass : #GoferOperation,
#instVars : [
'cacheReferences'
],
#category : #'Gofer-Core-Operations'
}
{ #category : #testing }
GoferSynchronize class >> isAbstract [
^ self == GoferSynchronize
]
{ #category : #accessing }
GoferSynchronize >> cacheRepository [
^ MCCacheRepository uniqueInstance
]
{ #category : #initialization }
GoferSynchronize >> initializeOn: aGofer [
super initializeOn: aGofer disablePackageCache.
MCFileBasedRepository flushAllCaches.
cacheReferences := self gofer allResolvedIn: self cacheRepository
]
|
Getting Started
===============
Installation
------------
You can install ``pybnb`` with ``pip``:
.. code-block:: console
$ pip install pybnb
``pybnb`` requires ``mpi4py`` to solve problems in
parallel. However, it will also solve problems in serial if
this module is not available. Thus, ``mpi4py`` is not listed
as a package requirement, and it may need to be installed in
a separate step.
Complete Example
----------------
The code below shows a complete example script that (1) defines
a problem, (2) creates a solver, and (3) solves the problem.
.. literalinclude:: ../../examples/scripts/simple.py
:language: python
:prepend: # simple.py
:lines: 16-
To solve the problem in serial, the example script should be
launched with the python interpretor:
.. code-block:: console
$ python simple.py
To solve the problem in parallel, the example script should
be launched using the same command as above, only wrapped
with ``mpiexec`` (specifying the number processes):
.. code-block:: console
$ mpiexec -n 4 python simple.py
Note that the parallel solve implementation used by
``pybnb`` always designates exactly one process as a
dispatcher. If more than one process is involved in a
solve, the dispatcher will only manage the global work
queue, leaving the processing of all branch-and-bound nodes
to the remaining processes. Thus, one should not expect any
parallel speedup until at least three processes are used to
solve a problem.
More Examples
-------------
``pybnb`` is distributed with a number of example problem
implementations. Each example can be run in serial or in
parallel with the ``mpiexec`` command. Some examples require
additional python packages or external binaries that are not
listed as dependencies for ``pybnb`` (e.g., ``pyomo``). See
the comments at the top of each example file for a brief
explanation.
The `examples
<https://github.com/ghackebeil/pybnb/blob/master/examples>`_
directory included with the source repository is organized
into two top-level directories.
- `command_line_problems
<https://github.com/ghackebeil/pybnb/blob/master/examples/command_line_problems>`_:
Includes basic problem implementations that expose all ``pybnb``
solver options as command-line arguments. Simply execute
one of the available examples with ``--help`` as an
argument to see the list of available solver options.
- `binary_knapsack.py <https://github.com/ghackebeil/pybnb/blob/master/examples/command_line_problems/binary_knapsack.py>`_
- `lipschitz_1d.py <https://github.com/ghackebeil/pybnb/blob/master/examples/command_line_problems/lipschitz_1d.py>`_ (faster with ``numba``, but it is optional)
- `bin_packing.py <https://github.com/ghackebeil/pybnb/blob/master/examples/command_line_problems/bin_packing.py>`_ (requires: ``pyomo`` + ``ipopt`` binary)
- `rosenbrock_2d.py <https://github.com/ghackebeil/pybnb/blob/master/examples/command_line_problems/rosenbrock_2d.py>`_ (requires: ``pyomo`` + ``ipopt`` binary)
- `scripts
<https://github.com/ghackebeil/pybnb/blob/master/examples/scripts>`_:
Includes problem implementations along with various
usages of ``pybnb`` ranging from simple to advanced. Some
of the examples accept a small set of command-line
options, but most ``pybnb`` solver options are hard-coded
and must be manually adjusted within each example file.
- `simple.py <https://github.com/ghackebeil/pybnb/blob/master/examples/scripts/simple.py>`_
- `range_reduction_pyomo.py <https://github.com/ghackebeil/pybnb/blob/master/examples/scripts/range_reduction_pyomo.py>`_ (requires: ``pyomo`` + ``ipopt`` binary)
- `tsp/tsp_byvertex.py <https://github.com/ghackebeil/pybnb/blob/master/examples/scripts/tsp/tsp_byvertex.py>`_
- `tsp/tsp_byedge.py <https://github.com/ghackebeil/pybnb/blob/master/examples/scripts/tsp/tsp_byedge.py>`_ (requires: ``numpy``)
Defining a Problem
------------------
To define a branch-and-bound problem with ``pybnb``, one
must define a class that implements the :class:`Problem
<pybnb.problem.Problem>` interface, which includes defining
at least the six required methods shown below.
.. code-block:: python
import pybnb
class MyProblem(pybnb.Problem):
def __init__(self): ...
# required methods
def sense(self): ...
def objective(self): ...
def bound(self): ...
def save_state(self, node): ...
def load_state(self, node): ...
def branch(self): ...
# optional methods
def notify_solve_begins(self,
comm,
worker_comm,
convergence_checker):
...
def notify_new_best_node(self,
node,
current):
...
def notify_solve_finished(self,
comm,
worker_comm,
results):
...
.. note::
The :class:`Problem <pybnb.problem.Problem>` base
class is a purely abstract interface that adds no
additional data to a problem implementation. It is not
required to call ``Problem.__init__`` when defining the
``__init__`` method on a derived class.
The remainder of this section includes a detailed
description of each of the required methods.
- :func:`Problem.sense() <pybnb.problem.Problem.sense>`
This is the easiest method to define for a
branch-and-bound problem. It should return the objective
sense of the problem, which should always be one of
:obj:`minimize <pybnb.common.minimize>` or
:obj:`maximize <pybnb.common.maximize>`, and should
not change what it returns over the lifetime of a
problem. For instance, to define a problem with an
objective value that should be minimized, the
implementation would look something like:
.. code-block:: python
class MyProblem(pybnb.Problem):
def sense(self):
return pybnb.minimize
The :class:`Problem <pybnb.problem.Problem>` base
class defines two additional convenience methods
:func:`Problem.infeasible_objective()
<pybnb.problem.Problem.infeasible_objective>` and
:func:`Problem.unbounded_objective()
<pybnb.problem.Problem.unbounded_objective>` that return
`+inf` or `-inf`, depending on the return value of
:func:`Problem.sense() <pybnb.problem.Problem.sense>`.
- :func:`Problem.bound() <pybnb.problem.Problem.bound>`
This method should return a valid bound for the objective
function over the current problem domain (as defined by
the current problem state), or it can return
:func:`self.unbounded_objective()
<pybnb.problem.Problem.unbounded_objective>` if a finite
bound can not be determined.
- :func:`Problem.objective() <pybnb.problem.Problem.objective>`
This method should return a value for the objective
function that is feasible for the current problem domain
(as defined by the current problem state), or it can
return :func:`self.infeasible_objective()
<pybnb.problem.Problem.infeasible_objective>` if a
feasible objective value can not be determined.
- :func:`Problem.save_state(node) <pybnb.problem.Problem.save_state>`
This method should save any relevant state information
about the problem onto the :attr:`state
<pybnb.node.Node.state>` attribute of node argument. If
one wishes to utilize the MPI-based parallel solver, the
only requirement for what goes into the node state is
that it can be serialized using the ``pickle`` or
``dill`` modules. By default, ``pybnb`` is configured to
use the ``pickle`` module for node serialization. See the
section titled :ref:`configuration` for details on how to
adjust this and related settings.
- :func:`Problem.load_state(node) <pybnb.problem.Problem.load_state>`
This method should load the problem state stored on the
:attr:`state <pybnb.node.Node.state>` attribute of the
node argument. The code block below shows an example pair
of :func:`save_state <pybnb.problem.Problem.save_state>`
and :func:`load_state <pybnb.problem.Problem.load_state>`
implementations.
.. code-block:: python
class MyProblem(pybnb.Problem):
def __init__(self):
self._L = 0.0
self._U = 1.0
def save_state(self, node):
node.state = (self._L, self._U)
def load_state(self, node):
(self._L, self._U) = node.state
- :func:`Problem.branch() <pybnb.problem.Problem.branch>`
This method should partition the problem domain defined
by the current user state into zero or more child states
and return them on new nodes. A child node can be created
by directly instantiating a :class:`pybnb.Node
<pybnb.node.Node>` object. Note that for the branching
process to make sense, the bound computed from the child
states should improve (or not be worse than) the bound
for their parent node. Once the child bound is computed,
the solver will issue a warning if it is found to be
worse than the bound from its parent node, as this is
indicative of a programming error or other numerical
issues.
Note that any child nodes returned from
:func:`Problem.branch() <pybnb.problem.Problem.branch>`
will automatically be assigned the bound and objective
from their parent for potential use in determining their
prioritization in the global work queue. Users can
override this by manually assigning a value to one or
both of these node attributes before yielding them from
the branch method.
Additionally, further control over the prioritization of
a child node can be achieved by setting the
`queue_strategy` solve option to "custom", and then
directly assigning a value to the :attr:`queue_priority
<pybnb.node.Node.queue_priority>` attribute of the child
node before it is yielded.
Solving a Problem
-----------------
There are two approaches to solving a branch-and-bound
problem with ``pybnb``. The first is to simply call the
:func:`solve <pybnb.solver.solve>` convenience
function. This will create a :class:`Solver
<pybnb.solver.Solver>` object, call the :func:`Solver.solve
<pybnb.solver.Solver.solve>` method, and report the results
as well as additional timing information about the solve.
.. code-block:: python
import pybnb
problem = MyProblem()
results = pybnb.solve(problem,
relative_gap=1e-4)
The second approach is to manually create a :class:`Solver
<pybnb.solver.Solver>` object and call the
:func:`Solver.solve <pybnb.solver.Solver.solve>` method
directly.
Both approaches can solve a problem in serial or
parallel. The difference is that the :func:`solve
<pybnb.solver.solve>` convenience function provides a few
additional options that simplify the process of saving
solver output and results to a file. Additionally,
collecting the timing information reported by this function
adds some additional communication overhead to the end of
the solve; thus, the second approach of directly using a
:class:`Solver <pybnb.solver.Solver>` can be more efficient.
Creating a Solver
^^^^^^^^^^^^^^^^^
The following example shows how to create a solver object.
.. code-block:: python
import pybnb
solver = pybnb.Solver()
By default, the solver will automatically use
``mpi4py.MPI.COMM_WORLD`` as the communicator, and the rank
0 process will act as the dispatcher. If the ``mpi4py``
module is not available, this will result in an
``ImportError``. The optional keywords `comm` and
`dispatcher_rank` can be used to change the default
behavior.
When a solver is created with ``Solver(comm=None)``, this
will disable any attempted import of ``mpi4py``, allowing
problems to be solved without the use of any parallel
functionality. The `comm` keyword can also be assigned a
communicator different from ``mpi4py.MPI.COMM_WORLD``. If
the solver communicator includes more than one process, the
`dispatcher_rank` keyword can be assigned a process rank
to control which process is designated as the dispatcher.
However the solver is initialized, the following assertions
hold true for the :attr:`is_dispatcher
<pybnb.solver.Solver.is_dispatcher>` and :attr:`is_worker
<pybnb.solver.Solver.is_worker>` attributes of the solver
object.
.. code-block:: python
if (solver.comm is None) or \
(solver.comm.size == 1):
assert solver.is_dispatcher and \
solver.is_worker
else:
if solver.comm.rank == <dispatcher_rank>:
assert solver.is_dispatcher and \
(not solver.is_worker)
else:
assert (not solver.is_dispatcher) and \
solver.is_worker
How the Solver Calls the Problem Methods
----------------------------------------
The following block of pseudocode provides a high-level
overview of how the solver calls the methods on a
user-defined problem. Highlighted lines show where problem
methods are called.
.. code-block:: python
:emphasize-lines: 5,6,8,16,17,18,19,21,23,24,26,31,32
:linenos:
def solve(problem, ...):
#
# solve initialization
#
sense = problem.sense()
problem.notify_solve_begins(...)
root = Node()
problem.save_state(root)
#
# solve loop
#
while <solve_not_terminated>:
node, best_node = dispatcher.update(...)
if <conditional_1>:
problem.notify_new_best_node(node=best_node,
current=False)
problem.load_state(node)
bound = problem.bound()
if <conditional_2>:
objective = problem.objective()
if <conditional_3>:
problem.notify_new_best_node(node=node,
current=True)
if <conditional_4>:
children = problem.branch()
#
# solve finalization
#
problem.load_state(root)
problem.notify_solve_finished(...)
Note that during the main solve loop (starting on line 13),
it is safe to assume that the six highlighted problem
methods between line 13 and line 25 will be called in the
relative order shown. The conditions under which these
methods will be called are briefly discussed below:
- **<conditional_1>** (line 15): This condition is met when
the `best_node` received from the dispatcher is not
unbounded and improves upon the best node currently known
to the worker process (i.e., has a better objective). By
default, the check for objective improvement is exact,
but it can be relaxed by assigning a nonzero value to the
`comparison_tolerance` keyword of the :func:`Solver.solve
<pybnb.solver.Solver.solve>` method.
- **<conditional_2>** (line 20): This condition is met when
the bound computed by the problem for the current node
makes it eligible for the queue relative to the best
objective known to the process. By default, this is true
when the bound is better than the best objective by any
nonzero amount, but this behavior can be influenced using
the `queue_tolerance` keyword of the :func:`Solver.solve
<pybnb.solver.Solver.solve>` method.
- **<conditional_3>** (line 22): This condition is met when
the objective computed by the problem for the current
node is not unbounded and improves upon the objective of
the best node currently known to the process. By default,
the check for improvement is exact, but it can be relaxed
by assigning a nonzero value to the
`comparison_tolerance` keyword of the :func:`Solver.solve
<pybnb.solver.Solver.solve>` method.
- **<conditional_4>** (line 25): This condition is met when
the objective computed by the problem for the current
node is not unbounded, when **<conditional_2>** is still
satisfied (based on a potentially new best objective),
and when the difference between the node's updated bound
and objective satisfies the branching tolerance. By
default, the branching tolerance is zero, meaning that
any nonzero distance between these two values will
satisfy this check, but this can be adjusted using the
`branching_tolerance` keyword of the :func:`Solver.solve
<pybnb.solver.Solver.solve>` method.
|
defmodule Adventofcode.Circle do
@moduledoc """
Circle is a circular data structure.
It's implemented using a map where every value is a three-element tuple
containing the id of the previous item, the value of the current item and then
the id of the next item.
There are also meta-keys like size, current and counter that are kept up to
date automatically as long as the built in API functions are used.
"""
def new(values \\ []) do
values
|> Enum.reduce(%{size: 0, current: 0, counter: 0}, &insert_next(&2, &1))
|> move_next
end
def to_list(state) do
[]
|> do_to_list(state, state.current, state.current)
|> Enum.reverse()
end
defp do_to_list(list, _state, current, current) when length(list) > 0 do
list
end
defp do_to_list(list, state, current, last) do
{_, value, next} = state[current]
do_to_list([value | list], state, next, last)
end
def all(state) do
state
|> Map.delete(:size)
|> Map.delete(:current)
|> Map.delete(:counter)
|> Enum.map(fn {id, {_, val, _}} -> {id, val} end)
end
def size(state) do
state.size
end
def current(%{size: 0}), do: nil
def current(state) do
elem(state[state.current], 1)
end
def at(state, id) do
{_, val, _} = state[id]
val
end
def move_next(state) do
{_, _, next} = state[state.current]
Map.put(state, :current, next)
end
def move_prev(state) do
{prev, _, _} = state[state.current]
Map.put(state, :current, prev)
end
def insert_after(state, values), do: insert_after(state, values, state.current)
def insert_after(state, values, after_id) when is_list(values) do
values
|> Enum.reduce({state, after_id}, fn value, {acc, prev} ->
id = acc.counter + 1
{_, _, next} = acc[prev]
{do_insert(acc, id, {prev, value, next}), id}
end)
|> elem(0)
end
def insert_next(state, values) when is_list(values) do
values
|> Enum.reduce(state, &insert_next(&2, &1))
end
def insert_next(%{size: 0} = state, value) do
id = state.counter + 1
state
|> do_insert(id, {id, value, id})
|> Map.put(:current, id)
end
def insert_next(state, value) do
id = state.counter + 1
prev = state.current
{_, _, next} = state[state.current]
state
|> do_insert(id, {prev, value, next})
|> Map.put(:current, id)
end
defp do_insert(state, id, {prev, _value, next} = item) do
state
|> Map.put(id, item)
|> Map.update(prev, item, &put_elem(&1, 2, id))
|> Map.update(next, item, &put_elem(&1, 0, id))
|> Map.update(:size, 0, &(&1 + 1))
|> Map.update(:counter, 0, &(&1 + 1))
end
def remove_current(%{size: 0} = state), do: state
def remove_current(state) do
{prev, _, next} = state[state.current]
state
|> Map.update(prev, nil, &put_elem(&1, 2, next))
|> Map.update(next, nil, &put_elem(&1, 0, prev))
|> Map.put(:current, next)
|> Map.update(:size, 0, &(&1 - 1))
|> Map.delete(state.current)
end
def take_after(state, amount) when is_integer(amount) and amount >= 1 do
{result, state} = Enum.reduce(1..amount, {[], move_next(state)}, &do_take/2)
{result, move_prev(state)}
end
defp do_take(_, {result, state}) do
{result ++ [current(state)], remove_current(state)}
end
end
|
-----------------------------------------------------------------------
-- awa -- Ada Web Application
-- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
-- == Introduction ==
--
-- @include awa.xml
package AWA is
pragma Pure;
-- Library SVN identification
SVN_URL : constant String := "$HeadURL: file:///opt/repository/svn/ada/awa/trunk/src/awa.ads $";
-- Revision used (must run 'make version' to update)
SVN_REV : constant String := "$Rev: 318 $";
end AWA;
|
#!/bin/bash
module restore PrgEnv-cray
module load hdf5
module load gcc/8.1.0
module load rocm
module list
export LD_LIBRARY_PATH="$CRAY_LD_LIBRARY_PATH:$LD_LIBRARY_PATH"
export CXX=CC
export DFLAGS='-DPARIS_NO_GPU_MPI'
export HIPCONFIG=$(hipconfig -C)
export MPI_HOME=$(dirname $(dirname $(which mpicc)))
export OMP_NUM_THREADS=16
export POISSON_SOLVER="-DPARIS"
export SUFFIX='.paris-amd'
export TYPE=gravity
make clean
make -j
|
object FrmCRUD: TFrmCRUD
Left = 0
Top = 0
Caption = 'Cadastro de'
ClientHeight = 379
ClientWidth = 635
Color = clSilver
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
FormStyle = fsMDIChild
OldCreateOrder = False
Position = poScreenCenter
Visible = True
WindowState = wsMaximized
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object pnlCabecalho: TPanel
Left = 0
Top = 0
Width = 635
Height = 28
Align = alTop
Color = clGray
Font.Charset = ANSI_CHARSET
Font.Color = clWhite
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0
object lbCabecalho: TLabel
Left = 8
Top = 5
Width = 119
Height = 19
Caption = 'CADASTRO DE'
Font.Charset = ANSI_CHARSET
Font.Color = clWhite
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
end
end
object gbLocalizar: TGroupBox
Left = 0
Top = 28
Width = 635
Height = 58
Align = alTop
Caption = ' Localizar '
Ctl3D = False
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentCtl3D = False
ParentFont = False
TabOrder = 1
object lbCodigo: TLabel
Left = 65
Top = 24
Width = 33
Height = 13
Caption = 'C'#243'digo'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
end
object btnLocalizar: TButton
Left = 227
Top = 21
Width = 30
Height = 19
Cursor = crHandPoint
Caption = '...'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0
TabStop = False
OnClick = btnLocalizarClick
end
object edCodigo: TEdit
Left = 104
Top = 21
Width = 121
Height = 19
Color = clBtnFace
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
NumbersOnly = True
ParentFont = False
TabOrder = 1
OnExit = edCodigoExit
OnKeyDown = edCodigoKeyDown
end
end
object pnlBotoes: TPanel
Left = 0
Top = 338
Width = 635
Height = 41
Align = alBottom
Color = clSilver
Font.Charset = ANSI_CHARSET
Font.Color = clWhite
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 2
DesignSize = (
635
41)
object btnLimpar: TBitBtn
Left = 400
Top = 4
Width = 115
Height = 35
Cursor = crHandPoint
Anchors = [akRight, akBottom]
Caption = '&Limpar'
DoubleBuffered = True
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
04000000000000010000120B0000120B00001000000000000000000000000000
800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00500005000555
555557777F777555F55500000000555055557777777755F75555005500055055
555577F5777F57555555005550055555555577FF577F5FF55555500550050055
5555577FF77577FF555555005050110555555577F757777FF555555505099910
555555FF75777777FF555005550999910555577F5F77777775F5500505509990
3055577F75F77777575F55005055090B030555775755777575755555555550B0
B03055555F555757575755550555550B0B335555755555757555555555555550
BBB35555F55555575F555550555555550BBB55575555555575F5555555555555
50BB555555555555575F555555555555550B5555555555555575}
NumGlyphs = 2
ParentDoubleBuffered = False
ParentFont = False
TabOrder = 3
OnClick = btnLimparClick
end
object btnExcluir: TBitBtn
Left = 283
Top = 4
Width = 115
Height = 35
Cursor = crHandPoint
Anchors = [akRight, akBottom]
Caption = '&Excluir'
DoubleBuffered = True
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
04000000000000010000120B0000120B00001000000000000000000000000000
800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333000000000
3333333777777777F3333330F777777033333337F3F3F3F7F3333330F0808070
33333337F7F7F7F7F3333330F080707033333337F7F7F7F7F3333330F0808070
33333337F7F7F7F7F3333330F080707033333337F7F7F7F7F3333330F0808070
333333F7F7F7F7F7F3F33030F080707030333737F7F7F7F7F7333300F0808070
03333377F7F7F7F773333330F080707033333337F7F7F7F7F333333070707070
33333337F7F7F7F7FF3333000000000003333377777777777F33330F88877777
0333337FFFFFFFFF7F3333000000000003333377777777777333333330777033
3333333337FFF7F3333333333000003333333333377777333333}
NumGlyphs = 2
ParentDoubleBuffered = False
ParentFont = False
TabOrder = 2
OnClick = btnExcluirClick
end
object btnGravar: TBitBtn
Left = 166
Top = 4
Width = 115
Height = 35
Cursor = crHandPoint
Anchors = [akRight, akBottom]
Caption = '&Gravar'
DoubleBuffered = True
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
04000000000000010000120B0000120B00001000000000000000000000000000
800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
333333FFFFFFFFFFFFF33000077777770033377777777777773F000007888888
00037F3337F3FF37F37F00000780088800037F3337F77F37F37F000007800888
00037F3337F77FF7F37F00000788888800037F3337777777337F000000000000
00037F3FFFFFFFFFFF7F00000000000000037F77777777777F7F000FFFFFFFFF
00037F7F333333337F7F000FFFFFFFFF00037F7F333333337F7F000FFFFFFFFF
00037F7F333333337F7F000FFFFFFFFF00037F7F333333337F7F000FFFFFFFFF
00037F7F333333337F7F000FFFFFFFFF07037F7F33333333777F000FFFFFFFFF
0003737FFFFFFFFF7F7330099999999900333777777777777733}
NumGlyphs = 2
ParentDoubleBuffered = False
ParentFont = False
TabOrder = 1
OnClick = btnGravarClick
end
object btnSair: TBitBtn
Left = 517
Top = 4
Width = 115
Height = 35
Cursor = crHandPoint
Anchors = [akRight, akBottom]
Caption = '&Sair'
DoubleBuffered = True
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
04000000000000010000120B0000120B00001000000000000000000000000000
800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00330000000000
03333377777777777F333301111111110333337F333333337F33330111111111
0333337F333333337F333301111111110333337F333333337F33330111111111
0333337F333333337F333301111111110333337F333333337F33330111111111
0333337F3333333F7F333301111111B10333337F333333737F33330111111111
0333337F333333337F333301111111110333337F33FFFFF37F3333011EEEEE11
0333337F377777F37F3333011EEEEE110333337F37FFF7F37F3333011EEEEE11
0333337F377777337F333301111111110333337F333333337F33330111111111
0333337FFFFFFFFF7F3333000000000003333377777777777333}
NumGlyphs = 2
ParentDoubleBuffered = False
ParentFont = False
TabOrder = 4
OnClick = btnSairClick
end
object btnNovo: TBitBtn
Left = 4
Top = 4
Width = 115
Height = 35
Cursor = crHandPoint
Anchors = [akLeft, akBottom]
Caption = '&Novo'
DoubleBuffered = True
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
04000000000000010000120B0000120B00001000000000000000000000000000
800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00555555555555
5555555FFFFFFFFFF5555550000000000555557777777777F5555550FFFFFFFF
0555557F5FFFF557F5555550F0000FFF0555557F77775557F5555550FFFFFFFF
0555557F5FFFFFF7F5555550F000000F0555557F77777757F5555550FFFFFFFF
0555557F5FFFFFF7F5555550F000000F0555557F77777757F5555550FFFFFFFF
0555557F5FFF5557F5555550F000FFFF0555557F77755FF7F5555550FFFFF000
0555557F5FF5777755555550F00FF0F05555557F77557F7555555550FFFFF005
5555557FFFFF7755555555500000005555555577777775555555555555555555
5555555555555555555555555555555555555555555555555555}
NumGlyphs = 2
ParentDoubleBuffered = False
ParentFont = False
TabOrder = 0
OnClick = btnNovoClick
end
end
object pmOpcoes: TPopupMenu
Left = 528
Top = 8
end
end
|
onbreak {quit -f}
onerror {quit -f}
vsim -voptargs="+acc" -t 1ps -L xil_defaultlib -L xpm -L fifo_generator_v13_2_0 -L unisims_ver -L unimacro_ver -L secureip -lib xil_defaultlib xil_defaultlib.fifo_generator_7 xil_defaultlib.glbl
do {wave.do}
view wave
view structure
view signals
do {fifo_generator_7.udo}
run -all
quit -force
|
#version 450 core
layout(set = 0, binding = 0) uniform sampler2D samp;
layout(location = 0) in vec3 inUV;
layout(location = 0) out vec4 oColor;
void main()
{
oColor = textureProj(samp, inUV);
}
// BEGIN_SHADERTEST
/*
; RUN: amdllpc -spvgen-dir=%spvgendir% -v %gfxip %s | FileCheck -check-prefix=SHADERTEST %s
; SHADERTEST-LABEL: {{^// LLPC}} SPIRV-to-LLVM translation results
; SHADERTEST: AMDLLPC SUCCESS
*/
// END_SHADERTEST
|
module Day04 where
import Data.List.Split (splitOn)
import Data.Set (Set)
import qualified Data.Set as Set
answer1 :: IO Int
answer1 = length . filter valid <$> readPassports
requiredFields :: Set String
requiredFields = Set.fromList [ "byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid" ]
valid :: Set String -> Bool
valid passport = Set.isSubsetOf requiredFields passport
passports :: [String] -> [Set String]
passports lines = go lines Set.empty []
where
go :: [String] -> (Set String) -> [Set String] -> [Set String]
go [] fields acc = fields:acc
go ("":lines') fields acc = go lines' Set.empty (fields:acc)
go (line:lines') fields acc = go lines' (fields <> parseFields line) acc
parseFields :: String -> Set String
parseFields line = Set.fromList $ parseField <$> words line
parseField :: String -> String
parseField line = head $ splitOn ":" line
example :: [String]
example = [
"ecl:gry pid:860033327 eyr:2020 hcl:#fffffd",
"byr:1937 iyr:2017 cid:147 hgt:183cm",
"",
"iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884",
"hcl:#cfa07d byr:1929",
"",
"hcl:#ae17e1 iyr:2013",
"eyr:2024",
"ecl:brn pid:760753108 byr:1931",
"hgt:179cm",
"",
"hcl:#cfa07d eyr:2025 pid:166559648",
"iyr:2011 ecl:brn hgt:59in"
]
readPassports :: IO [Set String]
readPassports = passports . lines <$> readFile "input04.txt"
|
#using Compat.Test
#using Compat
using ViscousFlow
using Test
##using TestSetExtensions
#@test isempty(detect_ambiguities(ViscousFlow))
include("pointforce.jl")
include("fields.jl")
include("points.jl")
include("layers.jl")
include("timemarching.jl")
include("saddle.jl")
include("systems.jl")
#@testset ExtendedTestSet "All tests" begin
# @includetests ARGS
#end
#if isempty(ARGS)
# include("../docs/make.jl")
#end
|
Data Baseball;
Length Div $100.;
Set Sashelp.Baseball;
Run;
/* */
/* %Let Dataset_Name = Work.Baseball; */
/* %Let Column_Name = Name; */
/* %Let Output_Dataset = Compressed_Baseball; */
%Macro Compress_Char_Column(Dataset_Name, Column_Name, Output_Dataset);
Proc Sql;
Create Table All_Compressed_Len As
Select &Column_Name., Length(&Column_Name.) As Compressed_Len From &Dataset_Name.
Group By Length(&Column_Name.);
Select Max(Compressed_len) Into: Compressed_Length Trimmed From All_Compressed_Len;
%put Compressed Length is found to be &Compressed_Length.;
Drop Table All_Compressed_Len;
Quit;
Data &Output_Dataset.;
Length &Column_Name. $&Compressed_Length.;
Set &Dataset_Name.;
Run;
%Mend;
%Compress_Char_Column(Baseball, Div, New_baseball);
|
package functions
// Map return a new slice with the map operation applied to each element.
// Can be generated for any type.
func (s SliceType) Map(f func(ElementType) ElementType) (out SliceType) {
if f == nil {
return s
}
for _, v := range s {
out = append(out, f(v))
}
return
}
|
#version 420 core
out vec4 FragColor;
layout (depth_greater) out float gl_FragDepth;
in vec2 TexCoords;
uniform sampler2D texture1;
void main()
{
FragColor = texture(texture1, TexCoords);
gl_FragDepth = gl_FragCoord.z + 0.1;
} |
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local lfs = require('lfs')
local neq, eq, command = helpers.neq, helpers.eq, helpers.command
local clear, curbufmeths = helpers.clear, helpers.curbufmeths
local exc_exec, expect, eval = helpers.exc_exec, helpers.expect, helpers.eval
local insert, pcall_err = helpers.insert, helpers.pcall_err
local meths = helpers.meths
describe('eval-API', function()
before_each(clear)
it("work", function()
command("call nvim_command('let g:test = 1')")
eq(1, eval("nvim_get_var('test')"))
local buf = eval("nvim_get_current_buf()")
command("call nvim_buf_set_lines("..buf..", 0, -1, v:true, ['aa', 'bb'])")
expect([[
aa
bb]])
command("call nvim_win_set_cursor(0, [1, 1])")
command("call nvim_input('ax<esc>')")
expect([[
aax
bb]])
end)
it("throw errors for invalid arguments", function()
local err = exc_exec('call nvim_get_current_buf("foo")')
eq('Vim(call):E118: Too many arguments for function: nvim_get_current_buf', err)
err = exc_exec('call nvim_set_option("hlsearch")')
eq('Vim(call):E119: Not enough arguments for function: nvim_set_option', err)
err = exc_exec('call nvim_buf_set_lines(1, 0, -1, [], ["list"])')
eq('Vim(call):E5555: API call: Wrong type for argument 4 when calling nvim_buf_set_lines, expecting Boolean', err)
err = exc_exec('call nvim_buf_set_lines(0, 0, -1, v:true, "string")')
eq('Vim(call):E5555: API call: Wrong type for argument 5 when calling nvim_buf_set_lines, expecting ArrayOf(String)', err)
err = exc_exec('call nvim_buf_get_number("0")')
eq('Vim(call):E5555: API call: Wrong type for argument 1 when calling nvim_buf_get_number, expecting Buffer', err)
err = exc_exec('call nvim_buf_line_count(17)')
eq('Vim(call):E5555: API call: Invalid buffer id: 17', err)
end)
it("use buffer numbers and windows ids as handles", function()
local screen = Screen.new(40, 8)
screen:attach()
local bnr = eval("bufnr('')")
local bhnd = eval("nvim_get_current_buf()")
local wid = eval("win_getid()")
local whnd = eval("nvim_get_current_win()")
eq(bnr, bhnd)
eq(wid, whnd)
command("new") -- creates new buffer and new window
local bnr2 = eval("bufnr('')")
local bhnd2 = eval("nvim_get_current_buf()")
local wid2 = eval("win_getid()")
local whnd2 = eval("nvim_get_current_win()")
eq(bnr2, bhnd2)
eq(wid2, whnd2)
neq(bnr, bnr2)
neq(wid, wid2)
-- 0 is synonymous to the current buffer
eq(bnr2, eval("nvim_buf_get_number(0)"))
command("bn") -- show old buffer in new window
eq(bnr, eval("nvim_get_current_buf()"))
eq(bnr, eval("bufnr('')"))
eq(bnr, eval("nvim_buf_get_number(0)"))
eq(wid2, eval("win_getid()"))
eq(whnd2, eval("nvim_get_current_win()"))
end)
it("get_lines and set_lines use NL to represent NUL", function()
curbufmeths.set_lines(0, -1, true, {"aa\0", "b\0b"})
eq({'aa\n', 'b\nb'}, eval("nvim_buf_get_lines(0, 0, -1, 1)"))
command('call nvim_buf_set_lines(0, 1, 2, v:true, ["xx", "\\nyy"])')
eq({'aa\0', 'xx', '\0yy'}, curbufmeths.get_lines(0, -1, 1))
end)
it("that are FUNC_ATTR_NOEVAL cannot be called", function()
-- Deprecated vim_ prefix is not exported.
local err = exc_exec('call vim_get_current_buffer("foo")')
eq('Vim(call):E117: Unknown function: vim_get_current_buffer', err)
-- Deprecated buffer_ prefix is not exported.
err = exc_exec('call buffer_line_count(0)')
eq('Vim(call):E117: Unknown function: buffer_line_count', err)
-- Functions deprecated before the api functions became available
-- in vimscript are not exported.
err = exc_exec('call buffer_get_line(0, 1)')
eq('Vim(call):E117: Unknown function: buffer_get_line', err)
-- some api functions are only useful from a msgpack-rpc channel
err = exc_exec('call nvim_subscribe("fancyevent")')
eq('Vim(call):E117: Unknown function: nvim_subscribe', err)
end)
it('have metadata accessible with api_info()', function()
local api_keys = eval("sort(keys(api_info()))")
eq({'error_types', 'functions', 'types',
'ui_events', 'ui_options', 'version'}, api_keys)
end)
it('are highlighted by vim.vim syntax file', function()
if lfs.attributes("build/runtime/syntax/vim/generated.vim",'uid') == nil then
pending("runtime was not built, skipping test")
return
end
local screen = Screen.new(40, 8)
screen:attach()
screen:set_default_attr_ids({
[1] = {bold = true, foreground = Screen.colors.Brown},
[2] = {foreground = Screen.colors.DarkCyan},
[3] = {foreground = Screen.colors.SlateBlue},
[4] = {foreground = Screen.colors.Fuchsia},
[5] = {bold = true, foreground = Screen.colors.Blue},
})
command("set ft=vim")
command("let &rtp='build/runtime/,'.&rtp")
command("syntax on")
insert([[
call bufnr('%')
call nvim_input('typing...')
call not_a_function(42)]])
screen:expect([[
{1:call} {2:bufnr}{3:(}{4:'%'}{3:)} |
{1:call} {2:nvim_input}{3:(}{4:'typing...'}{3:)} |
{1:call} not_a_function{3:(}{4:42}{3:^)} |
{5:~ }|
{5:~ }|
{5:~ }|
{5:~ }|
|
]])
end)
it('cannot be called from sandbox', function()
eq('Vim(call):E48: Not allowed in sandbox',
pcall_err(command, "sandbox call nvim_input('ievil')"))
eq({''}, meths.buf_get_lines(0, 0, -1, true))
end)
end)
|
/*
* Copyright © 2021 Paulo Villela. All rights reserved.
* Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
package util
import "github.com/google/uuid"
type Uuid string
func NewUuid() Uuid {
return Uuid(uuid.NewString())
}
|
module TestRound exposing (roundTest)
import Test exposing (..)
import TestFunction exposing (..)
import Round
data =
[ TestRow 0 "0" "0" "0" "0.0" "0.00"
, TestRow 0 "0" "0" "0" "0.0" "0.00"
, TestRow 0 "0" "0" "0" "0.0" "0.00"
, TestRow 0 "0" "0" "0" "0.0" "0.00"
, TestRow 0 "0" "0" "0" "0.0" "0.00"
, TestRow 99 "100" "100" "99" "99.0" "99.00"
, TestRow 9.9 "0" "10" "10" "9.9" "9.90"
, TestRow 0.99 "0" "0" "1" "1.0" "0.99"
, TestRow 0.099 "0" "0" "0" "0.1" "0.10"
, TestRow 0.0099 "0" "0" "0" "0.0" "0.01"
, TestRow -99 "-100" "-100" "-99" "-99.0" "-99.00"
, TestRow -9.9 "0" "-10" "-10" "-9.9" "-9.90"
, TestRow -0.99 "0" "0" "-1" "-1.0" "-0.99"
, TestRow -0.099 "0" "0" "0" "-0.1" "-0.10"
, TestRow -0.0099 "0" "0" "0" "0.0" "-0.01"
, TestRow 1 "0" "0" "1" "1.0" "1.00"
, TestRow 1.1 "0" "0" "1" "1.1" "1.10"
, TestRow 1.01 "0" "0" "1" "1.0" "1.01"
, TestRow 1.001 "0" "0" "1" "1.0" "1.00"
, TestRow -1 "0" "0" "-1" "-1.0" "-1.00"
, TestRow -1.1 "0" "0" "-1" "-1.1" "-1.10"
, TestRow -1.01 "0" "0" "-1" "-1.0" "-1.01"
, TestRow -1.001 "0" "0" "-1" "-1.0" "-1.00"
, TestRow 213 "200" "210" "213" "213.0" "213.00"
, TestRow 213.1 "200" "210" "213" "213.1" "213.10"
, TestRow 213.01 "200" "210" "213" "213.0" "213.01"
, TestRow 213.001 "200" "210" "213" "213.0" "213.00"
, TestRow -213 "-200" "-210" "-213" "-213.0" "-213.00"
, TestRow -213.1 "-200" "-210" "-213" "-213.1" "-213.10"
, TestRow -213.01 "-200" "-210" "-213" "-213.0" "-213.01"
, TestRow -213.001 "-200" "-210" "-213" "-213.0" "-213.00"
, TestRow 5.5 "0" "10" "6" "5.5" "5.50"
, TestRow 5.55 "0" "10" "6" "5.6" "5.55"
, TestRow 5.555 "0" "10" "6" "5.6" "5.56"
, TestRow 5.5555 "0" "10" "6" "5.6" "5.56"
, TestRow -5.5 "0" "-10" "-5" "-5.5" "-5.50"
, TestRow -5.55 "0" "-10" "-6" "-5.5" "-5.55"
, TestRow -5.555 "0" "-10" "-6" "-5.6" "-5.55"
, TestRow -5.5555 "0" "-10" "-6" "-5.6" "-5.56"
, TestRow 5.5 "0" "10" "6" "5.5" "5.50"
, TestRow 5.51 "0" "10" "6" "5.5" "5.51"
, TestRow 5.501 "0" "10" "6" "5.5" "5.50"
, TestRow 5.5001 "0" "10" "6" "5.5" "5.50"
, TestRow -5.5 "0" "-10" "-5" "-5.5" "-5.50"
, TestRow -5.51 "0" "-10" "-6" "-5.5" "-5.51"
, TestRow -5.501 "0" "-10" "-6" "-5.5" "-5.50"
, TestRow -5.5001 "0" "-10" "-6" "-5.5" "-5.50"
, TestRow 4.9 "0" "0" "5" "4.9" "4.90"
, TestRow 4.99 "0" "0" "5" "5.0" "4.99"
, TestRow 4.999 "0" "0" "5" "5.0" "5.00"
, TestRow 4.9999 "0" "0" "5" "5.0" "5.00"
, TestRow -4.9 "0" "0" "-5" "-4.9" "-4.90"
, TestRow -4.99 "0" "0" "-5" "-5.0" "-4.99"
, TestRow -4.999 "0" "0" "-5" "-5.0" "-5.00"
, TestRow -4.9999 "0" "0" "-5" "-5.0" "-5.00"
, TestRow 1.234e22 "12340000000000000000000" "12340000000000000000000" "12340000000000000000000" "12340000000000000000000.0" "12340000000000000000000.00"
, TestRow -1.234e22 "-12340000000000000000000" "-12340000000000000000000" "-12340000000000000000000" "-12340000000000000000000.0" "-12340000000000000000000.00"
, TestRow 1.234e-22 "0" "0" "0" "0.0" "0.00"
, TestRow -1.234e-22 "0" "0" "0" "0.0" "0.00"
, TestRow (0 / 0) "NaN" "NaN" "NaN" "NaN" "NaN"
, TestRow (1 / 0) "Infinity" "Infinity" "Infinity" "Infinity" "Infinity"
]
roundTest : Test
roundTest =
testFunction "round" Round.round data
|
/*
* Copyright 2016 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
import "google/protobuf/timestamp.proto";
package com.spbsu.grpc.chat;
message ChatMessage {
string host = 1;
string port = 2;
string from = 3;
string message = 4;
}
message ChatMessageFromServer {
google.protobuf.Timestamp timestamp = 1;
ChatMessage message = 2;
}
service ChatService {
rpc chat(stream ChatMessage) returns (stream ChatMessageFromServer);
}
|
---
title: "Wykład III - DBSCAN"
author: "Mateusz Sobieraj"
date: "3 kwiecien 2017"
encoding: "UTF-8"
output:
ioslides_presentation:
css: dependencies/styles.css
widescreen: false
transition : "slower"
smaller: true
logo: dependencies/grosz.png
---
<!-- 'f' enable fullscreen mode -->
<!-- 'w' toggle widescreen mode -->
<!-- 'o' enable overview mode -->
<!-- 'h' enable code highlight mode -->
<!-- 'p' show presenter notes -->
```{r required_datasets, include=FALSE, eval=TRUE}
#install.packages('ggplot2', dependencies = T)
#install.packages('assertthat', dependencies = T)
#install.packages('factoextra')
#install.packages('fpc')
#install.packages('dbscan')
#install.packages('FNN')
library('dbscan')
library('fpc')
library('ggplot2')
library('factoextra')
library('dplyr')
library('FNN')
# datasets preparing #
# different sizes
set.seed(0.5)
ds <- data.frame(x = c(runif(1000), runif(200, 0.3, 0.7) + 0.75, runif(200, 0.3, 0.7) - 0.75)
, y = c(runif(1000), runif(200, 0.3, 0.7), runif(200, 0.3, 0.7))
, label = c(rep('first', 1000), rep('second', 200), rep('third', 200)))
# different densities
set.seed(0.5)
dd <- data.frame(x = c(runif(200), runif(200, 0.35, 0.65) + 1, runif(200, 0.35, 0.65) + 1)
, y = c(runif(200), runif(200, 0.35, 0.65) + 0.25, runif(200, 0.35, 0.65) - 0.25)
, label = c(rep('first', 200), rep('second', 200), rep('third', 200)))
# on-convex shapes
set.seed(0.5)
phi1 <- seq(0, pi, by = 0.1)
x1 <- rep(cos(phi1), 50) + runif(50, 0, 0.3)
y1 <- rep(sin(phi1), 50) + runif(50, 0, 0.3)
phi2 <- seq(pi, 2 * pi, by = 0.1)
x2 <- 1 + rep(cos(phi2), 50) + runif(50, 0, 0.3)
y2 <- 0.5 + rep(sin(phi2), 50) + runif(50, 0, 0.3)
nc <- data.frame(x = c(x1, x2)
, y = c(y1, y2)
, label = c(rep('first', length(x1)), rep('second', length(x2)))
)
# weird shapes
ws <- multishapes #factoextra
ws$shape <- as.factor(ws$shape)
ws_ul <- ws[, -3]
# kmeans clasification #
ds_km <- kmeans(ds[, -3], 3)
ds_km.labels <- as.factor(ds_km$cluster)
dd_km <- kmeans(dd[, -3], 3)
dd_km.labels <- as.factor(dd_km$cluster)
nc_km <- kmeans(nc[, -3], 2)
nc_km.labels <- as.factor(nc_km$cluster)
ws_km <- kmeans(ws[, -3], 6)
ws_km.labels <- as.factor(ws_km$cluster)
# plots preparing #
ds_original <- ggplot(data = ds, aes(x = x, y = y, colour = label)) + geom_point() + ggtitle("Pierwotne klastry")
ds_kmeans <- ggplot(data = ds, aes(x = x, y = y, colour = ds_km.labels)) + geom_point() + ggtitle("Klasyfikacja K-means")
dd_original <- ggplot(data = dd, aes(x = x, y = y, colour = label)) + geom_point() + ggtitle("Pierwotne klastry")
dd_kmeans <- ggplot(data = dd, aes(x = x, y = y, colour = dd_km.labels)) + geom_point() + ggtitle("Klasyfikacja K-means")
nc_original <- ggplot(data = nc, aes(x = x, y = y, colour = label)) + geom_point() + ggtitle("Pierwotne klastry")
nc_kmeans <- ggplot(data = nc, aes(x = x, y = y, colour = nc_km.labels)) + geom_point() + ggtitle("Klasyfikacja K-means")
ws_original <- ggplot(data = ws, aes(x = x, y = y, colour = shape)) + geom_point() + ggtitle("Pierwotne klastry")
ws_kmeans <- ggplot(data = ws, aes(x = x, y = y, colour = ws_km.labels)) + geom_point() + ggtitle("Klasyfikacja K-means")
```
## Plan wykładu {.build}
- Teoria
- Dlaczego nie chcemy zawsze używać K-means
- Alternatywy do `K-means`
- Algorytm `DBSCAN` Wstęp
- Algorytm `DBSCAN` Podstawowe Definicje
- Algorytm `DBSCAN` dobór optymalnych $\epsilon$ i $mp$
- Algorytm `DBSCAN` problemy
- R
- Zbiór danych
- Klasteryzacja z `DBSCAN`
## Teoria
## Dlaczego nie zawsze chcemy używać `K-means` {.build}
Algorytm `K-means` jest prostym algorytmem, często dającym bardzo dobre rezultaty, jednak ma swoje ograniczenia. Najważniejsze z nich to:
1. możemy go stosować tylko dla obiektów opisanych zmiennymi ciągłymi
2. musimy z góry określić liczbę klastrów
3. jest wrażliwy na szum i obserwacje odstające
4. nie klasyfikuje dobrze klastrów o niewypukłych kształtach
5. nie klasyfikuje dobrze klastrów o różnych gęstościach
## Różne gęstości {.build}
```{r, echo=FALSE}
dd_original
```
## Różne gęstości
```{r, echo=FALSE}
dd_kmeans
```
## Różne wielkości klastrów {.build}
```{r, echo=FALSE}
ds_original
```
## Różne wielkości klastrów
```{r, echo=FALSE}
ds_kmeans
```
## Klastry o niewypukłych kształtach {.build}
```{r, echo=FALSE}
nc_original
```
## Klastry o niewypukłych kształtach
```{r, echo=FALSE}
nc_kmeans
```
## Alternatywy do `K-means` {.build}
Inne grupy algorytmów nauczania bez nadzoru:
- Expectation–maximization algorithm (EM)
- Density-Based Clustering
- `Density-based spatial clustering of applications with noise (DBSCAN)`
- Ordering points to identify the clustering structure (OPTICS)
- Density Clustering (DENCLUE)
- Hierarchical Clustering
- Single link
- Complete link
- Average
- Centroid
- pochodne K-means
- K-Medoids
- K-modes
## Algorytm `DBSCAN` Wstęp {.build}
Problemy `K-means`
1. możemy go stosować tylko dla obiektów opisanych zmiennymi ciągłymi.
2. musimy z góry określić liczbę klastrów
3. jest wrażliwy na szum i obserwacje odstające
4. nie klasyfikuje dobrze klastrów o niewypukłych kształtach
5. nie klasyfikuje dobrze klastrów o różnych gęstościach
## Algorytm `DBSCAN` Wstęp
Problemy, z którymi poradzi sobie `DBSCAN`
1. możemy go stosować tylko dla obiektów opisanych zmiennymi ciągłymi.
2. `musimy z góry określić liczbę klastrów`
3. `jest wrażliwy na szum i obserwacje odstające`
4. `nie klasyfikuje dobrze klastrów o niewypukłych kształtach`
5. nie klasyfikuje dobrze klastrów o różnych gęstościach
## Algorytm `DBSCAN` Wstęp II {.build}
W `Density-Based Clustering` staramy się podzielić punkty na 'gęste' obszary oddzielone 'niegęstymi' obszarami.
#### Oznaczenia
- $\epsilon$ - zdefiniowany przez nas promień okręgu
- $mp$ - zdefiniowana przez nas liczba punktów, która musi znaleźć się k kuli
- $p$, $q$,... - punkty
## Algorytm `DBSCAN` Podstawowe Definicje {.build}
#### DEF(gęstość w punkcie $p$)
Gęstością w punkcie $p$ nazywamy liczbę punktów znajdujących się w kuli o środku w punkcie $p$ i promienu $\epsilon$.
#### DEF(punkt główny)
Punkt $p$ jest punktem głównym, gdy gęstość dla punktu $p$ wynosi przynajmniej $mp$.
#### DEF(punkty bezpośrednio osiągalne)(directly reachable points)
Punkt $q$ jest bezpośrednio osiągalne z punktu głównego $p$, gdy znajdujące się w promieniu $\epsilon$. Żadne punkty nie są bezpośrednio osiągalne z punktów które nie są punktami głównymi.
#### DEF(punkty osiągalne)(reachable points)
Punkt $q$ jest osiągalny z punktu $p$ gdy istnieje ścieżka $p = p_1,\ldots,p_n = q$, w któej punkt $p_{i+1}$ jest bezpośrednio osiągalny z punktu $p_i$. Wszystkie punkty z wyjątkiem $q$ muszą być punktami głównymi.
## Algorytm `DBSCAN` Podstawowe Definicje II {.build}
#### DEF(punkty graniczne)(border points)
Punkt $p$ nazywamy punktem granicznym, gdy nie jest punktem głównym, ale jest osiągalny
#### DEF(punkty odstające)(noise points)
Wszystkie punkty nieosiągalne z żadnego innego punku to punkty odstające.
#### DEF(Klaster)
Klastrem nazywamy maksymalny zbiór punktów osiągalnych (wszystko jedno czy głównych, czy nie).
## Algorytm `DBSCAN` dobór optymalnych $\epsilon$ i $mp$ {.build}
#### Uwaga I
Im mniejsze $mp$ tym więcej szumu zostanie uznane za klastry.
##### Uwaga II
Uznaje się, że $mp$ powinno wynosić co najmniej liczbę wymiarów danych plus 1.
#### DEF(wykres odległości kNN)
Wykres, w którym na osi $Y$ znajduje się odległości, na osi $X$ skumulowana suma obserwacji posortowana po odległości od najmniejszej do największej.
##### Uwaga III
Wybieramy takie $\epsilon$ by druga pochodna wykresu odległości kNN była jak największa (innymi słowy szukamy kolanka).
## Wady algorytmu `DBSCAN` {.build}
Algorytm słabo klasyfikuje
- klastry o różnej gęstości
- wysoko wymiarowe dane
## R
## Zbiór danych {.build}
Będziemy pracować na zbiorze `multishapes` z pakietu `factoextra` (u nas przechowywany w zmiennej `ws_ul`), oraz używać bibliotek `fpc` i `dbscan`
```{r dataset_summary}
summary(ws)
str(ws)
```
## Zbiór danych
```{r, echo=FALSE}
ws_original
```
## Zbiór danych
```{r, echo=FALSE}
ws_kmeans
```
## Klasteryzacja z `DBSCAN` dobór parametrów {.build}
```{r dbscan0}
dbscan::kNNdistplot(ws_ul, k = 3)
```
## Klasteryzacja z `DBSCAN` dobór parametrów {.build}
```{r dbscan1}
#dbscan::kNNdistplot
add_new_plot <- function(x, k = 4, kontekst = 'plot', ...)
{
kNNdist <- sort(kNNdist(x, k))
if (kontekst == 'plot') {
plot(sort(kNNdist), type = "l",...)
} else {
lines(sort(kNNdist), type = "l",...)
}
}
```
```{r dbscan11, eval = FALSE}
add_new_plot(ws_ul, k = 10, ylim = c(0, 0.4)) +
add_new_plot(ws_ul, k = 3, kontekst = 'lines', col = "blue") +
add_new_plot(ws_ul, k = 5, kontekst = 'lines', col = "red") +
add_new_plot(ws_ul, k = 1, kontekst = 'lines', col = "green") +
abline(h = 0.06, col = 'green'); text(1000, 0.08, col = 'green', labels = "0.06 MinPts = 1") +
abline(h = 0.11, col = 'blue'); text(1000, 0.13, col = 'blue', labels = "0.11 MinPts = 3") +
abline(h = 0.14, col = 'red'); text(1000, 0.16, col = 'red', labels = "0.14 MinPts = 5") +
abline(h = 0.19); text(1000, 0.21, labels = "0.19 MinPts = 10")
```
## Klasteryzacja z `DBSCAN` dobór parametrów {.build}
```{r, echo=FALSE, results='hide',message=FALSE}
add_new_plot(ws_ul, k = 10, ylim = c(0, 0.4)) +
add_new_plot(ws_ul, k = 3, kontekst = 'lines', col = "blue") +
add_new_plot(ws_ul, k = 5, kontekst = 'lines', col = "red") +
add_new_plot(ws_ul, k = 1, kontekst = 'lines', col = "green") +
abline(h = 0.06, col = 'green'); text(1000, 0.08, col = 'green', labels = "0.06 MinPts = 1") +
abline(h = 0.11, col = 'blue'); text(1000, 0.13, col = 'blue', labels = "0.11 MinPts = 3") +
abline(h = 0.14, col = 'red'); text(1000, 0.16, col = 'red', labels = "0.14 MinPts = 5") +
abline(h = 0.19); text(1000, 0.21, labels = "0.19 MinPts = 10")
```
## Klasteryzacja z `DBSCAN` zastosowanie algorytmu {.build}
```{r dbscan2}
ws_dbxcan1 <- fpc::dbscan(ws_ul, eps = 0.06, MinPts = 1)
ws_dbxcan3 <- fpc::dbscan(ws_ul, eps = 0.11, MinPts = 3)
ws_dbxcan5 <- fpc::dbscan(ws_ul, eps = 0.14, MinPts = 5)
ws_dbxcan10 <- fpc::dbscan(ws_ul, eps = 0.19, MinPts = 10)
pred_ws_DB1 <- as.factor(predict(ws_dbxcan1))
pred_ws_DB3 <- as.factor(predict(ws_dbxcan3))
pred_ws_DB5 <- as.factor(predict(ws_dbxcan5))
pred_ws_DB10 <- as.factor(predict(ws_dbxcan10))
db1 <- ggplot(data = ws_ul, aes(x = x, y = y, colour = pred_ws_DB1)) + geom_point() +
ggtitle("Klasyfikacja DBSCAN MinPts = 1, eps = 0.06")
db3 <- ggplot(data = ws_ul, aes(x = x, y = y, colour = pred_ws_DB3)) + geom_point() +
ggtitle("Klasyfikacja DBSCAN MinPts = 3, eps = 0.11")
db5 <- ggplot(data = ws_ul, aes(x = x, y = y, colour = pred_ws_DB5)) + geom_point() +
ggtitle("Klasyfikacja DBSCAN MinPts = 5, eps = 0.14")
db10 <- ggplot(data = ws_ul, aes(x = x, y = y, colour = pred_ws_DB10)) + geom_point() +
ggtitle("Klasyfikacja DBSCAN 10, eps = 0.19")
```
## Klasteryzacja z `DBSCAN` Wizualizacja
```{r, echo=FALSE}
db1
```
## Klasteryzacja z `DBSCAN` Wizualizacja
```{r, echo=FALSE}
db3
```
## Klasteryzacja z `DBSCAN` Wizualizacja
```{r, echo=FALSE}
db5
```
## Klasteryzacja z `DBSCAN` Wizualizacja
```{r, echo=FALSE}
db10
```
|
||| Borrowed From Idris2 and improved with Test.Unit
module Main
import Data.List
import Test.Golden
%default total
tests : TestPool
tests
= MkTestPool "Tests"
[]
Nothing
[ "000-mux-check"
, "001-nice-exempler"
, "002-unused-port"
, "003-linear-check"
, "004-malformed-file"
, "005-locallink"
, "006-unused-port"
, "007-firewall"
, "008-core-alliance-swerv-eh1"
, "009-scrubbing"
, "010-gates"
, "011-paper"
, "012-tutorial"
]
covering
main : IO ()
main
= runner [ tests ]
-- [ EOF ]
|
-- sample app too clunky? here's the template :P
-- change to "Main" if using
module Template exposing (main)
import Browser
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
-- 📦 model 📦
type alias Model = { todo: Int {- implement model -} }
init: String -> ( Model, Cmd msg )
init flags = ( { todo = Debug.todo "implement init" }, Cmd.none )
-- 📦 ----- 📦
--
--
-- 📩 messages 📩
type Msg = Todo
-- 📩 -------- 📩
--
--
-- 🤝 helpers 🤝
helper input = Ok
-- 🤝 ------- 🤝
--
--
-- 📃 view 📃
view model = Debug.todo "implement view"
-- 📃 ---- 📃
--
--
-- 📯 update 📯
update msg model =
( case msg of
Todo -> { model | todo = Debug.todo "implement update" }
, Cmd.none
)
-- 📯 ------ 📯
--
--
-- 💻 main 💻
main =
Browser.element
{ init = init
, update = update
, view = view
, subscriptions = \_ -> Sub.none
}
-- 💻 ---- 💻
|
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import WhoToGreet from '../../src/components/WhoToGreet';
import * as GreetingActions from '../../src/actions/GreetingActions';
describe('WhoToGreet', () => {
let handleSelectionChangeSpy: jasmine.Spy;
beforeEach(() => {
handleSelectionChangeSpy = jasmine.createSpy('handleSelectionChange');
});
it('given a newGreeting then it renders a form containing an input containing that text and an add button', () => {
const newGreeting = 'James';
const form = render({ newGreeting });
expect(form.type).toBe('form');
expect(form.props.role).toBe('form');
const formGroup = form.props.children;
expect(formGroup.type).toBe('div');
expect(formGroup.props.className).toBe('form-group');
const [ input, button ] = formGroup.props.children;
expect(input.type).toBe('input');
expect(input.props.type).toBe('text');
expect(input.props.className).toBe('form-control');
expect(input.props.placeholder).toBe('Who would you like to greet?');
expect(input.props.value).toBe(newGreeting);
expect(button.type).toBe('button');
expect(button.props.type).toBe('submit');
expect(button.props.className).toBe('btn btn-default btn-primary');
expect(button.props.disabled).toBe(false);
expect(button.props.children).toBe('Add greeting');
});
it('input onChange triggers a newGreetingChanged action', () => {
const newGreeting = 'Benjamin';
const form = render({ newGreeting });
const formGroup = form.props.children;
const [ input ] = formGroup.props.children;
spyOn(GreetingActions, 'newGreetingChanged');
input.props.onChange({ target: { value: newGreeting }});
expect(GreetingActions.newGreetingChanged).toHaveBeenCalledWith(newGreeting);
});
it('button onClick triggers an addGreeting action', () => {
const newGreeting = 'Benjamin';
const form = render({ newGreeting });
const formGroup = form.props.children;
const [ , button ] = formGroup.props.children;
spyOn(GreetingActions, 'addGreeting');
button.props.onClick({ preventDefault: () => {} });
expect(GreetingActions.addGreeting).toHaveBeenCalledWith(newGreeting);
});
function render({ newGreeting }: { newGreeting: string }) {
const shallowRenderer = TestUtils.createRenderer();
shallowRenderer.render(<WhoToGreet newGreeting={ newGreeting } />);
return shallowRenderer.getRenderOutput();
}
});
|
module tb();
// Number of parallel dds blocks.
parameter N_DDS = 8;
// Ports.
reg aclk;
reg s_axis_data_tvalid;
wire s_axis_data_tready;
reg [255:0] s_axis_data_tdata;
wire m_axis_data_tvalid;
wire [31:0] m_axis_data_tdata;
// Test bench control.
reg tb_data_in = 0;
reg tb_data_in_done;
reg tb_write_out = 0;
// DUT.
fir_compiler_0
DUT
(
.aclk (aclk ),
.s_axis_data_tvalid (s_axis_data_tvalid ),
.s_axis_data_tready (s_axis_data_tready ),
.s_axis_data_tdata (s_axis_data_tdata ),
.m_axis_data_tvalid (m_axis_data_tvalid ),
.m_axis_data_tdata (m_axis_data_tdata )
);
initial begin
#1000;
@(posedge aclk);
tb_data_in <= 1;
tb_write_out <= 1;
wait (tb_data_in_done);
@(posedge aclk);
tb_write_out <= 0;
end
// Input data.
initial begin
int fd, i;
bit signed [15:0] vali, valq;
tb_data_in_done <= 0;
s_axis_data_tvalid <= 1;
s_axis_data_tdata <= 0;
wait (tb_data_in);
#1000;
// Open file with input data.
// Format: I, Q.
fd = $fopen("../../../../../tb/data_iq.txt","r");
i = N_DDS;
while ($fscanf(fd,"%d,%d", vali, valq) == 2) begin
$display("Time %t: Line %d, I = %d, Q = %d", $time, i, vali, valq);
s_axis_data_tdata[(i-1)*32 +: 32] <= {valq,vali};
i = i - 1;
if ( i == 0) begin
i = N_DDS;
@(posedge aclk);
end
end
#1000;
@(posedge aclk);
tb_data_in_done <= 1;
end
// Write output into file.
initial begin
int fd;
int i;
shortint real_d, imag_d;
// Output file.
fd = $fopen("../../../../../tb/dout.csv","w");
// Data format.
$fdisplay(fd, "valid, real, imag");
wait (tb_write_out);
while (tb_write_out) begin
@(posedge aclk);
real_d = m_axis_data_tdata[15:0];
imag_d = m_axis_data_tdata[31:16];
$fdisplay(fd, "%d, %d, %d", m_axis_data_tvalid, real_d, imag_d);
end
$display("Closing file, t = %0t", $time);
$fclose(fd);
end
// aclk.
always begin
aclk <= 0;
#5;
aclk <= 1;
#5;
end
endmodule
|
begin_version
3.POND
end_version
begin_metric
0
end_metric
63
begin_variable
var0
-1
2
Atom door-open(door0)
NegatedAtom door-open(door0)
end_variable
begin_variable
var1
-1
2
Atom door-open(door1)
NegatedAtom door-open(door1)
end_variable
begin_variable
var2
-1
8
Atom grasped(cup0, left_arm)
Atom grasped(cup1, left_arm)
Atom grasped(cup2, left_arm)
Atom grasped(cup3, left_arm)
Atom grasped(cup4, left_arm)
Atom grasped(cup5, left_arm)
Atom grasped(cup6, left_arm)
Atom hand-free(left_arm)
end_variable
begin_variable
var3
-1
9
Atom grasped(cup0, right_arm)
Atom grasped(cup1, right_arm)
Atom grasped(cup2, right_arm)
Atom grasped(cup3, right_arm)
Atom grasped(cup4, right_arm)
Atom grasped(cup5, right_arm)
Atom grasped(cup6, right_arm)
Atom grasped-sponge(right_arm)
Atom hand-free(right_arm)
end_variable
begin_variable
var4
-1
2
Atom on(cup0, table0)
NegatedAtom on(cup0, table0)
end_variable
begin_variable
var5
-1
2
Atom on(cup0, table1)
NegatedAtom on(cup0, table1)
end_variable
begin_variable
var6
-1
2
Atom on(cup0, table2)
NegatedAtom on(cup0, table2)
end_variable
begin_variable
var7
-1
2
Atom on(cup0, table3)
NegatedAtom on(cup0, table3)
end_variable
begin_variable
var8
-1
2
Atom on(cup1, table0)
NegatedAtom on(cup1, table0)
end_variable
begin_variable
var9
-1
2
Atom on(cup1, table1)
NegatedAtom on(cup1, table1)
end_variable
begin_variable
var10
-1
2
Atom on(cup1, table2)
NegatedAtom on(cup1, table2)
end_variable
begin_variable
var11
-1
2
Atom on(cup1, table3)
NegatedAtom on(cup1, table3)
end_variable
begin_variable
var12
-1
2
Atom on(cup2, table0)
NegatedAtom on(cup2, table0)
end_variable
begin_variable
var13
-1
2
Atom on(cup2, table1)
NegatedAtom on(cup2, table1)
end_variable
begin_variable
var14
-1
2
Atom on(cup2, table2)
NegatedAtom on(cup2, table2)
end_variable
begin_variable
var15
-1
2
Atom on(cup2, table3)
NegatedAtom on(cup2, table3)
end_variable
begin_variable
var16
-1
2
Atom on(cup3, table0)
NegatedAtom on(cup3, table0)
end_variable
begin_variable
var17
-1
2
Atom on(cup3, table1)
NegatedAtom on(cup3, table1)
end_variable
begin_variable
var18
-1
2
Atom on(cup3, table2)
NegatedAtom on(cup3, table2)
end_variable
begin_variable
var19
-1
2
Atom on(cup3, table3)
NegatedAtom on(cup3, table3)
end_variable
begin_variable
var20
-1
2
Atom on(cup4, table0)
NegatedAtom on(cup4, table0)
end_variable
begin_variable
var21
-1
2
Atom on(cup4, table1)
NegatedAtom on(cup4, table1)
end_variable
begin_variable
var22
-1
2
Atom on(cup4, table2)
NegatedAtom on(cup4, table2)
end_variable
begin_variable
var23
-1
2
Atom on(cup4, table3)
NegatedAtom on(cup4, table3)
end_variable
begin_variable
var24
-1
2
Atom on(cup5, table0)
NegatedAtom on(cup5, table0)
end_variable
begin_variable
var25
-1
2
Atom on(cup5, table1)
NegatedAtom on(cup5, table1)
end_variable
begin_variable
var26
-1
2
Atom on(cup5, table2)
NegatedAtom on(cup5, table2)
end_variable
begin_variable
var27
-1
2
Atom on(cup5, table3)
NegatedAtom on(cup5, table3)
end_variable
begin_variable
var28
-1
2
Atom on(cup6, table0)
NegatedAtom on(cup6, table0)
end_variable
begin_variable
var29
-1
2
Atom on(cup6, table1)
NegatedAtom on(cup6, table1)
end_variable
begin_variable
var30
-1
2
Atom on(cup6, table2)
NegatedAtom on(cup6, table2)
end_variable
begin_variable
var31
-1
2
Atom on(cup6, table3)
NegatedAtom on(cup6, table3)
end_variable
begin_variable
var32
-1
3
Atom robot-in-room(room0)
Atom robot-in-room(room1)
Atom robot-in-room(room2)
end_variable
begin_variable
var33
-1
2
Atom wipe-point-on(wipe0, table0)
NegatedAtom wipe-point-on(wipe0, table0)
end_variable
begin_variable
var34
-1
2
Atom wipe-point-on(wipe0, table1)
NegatedAtom wipe-point-on(wipe0, table1)
end_variable
begin_variable
var35
-1
2
Atom wipe-point-on(wipe0, table2)
NegatedAtom wipe-point-on(wipe0, table2)
end_variable
begin_variable
var36
-1
2
Atom wipe-point-on(wipe0, table3)
NegatedAtom wipe-point-on(wipe0, table3)
end_variable
begin_variable
var37
-1
2
Atom wipe-point-on(wipe1, table0)
NegatedAtom wipe-point-on(wipe1, table0)
end_variable
begin_variable
var38
-1
2
Atom wipe-point-on(wipe1, table1)
NegatedAtom wipe-point-on(wipe1, table1)
end_variable
begin_variable
var39
-1
2
Atom wipe-point-on(wipe1, table2)
NegatedAtom wipe-point-on(wipe1, table2)
end_variable
begin_variable
var40
-1
2
Atom wipe-point-on(wipe1, table3)
NegatedAtom wipe-point-on(wipe1, table3)
end_variable
begin_variable
var41
-1
2
Atom wipe-point-on(wipe2, table0)
NegatedAtom wipe-point-on(wipe2, table0)
end_variable
begin_variable
var42
-1
2
Atom wipe-point-on(wipe2, table1)
NegatedAtom wipe-point-on(wipe2, table1)
end_variable
begin_variable
var43
-1
2
Atom wipe-point-on(wipe2, table2)
NegatedAtom wipe-point-on(wipe2, table2)
end_variable
begin_variable
var44
-1
2
Atom wipe-point-on(wipe2, table3)
NegatedAtom wipe-point-on(wipe2, table3)
end_variable
begin_variable
var45
-1
2
Atom wipe-point-on(wipe3, table0)
NegatedAtom wipe-point-on(wipe3, table0)
end_variable
begin_variable
var46
-1
2
Atom wipe-point-on(wipe3, table1)
NegatedAtom wipe-point-on(wipe3, table1)
end_variable
begin_variable
var47
-1
2
Atom wipe-point-on(wipe3, table2)
NegatedAtom wipe-point-on(wipe3, table2)
end_variable
begin_variable
var48
-1
2
Atom wipe-point-on(wipe3, table3)
NegatedAtom wipe-point-on(wipe3, table3)
end_variable
begin_variable
var49
-1
2
Atom wipe-point-on(wipe4, table0)
NegatedAtom wipe-point-on(wipe4, table0)
end_variable
begin_variable
var50
-1
2
Atom wipe-point-on(wipe4, table1)
NegatedAtom wipe-point-on(wipe4, table1)
end_variable
begin_variable
var51
-1
2
Atom wipe-point-on(wipe4, table2)
NegatedAtom wipe-point-on(wipe4, table2)
end_variable
begin_variable
var52
-1
2
Atom wipe-point-on(wipe4, table3)
NegatedAtom wipe-point-on(wipe4, table3)
end_variable
begin_variable
var53
-1
2
Atom wipe-point-on(wipe5, table0)
NegatedAtom wipe-point-on(wipe5, table0)
end_variable
begin_variable
var54
-1
2
Atom wipe-point-on(wipe5, table1)
NegatedAtom wipe-point-on(wipe5, table1)
end_variable
begin_variable
var55
-1
2
Atom wipe-point-on(wipe5, table2)
NegatedAtom wipe-point-on(wipe5, table2)
end_variable
begin_variable
var56
-1
2
Atom wipe-point-on(wipe5, table3)
NegatedAtom wipe-point-on(wipe5, table3)
end_variable
begin_variable
var57
-1
2
Atom wiped(wipe0)
NegatedAtom wiped(wipe0)
end_variable
begin_variable
var58
-1
2
Atom wiped(wipe1)
NegatedAtom wiped(wipe1)
end_variable
begin_variable
var59
-1
2
Atom wiped(wipe2)
NegatedAtom wiped(wipe2)
end_variable
begin_variable
var60
-1
2
Atom wiped(wipe3)
NegatedAtom wiped(wipe3)
end_variable
begin_variable
var61
-1
2
Atom wiped(wipe4)
NegatedAtom wiped(wipe4)
end_variable
begin_variable
var62
-1
2
Atom wiped(wipe5)
NegatedAtom wiped(wipe5)
end_variable
3
begin_mutex_group
8
2 0
2 1
2 2
2 3
2 4
2 5
2 6
2 7
end_mutex_group
begin_mutex_group
9
3 0
3 1
3 2
3 3
3 4
3 5
3 6
3 7
3 8
end_mutex_group
begin_mutex_group
3
32 0
32 1
32 2
end_mutex_group
begin_state
11
2 7
3 8
32 2
0 1
1 1
57 1
58 1
59 1
60 1
61 1
62 1
13
8 0 9 0 10 0 11 0
12 0 13 0 14 0 15 0
28 0 29 0 30 0 31 0
4 0 5 0 6 0 7 0
24 0 25 0 26 0 27 0
16 0 17 0 18 0 19 0
20 0 21 0 22 0 23 0
33 0 34 0 35 0 36 0
53 0 54 0 55 0 56 0
37 0 38 0 39 0 40 0
49 0 50 0 51 0 52 0
41 0 42 0 43 0 44 0
45 0 46 0 47 0 48 0
0
end_state
begin_goal
13
4 0
8 0
12 0
16 0
20 0
24 0
28 0
57 0
58 0
59 0
60 0
61 0
62 0
end_goal
183
begin_operator
detect-arm left_arm
0
1
0
0
8
2 7
2 1
2 2
2 6
2 0
2 5
2 3
2 4
end_operator
begin_operator
detect-arm right_arm
0
1
0
0
9
3 7
3 8
3 1
3 2
3 6
3 0
3 5
3 3
3 4
end_operator
begin_operator
detect-door-state room0 door1
1
32 0
1
0
0
1
1 0
end_operator
begin_operator
detect-door-state room1 door0
1
32 1
1
0
0
1
0 0
end_operator
begin_operator
detect-door-state room2 door0
1
32 2
1
0
0
1
0 0
end_operator
begin_operator
detect-door-state room2 door1
1
32 2
1
0
0
1
1 0
end_operator
begin_operator
detect-objects room0 table0
1
32 0
1
0
0
13
8 0
12 0
28 0
4 0
24 0
16 0
20 0
33 0
53 0
37 0
49 0
41 0
45 0
end_operator
begin_operator
detect-objects room0 table2
1
32 0
1
0
0
13
10 0
14 0
30 0
6 0
26 0
18 0
22 0
35 0
55 0
39 0
51 0
43 0
47 0
end_operator
begin_operator
detect-objects room1 table3
1
32 1
1
0
0
13
11 0
15 0
31 0
7 0
27 0
19 0
23 0
36 0
56 0
40 0
52 0
44 0
48 0
end_operator
begin_operator
detect-objects room2 table1
1
32 2
1
0
0
13
9 0
13 0
29 0
5 0
25 0
17 0
21 0
34 0
54 0
38 0
50 0
42 0
46 0
end_operator
begin_operator
detect-room room0
0
1
0
0
1
32 0
end_operator
begin_operator
detect-room room1
0
1
0
0
1
32 1
end_operator
begin_operator
detect-room room2
0
1
0
0
1
32 2
end_operator
begin_operator
detect-wiped room0 table0 wipe0
2
32 0
33 0
1
0
0
1
57 0
end_operator
begin_operator
detect-wiped room0 table0 wipe1
2
32 0
37 0
1
0
0
1
58 0
end_operator
begin_operator
detect-wiped room0 table0 wipe2
2
32 0
41 0
1
0
0
1
59 0
end_operator
begin_operator
detect-wiped room0 table0 wipe3
2
32 0
45 0
1
0
0
1
60 0
end_operator
begin_operator
detect-wiped room0 table0 wipe4
2
32 0
49 0
1
0
0
1
61 0
end_operator
begin_operator
detect-wiped room0 table0 wipe5
2
32 0
53 0
1
0
0
1
62 0
end_operator
begin_operator
detect-wiped room0 table2 wipe0
2
32 0
35 0
1
0
0
1
57 0
end_operator
begin_operator
detect-wiped room0 table2 wipe1
2
32 0
39 0
1
0
0
1
58 0
end_operator
begin_operator
detect-wiped room0 table2 wipe2
2
32 0
43 0
1
0
0
1
59 0
end_operator
begin_operator
detect-wiped room0 table2 wipe3
2
32 0
47 0
1
0
0
1
60 0
end_operator
begin_operator
detect-wiped room0 table2 wipe4
2
32 0
51 0
1
0
0
1
61 0
end_operator
begin_operator
detect-wiped room0 table2 wipe5
2
32 0
55 0
1
0
0
1
62 0
end_operator
begin_operator
detect-wiped room1 table3 wipe0
2
32 1
36 0
1
0
0
1
57 0
end_operator
begin_operator
detect-wiped room1 table3 wipe1
2
32 1
40 0
1
0
0
1
58 0
end_operator
begin_operator
detect-wiped room1 table3 wipe2
2
32 1
44 0
1
0
0
1
59 0
end_operator
begin_operator
detect-wiped room1 table3 wipe3
2
32 1
48 0
1
0
0
1
60 0
end_operator
begin_operator
detect-wiped room1 table3 wipe4
2
32 1
52 0
1
0
0
1
61 0
end_operator
begin_operator
detect-wiped room1 table3 wipe5
2
32 1
56 0
1
0
0
1
62 0
end_operator
begin_operator
detect-wiped room2 table1 wipe0
2
32 2
34 0
1
0
0
1
57 0
end_operator
begin_operator
detect-wiped room2 table1 wipe1
2
32 2
38 0
1
0
0
1
58 0
end_operator
begin_operator
detect-wiped room2 table1 wipe2
2
32 2
42 0
1
0
0
1
59 0
end_operator
begin_operator
detect-wiped room2 table1 wipe3
2
32 2
46 0
1
0
0
1
60 0
end_operator
begin_operator
detect-wiped room2 table1 wipe4
2
32 2
50 0
1
0
0
1
61 0
end_operator
begin_operator
detect-wiped room2 table1 wipe5
2
32 2
54 0
1
0
0
1
62 0
end_operator
begin_operator
drive-through-door door0 room1 room2
2
0 0
32 1
2
0
1
0 32 1 2
0
0
end_operator
begin_operator
drive-through-door door0 room2 room1
2
0 0
32 2
2
0
1
0 32 2 1
0
0
end_operator
begin_operator
drive-through-door door1 room0 room2
2
1 0
32 0
2
0
1
0 32 0 2
0
0
end_operator
begin_operator
drive-through-door door1 room2 room0
2
1 0
32 2
2
0
1
0 32 2 0
0
0
end_operator
begin_operator
open-door room0 door1 left_arm
3
1 1
2 7
32 0
2
0
1
0 1 1 0
0
0
end_operator
begin_operator
open-door room1 door0 left_arm
3
0 1
2 7
32 1
2
0
1
0 0 1 0
0
0
end_operator
begin_operator
open-door room2 door0 left_arm
3
0 1
2 7
32 2
2
0
1
0 0 1 0
0
0
end_operator
begin_operator
open-door room2 door1 left_arm
3
1 1
2 7
32 2
2
0
1
0 1 1 0
0
0
end_operator
begin_operator
pickup-object room0 cup0 table0 left_arm
3
2 7
4 0
32 0
2
0
2
0 2 7 0
0 4 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup0 table0 right_arm
3
3 8
4 0
32 0
2
0
2
0 3 8 0
0 4 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup0 table2 left_arm
3
2 7
6 0
32 0
2
0
2
0 2 7 0
0 6 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup0 table2 right_arm
3
3 8
6 0
32 0
2
0
2
0 3 8 0
0 6 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup1 table0 left_arm
3
2 7
8 0
32 0
2
0
2
0 2 7 1
0 8 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup1 table0 right_arm
3
3 8
8 0
32 0
2
0
2
0 3 8 1
0 8 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup1 table2 left_arm
3
2 7
10 0
32 0
2
0
2
0 2 7 1
0 10 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup1 table2 right_arm
3
3 8
10 0
32 0
2
0
2
0 3 8 1
0 10 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup2 table0 left_arm
3
2 7
12 0
32 0
2
0
2
0 2 7 2
0 12 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup2 table0 right_arm
3
3 8
12 0
32 0
2
0
2
0 3 8 2
0 12 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup2 table2 left_arm
3
2 7
14 0
32 0
2
0
2
0 2 7 2
0 14 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup2 table2 right_arm
3
3 8
14 0
32 0
2
0
2
0 3 8 2
0 14 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup3 table0 left_arm
3
2 7
16 0
32 0
2
0
2
0 2 7 3
0 16 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup3 table0 right_arm
3
3 8
16 0
32 0
2
0
2
0 3 8 3
0 16 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup3 table2 left_arm
3
2 7
18 0
32 0
2
0
2
0 2 7 3
0 18 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup3 table2 right_arm
3
3 8
18 0
32 0
2
0
2
0 3 8 3
0 18 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup4 table0 left_arm
3
2 7
20 0
32 0
2
0
2
0 2 7 4
0 20 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup4 table0 right_arm
3
3 8
20 0
32 0
2
0
2
0 3 8 4
0 20 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup4 table2 left_arm
3
2 7
22 0
32 0
2
0
2
0 2 7 4
0 22 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup4 table2 right_arm
3
3 8
22 0
32 0
2
0
2
0 3 8 4
0 22 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup5 table0 left_arm
3
2 7
24 0
32 0
2
0
2
0 2 7 5
0 24 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup5 table0 right_arm
3
3 8
24 0
32 0
2
0
2
0 3 8 5
0 24 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup5 table2 left_arm
3
2 7
26 0
32 0
2
0
2
0 2 7 5
0 26 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup5 table2 right_arm
3
3 8
26 0
32 0
2
0
2
0 3 8 5
0 26 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup6 table0 left_arm
3
2 7
28 0
32 0
2
0
2
0 2 7 6
0 28 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup6 table0 right_arm
3
3 8
28 0
32 0
2
0
2
0 3 8 6
0 28 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup6 table2 left_arm
3
2 7
30 0
32 0
2
0
2
0 2 7 6
0 30 0 1
0
0
end_operator
begin_operator
pickup-object room0 cup6 table2 right_arm
3
3 8
30 0
32 0
2
0
2
0 3 8 6
0 30 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup0 table3 left_arm
3
2 7
7 0
32 1
2
0
2
0 2 7 0
0 7 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup0 table3 right_arm
3
3 8
7 0
32 1
2
0
2
0 3 8 0
0 7 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup1 table3 left_arm
3
2 7
11 0
32 1
2
0
2
0 2 7 1
0 11 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup1 table3 right_arm
3
3 8
11 0
32 1
2
0
2
0 3 8 1
0 11 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup2 table3 left_arm
3
2 7
15 0
32 1
2
0
2
0 2 7 2
0 15 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup2 table3 right_arm
3
3 8
15 0
32 1
2
0
2
0 3 8 2
0 15 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup3 table3 left_arm
3
2 7
19 0
32 1
2
0
2
0 2 7 3
0 19 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup3 table3 right_arm
3
3 8
19 0
32 1
2
0
2
0 3 8 3
0 19 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup4 table3 left_arm
3
2 7
23 0
32 1
2
0
2
0 2 7 4
0 23 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup4 table3 right_arm
3
3 8
23 0
32 1
2
0
2
0 3 8 4
0 23 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup5 table3 left_arm
3
2 7
27 0
32 1
2
0
2
0 2 7 5
0 27 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup5 table3 right_arm
3
3 8
27 0
32 1
2
0
2
0 3 8 5
0 27 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup6 table3 left_arm
3
2 7
31 0
32 1
2
0
2
0 2 7 6
0 31 0 1
0
0
end_operator
begin_operator
pickup-object room1 cup6 table3 right_arm
3
3 8
31 0
32 1
2
0
2
0 3 8 6
0 31 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup0 table1 left_arm
3
2 7
5 0
32 2
2
0
2
0 2 7 0
0 5 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup0 table1 right_arm
3
3 8
5 0
32 2
2
0
2
0 3 8 0
0 5 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup1 table1 left_arm
3
2 7
9 0
32 2
2
0
2
0 2 7 1
0 9 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup1 table1 right_arm
3
3 8
9 0
32 2
2
0
2
0 3 8 1
0 9 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup2 table1 left_arm
3
2 7
13 0
32 2
2
0
2
0 2 7 2
0 13 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup2 table1 right_arm
3
3 8
13 0
32 2
2
0
2
0 3 8 2
0 13 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup3 table1 left_arm
3
2 7
17 0
32 2
2
0
2
0 2 7 3
0 17 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup3 table1 right_arm
3
3 8
17 0
32 2
2
0
2
0 3 8 3
0 17 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup4 table1 left_arm
3
2 7
21 0
32 2
2
0
2
0 2 7 4
0 21 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup4 table1 right_arm
3
3 8
21 0
32 2
2
0
2
0 3 8 4
0 21 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup5 table1 left_arm
3
2 7
25 0
32 2
2
0
2
0 2 7 5
0 25 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup5 table1 right_arm
3
3 8
25 0
32 2
2
0
2
0 3 8 5
0 25 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup6 table1 left_arm
3
2 7
29 0
32 2
2
0
2
0 2 7 6
0 29 0 1
0
0
end_operator
begin_operator
pickup-object room2 cup6 table1 right_arm
3
3 8
29 0
32 2
2
0
2
0 3 8 6
0 29 0 1
0
0
end_operator
begin_operator
pickup-sponge right_arm
1
3 8
2
0
1
0 3 8 7
0
0
end_operator
begin_operator
putdown-object room0 cup0 table0 left_arm
2
2 0
32 0
2
0
2
0 2 0 7
0 4 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup0 table0 right_arm
2
3 0
32 0
2
0
2
0 3 0 8
0 4 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup0 table2 left_arm
2
2 0
32 0
2
0
2
0 2 0 7
0 6 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup0 table2 right_arm
2
3 0
32 0
2
0
2
0 3 0 8
0 6 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup1 table0 left_arm
2
2 1
32 0
2
0
2
0 2 1 7
0 8 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup1 table0 right_arm
2
3 1
32 0
2
0
2
0 3 1 8
0 8 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup1 table2 left_arm
2
2 1
32 0
2
0
2
0 2 1 7
0 10 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup1 table2 right_arm
2
3 1
32 0
2
0
2
0 3 1 8
0 10 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup2 table0 left_arm
2
2 2
32 0
2
0
2
0 2 2 7
0 12 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup2 table0 right_arm
2
3 2
32 0
2
0
2
0 3 2 8
0 12 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup2 table2 left_arm
2
2 2
32 0
2
0
2
0 2 2 7
0 14 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup2 table2 right_arm
2
3 2
32 0
2
0
2
0 3 2 8
0 14 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup3 table0 left_arm
2
2 3
32 0
2
0
2
0 2 3 7
0 16 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup3 table0 right_arm
2
3 3
32 0
2
0
2
0 3 3 8
0 16 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup3 table2 left_arm
2
2 3
32 0
2
0
2
0 2 3 7
0 18 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup3 table2 right_arm
2
3 3
32 0
2
0
2
0 3 3 8
0 18 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup4 table0 left_arm
2
2 4
32 0
2
0
2
0 2 4 7
0 20 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup4 table0 right_arm
2
3 4
32 0
2
0
2
0 3 4 8
0 20 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup4 table2 left_arm
2
2 4
32 0
2
0
2
0 2 4 7
0 22 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup4 table2 right_arm
2
3 4
32 0
2
0
2
0 3 4 8
0 22 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup5 table0 left_arm
2
2 5
32 0
2
0
2
0 2 5 7
0 24 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup5 table0 right_arm
2
3 5
32 0
2
0
2
0 3 5 8
0 24 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup5 table2 left_arm
2
2 5
32 0
2
0
2
0 2 5 7
0 26 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup5 table2 right_arm
2
3 5
32 0
2
0
2
0 3 5 8
0 26 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup6 table0 left_arm
2
2 6
32 0
2
0
2
0 2 6 7
0 28 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup6 table0 right_arm
2
3 6
32 0
2
0
2
0 3 6 8
0 28 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup6 table2 left_arm
2
2 6
32 0
2
0
2
0 2 6 7
0 30 -1 0
0
0
end_operator
begin_operator
putdown-object room0 cup6 table2 right_arm
2
3 6
32 0
2
0
2
0 3 6 8
0 30 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup0 table3 left_arm
2
2 0
32 1
2
0
2
0 2 0 7
0 7 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup0 table3 right_arm
2
3 0
32 1
2
0
2
0 3 0 8
0 7 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup1 table3 left_arm
2
2 1
32 1
2
0
2
0 2 1 7
0 11 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup1 table3 right_arm
2
3 1
32 1
2
0
2
0 3 1 8
0 11 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup2 table3 left_arm
2
2 2
32 1
2
0
2
0 2 2 7
0 15 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup2 table3 right_arm
2
3 2
32 1
2
0
2
0 3 2 8
0 15 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup3 table3 left_arm
2
2 3
32 1
2
0
2
0 2 3 7
0 19 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup3 table3 right_arm
2
3 3
32 1
2
0
2
0 3 3 8
0 19 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup4 table3 left_arm
2
2 4
32 1
2
0
2
0 2 4 7
0 23 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup4 table3 right_arm
2
3 4
32 1
2
0
2
0 3 4 8
0 23 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup5 table3 left_arm
2
2 5
32 1
2
0
2
0 2 5 7
0 27 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup5 table3 right_arm
2
3 5
32 1
2
0
2
0 3 5 8
0 27 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup6 table3 left_arm
2
2 6
32 1
2
0
2
0 2 6 7
0 31 -1 0
0
0
end_operator
begin_operator
putdown-object room1 cup6 table3 right_arm
2
3 6
32 1
2
0
2
0 3 6 8
0 31 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup0 table1 left_arm
2
2 0
32 2
2
0
2
0 2 0 7
0 5 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup0 table1 right_arm
2
3 0
32 2
2
0
2
0 3 0 8
0 5 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup1 table1 left_arm
2
2 1
32 2
2
0
2
0 2 1 7
0 9 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup1 table1 right_arm
2
3 1
32 2
2
0
2
0 3 1 8
0 9 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup2 table1 left_arm
2
2 2
32 2
2
0
2
0 2 2 7
0 13 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup2 table1 right_arm
2
3 2
32 2
2
0
2
0 3 2 8
0 13 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup3 table1 left_arm
2
2 3
32 2
2
0
2
0 2 3 7
0 17 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup3 table1 right_arm
2
3 3
32 2
2
0
2
0 3 3 8
0 17 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup4 table1 left_arm
2
2 4
32 2
2
0
2
0 2 4 7
0 21 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup4 table1 right_arm
2
3 4
32 2
2
0
2
0 3 4 8
0 21 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup5 table1 left_arm
2
2 5
32 2
2
0
2
0 2 5 7
0 25 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup5 table1 right_arm
2
3 5
32 2
2
0
2
0 3 5 8
0 25 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup6 table1 left_arm
2
2 6
32 2
2
0
2
0 2 6 7
0 29 -1 0
0
0
end_operator
begin_operator
putdown-object room2 cup6 table1 right_arm
2
3 6
32 2
2
0
2
0 3 6 8
0 29 -1 0
0
0
end_operator
begin_operator
putdown-sponge right_arm
1
3 7
2
0
1
0 3 7 8
0
0
end_operator
begin_operator
wipe room0 wipe0 table0 right_arm
4
3 7
32 0
33 0
57 1
2
0
1
0 57 1 0
0
0
end_operator
begin_operator
wipe room0 wipe0 table2 right_arm
4
3 7
32 0
35 0
57 1
2
0
1
0 57 1 0
0
0
end_operator
begin_operator
wipe room0 wipe1 table0 right_arm
4
3 7
32 0
37 0
58 1
2
0
1
0 58 1 0
0
0
end_operator
begin_operator
wipe room0 wipe1 table2 right_arm
4
3 7
32 0
39 0
58 1
2
0
1
0 58 1 0
0
0
end_operator
begin_operator
wipe room0 wipe2 table0 right_arm
4
3 7
32 0
41 0
59 1
2
0
1
0 59 1 0
0
0
end_operator
begin_operator
wipe room0 wipe2 table2 right_arm
4
3 7
32 0
43 0
59 1
2
0
1
0 59 1 0
0
0
end_operator
begin_operator
wipe room0 wipe3 table0 right_arm
4
3 7
32 0
45 0
60 1
2
0
1
0 60 1 0
0
0
end_operator
begin_operator
wipe room0 wipe3 table2 right_arm
4
3 7
32 0
47 0
60 1
2
0
1
0 60 1 0
0
0
end_operator
begin_operator
wipe room0 wipe4 table0 right_arm
4
3 7
32 0
49 0
61 1
2
0
1
0 61 1 0
0
0
end_operator
begin_operator
wipe room0 wipe4 table2 right_arm
4
3 7
32 0
51 0
61 1
2
0
1
0 61 1 0
0
0
end_operator
begin_operator
wipe room0 wipe5 table0 right_arm
4
3 7
32 0
53 0
62 1
2
0
1
0 62 1 0
0
0
end_operator
begin_operator
wipe room0 wipe5 table2 right_arm
4
3 7
32 0
55 0
62 1
2
0
1
0 62 1 0
0
0
end_operator
begin_operator
wipe room1 wipe0 table3 right_arm
4
3 7
32 1
36 0
57 1
2
0
1
0 57 1 0
0
0
end_operator
begin_operator
wipe room1 wipe1 table3 right_arm
4
3 7
32 1
40 0
58 1
2
0
1
0 58 1 0
0
0
end_operator
begin_operator
wipe room1 wipe2 table3 right_arm
4
3 7
32 1
44 0
59 1
2
0
1
0 59 1 0
0
0
end_operator
begin_operator
wipe room1 wipe3 table3 right_arm
4
3 7
32 1
48 0
60 1
2
0
1
0 60 1 0
0
0
end_operator
begin_operator
wipe room1 wipe4 table3 right_arm
4
3 7
32 1
52 0
61 1
2
0
1
0 61 1 0
0
0
end_operator
begin_operator
wipe room1 wipe5 table3 right_arm
4
3 7
32 1
56 0
62 1
2
0
1
0 62 1 0
0
0
end_operator
begin_operator
wipe room2 wipe0 table1 right_arm
4
3 7
32 2
34 0
57 1
2
0
1
0 57 1 0
0
0
end_operator
begin_operator
wipe room2 wipe1 table1 right_arm
4
3 7
32 2
38 0
58 1
2
0
1
0 58 1 0
0
0
end_operator
begin_operator
wipe room2 wipe2 table1 right_arm
4
3 7
32 2
42 0
59 1
2
0
1
0 59 1 0
0
0
end_operator
begin_operator
wipe room2 wipe3 table1 right_arm
4
3 7
32 2
46 0
60 1
2
0
1
0 60 1 0
0
0
end_operator
begin_operator
wipe room2 wipe4 table1 right_arm
4
3 7
32 2
50 0
61 1
2
0
1
0 61 1 0
0
0
end_operator
begin_operator
wipe room2 wipe5 table1 right_arm
4
3 7
32 2
54 0
62 1
2
0
1
0 62 1 0
0
0
end_operator
0
|
#lang scribble/manual
@(require scribble/core scribble/examples "helper.rkt"
(for-label
(only-meta-in 0 typed/racket)
#;(only-in typed/racket define-type : U Listof require/typed)
))
@title[#:style 'unnumbered #:tag "lab26"]{Lab 26: Enforcing Data Definitions}
@(define-syntax-rule (bslblock . body)
(codeblock #:keep-lang-line? #f "#lang htdp/bsl" "\n" . body))
Implement this lab in
@link["https://docs.racket-lang.org/htdp-langs/intermediate-lam.html"]{typed
racket}.
@section[#:style 'unnumbered #:tag "lab26:tr"]{Getting Typed Racket Running}
In order to create a Typed Racket program, you will need change the
language. To do this, create a new program, open the Choose Language
menu item in DrRacket. Choose "The Racket Language". This will add
@tt{#lang racket} to the top of your file. Edit the line to be
@tt{#lang typed/racket}.
As mentioned in lecture, Typed Racket, unlike ISL+ and friends, does
not have a testing framework built-in. So we will be using the
@racketmodname[rackunit] library.
The following will import @racket[check-equal?], roughly analogous to
@racket[check-expect] from ISL+, from @racketmodname[rackunit]. We do this
in the context of a @tt{test} @emph{submodule}, which is the idiomatic way
of adding tests to Racket and Typed Racket programs:
@codeblock|{
#lang typed/racket
(module+ test
(require/typed rackunit
[check-equal? (Any Any -> Any)]))
}|
You can now write functions and tests like this:
@codeblock|{
(: sqr : (Number -> Number))
;; Square the given number.
(module+ test
(check-equal? (sqr 5) 25)
(check-equal? (sqr -5) 25))
(define (sqr x)
(* x x))
}|
Choose the initial @bold{Head} and @bold{Hands}, and get started!
@section[#:style 'unnumbered #:tag "lab26:repl"]{Typed Interactions}
Once you've switched the language to Typed Racket, try some expressions in the
@emph{interactions window}.
@(define-syntax-rule (trex . body)
(examples #:label #f #:eval (make-base-eval #:lang 'typed/racket/base)
. body))
@trex[0]
OK, so we've only tried @racket[0] so far, but there's a lot going on. Typed
Racket informs us of the type of every expression we type into the
@emph{interactions window}. For zero, it informs us that @racket[0] is an
@emph{Integer}, but more precisely has the type @emph{Zero}. It's useful to have
a very specific type for @emph{Zero}, so it can be used easily in other data
definitions.
@bold{Ex 1}: Do all numbers have their own type? Try out some other examples to
find out. You should find at least one number with another very specific
type.
@bold{Ex 2}: As detailed in the @secref{assign10} specification, the numbers
we've been using in class are very sophisticated compared to most programming
languages. What types do each of the numbers @racket[1], @racket[10],
@racket[100], @racket[1000], ... @racket[1000000000000] have? Find one number
for each of the types given in the image below:
@centered{@image[#:scale 0.5]{img/lab26-int-tower.png}}
Look at the
@link["https://docs.racket-lang.org/ts-reference/type-ref.html"]{Type
Reference} for more details about the distinctions between these types, if
you're interested. Most of the time we can use the type @emph{Real} in the same
way as we used the data definition @emph{Number} to date.
@bold{Ex 3}: Test other atomic values that you've used in the student languages;
write down what types Typed Racket ascribes to them in a comment.
@section[#:style 'unnumbered #:tag "lab26:fun"]{Function Types}
Now let's type some anonymous functions in the @emph{interactions window}.
@trex[(lambda (x) x)]
This looks right, given @emph{Any} value that function just returns that same
value. The @racket[->] @emph{type constructor} is how function types are
expressed. As with most expressions we've seen in this class, it is a prefix
operation. The last argument given to @racket[->] is the output and the rest of
the arguments are the inputs.
@bold{Ex 3}: Write down (in a comment) types for functions that:
@itemlist[
@item{accept a number and return a string,}
@item{accept two strings and return a number,}
@item{accept no arguments and return a @emph{Positive-Integer}.}
]
@trex[(eval:error (lambda (x) (if (zero? x) 1 (sub1 x))))]
Hmm, this was rejected. Let's see what the issue is:
@trex[zero?]
OK, the function @racket[zero?] only accepts values of type @emph{Number}. The
Type Checker claims that we gave it a value of type @emph{Any}. Because we gave
the argument @tt{x} no type, it could be anything! Without any ascribed type, an
anonymous function we write assumes its arguments can be of @emph{Any}
type. That would break the contract for @racket[=].
@bold{Ex 4}: Properly annotate the argument @tt{x} with a valid type to satisfy
the Type Checker. Look at the
@link["https://docs.racket-lang.org/ts-guide/types.html"]{Typed Racket guide} if
you are unsure of the proper syntax.
@bold{Ex 5}: Write down two examples of functions that are rejected by the Type
Checker. Did you find any functions that you'd like to be able to write that you
were unable to write?
@section[#:style 'unnumbered #:tag "lab26:complex"]{More Complex Types}
Whenever we've needed to hold onto more than one piece of data at once, we've
defined structures to do so. When we've needed a type that can describe more
than one kind of data, we used an enumeration data definition. For example, we
can make binary trees with numbers at the leaves:
@#reader scribble/comment-reader (racketblock
(define-struct leaf (val))
(define-struct node (left right))
;; A Tree is one of:
;; - (leaf Number)
;; - (node Tree Tree)
)
We can do the same in Typed Racket, but the data definition is defined as a
@emph{type}.
In Typed Racket, we write a similar implementation, but define a type rather
than write a data definition. Note that the implementation refers to the type,
and the type refers to the names of the structs that make up the
implementation.
@racketblock[
(struct leaf ([val : Number]))
(struct node ([left : Tree] [right : Tree]))
(define-type Tree (U leaf node))
]
The structures look very similar, but their fields have annotated types. The
type @emph{Tree} is defined as the @emph{union} of the @emph{leaf} and
@emph{node} types. That union is described by the @emph{type constructor}
@racket[U].
@bold{Ex 6}: Design the function @tt{tree-height} that given a @emph{Tree},
returns the height of that @emph{Tree}.
@bold{Ex 7}: Design the function @tt{tree-product} that given a @emph{Tree},
returns the product of all the leaves of that @emph{Tree}.
@bold{Ex 8}: Design a data type @emph{STree} for binary trees with strings at
the leaves. Design a function @tt{tree->stree} that maps
@racket[number->string] over a @emph{Tree}, returning an @emph{STree} of the
same form.
@bold{Ex 9}: It will be a pain to define a different @emph{*Tree} type for every
kind of value. Design a new parameteric type constructor @emph{Treeof} and new
structure definitions for leaves and values. The leaf structure must be able to
hold a value of any type. Refer to the @racket[struct] and @racket[define-type]
documentation to see how parameterized structures and types are defined.
@bold{Ex 10}: Design a more general @tt{tree-map} using your parameterized
tree from @bold{Ex 9}.
@bold{Ex 11}: Implement a function @tt{ntree->stree} that maps a @tt{[Treeof
@emph{Number}]} to a @tt{[Treeof @emph{String}]} using @tt{tree-map}.
|
module Language.LSP.Message.Cancel
import Language.JSON
import Language.LSP.Message.Derive
import Language.LSP.Message.Utils
import Language.Reflection
%language ElabReflection
%default total
||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#cancelRequest
public export
record CancelParams where
constructor MkCancelParams
id : Int .+. String
%runElab deriveJSON defaultOpts `{{CancelParams}}
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xc09d, %rbx
clflush (%rbx)
nop
nop
nop
nop
nop
xor %r14, %r14
movb (%rbx), %r13b
nop
nop
nop
and $27859, %rcx
lea addresses_normal_ht+0x18d9d, %rsi
lea addresses_UC_ht+0x1981d, %rdi
nop
nop
nop
nop
sub %rbp, %rbp
mov $72, %rcx
rep movsb
add %rdi, %rdi
lea addresses_A_ht+0x18d9d, %rbp
nop
nop
nop
nop
add %r14, %r14
mov (%rbp), %di
nop
xor $43504, %r14
lea addresses_normal_ht+0x1075d, %rdi
nop
sub $18145, %rcx
mov (%rdi), %rbp
nop
nop
dec %rbx
lea addresses_WT_ht+0xd59d, %rsi
lea addresses_A_ht+0x1becd, %rdi
nop
inc %r8
mov $22, %rcx
rep movsq
nop
nop
nop
cmp %rbp, %rbp
lea addresses_A_ht+0x1dafd, %rsi
lea addresses_D_ht+0x1db9d, %rdi
nop
nop
sub $28029, %rbx
mov $1, %rcx
rep movsb
inc %rsi
lea addresses_WC_ht+0x459d, %rsi
lea addresses_WC_ht+0x1086d, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
nop
xor %r13, %r13
mov $123, %rcx
rep movsw
xor $33967, %rsi
lea addresses_UC_ht+0x639d, %rsi
clflush (%rsi)
nop
nop
nop
nop
cmp %r13, %r13
movl $0x61626364, (%rsi)
nop
xor %rcx, %rcx
lea addresses_normal_ht+0x2e1d, %rbp
add %rdi, %rdi
movl $0x61626364, (%rbp)
nop
nop
sub %rdi, %rdi
lea addresses_WC_ht+0x13d1d, %r14
nop
nop
nop
nop
nop
add %r13, %r13
mov (%r14), %ebp
nop
nop
lfence
lea addresses_WT_ht+0x2b12, %rsi
lea addresses_WC_ht+0xcd9d, %rdi
nop
nop
nop
add $11348, %r8
mov $81, %rcx
rep movsl
nop
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_UC_ht+0xb66d, %rsi
lea addresses_WC_ht+0x1085d, %rdi
inc %rbx
mov $104, %rcx
rep movsb
nop
nop
and %r8, %r8
lea addresses_WT_ht+0x5d9d, %r14
cmp $57839, %rdi
movb (%r14), %cl
nop
nop
nop
nop
xor %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r8
push %rax
push %rdi
push %rdx
push %rsi
// Store
lea addresses_normal+0x5d9d, %r10
sub %r11, %r11
mov $0x5152535455565758, %rsi
movq %rsi, %xmm7
movups %xmm7, (%r10)
nop
xor %r11, %r11
// Faulty Load
lea addresses_normal+0x5d9d, %rdi
nop
nop
nop
nop
and $58454, %r8
vmovups (%rdi), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %r11
lea oracles, %rdi
and $0xff, %r11
shlq $12, %r11
mov (%rdi,%r11,1), %r11
pop %rsi
pop %rdx
pop %rdi
pop %rax
pop %r8
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}}
{'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 5}, 'OP': 'LOAD'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Intl\Exception;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class ResourceBundleNotFoundException extends RuntimeException
{
}
|
defmodule IcdCode.ICDCode.Codes_K30 do
alias IcdCode.ICDCode
def _K30 do
%ICDCode{full_code: "K30",
category_code: "K30",
short_code: "",
full_name: "Functional dyspepsia",
short_name: "Functional dyspepsia",
category_name: "Functional dyspepsia"
}
end
end
|
(**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the "hack" directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*)
let go query oc =
let results = SearchService.MasterApi.query query in
Marshal.to_channel oc results [];
flush oc
|
% !TEX encoding = UTF-8 Unicode
% -*- coding: UTF-8; -*-
% vim: set fenc=utf-8
\ProvidesPackage{preamble}
% correct russian settings
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage[T2A]{fontenc}
\usepackage{cmap}
\DeclareUnicodeCharacter{0306}{-}
% page settings
\pdfcompresslevel=9
%\usepackage[left=30mm,right=10mm,top=20mm,bottom=20mm,bindingoffset=0cm]{geometry}
% color and linkable reference
\usepackage{xcolor}
\usepackage{hyperref}
\definecolor{linkcolor}{HTML}{000000}
\definecolor{urlcolor}{HTML}{000000}
% pdf settings
\hypersetup{pdfstartview=FitH, linkcolor=linkcolor, urlcolor=urlcolor, colorlinks=true}
% image settings
\PassOptionsToPackage{pdftex}{graphicx}
\graphicspath{{images/}}
\addto\captionsrussian{\renewcommand{\figurename}{Рисунок}}
% captions settings
\usepackage[labelsep=endash,nooneline]{caption}
\captionsetup{figurewithin=section}
\captionsetup[table]{justification=raggedright}
\captionsetup[figure]{justification=centering}
% line spacing settings
%\usepackage[onehalfspacing]{setspace}
% paragraph indent settings
%\usepackage{indentfirst}
%\setlength{\parindent}{15mm}
% section title settings
%\usepackage[explicit]{titlesec}
\usepackage{textcase}
%\titleformat{\section}[block]{\centering}{\thesection}{1em}{#1\\}
%\titleformat{\subsection}[block]{\centering}{\thesubsection}{1em}{#1\\}
%\usepackage{titlesec}
%\titlespacing{\section}{0pt}{*0}{*0}
%\titlespacing{\subsection}{0pt}{*0}{*0}
%\titlespacing{\subsubsection}{0pt}{*0}{*0}
% math settings
\usepackage{mathtools}
\numberwithin{equation}{section}
% table settings
\numberwithin{table}{section}
% plot settings
%\usepackage{gnuplottex}
% lists settings
%\usepackage{enumitem}
%\setlist{nolistsep, itemsep=0pt,parsep=0pt,leftmargin=0cm}
%\setlist[itemize]{itemindent=2cm}
\usepackage{listings}
%\setlist[enumerate]{itemindent=2cm}
% headers and page numbering settings
%\usepackage{fancyhdr}
%\pagestyle{fancy}
%\fancyhf{}
%\fancyhead[C]{\thepage}
%\fancyheadoffset{30mm}
%\fancyfootoffset{0mm}
%\setlength{\headheight}{0pt}
%\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\footrulewidth}{0pt}
%\fancypagestyle{plain}{
% \fancyhf{}
% \rhead{\thepage}
%}
%\renewcommand{\labelitemi}{$-$}
%\renewcommand*{\l@section}{\@dottedtocline{1}{1.5em}{2.3em}}
%\renewcommand*{\l@subsection}{\@dottedtocline{1}{1.5em}{2.3em}}
%\usepackage{tocloft}
%\renewcommand{\bfseries}{\relax}
%\usepackage{tocloft}
%\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
%\renewcommand{\cfttoctitlefont}{\normalfont\bfseries\hfil}
%\setlength{\cftbeforesecskip}{1pt}
%cyrillic listings settings
\lstset{
literate={а}{{\selectfont\char224}}1
{б}{{\selectfont\char225}}1
{в}{{\selectfont\char226}}1
{г}{{\selectfont\char227}}1
{д}{{\selectfont\char228}}1
{е}{{\selectfont\char229}}1
{ё}{{\"e}}1
{ж}{{\selectfont\char230}}1
{з}{{\selectfont\char231}}1
{и}{{\selectfont\char232}}1
{й}{{\selectfont\char233}}1
{к}{{\selectfont\char234}}1
{л}{{\selectfont\char235}}1
{м}{{\selectfont\char236}}1
{н}{{\selectfont\char237}}1
{о}{{\selectfont\char238}}1
{п}{{\selectfont\char239}}1
{р}{{\selectfont\char240}}1
{с}{{\selectfont\char241}}1
{т}{{\selectfont\char242}}1
{у}{{\selectfont\char243}}1
{ф}{{\selectfont\char244}}1
{х}{{\selectfont\char245}}1
{ц}{{\selectfont\char246}}1
{ч}{{\selectfont\char247}}1
{ш}{{\selectfont\char248}}1
{щ}{{\selectfont\char249}}1
{ъ}{{\selectfont\char250}}1
{ы}{{\selectfont\char251}}1
{ь}{{\selectfont\char252}}1
{э}{{\selectfont\char253}}1
{ю}{{\selectfont\char254}}1
{я}{{\selectfont\char255}}1
{А}{{\selectfont\char192}}1
{Б}{{\selectfont\char193}}1
{В}{{\selectfont\char194}}1
{Г}{{\selectfont\char195}}1
{Д}{{\selectfont\char196}}1
{Е}{{\selectfont\char197}}1
{Ё}{{\"E}}1
{Ж}{{\selectfont\char198}}1
{З}{{\selectfont\char199}}1
{И}{{\selectfont\char200}}1
{Й}{{\selectfont\char201}}1
{К}{{\selectfont\char202}}1
{Л}{{\selectfont\char203}}1
{М}{{\selectfont\char204}}1
{Н}{{\selectfont\char205}}1
{О}{{\selectfont\char206}}1
{П}{{\selectfont\char207}}1
{Р}{{\selectfont\char208}}1
{С}{{\selectfont\char209}}1
{Т}{{\selectfont\char210}}1
{У}{{\selectfont\char211}}1
{Ф}{{\selectfont\char212}}1
{Х}{{\selectfont\char213}}1
{Ц}{{\selectfont\char214}}1
{Ч}{{\selectfont\char215}}1
{Ш}{{\selectfont\char216}}1
{Щ}{{\selectfont\char217}}1
{Ъ}{{\selectfont\char218}}1
{Ы}{{\selectfont\char219}}1
{Ь}{{\selectfont\char220}}1
{Э}{{\selectfont\char221}}1
{Ю}{{\selectfont\char222}}1
{Я}{{\selectfont\char223}}1
}
\usepackage[enable-survey]{pdfpages}
%\usepackage[final]{pdfpages}
\usepackage{pdfpages} |
/*
Message Types
Author: Hyoukjun Kwon(hyoukjun@gatech.edu)
*/
/********** Native Libraries ************/
import Vector::*;
/******** User-Defined Libraries *********/
import Types::*;
import VirtualChannelTypes::*;
import RoutingTypes::*;
/************* Definitions **************/
//1. Sub-definitions for Flit class
//Message class and Flit types
typedef enum {Data, Control} MsgType deriving(Bits, Eq);
typedef enum {Head, Body, Tail, HeadTail} FlitType deriving(Bits, Eq);
//Statistic information for tests
typedef struct {
// Data flitId;
Data hopCount;
MeshWIdx srcX;
MeshHIdx srcY;
MeshWIdx dstX;
MeshHIdx dstY;
Data injectedCycle;
Data inflightCycle;
} FlitStatistics deriving(Bits, Eq);
`ifdef SOURCE_ROUTING
typedef SourceRoutingInfo RouteInfo;
`else
typedef LookAheadRouteInfo RouteInfo;
`endif
typedef Vector#(NumPorts, Maybe#(RouteInfo)) RouteInfoBundle;
typedef Data FlitData;
typedef struct {
VCIdx vc;
RouteInfo routeInfo;
} Header deriving (Bits, Eq);
//2. Main definition
// Flit Type
typedef struct {
MsgType msgType;
VCIdx vc;
FlitType flitType; //Head, Body, Tail, HeadTail
RouteInfo routeInfo;
FlitData flitData;
// This 'stat' should be discarded in the generated verilog unless needed for Performance Counter.
// `ifdef DETAILED_STATISTICS
FlitStatistics stat;
// `endif
} Flit deriving (Bits, Eq);
/* Bundles */
typedef Vector#(NumPorts, Maybe#(Header)) HeaderBundle;
typedef Vector#(NumPorts, Maybe#(FlitType)) FlitTypeBundle;
typedef Vector#(NumPorts, Maybe#(Flit)) FlitBundle;
function Bool isHead(Flit flit);
return (flit.flitType == Head || flit.flitType == HeadTail);
endfunction
function Bool isTail(Flit flit);
return (flit.flitType == Tail || flit.flitType == HeadTail);
endfunction
function Bool isValidFlitBundle (FlitBundle fb, DirIdx idx);
return isValid(fb[idx]);
endfunction
function Flit fb_getFlit(FlitBundle fb, Integer idx);
return validValue(fb[idx]);
endfunction
function Direction getFlitDirection(Flit flit);
`ifdef SOURCE_ROUTING
return idx2Dir(flit.routeInfo[0]);
`else
return flit.routeInfo.nextDir;
`endif
endfunction
|
; A142090: Primes congruent to 22 mod 35.
; Submitted by Jon Maiga
; 127,197,337,547,617,757,827,967,1597,1667,1877,2017,2087,2297,2437,2647,2857,2927,3067,3137,3347,3557,3697,3767,3907,4327,4397,4817,4957,5167,5237,5657,5867,6007,6217,6287,6427,6637,6917,7057,7127,7477,7547,7687,7757,8317,8387,8527,8597,8737,8807,9157,9227,9437,9787,9857,10067,10487,10627,10837,11047,11117,11257,11467,11677,11887,12097,12377,12517,13007,13147,13217,13567,14057,14197,14407,14827,14897,15107,15527,15667,15737,15877,16087,16787,16927,17137,17207,17417,17627,17837,17977,18047,18257
mov $2,$0
add $2,6
pow $2,2
mov $4,21
lpb $2
mov $3,$4
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,35
lpe
mov $0,$4
add $0,1
|
// "Add empty primary constructor" "true"
// ERROR: 'Parcelable' should have a primary constructor
// WITH_RUNTIME
package com.myapp.activity
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
@Parcelize
class <caret>Test : Parcelable {
constructor(a: Int)
} |
part of three;
/**
* @author mr.doob / http://mrdoob.com/
*
* Ported to Dart from JS by:
* @author rob silverton / http://www.unwrong.com/
*/
class RenderableParticle implements IRenderable {
num x = null;
num y = null;
num z = null;
num rotation = null;
Vector2 scale;
Material material = null;
RenderableParticle()
: scale = new Vector2.zero();
}
|
attribute vec3 position;
attribute vec2 texCoord;
attribute vec3 normal;
attribute vec3 tangent;
varying vec2 texCoord0;
varying vec3 worldPos0;
varying mat3 tbnMatrix;
uniform mat4 T_model;
uniform mat4 T_MVP;
void main() {
gl_Position = T_MVP * vec4(position, 1.0);
texCoord0 = texCoord;
worldPos0 = (T_model * vec4(position, 1.0)).xyz;
vec3 n = normalize((T_model * vec4(normal, 0.0)).xyz);
vec3 t = normalize((T_model * vec4(tangent, 0.0)).xyz);
t = normalize(t - dot(t, n) * n);
vec3 biTangent = cross(t, n);
tbnMatrix = mat3(t, biTangent, n);
} |
; A062988: a(n) = binomial(n+6,5) - 1.
; 5,20,55,125,251,461,791,1286,2001,3002,4367,6187,8567,11627,15503,20348,26333,33648,42503,53129,65779,80729,98279,118754,142505,169910,201375,237335,278255,324631,376991,435896,501941,575756,658007,749397,850667,962597,1086007,1221758,1370753,1533938,1712303,1906883,2118759,2349059,2598959,2869684,3162509,3478760,3819815,4187105,4582115,5006385,5461511,5949146,6471001,7028846,7624511,8259887,8936927,9657647,10424127,11238512,12103013,13019908,13991543,15020333,16108763,17259389,18474839,19757814,21111089,22537514,24040015,25621595,27285335,29034395,30872015,32801516,34826301,36949856,39175751,41507641,43949267,46504457,49177127,51971282,54891017,57940518,61124063,64446023,67910863,71523143,75287519,79208744,83291669,87541244,91962519,96560645,101340875,106308565,111469175,116828270,122391521,128164706,134153711,140364531,146803271,153476147,160389487,167549732,174963437,182637272,190578023,198792593,207288003,216071393,225150023,234531274,244222649,254231774,264566399,275234399,286243775,297602655,309319295,321402080,333859525,346700276,359933111,373566941,387610811,402073901,416965527,432295142,448072337,464306842,481008527,498187403,515853623,534017483,552689423,571880028,591600029,611860304,632671879,654045929,675993779,698526905,721656935,745395650,769754985,794747030,820384031,846678391,873642671,901289591,929632031,958683032,988455797,1018963692,1050220247,1082239157,1115034283,1148619653,1183009463,1218218078,1254260033,1291150034,1328902959,1367533859,1407057959,1447490659,1488847535,1531144340,1574397005,1618621640,1663834535,1710052161,1757291171,1805568401,1854900871,1905305786,1956800537,2009402702,2063130047,2118000527,2174032287,2231243663,2289653183,2349279568,2410141733,2472258788,2535650039,2600334989,2666333339,2733664989,2802350039,2872408790,2943861745,3016729610,3091033295,3166793915,3244032791,3322771451,3403031631,3484835276,3568204541,3653161792,3739729607,3827930777,3917788307,4009325417,4102565543,4197532338,4294249673,4392741638,4493032543,4595146919,4699109519,4804945319,4912679519,5022337544,5133945045,5247527900,5363112215,5480724325,5600390795,5722138421,5845994231,5971985486,6100139681,6230484546,6363048047,6497858387,6634944007,6774333587,6916056047,7060140548,7206616493,7355513528,7506861543,7660690673,7817031299,7975914049,8137369799,8301429674,8468125049,8637487550
add $0,6
bin $0,5
mov $1,$0
sub $1,1
|
package com.projector.timerecords.repository
enum class TimeRecordDocument(val key: String) {
ID("id"),
BOARD_ID("board_id"),
DURATION("duration"),
ITEM_ID("task_id"),
RUNNING("running"),
STARTED_AT("started_at"),
ENDED_AT("ended_at"),
TASK_ID("task_id"),
USER_ID("user_id"),
TIMERECORD_DATE("timerecord_date")
} |
package Xero::Class::Journal;
use Moo;
use MooX::ClassAttribute;
with 'Xero::Model::Journal';
class_has 'xml_root' => ( is => 'ro', default => sub { 'Journal' });
class_has 'primary_key => ( is => 'ro', default => sub { 'JournalID' });
1; |
<%@ page contentType="text/html;charset=iso-8859-1" language="java" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ taglib uri="/WEB-INF/eprot.tld" prefix="eprot" %>
<html:xhtml />
<eprot:page title="Gestione documentale">
<html:form action="/page/documentale/documento.do">
<jsp:include page="/WEB-INF/subpages/documentale/common/pathSenzaLink.jsp" />
<div id="messaggi">
<jsp:include page="/WEB-INF/subpages/documentale/common/messaggi.jsp" />
</div>
<div id="protocollo-errori">
<jsp:include page="/WEB-INF/subpages/documentale/common/errori.jsp" />
</div>
<br class="hidden" />
<jsp:include page="/WEB-INF/subpages/documentale/datiDocumentoView.jsp" />
<div class="sezione">
<span class="title"><strong><bean:message key="documentale.titolario"/></strong></span>
<jsp:include page="/WEB-INF/subpages/documentale/titolario.jsp" />
</div>
<logic:equal name="documentoForm" property="statoArchivio" value="L" >
<html:submit styleClass="submit" property="classificaDocumentoAction" value="Classifica" alt="Classifica il documento" />
</logic:equal>
</html:form>
</eprot:page>
|
; A068605: Number of functions from [1,2,...,n] to [1,2,...,n] such that the image contains exactly two elements.
; 2,18,84,300,930,2646,7112,18360,45990,112530,270204,638820,1490762,3440430,7864080,17825520,40107726,89652906,199229060,440401500,968883762,2122317318,4630511064,10066329000,21810380150,47110421826
add $0,2
mul $0,2
sub $0,2
lpb $0
add $1,$0
sub $0,2
mul $2,2
add $2,1
lpe
mul $1,$2
mov $0,$1
|
package app.cash.sqldelight.db
import kotlin.io.use as kotlinIoUse
actual typealias Closeable = java.io.Closeable
actual inline fun <T : Closeable?, R> T.use(body: (T) -> R): R = kotlinIoUse(body)
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const curry_1 = require("@typed/curry");
const validation_1 = require("./validation");
;
function createActionFn(namespace, type) {
const namespacedType = `${namespace}.${type}`;
const actionCreator = (payload) => ({ type: namespacedType, payload });
return [namespacedType, actionCreator];
}
function createActionSpecFn(namespace, type, predicate) {
const [actionType, actionCreator] = createActionFn(namespace, type);
return [
actionType,
function (payload) {
if (process && process.env && process.env.NODE_ENV === 'development' && !predicate(payload)) {
throw new Error(`Given payload did not match expected predicate.
Action Type : ${actionType}
Payload : ${JSON.stringify(payload)}
`);
}
return actionCreator(payload);
}
];
}
function createReducerFn(initialState, actionMap) {
return (state = initialState, { type, payload }) => {
const handler = actionMap[type] || (() => state);
return handler(state, payload);
};
}
function set(prop, value, obj) {
if (validation_1.isArray(obj)) {
const i = Number(prop);
return [
...obj.slice(0, i),
value,
...obj.slice(i + 1),
];
}
return Object.assign({}, obj, { [prop]: value });
}
function setPath(props, value, obj) {
if (!props.length) {
return obj;
}
const [firstProp, ...rest] = props;
if (rest.length) {
return set(firstProp, setPath(rest, value, obj[firstProp] || {}), obj);
}
return set(firstProp, value, obj);
}
;
exports.createAction = curry_1.curry(createActionFn);
exports.createActionSpec = curry_1.curry(createActionSpecFn);
exports.createReducer = curry_1.curry(createReducerFn);
exports.setter = (...props) => (state, value) => setPath(props, value, state);
var validation_2 = require("./validation");
exports.hasShape = validation_2.hasShape;
exports.hasType = validation_2.hasType;
exports.isFalsy = validation_2.isFalsy;
exports.isArray = validation_2.isArray;
exports.isBoolean = validation_2.isBoolean;
exports.isFunction = validation_2.isFunction;
exports.isNumber = validation_2.isNumber;
exports.isString = validation_2.isString;
exports.isNull = validation_2.isNull;
exports.isUndefined = validation_2.isUndefined;
exports.isArrayOrUndefined = validation_2.isArrayOrUndefined;
exports.isBooleanOrUndefined = validation_2.isBooleanOrUndefined;
exports.isFunctionOrUndefined = validation_2.isFunctionOrUndefined;
exports.isNumberOrUndefined = validation_2.isNumberOrUndefined;
exports.isStringOrUndefined = validation_2.isStringOrUndefined;
exports.hasMaxLength = validation_2.hasMaxLength;
exports.hasMinLength = validation_2.hasMinLength;
exports.or = validation_2.or;
exports.and = validation_2.and;
|
The c/c++ optimization tricks
=================================
Introduction
--------------------
This is the note about my tricks to optimize c/c++ program.On the top,the
software optimization often follow the path as below:
+----------+-----------+-------------+
| | order | coefficient |
+----------+-----------+-------------+
| time | Algorithm | Tricks |
+----------+-----------+-------------+
| space | Algorithm | Tricks |
+----------+-----------+-------------+
So in this book we concern the Optimization Tricks in c/c++ program.
Tricks List
----------------------
000. Memory Padding
001. Restrict Modifier
002. Inline or Macro Function
003. Tail Function Optimization
004. Noexcept
005. Continuous Memory
006. Conditional Branch Prediction
007. Bit Operator
008. Constexpr
009. Emplace API
010. Empty Array In Struct
011. Function calling
|
grammar Expr;
// rules
prog: (expr NEWLINE)* ;
expr: expr ('*'|'/') expr
| expr ('+'|'-') expr
| INT
| '(' expr ')'
;
//Tokens
NEWLINE : [\r\n]+ ;
INT : [0-9]+ ;
SUM: '+';
SUB: '-';
MULTI: '*';
DIV: '/';
// define que quando encontrar o withespace o mesmo será ignorado
WHITESPACE: [ \t]+ -> skip;
|
import Connectable::*;
import RegisteredSender::*;
import EnabledReceiver::*;
(*synthesize*)
module sysRegEnConnect(Empty);
RegisteredSender_ifc send <- mkRegisteredSender;
EnabledReceiver_ifc recv <- mkEnabledReceiver;
mkConnection(recv.iioo, send.iioo); //flip me
Reg#(int) count <- mkReg(0);
rule increment;
count <= count + 1;
send.set(count);
endrule
rule disp (count>0);
recv.display_it;
endrule
rule stop (count==10);
$finish(0);
endrule
endmodule
|
Meteor.methods
sendForgotPasswordEmail: (email) ->
check email, String
email = s.trim(email)
user = RocketChat.models.Users.findOneByEmailAddress(email)
if user?
regex = new RegExp("^" + s.escapeRegExp(email) + "$", 'i')
email = _.find _.pluck(user.emails || [], 'address'), (userEmail) ->
return regex.test(userEmail)
try
Accounts.sendResetPasswordEmail(user._id, email)
catch error
throw new Meteor.Error 'error-email-send-failed', 'Error trying to send email: ' + error.message, { method: 'registerUser', message: error.message }
return true
return false
|
const thirty_days = 30days
const Nmonths = 12
#@inline current_time_index(time, interval=2592000, length=12) = mod(unsafe_trunc(Int32, time / interval), length) + 1
#@inline next_time_index(time, interval=2592000, length=12) = mod(unsafe_trunc(Int32, time / interval) + 1, length) + 1
#@inline cyclic_interpolate(u₁::Number, u₂, time, interval=2592000) = u₁ + mod(time / interval, 1) * (u₂ - u₁)
@inline current_time_index(time) = mod(unsafe_trunc(Int32, time / 2592000), 12) + 1
@inline next_time_index(time) = mod(unsafe_trunc(Int32, time / 2592000) + 1, 12) + 1
@inline cyclic_interpolate(u₁::Number, u₂, time) = u₁ + mod(time / 2592000, 1) * (u₂ - u₁)
@inline function cyclic_interpolate(τ::AbstractArray, time, interval=2592000, length=12)
n₁ = current_time_index(time, interval, length)
n₂ = next_time_index(time, interval, length)
return cyclic_interpolate.(view(τ, :, :, n₁), view(τ, :, :, n₂), time, interval)
end
|