content stringlengths 4 1.04M | lang stringclasses 358 values | score int64 0 5 | repo_name stringlengths 5 114 | repo_path stringlengths 4 229 | repo_licenses listlengths 1 8 |
|---|---|---|---|---|---|
// Copyright 2019 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import "MPPTimestampConverter.h"
@implementation MPPTimestampConverter {
mediapipe::Timestamp _mediapipeTimestamp;
mediapipe::Timestamp _lastTimestamp;
mediapipe::TimestampDiff _timestampOffset;
}
- (instancetype)init
{
self = [super init];
if (self) {
[self reset];
}
return self;
}
- (void)reset {
_mediapipeTimestamp = mediapipe::Timestamp::Min();
_lastTimestamp = _mediapipeTimestamp;
_timestampOffset = 0;
}
- (mediapipe::Timestamp)timestampForMediaTime:(CMTime)mediaTime {
Float64 sampleSeconds = CMTIME_IS_VALID(mediaTime) ? CMTimeGetSeconds(mediaTime) : 0;
const int64 sampleUsec = sampleSeconds * mediapipe::Timestamp::kTimestampUnitsPerSecond;
_mediapipeTimestamp = mediapipe::Timestamp(sampleUsec) + _timestampOffset;
if (_mediapipeTimestamp <= _lastTimestamp) {
_timestampOffset = _timestampOffset + _lastTimestamp + 1 - _mediapipeTimestamp;
_mediapipeTimestamp = _lastTimestamp + 1;
}
_lastTimestamp = _mediapipeTimestamp;
return _mediapipeTimestamp;
}
@end
| Objective-C++ | 4 | virdio/mediapipe | mediapipe/objc/MPPTimestampConverter.mm | [
"Apache-2.0"
] |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_attr,
xpath_text,
xpath_element,
unescapeHTML,
unified_timestamp,
)
class SpringboardPlatformIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
cms\.springboardplatform\.com/
(?:
(?:previews|embed_iframe)/(?P<index>\d+)/video/(?P<id>\d+)|
xml_feeds_advanced/index/(?P<index_2>\d+)/rss3/(?P<id_2>\d+)
)
'''
_TESTS = [{
'url': 'http://cms.springboardplatform.com/previews/159/video/981017/0/0/1',
'md5': '5c3cb7b5c55740d482561099e920f192',
'info_dict': {
'id': '981017',
'ext': 'mp4',
'title': 'Redman "BUD like YOU" "Usher Good Kisser" REMIX',
'description': 'Redman "BUD like YOU" "Usher Good Kisser" REMIX',
'thumbnail': r're:^https?://.*\.jpg$',
'timestamp': 1409132328,
'upload_date': '20140827',
'duration': 193,
},
}, {
'url': 'http://cms.springboardplatform.com/embed_iframe/159/video/981017/rab007/rapbasement.com/1/1',
'only_matching': True,
}, {
'url': 'http://cms.springboardplatform.com/embed_iframe/20/video/1731611/ki055/kidzworld.com/10',
'only_matching': True,
}, {
'url': 'http://cms.springboardplatform.com/xml_feeds_advanced/index/159/rss3/981017/0/0/1/',
'only_matching': True,
}]
@staticmethod
def _extract_urls(webpage):
return [
mobj.group('url')
for mobj in re.finditer(
r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//cms\.springboardplatform\.com/embed_iframe/\d+/video/\d+.*?)\1',
webpage)]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id') or mobj.group('id_2')
index = mobj.group('index') or mobj.group('index_2')
video = self._download_xml(
'http://cms.springboardplatform.com/xml_feeds_advanced/index/%s/rss3/%s'
% (index, video_id), video_id)
item = xpath_element(video, './/item', 'item', fatal=True)
content = xpath_element(
item, './{http://search.yahoo.com/mrss/}content', 'content',
fatal=True)
title = unescapeHTML(xpath_text(item, './title', 'title', fatal=True))
video_url = content.attrib['url']
if 'error_video.mp4' in video_url:
raise ExtractorError(
'Video %s no longer exists' % video_id, expected=True)
duration = int_or_none(content.get('duration'))
tbr = int_or_none(content.get('bitrate'))
filesize = int_or_none(content.get('fileSize'))
width = int_or_none(content.get('width'))
height = int_or_none(content.get('height'))
description = unescapeHTML(xpath_text(
item, './description', 'description'))
thumbnail = xpath_attr(
item, './{http://search.yahoo.com/mrss/}thumbnail', 'url',
'thumbnail')
timestamp = unified_timestamp(xpath_text(
item, './{http://cms.springboardplatform.com/namespaces.html}created',
'timestamp'))
formats = [{
'url': video_url,
'format_id': 'http',
'tbr': tbr,
'filesize': filesize,
'width': width,
'height': height,
}]
m3u8_format = formats[0].copy()
m3u8_format.update({
'url': re.sub(r'(https?://)cdn\.', r'\1hls.', video_url) + '.m3u8',
'ext': 'mp4',
'format_id': 'hls',
'protocol': 'm3u8_native',
})
formats.append(m3u8_format)
self._sort_formats(formats)
return {
'id': video_id,
'title': title,
'description': description,
'thumbnail': thumbnail,
'timestamp': timestamp,
'duration': duration,
'formats': formats,
}
| Python | 4 | hackarada/youtube-dl | youtube_dl/extractor/springboardplatform.py | [
"Unlicense"
] |
Red/System [
Title: "Red/System atomic operations test script"
Author: "Xie Qingtian"
File: %atomic-test.reds
Tabs: 4
Rights: "Copyright (C) 2011-2019 Red Foundation. All rights reserved."
License: "BSD-3 - https://github.com/red/red/blob/origin/BSD-3-License.txt"
]
#include %../../../../quick-test/quick-test.reds
#either cpu-version > 5.0 [
#define handle! int-ptr!
#include %../../../../runtime/threads.reds
#define A_N_THREADS 100
#define A_N_ITERS 100000
#define COND_CC [#if OS <> 'Windows [[cdecl]]]
~~~start-file~~~ "atomic operations"
===start-group=== "atomic operations path"
st!: alias struct! [
a [integer!]
b [integer!]
]
st: declare st!
st/a: 0
st/b: 1
--test-- "atomic load path"
test-load: func [s [st!]][
--assert (system/atomic/load :s/b) = 1
]
test-load st
--test-- "atomic store path"
test-store: func [s [st!]][
system/atomic/store :s/a 1
--assert s/a = s/b
]
test-store st
===end-group===
===start-group=== "atomic operations with multi threads"
run-parallel: func [
op-func [int-ptr!]
/local
threads [int-ptr!]
n [integer!]
][
threads: system/stack/allocate A_N_THREADS
n: 1
until [ ;-- start some threads
threads/n: as-integer thread/start op-func null 0
n: n + 1
n > A_N_THREADS
]
loop A_N_THREADS [
thread/wait as int-ptr! threads/value -1 null
threads: threads + 1
]
]
run-parallel-n: func [
op-func [int-ptr!]
n-threads [integer!] ;-- number of threads
return: [logic!]
/local
threads [int-ptr!]
n [integer!]
ret [integer!]
][
threads: system/stack/allocate n-threads
n: 1
until [ ;-- start some threads
threads/n: as-integer thread/start op-func as int-ptr! n 0
n: n + 1
n > n-threads
]
loop n-threads [
ret: 0
thread/wait as int-ptr! threads/value -1 :ret
unless as logic! ret [return false]
threads: threads + 1
]
true
]
--test-- "atomic load and store"
counter1: 0
counter2: 0
atomic-load-store: func [ ;-- thread-func!
COND_CC
udata [int-ptr!]
return: [logic!]
/local
p1 [int-ptr!]
p2 [int-ptr!]
me [integer!]
n [integer!]
c1 [integer!]
c2 [integer!]
][
p1: :counter1
p2: :counter2
me: as-integer udata
loop A_N_ITERS [
either me = 1 [
c1: system/atomic/load p1
n: c1 + 1
;-- the following 2 store instructions should be sequential
;-- no reordering
system/atomic/store p1 n
system/atomic/store p2 n
][
c2: system/atomic/load p2
c1: system/atomic/load p1
if c1 < c2 [return false]
]
]
true
]
--assert run-parallel-n as int-ptr! :atomic-load-store 10
--test-- "atomic add"
g-a: 0 ;-- global variable
atomic-add-func: func [COND_CC udata [int-ptr!]][ ;-- thread-func!
loop A_N_ITERS [
;g-a: g-a + 1 ;-- this will fail
system/atomic/add :g-a 1
]
]
run-parallel as int-ptr! :atomic-add-func
--assert A_N_THREADS * A_N_ITERS = g-a
--test-- "atomic sub"
g-a: A_N_THREADS * A_N_ITERS
atomic-sub-func: func [COND_CC udata [int-ptr!]][ ;-- thread-func!
loop A_N_ITERS [
system/atomic/sub :g-a 1
]
]
run-parallel as int-ptr! :atomic-sub-func
--assert 0 = g-a
--test-- "atomic CAS"
g-a: 0 ;-- global variable
;fail-increment: func [val [int-ptr!] /local old [integer!] new [integer!]][
; until [ ;-- non-atomic compare and swap
; old: val/value
; new: old + 1
; either old = val/value [
; val/value: new
; true
; ][
; false
; ]
; ]
;]
cas-increment: func [val [int-ptr!] /local old [integer!] new [integer!]][
until [
old: system/atomic/load val
new: old + 1
system/atomic/cas val old new
]
]
atomic-cas-increment: func [COND_CC udata [int-ptr!]][ ;-- thread-func!
;loop A_N_ITERS [fail-increment :g-a] ;-- this wil fail
loop A_N_ITERS [cas-increment :g-a]
]
run-parallel as int-ptr! :atomic-cas-increment
--assert A_N_THREADS * A_N_ITERS = g-a
run-parallel-2: func [
op-func [int-ptr!]
init-value [integer!]
return: [integer!]
/local
threads [int-ptr!]
n [integer!]
a [integer!]
][
a: init-value
threads: system/stack/allocate A_N_THREADS
n: 1
until [ ;-- start some threads
threads/n: as-integer thread/start op-func :a 0
n: n + 1
n > A_N_THREADS
]
loop A_N_THREADS [
thread/wait as int-ptr! threads/value -1 null
threads: threads + 1
]
a
]
--test-- "atomic add 2"
atomic-add-func2: func [COND_CC udata [int-ptr!]][ ;-- thread-func!
loop A_N_ITERS [
system/atomic/add udata 1
]
]
--assert A_N_THREADS * A_N_ITERS = run-parallel-2 as int-ptr! :atomic-add-func2 0
--test-- "atomic sub 2"
atomic-sub-func2: func [COND_CC udata [int-ptr!]][ ;-- thread-func!
loop A_N_ITERS [
system/atomic/sub udata 1
]
]
--assert 0 = run-parallel-2 as int-ptr! :atomic-sub-func2 A_N_THREADS * A_N_ITERS
===end-group===
~~~end-file~~~
][
~~~start-file~~~ "Queue Test"
===start-group=== "Queue Basic"
===end-group===
~~~end-file~~~
] | Red | 5 | GalenIvanov/red | system/tests/source/units/atomic-test.reds | [
"BSL-1.0",
"BSD-3-Clause"
] |
vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0); | Io | 1 | ValtoForks/EtherealEngine | engine_data/data/shaders/fs_gamma_correction.io | [
"BSD-2-Clause"
] |
/*
* Script for randomizing instrument samples
*/
// config
1 => int instrument_count;
2000 => int min_duration;
2000 => int max_duration;
// instrument object
class Instrument {
string filename;
SndBuf buf;
}
// define instrument filenames
Instrument instruments[instrument_count];
me.dir() + "/subway/instruments/subway_ding_dong.wav" => instruments[0].filename;
// load instruments into sound buffers
for( 0 => int i; i < instrument_count; i++ )
{
instruments[i].filename => instruments[i].buf.read;
// set position to end, so it won't play immediately upon open
instruments[i].buf.samples() => instruments[i].buf.pos;
instruments[i].buf => dac;
}
// loop and play instruments
while(true) {
for( 0 => int i; i < instrument_count; i++ )
{
Math.random2(0, 1) => int coin;
if (coin >= 0) {
0 => instruments[i].buf.pos;
0.5 => instruments[i].buf.gain;
1 => instruments[i].buf.rate;
}
}
Math.random2(min_duration, max_duration)::ms => now;
}
<<< "Done." >>>;
| ChucK | 4 | beefoo/music-lab-scripts | sandbox/randomizer.ck | [
"MIT"
] |
module App exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Decode
type alias Model =
{counter: Int}
init : ( Model, Cmd Msg )
init =
( Model 0, Cmd.none )
decodeModel : Json.Decode.Decoder Model
decodeModel =
Json.Decode.map Model
(Json.Decode.field "counter" Json.Decode.int)
-- UPDATE
type Msg
= Inc
update : Msg -> Model -> ( Model, Cmd Msg )
update message model =
case message of
Inc ->
{model | counter = model.counter + 1} ! []
-- VIEW
view : Model -> Html Msg
view model =
div [ class "container" ]
[ h1 []
[ text "Elm SSR example"
]
, p [] [ text "Click on the button below to increment the state." ]
, div []
[ button
[ class "btn btn-primary"
, onClick Inc
]
[ text "+ 1" ]
, text <| toString model
]
, p [] [ text "A simple example of how to make Razzle and Elm work together!" ]
]
| Elm | 4 | senthilpazhani/ReactJS---MaterialUI-Example-2 | examples/with-elm/src/App.elm | [
"MIT"
] |
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -ex
echo "Asked to decommission"
# Find the pid to signal
date | tee -a ${LOG}
WORKER_PID=$(ps -o pid -C java | tail -n 1| awk '{ sub(/^[ \t]+/, ""); print }')
echo "Using worker pid $WORKER_PID"
kill -s SIGPWR ${WORKER_PID}
# For now we expect this to timeout, since we don't start exiting the backend.
echo "Waiting for worker pid to exit"
# If the worker does exit stop blocking the cleanup.
timeout 60 tail --pid=${WORKER_PID} -f /dev/null
date
echo "Done"
date
sleep 1
| Shell | 3 | kesavanvt/spark | resource-managers/kubernetes/docker/src/main/dockerfiles/spark/decom.sh | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] |
extends Reference
func int_to_2bytes(value: int) -> PoolByteArray:
return PoolByteArray([value & 255, (value >> 8) & 255])
| GDScript | 4 | triptych/Pixelorama | addons/gdgifexporter/little_endian.gd | [
"MIT"
] |
globals [
gini-index-reserve
normalized-gini
lorenz-points
prices
number_of_prices
mean_prices
]
turtles-own [
sugar ;; the amount of sugar this turtle has
spice
potsugar
potspice
sugar-metabolism ;; the amount of sugar that each turtles loses each tick
spice-metabolism ;;
vision ;; the distance that this turtle can see in the horizontal and vertical directions
vision-points ;; the points that this turtle can see in relative to it's current position (based on vision)
wealth
]
patches-own [
psugar ;; the amount of sugar on this patch
max-psugar ;; the maximum amount of sugar that can be on this patch
pspice
max-pspice
expected-wealth
]
;;
;; Setup Procedures
;;
to setup
if maximum-sugar-endowment <= minimum-sugar-endowment [
user-message "Oops: the maximum-sugar-endowment must be larger than the minimum-sugar-endowment"
stop
]
clear-all
create-turtles initial-population [ turtle-setup ]
setup-patches
update-lorenz-and-gini
reset-ticks
set prices []
end
to turtle-setup ;; turtle procedure
set color blue
set shape "circle"
move-to one-of patches with [not any? other turtles-here]
set sugar random-in-range minimum-sugar-endowment maximum-sugar-endowment
set spice random-in-range minimum-spice-endowment maximum-spice-endowment
set sugar-metabolism random-in-range 1 4
set spice-metabolism random-in-range 1 4
set vision random-in-range 1 6
;; turtles can look horizontally and vertically up to vision patches
;; but cannot look diagonally at all
set vision-points []
foreach (range 1 (vision + 1)) [ n ->
set vision-points sentence vision-points (list (list 0 n) (list n 0) (list 0 (- n)) (list (- n) 0))
]
set wealth wealth-func sugar spice sugar-metabolism spice-metabolism
run visualization
end
to turtle-setup-offspring ;; turtle procedure
set color blue
set shape "circle"
move-to one-of patches in-radius 3 with [not any? other turtles-here]
if random-float 1 < pmut [ifelse random 2 = 0 [set sugar-metabolism sugar-metabolism - 1][set sugar-metabolism sugar-metabolism + 1]]
if random-float 1 < pmut [ifelse random 2 = 0 [set spice-metabolism spice-metabolism - 1][set spice-metabolism spice-metabolism + 1]]
if random-float 1 < pmut [ifelse random 2 = 0 [set vision vision - 1][set vision vision + 1]]
if vision > 6 [set vision 6]
if sugar-metabolism < 1 [set sugar-metabolism 1]
if spice-metabolism < 1 [set spice-metabolism 1]
;; turtles can look horizontally and vertically up to vision patches
;; but cannot look diagonally at all
set vision-points []
foreach (range 1 (vision + 1)) [ n ->
set vision-points sentence vision-points (list (list 0 n) (list n 0) (list 0 (- n)) (list (- n) 0))
]
set wealth wealth-func sugar spice sugar-metabolism spice-metabolism
run visualization
end
to setup-patches
ask patch 38 38 [set max-psugar 4 ask patches in-radius 4 [set max-psugar 4 ]
ask patches in-radius 8 with [max-psugar = 0][set max-psugar 3]
ask patches in-radius 12 with [max-psugar = 0][set max-psugar 2]
ask patches in-radius 16 with [max-psugar = 0][set max-psugar 1]]
ask patch 12 12 [set max-psugar 4 ask patches in-radius 4 [set max-psugar 4 ]
ask patches in-radius 8 with [max-psugar = 0][set max-psugar 3]
ask patches in-radius 12 with [max-psugar = 0][set max-psugar 2]
ask patches in-radius 16 with [max-psugar = 0][set max-psugar 1]]
ask patch 12 38 [set max-pspice 4 ask patches in-radius 4 [set max-pspice 4 ]
ask patches in-radius 8 with [max-pspice = 0][set max-pspice 3]
ask patches in-radius 12 with [max-pspice = 0][set max-pspice 2]
ask patches in-radius 16 with [max-pspice = 0][set max-pspice 1]]
ask patch 38 12 [set max-pspice 4 ask patches in-radius 4 [set max-pspice 4 ]
ask patches in-radius 8 with [max-pspice = 0][set max-pspice 3]
ask patches in-radius 12 with [max-pspice = 0][set max-pspice 2]
ask patches in-radius 16 with [max-pspice = 0][set max-pspice 1]]
ask patches [set psugar max-psugar set pspice max-pspice patch-recolor]
end
;;
;; Runtime Procedures
;;
to go
if not any? turtles [
stop
]
ask patches [
patch-growback
patch-recolor
]
ask turtles [
turtle-move
turtle-eat
if sugar <= 0 [die]
if spice <= 0 [die]
]
if trade? [
set prices []
ask turtles [
trade
]
]
ask turtles [
if sugar <= 0 [die]
if spice <= 0 [die]
if wealth > wealth-reproduction [
if count patches in-radius 3 with [not any? other turtles-here] > 0 [
set sugar sugar / 2
set spice spice / 2
hatch 1 [ turtle-setup-offspring ]]
]
run visualization
]
ask turtles [
set wealth wealth-func sugar spice sugar-metabolism spice-metabolism
]
update-lorenz-and-gini
set number_of_prices length prices
if number_of_prices > 0 [
set mean_prices mean prices
]
tick
end
to turtle-move ;; turtle procedure
;; consider moving to unoccupied patches in our vision, as well as staying at the current patch
let move-candidates (patch-set patch-here (patches at-points vision-points) with [not any? turtles-here])
let ac-sugar [sugar] of self
let ac-spice [spice] of self
let m-sugar [sugar-metabolism] of self
let m-spice [spice-metabolism] of self
ask move-candidates [
set expected-wealth wealth-func (ac-sugar + psugar) (ac-spice + pspice) m-sugar m-spice
; show expected-wealth
]
let possible-winners move-candidates with-max [expected-wealth]
if any? possible-winners [
;; if there are any such patches move to one of the patches that is closest
move-to min-one-of possible-winners [distance myself]
]
end
to turtle-eat ;; turtle procedure
;; metabolize some sugar and spice, and eat all the sugar and spice on the current patch
set sugar (sugar - sugar-metabolism + psugar)
set psugar 0
set spice (spice - spice-metabolism + pspice)
set pspice 0
end
to trade
let agentA self
ask turtles-on neighbors [
let MRS_A ([spice] of agentA / [spice-metabolism] of agentA) / ([sugar] of agentA / [sugar-metabolism] of agentA)
let MRS_B (spice / spice-metabolism) / (sugar / sugar-metabolism)
let price sqrt (MRS_A * MRS_B)
if MRS_A > MRS_B [
if price >= 1 [ask agentA [set potspice spice - price set potsugar sugar + 1] set potspice spice + price set potsugar sugar - 1]
if price < 1 [ask agentA [set potspice spice - 1 set potsugar sugar + 1 / price] set potspice spice + 1 set potsugar sugar - 1 / price]
]
if MRS_A < MRS_B [
if price >= 1 [set potspice spice - price set potsugar sugar + 1 ask agentA [set potspice spice + price set potsugar sugar - 1]]
if price < 1 [set potspice spice - 1 set potsugar sugar + 1 / price ask agentA [set potspice spice + 1 set potsugar sugar - 1 / price]]
]
; wealth potential trade
let potwealthA wealth-func [potsugar] of agentA [potspice] of agentA [sugar-metabolism] of agentA [spice-metabolism] of agentA
let potwealthB wealth-func potsugar potspice sugar-metabolism spice-metabolism
if (potwealthA >= [wealth] of agentA) and (potwealthB >= wealth) [
ask agentA [set spice potspice set sugar potsugar set wealth potwealthA]
set spice potspice set sugar potsugar set wealth potwealthB
set prices lput price prices
]
]
end
to patch-recolor ;; patch procedure
;; color patches based on the amount of sugar and spice they have
if pxcor > 24 and pycor > 24 [set pcolor (yellow + 4.9 - psugar)]
if pxcor <= 24 and pycor <= 24 [set pcolor (yellow + 4.9 - psugar)]
if pxcor > 24 and pycor <= 24 [set pcolor (red + 4.9 - pspice)]
if pxcor <= 24 and pycor > 24 [set pcolor (red + 4.9 - pspice)]
end
to patch-growback ;; patch procedure
;; gradually grow back all of the sugar and spice for the patch
set psugar min (list max-psugar (psugar + 1))
set pspice min (list max-pspice (pspice + 1))
end
to update-lorenz-and-gini
let num-people count turtles
let sorted-wealths sort [wealth] of turtles
let total-wealth sum sorted-wealths
let wealth-sum-so-far 0
let index 0
set gini-index-reserve 0
set normalized-gini 0
set lorenz-points []
repeat num-people [
set wealth-sum-so-far (wealth-sum-so-far + item index sorted-wealths)
set lorenz-points lput ((wealth-sum-so-far / total-wealth) * 100) lorenz-points
set index (index + 1)
set gini-index-reserve
gini-index-reserve +
(index / num-people) -
(wealth-sum-so-far / total-wealth)
]
ifelse count turtles > 0 [
set normalized-gini (gini-index-reserve / count turtles) * 2]
[
set normalized-gini 0
]
end
;;
;; Utilities
;;
to-report random-in-range [low high]
report low + random (high - low + 1)
end
to-report wealth-func [ac-sugar ac-spice m-sugar m-spice]
let wealth-report 0
if ac-sugar > 0 and ac-spice > 0 [set wealth-report (ac-sugar ^ (m-sugar /(m-sugar + m-spice)) ) * (ac-spice ^ (m-spice / (m-sugar + m-spice)))]
report wealth-report
end
;;
;; Visualization Procedures
;;
to no-visualization ;; turtle procedure
set color blue
end
to color-agents-by-vision ;; turtle procedure
set color blue - (vision - 3.5)
end
to color-agents-by-metabolism ;; turtle procedure
set color blue + ((sugar-metabolism + spice-metabolism) / 2 - 2.5)
end
; Copyright 2009 Uri Wilensky.
; See Info tab for full copyright and license.
@#$#@#$#@
GRAPHICS-WINDOW
295
10
703
419
-1
-1
8.0
1
10
1
1
1
0
1
1
1
0
49
0
49
1
1
1
ticks
30.0
BUTTON
5
190
85
230
NIL
setup
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
90
190
180
230
NIL
go
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
0
BUTTON
185
190
275
230
go once
go
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
0
CHOOSER
5
240
285
285
visualization
visualization
"no-visualization" "color-agents-by-vision" "color-agents-by-metabolism"
2
SLIDER
10
10
290
43
initial-population
initial-population
0
1000
400.0
10
1
NIL
HORIZONTAL
SLIDER
10
45
290
78
minimum-sugar-endowment
minimum-sugar-endowment
0
200
5.0
1
1
NIL
HORIZONTAL
PLOT
710
220
970
420
Gini index vs. time
Time
Gini
0.0
100.0
0.0
1.0
true
false
"" ""
PENS
"default" 1.0 0 -13345367 true "" "plot (gini-index-reserve / count turtles) * 2"
SLIDER
10
80
290
113
maximum-sugar-endowment
maximum-sugar-endowment
0
200
25.0
1
1
NIL
HORIZONTAL
SLIDER
5
325
285
358
wealth-reproduction
wealth-reproduction
0
100
100.0
1
1
NIL
HORIZONTAL
SLIDER
10
115
290
148
minimum-spice-endowment
minimum-spice-endowment
5
100
5.0
1
1
NIL
HORIZONTAL
SLIDER
10
150
290
183
maximum-spice-endowment
maximum-spice-endowment
5
100
25.0
1
1
NIL
HORIZONTAL
PLOT
710
10
970
220
Population
NIL
NIL
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 0 -16777216 true "" "plot count turtles"
PLOT
970
220
1245
420
Turtle attributes
NIL
NIL
0.0
10.0
0.0
5.0
true
true
"" ""
PENS
"sugar" 1.0 0 -16777216 true "" "plot mean [sugar-metabolism] of turtles"
"spice" 1.0 0 -2674135 true "" "plot mean [spice-metabolism] of turtles"
"vision" 1.0 0 -14439633 true "" "plot mean [vision] of turtles"
SWITCH
5
290
108
323
Trade?
Trade?
0
1
-1000
SLIDER
110
290
285
323
pmut
pmut
0
0.1
0.0
0.01
1
NIL
HORIZONTAL
PLOT
970
10
1245
220
resources
NIL
NIL
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"sugar" 1.0 0 -16777216 true "" "plot sum [psugar] of patches"
"spice" 1.0 0 -2674135 true "" "plot sum [pspice] of patches"
PLOT
1245
220
1510
420
Price
NIL
NIL
0.0
10.0
0.0
2.0
true
false
"" ""
PENS
"average" 1.0 0 -16777216 true "" "if ticks > 0 and length prices > 0 [plot mean prices]"
PLOT
1245
10
1510
220
trades
NIL
NIL
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 0 -16777216 true "" "if ticks > 0 [plot length prices]"
@#$#@#$#@
## WHAT IS IT?
Note that this an adjustment of the third model in the NetLogo Sugarscape suite implements Epstein & Axtell's Sugarscape Wealth Distribution model, as described in chapter 2 of their book Growing Artificial Societies: Social Science from the Bottom Up. It provides a ground-up simulation of inequality in wealth. Only a minority of the population have above average wealth, while most agents have wealth near the same level as the initial endowment.
As discussed in the model documentation we include spice, reproduction, a welfare function, and trade.
## HOW IT WORKS
Each patch contains some sugar or spice, the maximum amount of which is predetermined. At each tick, each patch regains one unit of sugar or spice, until it reaches the maximum amount.
The amount of sugar or spicea patch currently contains is indicated by its color; the darker the yellow, the more sugar, and the darker the red, the more spice.
At setup, agents are placed at random within the world. Each agent can only see a certain distance horizontally and vertically. At each tick, each agent will move to the nearest unoccupied location within their vision range with the most welfare after consuming the resources on that patch, and collect all the sugar and spice there. If its current location has as much or more sugar and spice than any unoccupied location it can see, it will stay put.
Agents also use (and thus lose) a certain amount of sugar and spice each tick, based on their metabolism rates. If an agent runs out of sugar or spice, it dies.
Each agent also reproduces if the wealth is beyond a certain threshold.
## HOW TO USE IT
The INITIAL-POPULATION slider sets how many agents are in the world.
The MINIMUM-SUGAR-ENDOWMENT and MAXIMUM-SUGAR-ENDOWMENT sliders set the initial amount of sugar ("wealth") each agent has when it hatches. The actual value is randomly chosen from the given range.
Press SETUP to populate the world with agents and import the sugar map data. GO will run the simulation continuously, while GO ONCE will run one tick.
The VISUALIZATION chooser gives different visualization options and may be changed while the GO button is pressed. When NO-VISUALIZATION is selected all the agents will be red. When COLOR-AGENTS-BY-VISION is selected the agents with the longest vision will be darkest and, similarly, when COLOR-AGENTS-BY-METABOLISM is selected the agents with the lowest metabolism will be darkest.
## NETLOGO FEATURES
Since agents cannot see diagonally we cannot use `in-radius` to find the patches in the agents' vision. Instead, we use `at-points`.
## RELATED MODELS
Other models in the NetLogo Sugarscape suite include:
* Sugarscape 1 Immediate Growback
* Sugarscape 2 Constant Growback
* Sugarspace 3 Wealth DIstribution
For more explanation of the Lorenz curve and the Gini index, see the Info tab of the Wealth Distribution model. (That model is also based on Epstein and Axtell's Sugarscape model, but more loosely.)
## CREDITS AND REFERENCES
Epstein, J. and Axtell, R. (1996). Growing Artificial Societies: Social Science from the Bottom Up. Washington, D.C.: Brookings Institution Press.
## COPYRIGHT AND LICENSE
Copyright 2009 Uri Wilensky.

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.
<!-- 2009 Cite: Li, J. -->
@#$#@#$#@
default
true
0
Polygon -7500403 true true 150 5 40 250 150 205 260 250
airplane
true
0
Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15
arrow
true
0
Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150
box
false
0
Polygon -7500403 true true 150 285 285 225 285 75 150 135
Polygon -7500403 true true 150 135 15 75 150 15 285 75
Polygon -7500403 true true 15 75 15 225 150 285 150 135
Line -16777216 false 150 285 150 135
Line -16777216 false 150 135 15 75
Line -16777216 false 150 135 285 75
bug
true
0
Circle -7500403 true true 96 182 108
Circle -7500403 true true 110 127 80
Circle -7500403 true true 110 75 80
Line -7500403 true 150 100 80 30
Line -7500403 true 150 100 220 30
butterfly
true
0
Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240
Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240
Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163
Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165
Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225
Circle -16777216 true false 135 90 30
Line -16777216 false 150 105 195 60
Line -16777216 false 150 105 105 60
car
false
0
Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180
Circle -16777216 true false 180 180 90
Circle -16777216 true false 30 180 90
Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89
Circle -7500403 true true 47 195 58
Circle -7500403 true true 195 195 58
circle
false
0
Circle -7500403 true true 0 0 300
circle 2
false
0
Circle -7500403 true true 0 0 300
Circle -16777216 true false 30 30 240
cow
false
0
Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167
Polygon -7500403 true true 73 210 86 251 62 249 48 208
Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123
cylinder
false
0
Circle -7500403 true true 0 0 300
dot
false
0
Circle -7500403 true true 90 90 120
face happy
false
0
Circle -7500403 true true 8 8 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240
face neutral
false
0
Circle -7500403 true true 8 7 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Rectangle -16777216 true false 60 195 240 225
face sad
false
0
Circle -7500403 true true 8 8 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183
fish
false
0
Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166
Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165
Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60
Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166
Circle -16777216 true false 215 106 30
flag
false
0
Rectangle -7500403 true true 60 15 75 300
Polygon -7500403 true true 90 150 270 90 90 30
Line -7500403 true 75 135 90 135
Line -7500403 true 75 45 90 45
flower
false
0
Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135
Circle -7500403 true true 85 132 38
Circle -7500403 true true 130 147 38
Circle -7500403 true true 192 85 38
Circle -7500403 true true 85 40 38
Circle -7500403 true true 177 40 38
Circle -7500403 true true 177 132 38
Circle -7500403 true true 70 85 38
Circle -7500403 true true 130 25 38
Circle -7500403 true true 96 51 108
Circle -16777216 true false 113 68 74
Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218
Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240
house
false
0
Rectangle -7500403 true true 45 120 255 285
Rectangle -16777216 true false 120 210 180 285
Polygon -7500403 true true 15 120 150 15 285 120
Line -16777216 false 30 120 270 120
leaf
false
0
Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195
Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195
line
true
0
Line -7500403 true 150 0 150 300
line half
true
0
Line -7500403 true 150 0 150 150
pentagon
false
0
Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120
person
false
0
Circle -7500403 true true 110 5 80
Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90
Rectangle -7500403 true true 127 79 172 94
Polygon -7500403 true true 195 90 240 150 225 180 165 105
Polygon -7500403 true true 105 90 60 150 75 180 135 105
plant
false
0
Rectangle -7500403 true true 135 90 165 300
Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285
Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285
Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210
Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135
Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135
Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60
Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90
square
false
0
Rectangle -7500403 true true 30 30 270 270
square 2
false
0
Rectangle -7500403 true true 30 30 270 270
Rectangle -16777216 true false 60 60 240 240
star
false
0
Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108
target
false
0
Circle -7500403 true true 0 0 300
Circle -16777216 true false 30 30 240
Circle -7500403 true true 60 60 180
Circle -16777216 true false 90 90 120
Circle -7500403 true true 120 120 60
tree
false
0
Circle -7500403 true true 118 3 94
Rectangle -6459832 true false 120 195 180 300
Circle -7500403 true true 65 21 108
Circle -7500403 true true 116 41 127
Circle -7500403 true true 45 90 120
Circle -7500403 true true 104 74 152
triangle
false
0
Polygon -7500403 true true 150 30 15 255 285 255
triangle 2
false
0
Polygon -7500403 true true 150 30 15 255 285 255
Polygon -16777216 true false 151 99 225 223 75 224
truck
false
0
Rectangle -7500403 true true 4 45 195 187
Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194
Rectangle -1 true false 195 60 195 105
Polygon -16777216 true false 238 112 252 141 219 141 218 112
Circle -16777216 true false 234 174 42
Rectangle -7500403 true true 181 185 214 194
Circle -16777216 true false 144 174 42
Circle -16777216 true false 24 174 42
Circle -7500403 false true 24 174 42
Circle -7500403 false true 144 174 42
Circle -7500403 false true 234 174 42
turtle
true
0
Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210
Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105
Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105
Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87
Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210
Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99
wheel
false
0
Circle -7500403 true true 3 3 294
Circle -16777216 true false 30 30 240
Line -7500403 true 150 285 150 15
Line -7500403 true 15 150 285 150
Circle -7500403 true true 120 120 60
Line -7500403 true 216 40 79 269
Line -7500403 true 40 84 269 221
Line -7500403 true 40 216 269 79
Line -7500403 true 84 40 221 269
x
false
0
Polygon -7500403 true true 270 75 225 30 30 225 75 270
Polygon -7500403 true true 30 75 75 30 270 225 225 270
@#$#@#$#@
NetLogo 6.1.1
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@
<experiments>
<experiment name="experiment" repetitions="1000" runMetricsEveryStep="false">
<setup>setup</setup>
<go>go</go>
<timeLimit steps="300"/>
<metric>count turtles</metric>
<metric>avg_price</metric>
<enumeratedValueSet variable="maximum-sugar-endowment">
<value value="25"/>
</enumeratedValueSet>
<enumeratedValueSet variable="wealth-reproduction">
<value value="10"/>
<value value="11"/>
<value value="12"/>
<value value="13"/>
<value value="14"/>
<value value="15"/>
</enumeratedValueSet>
<enumeratedValueSet variable="minimum-spice-endowment">
<value value="5"/>
</enumeratedValueSet>
<enumeratedValueSet variable="Trade?">
<value value="false"/>
<value value="true"/>
</enumeratedValueSet>
<enumeratedValueSet variable="minimum-sugar-endowment">
<value value="5"/>
</enumeratedValueSet>
<enumeratedValueSet variable="visualization">
<value value=""no-visualization""/>
</enumeratedValueSet>
<enumeratedValueSet variable="maximum-spice-endowment">
<value value="25"/>
</enumeratedValueSet>
<enumeratedValueSet variable="initial-population">
<value value="400"/>
</enumeratedValueSet>
<enumeratedValueSet variable="pmut">
<value value="0.05"/>
</enumeratedValueSet>
</experiment>
</experiments>
@#$#@#$#@
@#$#@#$#@
default
0.0
-0.2 0 0.0 1.0
0.0 1 1.0 0.0
0.2 0 0.0 1.0
link direction
true
0
Line -7500403 true 150 150 90 180
Line -7500403 true 150 150 210 180
@#$#@#$#@
1
@#$#@#$#@
| NetLogo | 5 | CarrKnight/nofreelunch | data/sugarscape/Sugarscape trade.nlogo | [
"MIT"
] |
#Date: Sat, 8 May 1999 17:42:20 +0200
#From: Iva Cabric <ivac@fly.srk.fer.hr>
#To: bug-gnu-utils@gnu.org
#Cc: arnold@gnu.org
#Subject: Problem in gawk with match
#
#Hello,
#
#gawk reports fatal error in match when first character in regexp is "=" :
#
#$ gawk '{ where = match($0, /=a/); print where}'
#gawk: cmd. line:1: { where = match($0, /=a/); print where}
#gawk: cmd. line:1: ^ parse error
#gawk: cmd. line:1: fatal: match() cannot have 0 arguments
#
#Using "\=" instead "=" works without problems :
#
#$ gawk '{ where = match($0, /\=a/); print where}'
#sdgfa
#0
#asdfds=a
#7
#
#Other versions of awk have no problems with "/=/" (except oawk on SunOS).
#
#--
# @
#
{ where = match($0, /=a/); print where}
| Awk | 2 | Crestwave/goawk | testdata/gawk/regeq.awk | [
"MIT"
] |
<%@ page session="false" language="java" pageEncoding="UTF-8" %>
<h4 class="text-success">Business实时报表 <a href="/cat/r/business?domain=cat">访问链接</a></h4>
<h5>公司核心业务指标监控</h5>
<img class="img-polaroid" src="${model.webapp}/images/metric02.png" width="100%"/>
<h5>输入时间,查询条件,即可查看业务指标报表。查询条件可以是domain,也可以是标签名称,其中标签均以TAG_开头。</h5>
<h5 class='text-danger'>“当前值”表示当前实际值,“基线值”表示根据历史趋势算出来当天的基准线</h5>
<br/><br/>
<h4 class="text-success">自定义metric配置 <a href="/cat/s/business?op=list">配置链接</a></h4>
<h5>支持自定义metric,自定义metric指对多个打点得到的指标进行四则运算,得到一个新的metric。</h5>
<h5 class="text-success">配置方法:</h5>
<h5>输入domain,查询 -> 点击新增,进入配置页面 -> 填写自定义metric的信息,在规则配置栏中填写四则运算规则 -> 配置完成后,即可在对应domain的报表中看到该metric的报表。</h5>
<img class="img-polaroid" src="${model.webapp}/images/metric03.png" width="100%"/>
<h4 class="text-success">一个例子:<br/></h4>
<h5 class="text-success">应用打点:</h5>
<h5>
在应用shopweb的某段代码中,加入如下打点:<br/><br/>
Cat.logMetricForCount("success");<br/>
Cat.logMetricForCount("total", 3);<br/>
</h5>
<h5 class="text-success">自定义配置:</h5>
<h5>\${shopweb,success,COUNT} / \${shopweb,total,COUNT} </h5>
<h5>表示shopweb下名为success,类型为COUNT的值除以shopweb下名为total,类型为COUNT的值,用于表示成功率。</h5>
<h5 class='text-danger'>最终shopweb这个domain下,business报表会有三张图,表示的指标分别为success,total,以及计算出的成功率。</h5>
<br/><br/>
<h4 class="text-success">标签配置:<a href="/cat/s/business?op=tagConfig">配置链接</a><br/></h4>
<h5>每个tag节点表示一个标签,tag下可以有多个business-item,每个business-item表示一个metric项,其中domain为应用名,item-id为指标名称。</h5><br/>
<img class="img-polaroid" src="${model.webapp}/images/metric04.png" width="100%"/>
| Java Server Pages | 2 | woozhijun/cat | cat-home/src/main/webapp/jsp/report/home/application/metric.jsp | [
"Apache-2.0"
] |
-0.120621 -0.048544 -0.228788 -0.518633 -0.562817 -0.643628
-0.145242 -0.260515 -0.006676 -0.905953 -0.078285 0.416078
-0.105662 -0.247177 0.193006 -0.477531 -0.665668 0.573455
-0.146439 -0.108520 0.200191 0.758422 0.545662 -0.356438
-0.080971 -0.201227 0.235887 -0.159911 -0.561493 0.811883
-0.046093 0.056768 0.326914 -0.775391 0.394342 0.493217
-0.060315 0.012698 0.315317 -0.658921 -0.571128 0.489526
-0.123808 0.124865 0.238565 0.133001 0.658355 0.740864
-0.193908 0.359075 0.080725 -0.680241 0.713183 0.169237
-0.286000 0.252357 -0.123538 -0.953695 0.269394 -0.133766
-0.246638 0.010038 -0.159150 -0.785590 -0.479407 -0.391175
0.105626 0.415783 0.061238 0.303940 0.865578 0.397988
0.101478 0.139104 0.211693 0.063001 0.935256 0.348320
0.072605 0.141517 0.214212 0.118542 0.693490 0.710647
0.072546 0.317745 0.231520 -0.386358 0.308328 0.869288
0.112578 0.420875 0.259689 -0.741723 0.667821 -0.062149
-0.031954 0.031205 0.298190 -0.416060 -0.900033 0.129746
0.059409 0.033591 0.285081 0.107449 -0.956451 0.271399
0.180547 -0.024784 0.220859 0.705570 -0.197358 0.680603
0.092677 -0.141563 0.152956 0.087981 0.755115 0.649662
0.278762 0.059564 -0.109930 0.955160 -0.289052 -0.064168
0.073527 -0.097419 -0.225126 0.513229 -0.466560 -0.720360
-0.154040 -0.476283 -0.043982 -0.837568 -0.067660 0.542127
-0.170660 -0.270323 -0.085531 -0.983285 0.055951 0.173264
-0.166657 -0.192565 -0.124768 -0.932016 0.276697 -0.234064
-0.167240 -0.140393 -0.082325 -0.974344 -0.156970 -0.161292
0.055133 -0.033524 -0.278666 0.306562 -0.547088 -0.778919
-0.140340 -0.058923 -0.200900 -0.567966 -0.606268 -0.556645
-0.117496 -0.116762 -0.172123 -0.783674 -0.142037 -0.604715
-0.096648 -0.148925 -0.201947 -0.682528 0.258560 -0.683595
-0.127318 -0.286572 -0.252884 -0.513646 0.435424 -0.739306
-0.106315 -0.320744 0.037220 -0.631554 -0.176948 0.754870
-0.005000 -0.275066 0.194609 -0.007934 -0.906053 0.423090
0.030329 -0.138833 0.174660 0.076542 0.957792 0.277085
0.051875 -0.097993 0.139053 0.145418 0.160563 0.976255
0.021711 -0.067817 0.160780 0.080293 -0.720869 0.688404
-0.141561 -0.074914 0.139659 0.426081 -0.866849 0.258896
-0.160338 -0.141315 0.221206 -0.621149 -0.321852 0.714552
-0.110221 -0.142749 0.194368 0.465119 0.857365 -0.220432
-0.221494 -0.146964 0.105929 -0.913090 -0.197899 0.356513
-0.138057 -0.238494 0.111792 -0.103330 -0.654556 -0.748919
-0.167040 -0.010400 0.229427 -0.601051 -0.209977 0.771134
-0.146742 -0.094807 0.237134 -0.300019 -0.014195 0.953828
-0.127498 -0.109061 0.226495 0.803650 0.397154 -0.443188
-0.099191 -0.126896 0.253449 0.304251 0.947151 -0.101665
-0.033252 -0.141813 0.221353 -0.008402 0.961414 -0.274977
-0.005925 -0.150986 0.290242 -0.031540 -0.215052 0.976093
-0.029258 -0.160348 0.284504 -0.185169 -0.441861 0.877765
-0.063208 -0.177785 0.262457 -0.131158 -0.724711 0.676456
-0.095308 -0.051091 0.256194 -0.179793 -0.334084 0.925236
-0.100720 -0.139892 0.262180 -0.429330 -0.016667 0.902994
-0.047692 0.006044 0.319362 0.244669 -0.845525 -0.474579
0.011895 0.000516 0.319437 0.388379 -0.921054 0.028667
0.033599 0.025879 0.301989 0.843802 -0.513359 0.156398
0.035037 0.023886 0.322234 0.682175 -0.444744 -0.580379
0.056310 0.005973 0.319977 -0.224128 -0.830079 -0.510623
0.062645 0.009288 0.270543 0.438588 -0.052531 0.897152
0.030584 0.013166 0.298362 0.775072 -0.544763 0.320151
-0.055112 0.021004 0.269479 -0.288401 -0.297477 0.910128
-0.093872 0.025419 0.292109 -0.751841 -0.267283 0.602740
-0.176830 0.003144 0.229102 -0.552109 -0.472274 0.687119
-0.207186 0.148253 0.193460 -0.492767 0.594442 0.635467
-0.091426 0.081590 0.234542 -0.422261 0.443635 0.790496
-0.058229 0.083839 0.259741 -0.497708 0.738629 0.454658
0.033677 0.150994 0.263246 0.829535 0.383220 0.406220
0.040803 0.049973 0.360848 0.777214 0.239719 0.581785
0.017587 0.065482 0.372548 0.189284 0.337243 0.922192
0.017568 0.124492 0.323605 0.422802 0.688220 0.589570
-0.009516 0.041848 0.376837 -0.145567 -0.009061 0.989307
-0.059743 0.060764 0.305958 -0.520372 0.610255 0.597329
-0.176577 0.448014 0.295504 -0.994538 -0.093669 0.046040
-0.133151 0.426190 0.311234 0.457897 -0.312803 0.832157
-0.106835 0.217074 0.268559 -0.265934 0.038684 0.963215
-0.009356 0.169240 0.267557 -0.340580 0.656423 0.673138
0.011304 0.169820 0.269146 0.105077 0.727488 0.678026
0.057881 0.181082 0.234789 0.435119 -0.898936 0.050852
0.025518 0.176177 0.257952 0.591650 0.313524 0.742734
0.011580 0.218237 0.250054 -0.452533 -0.155312 0.878118
-0.063065 0.315649 0.233226 0.321520 0.397612 0.859377
-0.131819 0.337085 0.249982 -0.326090 -0.537269 0.777822
-0.114226 0.218165 0.183323 0.012619 -0.982563 -0.185501
-0.129036 0.384853 0.162936 -0.098054 0.945044 -0.311894
-0.214829 0.375793 -0.098675 -0.720443 0.687333 -0.092386
-0.172492 0.399583 -0.157675 -0.607552 0.753321 -0.251768
-0.189026 0.238547 -0.284740 -0.697494 0.219130 -0.682264
-0.281949 0.168553 -0.173224 -0.926758 0.017290 -0.375262
-0.244232 0.146560 0.135380 -0.927848 0.106349 0.357475
-0.142164 0.205745 0.139655 0.114377 -0.426786 0.897091
-0.157215 0.173417 0.151831 0.481211 0.507428 0.714810
-0.114867 0.142595 0.187433 -0.065058 0.958643 0.277077
0.030627 0.365782 0.170269 -0.046190 0.822609 0.566729
-0.068279 0.178227 0.152508 -0.591999 0.534884 0.602857
-0.060531 0.358218 -0.307816 -0.308648 0.563557 -0.766250
-0.100511 0.114240 -0.361544 -0.385079 -0.184748 -0.904203
0.037236 0.170225 -0.373839 0.056823 0.113420 -0.991921
0.002095 0.384969 -0.300973 0.042160 0.658391 -0.751494
-0.011917 0.429351 -0.249887 -0.078780 0.837334 -0.540986
0.023776 0.436419 -0.234897 0.112051 0.870824 -0.478655
-0.022702 0.460565 -0.005863 -0.104625 0.955616 0.275413
-0.056408 0.396210 0.118284 -0.069449 0.875046 0.479031
0.070724 0.375146 0.154673 -0.042092 0.924544 0.378742
0.150227 0.371600 0.145520 0.532509 0.844305 -0.059857
0.126031 0.292862 -0.314775 0.469333 0.409888 -0.782125
0.067529 0.340283 -0.316913 0.333842 0.506439 -0.795027
0.148231 0.159814 -0.336287 0.578481 0.023548 -0.815356
0.125154 0.175200 0.140569 -0.002980 0.346271 0.938130
0.155969 0.173105 0.147249 -0.344863 0.549971 0.760659
0.071322 0.179174 0.153533 0.636991 0.488753 0.596123
0.128106 0.152819 0.160037 -0.038274 0.822535 0.567426
0.211278 0.307809 0.094853 0.830541 0.488978 0.266651
0.282239 0.263043 -0.139394 0.938047 0.267401 -0.220372
0.204689 0.314004 -0.234116 0.707254 0.350725 -0.613827
0.226387 0.129128 -0.259376 0.783011 -0.034629 -0.621043
0.159980 0.111933 -0.324059 0.574861 -0.232615 -0.784490
0.258975 0.326866 -0.118035 0.841238 0.511889 -0.174035
0.202480 0.396662 -0.109659 0.651298 0.743008 -0.154109
0.232036 0.366987 -0.105496 0.761305 0.632680 -0.141882
0.165689 0.424001 -0.042340 0.482550 0.866887 0.125113
0.175411 0.411582 -0.015471 0.545792 0.798117 0.255187
0.194127 0.203529 0.193966 0.331245 -0.789561 0.516594
0.108372 0.217052 0.195878 0.065403 -0.970821 -0.230712
0.090463 0.377854 0.172851 -0.412644 0.884150 -0.219096
0.077896 0.370241 0.180719 -0.559992 0.826164 0.062142
0.074784 0.209745 0.175247 0.572558 -0.819506 -0.024220
0.129538 0.332001 0.252574 0.216396 -0.602248 0.768421
0.139746 0.307123 0.231802 0.512112 -0.036445 0.858145
0.164876 0.212232 0.232737 0.626139 -0.371816 0.685349
0.178725 0.482448 0.351860 0.035129 0.972106 0.231895
0.181707 0.481204 0.339898 0.497211 0.829858 -0.253214
0.229633 0.117281 0.195020 0.871505 0.234329 0.430778
0.113625 0.114175 0.242935 -0.349482 0.312372 0.883338
0.112548 0.199977 0.255885 0.248406 -0.960471 0.125657
0.086721 0.191669 0.255759 0.225988 -0.931041 0.286518
0.065511 0.172415 0.181754 0.785138 0.533073 0.315265
0.066282 0.201738 0.166886 0.685996 -0.678433 0.262940
0.185573 0.199144 0.180832 -0.433597 -0.871829 0.227833
0.187837 0.193588 0.171468 -0.686826 -0.505291 0.522448
0.188379 0.185540 0.169102 -0.632302 0.086002 0.769933
0.218577 0.177831 0.171427 0.586487 0.186305 0.788241
0.224386 0.067294 0.226753 0.892544 -0.005648 0.450925
0.209357 -0.006271 0.194374 0.751419 -0.452169 0.480534
0.170214 -0.063974 0.232720 0.414458 0.060281 0.908070
0.122396 0.021294 0.230206 0.451445 -0.063794 0.890016
0.086291 0.086539 0.241531 0.366528 0.744124 0.558513
0.069185 0.011449 0.314061 0.620803 -0.635543 0.459008
0.099420 0.075887 0.263531 0.433712 0.854342 0.286345
0.104166 0.025705 0.290465 0.758416 -0.365458 0.539672
0.140475 0.092401 0.263950 -0.334511 0.248421 0.909060
0.184569 0.072711 0.269672 0.345390 -0.095905 0.933546
0.157570 -0.114705 0.192804 -0.672923 0.698053 -0.244739
0.126086 -0.070763 0.226099 -0.537963 -0.829291 -0.151239
0.124741 -0.139222 0.200328 -0.473995 0.826325 -0.304164
0.078195 -0.148578 0.187604 0.051055 0.998663 0.008103
0.073293 -0.268824 0.195699 0.202806 -0.888508 0.411610
0.141648 -0.246900 0.172051 0.506389 -0.745999 0.432499
0.146051 -0.229096 0.187531 0.532960 -0.551456 0.641755
0.153478 -0.242293 0.161617 0.616815 -0.761130 0.200551
0.163479 -0.231230 0.164183 0.707230 -0.599682 0.374443
0.224589 -0.070392 0.126711 0.877258 -0.146234 0.457203
0.204233 -0.191153 0.076956 0.460349 -0.752997 -0.470185
0.259492 -0.074909 0.005159 0.834237 -0.257380 -0.487652
0.269776 -0.047705 0.021681 0.982032 -0.159907 -0.100211
0.270461 -0.041692 0.038064 0.982795 -0.130829 0.130373
0.249845 0.009374 0.123742 0.858932 -0.366265 0.357890
0.144664 -0.085069 0.122026 -0.190123 -0.109995 0.975579
0.168022 -0.192817 -0.041020 0.997427 -0.010290 0.070948
0.164373 -0.194658 -0.023120 0.960319 -0.138929 0.241838
0.090479 -0.211110 0.093813 0.107214 -0.992965 0.050254
0.151817 -0.229010 0.001743 0.919718 -0.101329 0.379278
0.105325 -0.376256 -0.310617 0.316033 0.394531 -0.862826
0.146454 -0.235982 -0.195447 0.696935 0.433972 -0.570921
0.097320 -0.193218 -0.219661 0.609021 0.370176 -0.701472
0.165748 -0.133407 -0.093331 0.894374 -0.100750 -0.435826
0.153760 0.053006 -0.293015 0.472499 -0.556964 -0.683034
0.236838 0.100640 -0.241514 0.797406 -0.189933 -0.572773
0.275556 0.095343 -0.166110 0.919282 -0.206440 -0.335116
0.237836 0.037652 -0.199087 0.761622 -0.437555 -0.477993
0.257149 0.004935 -0.109671 0.893066 -0.431132 -0.128682
0.168286 -0.176240 -0.090125 0.993606 0.112881 -0.002359
-0.231378 -0.410115 -0.214820 -0.963528 0.204236 0.172919
-0.227377 -0.403018 -0.236253 -0.844832 0.427195 -0.322123
-0.207533 -0.394894 -0.259644 -0.674179 0.478817 -0.562332
-0.172842 -0.386097 -0.284084 -0.532385 0.465851 -0.706788
-0.166767 -0.273726 -0.061629 -0.962895 0.022230 0.268958
-0.184776 -0.260584 -0.138803 -0.971892 0.229184 0.053856
-0.186173 -0.284426 -0.132286 -0.920662 0.058185 0.386001
-0.186671 -0.450764 -0.106026 -0.932973 0.005031 0.359911
-0.200154 -0.428919 -0.159195 -0.938678 0.038381 0.342653
-0.201610 -0.114161 -0.020482 -0.732670 -0.570529 -0.371069
-0.181025 -0.118841 -0.073308 -0.786100 -0.553328 -0.275454
-0.170381 -0.129945 -0.082971 -0.875188 -0.359826 -0.323375
-0.166981 -0.160885 -0.024053 -0.861861 -0.501538 -0.075203
-0.165508 -0.161046 -0.087055 -0.999685 0.003839 0.024786
-0.167208 -0.255017 -0.185392 -0.756721 0.443486 -0.480307
-0.170703 -0.201781 -0.104810 -0.984480 0.116781 0.131001
-0.172087 -0.116057 -0.095567 -0.754389 -0.459073 -0.469201
-0.178852 -0.245944 -0.152420 -0.899531 0.365160 -0.239797
-0.194683 -0.083627 -0.104984 -0.673891 -0.615696 -0.408400
-0.261076 0.010835 -0.110162 -0.892958 -0.437114 -0.107505
-0.247713 -0.016776 -0.054096 -0.895829 -0.441681 -0.049075
-0.250432 -0.019271 -0.031422 -0.874975 -0.390308 -0.286494
-0.264063 0.012861 -0.020148 -0.965120 -0.231115 -0.123000
-0.257655 -0.022495 -0.010736 -0.900827 -0.246064 -0.357719
-0.274291 0.059097 -0.035618 -0.976789 -0.202722 0.069190
-0.269561 0.036432 -0.057036 -0.946980 -0.320058 -0.028136
-0.274727 0.043975 -0.109763 -0.950634 -0.309664 -0.020092
-0.273521 0.055669 -0.145461 -0.905251 -0.339340 -0.255672
-0.262255 0.056178 -0.174960 -0.854338 -0.353579 -0.380905
-0.198199 0.044792 -0.255876 -0.555063 -0.535260 -0.636712
-0.223537 0.052551 -0.236392 -0.683676 -0.462332 -0.564656
-0.246080 0.056433 -0.207130 -0.784684 -0.393376 -0.479088
-0.219118 0.007105 -0.198285 -0.645924 -0.556397 -0.522690
-0.242075 -0.016298 -0.130136 -0.798070 -0.533405 -0.280290
-0.245307 -0.047470 -0.016257 -0.758915 -0.327653 -0.562754
-0.223971 -0.082401 -0.018351 -0.708208 -0.445313 -0.547848
-0.214649 -0.073156 -0.053473 -0.837736 -0.506076 -0.205146
-0.234008 -0.038129 -0.101903 -0.820130 -0.551799 -0.151344
-0.218658 -0.026474 -0.157787 -0.647776 -0.616653 -0.447354
-0.094845 -0.127543 -0.197830 -0.712905 0.065086 -0.698234
-0.120385 -0.132043 -0.168122 -0.788217 0.128990 -0.601727
-0.157387 -0.136420 -0.111937 -0.891958 0.045132 -0.449860
-0.158114 -0.123513 -0.111652 -0.840134 -0.212745 -0.498914
-0.118244 -0.102254 -0.179868 -0.675166 -0.456031 -0.579816
-0.085891 -0.115805 -0.207012 -0.661501 -0.139184 -0.736915
-0.081569 -0.104765 -0.215573 -0.567941 -0.421268 -0.707090
-0.086695 -0.036943 -0.262262 -0.432421 -0.552247 -0.712766
-0.100425 0.038797 -0.315556 -0.358911 -0.573929 -0.736063
-0.057742 0.047597 -0.341422 -0.255946 -0.571669 -0.779542
-0.027523 0.016569 -0.325960 -0.160761 -0.580206 -0.798447
-0.008726 -0.053842 -0.276424 -0.048348 -0.556194 -0.829645
-0.038918 -0.054159 -0.271437 -0.254560 -0.546389 -0.797909
-0.002642 -0.097447 -0.249643 -0.037670 -0.457542 -0.888390
-0.048899 -0.125256 -0.231684 -0.422170 -0.017610 -0.906346
-0.052804 -0.107898 -0.231964 -0.405683 -0.362958 -0.838858
-0.018368 -0.115189 -0.241300 -0.120442 -0.162460 -0.979337
-0.030882 -0.105662 -0.241409 -0.221927 -0.375552 -0.899838
-0.015298 -0.134647 -0.242965 -0.139695 0.196571 -0.970487
-0.061446 -0.136847 -0.226818 -0.571280 0.186104 -0.799377
-0.048825 -0.185359 -0.248322 -0.388084 0.303341 -0.870273
-0.006844 -0.205303 -0.263737 -0.014992 0.307021 -0.951585
-0.038979 -0.220489 -0.264183 -0.233295 0.329684 -0.914813
-0.050737 -0.371800 -0.322399 -0.137605 0.357429 -0.923747
-0.122973 -0.378126 -0.305648 -0.370919 0.418430 -0.829057
-0.149832 -0.271779 -0.221855 -0.648305 0.457014 -0.608965
-0.073848 -0.257062 -0.267515 -0.357913 0.379407 -0.853199
-0.090872 -0.227869 -0.244665 -0.499718 0.385225 -0.775812
-0.075813 -0.176652 -0.230975 -0.551950 0.317016 -0.771267
-0.163995 -0.157082 -0.101144 -0.967653 0.133757 -0.213906
-0.163577 -0.168190 -0.029857 -0.973057 -0.225083 0.049978
-0.156466 -0.179980 -0.010279 -0.934583 -0.275252 0.225369
-0.156246 -0.189264 -0.145417 -0.815326 0.366497 -0.448245
-0.161458 -0.195103 -0.035875 -0.977822 -0.057099 0.201503
-0.131423 -0.487056 -0.018042 -0.718518 -0.121955 0.684732
-0.139833 -0.201775 -0.180377 -0.728402 0.406604 -0.551457
-0.112239 -0.197960 -0.209307 -0.648815 0.383377 -0.657314
-0.126585 -0.161496 -0.171732 -0.773628 0.298701 -0.558817
-0.156058 -0.153319 -0.120917 -0.872716 0.247271 -0.420979
-0.082824 -0.235578 0.076230 -0.391033 -0.346633 0.852607
-0.078892 -0.309259 0.055395 -0.251191 -0.253893 0.934046
-0.087775 -0.497565 0.006306 -0.208808 -0.237465 0.948688
-0.001954 -0.500000 0.011003 -0.020663 -0.250971 0.967774
-0.109800 -0.494092 -0.001401 -0.496637 -0.187216 0.847527
-0.130096 -0.321299 0.010325 -0.799278 -0.099808 0.592615
-0.128525 -0.248512 0.027487 -0.808488 -0.159053 0.566612
-0.101206 -0.233816 0.064571 -0.665757 -0.291402 0.686915
-0.120565 -0.221807 0.047859 -0.796734 -0.276069 0.537587
-0.071825 -0.216471 0.089175 -0.176554 -0.557385 0.811265
-0.114764 -0.236050 0.107955 0.002253 -0.482854 -0.875698
-0.138930 -0.250187 0.130902 -0.527451 -0.845574 -0.082461
-0.116647 -0.258691 0.126399 -0.280137 -0.858346 -0.429844
-0.097794 -0.265020 0.127559 -0.217489 -0.942269 -0.254611
-0.032103 -0.278679 0.137064 -0.094829 -0.988765 -0.115544
-0.010874 -0.276982 0.124372 -0.053952 -0.803618 -0.592695
-0.066791 -0.264446 0.119172 -0.099071 -0.602341 -0.792067
-0.024991 -0.255567 0.112435 -0.010194 -0.374170 -0.927304
-0.069950 -0.237995 0.078956 -0.138277 -0.353154 0.925290
-0.092790 -0.128824 0.139125 0.010936 0.606506 0.795004
-0.086590 -0.214993 0.102139 0.012184 -0.716153 -0.697837
-0.074334 -0.211636 0.094402 -0.128754 -0.958672 0.253714
-0.093146 -0.208937 0.089398 -0.377382 -0.919547 0.109623
-0.092234 -0.212222 0.083961 -0.477404 -0.624589 0.618041
-0.107952 -0.086083 0.120530 -0.079869 -0.303630 0.949437
-0.079619 -0.075659 0.132685 -0.166359 -0.581346 0.796468
-0.040910 -0.096579 0.137960 -0.191607 0.082350 0.978011
-0.039852 -0.119615 0.144594 -0.138846 0.422749 0.895547
-0.005515 -0.090849 0.144913 -0.110843 -0.396640 0.911258
-0.120704 -0.073294 0.131170 0.081560 -0.834404 0.545085
-0.131749 -0.098906 0.124997 0.262363 0.516586 0.815049
-0.129203 -0.081997 0.123764 0.173387 -0.538215 0.824780
-0.132314 -0.088656 0.122012 0.288675 -0.031126 0.956921
-0.109844 -0.098673 0.121664 -0.053775 0.294367 0.954178
-0.141691 -0.196936 0.020133 -0.886116 -0.267476 0.378490
-0.136072 -0.191834 0.040177 -0.797238 -0.510182 0.322685
-0.132346 -0.192364 0.056391 -0.571478 -0.818269 0.062042
-0.114777 -0.208210 0.062166 -0.725231 -0.418463 0.546743
-0.114982 -0.202034 0.070220 -0.657812 -0.624930 0.420412
-0.141832 -0.108939 0.138821 0.498177 0.668092 0.552696
-0.155230 -0.092763 0.137960 0.797926 0.314804 0.514017
-0.144242 -0.096657 0.129656 0.512510 0.371856 0.773988
-0.242892 -0.092356 0.001462 -0.674630 -0.393778 -0.624350
-0.216364 -0.108745 -0.006360 -0.550017 -0.567361 -0.612848
-0.241752 0.008279 0.120929 -0.850169 -0.368721 0.375843
-0.217111 -0.069884 0.123892 -0.883098 -0.132333 0.450141
-0.141927 -0.081416 0.129318 0.392005 -0.619186 0.680398
-0.150222 -0.087038 0.131535 0.665616 -0.273075 0.694540
-0.157718 -0.087052 0.144039 0.846414 -0.460311 0.267764
-0.243280 0.037686 0.141400 -0.937230 -0.185248 0.295438
-0.250743 -0.008914 0.089386 -0.911372 -0.192662 0.363707
-0.258001 0.038181 0.084249 -0.972179 -0.067132 0.224414
-0.261414 -0.029936 0.046406 -0.968065 -0.120361 0.219915
-0.271479 0.063011 0.004824 -0.990824 -0.087223 0.103245
-0.256444 -0.062831 0.005584 -0.887693 -0.245969 -0.389231
-0.248841 -0.096543 0.015298 -0.894553 -0.386252 -0.224909
-0.261823 -0.048665 0.025091 -0.982865 -0.176218 -0.054064
-0.244395 -0.109042 0.057559 -0.956064 -0.241265 0.166531
-0.246818 -0.067149 0.072566 -0.909350 -0.135738 0.393266
-0.237554 -0.130098 0.045890 -0.909598 -0.413058 -0.044882
-0.226700 -0.150809 0.051881 -0.793527 -0.569788 -0.213674
-0.224481 -0.156061 0.086677 -0.895284 -0.429410 0.118632
-0.215559 -0.164447 0.056124 -0.534919 -0.710252 -0.457607
-0.202783 -0.149411 0.142668 -0.897050 -0.086724 0.433335
-0.171488 -0.159688 0.016678 -0.643817 -0.746503 -0.168027
-0.173747 -0.166531 0.036756 -0.399170 -0.812275 -0.425292
-0.192750 -0.131377 -0.006179 -0.684770 -0.668786 -0.289507
-0.193010 -0.152509 0.030508 -0.416847 -0.731538 -0.539528
-0.235752 -0.113308 0.010319 -0.581390 -0.603503 -0.545683
-0.170008 -0.188723 0.066708 -0.157422 -0.756731 -0.634489
-0.152486 -0.177409 0.014505 -0.783473 -0.613402 0.099537
-0.149718 -0.182482 0.048840 -0.470787 -0.852830 -0.225921
-0.143423 -0.191455 0.065786 -0.191092 -0.877836 -0.439191
-0.143320 -0.202433 0.079844 0.031625 -0.692445 -0.720777
-0.161945 -0.232781 0.132093 -0.696025 -0.714573 0.070242
-0.189428 -0.198264 0.083075 -0.337650 -0.760129 -0.555154
-0.191350 -0.202432 0.116498 -0.804345 -0.577243 0.140783
-0.198668 -0.195104 0.093233 -0.710848 -0.690436 -0.134138
-0.210392 -0.171298 0.114909 -0.872046 -0.398016 0.284814
-0.178518 -0.206122 0.152581 -0.786804 -0.516982 0.337148
-0.187416 -0.173238 0.167581 -0.859917 -0.273121 0.431217
-0.172243 -0.188721 0.181054 -0.741659 -0.391146 0.544928
-0.158012 -0.097050 0.182656 0.967451 0.082669 -0.239174
-0.186602 -0.034186 0.200471 -0.825586 -0.190215 0.531249
-0.186969 -0.071276 0.192189 -0.897288 -0.056545 0.437809
-0.153069 -0.087013 0.182245 0.685630 -0.684151 -0.248692
-0.160359 -0.089214 0.157901 0.877436 -0.474820 -0.068201
-0.161371 -0.094943 0.155924 0.963868 0.243361 0.108322
-0.150707 -0.110019 0.153588 0.710777 0.659900 0.243574
-0.147553 -0.077349 0.156627 0.552369 -0.831721 -0.055926
-0.119895 -0.066209 0.168345 0.303257 -0.952861 -0.009519
-0.147251 -0.114230 0.176012 0.739270 0.669203 -0.075152
-0.150152 -0.096870 0.201582 0.842049 -0.113762 -0.527267
-0.132933 -0.233823 0.187059 -0.488387 -0.579472 0.652450
-0.145828 -0.224525 0.184277 -0.629749 -0.522136 0.575143
-0.133354 -0.248096 0.168588 -0.506946 -0.780862 0.365048
-0.152258 -0.235655 0.160042 -0.669639 -0.690019 0.274695
-0.116272 -0.259856 0.154276 -0.349955 -0.933293 0.080595
-0.093770 -0.263022 0.173370 -0.354712 -0.901185 0.249088
-0.089455 -0.147753 0.166136 0.057721 0.963731 0.260560
-0.109647 -0.145154 0.167748 0.418365 0.891011 0.176265
-0.101869 -0.140810 0.153017 0.209171 0.796657 0.567085
-0.084253 -0.057027 0.171606 0.140370 -0.969802 0.199449
-0.029933 -0.072197 0.152097 -0.170746 -0.643548 0.746118
-0.006876 -0.123292 0.151717 -0.088467 0.684112 0.723992
-0.015052 -0.134487 0.164837 -0.076717 0.870503 0.486148
-0.077423 -0.142597 0.153399 -0.079247 0.790058 0.607888
-0.069210 -0.147197 0.166271 -0.128219 0.953187 0.273853
-0.025431 -0.279061 0.177803 -0.119629 -0.984165 0.130799
-0.011563 -0.143655 0.208616 -0.029994 0.999451 -0.014106
-0.020619 -0.140508 0.179822 -0.100627 0.973902 0.203444
-0.015331 -0.057444 0.173429 -0.056918 -0.811608 0.581423
-0.008620 -0.046061 0.195811 0.005353 -0.915015 0.403385
-0.089552 -0.145391 0.207339 0.133294 0.956443 -0.259711
-0.057964 -0.148128 0.201480 -0.043469 0.992920 -0.110549
-0.090584 -0.149148 0.184291 0.102211 0.994144 -0.035080
-0.082822 -0.258795 0.200842 -0.391891 -0.772645 0.499440
-0.063967 -0.270489 0.190015 -0.221696 -0.930878 0.290374
-0.099051 -0.220333 0.217564 -0.384441 -0.528858 0.756646
-0.103569 -0.168477 0.250365 -0.491920 -0.396627 0.775050
-0.086331 -0.130098 0.252826 0.219285 0.957604 -0.186836
-0.102965 -0.067559 0.237837 0.413528 -0.900334 0.135621
-0.014415 -0.039270 0.229903 0.162242 -0.986010 0.038236
-0.077486 -0.057257 0.251337 0.263686 -0.952241 0.153971
-0.059499 -0.244831 0.221581 -0.119718 -0.473445 0.872650
-0.076607 -0.246952 0.215857 -0.365814 -0.538315 0.759208
-0.056872 -0.260586 0.209703 -0.125062 -0.726263 0.675944
-0.005587 -0.177790 0.257350 0.002383 -0.797486 0.603332
-0.045970 -0.141825 0.285601 -0.249281 -0.089699 0.964268
-0.032681 -0.126972 0.286976 -0.265961 0.432355 0.861588
-0.021611 -0.122934 0.287537 -0.122330 0.856123 0.502085
-0.008868 -0.038352 0.284632 0.080936 -0.986568 0.141894
-0.083111 -0.053525 0.258801 -0.054051 -0.731665 0.679518
-0.086675 -0.129965 0.262706 -0.025128 0.989039 0.145502
-0.051314 -0.129975 0.257185 0.001657 0.965864 -0.259043
-0.101800 -0.131849 0.260236 -0.179533 0.606073 0.774883
-0.072581 -0.167208 0.266517 -0.314690 -0.465207 0.827377
-0.107237 -0.123823 0.252657 0.389214 0.890009 0.237480
-0.125478 -0.107071 0.238574 0.817757 0.554358 0.154791
-0.129221 -0.102409 0.239686 0.667971 0.309787 0.676643
-0.129369 -0.095802 0.235407 0.942561 -0.085375 0.322939
-0.131644 -0.105465 0.242406 0.075269 0.359012 0.930293
-0.174214 -0.123621 0.213991 -0.823645 -0.186645 0.535512
-0.166023 -0.111658 0.226719 -0.640797 -0.208473 0.738863
-0.158375 -0.114311 0.231241 -0.461799 -0.114684 0.879539
-0.133104 -0.095778 0.221418 0.931050 -0.141277 -0.336433
-0.109112 -0.125852 0.233984 0.562801 0.784971 -0.258989
-0.118935 -0.078349 0.229099 0.700367 -0.709105 -0.081591
-0.127114 -0.087261 0.229440 0.845719 -0.533627 0.001158
-0.151543 -0.060109 0.234482 -0.231875 0.054378 0.971224
-0.168217 -0.086447 0.230214 -0.625483 -0.028511 0.779716
-0.172563 -0.046920 0.219121 -0.784185 -0.036048 0.619480
-0.133274 -0.094594 0.240701 0.383551 0.079327 0.920106
-0.126289 -0.078484 0.242172 0.161071 -0.320806 0.933349
-0.122364 -0.078568 0.239603 0.627056 -0.664135 0.407094
-0.112792 -0.050810 0.248707 -0.360271 0.071968 0.930068
-0.109960 -0.069162 0.243516 0.323098 -0.814869 0.481244
-0.035435 0.012436 0.354525 -0.613307 -0.496802 0.614037
-0.043214 0.008674 0.339247 -0.575657 -0.712491 0.401219
-0.043282 0.023975 0.323258 0.489601 -0.378864 -0.785336
-0.052272 0.018106 0.328582 -0.825905 -0.094533 0.555827
-0.092077 0.019299 0.284881 -0.508330 -0.836842 0.203215
-0.070151 0.026440 0.279286 0.845626 -0.520665 0.117576
-0.068076 0.026046 0.295411 0.872415 -0.224137 -0.434344
-0.066247 0.010842 0.300200 0.186305 -0.971244 -0.148241
-0.064043 0.026039 0.315018 -0.684623 -0.034481 0.728081
-0.043809 0.030673 0.281724 -0.383804 -0.742374 0.549159
-0.056411 0.033422 0.285973 0.024327 -0.993673 0.109650
-0.063673 0.031959 0.295459 0.491265 -0.847622 -0.200489
-0.092425 0.055582 0.290297 -0.548713 0.462116 0.696680
-0.102720 0.052424 0.281347 -0.821512 0.293054 0.489120
-0.091704 0.042939 0.295502 -0.639628 0.111830 0.760506
-0.063214 0.045850 0.313169 -0.627042 0.282256 0.726051
-0.051078 0.039090 0.328585 -0.797351 0.147108 0.585312
-0.039521 0.030890 0.315380 -0.034685 -0.939016 -0.342120
-0.033619 0.044442 0.359680 -0.813806 0.168786 0.556085
-0.025558 0.027103 0.313206 -0.721546 -0.687442 -0.082425
-0.027099 0.024417 0.322712 -0.680076 -0.545708 -0.489591
-0.031958 0.022349 0.327060 -0.167629 -0.456631 -0.873721
-0.025312 0.009014 0.325502 -0.511249 -0.611445 -0.603953
-0.031082 0.007967 0.328265 0.187628 -0.477309 -0.858471
-0.019875 0.005022 0.342628 -0.151719 -0.988423 -0.001161
-0.020638 0.012050 0.307374 -0.791322 -0.610584 0.031560
-0.017998 0.021719 0.371471 -0.287265 -0.360234 0.887530
-0.020358 0.046110 0.372875 -0.552921 0.085334 0.828853
-0.008792 0.064646 0.372878 -0.167153 0.342751 0.924436
-0.002261 0.000057 0.306274 -0.338708 -0.935068 0.104521
-0.008816 -0.000939 0.296870 -0.443635 -0.732157 0.516851
-0.008378 -0.006556 0.292226 -0.196974 -0.352802 0.914730
-0.008339 -0.023625 0.294750 -0.141114 0.066399 0.987764
-0.008058 -0.033950 0.293507 -0.071662 -0.596805 0.799180
-0.031870 -0.031146 0.287966 -0.355091 -0.107637 0.928615
-0.020881 -0.006175 0.288334 -0.406701 -0.001199 0.913561
-0.018846 0.002005 0.291487 -0.494121 -0.391949 0.776029
-0.025585 0.012748 0.293147 -0.730111 -0.356873 0.582734
-0.027220 0.025031 0.296800 -0.810194 -0.445050 0.381467
-0.101100 0.065858 0.262007 -0.803254 0.570961 0.169663
-0.107930 0.051718 0.265142 -0.948424 0.270379 0.165492
-0.107989 0.038996 0.271968 -0.942845 -0.127035 0.308068
-0.103758 0.028051 0.275584 -0.796464 -0.555192 0.239596
-0.076359 0.014498 0.271912 -0.175660 -0.978071 0.111896
-0.047820 0.009748 0.273789 -0.502820 -0.112439 0.857047
-0.064944 0.013933 0.267598 0.040577 -0.459359 0.887323
-0.071455 0.015373 0.274539 0.716814 -0.650777 0.250335
-0.040062 0.022288 0.278466 -0.636242 -0.239388 0.733409
-0.065211 0.028326 0.273557 0.350366 -0.728059 0.589215
-0.107946 0.027761 0.246004 -0.813194 -0.553630 0.179468
-0.095610 0.018761 0.253425 -0.559474 -0.797331 0.226388
-0.101782 0.018245 0.241953 -0.696951 -0.591631 0.405255
-0.079327 0.009649 0.258085 -0.461662 -0.583843 0.667829
-0.080641 -0.006273 0.255900 -0.476829 0.080972 0.875259
-0.111648 -0.003342 0.236126 -0.474731 0.151970 0.866912
-0.112507 0.019723 0.231073 -0.427487 -0.123974 0.895481
-0.113055 0.034212 0.236386 -0.881705 -0.206162 0.424374
-0.109671 0.052198 0.238394 -0.824137 0.302991 0.478534
-0.108642 0.062213 0.235857 -0.031281 0.138104 0.989924
-0.117159 0.021691 0.230394 0.065600 -0.097073 0.993113
-0.116731 0.040081 0.234783 0.019637 -0.196455 0.980316
-0.144766 0.036568 0.255776 0.222495 -0.352096 0.909134
-0.175715 0.040600 0.259861 -0.200711 -0.498792 0.843162
-0.167163 0.060639 0.269214 0.005159 -0.241236 0.970453
-0.154802 0.008676 0.241880 -0.247408 -0.378575 0.891891
-0.142806 0.002020 0.240765 0.241497 -0.291858 0.925472
-0.152339 -0.029643 0.234033 -0.124202 -0.068691 0.989876
-0.134557 -0.005645 0.233585 0.266022 -0.104672 0.958267
-0.160481 -0.028488 0.230642 -0.472693 -0.089586 0.876662
-0.214937 -0.022192 0.149404 -0.851902 -0.305224 0.425560
-0.193067 -0.018952 0.196823 -0.802734 -0.325443 0.499705
-0.200456 -0.005190 0.196856 -0.746544 -0.479582 0.461165
-0.220594 0.031181 0.206773 -0.851997 -0.361306 0.378893
-0.206519 0.025067 0.223313 -0.674742 -0.513896 0.529749
-0.186518 0.056550 0.263680 -0.423021 -0.315093 0.849570
-0.202989 0.065584 0.253485 -0.723040 -0.139583 0.676557
-0.195757 0.036277 0.245691 -0.583174 -0.466122 0.665311
-0.214680 0.051704 0.232223 -0.823838 -0.257426 0.504997
-0.227816 0.058156 0.204416 -0.943334 -0.046519 0.328569
-0.197241 0.154564 0.192375 -0.200580 0.716898 0.667702
-0.224032 0.120219 0.196436 -0.889638 0.211165 0.404912
-0.205576 0.114606 0.232838 -0.712597 0.428660 0.555389
-0.215561 0.077170 0.234979 -0.872497 0.087571 0.480708
-0.205473 0.201345 0.179991 -0.629331 -0.252411 0.735004
-0.205763 0.170520 0.179463 -0.228648 0.365695 0.902212
-0.195544 0.174246 0.179160 0.182585 0.242556 0.952801
-0.195932 0.182395 0.178344 0.193823 -0.009237 0.980993
-0.207957 0.183633 0.175842 -0.394243 -0.109913 0.912410
-0.175750 0.199973 0.177245 0.482363 -0.857128 0.180716
-0.186112 0.197417 0.184390 0.212411 -0.841552 0.496660
-0.193958 0.199546 0.186675 -0.283224 -0.570762 0.770724
-0.170974 0.203539 0.199484 0.130664 -0.990037 0.052484
-0.180461 0.204503 0.201166 -0.279692 -0.865369 0.415823
-0.155748 0.135150 0.228686 0.007113 0.848046 0.529876
-0.176804 0.150685 0.198299 0.146227 0.894402 0.422686
-0.183997 0.158195 0.188336 0.180572 0.744792 0.642400
-0.184293 0.165275 0.181288 0.324181 0.552304 0.768028
-0.194357 0.189563 0.180052 0.180705 -0.502260 0.845624
-0.123810 0.137555 0.215666 0.056165 0.951808 0.301508
-0.076999 0.142384 0.208820 -0.238043 0.868462 0.434867
-0.062209 0.150019 0.206724 -0.423023 0.684947 0.593210
-0.072928 0.160880 0.180194 -0.584120 0.705551 0.401250
-0.057946 0.177439 0.181154 -0.852688 0.430104 0.296536
-0.057419 0.187154 0.204116 -0.788634 -0.612909 -0.048972
-0.054436 0.180035 0.194874 -0.974953 -0.097463 0.199920
-0.047913 0.169539 0.211250 -0.838085 -0.276812 0.470095
-0.054344 0.164506 0.202027 -0.799856 0.267867 0.537101
-0.057904 0.144807 0.213712 -0.288888 0.533797 0.794735
-0.069753 0.095645 0.238729 -0.462123 0.514383 0.722394
-0.076021 0.135669 0.218419 0.019105 0.727649 0.685684
-0.046253 0.175850 0.224142 -0.632499 -0.754079 0.176946
-0.037841 0.177982 0.236728 -0.354874 -0.792548 0.495916
-0.060434 0.184908 0.227770 -0.479284 -0.865844 -0.143529
-0.127842 0.203506 0.234246 0.043427 -0.986545 -0.157619
-0.093155 0.105754 0.236208 0.264756 0.181616 0.947059
-0.079771 0.103271 0.234013 -0.013836 0.192290 0.981241
-0.101301 0.078417 0.234155 0.211715 -0.059456 0.975521
-0.097556 0.072859 0.238773 -0.666662 0.655881 0.354093
-0.045798 0.115413 0.249420 -0.734080 0.421886 0.532108
-0.029773 0.182004 0.246254 -0.231709 -0.647203 0.726250
-0.060933 0.186088 0.251325 -0.199319 -0.937916 0.283877
-0.058907 0.193990 0.265822 -0.016964 -0.766427 0.642108
-0.012802 0.192061 0.254321 0.342250 0.036739 0.938890
-0.019791 0.189203 0.254445 -0.161317 -0.271993 0.948681
-0.011310 0.183202 0.256771 -0.059374 0.379519 0.923277
-0.017656 0.176210 0.256444 -0.617193 0.090060 0.781640
-0.027498 0.174171 0.245227 -0.668059 -0.367300 0.647138
-0.017444 0.071571 0.365004 -0.592792 0.411232 0.692449
-0.006671 0.088587 0.359370 -0.197529 0.579204 0.790889
-0.014195 0.101188 0.344457 -0.610708 0.558701 0.561150
-0.006433 0.115005 0.335907 -0.221138 0.694853 0.684308
-0.023251 0.147815 0.269819 -0.802928 0.417885 0.425063
-0.046428 0.201859 0.271094 0.145946 -0.525481 0.838194
-0.048595 0.087684 0.270053 -0.794492 0.485499 0.364793
-0.029629 0.078140 0.343789 -0.804564 0.408786 0.430779
-0.045513 0.073671 0.306488 -0.719459 0.589192 0.367739
-0.061361 0.069895 0.292754 -0.402512 0.799625 0.445627
-0.091712 0.070222 0.275133 -0.477214 0.785129 0.394764
-0.142975 0.083590 0.266355 0.363313 -0.019954 0.931454
-0.168134 0.082296 0.271325 0.016167 0.149375 0.988648
-0.181100 0.094121 0.265709 -0.237161 0.462329 0.854404
-0.185866 0.079099 0.268706 -0.405750 0.022555 0.913706
-0.197752 0.087560 0.257505 -0.679239 0.255226 0.688109
-0.145127 0.096947 0.263717 0.216815 0.409072 0.886370
-0.131974 0.067178 0.257536 0.578623 -0.213218 0.787231
-0.107808 0.100495 0.242837 0.511872 0.011865 0.858980
-0.080092 0.083471 0.244789 -0.476687 0.771100 0.422107
-0.083207 0.190102 0.250241 -0.276863 -0.957336 0.082795
-0.105547 0.199092 0.246616 -0.255784 -0.950183 -0.178121
-0.111267 0.117594 0.240491 0.329649 0.373839 0.866935
-0.179811 0.110971 0.253010 -0.178637 0.695861 0.695606
-0.193570 0.110415 0.247528 -0.448555 0.596927 0.665189
-0.156305 0.108910 0.256809 0.012379 0.639342 0.768822
-0.123895 0.206191 0.256452 -0.432621 -0.621394 0.653229
-0.115581 0.201801 0.255405 -0.248554 -0.949945 0.189275
-0.101734 0.205999 0.268405 -0.304007 -0.379924 0.873634
-0.090534 0.196826 0.264699 -0.217944 -0.779823 0.586837
-0.146296 0.482999 0.327409 0.828173 0.423585 0.367022
-0.150128 0.478128 0.334905 0.659472 0.066355 0.748794
-0.158306 0.473070 0.338892 0.091070 -0.312157 0.945655
-0.160174 0.451011 0.326199 -0.444220 -0.512157 0.735095
-0.177102 0.481634 0.325311 -0.976044 -0.021444 0.216513
-0.173129 0.454209 0.315814 -0.811845 -0.381212 0.442250
-0.169754 0.481258 0.298859 -0.603128 0.584993 -0.542236
-0.152452 0.467522 0.271976 -0.078618 0.791278 -0.606381
-0.146842 0.434500 0.318930 -0.037255 -0.522773 0.851658
-0.152709 0.492673 0.322100 0.663316 0.748339 0.000792
-0.154435 0.489450 0.306780 0.339459 0.855694 -0.390583
-0.165759 0.500000 0.330841 0.107451 0.993410 -0.039876
-0.168827 0.493113 0.313041 -0.385279 0.811505 -0.439341
-0.176228 0.484339 0.313918 -0.896987 0.337343 -0.285683
-0.172661 0.497235 0.332539 -0.793972 0.595249 0.123640
-0.170251 0.487807 0.340339 -0.656725 -0.109545 0.746131
-0.167524 0.497744 0.338520 -0.220190 0.709413 0.669514
-0.164956 0.491188 0.342127 0.139956 0.172415 0.975031
-0.159648 0.494994 0.337752 0.583419 0.615981 0.529330
-0.121908 0.455535 0.280850 0.675256 0.712804 -0.189581
-0.112445 0.443848 0.278709 0.844593 0.530497 0.072365
-0.114019 0.435887 0.291594 0.837903 0.107688 0.535090
-0.077360 0.237538 0.271075 -0.100615 0.247075 0.963758
-0.064406 0.207164 0.274371 -0.049085 -0.229980 0.971957
-0.022111 0.209782 0.267135 0.468293 -0.182581 0.864503
-0.035019 0.214856 0.272582 0.215047 -0.066479 0.974338
-0.049016 0.231641 0.273336 0.074783 0.172251 0.982210
-0.031955 0.233222 0.269510 0.323154 0.221704 0.920010
-0.051664 0.250021 0.267358 0.111726 0.393294 0.912599
-0.087361 0.401015 0.248388 0.908808 0.350964 0.225593
-0.091400 0.360812 0.257274 0.592880 -0.211460 0.777031
-0.009943 0.271567 0.247614 0.150282 0.397657 0.905143
-0.001731 0.251739 0.251848 0.122553 0.074562 0.989657
-0.012407 0.246247 0.256628 0.444934 0.142573 0.884142
-0.124895 0.216741 0.260651 -0.493151 -0.131060 0.860015
-0.143213 0.227424 0.249005 -0.578608 0.057520 0.813575
-0.115136 0.264891 0.255021 -0.338888 0.235667 0.910832
-0.094500 0.328632 0.246643 0.291054 -0.310980 0.904753
-0.115777 0.341834 0.257083 0.014406 -0.507132 0.861748
-0.105885 0.314808 0.243699 -0.044183 -0.192211 0.980359
-0.123244 0.313681 0.239688 -0.384480 -0.308876 0.869926
-0.139210 0.313671 0.230905 -0.540815 -0.068974 0.838309
-0.111998 0.303806 0.243232 -0.218987 0.140455 0.965566
-0.086856 0.302940 0.244507 0.080136 0.274384 0.958275
-0.085078 0.313504 0.241847 0.327034 0.040130 0.944160
-0.080298 0.326832 0.239948 0.515902 -0.161963 0.841198
-0.069213 0.330774 0.231767 0.635728 0.076018 0.768161
-0.045913 0.331349 0.216329 0.238354 0.600237 0.763480
-0.054392 0.335152 0.217643 0.573516 0.485396 0.659901
-0.064366 0.365926 0.195734 0.778550 0.618939 0.103802
-0.023990 0.358072 0.180716 0.068338 0.777266 0.625450
-0.056133 0.355172 0.199111 0.670352 0.644018 0.368603
-0.048852 0.354745 0.192696 0.328050 0.772285 0.544022
-0.060959 0.349959 0.216125 0.826228 0.356929 0.435831
-0.077535 0.209511 0.176359 -0.455459 -0.888702 -0.052586
-0.093082 0.214636 0.183393 -0.290815 -0.939193 -0.182601
-0.064505 0.367734 0.179412 0.481603 0.855454 0.190410
-0.111673 0.392109 0.179473 0.117786 0.868567 -0.481371
-0.124977 0.393693 0.180447 -0.114623 0.836785 -0.535399
-0.155030 0.381790 0.179952 -0.613356 0.698319 -0.368978
-0.164671 0.373740 0.188898 -0.883248 0.420480 -0.207529
-0.145481 0.397745 0.193714 -0.407147 0.710332 -0.574161
-0.157564 0.399816 0.208391 -0.737310 0.500496 -0.453737
-0.145659 0.336461 0.238666 -0.597343 -0.486190 0.637810
-0.157960 0.208346 0.231248 -0.567174 -0.525637 0.634050
-0.167004 0.225035 0.227977 -0.652310 -0.246493 0.716751
-0.159222 0.334787 0.218493 -0.798753 -0.267606 0.538870
-0.156245 0.319285 0.218191 -0.674191 0.087254 0.733385
-0.158086 0.207091 0.189700 0.276043 -0.952588 -0.127973
-0.190349 0.324111 0.177830 -0.796742 0.363348 0.482888
-0.202686 0.246893 0.186753 -0.792203 0.035917 0.609200
-0.191688 0.295568 0.192022 -0.754697 0.214316 0.620082
-0.192950 0.208334 0.194190 -0.471638 -0.623381 0.623662
-0.175535 0.251395 0.218361 -0.694680 0.103921 0.711772
-0.167645 0.396086 0.225716 -0.874989 0.335967 -0.348599
-0.167226 0.345691 0.205954 -0.961369 -0.103529 0.255053
-0.168816 0.366685 0.204487 -0.983315 0.139240 -0.117063
-0.172130 0.333440 0.197254 -0.833018 0.169155 0.526753
-0.172274 0.351516 0.182551 -0.912922 0.330529 0.239422
-0.183202 0.357688 0.141838 -0.716265 0.671318 0.190517
-0.203703 0.326083 0.149439 -0.834709 0.457095 0.307124
-0.214766 0.283626 0.161667 -0.853273 0.215748 0.474740
-0.229514 0.271174 0.135947 -0.924467 0.223344 0.308997
-0.168801 0.362810 0.170960 -0.798774 0.597440 0.070891
-0.170494 0.370069 0.136148 -0.552701 0.825377 0.115218
-0.157858 0.373946 0.163264 -0.576494 0.816585 -0.029040
-0.168436 0.375871 0.092975 -0.515704 0.839924 0.169046
-0.151350 0.385039 0.092953 -0.331058 0.921186 0.204490
-0.176365 0.409512 -0.053733 -0.564596 0.821842 0.076204
-0.185778 0.395922 -0.018376 -0.617844 0.763874 0.186453
-0.206599 0.384342 -0.059189 -0.693667 0.717502 0.063379
-0.217351 0.365015 -0.019691 -0.758266 0.630810 0.164655
-0.222170 0.326598 0.073957 -0.817027 0.544351 0.190126
-0.265478 0.247344 0.021203 -0.952639 0.204405 0.225161
-0.273622 0.275271 -0.048661 -0.927682 0.317604 0.196300
-0.267338 0.297855 -0.065476 -0.905573 0.407091 0.119222
-0.232487 0.303203 0.082171 -0.889063 0.405294 0.212846
-0.251919 0.328116 -0.070184 -0.854223 0.512162 0.089403
-0.242369 0.339656 -0.114455 -0.805954 0.579486 -0.120973
-0.231234 0.358297 -0.076484 -0.782518 0.622094 0.025755
-0.187879 0.400642 -0.098138 -0.625764 0.774186 -0.095160
-0.153009 0.424975 -0.093977 -0.504052 0.862193 -0.050550
-0.151806 0.418965 -0.140321 -0.518150 0.836039 -0.180442
-0.167034 0.385398 -0.198722 -0.612565 0.685594 -0.393351
-0.170138 0.359055 -0.230379 -0.592575 0.603197 -0.533862
-0.188175 0.330042 -0.238726 -0.654808 0.478998 -0.584625
-0.200545 0.376526 -0.150866 -0.699925 0.667439 -0.254225
-0.205477 0.348334 -0.194534 -0.713235 0.569803 -0.408190
-0.257492 0.267244 -0.188802 -0.816565 0.309567 -0.487227
-0.251012 0.299418 -0.172287 -0.797380 0.462621 -0.387513
-0.231000 0.295839 -0.209597 -0.751018 0.397224 -0.527432
-0.198086 0.297075 -0.249599 -0.686107 0.338742 -0.643826
-0.153334 0.247453 -0.315391 -0.609392 0.276170 -0.743217
-0.253331 0.316298 -0.137118 -0.810400 0.532804 -0.243662
-0.271816 0.271991 -0.155962 -0.878275 0.381708 -0.287979
-0.274939 0.285837 -0.109333 -0.902319 0.426839 -0.060240
-0.276825 0.247689 -0.164758 -0.899647 0.241513 -0.363740
-0.284727 0.254270 -0.074570 -0.958047 0.268908 0.099172
-0.287997 0.130806 -0.149637 -0.967567 -0.076846 -0.240643
-0.285581 0.215111 -0.158183 -0.951712 0.119805 -0.282650
-0.274880 0.124611 -0.187651 -0.912900 -0.095073 -0.396957
-0.269172 0.222840 -0.189784 -0.848926 0.135678 -0.510799
-0.148418 0.183762 -0.336124 -0.602695 0.130185 -0.787281
-0.167708 0.153187 -0.323293 -0.663962 0.031945 -0.747084
-0.196871 0.178256 -0.291231 -0.722008 0.119646 -0.681461
-0.232624 0.162073 -0.252967 -0.781836 0.089154 -0.617077
-0.237712 0.242176 -0.227775 -0.763306 0.219906 -0.607458
-0.215778 0.119329 -0.275370 -0.744250 -0.054438 -0.665679
-0.200066 0.090454 -0.285117 -0.641893 -0.323168 -0.695367
-0.177313 0.116106 -0.313681 -0.646788 -0.112805 -0.754281
-0.166486 0.067738 -0.298047 -0.495203 -0.499939 -0.710518
-0.156022 0.108481 -0.328371 -0.537410 -0.245715 -0.806731
-0.224008 0.078288 -0.253612 -0.746207 -0.301960 -0.593292
-0.248890 0.124404 -0.233930 -0.836015 -0.050406 -0.546386
-0.264805 0.091280 -0.196030 -0.866799 -0.242319 -0.435821
-0.278331 0.094034 -0.164460 -0.932797 -0.196009 -0.302442
-0.287582 0.101187 -0.132907 -0.979826 -0.163590 -0.114799
-0.294394 0.192391 -0.121942 -0.994087 0.012105 -0.107908
-0.285869 0.086874 -0.100211 -0.981107 -0.191041 0.030532
-0.293335 0.147651 -0.092235 -0.994410 -0.087426 0.059204
-0.269743 0.141046 0.042341 -0.977550 -0.004496 0.210657
-0.246120 0.072712 0.137004 -0.967992 -0.028960 0.249304
-0.232813 0.211048 0.144982 -0.845272 0.079759 0.528351
-0.270302 0.200275 0.031439 -0.967441 0.084270 0.238655
-0.289905 0.220115 -0.069867 -0.981002 0.125420 0.148000
-0.293467 0.196874 -0.084586 -0.992509 0.024411 0.119708
-0.290079 0.237899 -0.113680 -0.987343 0.155352 -0.031927
-0.152830 0.198140 0.140605 0.343347 -0.080924 0.935716
-0.159731 0.200033 0.144838 0.623959 -0.203655 0.754453
-0.158140 0.206758 0.148052 0.554339 -0.639717 0.532419
-0.160277 0.209906 0.160863 0.510460 -0.851755 0.118087
-0.181920 0.190482 0.171390 0.660832 -0.460428 0.592712
-0.214878 0.167429 0.175133 -0.535107 0.393109 0.747747
-0.182001 0.178958 0.171321 0.580824 0.222541 0.783019
-0.226195 0.151637 0.170803 -0.763058 0.340626 0.549287
-0.223650 0.181493 0.162544 -0.718683 0.153539 0.678175
-0.155700 0.188270 0.142925 0.480595 0.237112 0.844279
-0.123464 0.163277 0.148100 0.049620 0.635187 0.770762
-0.107376 0.160637 0.151643 -0.129306 0.766675 0.628880
-0.142269 0.159029 0.157795 0.305008 0.741996 0.597002
-0.128255 0.147695 0.171727 0.073556 0.908628 0.411076
-0.107260 0.218661 0.164984 -0.207301 -0.961406 0.180898
-0.134319 0.218467 0.162357 0.156650 -0.987036 0.034926
-0.144999 0.213982 0.148904 0.274285 -0.868063 0.413806
-0.131761 0.214644 0.146798 -0.078366 -0.787677 0.611084
-0.141156 0.178155 0.141501 0.247783 0.481519 0.840680
-0.070511 0.190924 0.148457 -0.405110 -0.296131 0.864981
-0.072871 0.200854 0.153285 -0.391967 -0.685155 0.613941
-0.061525 0.194191 0.157424 -0.731392 -0.473812 0.490478
-0.066758 0.202317 0.162218 -0.533698 -0.804416 0.260922
-0.059894 0.197374 0.172034 -0.829688 -0.558072 0.013158
-0.098973 0.154435 0.164285 -0.257527 0.863103 0.434435
-0.059196 0.186133 0.157138 -0.859018 0.181940 0.478525
-0.079702 0.169502 0.152136 -0.377884 0.690520 0.616754
-0.096033 0.171658 0.144609 -0.151259 0.482229 0.862888
-0.079135 0.182375 0.144571 -0.333642 0.160420 0.928950
-0.048680 0.076130 -0.362066 -0.138689 -0.467507 -0.873042
-0.083231 0.080224 -0.354538 -0.311952 -0.485506 -0.816682
-0.106993 0.142181 -0.361248 -0.395118 -0.021673 -0.918375
-0.113687 0.089079 -0.345724 -0.419599 -0.423551 -0.802833
-0.144675 0.147961 -0.340487 -0.545686 -0.023811 -0.837652
-0.075761 0.102429 -0.367071 -0.265527 -0.294364 -0.918066
-0.070309 0.133933 -0.372314 -0.199239 -0.030119 -0.979488
-0.046022 0.098346 -0.371513 -0.100953 -0.238569 -0.965864
-0.044261 0.175896 -0.372870 -0.077024 0.120200 -0.989757
-0.024498 0.125169 -0.376837 -0.036242 -0.018059 -0.999180
-0.023099 0.294556 -0.348722 -0.076813 0.324399 -0.942797
-0.050262 0.260863 -0.356307 -0.120420 0.247155 -0.961464
-0.084052 0.189628 -0.364659 -0.245265 0.142155 -0.958977
-0.115820 0.179179 -0.355536 -0.422321 0.087384 -0.902224
-0.119801 0.217406 -0.347643 -0.442247 0.209746 -0.872023
-0.143875 0.304519 -0.295916 -0.563825 0.412404 -0.715559
-0.136053 0.186624 0.137530 0.066277 0.176483 0.982070
-0.123994 0.261462 -0.330812 -0.480041 0.337207 -0.809847
-0.097460 0.314188 -0.319516 -0.413749 0.463030 -0.783846
-0.092470 0.257277 -0.347370 -0.314331 0.302733 -0.899750
-0.099835 0.402700 -0.245578 -0.374531 0.735528 -0.564557
-0.119786 0.407846 -0.222256 -0.491612 0.737691 -0.462742
-0.121748 0.370201 -0.264078 -0.462232 0.601739 -0.651347
-0.142416 0.347622 -0.267346 -0.532719 0.522951 -0.665382
-0.142578 0.411902 -0.183475 -0.527091 0.788895 -0.315944
-0.057733 0.392353 -0.280182 -0.324950 0.659717 -0.677629
-0.054416 0.318065 -0.334779 -0.225375 0.417475 -0.880296
-0.028259 0.394903 -0.288636 -0.160270 0.692575 -0.703317
-0.016672 0.356696 -0.321161 -0.113306 0.550703 -0.826975
-0.009628 0.334492 -0.334190 -0.019863 0.418985 -0.907776
-0.003751 0.449017 -0.211356 -0.018679 0.932916 -0.359609
-0.045198 0.433798 -0.232046 -0.229469 0.860963 -0.453968
-0.048136 0.414302 -0.259926 -0.248371 0.764115 -0.595348
-0.089891 0.429876 -0.209415 -0.344367 0.850467 -0.397640
-0.109249 0.433260 -0.176866 -0.399410 0.881164 -0.253026
-0.112155 0.442690 -0.122289 -0.392551 0.914591 -0.097090
-0.061217 0.460855 -0.118050 -0.260396 0.960035 -0.102599
-0.046260 0.454445 -0.176820 -0.208901 0.945334 -0.250408
-0.011039 0.470476 -0.106605 -0.082867 0.992399 -0.090978
-0.008423 0.460779 -0.171603 -0.028669 0.977614 -0.208444
-0.013454 0.467928 -0.036914 -0.085783 0.985465 0.146628
-0.039244 0.467516 -0.065327 -0.172668 0.984164 0.040095
-0.066657 0.457044 -0.029599 -0.275185 0.944925 0.177175
-0.032909 0.439156 0.049957 -0.164172 0.910895 0.378574
-0.017389 0.428250 0.076761 -0.075115 0.860207 0.504382
-0.100076 0.400546 0.096359 -0.207997 0.903451 0.374851
-0.137833 0.426600 -0.019596 -0.443092 0.871417 0.210482
-0.124873 0.439241 -0.059432 -0.415557 0.907125 0.066611
-0.085346 0.440107 0.008058 -0.293835 0.905706 0.305544
-0.081869 0.456026 -0.064909 -0.313950 0.949101 0.025369
-0.124251 0.388942 0.115278 -0.148246 0.965752 0.212948
-0.137669 0.387042 0.173204 -0.321659 0.868450 -0.377267
-0.132767 0.382470 0.149141 -0.128373 0.991417 0.024736
-0.112030 0.382152 0.154090 0.084627 0.994222 -0.066034
-0.147426 0.379281 0.156725 -0.354525 0.934729 -0.024372
-0.076206 0.375043 0.175781 0.571489 0.802605 -0.170954
-0.062580 0.375948 0.156727 0.095358 0.893549 0.438722
-0.084031 0.377898 0.159696 0.249751 0.963325 0.098125
-0.093161 0.381564 0.170396 0.310791 0.884935 -0.346841
-0.094425 0.386382 0.133174 -0.016569 0.946663 0.321799
0.051681 0.395655 0.117723 0.118876 0.826142 0.550779
0.082778 0.387109 0.125673 0.135744 0.895218 0.424450
0.013203 0.386898 0.135599 0.026393 0.848425 0.528657
0.064886 0.366084 0.174027 -0.222702 0.902128 0.369554
0.086049 0.375818 0.159815 -0.242187 0.962349 0.123410
0.134017 0.378385 0.136044 0.212178 0.976963 0.022883
0.112103 0.379976 0.153650 -0.093052 0.983434 -0.155559
0.104594 0.380883 0.140076 0.019998 0.982068 0.187463
0.131928 0.380961 0.156069 0.196656 0.938823 -0.282732
0.137153 0.428348 -0.001828 0.389725 0.875178 0.286666
0.138282 0.407939 0.049613 0.405896 0.827028 0.388939
0.120401 0.391113 0.096421 0.365579 0.836317 0.408566
0.121005 0.383758 0.116877 0.251405 0.943924 0.214014
0.142007 0.377204 0.110624 0.411927 0.901792 0.130718
0.026535 0.428280 0.076417 0.089363 0.851178 0.517215
0.062806 0.430955 0.057883 0.188094 0.885660 0.424532
0.011925 0.441219 0.052867 0.024993 0.921411 0.387785
0.063521 0.453033 -0.001213 0.237497 0.930937 0.277401
0.023566 0.459503 -0.000698 0.089938 0.950642 0.296970
0.013039 0.471800 -0.070391 0.053172 0.998294 0.024131
0.024479 0.467383 -0.034036 0.079841 0.979962 0.182481
0.060113 0.463611 -0.048490 0.225944 0.969391 0.096077
0.108941 0.445550 -0.025585 0.331664 0.927682 0.171482
0.123347 0.445684 -0.080286 0.361993 0.931839 -0.025240
0.072045 0.461172 -0.091579 0.240945 0.968246 -0.066679
0.059626 0.454132 -0.165510 0.229677 0.952569 -0.199653
0.043528 0.443871 -0.211929 0.216750 0.903807 -0.368987
0.028627 0.459571 -0.168412 0.115840 0.964420 -0.237645
0.026845 0.468099 -0.118254 0.114358 0.986631 -0.116109
0.009157 0.418867 -0.265230 0.065035 0.783936 -0.617425
0.040785 0.404011 -0.275448 0.237542 0.715226 -0.657286
0.041705 0.378563 -0.299400 0.240699 0.614063 -0.751658
0.052879 0.421933 -0.247171 0.236096 0.812193 -0.533480
0.104923 0.377193 -0.269820 0.401113 0.618165 -0.676003
0.142078 0.408208 -0.201149 0.513428 0.757702 -0.402838
0.141310 0.426567 -0.157575 0.448850 0.861263 -0.238244
0.106382 0.429421 -0.199000 0.376738 0.851542 -0.364615
0.104773 0.440784 -0.166404 0.321954 0.922299 -0.213798
0.102053 0.412587 -0.233480 0.375141 0.760278 -0.530327
0.063928 0.272361 -0.350206 0.204038 0.291479 -0.934563
0.077730 0.298491 -0.335599 0.320128 0.401696 -0.857996
0.100395 0.253498 -0.345070 0.360742 0.285130 -0.888012
0.126560 0.206828 -0.345269 0.500682 0.165408 -0.849681
0.106496 0.204136 -0.354788 0.352603 0.159777 -0.922032
0.083229 0.184546 -0.365430 0.231449 0.133804 -0.963601
0.049556 0.228506 -0.363110 0.109451 0.200819 -0.973495
0.017416 0.285164 -0.351998 0.043797 0.285289 -0.957440
0.004039 0.226280 -0.365830 0.004314 0.190210 -0.981734
0.008464 0.088709 -0.370568 0.023850 -0.386073 -0.922160
0.012259 0.105635 -0.375538 0.046826 -0.166304 -0.984962
0.048107 0.142477 -0.374883 0.103217 0.017271 -0.994509
0.072610 0.099852 -0.367158 0.246350 -0.308565 -0.918749
0.076439 0.118838 -0.369791 0.251476 -0.069912 -0.965335
0.119668 0.124306 -0.352613 0.454006 -0.131972 -0.881171
0.111393 0.159250 -0.357537 0.406955 0.041326 -0.912513
0.104963 0.097956 -0.353048 0.434476 -0.345499 -0.831782
0.084461 0.070576 -0.347504 0.355367 -0.524894 -0.773435
0.046136 0.066662 -0.356893 0.176103 -0.514061 -0.839481
0.084355 0.182717 0.144632 0.313790 0.099025 0.944314
0.104925 0.166220 0.147068 0.143180 0.601722 0.785767
0.084283 0.169012 0.152571 0.452397 0.698264 0.554766
0.064702 0.187740 0.156743 0.814005 0.114546 0.569452
0.105055 0.156226 0.158083 0.194907 0.841770 0.503423
0.063979 0.193696 0.159775 0.903460 -0.276471 0.327604
0.092011 0.211969 0.158150 0.313288 -0.810109 0.495554
0.075937 0.198102 0.151744 0.449359 -0.479997 0.753445
0.019439 0.353901 -0.322085 0.120568 0.529137 -0.839927
0.036192 0.324608 -0.334929 0.167304 0.414939 -0.894335
0.135803 0.255327 -0.324982 0.569922 0.280360 -0.772391
0.137059 0.343766 -0.275895 0.503084 0.516143 -0.693183
0.139154 0.214268 0.146757 -0.002462 -0.813954 0.580924
0.112948 0.219459 0.163006 0.085279 -0.963726 0.252904
0.127937 0.219968 0.171107 -0.171944 -0.984803 0.024444
0.145877 0.156193 0.161308 -0.272132 0.803496 0.529470
0.130473 0.165093 0.146690 -0.102595 0.642266 0.759585
0.143237 0.208479 0.141053 0.044044 -0.470983 0.881042
0.144018 0.193845 0.137194 -0.012655 -0.035088 0.999304
0.136547 0.082137 -0.325865 0.484064 -0.454927 -0.747478
0.147372 0.186040 0.138631 -0.219731 0.264070 0.939141
0.158616 0.198205 0.140122 -0.339349 -0.110804 0.934112
0.166659 0.188565 0.145410 -0.556640 0.234487 0.796974
0.163677 0.163589 0.163152 -0.411817 0.715332 0.564542
0.157735 0.213657 0.161158 -0.349856 -0.936801 0.002170
0.167363 0.207989 0.153496 -0.564139 -0.761916 0.318169
0.147421 0.215621 0.151528 -0.205971 -0.937442 0.280676
0.170642 0.199189 0.148204 -0.693926 -0.263456 0.670117
0.159864 0.206947 0.144042 -0.366470 -0.637011 0.678172
0.288767 0.223019 -0.054077 0.977558 0.096899 0.187058
0.266434 0.246438 0.017879 0.932377 0.218239 0.288176
0.269160 0.201387 0.036211 0.942564 0.167525 0.288979
0.244635 0.241177 0.078909 0.906328 0.270273 0.324842
0.227312 0.226548 0.144067 0.895815 0.222458 0.384744
0.184268 0.176616 0.168230 -0.531124 0.473099 0.702912
0.238730 0.169946 0.143724 0.852926 0.205227 0.480000
0.252645 0.140303 0.120965 0.946863 0.119333 0.298680
0.272375 0.134800 0.049837 0.980980 0.024823 0.192515
0.277904 0.082184 0.002125 0.994163 -0.064549 0.086446
0.293033 0.156894 -0.078552 0.995359 -0.030677 0.091214
0.290066 0.114354 -0.101570 0.990897 -0.134129 -0.011497
0.287010 0.134479 -0.147923 0.966643 -0.073495 -0.245356
0.284824 0.096513 -0.133180 0.966207 -0.193659 -0.170119
0.264645 0.132268 -0.203780 0.875957 -0.054015 -0.479355
0.186995 0.136100 -0.303800 0.705208 0.015136 -0.708839
0.192959 0.074838 -0.280095 0.575162 -0.440936 -0.689031
0.197941 0.097453 -0.287417 0.701813 -0.225452 -0.675744
0.219630 0.058637 -0.241637 0.700753 -0.414130 -0.580897
0.254667 0.085599 -0.206597 0.840435 -0.272203 -0.468588
0.271779 0.229812 -0.182196 0.859777 0.125638 -0.494974
0.244960 0.248626 -0.215528 0.770854 0.205754 -0.602868
0.235334 0.173624 -0.245240 0.787442 0.086907 -0.610231
0.190633 0.231103 -0.284394 0.705534 0.205983 -0.678080
0.165427 0.195669 -0.317405 0.651853 0.148276 -0.743708
0.280149 0.169825 -0.172405 0.922840 0.006955 -0.385121
0.285971 0.224092 -0.151651 0.953996 0.097428 -0.283547
0.289178 0.253237 -0.110787 0.981791 0.177938 -0.066515
0.293118 0.220476 -0.088524 0.995043 0.081072 0.057593
0.294394 0.185309 -0.116319 0.996478 0.005035 -0.083698
0.284390 0.263664 -0.064970 0.957957 0.237498 0.160974
0.276843 0.295953 -0.096872 0.927774 0.372265 -0.025576
0.271529 0.290622 -0.142004 0.884101 0.397432 -0.245790
0.264574 0.308025 -0.042659 0.887824 0.407564 0.213685
0.252485 0.342044 -0.072170 0.845897 0.531387 0.045662
0.171069 0.309885 -0.270635 0.616178 0.382962 -0.688233
0.224597 0.321040 -0.203453 0.743961 0.454843 -0.489530
0.247842 0.317169 -0.167264 0.792313 0.489658 -0.363972
0.255148 0.276378 -0.190202 0.790515 0.289859 -0.539507
0.268750 0.274431 -0.168517 0.861599 0.307897 -0.403542
0.207915 0.379693 -0.146283 0.686665 0.675189 -0.269464
0.195929 0.372185 -0.185905 0.665121 0.628303 -0.403546
0.184428 0.350039 -0.228900 0.631535 0.522526 -0.572827
0.172681 0.407055 -0.156226 0.579308 0.766016 -0.278606
0.154169 0.382255 -0.226863 0.534928 0.642207 -0.549019
0.158154 0.429976 -0.077050 0.475092 0.879840 -0.013031
0.162713 0.424694 -0.109959 0.501752 0.854637 -0.133570
0.195593 0.406173 -0.079542 0.604267 0.796728 -0.009281
0.223888 0.379682 -0.071693 0.737269 0.675377 0.017312
0.235205 0.348743 -0.145534 0.755485 0.587478 -0.290020
0.203282 0.394386 -0.031068 0.658197 0.733351 0.170215
0.229908 0.366317 -0.037023 0.785986 0.581532 0.209871
0.223377 0.349194 0.016053 0.801366 0.495765 0.334708
0.228782 0.294621 0.068617 0.842715 0.416483 0.341135
0.252572 0.287011 0.021542 0.885274 0.338899 0.318493
0.197368 0.340497 0.076278 0.737460 0.585139 0.337290
0.161593 0.367093 0.100521 0.625202 0.757152 0.189322
0.161064 0.376191 0.079364 0.542119 0.766364 0.344664
0.194355 0.380140 0.025774 0.668357 0.658713 0.345539
0.167299 0.397285 0.036558 0.512859 0.772000 0.375489
0.147016 0.378871 0.164463 0.468196 0.813295 -0.345461
0.158248 0.367871 0.157708 0.669543 0.700501 -0.247003
0.166049 0.359231 0.161679 0.883508 0.446987 -0.140059
0.167343 0.356531 0.140790 0.795435 0.602766 0.062893
0.174065 0.338800 0.162842 0.935521 0.338429 0.101326
0.223753 0.257396 0.129315 0.887025 0.338906 0.313577
0.203879 0.267093 0.168109 0.847057 0.297858 0.440199
0.207590 0.293848 0.132212 0.859870 0.422124 0.287116
0.177197 0.322357 0.174546 0.898900 0.299035 0.320244
0.179834 0.347966 0.107081 0.733216 0.658090 0.171206
0.170703 0.355621 0.181442 0.961590 0.225964 -0.155835
0.171544 0.336624 0.186606 0.995030 0.009472 0.099127
0.167071 0.379748 0.198066 0.811344 0.463413 -0.356327
0.168114 0.331441 0.202781 0.924447 -0.247491 0.290077
0.174087 0.226740 0.224966 0.732890 0.057862 0.677882
0.159937 0.328478 0.222086 0.794590 -0.446432 0.411491
0.192533 0.234095 0.200396 0.807436 0.139714 0.573173
0.169511 0.317081 0.195754 0.907224 0.108277 0.406474
0.170305 0.205438 0.188062 -0.391494 -0.901862 0.182693
0.157796 0.313340 0.215178 0.794886 -0.008243 0.606702
0.134406 0.315058 0.237028 0.385296 -0.410415 0.826503
0.112836 0.306125 0.242103 0.157126 0.127959 0.979254
0.145758 0.205307 0.242749 0.355795 -0.839670 0.410322
0.119669 0.315794 0.242841 0.100289 -0.386531 0.916808
0.148843 0.322194 0.231728 0.569092 -0.503419 0.650157
0.158637 0.383315 0.188242 0.592289 0.678753 -0.434152
0.147001 0.391305 0.188215 0.373307 0.791281 -0.484268
0.115689 0.390346 0.181782 -0.180130 0.897658 -0.402198
0.129836 0.390454 0.180323 0.040082 0.891813 -0.450626
0.071214 0.363165 0.194204 -0.725963 0.653410 0.214554
0.069874 0.354544 0.211218 -0.833444 0.421900 0.356891
0.064675 0.332260 0.219848 -0.540145 0.448518 0.712092
0.099762 0.219022 0.176495 0.201558 -0.978960 0.031791
0.086755 0.214422 0.188138 0.354646 -0.908900 -0.219377
-0.001169 0.325232 0.211067 0.033848 0.682096 0.730479
0.046964 0.338698 0.206500 -0.210589 0.709560 0.672441
0.063155 0.347359 0.206539 -0.534022 0.622707 0.571889
0.055508 0.351959 0.194449 -0.375717 0.793208 0.479226
0.019304 0.352710 0.185740 -0.046865 0.739076 0.671990
0.074848 0.336833 0.227208 -0.746255 0.139991 0.650774
0.043051 0.309634 0.228844 -0.185097 0.562497 0.805814
-0.000716 0.302607 0.229436 0.012215 0.550328 0.834859
0.020095 0.277796 0.244593 -0.084289 0.444502 0.891803
0.001213 0.217962 0.248300 0.233310 -0.118351 0.965173
0.093816 0.309435 0.240522 -0.193449 0.079034 0.977922
0.091829 0.321386 0.239566 -0.430108 -0.116887 0.895179
0.080396 0.328334 0.234043 -0.588268 0.019462 0.808432
0.110801 0.328732 0.249444 -0.220877 -0.440354 0.870231
0.095928 0.344739 0.250875 -0.585991 -0.256887 0.768520
0.115149 0.276052 0.253349 0.300521 0.282854 0.910868
0.144487 0.226812 0.251638 0.561914 0.107428 0.820190
0.115640 0.221642 0.266567 0.278692 0.086556 0.956472
0.127428 0.211076 0.261235 0.441671 -0.283670 0.851151
0.032189 0.210380 0.267346 -0.416512 -0.180855 0.890960
0.011942 0.239396 0.251752 -0.329524 -0.000901 0.944147
0.080844 0.244676 0.268497 0.089811 0.277578 0.956496
0.059519 0.252201 0.265958 -0.118973 0.400932 0.908349
0.014388 0.259458 0.250968 -0.163590 0.243864 0.955913
0.110447 0.414484 0.275888 -0.896445 0.306926 0.319660
0.040524 0.232456 0.269687 -0.324583 0.172225 0.930045
0.062172 0.219417 0.275007 -0.039548 0.033344 0.998661
0.087118 0.207019 0.271695 0.131171 -0.286235 0.949138
0.048580 0.203944 0.269581 -0.130055 -0.471289 0.872337
0.155605 0.409552 0.319372 0.162709 -0.648384 0.743723
0.149738 0.424549 0.328001 -0.441050 -0.412508 0.797065
0.139105 0.438207 0.321943 -0.788918 -0.024283 0.614019
0.139635 0.451479 0.316358 -0.844075 0.471451 0.255483
0.153781 0.455828 0.285347 -0.271708 0.874085 -0.402679
0.171549 0.475051 0.355750 -0.524946 0.237654 0.817284
0.176629 0.467463 0.356879 0.162722 -0.262104 0.951222
0.177918 0.478816 0.356424 0.126682 0.532445 0.836931
0.183673 0.480409 0.349243 0.743380 0.623991 0.240877
0.185640 0.474587 0.351557 0.864290 0.033373 0.501885
0.188422 0.468561 0.334898 0.951820 0.286894 -0.108304
0.173493 0.481066 0.334343 -0.173866 0.958927 -0.224119
0.171443 0.465700 0.301289 0.226210 0.835703 -0.500429
0.166862 0.478351 0.346028 -0.626770 0.722669 0.291391
0.158091 0.471986 0.326169 -0.592334 0.798614 -0.106568
0.179768 0.464344 0.307381 0.683619 0.576142 -0.448024
0.180685 0.440840 0.333404 0.683826 -0.542346 0.488102
0.183422 0.406785 0.281705 0.932536 -0.319812 0.167624
0.186375 0.439343 0.296885 0.962871 0.158378 -0.218622
0.187996 0.445574 0.321254 0.962021 -0.206311 0.178749
0.183975 0.462409 0.348741 0.741410 -0.372731 0.558016
0.175106 0.451368 0.348296 0.395122 -0.555518 0.731627
0.166868 0.444219 0.345151 -0.080398 -0.504715 0.859534
0.162831 0.455644 0.349116 -0.506077 -0.209363 0.836692
0.159862 0.464770 0.346974 -0.782695 0.212517 0.585000
0.066540 0.195384 0.265714 0.051335 -0.736762 0.674200
0.108544 0.202919 0.265065 0.269394 -0.699647 0.661756
0.176542 0.088448 0.269977 0.135199 0.344969 0.928826
0.196377 0.086066 0.261410 0.585930 0.237033 0.774920
0.190214 0.109021 0.251677 0.369285 0.618422 0.693673
0.169342 0.106303 0.259700 0.068098 0.650430 0.756507
0.146736 0.104274 0.259966 -0.145147 0.506510 0.849929
0.107798 0.199114 0.249243 0.280600 -0.937448 -0.206048
0.107657 0.100722 0.240562 -0.517493 -0.082403 0.851711
0.067467 0.084497 0.259415 0.550656 0.702038 0.451576
0.108990 0.069587 0.259143 0.749742 0.641776 0.161280
0.139728 0.076736 0.263511 -0.536136 -0.177414 0.825277
0.199697 0.064059 0.259097 0.614791 -0.174369 0.769173
0.213182 0.071621 0.245967 0.802696 0.008775 0.596324
0.169270 0.074743 0.271904 -0.107111 -0.080378 0.990993
0.107645 0.064130 0.276755 0.693681 0.587682 0.416457
0.101489 0.057880 0.289810 0.592127 0.451906 0.667208
0.094641 0.068719 0.283109 0.380830 0.752933 0.536714
0.070196 0.070180 0.293228 0.374318 0.807253 0.456320
0.059104 0.055443 0.322021 0.742147 0.432613 0.511922
0.027669 0.057007 0.371292 0.528952 0.252471 0.810227
0.054765 0.074383 0.306156 0.743967 0.569548 0.349470
0.032876 0.088920 0.343931 0.742682 0.480404 0.466515
0.058170 0.090171 0.266797 0.788612 0.468241 0.398549
0.017876 0.182400 0.257136 0.013080 0.523165 0.852131
0.021435 0.164707 0.269801 0.546905 0.578147 0.605509
0.006489 0.125622 0.326020 0.040654 0.753389 0.656317
0.017230 0.099393 0.350431 0.252211 0.652855 0.714262
0.020323 0.080286 0.364185 0.370023 0.498704 0.783822
0.002773 0.191351 0.247552 0.063319 0.506841 0.859711
0.022593 0.191846 0.254499 -0.248257 -0.014042 0.968592
0.028368 0.192396 0.256303 -0.047954 -0.437312 0.898031
0.010727 0.199060 0.246013 -0.366553 0.183236 0.912175
0.002658 0.202950 0.243634 0.201812 -0.043756 0.978446
0.051003 0.182646 0.244733 0.214455 -0.891639 0.398733
0.038492 0.181594 0.246345 0.334805 -0.609948 0.718241
0.029290 0.180869 0.253667 0.507650 -0.099285 0.855824
0.039846 0.169050 0.239816 0.826973 0.000120 0.562242
0.049108 0.131412 0.245499 0.796906 0.373992 0.474416
0.114931 0.063702 0.236669 0.521990 0.317154 0.791795
0.119024 0.064034 0.238564 -0.580680 -0.255008 0.773163
0.104048 0.077586 0.235040 0.524291 0.615215 0.588752
0.107946 0.079417 0.234096 -0.280991 -0.071333 0.957056
0.092064 0.104220 0.234956 -0.247212 0.034124 0.968360
0.070599 0.188056 0.232528 0.495855 -0.832878 -0.245850
0.058979 0.181951 0.224142 0.711521 -0.697927 -0.081458
0.045942 0.175183 0.233492 0.669672 -0.545028 0.504464
0.080822 0.120223 0.227839 -0.177242 0.398558 0.899854
0.082463 0.100260 0.235245 0.094234 0.298262 0.949821
0.064319 0.151502 0.209385 0.547611 0.576193 0.606733
0.059920 0.166197 0.201818 0.860461 0.218304 0.460381
0.052823 0.173512 0.219595 0.819022 -0.512832 0.257305
0.060336 0.179324 0.193069 0.974459 0.077860 0.210638
0.060422 0.187146 0.200972 0.908245 -0.418427 0.003091
0.081599 0.155105 0.183540 0.553453 0.714742 0.427590
0.095055 0.144773 0.191236 0.281158 0.891715 0.354676
0.080359 0.143548 0.206629 0.272765 0.881628 0.385138
0.088113 0.134301 0.221632 -0.119006 0.721637 0.681966
0.066054 0.130780 0.221970 0.393110 0.494646 0.775106
0.129451 0.143918 0.180933 -0.025857 0.958749 0.283075
0.178946 0.151269 0.197176 -0.172675 0.892252 0.417217
0.129935 0.137715 0.219381 -0.074277 0.931379 0.356393
0.169214 0.140114 0.221233 0.032692 0.834644 0.549818
0.129563 0.125585 0.239649 -0.140017 0.687738 0.712329
0.129514 0.203614 0.239265 0.034435 -0.995929 -0.083305
0.184437 0.202399 0.194962 -0.161243 -0.937216 0.309235
0.191603 0.159921 0.187046 -0.217850 0.713188 0.666261
0.195830 0.198124 0.186331 -0.066484 -0.835248 0.545840
0.196868 0.192203 0.179659 -0.300125 -0.599398 0.742056
0.197546 0.184671 0.175785 -0.447344 -0.179543 0.876155
0.209544 0.179273 0.176894 0.127159 0.047786 0.990731
0.203285 0.173555 0.179402 -0.220263 0.363530 0.905169
0.207288 0.193620 0.179694 0.333221 -0.381352 0.862284
0.208975 0.203817 0.180005 0.717368 -0.134997 0.683490
0.206182 0.111068 0.237073 0.697625 0.413540 0.585068
0.202790 0.154243 0.193231 0.226732 0.675603 0.701536
0.220420 0.143116 0.189872 0.636433 0.500791 0.586653
0.200720 0.165179 0.184335 -0.092938 0.516039 0.851508
0.220144 0.162433 0.176297 0.672207 0.367245 0.642859
0.235798 0.055012 0.199739 0.933982 -0.073681 0.349640
0.219133 0.036137 0.225069 0.794951 -0.319530 0.515708
0.175528 0.036119 0.257618 0.212771 -0.532336 0.819358
0.189278 0.045752 0.258602 0.387182 -0.391754 0.834637
0.200318 0.035807 0.245938 0.569769 -0.469308 0.674621
0.178790 0.002424 0.231495 0.447046 -0.440485 0.778539
0.193471 -0.001421 0.217163 0.658672 -0.414029 0.628276
0.228407 0.026344 0.199264 0.845874 -0.380060 0.374234
0.200920 -0.024754 0.194362 0.811447 -0.278291 0.513914
0.135581 0.001096 0.232531 -0.140438 -0.044856 0.989073
0.162663 -0.030022 0.233537 0.257458 -0.095984 0.961511
0.123101 0.001098 0.233684 0.342599 0.193798 0.919276
0.164838 -0.012777 0.234317 0.357362 -0.251147 0.899565
0.149214 0.007655 0.241911 -0.331742 -0.312291 0.890181
0.174362 0.052518 0.266264 0.049044 -0.368450 0.928353
0.149352 0.046835 0.259413 -0.310834 -0.346161 0.885186
0.162123 0.020498 0.248540 0.076608 -0.443068 0.893209
0.153687 0.019816 0.248180 -0.075157 -0.401455 0.912790
0.124642 0.044275 0.235023 0.012654 -0.199289 0.979859
0.121577 0.041922 0.237640 0.922183 0.062040 0.381746
0.120184 0.030156 0.235644 0.843678 -0.369143 0.389796
0.108264 0.020759 0.250382 0.542737 -0.816506 0.196862
0.106689 0.016761 0.245386 0.706610 -0.355124 0.612037
0.115148 -0.041996 0.251721 0.406077 0.098673 0.908496
0.053633 -0.046956 0.196887 -0.111827 -0.977428 0.179248
0.005995 -0.039129 0.214085 0.009439 -0.979513 0.201158
0.016819 -0.037496 0.248784 -0.135058 -0.990825 0.005046
0.099056 -0.004582 0.250523 0.526593 0.016837 0.849951
0.086542 0.009981 0.259331 0.477016 -0.557586 0.679377
0.075040 0.029870 0.277588 -0.432877 -0.840916 0.324773
0.052918 0.027987 0.278186 0.456236 -0.576143 0.678165
0.069332 0.027862 0.271962 -0.013135 -0.642396 0.766260
0.057980 0.020138 0.271600 0.394801 -0.167420 0.903384
0.072686 0.013782 0.267604 0.074135 -0.338227 0.938140
0.080225 0.015210 0.272534 -0.473900 -0.775211 0.417693
0.077882 0.023535 0.272872 -0.657331 -0.441400 0.610805
0.113461 0.028473 0.271677 0.803952 -0.554742 0.214295
0.118146 0.040294 0.269074 0.958823 -0.124330 0.255343
0.116746 0.053773 0.267139 0.922816 0.323420 0.209310
0.029094 0.010918 0.312560 0.880243 -0.447210 -0.158669
0.021535 -0.004979 0.292163 0.372063 -0.461991 0.805067
0.030992 -0.005975 0.286898 0.439251 0.031544 0.897810
0.022208 -0.035762 0.291477 0.101104 -0.715335 0.691429
0.018639 -0.038860 0.280644 -0.117284 -0.985742 0.120650
0.017466 -0.026312 0.295295 0.167930 -0.022102 0.985551
0.018461 -0.011083 0.291781 0.161691 0.046915 0.985726
0.006234 -0.002301 0.300044 0.048232 -0.936272 0.347950
0.016213 0.000459 0.298509 0.449370 -0.760180 0.469247
0.020223 0.046276 0.376516 0.210089 0.098469 0.972711
0.020988 0.025954 0.375110 0.190192 -0.235156 0.953168
0.008653 0.012642 0.370504 0.127165 -0.625616 0.769697
0.003844 0.005104 0.362972 -0.039476 -0.894675 0.444970
0.004453 -0.000845 0.336977 0.003563 -0.995415 0.095579
0.024174 0.003671 0.341792 0.301169 -0.953546 -0.006892
0.035068 0.005905 0.338738 0.065470 -0.995137 -0.073593
0.037215 0.008381 0.328260 0.259439 -0.704600 -0.660477
0.033571 0.026555 0.313465 0.711268 -0.680662 -0.175490
0.032999 0.036011 0.370243 0.595999 -0.015852 0.802828
0.041340 0.032268 0.305172 0.308536 -0.950709 -0.030945
0.044933 0.027714 0.322801 -0.021664 -0.834332 -0.550836
0.066009 0.035004 0.321085 0.747127 0.142663 0.649190
0.073135 0.027980 0.300277 -0.726860 -0.414964 -0.547247
0.073599 0.054899 0.308569 0.503929 0.479514 0.718417
0.112721 0.043685 0.283270 0.844853 0.127999 0.519461
0.103045 0.041787 0.294166 0.634328 0.092324 0.767531
0.078680 0.028279 0.287213 -0.906472 -0.417210 -0.065146
0.073557 0.032564 0.291370 -0.351931 -0.924007 -0.149518
0.040712 0.028350 0.289872 0.644827 -0.615874 0.452656
0.041043 0.013007 0.283714 0.633075 -0.191328 0.750073
0.048893 -0.030230 0.283685 0.382493 -0.056379 0.922237
0.068974 0.017319 0.317829 0.737988 -0.194967 0.646035
0.078245 0.012658 0.293129 -0.523796 -0.791467 -0.314988
0.100878 0.019609 0.285658 0.529252 -0.823108 0.205876
0.053965 0.023129 0.322276 -0.500028 -0.298225 -0.813040
0.047632 0.008860 0.346592 0.473169 -0.771808 0.424763
0.046780 0.020441 0.354756 0.792939 -0.109034 0.599465
0.040719 0.018656 0.328019 -0.044494 -0.230080 -0.972154
0.037339 0.018043 0.363729 0.517535 -0.415183 0.748185
0.133909 -0.070067 0.243906 -0.168258 -0.462020 0.870762
0.144354 -0.097918 0.239275 -0.814862 0.207837 0.541114
0.147964 -0.091227 0.240339 -0.200427 -0.021104 0.979481
0.151065 -0.073129 0.239945 0.270129 -0.003445 0.962818
0.175113 -0.089294 0.230008 0.530750 -0.046979 0.846225
0.158826 -0.059150 0.235414 0.301215 0.057724 0.951807
0.143732 -0.093371 0.231536 -0.994763 -0.091117 -0.046299
0.142439 -0.087118 0.238532 -0.759882 -0.383686 0.524751
0.134954 -0.078258 0.235827 -0.696585 -0.695437 0.176456
0.113293 -0.200844 0.229281 0.377522 -0.529886 0.759406
0.124661 -0.119884 0.240314 -0.654817 0.732993 -0.184215
0.139960 -0.104915 0.237571 -0.848427 0.502620 0.165969
0.155345 -0.118019 0.239879 0.435483 -0.026574 0.899805
0.176108 -0.104627 0.227361 0.741619 -0.107763 0.662109
0.144013 -0.104299 0.242406 -0.390668 0.536855 0.747773
0.121888 -0.142880 0.256924 0.495435 -0.285171 0.820501
0.120578 -0.123249 0.254260 -0.279286 0.873158 0.399493
0.113752 -0.133331 0.261666 0.303800 0.267755 0.914338
0.111658 -0.126347 0.248706 -0.351130 0.932386 -0.085816
0.035045 -0.168143 0.278534 0.155764 -0.622648 0.766842
0.064338 -0.143087 0.282421 0.323990 -0.040075 0.945211
0.035055 -0.138242 0.289771 0.147087 -0.039786 0.988323
0.070193 -0.126470 0.267636 0.039947 0.988593 -0.145220
0.043142 -0.124853 0.286126 0.227734 0.620314 0.750565
0.022543 -0.121568 0.285962 0.056395 0.952778 0.298384
-0.001687 -0.121786 0.279102 -0.013313 0.978071 -0.207847
0.009997 -0.125899 0.291605 -0.006356 0.268120 0.963365
0.031587 -0.156804 0.286470 0.153539 -0.380388 0.911993
0.000804 -0.168449 0.282440 0.002432 -0.706757 0.707452
0.087321 -0.202033 0.235606 0.156878 -0.534626 0.830400
0.007685 -0.189027 0.247806 -0.000458 -0.459844 0.887999
0.070752 -0.180612 0.258343 0.109024 -0.738506 0.665374
0.082808 -0.167659 0.265646 0.298103 -0.487929 0.820402
0.008078 -0.139949 0.230389 0.008701 0.972642 -0.232148
0.103842 -0.054402 0.255339 0.203209 -0.473833 0.856848
0.096550 -0.058632 0.240812 -0.306542 -0.951769 -0.012939
0.106262 -0.060118 0.246959 -0.228369 -0.912003 0.340733
0.097038 -0.128777 0.255773 -0.141239 0.978362 -0.151196
0.100394 -0.129970 0.264504 0.133692 0.851498 0.507028
0.088140 -0.257646 0.205106 0.355321 -0.732365 0.580852
0.115470 -0.245827 0.193912 0.476386 -0.635035 0.608101
0.084468 -0.244765 0.217806 0.321744 -0.521624 0.790183
0.107058 -0.220681 0.217647 0.408184 -0.502590 0.762095
0.105298 -0.144484 0.207118 -0.163757 0.959126 -0.230785
0.035918 -0.144043 0.198556 0.064499 0.997879 0.008758
0.074489 -0.145804 0.208829 0.002911 0.981323 -0.192348
0.003015 -0.240905 0.226963 -0.007491 -0.510769 0.859685
0.056817 -0.242754 0.223799 0.091392 -0.458470 0.883998
0.041809 -0.260991 0.212004 0.069780 -0.695173 0.715448
0.010655 -0.281188 0.171967 0.022292 -0.995271 0.094546
0.024143 -0.129657 0.158049 0.092742 0.807021 0.583194
-0.000535 -0.080041 0.150294 -0.047831 -0.589343 0.806466
0.040176 -0.050851 0.182603 0.025466 -0.905648 0.423265
0.006693 -0.047805 0.189857 0.017386 -0.891545 0.452598
0.083339 -0.146201 0.164686 0.077863 0.949941 0.302572
0.109300 -0.148094 0.175631 -0.120268 0.989325 0.082286
0.109048 -0.259879 0.175398 0.380402 -0.870428 0.312489
0.057996 -0.274841 0.183560 0.191426 -0.967146 0.167286
0.042378 -0.278954 0.151824 0.141901 -0.989823 -0.010660
0.117002 -0.140910 0.155062 -0.209651 0.850465 0.482448
0.134956 -0.255796 0.155195 0.411734 -0.898114 0.154488
0.123754 -0.143658 0.166816 -0.425062 0.879624 0.213505
0.126331 -0.143463 0.180624 -0.462549 0.881844 -0.091646
0.165897 -0.199245 0.191100 0.650315 -0.431139 0.625468
0.144525 -0.104724 0.224954 -0.858329 0.191124 -0.476176
0.146475 -0.087293 0.218857 -0.807913 -0.413916 -0.419465
0.162338 -0.086322 0.198384 -0.658268 -0.647933 -0.383230
0.135294 -0.064771 0.162286 -0.251098 -0.967300 0.035794
0.163623 -0.075288 0.157355 -0.508342 -0.853518 -0.114435
0.177333 -0.094333 0.169851 -0.979382 0.113296 -0.167255
0.174844 -0.087196 0.170027 -0.823883 -0.534623 -0.188136
0.197417 -0.051604 0.189552 0.873641 -0.091980 0.477797
0.167393 -0.093769 0.198426 -0.831895 -0.250001 -0.495430
0.181514 -0.053652 0.217596 0.778542 0.002369 0.627588
0.172084 -0.134818 0.221402 0.673111 -0.292582 0.679204
0.167223 -0.100773 0.198523 -0.828460 0.393106 -0.398900
0.191404 -0.171945 0.175423 0.828194 -0.280835 0.485002
0.166029 -0.110888 0.165721 -0.740217 0.672205 0.014814
0.189252 -0.198242 0.159118 0.802244 -0.441290 0.402079
0.211480 -0.189646 0.108912 0.817831 -0.555760 0.149273
0.178294 -0.226629 0.119233 0.654701 -0.751932 -0.077233
0.160225 -0.234820 0.111207 0.248696 -0.752950 -0.609275
0.148759 -0.249288 0.131259 0.487290 -0.861159 -0.144750
0.143356 -0.198512 0.033524 0.849864 -0.341936 0.401012
0.143400 -0.190136 0.045815 0.695057 -0.691639 0.196292
0.155921 -0.181095 0.024669 0.753817 -0.652747 0.075373
0.156560 -0.185396 0.010103 0.909030 -0.318614 0.268607
0.165667 -0.195879 0.072564 0.100203 -0.760244 -0.641864
0.223377 -0.157517 0.046318 0.395519 -0.706990 -0.586285
0.202050 -0.162877 0.044118 0.269081 -0.741770 -0.614306
0.192664 -0.151834 0.022463 0.508865 -0.750068 -0.422439
0.180229 -0.171418 0.044489 0.287582 -0.790801 -0.540306
0.177587 -0.161749 0.017448 0.675327 -0.723516 -0.143029
0.162305 -0.179769 0.047559 0.399370 -0.865297 -0.302928
0.219140 -0.154247 0.126814 0.895344 -0.127182 0.426830
0.219509 -0.178456 0.075741 0.754776 -0.637923 -0.152863
0.225604 -0.161570 0.108143 0.891136 -0.328487 0.313007
0.232285 -0.159208 0.081203 0.888673 -0.450985 0.082907
0.244913 -0.128032 0.077484 0.937540 -0.232392 0.258866
0.255931 -0.059857 0.074541 0.900805 -0.143711 0.409754
0.247654 -0.129271 0.053470 0.915828 -0.401314 -0.014365
0.255805 -0.101008 0.017432 0.896313 -0.367587 -0.247997
0.242632 -0.114202 0.010999 0.553938 -0.564066 -0.612358
0.266567 -0.055608 0.012141 0.921353 -0.207473 -0.328730
0.267382 0.029924 0.076294 0.974430 -0.059971 0.216540
0.259142 0.005992 0.095702 0.925189 -0.201183 0.321793
0.250760 -0.016919 0.102330 0.867653 -0.257233 0.425451
0.251004 0.052062 0.148608 0.964466 -0.029528 0.262554
0.174648 -0.083954 0.148283 -0.759658 -0.638266 0.124648
0.157884 -0.073011 0.140141 -0.386260 -0.887820 0.250159
0.166817 -0.082431 0.133557 -0.653796 -0.481666 0.583565
0.140501 -0.074567 0.127914 -0.145377 -0.729030 0.668865
0.156979 -0.083382 0.126118 -0.403105 -0.337642 0.850591
0.234854 -0.149787 0.048389 0.701950 -0.623612 -0.344054
0.163952 -0.092235 0.130190 -0.536285 0.304912 0.787037
0.149015 -0.106980 0.133500 -0.324565 0.626657 0.708490
0.164661 -0.108117 0.147155 -0.605460 0.682742 0.409001
0.177451 -0.090300 0.149152 -0.961107 0.093193 0.259977
0.100879 -0.209044 0.087561 0.381808 -0.902680 0.198472
0.106228 -0.210193 0.079671 0.655479 -0.497139 0.568507
0.126024 -0.199713 0.067936 0.548739 -0.820724 0.159053
0.123421 -0.207253 0.061569 0.745107 -0.468995 0.474192
0.135532 -0.199678 0.079022 0.082523 -0.868526 -0.488725
0.122535 -0.085717 0.120870 0.121025 -0.206752 0.970879
0.129396 -0.097078 0.121725 -0.029802 0.339259 0.940221
0.107404 -0.127880 0.139270 -0.035343 0.615201 0.787578
0.127594 -0.067420 0.139926 -0.074556 -0.938248 0.337835
0.014163 -0.087972 0.146115 0.060022 -0.413430 0.908556
0.039572 -0.081559 0.144881 0.199022 -0.470583 0.859618
0.002335 -0.102638 0.143128 -0.029137 -0.011542 0.999509
0.037783 -0.091851 0.141641 0.178590 -0.240075 0.954185
0.097538 -0.072518 0.133846 0.151324 -0.669555 0.727184
0.001308 -0.214190 0.098829 0.009095 -0.994422 -0.105078
0.098295 -0.213235 0.099855 -0.023477 -0.798914 -0.600987
0.056402 -0.120358 0.144719 0.136431 0.446837 0.884151
0.004894 -0.113390 0.146152 0.009255 0.413772 0.910334
0.018746 -0.120966 0.149980 0.079373 0.603222 0.793614
0.082042 -0.215013 0.089804 0.210832 -0.722680 0.658242
0.001361 -0.216719 0.094067 -0.002006 -0.676514 0.736427
0.066176 -0.254854 0.112990 0.048491 -0.411638 -0.910056
0.033630 -0.273118 0.121881 0.061903 -0.673414 -0.736670
0.023851 -0.279792 0.131733 0.077694 -0.965459 -0.248701
0.117371 -0.263004 0.131769 0.271915 -0.954997 -0.118500
0.117559 -0.259712 0.123129 0.205710 -0.776597 -0.595466
0.115790 -0.239862 0.109817 0.028666 -0.490193 -0.871143
0.088917 -0.220959 0.105328 -0.044806 -0.432216 -0.900656
0.139940 -0.218672 0.094828 -0.079752 -0.595487 -0.799397
0.101203 -0.221856 0.076062 0.508304 -0.408089 0.758347
0.121456 -0.226379 0.054352 0.740023 -0.259525 0.620493
0.137890 -0.236624 0.027579 0.844230 -0.148950 0.514868
0.126660 -0.293353 0.029801 0.762605 -0.134606 0.632705
0.106184 -0.301364 0.047309 0.543185 -0.218884 0.810580
0.003201 -0.311289 0.060094 -0.000440 -0.279369 0.960184
0.083894 -0.291257 0.060752 0.239169 -0.279047 0.930017
0.094499 -0.264772 0.064562 0.387612 -0.289458 0.875198
0.001117 -0.234012 0.084845 0.000136 -0.385520 0.922700
0.081871 -0.232160 0.080965 0.232072 -0.381758 0.894653
0.144048 -0.160084 -0.143865 0.815830 0.288666 -0.501092
0.152319 -0.303835 -0.010069 0.873019 -0.063609 0.483520
0.128956 -0.490997 -0.008621 0.633057 -0.457309 0.624586
0.102353 -0.497075 0.005334 0.267231 -0.229350 0.935941
0.156630 -0.479455 -0.036371 0.805486 -0.386195 0.449495
0.166956 -0.198173 -0.129160 0.879474 0.343313 -0.329639
0.165245 -0.172798 -0.109637 0.927417 0.247005 -0.280867
0.165402 -0.172481 -0.003795 0.878922 -0.465748 0.102836
0.167414 -0.152728 -0.078896 0.991660 -0.052791 -0.117570
0.123632 -0.183806 -0.186688 0.703711 0.372622 -0.604933
0.166331 -0.231081 -0.161569 0.796184 0.419092 -0.436409
0.125565 -0.235444 -0.218319 0.634763 0.434541 -0.638944
0.083679 -0.264844 -0.265585 0.436629 0.407422 -0.802099
0.126063 -0.289021 -0.253324 0.531471 0.443481 -0.721709
0.039906 -0.371759 -0.322519 0.121549 0.353836 -0.927376
0.015073 -0.243848 -0.276786 0.083564 0.334550 -0.938666
0.044252 -0.231920 -0.266549 0.283326 0.347481 -0.893859
0.073081 -0.188681 -0.236457 0.499357 0.319193 -0.805455
0.024667 -0.174721 -0.251997 0.183262 0.298802 -0.936554
0.018714 -0.140758 -0.243805 0.158434 0.203861 -0.966095
0.008751 -0.123694 -0.241831 0.073969 0.030695 -0.996788
0.035248 -0.118491 -0.236246 0.343917 -0.033999 -0.938384
0.048287 -0.141005 -0.233631 0.378615 0.236915 -0.894719
0.059067 -0.132109 -0.225598 0.511696 0.157634 -0.844582
0.070132 -0.114852 -0.218726 0.578950 -0.157118 -0.800081
0.049244 -0.102929 -0.235984 0.372229 -0.402339 -0.836402
0.015631 -0.108682 -0.243092 0.139482 -0.355521 -0.924202
0.023368 -0.056823 -0.272574 0.119116 -0.546284 -0.829087
0.004941 0.037749 -0.342482 0.010051 -0.543030 -0.839653
0.092422 -0.002040 -0.285166 0.412470 -0.561815 -0.717100
0.111282 -0.058558 -0.226599 0.522568 -0.558617 -0.644104
0.135211 -0.056009 -0.207170 0.547495 -0.602063 -0.581179
0.108522 -0.101813 -0.190223 0.651915 -0.477351 -0.589187
0.168024 -0.114591 -0.102027 0.738429 -0.475801 -0.477846
0.163981 -0.144361 -0.098097 0.946290 0.092378 -0.309841
0.153938 -0.133477 -0.115493 0.850096 0.184936 -0.493088
0.108377 -0.127183 -0.181234 0.766178 0.078921 -0.637764
0.105227 -0.115747 -0.186305 0.755491 -0.131308 -0.641866
0.093850 -0.142054 -0.200905 0.681765 0.215999 -0.698957
0.228012 -0.031071 -0.132497 0.720138 -0.594883 -0.357093
0.182180 -0.074753 -0.131783 0.617109 -0.617089 -0.488239
0.199203 -0.087760 -0.089103 0.716832 -0.601247 -0.353064
0.238490 -0.037284 -0.052132 0.871918 -0.463373 -0.158252
0.213107 -0.080484 -0.050245 0.807848 -0.521601 -0.274433
0.237468 -0.031067 -0.106853 0.822677 -0.536231 -0.188834
0.241906 -0.001636 -0.150020 0.784466 -0.499293 -0.367858
0.212041 -0.028381 -0.161177 0.618419 -0.628725 -0.471448
0.209325 0.005420 -0.204123 0.623033 -0.565340 -0.540575
0.187113 0.034824 -0.253476 0.541636 -0.554524 -0.631770
0.262845 0.055295 -0.166581 0.858959 -0.349636 -0.374092
0.270934 0.048265 -0.136498 0.910762 -0.336192 -0.239764
0.273839 0.042428 -0.046389 0.967123 -0.249375 -0.049843
0.270806 0.016873 -0.009653 0.971759 -0.161866 -0.171710
0.275340 0.047060 -0.003097 0.992773 -0.116452 -0.028980
0.249965 -0.091323 0.001818 0.645968 -0.369989 -0.667707
0.254092 -0.039447 -0.014744 0.742805 -0.297205 -0.599925
0.263358 -0.002594 -0.023167 0.893954 -0.320235 -0.313523
0.245265 -0.038406 -0.028734 0.793057 -0.420214 -0.441000
0.263556 0.013489 -0.052884 0.921053 -0.377039 -0.097481
0.181452 -0.244698 -0.130190 0.962887 0.262966 -0.060807
0.179920 -0.251783 -0.154660 0.885368 0.379859 -0.268011
0.172752 -0.132430 -0.075780 0.879762 -0.379459 -0.286407
0.169153 -0.169565 -0.028060 0.975809 -0.218262 0.012619
0.168770 -0.203163 -0.080815 0.991893 0.071650 0.104951
0.172198 -0.161997 -0.025863 0.847920 -0.507196 -0.154217
0.197682 -0.130327 -0.013806 0.728476 -0.609975 -0.311854
0.210739 -0.115127 -0.013030 0.688919 -0.544558 -0.478380
0.222446 -0.115061 0.000529 0.455891 -0.638744 -0.619813
0.227604 -0.091988 -0.011942 0.581616 -0.429824 -0.690633
0.198961 -0.443244 -0.123778 0.973350 -0.175175 0.147995
0.182262 -0.462262 -0.078272 0.816685 -0.557330 0.149693
0.180301 -0.253650 -0.114647 0.965956 0.098542 0.239205
0.175532 -0.323116 -0.063414 0.932873 -0.000974 0.360205
0.173495 -0.262194 -0.061627 0.975851 0.028690 0.216544
0.172437 -0.386233 -0.283782 0.535169 0.460460 -0.708216
0.204970 -0.428874 -0.159154 0.955216 -0.246584 0.163578
0.209425 -0.396207 -0.256109 0.698498 0.474446 -0.535726
0.227872 -0.403760 -0.233922 0.880797 0.400411 -0.252722
0.230974 -0.411741 -0.210068 0.962180 0.171864 0.211360
| PAWN | 0 | ffteja/cgal | Data/data/points_3/oni.pwn | [
"CC0-1.0"
] |
-- Tags: no-fasttest
DROP TABLE IF EXISTS normalize_test;
CREATE TABLE normalize_test (id int, value String) ENGINE = MergeTree ORDER BY value;
SELECT
'ё' AS norm, 'ё' AS denorm,
length(norm), length(denorm),
normalizeUTF8NFC(norm) AS norm_nfc,
normalizeUTF8NFC(denorm) AS denorm_nfc,
length(norm_nfc),
length(denorm_nfc);
INSERT INTO normalize_test (id, value) VALUES (1, 'ё');
INSERT INTO normalize_test (id, value) VALUES (2, 'ё');
INSERT INTO normalize_test (id, value) VALUES (3, 'జ్ఞా');
INSERT INTO normalize_test (id, value) VALUES (4, '本気ですか');
INSERT INTO normalize_test (id, value) VALUES (5, 'ﷺ');
INSERT INTO normalize_test (id, value) VALUES (6, 'ᾂ');
INSERT INTO normalize_test (id, value) VALUES (7, 'ΐ');
INSERT INTO normalize_test (id, value) VALUES (8, 'שּׁ');
INSERT INTO normalize_test (id, value) VALUES (9, '𝅘𝅥𝅮');
INSERT INTO normalize_test (id, value) VALUES (10, 'Q̹̣̩̭̰̰̹̄ͬ̿͋̃ṷ̬̰ͥe̘͚͈̰̺̍͐s͎̜̖t͔̣̯̲̜̠ͣ̑ͨ̉̈̈o̲͙̺͊ͯͣ̐̋̂̔ ̳͉͍̒̂è̗ͥͯͨ̍ͮ͛ ̦̹̣̰̐̅̑͑̅̂t͙̭̻̖͛̾e̺͙ͣ͒̚ṣ̠͉͓͔̲̦̎t̖͖̝͓̣ͭ͑̈́̂ỏ̥͕͈͛̓ ̀ͦ̽ͅZͯ̑̎a͆l̻ͨ̋ͧͣͨͬg͉̙̟̾̅̾ͬo̠ͮ͒');
SELECT
id, value, length(value),
normalizeUTF8NFC(value) AS nfc, length(nfc) AS nfc_len,
normalizeUTF8NFD(value) AS nfd, length(nfd) AS nfd_len,
normalizeUTF8NFKC(value) AS nfkc, length(nfkc) AS nfkc_len,
normalizeUTF8NFKD(value) AS nfkd, length(nfkd) AS nfkd_len
FROM normalize_test
ORDER BY id;
SELECT char(228) AS value, normalizeUTF8NFC(value); -- { serverError 621 }
SELECT char(228) AS value, normalizeUTF8NFD(value); -- { serverError 621 }
SELECT char(228) AS value, normalizeUTF8NFKC(value); -- { serverError 621 }
SELECT char(228) AS value, normalizeUTF8NFKD(value); -- { serverError 621 }
| SQL | 3 | pdv-ru/ClickHouse | tests/queries/0_stateless/02011_normalize_utf8.sql | [
"Apache-2.0"
] |
create database cpdt;
| SQL | 0 | WizardXiao/tidb | br/tests/lightning_checkpoint_dirty_tableid/data/cpdt-schema-create.sql | [
"Apache-2.0"
] |
{
"backup_data_uid": "cabe5c1c202f403b",
"build_compiler_vars": {
"CPU_ONLY": "ON",
"TF_VIA_MAKE": "",
"XOPENME": ""
},
"compile_deps": {
"compiler": {
"local": "yes",
"name": "GCC compiler",
"sort": 0,
"tags": "compiler,lang-cpp"
},
"lib-protobuf": {
"local": "yes",
"name": "ProtoBuf library",
"only_for_target_os_tags": [
"android"
],
"sort": 110,
"tags": "lib,protobuf"
},
"lib-protobuf-host": {
"force_target_as_host": "yes",
"local": "yes",
"name": "ProtoBuf host compiler",
"skip_installed": {
"android": "yes",
"win": "yes"
},
"sort": 115,
"tags": "lib,protobuf-host,v3.1.0"
},
"lib-tensorflow-make": {
"add_dict": "yes",
"local": "yes",
"name": "Tensorflow library 1.2.1 (via make)",
"skip_default": "yes",
"sort": 5,
"tags": "lib,tensorflow-cpu-make,v1.2.1"
},
"libjpeg": {
"local": "yes",
"name": "Jpeg library",
"sort": 10,
"tags": "lib,libjpeg"
},
"xopenme": {
"local": "yes",
"name": "xOpenME library",
"sort": 20,
"tags": "lib,xopenme"
}
},
"compiler_add_include_as_env_from_deps": [
"CK_ENV_LIB_STDCPP_INCLUDE",
"CK_ENV_LIB_STDCPP_INCLUDE_EXTRA",
"CK_ENV_LIB_TF_PROTO",
"$<<CK_ENV_LIB_TF_INCLUDE>>$/tensorflow/contrib/makefile/downloads/eigen"
],
"compiler_env": "CK_CXX",
"compiler_flags_as_env": "$<<CK_COMPILER_FLAG_CPP11>>$",
"data_name": "tensorflow-classification-cpu-1.2.1",
"extra_ld_vars": "$<<CK_EXTRA_LIB_DL>>$ $<<CK_EXTRA_LIB_M>>$ $<<CK_ENV_LIB_STDCPP_STATIC>>$ $<<CK_EXTRA_LIB_LOG>>$ $<<CK_CUSTOM_LIBS>>$",
"extra_ld_vars_first": "",
"main_language": "cpp",
"only_for_target_os_tags": [
"windows",
"linux",
"android"
],
"print_files_after_run": [
"tmp-output1.tmp",
"tmp-output2.tmp"
],
"process_in_tmp": "yes",
"program": "yes",
"run_cmds": {
"default": {
"dataset_tags": [
"image",
"jpeg",
"dataset"
],
"hot_functions": [],
"ignore_return_code": "no",
"run_time": {
"fine_grain_timer_file": "tmp-ck-timer.json",
"pre_process_via_ck": {
"data_uoa": "1c1cc5d6a4944be7",
"script_name": "preprocess"
},
"run_cmd_main": "$#BIN_FILE#$ --labels=${CK_DATASET_TENSORFLOW_AUX_TXT} --graph=${CK_DATASET_TENSORFLOW_AUX_PB} --image=$#dataset_path#$$#dataset_filename#$",
"run_cmd_out1": "tmp-output1.tmp",
"run_cmd_out2": "tmp-output2.tmp",
"run_correctness_output_files": [],
"run_input_files": [
"$<<CK_ENV_DATASET_TENSORFLOW_AUX_PB>>$",
"$<<CK_ENV_DATASET_TENSORFLOW_AUX_TXT>>$"
],
"run_output_files": [
"tmp-output1.tmp",
"tmp-output2.tmp",
"tmp-ck-timer.json"
]
}
}
},
"run_deps": {
"tensorflow-model": {
"local": "yes",
"name": "Tensorflow aux",
"sort": 1,
"tags": "tensorflowmodel,stripped"
}
},
"skip_bin_ext": "yes",
"source_files": [
"classification.cpp"
],
"tags": [
"tensorflow-classification-cpp",
"demo",
"vcpu"
],
"target_file": "classification"
}
| Arc | 3 | TITAN-PyCompat/ck-tensorflow | program/tensorflow-classification-cpu-1.2.1/.cm/meta.json.arc | [
"BSD-3-Clause"
] |
<header class="marketing-banner">
<h1 class="banner-headline no-toc no-anchor">Events</h1>
</header>
<article class="center-layout">
<aio-events></aio-events>
</article>
| HTML | 2 | John-Cassidy/angular | aio/content/marketing/events.html | [
"MIT"
] |
# Android BLE Scanner Compat library
[  ](https://search.maven.org/artifact/no.nordicsemi.android.support.v18/scanner)
The Scanner Compat library solves the problem with scanning for Bluetooth Low Energy devices on Android.
The scanner API, initially created in Android 4.3, has changed in Android 5.0 and has been extended in 6.0 and 8.0.
This library allows to use modern API even on older phones, emulating not supported features. If a feature
(for example offloaded filtering or batching) is not available natively, it will be emulated by
the compat library. Also, native filtering, batching and reporting first match or match lost may
be disabled if you find them not working on some devices. Advertising Extension (`ScanSetting#setLegacy(boolean)`
or `setPhy(int)`) is available only on Android Oreo or newer and such calls will be ignored on
older platforms where only legacy advertising packets on PHY LE 1M will be reported,
due to the Bluetooth chipset capabilities.
### Background scanning
`SCAN_MODE_LOW_POWER` or `SCAN_MODE_OPPORTUNISTIC` should be used when scanning in background.
Note, that newer Android versions will enforce using low power mode in background, even if another one has been set.
This library allows to emulate [scanning with PendingIntent](https://developer.android.com/reference/android/bluetooth/le/BluetoothLeScanner.html#startScan(java.util.List%3Candroid.bluetooth.le.ScanFilter%3E,%20android.bluetooth.le.ScanSettings,%20android.app.PendingIntent))
on pre-Oreo devices by starting a background service that will scan with requested scan mode.
This is much less battery friendly than when the original method is used, but works and saves
a lot of development time if such feature should be implemented anyway. Please read below
for more details.
Note, that for unfiltered scans, scanning is stopped on screen off to save power. Scanning is
resumed when screen is turned on again. To avoid this, use scanning with desired ScanFilter.
## Usage
The compat library may be found on Maven Central repository. Add it to your project by adding the
following dependency:
```Groovy
implementation 'no.nordicsemi.android.support.v18:scanner:{{VERSION}}'
```
Project not targeting API 31 (Android 12) or newer should use version 1.5.1.
Projects not migrated to Android Jetpack should use version 1.3.1, which is feature-equal to 1.4.0.
As JCenter has shut down, starting from version 1.4.4 the library is available only on Maven Central.
Make sure you have `mavenCentral()` in your main *build.gradle* file:
```gradle
buildscript {
repositories {
mavenCentral()
}
}
allprojects {
repositories {
mavenCentral()
}
}
```
Since version 1.5 you will need to [enable desugaring of Java 8 language features](https://developer.android.com/studio/write/java8-support.html#supported_features)
if you have not already done so.(And if you are releasing an Android library, then anyone who uses
that library will also have to enable desugaring.) We expect for nearly all Android projects to have
already enabled desugaring. But if this causes problems for you, please use version 1.4.5.
## Permissions
Following [this](https://developer.android.com/reference/android/bluetooth/le/BluetoothLeScanner#startScan(android.bluetooth.le.ScanCallback)) link:
> An app must have [ACCESS_COARSE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION)
permission in order to get results. An App targeting Android Q or later must have
[ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)
permission in order to get results.
For apps targeting [Build.VERSION_CODES#R](https://developer.android.com/reference/android/os/Build.VERSION_CODES#R)
or lower, this requires the [Manifest.permission#BLUETOOTH_ADMIN](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADMIN)
permission which can be gained with a simple `<uses-permission>` manifest tag.
For apps targeting [Build.VERSION_CODES#S](https://developer.android.com/reference/android/os/Build.VERSION_CODES#S)
or or higher, this requires the [Manifest.permission#BLUETOOTH_SCAN](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_SCAN)
permission which can be gained with
[Activity.requestPermissions(String[], int)](https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)).
In addition, this requires either the [Manifest.permission#ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)
permission or a strong assertion that you will never derive the physical location of the device.
You can make this assertion by declaring `usesPermissionFlags="neverForLocation"` on the relevant
`<uses-permission>` manifest tag, but it may restrict the types of Bluetooth devices you can interact with.
## API
The Scanner Compat API is very similar to the original one, known from Android Oreo.
Instead of getting it from the **BluetoothAdapter**, acquire the scanner instance using:
```java
BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
```
You also need to change the packets for **ScanSettings**, **ScanFilter** and **ScanCallback**
classes to:
```java
no.nordicsemi.android.support.v18.scanner
```
## Sample
To start scanning use (example):
```java
BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
ScanSettings settings = new ScanSettings.Builder()
.setLegacy(false)
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.setReportDelay(5000)
.setUseHardwareBatchingIfSupported(true)
.build();
List<ScanFilter> filters = new ArrayList<>();
filters.add(new ScanFilter.Builder().setServiceUuid(mUuid).build());
scanner.startScan(filters, settings, scanCallback);
```
to stop scanning use:
```java
BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
scanner.stopScan(scanCallback);
```
### Scanning modes
There are 4 scanning modes available in native [ScanSettings](https://developer.android.com/reference/android/bluetooth/le/ScanSettings).
3 of them are available since Android Lollipop while the opportunistic scan mode has been added in Marshmallow.
This library tries to emulate them on platforms where they are not supported natively.
1. [SCAN_MODE_LOW_POWER](https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_LOW_POWER) -
Perform Bluetooth LE scan in low power mode. This is the default scan mode as it consumes the least power.
The scanner will scan for 0.5 second and rest for 4.5 seconds. A Bluetooth LE device should advertise
very often (at least once per 100 ms) in order to be found with this mode, otherwise the scanning interval may miss some or even all
advertising events. This mode may be enforced if the scanning application is not in foreground.
2. [SCAN_MODE_BALANCED](https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_BALANCED) -
Perform Bluetooth LE scan in balanced power mode. Scan results are returned at a rate that provides a
good trade-off between scan frequency and power consumption. The scanner will scan for 2 seconds followed
by 3 seconds of idle.
3. [SCAN_MODE_LOW_LATENCY](https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_LOW_LATENCY) -
Scan using highest duty cycle. It's recommended to only use this mode when the application is running in the foreground.
4. [SCAN_MODE_OPPORTUNISTIC](https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_OPPORTUNISTIC) -
A special Bluetooth LE scan mode. Applications using this scan mode will passively listen for other scan results
without starting BLE scans themselves.
3 first modes are emulated on Android 4.3 and 4.4.x by starting a handler task that scans for a period of time
and rests in between. To set scanning and rest intervals use `Builder#setPowerSave(long,long)`.
Opportunistic scanning is not possible to emulate and will fallback to `SCAN_MODE_LOW_POWER` on Lollipop and
power save settings on pre-Lollipop devices. That means that this library actually will initiate scanning
on its own. This may have impact on battery consumption and should be used with care.
### Scan filters and batching
Offloaded filtering is available on Lollipop or newer devices where
[BluetoothAdapter#isOffloadedFilteringSupported()](https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#isOffloadedFilteringSupported())
returns *true* (when Bluetooth is enabled). If it is not supported, this library will scan without a filter and
apply the filter to the results. If you find offloaded filtering unreliable you may force using compat filtering by calling
`Builder#useHardwareFilteringIfSupported(false)`. Keep in mind that, newer Android versions may prohibit
background scanning without native filters to save battery, so this method should be used with care.
Android Scanner Compat Library may also emulate batching. To enable scan batching call `Builder#setScanDelay(interval)`
with an interval greater than 0. For intervals less 5 seconds the actual interval may vary.
If you want to get results in lower intervals, call `Builder#useHardwareBatchingIfSupported(false)`, which will
start a normal scan and report results in given interval. Emulated batching uses significantly more battery
than offloaded as it wakes CPU with every device found.
### Scanning with Pending Intent
Android 8.0 Oreo introduced [Background Execution Limits](https://developer.android.com/about/versions/oreo/background)
which made background running services short-lived. At the same time, to make background scanning possible, a new
[method](https://developer.android.com/reference/android/bluetooth/le/BluetoothLeScanner.html#startScan(java.util.List%3Candroid.bluetooth.le.ScanFilter%3E,%20android.bluetooth.le.ScanSettings,%20android.app.PendingIntent))
was added to [BluetoothLeScanner](https://developer.android.com/reference/android/bluetooth/le/BluetoothLeScanner.html)
which allows registering a [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent)
that will be sent whenever a device matching filter criteria is found. This will also work after
your application has been killed (the receiver must be added in *AndroidManifest* and the
`PendingIntent` must be created with an explicit Intent).
Starting from version 1.3.0, this library may emulate such feature on older Android versions.
In order to do that, a background service will be started after calling
`scanner.startScan(filters, settings, context, pendingIntent, requestCode)`, which will be scanning in
background with given settings and will send the given `PendingIntent` when a device
matching filter is found. To lower battery consumption it is recommended to set
`ScanSettings.SCAN_MODE_LOW_POWER` scanning mode and use filter, but even with those conditions fulfilled
**the battery consumption will be significantly higher than on Oreo+**. To stop scanning call
`scanner.stopScan(context, pendingIntent, requestCode)` with
[the same](https://developer.android.com/reference/android/app/PendingIntent) intent in parameter.
The service will be stopped when the last scan was stopped.
On Android Oreo or newer this library will use the native scanning mechanism. However, as it may also
emulate batching or apply filtering (when `useHardwareBatchingIfSupported` or `useHardwareFilteringIfSupported`
were called with parameter *false*) the library will register its own broadcast
receiver that will translate results from native to compat classes.
The receiver and service will be added automatically to the manifest even if they are not used by
the application. No changes are required to make it work.
To use this feature:
```java
Intent intent = new Intent(context, MyReceiver.class); // explicit intent
intent.setAction("com.example.ACTION_FOUND");
intent.putExtra("some.extra", value); // optional
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT);
BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_POWER)
.setReportDelay(10000)
.build();
List<ScanFilter> filters = new ArrayList<>();
filters.add(new ScanFilter.Builder().setServiceUuid(mUuid).build());
scanner.startScan(filters, settings, context, pendingIntent, requestCode);
```
Add your `MyReceiver` to *AndroidManifest*, as the application context might have been released
and all broadcast receivers registered to it together with it.
To stop scanning call:
```java
// To stop scanning use the same PendingIntent and request code as one used to start scanning.
Intent intent = new Intent(context, MyReceiver.class);
intent.setAction("com.example.ACTION_FOUND");
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
scanner.stopScan(context, pendingIntent, requestCode);
```
**Note:** Android versions 6 and 7 will not report any advertising packets when in Doze mode.
Read more about it here: https://developer.android.com/training/monitoring-device-state/doze-standby
**Note 2:** An additional parameter called `requestCode` was added in version 1.4.5 to the above API.
It is to ensure that the scanning would be correctly stopped. If not provided, a request code equal
to 0 will be used preventing from having multiple scanning tasks.
## Background scanning guidelines
To save power it is recommended to use as low power settings as possible and and use filters.
However, the more battery friendly settings are used, the longest time to finding a device.
In general, scanning with `PendingIntent` and `SCAN_MODE_LOW_POWER` or `SCAN_MODE_OPPORTUNISTIC`
should be used, together with report delay set and filters used.
`useHardwareFilteringIfSupported` and `useHardwareBatchingIfSupported` should be set to *true* (default).
Background scanning on Android 4.3 and 4.4.x will use a lot of power, as all those properties
will have to be emulated. It is recommended to scan in background only on Lollipop or newer, or
even Oreo or newer devices and giving the user an option to disable this feature.
Note, that for unfiltered scans, scanning is stopped on screen off to save power. Scanning is
resumed when screen is turned on again. To avoid this, use scanning with desired ScanFilter.
## License
The Scanner Compat library is available under BSD 3-Clause license. See the LICENSE file for more info. | Modelica | 4 | NordicSemiconductor/Android-Scanner-Compat-Library | moustache/README.mo | [
"BSD-3-Clause"
] |
module.exports = {
plugins: [
`gatsby-theme-parent`,
]
} | JavaScript | 3 | Pabelnedved/ghostlocoko | packages/gatsby/src/bootstrap/load-themes/__tests__/fixtures/resolve-from-config-location/node_modules/gatsby-theme-child/gatsby-config.js | [
"MIT"
] |
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
mkShell {
nativeBuildInputs = [
pkg-config
autoreconfHook
openssl
db5
util-linux
boost
zlib
libevent
miniupnpc
qt4
protobuf
qrencode
];
}
| Nix | 4 | just-an-dev/dogecoin | contrib/nixos/shell.nix | [
"MIT"
] |
// Solarized Syntax Theme
@import "styles/syntax-variables.less";
// Editor
@import "styles/editor.less";
// Languages
@import "styles/syntax-legacy/_base.less";
// @import "styles/syntax-legacy/c.less";
@import "styles/syntax-legacy/coffee.less";
@import "styles/syntax-legacy/css.less";
// @import "styles/syntax-legacy/go.less";
@import "styles/syntax-legacy/java.less";
// @import "styles/syntax-legacy/javascript.less";
@import "styles/syntax-legacy/markdown.less";
@import "styles/syntax-legacy/markup.less";
@import "styles/syntax-legacy/php.less";
// @import "styles/syntax-legacy/python.less";
// @import "styles/syntax-legacy/ruby.less";
@import "styles/syntax-legacy/scala.less";
@import "styles/syntax-legacy/typescript.less";
@import "styles/syntax/base.less";
@import "styles/syntax/css.less";
@import "styles/syntax/html.less";
@import "styles/syntax/js.less";
| Less | 2 | Embodimentgeniuslm3/BDB11A0E2DE062D2E39E4C5301B2FE5E | packages/solarized-light-syntax/index.less | [
"MIT"
] |
/* Copyright (c) 2017-2019 Netronome Systems, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_32=0xf0bf
#include "pkt_ipv4_tcp_x88.uc"
#include "actions_rss.uc"
.reg pkt_len
pv_get_length(pkt_len, pkt_vec)
rss_reset_test(pkt_vec)
__actions_rss(pkt_vec)
rss_validate(pkt_vec, NFP_NET_RSS_IPV4_TCP, test_assert_equal, 0x3bf00e81)
rss_validate_range(pkt_vec, NFP_NET_RSS_IPV4_TCP, excl, 0, (14 + 12))
rss_validate_range(pkt_vec, NFP_NET_RSS_IPV4_TCP, incl, (14 + 12), (14 + 12 + 8 + 4))
rss_validate_range(pkt_vec, NFP_NET_RSS_IPV4_TCP, excl, (14 + 12 + 8 + 4), pkt_len)
test_pass()
PV_SEEK_SUBROUTINE#:
pv_seek_subroutine(pkt_vec)
| UnrealScript | 3 | pcasconnetronome/nic-firmware | test/datapath/actions_rss_ipv4_tcp_no_udp_test.uc | [
"BSD-2-Clause"
] |
package com.baeldung.jacksonannotation.serialization.jsonserialize;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Source code github.com/eugenp/tutorials
*
* @author Alex Theedom www.baeldung.com
* @version 1.0
*/
public class CustomDateSerializer extends StdSerializer<Date> {
private static SimpleDateFormat formatter =
new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
public CustomDateSerializer() {
this(null);
}
public CustomDateSerializer(Class<Date> t) {
super(t);
}
@Override
public void serialize(Date value, JsonGenerator gen, SerializerProvider arg2)
throws IOException, JsonProcessingException {
gen.writeString(formatter.format(value));
}
}
| Java | 5 | zeesh49/tutorials | video-tutorials/jackson-annotations/src/main/java/com/baeldung/jacksonannotation/serialization/jsonserialize/CustomDateSerializer.java | [
"MIT"
] |
interface Add a where
add : a -> a
testAdd : Nat -> Nat -> Nat
testAdd x y = add x
where
Add Nat where
add Z = y
add (S k) = add k
| Idris | 3 | ska80/idris-jvm | tests/idris2/interface020/LocalInterface.idr | [
"BSD-3-Clause"
] |
module enum_simple(input clk, input rst);
enum {s0, s1, s2, s3} test_enum;
typedef enum logic [1:0] {
ts0, ts1, ts2, ts3
} states_t;
states_t state;
(states_t) state1;
states_t enum_const = ts1;
always @(posedge clk) begin
if (rst) begin
test_enum <= s3;
state <= ts0;
end else begin
//test_enum
if (test_enum == s0)
test_enum <= s1;
else if (test_enum == s1)
test_enum <= s2;
else if (test_enum == s2)
test_enum <= s3;
else if (test_enum == s3)
test_enum <= s0;
else
assert(1'b0); //should be unreachable
//state
if (state == ts0)
state <= ts1;
else if (state == ts1)
state <= ts2;
else if (state == ts2)
state <= ts0;
else
assert(1'b0); //should be unreachable
end
end
always @(*) begin
assert(state != 2'h3);
assert(s0 == '0);
assert(ts0 == '0);
assert(enum_const == ts1);
end
endmodule
| SystemVerilog | 4 | gudeh/yosys | tests/svtypes/enum_simple.sv | [
"ISC"
] |
package com.baeldung.folding;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class FoldingHashUnitTest {
@Test
public void givenStringJavaLanguage_whenSize2Capacity100000_then48933() throws Exception {
final FoldingHash hasher = new FoldingHash();
final int value = hasher.hash("Java language", 2, 100_000);
assertEquals(value, 48933);
}
@Test
public void givenStringVaJaLanguage_whenSize2Capacity100000_thenSameAsJavaLanguage() throws Exception {
final FoldingHash hasher = new FoldingHash();
final int java = hasher.hash("Java language", 2, 100_000);
final int vaja = hasher.hash("vaJa language", 2, 100_000);
assertTrue(java == vaja);
}
@Test
public void givenSingleElementArray_whenOffset0Size2_thenSingleElement() throws Exception {
final FoldingHash hasher = new FoldingHash();
final int[] value = hasher.extract(new int[] { 5 }, 0, 2);
assertArrayEquals(new int[] { 5 }, value);
}
@Test
public void givenFiveElementArray_whenOffset0Size3_thenFirstThreeElements() throws Exception {
final FoldingHash hasher = new FoldingHash();
final int[] value = hasher.extract(new int[] { 1, 2, 3, 4, 5 }, 0, 3);
assertArrayEquals(new int[] { 1, 2, 3 }, value);
}
@Test
public void givenFiveElementArray_whenOffset1Size2_thenTwoElements() throws Exception {
final FoldingHash hasher = new FoldingHash();
final int[] value = hasher.extract(new int[] { 1, 2, 3, 4, 5 }, 1, 2);
assertArrayEquals(new int[] { 2, 3 }, value);
}
@Test
public void givenFiveElementArray_whenOffset2SizeTooBig_thenElementsToTheEnd() throws Exception {
final FoldingHash hasher = new FoldingHash();
final int[] value = hasher.extract(new int[] { 1, 2, 3, 4, 5 }, 2, 2000);
assertArrayEquals(new int[] { 3, 4, 5 }, value);
}
}
| Java | 4 | DBatOWL/tutorials | algorithms-miscellaneous-3/src/test/java/com/baeldung/folding/FoldingHashUnitTest.java | [
"MIT"
] |
#include <ATen/Tensor.h>
#import <ATen/native/metal/MetalCommandBuffer.h>
#import <ATen/native/metal/MetalTensorImpl.h>
#import <ATen/native/metal/MetalTensorImplStorage.h>
#import <ATen/native/metal/MetalTensorUtils.h>
#import <ATen/native/metal/MetalContext.h>
#import <ATen/native/metal/mpscnn/MPSImage+Tensor.h>
#import <ATen/native/metal/mpscnn/MPSImageUtils.h>
#include <ATen/ATen.h>
#include <torch/library.h>
namespace at {
namespace native {
namespace metal {
template <typename T>
Tensor mpscnn_softmax(
const Tensor& input,
int64_t dim,
c10::optional<ScalarType> dtype) {
TORCH_CHECK(input.is_metal());
// TODO: [T87180544] Implment softmax/log_softmax in metal shaders
TORCH_CHECK(input.dim() == 2);
if(input.numel() == 0){
return makeTensor({input.sizes().vec()}, input.options());
}
std::vector<int64_t> newSize(4, 1);
if (dim == 0) {
newSize[1] = input.size(0);
newSize[2] = input.size(1);
} else {
newSize[0] = input.size(0);
newSize[1] = input.size(1);
}
auto input_ = input.view(newSize);
MPSImage* X = imageFromTensor(input_);
// MPSCNNSoftmax kernels operate on feature channels
// https://developer.apple.com/documentation/metalperformanceshaders/mpscnnsoftmax?changes=_1&language=objc
T* softmax = [[T alloc] initWithDevice:[MetalContext sharedInstance].device];
MetalTensorImplStorage mt{newSize};
MetalCommandBuffer* commandBuffer = getCommandBuffer(input_);
mt.texture()->allocateTemporaryStorage(newSize, commandBuffer);
MPSImage* Y = mt.texture()->image();
[softmax encodeToCommandBuffer:commandBuffer.buffer
sourceImage:X
destinationImage:Y];
// restore the original sizes
auto output = makeTensor(std::move(mt), input.options()).view(input.sizes());
return output;
}
Tensor log_softmax_int(
const Tensor& input,
int64_t dim,
c10::optional<ScalarType> dtype) {
return mpscnn_softmax<MPSCNNLogSoftMax>(input, dim, dtype);
}
Tensor softmax_int(
const Tensor& input,
int64_t dim,
c10::optional<ScalarType> dtype) {
return mpscnn_softmax<MPSCNNSoftMax>(input, dim, dtype);
}
TORCH_LIBRARY_IMPL(aten, Metal, m) {
m.impl("log_softmax.int", TORCH_FN(metal::log_softmax_int));
m.impl("softmax.int", TORCH_FN(metal::softmax_int));
};
}
}
}
| Objective-C++ | 4 | Hacky-DH/pytorch | aten/src/ATen/native/metal/ops/MetalSoftmax.mm | [
"Intel"
] |
# Container - controller of object properties
## Class Container
delegate = require 'delegates'
Emitter = require('events').EventEmitter
Property = require('./property')
kProp = Symbol.for('property')
class Container extends Property
logger: require('debug')('yang:container')
constructor: ->
super arguments...
@state.children = new Map # committed props
@state.pending = new Map # uncommitted changed props
@state.delta = undefined
@state.locked = false
@state.proxy =
has: (obj, key) => @children.has(key) or key of obj
get: (obj, key) => switch
when key is kProp then this
when key is '_' then this
when key is 'toJSON' then @toJSON.bind(this)
when @has(key) then @get(key)
when key of obj then obj[key]
when key is 'inspect' then @toJSON.bind(this)
when key of this and typeof @[key] is 'function' then @[key].bind(this)
when typeof key is 'string' and key[0] is '_' then @[key.substring(1)]
set: (obj, key, value) => switch
when @has(key) then @_get(key).set(value)
else obj[key] = value
deleteProperty: (obj, key) => switch
when @has(key) then @_get(key).delete()
when key of obj then delete obj[key]
Object.setPrototypeOf @state, Emitter.prototype
delegate @prototype, 'state'
.getter 'children'
.getter 'pending'
.getter 'locked'
.getter 'delta'
.method 'once'
.method 'on'
.method 'off'
.method 'emit'
@property 'props',
get: -> Array.from(@children.values())
@property 'changed',
get: -> @pending.size > 0 or @state.changed
@property 'changes',
get: -> Array.from(@pending.values())
@property 'change',
get: -> switch
when @changed and not @active then null
when @changed and @pending.size
obj = {}
obj[prop.key] = prop.change for prop from @changes
obj
when @changed then @data
@property 'data',
set: (value) -> @set value, { force: true }
get: ->
value = switch
when @binding?.get? then @binding.get @context
else @value
return value unless value instanceof Object
new Proxy value, @state.proxy
clone: ->
copy = super children: new Map, pending: new Map
copy.add prop.clone(parent: copy) for prop in @props
return copy
### add (child)
This call is used to add a child property to map of children.
add: (child) ->
@children.set child.key, child
if @value?
Object.defineProperty @value, child.key,
configurable: true
enumerable: child.active
### remove (child)
This call is used to remove a child property from map of children.
remove: (child) ->
@children.delete child.key
if @value?
delete @value[child.key]
### has (key)
has: (key) -> @children.has(key)
### get (key)
_get: (key) -> @children.get(key)
get: (key) -> switch
when key? and @has(key) then @_get(key).data
else super arguments...
### set (obj, opts)
set: (obj, opts={}) ->
# TODO: should we preserve prior changes and restore if super fails?
@pending.clear()
# TODO: should we also clear Object.defineProperties?
try obj = Object.assign {}, obj if kProp of obj
super obj, opts
# remove all props not part of pending changes
subopts = Object.assign {}, opts
#prop.delete(subopts) for prop in @props when not @pending.has(prop.key)
@props.forEach (prop) => prop.delete(subopts) unless @pending.has(prop.key)
return this
### merge (obj, opts)
Enumerate key/value of the passed in `obj` and merge into known child
properties.
merge: (obj, opts={}) ->
opts.origin ?= this
return @delete opts if obj is null
return @set obj, opts if opts.replace or not @value?
# TODO: protect this as a transaction?
{ deep = true } = opts
subopts = Object.assign {}, opts, inner: true, replace: not deep
for own k, v of obj
@debug => "[merge] looking for #{k} inside #{@children.size} children"
prop = @children.get(k) ? @in(k)
continue unless prop? and not Array.isArray(prop)
@debug => "[merge] applying value to child prop #{prop.key}"
prop.merge(v, subopts)
# TODO: we should consider evaluating schema.attrs here before calling update
@update this, opts
### update
Updates the value to the data model. Called *once* for each node that
is part of the change branch.
update: (value, opts={}) ->
opts.origin ?= this
if value instanceof Property
# handle updating pending map if value is a child prop
if value.parent is this
@pending.set value.key, value
@debug => "[update] pending.set '#{value.key}' now have #{@pending.size} pending changes"
unless value is this
# return right away if part of update on a higher node
return this if opts.inner or opts.origin is this
# higher up the tree from change origin and continue
value = @value
@debug => "[update] handle #{@pending.size} changed props"
for prop from @changes
@debug => "[update] child #{prop.uri} changed? #{prop.changed}"
@add prop, opts
@pending.delete prop.key unless prop.changed
# dynamically compute value to be used for storing into @state
value = @value if value is this
# we must clear children here if being deleted before calling super (which calls parent.update)
@children.clear() if value is null
super value, opts
@emit 'update', this, opts
return this
### commit (opts)
Commits the changes to the data model. Async transaction.
Events: commit, change
lock: (opts={}) ->
randomize = (min, max) -> Math.floor(Math.random() * (max - min)) + min
opts.seq ?= randomize 1000, 9999
@debug "[lock:#{opts.seq}] acquiring lock... already have it?", (opts.lock is this)
unless opts.lock is this
while @locked
await (new Promise (resolve) => @once 'ready', -> resolve true)
@debug "[lock:#{opts.seq}] acquired and has #{@pending.size} changes, changed? #{@changed}"
@debug "[lock:#{opts.seq}] acquired by #{opts.caller.uri} and locked? #{opts.caller.locked}" if opts.caller?
super opts
unlock: (opts={}) ->
@debug "[unlock:#{opts.seq}] freeing lock..."
return this unless @locked
super opts
@emit 'ready'
return this
commit: (opts={}) ->
try
await @lock opts
id = opts.seq ? 0
if @changed
subopts = Object.assign {}, opts, caller: this, inner: true
delete subopts.lock
# 1. commit all the changed children
@debug "[commit:#{id}] wait to commit all the children..."
await Promise.all @changes.filter((p) -> not p.locked).map (prop) -> prop.commit subopts
# 2. run the commit binding
if not opts.sync and @binding?.commit?
@debug "[commit:#{id}] executing commit binding..."
await @binding.commit @context.with(opts)
# wait for the parent to commit unless called by parent
opts.origin ?= this
unless opts.inner
subopts = Object.assign {}, opts, caller: this
@debug "[commit:#{id}] wait for parent to commit..."
await @parent?.commit? subopts
@emit 'change', opts.origin, opts.actor if not opts.suppress and not opts.inner
@clean opts unless opts.inner
catch err
@debug "[commit:#{id}] error: #{err.message}"
failed = true
throw @error err, 'commit'
finally
@debug "[commit:#{id}] finalizing... successful? ${!failed}"
await @revert opts if failed
@debug "[commit:#{id}] #{@pending.size} changes, now have #{@children.size} props, releasing lock!"
@unlock opts
return this
revert: (opts={}) ->
return unless @changed
id = opts.seq ? 0
@debug => "[revert:#{id}] changing back #{@pending.size} pending changes..."
# NOTE: save a copy of current data here since reverting changed children may alter @state.value
copy = @toJSON()
# XXX: may want to consider Promise.all here
for prop from @changes when (not prop.locked) or (prop is opts.caller)
@debug "[revert:#{id}] changing back: #{prop.key}"
await prop.revert opts
@add prop
# XXX: need to deal with scenario where child nodes reverting is sufficient?
# below is hackish but works to make a copy of current value
# to be used as ctx.prior during revert commit binding call
@state.value = copy
await super opts
@debug "[revert:#{id}] #{@children.size} remaining props"
clean: (opts={}) ->
return unless @changed
# traverse down committed nodes and clean their state
# console.warn(opts.caller) if opts.caller
id = opts.seq
@debug "[clean:#{id}] #{@pending.size} changes with #{@children.size} props"
unless @state.value?
@children.clear()
@pending.clear()
else
for prop from @changes when (not prop.locked) or (prop is opts.caller)
prop.clean opts
@pending.delete(prop.key)
@debug "[clean:#{id}] #{@pending.size} remaining changes"
super opts
### toJSON
This call creates a new copy of the current `Property.data`
completely detached/unbound to the underlying data schema. It's main
utility is to represent the current data state for subsequent
serialization/transmission. It accepts optional argument `tag` which
when called with `true` will tag the produced object with the current
property's `@name`.
toJSON: (key, state = true) ->
props = @props
value = switch
when props.length
obj = {}
for prop in props when prop.enumerable and (state or prop.mutable)
value = prop.toJSON false, state
obj[prop.key] = value if value?
obj
else @value
value = "#{@name}": value if key is true
return value
### inspect
inspect: ->
output = super arguments...
return Object.assign output, children: @children.size
module.exports = Container
| Literate CoffeeScript | 4 | EnesKilicaslan/yang-js | src/container.litcoffee | [
"Apache-2.0"
] |
import React from 'react';
import Image from '@theme/IdealImage';
import Layout from '@theme/Layout';
// import clsx from 'clsx';
import styles from './styles.module.css';
import apps from '../../data/apps';
const TITLE = 'Showcase';
const DESCRIPTION = 'See the awesome apps people are building with React Native Navigation';
const EDIT_URL = 'https://forms.gle/pyP8w73hNUhoReQ3A';
function Showcase() {
return (
<Layout title={TITLE} description={DESCRIPTION}>
<main className="margin-vert--lg">
<div className="text--center margin-bottom--xl">
<h1>{TITLE}</h1>
<p>{DESCRIPTION}</p>
<p>
<a className={'button button--primary'} href={EDIT_URL} target={'_blank'}>
Add your app!
</a>
</p>
</div>
<div className={styles.parent}>
<div className={styles.root}>
{apps.map((app) => {
return (
<div className={styles.cardContainer}>
<div className={styles.appIcon}>
<Image img={app.image} />
</div>
<div className={styles.content}>
<h4 className={styles.appName}>{app.title}</h4>
<p className={styles.appDescription}>{app.description}</p>
<div className={styles.cardFooter}>
<div className="button-group button-group--block">
{app.appStore && (
<a
className="button button--small button--secondary button--block"
href={app.appStore}
target="_blank"
rel="noreferrer noopener"
>
App Store
</a>
)}
{app.playStore && (
<a
className="button button--small button--secondary button--block"
href={app.playStore}
target="_blank"
rel="noreferrer noopener"
>
Play Store
</a>
)}
</div>
</div>
</div>
</div>
);
})}
</div>
</div>
</main>
</Layout>
);
}
export default Showcase;
| JSX | 4 | sharekey/react-native-navigation | website/src/pages/showcase/index.jsx | [
"MIT"
] |
package com.baeldung.jaxws.client;
import java.net.URL;
import java.util.List;
public class EmployeeServiceClient {
public static void main(String[] args) throws Exception {
URL url = new URL("http://localhost:8080/employeeservice?wsdl");
EmployeeService_Service employeeService_Service = new EmployeeService_Service(url);
EmployeeService employeeServiceProxy = employeeService_Service.getEmployeeServiceImplPort();
List<Employee> allEmployees = employeeServiceProxy.getAllEmployees();
}
} | Java | 4 | zeesh49/tutorials | jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeServiceClient.java | [
"MIT"
] |
/**
*
*/
import Util;
import OpenApi;
import EndpointUtil;
extends OpenApi;
init(config: OpenApi.Config){
super(config);
@endpointRule = '';
checkConfig(config);
@endpoint = getEndpoint('ddospro', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}
function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
if (!Util.empty(endpoint)) {
return endpoint;
}
if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
return endpointMap[regionId];
}
return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model ConfigSwitchPriorityRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
config?: [
{
ip?: string(name='Ip'),
priority?: int32(name='Priority'),
}
](name='Config'),
}
model ConfigSwitchPriorityResponseBody = {
requestId?: string(name='RequestId'),
}
model ConfigSwitchPriorityResponse = {
headers: map[string]string(name='headers'),
body: ConfigSwitchPriorityResponseBody(name='body'),
}
async function configSwitchPriorityWithOptions(request: ConfigSwitchPriorityRequest, runtime: Util.RuntimeOptions): ConfigSwitchPriorityResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ConfigSwitchPriority', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function configSwitchPriority(request: ConfigSwitchPriorityRequest): ConfigSwitchPriorityResponse {
var runtime = new Util.RuntimeOptions{};
return configSwitchPriorityWithOptions(request, runtime);
}
model CreateCcCustomedRuleRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
matchingRule?: string(name='MatchingRule'),
domain?: string(name='Domain'),
visitCount?: int32(name='VisitCount'),
name?: string(name='Name'),
blockingType?: string(name='BlockingType'),
interval?: int32(name='Interval'),
blockingTime?: int32(name='BlockingTime'),
uri?: string(name='Uri'),
}
model CreateCcCustomedRuleResponseBody = {
requestId?: string(name='RequestId'),
}
model CreateCcCustomedRuleResponse = {
headers: map[string]string(name='headers'),
body: CreateCcCustomedRuleResponseBody(name='body'),
}
async function createCcCustomedRuleWithOptions(request: CreateCcCustomedRuleRequest, runtime: Util.RuntimeOptions): CreateCcCustomedRuleResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('CreateCcCustomedRule', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function createCcCustomedRule(request: CreateCcCustomedRuleRequest): CreateCcCustomedRuleResponse {
var runtime = new Util.RuntimeOptions{};
return createCcCustomedRuleWithOptions(request, runtime);
}
model CreateDomainRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
ip?: string(name='Ip'),
type?: string(name='Type'),
ccEnable?: boolean(name='CcEnable'),
realServer?: [ string ](name='RealServer'),
proxyType?: [ string ](name='ProxyType'),
ips?: [ string ](name='Ips'),
}
model CreateDomainResponseBody = {
requestId?: string(name='RequestId'),
}
model CreateDomainResponse = {
headers: map[string]string(name='headers'),
body: CreateDomainResponseBody(name='body'),
}
async function createDomainWithOptions(request: CreateDomainRequest, runtime: Util.RuntimeOptions): CreateDomainResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('CreateDomain', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function createDomain(request: CreateDomainRequest): CreateDomainResponse {
var runtime = new Util.RuntimeOptions{};
return createDomainWithOptions(request, runtime);
}
model CreatePortRuleRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
frontPort?: int32(name='FrontPort'),
backPort?: int32(name='BackPort'),
proxyType?: string(name='ProxyType'),
realServerList?: string(name='RealServerList'),
ip?: string(name='Ip'),
}
model CreatePortRuleResponseBody = {
requestId?: string(name='RequestId'),
}
model CreatePortRuleResponse = {
headers: map[string]string(name='headers'),
body: CreatePortRuleResponseBody(name='body'),
}
async function createPortRuleWithOptions(request: CreatePortRuleRequest, runtime: Util.RuntimeOptions): CreatePortRuleResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('CreatePortRule', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function createPortRule(request: CreatePortRuleRequest): CreatePortRuleResponse {
var runtime = new Util.RuntimeOptions{};
return createPortRuleWithOptions(request, runtime);
}
model CreateTransmitLineRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
type?: string(name='Type'),
domain?: string(name='Domain'),
ips?: [ string ](name='Ips'),
realServers?: [ string ](name='RealServers'),
}
model CreateTransmitLineResponseBody = {
requestId?: string(name='RequestId'),
}
model CreateTransmitLineResponse = {
headers: map[string]string(name='headers'),
body: CreateTransmitLineResponseBody(name='body'),
}
async function createTransmitLineWithOptions(request: CreateTransmitLineRequest, runtime: Util.RuntimeOptions): CreateTransmitLineResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('CreateTransmitLine', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function createTransmitLine(request: CreateTransmitLineRequest): CreateTransmitLineResponse {
var runtime = new Util.RuntimeOptions{};
return createTransmitLineWithOptions(request, runtime);
}
model DeleteCcCustomedRuleRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
name?: string(name='Name'),
}
model DeleteCcCustomedRuleResponseBody = {
requestId?: string(name='RequestId'),
}
model DeleteCcCustomedRuleResponse = {
headers: map[string]string(name='headers'),
body: DeleteCcCustomedRuleResponseBody(name='body'),
}
async function deleteCcCustomedRuleWithOptions(request: DeleteCcCustomedRuleRequest, runtime: Util.RuntimeOptions): DeleteCcCustomedRuleResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DeleteCcCustomedRule', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function deleteCcCustomedRule(request: DeleteCcCustomedRuleRequest): DeleteCcCustomedRuleResponse {
var runtime = new Util.RuntimeOptions{};
return deleteCcCustomedRuleWithOptions(request, runtime);
}
model DeleteDomainRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
}
model DeleteDomainResponseBody = {
requestId?: string(name='RequestId'),
}
model DeleteDomainResponse = {
headers: map[string]string(name='headers'),
body: DeleteDomainResponseBody(name='body'),
}
async function deleteDomainWithOptions(request: DeleteDomainRequest, runtime: Util.RuntimeOptions): DeleteDomainResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DeleteDomain', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function deleteDomain(request: DeleteDomainRequest): DeleteDomainResponse {
var runtime = new Util.RuntimeOptions{};
return deleteDomainWithOptions(request, runtime);
}
model DeletePortRuleRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
frontPort?: int32(name='FrontPort'),
ip?: string(name='Ip'),
}
model DeletePortRuleResponseBody = {
requestId?: string(name='RequestId'),
}
model DeletePortRuleResponse = {
headers: map[string]string(name='headers'),
body: DeletePortRuleResponseBody(name='body'),
}
async function deletePortRuleWithOptions(request: DeletePortRuleRequest, runtime: Util.RuntimeOptions): DeletePortRuleResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DeletePortRule', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function deletePortRule(request: DeletePortRuleRequest): DeletePortRuleResponse {
var runtime = new Util.RuntimeOptions{};
return deletePortRuleWithOptions(request, runtime);
}
model DeleteTransmitLineRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
line?: string(name='Line'),
domain?: string(name='Domain'),
}
model DeleteTransmitLineResponseBody = {
requestId?: string(name='RequestId'),
}
model DeleteTransmitLineResponse = {
headers: map[string]string(name='headers'),
body: DeleteTransmitLineResponseBody(name='body'),
}
async function deleteTransmitLineWithOptions(request: DeleteTransmitLineRequest, runtime: Util.RuntimeOptions): DeleteTransmitLineResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DeleteTransmitLine', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function deleteTransmitLine(request: DeleteTransmitLineRequest): DeleteTransmitLineResponse {
var runtime = new Util.RuntimeOptions{};
return deleteTransmitLineWithOptions(request, runtime);
}
model DescribeBackSourceCidrRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
line?: string(name='Line'),
region?: string(name='Region'),
}
model DescribeBackSourceCidrResponseBody = {
requestId?: string(name='RequestId'),
cidrList?: {
cidr?: [ string ](name='Cidr')
}(name='CidrList'),
}
model DescribeBackSourceCidrResponse = {
headers: map[string]string(name='headers'),
body: DescribeBackSourceCidrResponseBody(name='body'),
}
async function describeBackSourceCidrWithOptions(request: DescribeBackSourceCidrRequest, runtime: Util.RuntimeOptions): DescribeBackSourceCidrResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeBackSourceCidr', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeBackSourceCidr(request: DescribeBackSourceCidrRequest): DescribeBackSourceCidrResponse {
var runtime = new Util.RuntimeOptions{};
return describeBackSourceCidrWithOptions(request, runtime);
}
model DescribeBizFlowRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
startTime?: long(name='StartTime'),
endTime?: long(name='EndTime'),
ip?: string(name='Ip'),
}
model DescribeBizFlowResponseBody = {
requestId?: string(name='RequestId'),
data?: {
inKbps?: [ string ](name='InKbps'),
outKbps?: [ string ](name='OutKbps'),
timeScope?: {
startTime?: long(name='StartTime'),
interval?: int32(name='Interval'),
}(name='TimeScope'),
}(name='Data'),
}
model DescribeBizFlowResponse = {
headers: map[string]string(name='headers'),
body: DescribeBizFlowResponseBody(name='body'),
}
async function describeBizFlowWithOptions(request: DescribeBizFlowRequest, runtime: Util.RuntimeOptions): DescribeBizFlowResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeBizFlow', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeBizFlow(request: DescribeBizFlowRequest): DescribeBizFlowResponse {
var runtime = new Util.RuntimeOptions{};
return describeBizFlowWithOptions(request, runtime);
}
model DescribeCcEventsRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
startTime?: long(name='StartTime'),
domain?: string(name='Domain'),
endTime?: long(name='EndTime'),
pageSize?: int32(name='PageSize'),
pageNo?: int32(name='PageNo'),
}
model DescribeCcEventsResponseBody = {
requestId?: string(name='RequestId'),
eventList?: [
{
endTime?: string(name='EndTime'),
startTime?: string(name='StartTime'),
domain?: string(name='Domain'),
attackFinished?: boolean(name='AttackFinished'),
maxQps?: int32(name='MaxQps'),
duration?: int32(name='Duration'),
blockedCount?: int32(name='BlockedCount'),
}
](name='EventList'),
total?: int32(name='Total'),
}
model DescribeCcEventsResponse = {
headers: map[string]string(name='headers'),
body: DescribeCcEventsResponseBody(name='body'),
}
async function describeCcEventsWithOptions(request: DescribeCcEventsRequest, runtime: Util.RuntimeOptions): DescribeCcEventsResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeCcEvents', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeCcEvents(request: DescribeCcEventsRequest): DescribeCcEventsResponse {
var runtime = new Util.RuntimeOptions{};
return describeCcEventsWithOptions(request, runtime);
}
model DescribeCnameAutoStatusRequest {
resourceOwnerId?: long(name='ResourceOwnerId'),
domain?: string(name='Domain'),
}
model DescribeCnameAutoStatusResponseBody = {
status?: boolean(name='Status'),
requestId?: string(name='RequestId'),
}
model DescribeCnameAutoStatusResponse = {
headers: map[string]string(name='headers'),
body: DescribeCnameAutoStatusResponseBody(name='body'),
}
async function describeCnameAutoStatusWithOptions(request: DescribeCnameAutoStatusRequest, runtime: Util.RuntimeOptions): DescribeCnameAutoStatusResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeCnameAutoStatus', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeCnameAutoStatus(request: DescribeCnameAutoStatusRequest): DescribeCnameAutoStatusResponse {
var runtime = new Util.RuntimeOptions{};
return describeCnameAutoStatusWithOptions(request, runtime);
}
model DescribeDdosAttackEventsRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
pageSize?: int32(name='PageSize'),
startTime?: long(name='StartTime'),
endTime?: long(name='EndTime'),
ip?: string(name='Ip'),
currentPage?: int32(name='CurrentPage'),
}
model DescribeDdosAttackEventsResponseBody = {
requestId?: string(name='RequestId'),
data?: {
eventList?: [
{
endTime?: long(name='EndTime'),
startTime?: long(name='StartTime'),
attackType?: string(name='AttackType'),
result?: int32(name='Result'),
duration?: string(name='Duration'),
}
](name='EventList'),
totalCount?: int32(name='TotalCount'),
}(name='Data'),
}
model DescribeDdosAttackEventsResponse = {
headers: map[string]string(name='headers'),
body: DescribeDdosAttackEventsResponseBody(name='body'),
}
async function describeDdosAttackEventsWithOptions(request: DescribeDdosAttackEventsRequest, runtime: Util.RuntimeOptions): DescribeDdosAttackEventsResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeDdosAttackEvents', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeDdosAttackEvents(request: DescribeDdosAttackEventsRequest): DescribeDdosAttackEventsResponse {
var runtime = new Util.RuntimeOptions{};
return describeDdosAttackEventsWithOptions(request, runtime);
}
model DescribeDdosAttackEventSourceIpsRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
pageSize?: int32(name='PageSize'),
startTime?: long(name='StartTime'),
endTime?: long(name='EndTime'),
ip?: string(name='Ip'),
currentPage?: int32(name='CurrentPage'),
}
model DescribeDdosAttackEventSourceIpsResponseBody = {
requestId?: string(name='RequestId'),
data?: {
ipList?: [
{
sourceIp?: string(name='SourceIp'),
inBps?: int32(name='InBps'),
city?: string(name='City'),
}
](name='IpList'),
totalCount?: int32(name='TotalCount'),
}(name='Data'),
}
model DescribeDdosAttackEventSourceIpsResponse = {
headers: map[string]string(name='headers'),
body: DescribeDdosAttackEventSourceIpsResponseBody(name='body'),
}
async function describeDdosAttackEventSourceIpsWithOptions(request: DescribeDdosAttackEventSourceIpsRequest, runtime: Util.RuntimeOptions): DescribeDdosAttackEventSourceIpsResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeDdosAttackEventSourceIps', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeDdosAttackEventSourceIps(request: DescribeDdosAttackEventSourceIpsRequest): DescribeDdosAttackEventSourceIpsResponse {
var runtime = new Util.RuntimeOptions{};
return describeDdosAttackEventSourceIpsWithOptions(request, runtime);
}
model DescribeDdosAttackTypeChartRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
startTime?: long(name='StartTime'),
endTime?: long(name='EndTime'),
ip?: string(name='Ip'),
}
model DescribeDdosAttackTypeChartResponseBody = {
attckCount?: int32(name='AttckCount'),
requestId?: string(name='RequestId'),
attckType?: string(name='AttckType'),
dropCount?: int32(name='DropCount'),
dropType?: string(name='DropType'),
}
model DescribeDdosAttackTypeChartResponse = {
headers: map[string]string(name='headers'),
body: DescribeDdosAttackTypeChartResponseBody(name='body'),
}
async function describeDdosAttackTypeChartWithOptions(request: DescribeDdosAttackTypeChartRequest, runtime: Util.RuntimeOptions): DescribeDdosAttackTypeChartResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeDdosAttackTypeChart', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeDdosAttackTypeChart(request: DescribeDdosAttackTypeChartRequest): DescribeDdosAttackTypeChartResponse {
var runtime = new Util.RuntimeOptions{};
return describeDdosAttackTypeChartWithOptions(request, runtime);
}
model DescribeDdosFlowProportionDiagramRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
startTime?: long(name='StartTime'),
endTime?: long(name='EndTime'),
ip?: string(name='Ip'),
}
model DescribeDdosFlowProportionDiagramResponseBody = {
totalBps?: int32(name='TotalBps'),
requestId?: string(name='RequestId'),
dropPps?: int32(name='DropPps'),
dropBps?: int32(name='DropBps'),
totalPps?: int32(name='TotalPps'),
}
model DescribeDdosFlowProportionDiagramResponse = {
headers: map[string]string(name='headers'),
body: DescribeDdosFlowProportionDiagramResponseBody(name='body'),
}
async function describeDdosFlowProportionDiagramWithOptions(request: DescribeDdosFlowProportionDiagramRequest, runtime: Util.RuntimeOptions): DescribeDdosFlowProportionDiagramResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeDdosFlowProportionDiagram', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeDdosFlowProportionDiagram(request: DescribeDdosFlowProportionDiagramRequest): DescribeDdosFlowProportionDiagramResponse {
var runtime = new Util.RuntimeOptions{};
return describeDdosFlowProportionDiagramWithOptions(request, runtime);
}
model DescribeDdosIpConfigRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
index?: int32(name='Index'),
pageSize?: int32(name='PageSize'),
ips?: [ string ](name='Ips'),
}
model DescribeDdosIpConfigResponseBody = {
dataList?: [
{
status?: int32(name='Status'),
cleanStatus?: int32(name='CleanStatus'),
bandwidth?: int32(name='Bandwidth'),
configDomainCount?: int32(name='ConfigDomainCount'),
line?: string(name='Line'),
elasticBandwidth?: int32(name='ElasticBandwidth'),
lbId?: string(name='LbId'),
configPortCount?: int32(name='ConfigPortCount'),
ip?: string(name='Ip'),
totalDefenseCount?: int32(name='TotalDefenseCount'),
}
](name='DataList'),
requestId?: string(name='RequestId'),
total?: int32(name='Total'),
}
model DescribeDdosIpConfigResponse = {
headers: map[string]string(name='headers'),
body: DescribeDdosIpConfigResponseBody(name='body'),
}
async function describeDdosIpConfigWithOptions(request: DescribeDdosIpConfigRequest, runtime: Util.RuntimeOptions): DescribeDdosIpConfigResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeDdosIpConfig', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeDdosIpConfig(request: DescribeDdosIpConfigRequest): DescribeDdosIpConfigResponse {
var runtime = new Util.RuntimeOptions{};
return describeDdosIpConfigWithOptions(request, runtime);
}
model DescribeDdosPeakFlowRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
startTime?: long(name='StartTime'),
endTime?: long(name='EndTime'),
ip?: string(name='Ip'),
}
model DescribeDdosPeakFlowResponseBody = {
peakFlow?: string(name='PeakFlow'),
requestId?: string(name='RequestId'),
}
model DescribeDdosPeakFlowResponse = {
headers: map[string]string(name='headers'),
body: DescribeDdosPeakFlowResponseBody(name='body'),
}
async function describeDdosPeakFlowWithOptions(request: DescribeDdosPeakFlowRequest, runtime: Util.RuntimeOptions): DescribeDdosPeakFlowResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeDdosPeakFlow', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeDdosPeakFlow(request: DescribeDdosPeakFlowRequest): DescribeDdosPeakFlowResponse {
var runtime = new Util.RuntimeOptions{};
return describeDdosPeakFlowWithOptions(request, runtime);
}
model DescribeDomainConfigPageRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
pageSize?: int32(name='PageSize'),
pageNo?: int32(name='PageNo'),
}
model DescribeDomainConfigPageResponseBody = {
requestId?: string(name='RequestId'),
total?: int32(name='Total'),
configList?: [
{
domain?: string(name='Domain'),
cname?: string(name='Cname'),
instances?: [
{
instanceRemark?: string(name='InstanceRemark'),
instanceId?: string(name='InstanceId'),
rules?: [
{
proxyTypeList?: [ string ](name='ProxyTypeList'),
line?: string(name='Line'),
realServers?: [ string ](name='RealServers'),
ip?: string(name='Ip'),
}
](name='Rules'),
}
](name='Instances'),
}
](name='ConfigList'),
}
model DescribeDomainConfigPageResponse = {
headers: map[string]string(name='headers'),
body: DescribeDomainConfigPageResponseBody(name='body'),
}
async function describeDomainConfigPageWithOptions(request: DescribeDomainConfigPageRequest, runtime: Util.RuntimeOptions): DescribeDomainConfigPageResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeDomainConfigPage', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeDomainConfigPage(request: DescribeDomainConfigPageRequest): DescribeDomainConfigPageResponse {
var runtime = new Util.RuntimeOptions{};
return describeDomainConfigPageWithOptions(request, runtime);
}
model DescribeDomainSecurityConfigRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
}
model DescribeDomainSecurityConfigResponseBody = {
requestId?: string(name='RequestId'),
ccInfo?: {
ccCustomRuleCount?: int32(name='CcCustomRuleCount'),
ccSwitch?: boolean(name='CcSwitch'),
ccTemplate?: string(name='CcTemplate'),
ccCustomRuleEnable?: boolean(name='CcCustomRuleEnable'),
}(name='CcInfo'),
cnameEnable?: boolean(name='CnameEnable'),
whiteList?: string(name='WhiteList'),
blackList?: string(name='BlackList'),
cnameMode?: int32(name='CnameMode'),
}
model DescribeDomainSecurityConfigResponse = {
headers: map[string]string(name='headers'),
body: DescribeDomainSecurityConfigResponseBody(name='body'),
}
async function describeDomainSecurityConfigWithOptions(request: DescribeDomainSecurityConfigRequest, runtime: Util.RuntimeOptions): DescribeDomainSecurityConfigResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeDomainSecurityConfig', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeDomainSecurityConfig(request: DescribeDomainSecurityConfigRequest): DescribeDomainSecurityConfigResponse {
var runtime = new Util.RuntimeOptions{};
return describeDomainSecurityConfigWithOptions(request, runtime);
}
model DescribeHealthCheckConfigRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
ip?: string(name='Ip'),
}
model DescribeHealthCheckConfigResponseBody = {
listeners?: [
{
frontendPort?: int32(name='FrontendPort'),
check?: {
type?: string(name='Type'),
timeout?: int32(name='Timeout'),
domain?: string(name='Domain'),
interval?: int32(name='Interval'),
up?: int32(name='Up'),
down?: int32(name='Down'),
port?: int32(name='Port'),
uri?: string(name='Uri'),
}(name='Check'),
protocol?: string(name='Protocol'),
backPort?: int32(name='BackPort'),
config?: {
synProxy?: string(name='SynProxy'),
persistenceTimeout?: int32(name='PersistenceTimeout'),
noDataConn?: string(name='NoDataConn'),
sla?: {
cpsEnable?: int32(name='CpsEnable'),
cps?: int32(name='Cps'),
maxConnEnable?: int32(name='MaxConnEnable'),
maxConn?: int32(name='MaxConn'),
}(name='Sla'),
payloadLength?: {
max?: int32(name='Max'),
min?: int32(name='Min'),
}(name='PayloadLength'),
slimit?: {
cpsEnable?: int32(name='CpsEnable'),
cps?: int32(name='Cps'),
maxConnEnable?: int32(name='MaxConnEnable'),
maxConn?: int32(name='MaxConn'),
}(name='Slimit'),
}(name='Config'),
}
](name='Listeners'),
requestId?: string(name='RequestId'),
}
model DescribeHealthCheckConfigResponse = {
headers: map[string]string(name='headers'),
body: DescribeHealthCheckConfigResponseBody(name='body'),
}
async function describeHealthCheckConfigWithOptions(request: DescribeHealthCheckConfigRequest, runtime: Util.RuntimeOptions): DescribeHealthCheckConfigResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeHealthCheckConfig', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeHealthCheckConfig(request: DescribeHealthCheckConfigRequest): DescribeHealthCheckConfigResponse {
var runtime = new Util.RuntimeOptions{};
return describeHealthCheckConfigWithOptions(request, runtime);
}
model DescribeInstancePageRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
pageSize?: int32(name='PageSize'),
currentPage?: int32(name='CurrentPage'),
instanceId?: string(name='InstanceId'),
line?: string(name='Line'),
instanceIdList?: [ string ](name='InstanceIdList'),
ipList?: [ string ](name='IpList'),
}
model DescribeInstancePageResponseBody = {
requestId?: string(name='RequestId'),
total?: int32(name='Total'),
instanceList?: [
{
instanceRemark?: string(name='InstanceRemark'),
ipList?: [
{
status?: int32(name='Status'),
line?: string(name='Line'),
ip?: string(name='Ip'),
instanceId?: string(name='InstanceId'),
bandWidth?: int32(name='BandWidth'),
elasticBandWidth?: int32(name='ElasticBandWidth'),
}
](name='IpList'),
instanceId?: string(name='InstanceId'),
}
](name='InstanceList'),
}
model DescribeInstancePageResponse = {
headers: map[string]string(name='headers'),
body: DescribeInstancePageResponseBody(name='body'),
}
async function describeInstancePageWithOptions(request: DescribeInstancePageRequest, runtime: Util.RuntimeOptions): DescribeInstancePageResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribeInstancePage', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describeInstancePage(request: DescribeInstancePageRequest): DescribeInstancePageResponse {
var runtime = new Util.RuntimeOptions{};
return describeInstancePageWithOptions(request, runtime);
}
model DescribePortRulePageRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
pageSize?: int32(name='PageSize'),
ip?: string(name='Ip'),
currentPage?: int32(name='CurrentPage'),
}
model DescribePortRulePageResponseBody = {
ruleList?: [
{
backProtocol?: string(name='BackProtocol'),
backPort?: int32(name='BackPort'),
lbId?: string(name='LbId'),
ip?: string(name='Ip'),
lvsType?: string(name='LvsType'),
realServer?: string(name='RealServer'),
frontPort?: int32(name='FrontPort'),
frontProtocol?: string(name='FrontProtocol'),
}
](name='RuleList'),
requestId?: string(name='RequestId'),
count?: int32(name='Count'),
}
model DescribePortRulePageResponse = {
headers: map[string]string(name='headers'),
body: DescribePortRulePageResponseBody(name='body'),
}
async function describePortRulePageWithOptions(request: DescribePortRulePageRequest, runtime: Util.RuntimeOptions): DescribePortRulePageResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('DescribePortRulePage', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function describePortRulePage(request: DescribePortRulePageRequest): DescribePortRulePageResponse {
var runtime = new Util.RuntimeOptions{};
return describePortRulePageWithOptions(request, runtime);
}
model ListCcCustomedRuleRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
pageSize?: int32(name='PageSize'),
currentPage?: int32(name='CurrentPage'),
}
model ListCcCustomedRuleResponseBody = {
totalCount?: int32(name='TotalCount'),
ruleList?: {
rule?: [
{
blockingTime?: int32(name='BlockingTime'),
blockingType?: string(name='BlockingType'),
interval?: int32(name='Interval'),
visitCount?: int32(name='VisitCount'),
name?: string(name='Name'),
uri?: string(name='Uri'),
matchingRule?: string(name='MatchingRule'),
}
](name='Rule')
}(name='RuleList'),
requestId?: string(name='RequestId'),
}
model ListCcCustomedRuleResponse = {
headers: map[string]string(name='headers'),
body: ListCcCustomedRuleResponseBody(name='body'),
}
async function listCcCustomedRuleWithOptions(request: ListCcCustomedRuleRequest, runtime: Util.RuntimeOptions): ListCcCustomedRuleResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ListCcCustomedRule', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function listCcCustomedRule(request: ListCcCustomedRuleRequest): ListCcCustomedRuleResponse {
var runtime = new Util.RuntimeOptions{};
return listCcCustomedRuleWithOptions(request, runtime);
}
model ModifyCcCustomStatusRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
enable?: boolean(name='Enable'),
}
model ModifyCcCustomStatusResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyCcCustomStatusResponse = {
headers: map[string]string(name='headers'),
body: ModifyCcCustomStatusResponseBody(name='body'),
}
async function modifyCcCustomStatusWithOptions(request: ModifyCcCustomStatusRequest, runtime: Util.RuntimeOptions): ModifyCcCustomStatusResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyCcCustomStatus', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyCcCustomStatus(request: ModifyCcCustomStatusRequest): ModifyCcCustomStatusResponse {
var runtime = new Util.RuntimeOptions{};
return modifyCcCustomStatusWithOptions(request, runtime);
}
model ModifyCcStatusRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
enable?: boolean(name='Enable'),
}
model ModifyCcStatusResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyCcStatusResponse = {
headers: map[string]string(name='headers'),
body: ModifyCcStatusResponseBody(name='body'),
}
async function modifyCcStatusWithOptions(request: ModifyCcStatusRequest, runtime: Util.RuntimeOptions): ModifyCcStatusResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyCcStatus', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyCcStatus(request: ModifyCcStatusRequest): ModifyCcStatusResponse {
var runtime = new Util.RuntimeOptions{};
return modifyCcStatusWithOptions(request, runtime);
}
model ModifyCcTemplateRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
mode?: int32(name='Mode'),
}
model ModifyCcTemplateResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyCcTemplateResponse = {
headers: map[string]string(name='headers'),
body: ModifyCcTemplateResponseBody(name='body'),
}
async function modifyCcTemplateWithOptions(request: ModifyCcTemplateRequest, runtime: Util.RuntimeOptions): ModifyCcTemplateResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyCcTemplate', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyCcTemplate(request: ModifyCcTemplateRequest): ModifyCcTemplateResponse {
var runtime = new Util.RuntimeOptions{};
return modifyCcTemplateWithOptions(request, runtime);
}
model ModifyDDoSProtectConfigRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
ip?: string(name='Ip'),
frontPort?: int32(name='FrontPort'),
configJson?: string(name='ConfigJson'),
lbId?: string(name='LbId'),
}
model ModifyDDoSProtectConfigResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyDDoSProtectConfigResponse = {
headers: map[string]string(name='headers'),
body: ModifyDDoSProtectConfigResponseBody(name='body'),
}
async function modifyDDoSProtectConfigWithOptions(request: ModifyDDoSProtectConfigRequest, runtime: Util.RuntimeOptions): ModifyDDoSProtectConfigResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyDDoSProtectConfig', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyDDoSProtectConfig(request: ModifyDDoSProtectConfigRequest): ModifyDDoSProtectConfigResponse {
var runtime = new Util.RuntimeOptions{};
return modifyDDoSProtectConfigWithOptions(request, runtime);
}
model ModifyDomainBlackWhiteListRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
black?: [ string ](name='Black'),
white?: [ string ](name='White'),
}
model ModifyDomainBlackWhiteListResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyDomainBlackWhiteListResponse = {
headers: map[string]string(name='headers'),
body: ModifyDomainBlackWhiteListResponseBody(name='body'),
}
async function modifyDomainBlackWhiteListWithOptions(request: ModifyDomainBlackWhiteListRequest, runtime: Util.RuntimeOptions): ModifyDomainBlackWhiteListResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyDomainBlackWhiteList', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyDomainBlackWhiteList(request: ModifyDomainBlackWhiteListRequest): ModifyDomainBlackWhiteListResponse {
var runtime = new Util.RuntimeOptions{};
return modifyDomainBlackWhiteListWithOptions(request, runtime);
}
model ModifyDomainProxyRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
proxyType?: [ string ](name='ProxyType'),
}
model ModifyDomainProxyResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyDomainProxyResponse = {
headers: map[string]string(name='headers'),
body: ModifyDomainProxyResponseBody(name='body'),
}
async function modifyDomainProxyWithOptions(request: ModifyDomainProxyRequest, runtime: Util.RuntimeOptions): ModifyDomainProxyResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyDomainProxy', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyDomainProxy(request: ModifyDomainProxyRequest): ModifyDomainProxyResponse {
var runtime = new Util.RuntimeOptions{};
return modifyDomainProxyWithOptions(request, runtime);
}
model ModifyElasticBandwidthRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
elasticBandwidth?: int32(name='ElasticBandwidth'),
ip?: string(name='Ip'),
}
model ModifyElasticBandwidthResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyElasticBandwidthResponse = {
headers: map[string]string(name='headers'),
body: ModifyElasticBandwidthResponseBody(name='body'),
}
async function modifyElasticBandwidthWithOptions(request: ModifyElasticBandwidthRequest, runtime: Util.RuntimeOptions): ModifyElasticBandwidthResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyElasticBandwidth', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyElasticBandwidth(request: ModifyElasticBandwidthRequest): ModifyElasticBandwidthResponse {
var runtime = new Util.RuntimeOptions{};
return modifyElasticBandwidthWithOptions(request, runtime);
}
model ModifyHealthCheckConfigRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
ip?: string(name='Ip'),
frontPort?: int32(name='FrontPort'),
configJson?: string(name='ConfigJson'),
lbId?: string(name='LbId'),
}
model ModifyHealthCheckConfigResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyHealthCheckConfigResponse = {
headers: map[string]string(name='headers'),
body: ModifyHealthCheckConfigResponseBody(name='body'),
}
async function modifyHealthCheckConfigWithOptions(request: ModifyHealthCheckConfigRequest, runtime: Util.RuntimeOptions): ModifyHealthCheckConfigResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyHealthCheckConfig', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyHealthCheckConfig(request: ModifyHealthCheckConfigRequest): ModifyHealthCheckConfigResponse {
var runtime = new Util.RuntimeOptions{};
return modifyHealthCheckConfigWithOptions(request, runtime);
}
model ModifyIpCnameStatusRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
ip?: string(name='Ip'),
enable?: boolean(name='Enable'),
}
model ModifyIpCnameStatusResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyIpCnameStatusResponse = {
headers: map[string]string(name='headers'),
body: ModifyIpCnameStatusResponseBody(name='body'),
}
async function modifyIpCnameStatusWithOptions(request: ModifyIpCnameStatusRequest, runtime: Util.RuntimeOptions): ModifyIpCnameStatusResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyIpCnameStatus', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyIpCnameStatus(request: ModifyIpCnameStatusRequest): ModifyIpCnameStatusResponse {
var runtime = new Util.RuntimeOptions{};
return modifyIpCnameStatusWithOptions(request, runtime);
}
model ModifyPersistenceTimeOutRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
ip?: string(name='Ip'),
frontPort?: int32(name='FrontPort'),
configJson?: string(name='ConfigJson'),
lbId?: string(name='LbId'),
}
model ModifyPersistenceTimeOutResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyPersistenceTimeOutResponse = {
headers: map[string]string(name='headers'),
body: ModifyPersistenceTimeOutResponseBody(name='body'),
}
async function modifyPersistenceTimeOutWithOptions(request: ModifyPersistenceTimeOutRequest, runtime: Util.RuntimeOptions): ModifyPersistenceTimeOutResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyPersistenceTimeOut', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyPersistenceTimeOut(request: ModifyPersistenceTimeOutRequest): ModifyPersistenceTimeOutResponse {
var runtime = new Util.RuntimeOptions{};
return modifyPersistenceTimeOutWithOptions(request, runtime);
}
model ModifyRealServersRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
type?: string(name='Type'),
domain?: string(name='Domain'),
line?: string(name='Line'),
realServers?: [ string ](name='RealServers'),
}
model ModifyRealServersResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyRealServersResponse = {
headers: map[string]string(name='headers'),
body: ModifyRealServersResponseBody(name='body'),
}
async function modifyRealServersWithOptions(request: ModifyRealServersRequest, runtime: Util.RuntimeOptions): ModifyRealServersResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyRealServers', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyRealServers(request: ModifyRealServersRequest): ModifyRealServersResponse {
var runtime = new Util.RuntimeOptions{};
return modifyRealServersWithOptions(request, runtime);
}
model ModifyTransmitLineRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
domain?: string(name='Domain'),
ips?: [ string ](name='Ips'),
}
model ModifyTransmitLineResponseBody = {
requestId?: string(name='RequestId'),
}
model ModifyTransmitLineResponse = {
headers: map[string]string(name='headers'),
body: ModifyTransmitLineResponseBody(name='body'),
}
async function modifyTransmitLineWithOptions(request: ModifyTransmitLineRequest, runtime: Util.RuntimeOptions): ModifyTransmitLineResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('ModifyTransmitLine', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function modifyTransmitLine(request: ModifyTransmitLineRequest): ModifyTransmitLineResponse {
var runtime = new Util.RuntimeOptions{};
return modifyTransmitLineWithOptions(request, runtime);
}
model UpdateCcCustomedRuleRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
matchingRule?: string(name='MatchingRule'),
domain?: string(name='Domain'),
visitCount?: int32(name='VisitCount'),
name?: string(name='Name'),
blockingType?: string(name='BlockingType'),
interval?: int32(name='Interval'),
blockingTime?: int32(name='BlockingTime'),
uri?: string(name='Uri'),
}
model UpdateCcCustomedRuleResponseBody = {
requestId?: string(name='RequestId'),
}
model UpdateCcCustomedRuleResponse = {
headers: map[string]string(name='headers'),
body: UpdateCcCustomedRuleResponseBody(name='body'),
}
async function updateCcCustomedRuleWithOptions(request: UpdateCcCustomedRuleRequest, runtime: Util.RuntimeOptions): UpdateCcCustomedRuleResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('UpdateCcCustomedRule', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function updateCcCustomedRule(request: UpdateCcCustomedRuleRequest): UpdateCcCustomedRuleResponse {
var runtime = new Util.RuntimeOptions{};
return updateCcCustomedRuleWithOptions(request, runtime);
}
model UpdatePortRuleRequest {
sourceIp?: string(name='SourceIp'),
lang?: string(name='Lang'),
frontPort?: int32(name='FrontPort'),
realServerList?: string(name='RealServerList'),
ip?: string(name='Ip'),
}
model UpdatePortRuleResponseBody = {
requestId?: string(name='RequestId'),
}
model UpdatePortRuleResponse = {
headers: map[string]string(name='headers'),
body: UpdatePortRuleResponseBody(name='body'),
}
async function updatePortRuleWithOptions(request: UpdatePortRuleRequest, runtime: Util.RuntimeOptions): UpdatePortRuleResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
body = Util.toMap(request),
};
return doRPCRequest('UpdatePortRule', '2017-07-25', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}
async function updatePortRule(request: UpdatePortRuleRequest): UpdatePortRuleResponse {
var runtime = new Util.RuntimeOptions{};
return updatePortRuleWithOptions(request, runtime);
}
| Tea | 5 | alibabacloud-sdk-swift/alibabacloud-sdk | ddospro-20170725/main.tea | [
"Apache-2.0"
] |
/*--------------------------------------------------*/
/* SAS Programming for R Users - code for exercises */
/* Copyright 2016 SAS Institute Inc. */
/*--------------------------------------------------*/
/*SP4R05s05*/
/*Part A*/
%macro myimport(firstyear,lastyear);
%do i=&firstyear %to &lastyear;
proc import datafile = "&path\amesbyyear.xlsx"
out = sp4r.year&i
dbms = xlsx REPLACE;
getnames = yes;
sheet = "&i";
datarow = 2;
run;
%end;
%mend;
/*Part B*/
options mprint;
%myimport(2006,2010)
| SAS | 4 | snowdj/sas-prog-for-r-users | code/SP4R05s05.sas | [
"CC-BY-4.0"
] |
20 5 2 0
0 1 21 13 7 1 19 21 9 8 10 3 2 14 15 11 17 6 20 16 4 18 5 12 [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0]
1 5 3 15 11 21 [-4 9 8 9 20 6 1 -4 3 14 16 0 18 3 3 -8 5 26 13 20 0 1 4 3 8] [9 18 3 14 11 9 3 9 12 14 10 12 5 -3 0 0 8 1 10 6 9 4 4 3 1] [8 5 6 9 5]
2 5 4 18 7 13 21 [6 8 -2 6 9 3 20 5 11 8 22 21 3 9 11 -4 -3 13 -4 4 17 16 8 -4 -1] [7 9 3 -1 1 7 10 -9 7 1 5 4 12 -3 -2 11 10 9 14 10 14 2 13 5 0] [2 -2 7 0 7 -4 21 23 14 8 20 5 21 20 18 8 9 15 1 0 0 3 5 10 5] [3 10 8 5 6]
3 5 4 9 21 12 18 [-5 6 7 3 9 13 11 5 17 0 3 0 3 2 0 -5 -3 9 4 16 6 0 2 3 2] [6 8 1 8 2] [14 12 0 15 2 10 -2 20 5 22 3 2 0 0 0 15 -7 20 -1 -6 3 -1 5 0 2] [3 2 -1 4 -1 22 7 8 -2 -6 0 0 2 0 3 -7 4 20 10 11 0 5 4 -1 2]
4 5 4 21 7 18 19 [4 5 7 5 10] [0 7 -3 -3 8 10 1 1 14 -4 8 0 21 12 0 -2 15 3 2 7 4 10 23 15 10] [7 10 1 0 -3 -2 0 10 0 15 8 14 10 21 3 2 8 -4 4 -4 17 -3 22 -3 16] [-1 0 1 -3 0 9 9 -3 7 8 15 2 7 0 -4 11 0 -2 -3 12 13 25 21 19 21]
5 5 4 19 21 7 18 [1 1 2 5 9 0 12 -2 5 10 18 0 5 18 0 15 8 4 8 6 4 3 0 6 0] [5 4 6 5 2] [13 15 0 11 2 5 8 -1 3 11 16 14 7 0 9 13 8 9 -2 9 6 2 6 0 0] [13 5 8 11 6 6 9 12 1 7 17 2 5 11 0 14 5 6 -4 6 5 3 -1 4 3]
6 5 4 13 21 7 18 [-2 10 -5 0 0 2 1 2 0 0 6 16 18 7 29 0 -3 6 6 3 -1 8 10 -2 3] [7 1 10 4 4] [18 19 4 -2 13 1 2 0 1 0 20 15 -7 20 26 11 0 6 1 -2 -3 10 0 2 -3] [9 17 2 -3 10 3 3 0 0 0 -5 7 -6 2 13 -2 -3 -3 12 6 2 5 0 -1 9]
7 5 3 9 21 14 [4 8 4 -2 -7 13 20 3 17 -3 18 0 -4 1 21 2 0 3 1 0 30 16 19 22 29] [8 9 10 1 10] [2 5 7 10 -1 1 -1 17 -1 -4 -4 22 -1 18 13 0 1 0 1 0 29 5 5 19 -8]
8 5 3 11 16 21 [-2 -2 3 4 14 1 8 7 3 2 -2 4 16 18 11 0 5 7 0 1 1 11 0 11 -2] [-4 11 1 3 15 -1 8 4 4 0 11 5 7 9 -1 3 4 1 -1 7 4 0 3 -1 7] [5 3 6 3 4]
9 5 4 7 8 10 21 [-3 -12 -19 -10 -12 -2 -14 -3 -14 -21 -24 -3 -13 -15 -16 -18 -14 -25 -19 -9 -2 -21 -15 -19 -3] [18 -2 14 7 12 9 19 3 13 16 0 2 0 1 1 24 9 -1 -5 7 2 0 1 0 2] [6 5 5 2 2 -4 23 -4 6 12 0 0 1 1 3 21 -2 15 23 24 3 3 1 0 0] [6 8 1 8 1]
10 5 5 11 19 15 12 21 [1 17 28 6 1 4 13 -4 21 0 7 2 3 5 7 3 1 7 3 5 1 9 10 4 3] [-16 -48 -65 -64 -65 -60 -56 -54 -27 -23 -66 -31 -50 -37 -30 -58 -19 -37 -22 -58 -63 -29 -40 -66 -53] [19 17 3 0 -6 17 -4 1 -2 10 9 2 9 -1 2 -2 12 11 6 8 -4 7 -3 5 1] [-13 -17 -11 -54 -41 -40 -24 -61 -45 -13 -16 -39 -51 -12 -34 -57 -43 -43 -62 -46 -22 -42 -14 -40 -26] [10 8 4 4 5]
11 5 2 21 17 [3 7 8 9 1] [1 6 0 0 1 6 -4 11 -3 15 14 12 -1 16 9 0 -6 7 19 22 3 2 0 1 3]
12 5 3 14 19 21 [-3 11 4 1 0 15 1 14 -9 -2 5 4 0 8 0 14 28 21 12 1 0 0 2 0 -1] [12 12 0 -3 2 -4 24 24 7 0 4 6 0 6 4 10 13 11 -5 3 -1 5 0 6 4] [4 10 3 10 2]
13 5 4 6 9 12 21 [-23 -21 -19 -20 -7 -10 -19 -23 -18 -17 -7 -11 -11 -9 -23 -22 -12 -23 -24 -20 -22 -14 -16 -11 -14] [22 22 28 11 10 5 5 2 4 4 27 -1 30 -8 20 6 -3 14 0 0 1 15 11 5 9] [28 15 27 28 3 -1 4 6 5 2 27 2 15 27 1 -1 4 7 2 -3 0 5 3 -3 11] [10 2 10 5 5]
14 5 3 8 10 21 [-3 25 13 27 15 -5 0 -4 10 6 3 2 0 0 1 0 6 0 6 3 0 2 0 1 6] [-8 22 16 -8 -5 17 5 18 4 15 0 0 3 0 0 8 0 4 5 2 0 2 4 1 0] [9 6 1 3 2]
15 5 4 1 16 21 17 [-99 -108 -103 -78 -69 -53 -66 -57 -87 -115 -60 -41 -90 -70 -28 -44 -74 -69 -27 -64 -91 -91 -28 -116 -102] [-84 -105 -60 -28 -89 -72 -61 -34 -114 -78 -53 -52 -70 -75 -29 -26 -26 -98 -30 -114 -32 -69 -79 -67 -42] [9 8 6 10 9] [-3 -6 -3 19 3 13 23 24 19 0 16 17 -2 -5 -1 0 -2 20 -3 1 25 4 0 23 8]
16 5 2 15 21 [8 0 21 11 -1 2 3 0 2 3 -4 3 1 21 18 6 3 1 0 5 -8 23 -4 0 -5] [8 1 8 5 9]
17 5 7 15 1 21 8 16 20 11 [-49 -69 -109 -113 -66 -78 -36 -37 -55 -72 -88 -91 -35 -62 -56 -91 -68 -89 -55 -37 -61 -93 -76 -111 -106] [-31 -106 -89 -70 -39 -38 -31 -81 -83 -24 -101 -33 -70 -60 -58 -97 -98 -59 -36 -85 -25 -88 -70 -37 -91] [4 10 6 6 8] [-97 -38 -52 -35 -93 -36 -114 -87 -96 -86 -69 -41 -60 -90 -41 -55 -110 -87 -93 -88 -79 -103 -75 -96 -105] [-103 -69 -31 -38 -40 -36 -49 -84 -29 -35 -38 -62 -78 -106 -94 -75 -34 -84 -109 -25 -82 -76 -100 -49 -60] [7 12 6 9 -1 9 22 29 9 28 -5 7 4 14 8 6 17 4 3 16 -7 0 3 -1 5] [-37 -69 -32 -97 -90 -27 -100 -91 -105 -66 -31 -81 -103 -49 -33 -53 -104 -39 -113 -70 -90 -38 -84 -87 -112]
18 5 5 4 10 21 3 8 [-14 -30 -38 -16 -36 -30 -19 -23 -10 -30 -10 -39 -24 -15 -16 -40 -23 -34 -20 -19 -26 -38 -22 -19 -34] [8 8 9 0 -1 9 -9 23 11 -2 0 4 3 2 2 2 26 8 -8 19 0 17 -4 3 -3] [3 10 2 9 10] [-7 -38 -28 -31 -37 -38 -37 -21 -26 -33 -8 -24 -25 -17 -28 -22 -34 -35 -32 -8 -39 -27 -27 -38 -15] [3 -2 5 5 3 1 8 -7 -2 -1 0 0 -1 4 1 1 24 8 -5 6 6 18 23 -8 3]
19 5 3 10 8 21 [1 5 11 15 11 0 0 0 13 11 16 17 -5 2 4 5 5 6 -1 6 -4 -8 4 18 24] [8 1 0 4 -3 6 11 0 6 0 12 7 2 0 10 5 9 -2 6 4 -7 -5 -8 22 4] [5 5 7 3 9]
20 5 5 1 15 8 21 16 [-104 -47 -48 -81 -43 -24 -77 -52 -129 -79 -100 -103 -76 -103 -110 -55 -84 -104 -112 -68 -38 -128 -78 -77 -91] [-121 -124 -102 -111 -63 -89 -123 -113 -115 -111 -53 -96 -26 -81 -56 -34 -81 -124 -87 -40 -112 -33 -52 -44 -36] [-25 -113 -29 -49 -100 -107 -33 -114 -78 -70 -71 -106 -43 -101 -40 -46 -121 -41 -67 -51 -65 -94 -123 -64 -116] [7 9 2 7 10] [-54 -30 -50 -74 -94 -79 -80 -128 -111 -24 -120 -61 -75 -58 -62 -77 -39 -29 -89 -50 -95 -63 -81 -67 -60]
21 1 0
0 1 0 0 0 0 0 0 0 0
1 1 8 2 5 4 1 3 5 4
2 5 2 5 4 1 3 5 4
3 6 2 5 4 1 3 5 4
4 9 2 5 4 1 3 5 4
5 5 2 5 4 1 3 5 4
2 1 3 2 3 1 5 4 3 5
2 10 2 3 1 5 4 3 5
3 8 2 3 1 5 4 3 5
4 5 2 3 1 5 4 3 5
5 6 2 3 1 5 4 3 5
3 1 6 4 2 2 3 4 2 2
2 8 4 2 2 3 4 2 2
3 1 4 2 2 3 4 2 2
4 8 4 2 2 3 4 2 2
5 2 4 2 2 3 4 2 2
4 1 4 2 4 4 2 4 3 1
2 5 2 4 4 2 4 3 1
3 7 2 4 4 2 4 3 1
4 5 2 4 4 2 4 3 1
5 10 2 4 4 2 4 3 1
5 1 5 3 1 1 2 2 4 3
2 4 3 1 1 2 2 4 3
3 6 3 1 1 2 2 4 3
4 5 3 1 1 2 2 4 3
5 2 3 1 1 2 2 4 3
6 1 7 5 4 3 2 1 1 1
2 1 5 4 3 2 1 1 1
3 10 5 4 3 2 1 1 1
4 4 5 4 3 2 1 1 1
5 4 5 4 3 2 1 1 1
7 1 8 2 3 3 3 1 5 4
2 9 2 3 3 3 1 5 4
3 10 2 3 3 3 1 5 4
4 1 2 3 3 3 1 5 4
5 10 2 3 3 3 1 5 4
8 1 5 2 2 2 5 1 5 1
2 3 2 2 2 5 1 5 1
3 6 2 2 2 5 1 5 1
4 3 2 2 2 5 1 5 1
5 4 2 2 2 5 1 5 1
9 1 6 2 1 1 1 2 4 2
2 8 2 1 1 1 2 4 2
3 1 2 1 1 1 2 4 2
4 8 2 1 1 1 2 4 2
5 1 2 1 1 1 2 4 2
10 1 10 3 1 5 2 3 5 4
2 8 3 1 5 2 3 5 4
3 4 3 1 5 2 3 5 4
4 4 3 1 5 2 3 5 4
5 5 3 1 5 2 3 5 4
11 1 3 4 1 4 3 1 1 3
2 7 4 1 4 3 1 1 3
3 8 4 1 4 3 1 1 3
4 9 4 1 4 3 1 1 3
5 1 4 1 4 3 1 1 3
12 1 4 3 5 1 1 5 4 1
2 10 3 5 1 1 5 4 1
3 3 3 5 1 1 5 4 1
4 10 3 5 1 1 5 4 1
5 2 3 5 1 1 5 4 1
13 1 10 2 4 1 2 3 5 5
2 2 2 4 1 2 3 5 5
3 10 2 4 1 2 3 5 5
4 5 2 4 1 2 3 5 5
5 5 2 4 1 2 3 5 5
14 1 9 1 3 2 3 5 4 4
2 6 1 3 2 3 5 4 4
3 1 1 3 2 3 5 4 4
4 3 1 3 2 3 5 4 4
5 2 1 3 2 3 5 4 4
15 1 9 3 3 5 5 3 4 3
2 8 3 3 5 5 3 4 3
3 6 3 3 5 5 3 4 3
4 10 3 3 5 5 3 4 3
5 9 3 3 5 5 3 4 3
16 1 8 1 2 1 5 4 2 2
2 1 1 2 1 5 4 2 2
3 8 1 2 1 5 4 2 2
4 5 1 2 1 5 4 2 2
5 9 1 2 1 5 4 2 2
17 1 4 4 5 3 4 3 1 1
2 10 4 5 3 4 3 1 1
3 6 4 5 3 4 3 1 1
4 6 4 5 3 4 3 1 1
5 8 4 5 3 4 3 1 1
18 1 3 5 1 1 4 2 4 3
2 10 5 1 1 4 2 4 3
3 2 5 1 1 4 2 4 3
4 9 5 1 1 4 2 4 3
5 10 5 1 1 4 2 4 3
19 1 5 2 4 5 2 1 5 4
2 5 2 4 5 2 1 5 4
3 7 2 4 5 2 1 5 4
4 3 2 4 5 2 1 5 4
5 9 2 4 5 2 1 5 4
20 1 7 1 1 5 4 1 3 5
2 9 1 1 5 4 1 3 5
3 2 1 1 5 4 1 3 5
4 7 1 1 5 4 1 3 5
5 10 1 1 5 4 1 3 5
21 1 0 0 0 0 0 0 0 0
5 5 5 5 5 70 128
| Eagle | 0 | klorel/or-tools | examples/data/rcpsp/multi_mode_max_delay/mm_j20/psp248.sch | [
"Apache-2.0"
] |
.class Linner/OuterCls$TestCls;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Linner/OuterCls;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = "TestCls"
.end annotation
.field final synthetic this$0:Linner/OuterCls;
# direct methods
.method private constructor <init>(Linner/OuterCls;)V
.locals 0
iput-object p1, p0, Linner/OuterCls$TestCls;->this$0:Linner/OuterCls;
new-instance p1, Ljava/util/ArrayList;
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
return-void
.end method
.method synthetic constructor <init>(Linner/OuterCls;Linner/OuterCls$1;)V
.locals 0
invoke-direct {p0, p1}, Linner/OuterCls$TestCls;-><init>(Linner/OuterCls;)V
return-void
.end method
| Smali | 3 | DSYliangweihao/jadx | jadx-core/src/test/smali/inner/TestAnonymousClass14/OuterCls$TestCls.smali | [
"Apache-2.0"
] |
// This file is needed to make "go build" work for package with external functions.
| GAS | 0 | Havoc-OS/androidprebuilts_go_linux-x86 | src/cmd/link/internal/ld/testdata/issue10978/main.s | [
"BSD-3-Clause"
] |
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package types
import "cmd/compile/internal/base"
// AlgKind describes the kind of algorithms used for comparing and
// hashing a Type.
type AlgKind int
//go:generate stringer -type AlgKind -trimprefix A alg.go
const (
// These values are known by runtime.
ANOEQ AlgKind = iota
AMEM0
AMEM8
AMEM16
AMEM32
AMEM64
AMEM128
ASTRING
AINTER
ANILINTER
AFLOAT32
AFLOAT64
ACPLX64
ACPLX128
// Type can be compared/hashed as regular memory.
AMEM AlgKind = 100
// Type needs special comparison/hashing functions.
ASPECIAL AlgKind = -1
)
// AlgType returns the AlgKind used for comparing and hashing Type t.
// If it returns ANOEQ, it also returns the component type of t that
// makes it incomparable.
func AlgType(t *Type) (AlgKind, *Type) {
if t.Broke() {
return AMEM, nil
}
if t.Noalg() {
return ANOEQ, t
}
switch t.Kind() {
case TANY, TFORW:
// will be defined later.
return ANOEQ, t
case TINT8, TUINT8, TINT16, TUINT16,
TINT32, TUINT32, TINT64, TUINT64,
TINT, TUINT, TUINTPTR,
TBOOL, TPTR,
TCHAN, TUNSAFEPTR:
return AMEM, nil
case TFUNC, TMAP:
return ANOEQ, t
case TFLOAT32:
return AFLOAT32, nil
case TFLOAT64:
return AFLOAT64, nil
case TCOMPLEX64:
return ACPLX64, nil
case TCOMPLEX128:
return ACPLX128, nil
case TSTRING:
return ASTRING, nil
case TINTER:
if t.IsEmptyInterface() {
return ANILINTER, nil
}
return AINTER, nil
case TSLICE:
return ANOEQ, t
case TARRAY:
a, bad := AlgType(t.Elem())
switch a {
case AMEM:
return AMEM, nil
case ANOEQ:
return ANOEQ, bad
}
switch t.NumElem() {
case 0:
// We checked above that the element type is comparable.
return AMEM, nil
case 1:
// Single-element array is same as its lone element.
return a, nil
}
return ASPECIAL, nil
case TSTRUCT:
fields := t.FieldSlice()
// One-field struct is same as that one field alone.
if len(fields) == 1 && !fields[0].Sym.IsBlank() {
return AlgType(fields[0].Type)
}
ret := AMEM
for i, f := range fields {
// All fields must be comparable.
a, bad := AlgType(f.Type)
if a == ANOEQ {
return ANOEQ, bad
}
// Blank fields, padded fields, fields with non-memory
// equality need special compare.
if a != AMEM || f.Sym.IsBlank() || IsPaddedField(t, i) {
ret = ASPECIAL
}
}
return ret, nil
}
base.Fatalf("AlgType: unexpected type %v", t)
return 0, nil
}
// TypeHasNoAlg reports whether t does not have any associated hash/eq
// algorithms because t, or some component of t, is marked Noalg.
func TypeHasNoAlg(t *Type) bool {
a, bad := AlgType(t)
return a == ANOEQ && bad.Noalg()
}
// IsComparable reports whether t is a comparable type.
func IsComparable(t *Type) bool {
a, _ := AlgType(t)
return a != ANOEQ
}
// IncomparableField returns an incomparable Field of struct Type t, if any.
func IncomparableField(t *Type) *Field {
for _, f := range t.FieldSlice() {
if !IsComparable(f.Type) {
return f
}
}
return nil
}
// IsPaddedField reports whether the i'th field of struct type t is followed
// by padding.
func IsPaddedField(t *Type, i int) bool {
if !t.IsStruct() {
base.Fatalf("IsPaddedField called non-struct %v", t)
}
end := t.width
if i+1 < t.NumFields() {
end = t.Field(i + 1).Offset
}
return t.Field(i).End() != end
}
| Go | 5 | SSSDNSY/go | src/cmd/compile/internal/types/alg.go | [
"BSD-3-Clause"
] |
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Code is borrowed from https://github.com/kaldi-asr/kaldi/blob/master/src/base/kaldi-math.h
// base/kaldi-math.h
// Copyright 2009-2011 Ondrej Glembek; Microsoft Corporation; Yanmin Qian;
// Jan Silovsky; Saarland University
//
// See ../../COPYING for clarification regarding multiple authors
//
// 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
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing permissions and
// limitations under the License.
#ifndef __OPENCV_DNN_MATH_UTILS_HPP__
#define __OPENCV_DNN_MATH_UTILS_HPP__
#ifdef OS_QNX
#include <math.h>
#else
#include <cmath>
#endif
#include <limits>
#ifndef FLT_EPSILON
#define FLT_EPSILON 1.19209290e-7f
#endif
namespace cv { namespace dnn {
const float kNegativeInfinity = -std::numeric_limits<float>::infinity();
const float kMinLogDiffFloat = std::log(FLT_EPSILON);
#if !defined(_MSC_VER) || (_MSC_VER >= 1700)
inline float Log1p(float x) { return log1pf(x); }
#else
inline float Log1p(float x) {
const float cutoff = 1.0e-07;
if (x < cutoff)
return x - 2 * x * x;
else
return Log(1.0 + x);
}
#endif
inline float Exp(float x) { return expf(x); }
inline float LogAdd(float x, float y) {
float diff;
if (x < y) {
diff = x - y;
x = y;
} else {
diff = y - x;
}
// diff is negative. x is now the larger one.
if (diff >= kMinLogDiffFloat) {
float res;
res = x + Log1p(Exp(diff));
return res;
} else {
return x; // return the larger one.
}
}
}} // namespace
#endif // __OPENCV_DNN_MATH_UTILS_HPP__
| C++ | 4 | xipingyan/opencv | modules/dnn/src/math_utils.hpp | [
"Apache-2.0"
] |
package com.baeldung.restassured.learner;
import io.restassured.module.mockmvc.RestAssuredMockMvc;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import java.util.Collections;
import static io.restassured.http.ContentType.JSON;
import static io.restassured.module.mockmvc.RestAssuredMockMvc.given;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.when;
import static org.springframework.http.HttpStatus.NOT_FOUND;
import static org.springframework.http.HttpStatus.OK;
@RunWith(MockitoJUnitRunner.class)
public class CourseControllerUnitTest {
@Mock
private CourseService courseService;
@InjectMocks
private CourseController courseController;
@InjectMocks
private CourseControllerExceptionHandler courseControllerExceptionHandler;
@Before
public void initialiseRestAssuredMockMvcStandalone() {
RestAssuredMockMvc.standaloneSetup(courseController, courseControllerExceptionHandler);
}
@Test
public void givenNoExistingCoursesWhenGetCoursesThenRespondWithStatusOkAndEmptyArray() {
when(courseService.getCourses()).thenReturn(Collections.emptyList());
given()
.when()
.get("/courses")
.then()
.log().ifValidationFails()
.statusCode(OK.value())
.contentType(JSON)
.body(is(equalTo("[]")));
}
@Test
public void givenNoMatchingCoursesWhenGetCoursesThenRespondWithStatusNotFound() {
String nonMatchingCourseCode = "nonMatchingCourseCode";
when(courseService.getCourse(nonMatchingCourseCode)).thenThrow(new CourseNotFoundException(nonMatchingCourseCode));
given()
.when()
.get("/courses/" + nonMatchingCourseCode)
.then()
.log().ifValidationFails()
.statusCode(NOT_FOUND.value());
}
}
| Java | 5 | DBatOWL/tutorials | testing-modules/rest-assured/src/test/java/com/baeldung/restassured/learner/CourseControllerUnitTest.java | [
"MIT"
] |
module jsonToDynamicObject
function toDynamicObjectTree = |obj| {
let isJSONObject = |obj| -> obj oftype org.json.simple.JSONObject.class
let isJSONArray = |obj| -> obj oftype org.json.simple.JSONArray.class
let parse = |level, obj, dyno| {
let parseMembers = |obj, dyno| {
obj: each(|key, value| {
dyno: define(key, value)
parse(key, value, dyno)
})
}
if isJSONObject(obj) {
if level is null { # root
parseMembers(obj, dyno)
} else {
dyno: define(level, DynamicObject())
parseMembers(obj, dyno: get(level))
}
} else if isJSONArray(obj) {
dyno: define(level, list[])
obj: each(|item| {
if isJSONObject(item) is false and isJSONArray(item) is false {
dyno: get(level): append(item)
} else if isJSONObject(item) {
let subDyno = DynamicObject()
parseMembers(item, subDyno)
dyno: get(level): append(subDyno)
}
})
}
return dyno
}
return parse(null, obj, DynamicObject())
}
function toDynamicObjectTreeFromString = |str| -> toDynamicObjectTree(JSON.parse(str))
| Golo | 4 | ajnavarro/language-dataset | data/github.com/k33g/files/47df1abcb511c8e6de95af6725ef6f1d207f5236/snippets/golo/json/jsonToDynamicObject.golo | [
"MIT"
] |
#SingleInstance force
#Persistent
#include Lib\AutoHotInterception.ahk
global AHI := new AutoHotInterception()
keyboardId := AHI.GetKeyboardId(0x04F2, 0x0112)
AHI.SubscribeKey(keyboardId, GetKeySC("2"), true, Func("KeyEvent"))
cm1 := AHI.CreateContextManager(keyboardId)
return
KeyEvent(state){
static ctrlCode := GetKeySC("Ctrl")
global keyboardId
;~ AHI.SendKeyEvent(keyboardId, ctrlCode, state)
ToolTip % "State: " state
}
#if cm1.IsActive
::aaa::JACKPOT
1::
ToolTip % "KEY DOWN EVENT @ " A_TickCount
return
1 up::
ToolTip % "KEY UP EVENT @ " A_TickCount
return
#if
^Esc::
ExitApp | AutoHotkey | 4 | AlexVallat/AutoHotInterception | Combined Example.ahk | [
"MIT"
] |
display "hello".
| COBOL | 0 | jmptrader/CobolScript | test/files/hello.cob | [
"MIT"
] |
<!DOCTYPE html>
<html>
<head>
<title>Keyboarb Shortcuts</title>
<script data-main="app" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js"></script>
</head>
<body>
<label>Keyboard shortcut sequence</label>
<input type="text" placeholder="Ctrl+Alt+D">
<button>Add</button>
<p>Keyboard shortcuts:</p>
<ul>
</ul>
</body>
</html>
| HTML | 2 | ignatandrei/RxJS | examples/keyboard-shortcuts/keyboard-shortcuts.html | [
"Apache-2.0"
] |
.style {
grid-template-columns: fit-content(8ch) fit-content(8ch) 1fr;
}
| CSS | 2 | vjpr/swc | css/parser/tests/fixture/rome/fit-content/input.css | [
"Apache-2.0",
"MIT"
] |
<!DOCTYPE html>
<html>
<style>
* {
padding: 0;
margin: 0;
}
</style>
<body>
<a href="about:blank>" target="_blank">CLICK</a>
</body>
</html>
| HTML | 1 | lingxiao-Zhu/electron | spec/fixtures/pages/window-no-javascript.html | [
"MIT"
] |
require "./sys/types"
require "./time"
lib LibC
SIGHUP = 1
SIGINT = 2
SIGQUIT = 3
SIGILL = 4
SIGTRAP = 5
SIGIOT = LibC::SIGABRT
SIGABRT = 6
SIGFPE = 8
SIGKILL = 9
SIGBUS = 10
SIGSEGV = 11
SIGSYS = 12
SIGPIPE = 13
SIGALRM = 14
SIGTERM = 15
SIGURG = 16
SIGSTOP = 17
SIGTSTP = 18
SIGCONT = 19
SIGCHLD = 20
SIGTTIN = 21
SIGTTOU = 22
SIGIO = 23
SIGXCPU = 24
SIGXFSZ = 25
SIGVTALRM = 26
SIGUSR1 = 30
SIGUSR2 = 31
SIGEMT = 7
SIGINFO = 29
SIGWINCH = 28
MAX_PAGE_SHIFT = 12_u32
MINSIGSTKSZ = 3_u64 << LibC::MAX_PAGE_SHIFT
SIGSTKSZ = LibC::MINSIGSTKSZ + (1_u64 << LibC::MAX_PAGE_SHIFT) * 4
SIG_SETMASK = 3
alias SighandlerT = Int ->
alias SigsetT = UInt32
SIG_DFL = SighandlerT.new(Pointer(Void).new(0_u64), Pointer(Void).null)
SIG_IGN = SighandlerT.new(Pointer(Void).new(1_u64), Pointer(Void).null)
SA_ONSTACK = 0x0001
SA_SIGINFO = 0x0040
struct SiginfoT
si_signo : Int
si_code : Int
si_errno : Int
si_addr : Void*
_pad : StaticArray(UInt8, 108)
end
alias SigactionHandlerT = (Int, SiginfoT*, Void*) ->
struct Sigaction
# Technically a union, but only one can be valid and we only use sa_sigaction
# and not sa_handler (which would be a SighandlerT)
sa_sigaction : SigactionHandlerT
sa_flags : Int
sa_mask : SigsetT
end
struct StackT
ss_sp : Void*
ss_size : SizeT
ss_flags : Int
end
fun kill(x0 : PidT, x1 : Int) : Int
fun pthread_sigmask(Int, SigsetT*, SigsetT*) : Int
fun signal(x0 : Int, x1 : Int -> Void) : Int -> Void
fun sigaction(x0 : Int, x1 : Sigaction*, x2 : Sigaction*) : Int
fun sigaltstack(x0 : StackT*, x1 : StackT*) : Int
fun sigemptyset(SigsetT*) : Int
fun sigfillset(SigsetT*) : Int
fun sigaddset(SigsetT*, Int) : Int
fun sigdelset(SigsetT*, Int) : Int
fun sigismember(SigsetT*, Int) : Int
end
| Crystal | 4 | jessedoyle/crystal | src/lib_c/x86_64-openbsd/c/signal.cr | [
"Apache-2.0"
] |
FROM golang:1.13.0-stretch as builder
WORKDIR /build
# Resolve and build Go dependencies as Docker cache
COPY go.mod /build/go.mod
COPY go.sum /build/go.sum
COPY kv/go.mod /build/kv/go.mod
ENV GO111MODULE=on
RUN go mod download
COPY service.go /build/main.go
COPY kv/ /build/kv
# Build for linux
ENV GOOS=linux
ENV GOARCH=amd64
ENV CGO_ENABLED=0
RUN go build -o server
# Build the main container (Linux Runtime)
FROM alpine:latest
WORKDIR /root/
# Copy the linux amd64 binary
COPY --from=builder /build/server /bin/
ENTRYPOINT /bin/server
| Dockerfile | 3 | dcillera/envoy | examples/grpc-bridge/server/Dockerfile | [
"Apache-2.0"
] |
eq (require '../package.json' .version), LiveScript.VERSION
| LiveScript | 0 | danielo515/LiveScript | test/lib.ls | [
"MIT"
] |
#include <stdio.h>
#include <upc.h>
#include "gettime.h"
#define N MAT_WIDTH
#define T MYTHREAD
#define NT THREADS
#define BS N/NT /* 1, N/NT, (N/NT)+1 */
#define RUNS 3
shared [BS] float m[N][N];
/* extern void add_vectors(float *v1, float *v2, float *v3, int i0, int i1); */
/* extern int transpose(float **m, int width); */
#ifdef DO_CHECK
void check_matrix()
{
int i, j;
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++) {
if (m[j][i] != (float)(i * N + j)) {
printf("Error.\n");
return;
}
}
}
printf("Success.\n");
}
#endif /* DO_CHECK */
#ifdef SHOW_MATRIX
void print_matrix()
{
int i, j;
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++) {
printf("%5.1f ", m[i][j]);
}
printf("\n");
}
}
#endif /* SHOW_MATRIX */
int main (int argc, char **argv)
{
int i, j, i0, i1, j0, j1, r, t, it;
timespec_t start, end;
double time_diff;
float tmp;
/* shared [BS] float *_m; */
if (T == 0) {
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++) {
m[i][j] = (float)(i * N + j);
}
}
#ifdef SHOW_MATRIX
print_matrix();
#endif /* SHOW_MATRIX */
}
upc_barrier;
for (r = 0; r < RUNS; r++) {
it = 0;
get_time_nsec(&start);
/* /\* upc_forall (j = 1; j < N; j++; j) { *\/ */
/* upc_forall (j = 1; j < N; j++; ((int)(((double)j)/((double)BS))) % N) { */
/* /\* printf("j = %d, BS = %d, j/BS = %d, j/BS = %g, (j/BS)//NT = %d\n", *\/ */
/* /\* j, BS, j/BS, ((double)j)/((double)BS), ((int)(((double)j)/((double)BS))) % NT); *\/ */
/* for (i = 0; i < j; i++) { */
/* it++; */
/* tmp = m[i][j]; */
/* m[i][j] = m[j][i]; */
/* m[j][i] = tmp; */
/* } */
/* } */
/* upc_forall (t = 0; t < NT; t++; t) { */
/* for (i = 0; i < N; i++) { */
/* for (j = T*BS; j < (T*BS)+BS; j++) { */
/* if (i < j) { */
/* it++; */
/* tmp = m[i][j]; */
/* m[i][j] = m[j][i]; */
/* m[j][i] = tmp; */
/* } */
/* } */
/* } */
/* } */
for (j = T*BS; j < (T*BS)+BS; j++) {
for (i = 0; i < j; i++) {
it++;
tmp = m[i][j];
m[i][j] = m[j][i];
m[j][i] = tmp;
}
}
get_time_nsec(&end);
time_diff = time_diff_nsec(&start, &end);
if (r == RUNS - 1) {
printf("T %2d: %15.10f s, %d swaps\n", T, time_diff, it);
}
upc_barrier;
}
if (T == 0) {
#ifdef DO_CHECK
check_matrix();
#endif /* DO_CHECK */
#ifdef SHOW_MATRIX
print_matrix();
#endif /* SHOW_MATRIX */
}
return 0;
}
| Unified Parallel C | 4 | fredmorcos/attic | Projects/Matrix FFT UPC Cilk/transpose-simple/upc-transpose.upc | [
"Unlicense"
] |
PARAMETER VERSION = 2.2.0
BEGIN OS
PARAMETER OS_NAME = standalone
PARAMETER OS_VER = 2.00.a
PARAMETER PROC_INSTANCE = ppc440_0
PARAMETER STDIN = RS232_Uart_1
PARAMETER STDOUT = RS232_Uart_1
END
BEGIN PROCESSOR
PARAMETER DRIVER_NAME = cpu_ppc440
PARAMETER DRIVER_VER = 1.01.a
PARAMETER HW_INSTANCE = ppc440_0
PARAMETER COMPILER = powerpc-eabi-gcc
PARAMETER ARCHIVER = powerpc-eabi-ar
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = bram
PARAMETER DRIVER_VER = 1.00.a
PARAMETER HW_INSTANCE = xps_bram_if_cntlr_1
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = generic
PARAMETER DRIVER_VER = 1.00.a
PARAMETER HW_INSTANCE = xps_bram_if_cntlr_1_bram
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = uartlite
PARAMETER DRIVER_VER = 1.14.a
PARAMETER HW_INSTANCE = RS232_Uart_1
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = gpio
PARAMETER DRIVER_VER = 2.13.a
PARAMETER HW_INSTANCE = LEDs_8Bit
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = gpio
PARAMETER DRIVER_VER = 2.13.a
PARAMETER HW_INSTANCE = LEDs_Positions
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = gpio
PARAMETER DRIVER_VER = 2.13.a
PARAMETER HW_INSTANCE = Push_Buttons_5Bit
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = gpio
PARAMETER DRIVER_VER = 2.13.a
PARAMETER HW_INSTANCE = DIP_Switches_8Bit
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = iic
PARAMETER DRIVER_VER = 1.15.a
PARAMETER HW_INSTANCE = IIC_EEPROM
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = emc
PARAMETER DRIVER_VER = 2.00.a
PARAMETER HW_INSTANCE = SRAM
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = pcie
PARAMETER DRIVER_VER = 1.00.a
PARAMETER HW_INSTANCE = PCIe_Bridge
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = emaclite
PARAMETER DRIVER_VER = 1.14.a
PARAMETER HW_INSTANCE = Ethernet_MAC
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = memcon
PARAMETER DRIVER_VER = 1.00.a
PARAMETER HW_INSTANCE = DDR2_SDRAM
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = sysace
PARAMETER DRIVER_VER = 1.12.a
PARAMETER HW_INSTANCE = SysACE_CompactFlash
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = generic
PARAMETER DRIVER_VER = 1.00.a
PARAMETER HW_INSTANCE = clock_generator_0
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = generic
PARAMETER DRIVER_VER = 1.00.a
PARAMETER HW_INSTANCE = jtagppc_cntlr_inst
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = generic
PARAMETER DRIVER_VER = 1.00.a
PARAMETER HW_INSTANCE = proc_sys_reset_0
END
BEGIN DRIVER
PARAMETER DRIVER_NAME = intc
PARAMETER DRIVER_VER = 1.11.a
PARAMETER HW_INSTANCE = xps_intc_0
END
| CartoCSS | 3 | JVVJV/FreeRTOS | FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/system.mss | [
"MIT"
] |
package unit.issues;
#if cs
import cs.NativeArray;
import cs.Lib;
#elseif java
import java.NativeArray;
import java.Lib;
#end
class Issue2049 extends unit.Test
{
#if (java || cs)
public function test()
{
var arr = [ 1., 1., 1., 0.5 ].map( function( n: Float ): Single { return n; });
var scaleFactors:NativeArray<Single> = Lib.nativeArray( arr, true );
eq(1.,scaleFactors[0]);
eq(1.,scaleFactors[1]);
eq(1.,scaleFactors[2]);
eq(.5,scaleFactors[3]);
}
#end
}
| Haxe | 4 | bendmorris/haxe | tests/unit/issues/Issue2049.hx | [
"MIT"
] |
# Broken with current boost
>net-libs/libtorrent-rasterbar-1.2.14-r1
| Mask | 0 | msdobrescu/desktop | packages/layers/net-tools/package.mask/01-net-tools.mask | [
"MIT"
] |
CREATE TABLE `tb_mzhjgiljck` (
`col_lnqceyzqyi` mediumint DEFAULT '1',
`col_rorzwqbqzc` varbinary(190) NULL,
`col_qfegkgeaal` tinyint unsigned DEFAULT '1',
UNIQUE `uk_nvoltofkla` (`col_rorzwqbqzc`(15))
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tb_jwpndmdumd` (
`col_vpupwhoacr` bit(52) DEFAULT b'0',
UNIQUE `uk_ghdynafkbb` (`col_vpupwhoacr`),
UNIQUE `uk_pdhqnqgdnh` (`col_vpupwhoacr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
RENAME TABLE `tb_jwpndmdumd` TO `tb_xnqicybdlo`, `tb_mzhjgiljck` TO `tb_cmzqttalvi`;
ALTER TABLE `tb_xnqicybdlo` ADD COLUMN `col_jzysxyqbvv` binary(91) NULL;
ALTER TABLE `tb_xnqicybdlo` ADD `col_ldvvuuqjus` enum('enum_or_set_0','enum_or_set_1','enum_or_set_2') DEFAULT 'enum_or_set_0' FIRST;
ALTER TABLE `tb_xnqicybdlo` ADD (`col_drciitekzb` longblob, `col_ocncfebity` numeric(32,27));
ALTER TABLE `tb_xnqicybdlo` ADD `col_uzoealeegi` binary;
ALTER TABLE `tb_xnqicybdlo` ADD COLUMN (`col_qnchccpalx` binary(157) NULL, `col_daawnfezqe` datetime(1) NULL);
ALTER TABLE `tb_xnqicybdlo` ADD UNIQUE INDEX (`col_jzysxyqbvv`(31),`col_uzoealeegi`);
ALTER TABLE `tb_xnqicybdlo` ADD UNIQUE `uk_spjmyismss` (`col_ldvvuuqjus`);
ALTER TABLE `tb_xnqicybdlo` ALTER COLUMN `col_uzoealeegi` SET DEFAULT NULL;
ALTER TABLE `tb_xnqicybdlo` ALTER COLUMN `col_jzysxyqbvv` DROP DEFAULT;
ALTER TABLE `tb_xnqicybdlo` ALTER COLUMN `col_qnchccpalx` DROP DEFAULT;
ALTER TABLE `tb_xnqicybdlo` DROP `col_vpupwhoacr`;
ALTER TABLE `tb_xnqicybdlo` DROP COLUMN `col_daawnfezqe`, DROP COLUMN `col_uzoealeegi`;
ALTER TABLE `tb_xnqicybdlo` DROP `col_ocncfebity`, DROP `col_ldvvuuqjus`;
ALTER TABLE `tb_xnqicybdlo` DROP `col_qnchccpalx`;
ALTER TABLE `tb_xnqicybdlo` DROP `col_drciitekzb`;
| SQL | 1 | yuanweikang2020/canal | parse/src/test/resources/ddl/alter/test_14.sql | [
"Apache-2.0"
] |
precision mediump float;
attribute vec2 a_position;
attribute vec2 a_center;
attribute float a_size;
attribute float a_angle; // in radians
attribute float a_linewidth;
attribute vec4 a_line_color;
attribute vec4 a_fill_color;
attribute float a_show;
uniform float u_pixel_ratio;
uniform vec2 u_canvas_size;
uniform float u_antialias;
varying float v_linewidth;
varying float v_size;
varying vec4 v_line_color;
varying vec4 v_fill_color;
varying vec2 v_coords;
void main()
{
v_size = a_size;
v_linewidth = a_linewidth;
v_line_color = a_line_color;
v_fill_color = a_fill_color;
if (a_show < 0.5) {
// Do not show this marker.
gl_Position = vec4(-2.0, -2.0, 0.0, 1.0);
return;
}
float enclosing_size = v_size + 2.0*v_linewidth + 3.0*u_antialias;
// Coordinates in rotated frame with respect to center of marker, used in
// distance functions in fragment shader.
v_coords = a_position*enclosing_size;
float c = cos(-a_angle);
float s = sin(-a_angle);
mat2 rotation = mat2(c, -s, s, c);
vec2 pos = a_center + rotation*v_coords;
pos += 0.5; // make up for Bokeh's offset
pos /= u_canvas_size / u_pixel_ratio; // in 0..1
gl_Position = vec4(2.0*pos.x - 1.0, 1.0 - 2.0*pos.y, 0.0, 1.0);
}
| GLSL | 5 | g-parki/bokeh | bokehjs/src/lib/models/glyphs/webgl/markers.vert | [
"BSD-3-Clause"
] |
@STATIC;1.0;p;20;CSGDataPersistance.jt;7474;@STATIC;1.0;I;23;Foundation/Foundation.ji;12;CSGBackend.jt;7410;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CSGBackend.j", YES);{var the_protocol = objj_allocateProtocol("CSGPersistance");
objj_registerProtocol(the_protocol);
protocol_addMethodDescriptions(the_protocol, [new objj_method(sel_getUid("needsAuthentication"), Nil
,["BOOL"]), new objj_method(sel_getUid("setValue:forKey:"), Nil
,["void","id","CPString"]), new objj_method(sel_getUid("valueForKey:responseBlock:"), Nil
,["void","CPString","Function"]), new objj_method(sel_getUid("allKeysUsingResponseBlock:"), Nil
,["void","Function"]), new objj_method(sel_getUid("deleteValueForKey:"), Nil
,["void","CPString"])], true, true);
}
{var the_class = objj_allocateClassPair(CPObject, "CSGBasePersistence"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CSGPersistance");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CSGPersistance\"");
class_addProtocol(the_class, aProtocol);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CSGBasePersistence__init(self, _cmd)
{
return (objj_getClass("CSGBasePersistence").super_class.method_dtable["init"] || _objj_forward)(self, "init");
}
,["id"]), new objj_method(sel_getUid("needsAuthentication"), function $CSGBasePersistence__needsAuthentication(self, _cmd)
{
return NO;
}
,["BOOL"]), new objj_method(sel_getUid("setValue:forKey:"), function $CSGBasePersistence__setValue_forKey_(self, _cmd, value, key)
{
}
,["void","id","CPString"]), new objj_method(sel_getUid("valueForKey:responseBlock:"), function $CSGBasePersistence__valueForKey_responseBlock_(self, _cmd, key, responseBlock)
{
responseBlock(nil);
}
,["void","CPString","Function"]), new objj_method(sel_getUid("allKeysUsingResponseBlock:"), function $CSGBasePersistence__allKeysUsingResponseBlock_(self, _cmd, responseBlock)
{
responseBlock([]);
}
,["void","Function"]), new objj_method(sel_getUid("deleteValueForKey:"), function $CSGBasePersistence__deleteValueForKey_(self, _cmd, key)
{
}
,["void","CPString"])]);
}
{var the_class = objj_allocateClassPair(CSGBasePersistence, "CSGLocalPersistence"),
meta_class = the_class.isa;objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CSGLocalPersistence__init(self, _cmd)
{
if (self = (objj_getClass("CSGLocalPersistence").super_class.method_dtable["init"] || _objj_forward)(self, "init"))
{
try {
var x = '__storage_test__';
window.localStorage.setItem(x, x);
window.localStorage.removeItem(x);
}
catch(e) {
CPLogAlert("\nHTML5 local storage not available.\nSaving and loading will be disabled.");
return ((___r1 = (CSGBasePersistence.isa.method_msgSend["alloc"] || _objj_forward)(CSGBasePersistence, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
var ___r1;
}
}
return self;
}
,["id"]), new objj_method(sel_getUid("needsAuthentication"), function $CSGLocalPersistence__needsAuthentication(self, _cmd)
{
return NO;
}
,["BOOL"]), new objj_method(sel_getUid("setValue:forKey:"), function $CSGLocalPersistence__setValue_forKey_(self, _cmd, value, key)
{
var dataString = ((___r1 = (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", value)), ___r1 == null ? null : (___r1.isa.method_msgSend["rawString"] || _objj_forward)(___r1, "rawString"));
window.localStorage.setItem(key, dataString);
var ___r1;
}
,["void","id","CPString"]), new objj_method(sel_getUid("valueForKey:responseBlock:"), function $CSGLocalPersistence__valueForKey_responseBlock_(self, _cmd, key, responseBlock)
{
var dataString = window.localStorage.getItem(key);
var value = dataString !== null ? (CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPData.isa.method_msgSend["dataWithRawString:"] || _objj_forward)(CPData, "dataWithRawString:", dataString)) : nil;
responseBlock(value);
}
,["void","CPString","Function"]), new objj_method(sel_getUid("allKeysUsingResponseBlock:"), function $CSGLocalPersistence__allKeysUsingResponseBlock_(self, _cmd, responseBlock)
{
var n = window.localStorage.length;
var keys = [];
for (var i = 0; i < n; i++)
{
keys[i] = window.localStorage.key(i);
}
responseBlock(keys);
}
,["void","Function"]), new objj_method(sel_getUid("deleteValueForKey:"), function $CSGLocalPersistence__deleteValueForKey_(self, _cmd, key)
{
window.localStorage.removeItem(key);
}
,["void","CPString"])]);
}
{var the_class = objj_allocateClassPair(CPObject, "CSGRemotePersistence"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CSGPersistance");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CSGPersistance\"");
class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("backend", "CSGBackend"), new objj_ivar("authToken", "CPString")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("authToken"), function $CSGRemotePersistence__authToken(self, _cmd)
{
return self.authToken;
}
,["CPString"]), new objj_method(sel_getUid("setAuthToken:"), function $CSGRemotePersistence__setAuthToken_(self, _cmd, newValue)
{
self.authToken = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("init"), function $CSGRemotePersistence__init(self, _cmd)
{
if (self = (objj_getClass("CSGRemotePersistence").super_class.method_dtable["init"] || _objj_forward)(self, "init"))
{
self.backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
self.authToken = nil;
}
return self;
}
,["id"]), new objj_method(sel_getUid("needsAuthentication"), function $CSGRemotePersistence__needsAuthentication(self, _cmd)
{
return YES;
}
,["BOOL"]), new objj_method(sel_getUid("setValue:forKey:"), function $CSGRemotePersistence__setValue_forKey_(self, _cmd, value, key)
{
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["storeValue:forKey:authToken:"] || _objj_forward)(___r1, "storeValue:forKey:authToken:", value, key, self.authToken));
var ___r1;
}
,["void","id","CPString"]), new objj_method(sel_getUid("valueForKey:responseBlock:"), function $CSGRemotePersistence__valueForKey_responseBlock_(self, _cmd, key, responseBlock)
{
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["fetchValueForKey:responseBlock:"] || _objj_forward)(___r1, "fetchValueForKey:responseBlock:", key, responseBlock));
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("allKeysUsingResponseBlock:"), function $CSGRemotePersistence__allKeysUsingResponseBlock_(self, _cmd, responseBlock)
{
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["fetchAllKeysUsingResponseBlock:"] || _objj_forward)(___r1, "fetchAllKeysUsingResponseBlock:", responseBlock));
var ___r1;
}
,["void","Function"]), new objj_method(sel_getUid("deleteValueForKey:"), function $CSGRemotePersistence__deleteValueForKey_(self, _cmd, key)
{
CPLog("Not implemented");
}
,["void","CPString"])]);
}
p;12;CSGProject.jt;17772;@STATIC;1.0;I;23;Foundation/Foundation.ji;12;CSGProgram.ji;12;CSGBackend.ji;17;CSGScriptViewer.ji;16;CSGAppUIViewer.ji;18;CSGEventListener.jt;17624;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CSGProgram.j", YES);objj_executeFile("CSGBackend.j", YES);objj_executeFile("CSGScriptViewer.j", YES);objj_executeFile("CSGAppUIViewer.j", YES);objj_executeFile("CSGEventListener.j", YES);
{var the_class = objj_allocateClassPair(CPObject, "CSGProject"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CPCoding");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPCoding\"");
class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("program", "CSGProgram"), new objj_ivar("name", "CPString"), new objj_ivar("appID", "CPString"), new objj_ivar("isUntitled", "BOOL"), new objj_ivar("showUIView", "BOOL"), new objj_ivar("appUIViewer", "CSGAppUIViewer"), new objj_ivar("eventListener", "CSGEventListener"), new objj_ivar("uiDefinitions", "JSObject"), new objj_ivar("uiTimer", "CPTimer")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("program"), function $CSGProject__program(self, _cmd)
{
return self.program;
}
,["CSGProgram"]), new objj_method(sel_getUid("setProgram:"), function $CSGProject__setProgram_(self, _cmd, newValue)
{
self.program = newValue;
}
,["void","CSGProgram"]), new objj_method(sel_getUid("name"), function $CSGProject__name(self, _cmd)
{
return self.name;
}
,["CPString"]), new objj_method(sel_getUid("setName:"), function $CSGProject__setName_(self, _cmd, newValue)
{
self.name = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("appID"), function $CSGProject__appID(self, _cmd)
{
return self.appID;
}
,["CPString"]), new objj_method(sel_getUid("setAppID:"), function $CSGProject__setAppID_(self, _cmd, newValue)
{
self.appID = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("isUntitled"), function $CSGProject__isUntitled(self, _cmd)
{
return self.isUntitled;
}
,["BOOL"]), new objj_method(sel_getUid("setIsUntitled:"), function $CSGProject__setIsUntitled_(self, _cmd, newValue)
{
self.isUntitled = newValue;
}
,["void","BOOL"]), new objj_method(sel_getUid("showUIView"), function $CSGProject__showUIView(self, _cmd)
{
return self.showUIView;
}
,["BOOL"]), new objj_method(sel_getUid("setShowUIView:"), function $CSGProject__setShowUIView_(self, _cmd, newValue)
{
self.showUIView = newValue;
}
,["void","BOOL"]), new objj_method(sel_getUid("uiDefinitions"), function $CSGProject__uiDefinitions(self, _cmd)
{
return self.uiDefinitions;
}
,["JSObject"]), new objj_method(sel_getUid("setUiDefinitions:"), function $CSGProject__setUiDefinitions_(self, _cmd, newValue)
{
self.uiDefinitions = newValue;
}
,["void","JSObject"]), new objj_method(sel_getUid("initWithName:"), function $CSGProject__initWithName_(self, _cmd, projectName)
{
if (self = (objj_getClass("CSGProject").super_class.method_dtable["init"] || _objj_forward)(self, "init"))
{
self.name = projectName;
self.program = ((___r1 = (CSGProgram.isa.method_msgSend["alloc"] || _objj_forward)(CSGProgram, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
self.appID = nil;
self.isUntitled = YES;
self.uiDefinitions = {};
(self == null ? null : (self.isa.method_msgSend["setShowUIView:"] || _objj_forward)(self, "setShowUIView:", YES));
}
return self;
var ___r1;
}
,["id","CPString"]), new objj_method(sel_getUid("initWithCoder:"), function $CSGProject__initWithCoder_(self, _cmd, coder)
{
self = (objj_getClass("CSGProject").super_class.method_dtable["initWithName:"] || _objj_forward)(self, "initWithName:", "_DUMMY_");
if (self)
{
self.program = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "program"));
self.name = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "name"));
self.isUntitled = (coder == null ? null : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", "isUntitled"));
self.appID = nil;
}
return self;
}
,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CSGProject__encodeWithCoder_(self, _cmd, coder)
{
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.program, "program"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.name, "name"));
(coder == null ? null : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self.isUntitled, "isUntitled"));
}
,["void","CPCoder"]), new objj_method(sel_getUid("setErrors:andWarnings:"), function $CSGProject__setErrors_andWarnings_(self, _cmd, errors, warnings)
{
errors.forEach( function(error, i, list)
{
list[i] = i + 1 + " : " + error.reason;
});
warnings.forEach( function(warning, i, list)
{
list[i] = i + 1 + " : " + warning.reason;
});
var errorViewer = ((___r1 = (CSGScriptViewer.isa.method_msgSend["alloc"] || _objj_forward)(CSGScriptViewer, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
var errorText = (errors == null ? null : (errors.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(errors, "componentsJoinedByString:", "\n"));
var warningText = (warnings == null ? null : (warnings.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(warnings, "componentsJoinedByString:", "\n"));
var text = ((___r1 = ["Errors:", errorText, "", "Warnings:", warningText]), ___r1 == null ? null : (___r1.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(___r1, "componentsJoinedByString:", "\n"));
(errorViewer == null ? null : (errorViewer.isa.method_msgSend["setTitle:"] || _objj_forward)(errorViewer, "setTitle:", "Errors and Warnings"));
(errorViewer == null ? null : (errorViewer.isa.method_msgSend["setScript:"] || _objj_forward)(errorViewer, "setScript:", text));
(errorViewer == null ? null : (errorViewer.isa.method_msgSend["setReleasedWhenClosed:"] || _objj_forward)(errorViewer, "setReleasedWhenClosed:", YES));
var ___r1;
}
,["void","id","id"]), new objj_method(sel_getUid("isRunning"), function $CSGProject__isRunning(self, _cmd)
{
return self.appID !== nil;
}
,["BOOL"]), new objj_method(sel_getUid("run"), function $CSGProject__run(self, _cmd)
{
if ((self.isa.method_msgSend["isRunning"] || _objj_forward)(self, "isRunning"))
{
return;
}
var backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
var script = ((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["scriptRepresentation"] || _objj_forward)(___r1, "scriptRepresentation"));
(backend == null ? null : (backend.isa.method_msgSend["deployScript:withName:responseBlock:"] || _objj_forward)(backend, "deployScript:withName:responseBlock:", script, self.name, function(response)
{
var app_id = response.application_id;
if (app_id === undefined)
{
(self.isa.method_msgSend["setErrors:andWarnings:"] || _objj_forward)(self, "setErrors:andWarnings:", response.errors, response.warnings);
} else
{
(backend == null ? null : (backend.isa.method_msgSend["infoForAppID:usingBlock:"] || _objj_forward)(backend, "infoForAppID:usingBlock:", app_id, function(info)
{
(self.isa.method_msgSend["setRuntimeInfo:"] || _objj_forward)(self, "setRuntimeInfo:", info);
(self.isa.method_msgSend["setAppID:"] || _objj_forward)(self, "setAppID:", app_id);
(self.isa.method_msgSend["startUI"] || _objj_forward)(self, "startUI");
}));
} }));
var ___r1;
}
,["void"]), new objj_method(sel_getUid("stop"), function $CSGProject__stop(self, _cmd)
{
if (!(self.isa.method_msgSend["isRunning"] || _objj_forward)(self, "isRunning"))
{
return;
}
var backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
(backend == null ? null : (backend.isa.method_msgSend["stopAppWithID:responseBlock:"] || _objj_forward)(backend, "stopAppWithID:responseBlock:", self.appID, function()
{
(self.isa.method_msgSend["stopUI"] || _objj_forward)(self, "stopUI");
((___r1 = ((___r2 = self.program), ___r2 == null ? null : (___r2.isa.method_msgSend["actors"] || _objj_forward)(___r2, "actors"))), ___r1 == null ? null : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", nil, "identifier"));
((___r1 = ((___r2 = self.program), ___r2 == null ? null : (___r2.isa.method_msgSend["actors"] || _objj_forward)(___r2, "actors"))), ___r1 == null ? null : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", nil, "nodeName"));
(self.isa.method_msgSend["setAppID:"] || _objj_forward)(self, "setAppID:", nil);
var ___r1, ___r2;
}));
}
,["void"]), new objj_method(sel_getUid("startUI"), function $CSGProject__startUI(self, _cmd)
{
var backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
(backend == null ? null : (backend.isa.method_msgSend["getUIDefinitions:responseBlock:"] || _objj_forward)(backend, "getUIDefinitions:responseBlock:", self.appID, function(defs)
{
self.uiDefinitions = defs;
if (self.uiDefinitions && (self.isa.method_msgSend["hasUIActors"] || _objj_forward)(self, "hasUIActors"))
{
self.appUIViewer = ((___r1 = (CSGAppUIViewer.isa.method_msgSend["alloc"] || _objj_forward)(CSGAppUIViewer, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithProject:"] || _objj_forward)(___r1, "initWithProject:", self));
(self.isa.method_msgSend["addUIEventListener"] || _objj_forward)(self, "addUIEventListener");
(self.isa.method_msgSend["showUI"] || _objj_forward)(self, "showUI");
} var ___r1;
}));
}
,["void"]), new objj_method(sel_getUid("addUIEventListener"), function $CSGProject__addUIEventListener(self, _cmd)
{
var HAS_NGINX_REWRITE = NO;
var host = ((___r1 = (CSGHostConfig.isa.method_msgSend["sharedHostConfig"] || _objj_forward)(CSGHostConfig, "sharedHostConfig")), ___r1 == null ? null : (___r1.isa.method_msgSend["calvinHost"] || _objj_forward)(___r1, "calvinHost"));
var containerID = ((___r1 = (CSGHostConfig.isa.method_msgSend["sharedHostConfig"] || _objj_forward)(CSGHostConfig, "sharedHostConfig")), ___r1 == null ? null : (___r1.isa.method_msgSend["containerID"] || _objj_forward)(___r1, "containerID"));
var url = "";
if (containerID !== "")
{
if (HAS_NGINX_REWRITE)
{
url = "http://" + host + ":7777/" + containerID + "/client_id/" + self.appID;
}
else
{
url = "http://" + host + ":5000/event_stream/" + containerID + "/client_id/" + self.appID;
}
}
else
{
url = "http://" + host + ":7777/client_id/" + self.appID;
}
console.log("Adding eventlistener:", url);
self.eventListener = ((___r1 = (CSGEventListener.isa.method_msgSend["alloc"] || _objj_forward)(CSGEventListener, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithURL:eventType:dataFormat:"] || _objj_forward)(___r1, "initWithURL:eventType:dataFormat:", url, "message", CSGJSONStringDataFormat));
((___r1 = self.eventListener), ___r1 == null ? null : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self.appUIViewer));
((___r1 = self.eventListener), ___r1 == null ? null : (___r1.isa.method_msgSend["startListening"] || _objj_forward)(___r1, "startListening"));
var ___r1;
}
,["void"]), new objj_method(sel_getUid("stopUI"), function $CSGProject__stopUI(self, _cmd)
{
(self.isa.method_msgSend["hideUI"] || _objj_forward)(self, "hideUI");
((___r1 = self.eventListener), ___r1 == null ? null : (___r1.isa.method_msgSend["stopListening"] || _objj_forward)(___r1, "stopListening"));
((___r1 = self.appUIViewer), ___r1 == null ? null : (___r1.isa.method_msgSend["close"] || _objj_forward)(___r1, "close"));
self.uiDefinitions = {};
self.appUIViewer = nil;
var ___r1;
}
,["void"]), new objj_method(sel_getUid("hasUIActors"), function $CSGProject__hasUIActors(self, _cmd)
{
return (self.isa.method_msgSend["uiActors"] || _objj_forward)(self, "uiActors").length > 0;
}
,["BOOL"]), new objj_method(sel_getUid("uiActors"), function $CSGProject__uiActors(self, _cmd)
{
var ui_actors = [];
var actors = ((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["actors"] || _objj_forward)(___r1, "actors"));
for (var i = 0; i < actors.length; i++)
{
var actor = actors[i];
if (self.uiDefinitions[actor.type])
{
ui_actors.push(actor);
}
}
return ui_actors;
var ___r1;
}
,["CPArray"]), new objj_method(sel_getUid("startUITimer"), function $CSGProject__startUITimer(self, _cmd)
{
if (!self.uiTimer || !((___r1 = self.uiTimer), ___r1 == null ? null : (___r1.isa.method_msgSend["isValid"] || _objj_forward)(___r1, "isValid")))
{
self.uiTimer = (CPTimer.isa.method_msgSend["scheduledTimerWithTimeInterval:callback:repeats:"] || _objj_forward)(CPTimer, "scheduledTimerWithTimeInterval:callback:repeats:", 1, function()
{
(self.isa.method_msgSend["updateUIVisibility"] || _objj_forward)(self, "updateUIVisibility");
}, YES);
}
var ___r1;
}
,["void"]), new objj_method(sel_getUid("stopUITimer"), function $CSGProject__stopUITimer(self, _cmd)
{
if (self.uiTimer && ((___r1 = self.uiTimer), ___r1 == null ? null : (___r1.isa.method_msgSend["isValid"] || _objj_forward)(___r1, "isValid")))
{
((___r1 = self.uiTimer), ___r1 == null ? null : (___r1.isa.method_msgSend["invalidate"] || _objj_forward)(___r1, "invalidate"));
}
var ___r1;
}
,["void"]), new objj_method(sel_getUid("updateUIVisibility"), function $CSGProject__updateUIVisibility(self, _cmd)
{
((___r1 = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend")), ___r1 == null ? null : (___r1.isa.method_msgSend["actorsOnUIRuntime:"] || _objj_forward)(___r1, "actorsOnUIRuntime:", function(list)
{
((___r1 = self.appUIViewer), ___r1 == null ? null : (___r1.isa.method_msgSend["updateVisibility:"] || _objj_forward)(___r1, "updateVisibility:", list));
var ___r1;
}));
var ___r1;
}
,["void"]), new objj_method(sel_getUid("setRuntimeInfo:"), function $CSGProject__setRuntimeInfo_(self, _cmd, rti)
{
if (!rti)
{
return;
}
var actor_ids = rti.actors;
var namespace = rti.ns;
var name_map = (CPDictionary.isa.method_msgSend["dictionaryWithJSObject:"] || _objj_forward)(CPDictionary, "dictionaryWithJSObject:", rti.actors_name_map);
var actors = ((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["actors"] || _objj_forward)(___r1, "actors"));
for (var i = 0; i < actors.length; i++)
{
var actor = actors[i];
var qualified_name = namespace + ":" + actor.name;
var id = (name_map == null ? null : (name_map.isa.method_msgSend["allKeysForObject:"] || _objj_forward)(name_map, "allKeysForObject:", qualified_name))[0];
(actor == null ? null : (actor.isa.method_msgSend["setIdentifier:"] || _objj_forward)(actor, "setIdentifier:", id));
}
var ___r1;
}
,["void","JSObject"]), new objj_method(sel_getUid("setShowUIView:"), function $CSGProject__setShowUIView_(self, _cmd, flag)
{
if (flag === self.showUIView)
{
return;
}
self.showUIView = flag;
if (self.showUIView)
{
(self.isa.method_msgSend["showUI"] || _objj_forward)(self, "showUI");
}
else
{
(self.isa.method_msgSend["hideUI"] || _objj_forward)(self, "hideUI");
}
}
,["void","BOOL"]), new objj_method(sel_getUid("showUI"), function $CSGProject__showUI(self, _cmd)
{
if (self.appUIViewer && self.showUIView)
{
(self.isa.method_msgSend["startUITimer"] || _objj_forward)(self, "startUITimer");
((___r1 = self.appUIViewer), ___r1 == null ? null : (___r1.isa.method_msgSend["showWindow:"] || _objj_forward)(___r1, "showWindow:", self));
}
var ___r1;
}
,["void"]), new objj_method(sel_getUid("hideUI"), function $CSGProject__hideUI(self, _cmd)
{
if (self.appUIViewer)
{
((___r1 = ((___r2 = self.appUIViewer), ___r2 == null ? null : (___r2.isa.method_msgSend["window"] || _objj_forward)(___r2, "window"))), ___r1 == null ? null : (___r1.isa.method_msgSend["orderOut:"] || _objj_forward)(___r1, "orderOut:", self));
(self.isa.method_msgSend["stopUITimer"] || _objj_forward)(self, "stopUITimer");
}
var ___r1, ___r2;
}
,["void"]), new objj_method(sel_getUid("activate"), function $CSGProject__activate(self, _cmd)
{
(self.isa.method_msgSend["showUI"] || _objj_forward)(self, "showUI");
}
,["void"]), new objj_method(sel_getUid("deactivate"), function $CSGProject__deactivate(self, _cmd)
{
(self.isa.method_msgSend["hideUI"] || _objj_forward)(self, "hideUI");
}
,["void"])]);
}
p;12;CSGProgram.jt;10872;@STATIC;1.0;I;23;Foundation/Foundation.ji;15;CSGConnection.jt;10804;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CSGConnection.j", YES);
{var the_class = objj_allocateClassPair(CPObject, "CSGProgram"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CPCoding");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPCoding\"");
class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("instances", "CPMutableArray"), new objj_ivar("connections", "CPMutableArray"), new objj_ivar("_counter", "int"), new objj_ivar("name", "CPString")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("actors"), function $CSGProgram__actors(self, _cmd)
{
return self.instances;
}
,["CPMutableArray"]), new objj_method(sel_getUid("name"), function $CSGProgram__name(self, _cmd)
{
return self.name;
}
,["CPString"]), new objj_method(sel_getUid("setName:"), function $CSGProgram__setName_(self, _cmd, newValue)
{
self.name = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("init"), function $CSGProgram__init(self, _cmd)
{
self = (objj_getClass("CSGProgram").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
self.instances = [];
self.connections = [];
self._counter = 0;
var fmt = ((___r1 = (CPDateFormatter.isa.method_msgSend["alloc"] || _objj_forward)(CPDateFormatter, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithDateFormat:allowNaturalLanguage:"] || _objj_forward)(___r1, "initWithDateFormat:allowNaturalLanguage:", "yyMMddHHmmss", NO));
self.name = (fmt == null ? null : (fmt.isa.method_msgSend["stringFromDate:"] || _objj_forward)(fmt, "stringFromDate:", (CPDate.isa.method_msgSend["date"] || _objj_forward)(CPDate, "date")));
}
return self;
var ___r1;
}
,["id"]), new objj_method(sel_getUid("initWithCoder:"), function $CSGProgram__initWithCoder_(self, _cmd, coder)
{
self = (objj_getClass("CSGProgram").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
self.instances = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "instances"));
self.connections = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "connections"));
self._counter = (coder == null ? null : (coder.isa.method_msgSend["decodeIntForKey:"] || _objj_forward)(coder, "decodeIntForKey:", "counter"));
}
return self;
}
,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CSGProgram__encodeWithCoder_(self, _cmd, coder)
{
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.instances, "instances"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.connections, "connections"));
(coder == null ? null : (coder.isa.method_msgSend["encodeInt:forKey:"] || _objj_forward)(coder, "encodeInt:forKey:", self._counter, "counter"));
}
,["void","CPCoder"]), new objj_method(sel_getUid("addInstance:"), function $CSGProgram__addInstance_(self, _cmd, actor)
{
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "instances");
var typeParts = ((___r1 = actor.type), ___r1 == null ? null : (___r1.isa.method_msgSend["componentsSeparatedByString:"] || _objj_forward)(___r1, "componentsSeparatedByString:", ".")),
tmpName = ((___r1 = typeParts[typeParts.length - 1]), ___r1 == null ? null : (___r1.isa.method_msgSend["lowercaseString"] || _objj_forward)(___r1, "lowercaseString"));
actor.name = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@%d", tmpName, ++self._counter);
((___r1 = self.instances), ___r1 == null ? null : (___r1.isa.method_msgSend["insertObject:atIndex:"] || _objj_forward)(___r1, "insertObject:atIndex:", actor, 0));
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "instances");
var ___r1;
}
,["void","CSGActor"]), new objj_method(sel_getUid("isValidActorName:"), function $CSGProgram__isValidActorName_(self, _cmd, actorName)
{
var syntax_ok = /^[a-z][a-z0-9_]*$/i.test(actorName);
if (!syntax_ok)
{
return NO;
}
for (var i = 0; i < self.instances.length; i++)
{
if (actorName === self.instances[i].name)
{
return NO;
}
}
return YES;
}
,["BOOL","CPString"]), new objj_method(sel_getUid("addConnectionFrom:fromPort:to:toPort:"), function $CSGProgram__addConnectionFrom_fromPort_to_toPort_(self, _cmd, fromActor, fromPort, toActor, toPort)
{
if ((fromPort == null ? null : (fromPort.isa.method_msgSend["isInport"] || _objj_forward)(fromPort, "isInport")) === (toPort == null ? null : (toPort.isa.method_msgSend["isInport"] || _objj_forward)(toPort, "isInport")))
{
return false;
}
var conn;
if ((fromPort == null ? null : (fromPort.isa.method_msgSend["isInport"] || _objj_forward)(fromPort, "isInport")))
{
conn = ((___r1 = (CSGConnection.isa.method_msgSend["alloc"] || _objj_forward)(CSGConnection, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithSrc:srcPort:dst:dstPort:"] || _objj_forward)(___r1, "initWithSrc:srcPort:dst:dstPort:", toActor, toPort, fromActor, fromPort));
}
else
{
conn = ((___r1 = (CSGConnection.isa.method_msgSend["alloc"] || _objj_forward)(CSGConnection, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithSrc:srcPort:dst:dstPort:"] || _objj_forward)(___r1, "initWithSrc:srcPort:dst:dstPort:", fromActor, fromPort, toActor, toPort));
}
for (var i = 0; i < self.connections.length; i++)
{
var present = self.connections[i];
if ((conn == null ? null : (conn.isa.method_msgSend["isEqualToConnection:"] || _objj_forward)(conn, "isEqualToConnection:", present)) || (conn == null ? null : (conn.isa.method_msgSend["hasSameDestinationPortAsConnection:"] || _objj_forward)(conn, "hasSameDestinationPortAsConnection:", present)))
{
return false;
}
}
((___r1 = self.connections), ___r1 == null ? null : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", conn));
return true;
var ___r1;
}
,["BOOL","CSGActor","CSGPort","CSGActor","CSGPort"]), new objj_method(sel_getUid("connectionForActor:inport:"), function $CSGProgram__connectionForActor_inport_(self, _cmd, actor, port)
{
for (var i = 0; i < self.connections.length; i++)
{
if (((___r1 = self.connections[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["isConnectedToActor:inport:"] || _objj_forward)(___r1, "isConnectedToActor:inport:", actor, port)))
{
return self.connections[i];
}
}
return nil;
var ___r1;
}
,["CSGConnection","CSGActor","CSGPort"]), new objj_method(sel_getUid("connectionsForActor:outport:"), function $CSGProgram__connectionsForActor_outport_(self, _cmd, actor, port)
{
var conns = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array");
for (var i = 0; i < self.connections.length; i++)
{
if (((___r1 = self.connections[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["isConnectedToActor:outport:"] || _objj_forward)(___r1, "isConnectedToActor:outport:", actor, port)))
{
(conns == null ? null : (conns.isa.method_msgSend["addObject:"] || _objj_forward)(conns, "addObject:", self.connections[i]));
}
}
return conns;
var ___r1;
}
,["CPArray","CSGActor","CSGPort"]), new objj_method(sel_getUid("removeComponent:"), function $CSGProgram__removeComponent_(self, _cmd, comp)
{
if (comp === nil)
{
return;
}
if ((comp == null ? null : (comp.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(comp, "isKindOfClass:", (CSGActor == null ? null : (CSGActor.isa.method_msgSend["class"] || _objj_forward)(CSGActor, "class")))))
{
var index = self.connections.length;
while (index--)
{
if (((___r1 = self.connections[index]), ___r1 == null ? null : (___r1.isa.method_msgSend["isConnectedToActor:"] || _objj_forward)(___r1, "isConnectedToActor:", comp)))
{
((___r1 = self.connections), ___r1 == null ? null : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index));
}
}
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "instances");
((___r1 = self.instances), ___r1 == null ? null : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", comp));
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "instances");
}
else if ((comp == null ? null : (comp.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(comp, "isKindOfClass:", (CSGConnection.isa.method_msgSend["class"] || _objj_forward)(CSGConnection, "class"))))
{
((___r1 = self.connections), ___r1 == null ? null : (___r1.isa.method_msgSend["removeObject:"] || _objj_forward)(___r1, "removeObject:", comp));
}
else
{
console.log("Can't remove component", comp);
}
var ___r1;
}
,["void","CSGComponent"]), new objj_method(sel_getUid("scriptRepresentation"), function $CSGProgram__scriptRepresentation(self, _cmd)
{
var reps = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array");
for (var i = 0; i < self.instances.length; i++)
{
(reps == null ? null : (reps.isa.method_msgSend["addObject:"] || _objj_forward)(reps, "addObject:", ((___r1 = self.instances[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["scriptRepresentation"] || _objj_forward)(___r1, "scriptRepresentation"))));
}
(reps == null ? null : (reps.isa.method_msgSend["addObject:"] || _objj_forward)(reps, "addObject:", ""));
for (var i = 0; i < self.connections.length; i++)
{
(reps == null ? null : (reps.isa.method_msgSend["addObject:"] || _objj_forward)(reps, "addObject:", ((___r1 = self.connections[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["scriptRepresentation"] || _objj_forward)(___r1, "scriptRepresentation"))));
}
var script = (reps == null ? null : (reps.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(reps, "componentsJoinedByString:", "\n"));
return script;
var ___r1;
}
,["CPString"])]);
}
p;14;CSGComponent.jt;885;@STATIC;1.0;I;23;Foundation/Foundation.jt;839;objj_executeFile("Foundation/Foundation.j", NO);
{var the_class = objj_allocateClassPair(CPObject, "CSGComponent"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_selected", "BOOL")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("isSelected"), function $CSGComponent__isSelected(self, _cmd)
{
return self._selected;
}
,["BOOL"]), new objj_method(sel_getUid("setSelected:"), function $CSGComponent__setSelected_(self, _cmd, newValue)
{
self._selected = newValue;
}
,["void","BOOL"]), new objj_method(sel_getUid("init"), function $CSGComponent__init(self, _cmd)
{
self = (objj_getClass("CSGComponent").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
self._selected = NO;
}
return self;
}
,["id"])]);
}
p;20;CPString+Rendering.jt;2206;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.jt;2139;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);{
var the_class = objj_getClass("CPString")
if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPString\"");
var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("drawAtPoint:withAttributes:"), function $CPString__drawAtPoint_withAttributes_(self, _cmd, point, attributes)
{
var ctx = ((___r1 = (CPGraphicsContext.isa.method_msgSend["currentContext"] || _objj_forward)(CPGraphicsContext, "currentContext")), ___r1 == null ? null : (___r1.isa.method_msgSend["graphicsPort"] || _objj_forward)(___r1, "graphicsPort"));
ctx.font = ((___r1 = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12)), ___r1 == null ? null : (___r1.isa.method_msgSend["cssString"] || _objj_forward)(___r1, "cssString"));
ctx.fillText(self, point.x, point.y);
var ___r1;
}
,["void","CSGPoint","CPDictionary"]), new objj_method(sel_getUid("drawInBounds:withAlignment:"), function $CPString__drawInBounds_withAlignment_(self, _cmd, bounds, align)
{
var x = 0.0;
var font = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12);
if (align !== CPLeftTextAlignment)
{
var w = (self.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(self, "sizeWithFont:", font).width;
if (align === CPCenterTextAlignment)
{
x = (bounds.size.width - w) / 2.0;
}
else
{
x = bounds.size.width - w;
}
}
((___r1 = (CPColor.isa.method_msgSend["blackColor"] || _objj_forward)(CPColor, "blackColor")), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
var p = CPMakePoint(bounds.origin.x + x, bounds.origin.y + (font == null ? null : (font.isa.method_msgSend["size"] || _objj_forward)(font, "size")));
(self.isa.method_msgSend["drawAtPoint:withAttributes:"] || _objj_forward)(self, "drawAtPoint:withAttributes:", p, {});
var ___r1;
}
,["void","CGRect","CPTextAlignment"])]);
}
p;9;CSGPort.jt;3357;@STATIC;1.0;I;23;Foundation/Foundation.jt;3310;objj_executeFile("Foundation/Foundation.j", NO);
{var the_class = objj_allocateClassPair(CPObject, "CSGPort"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CPCoding");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPCoding\"");
class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("portName", "CPString"), new objj_ivar("isInport", "BOOL"), new objj_ivar("portSize", "CGSize")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("name"), function $CSGPort__name(self, _cmd)
{
return self.portName;
}
,["CPString"]), new objj_method(sel_getUid("setPortName:"), function $CSGPort__setPortName_(self, _cmd, newValue)
{
self.portName = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("isInport"), function $CSGPort__isInport(self, _cmd)
{
return self.isInport;
}
,["BOOL"]), new objj_method(sel_getUid("setIsInport:"), function $CSGPort__setIsInport_(self, _cmd, newValue)
{
self.isInport = newValue;
}
,["void","BOOL"]), new objj_method(sel_getUid("initWithName:isInport:"), function $CSGPort__initWithName_isInport_(self, _cmd, name, flag)
{
if (self = (objj_getClass("CSGPort").super_class.method_dtable["init"] || _objj_forward)(self, "init"))
{
self.portName = name;
self.isInport = flag;
self.portSize = CGSizeMakeZero();
}
return self;
}
,["id","CPString","BOOL"]), new objj_method(sel_getUid("initWithCoder:"), function $CSGPort__initWithCoder_(self, _cmd, coder)
{
self = (objj_getClass("CSGPort").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
self.portName = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "portName"));
self.isInport = (coder == null ? null : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", "isInport"));
self.portSize = CGSizeMakeZero();
}
return self;
}
,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CSGPort__encodeWithCoder_(self, _cmd, coder)
{
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.portName, "portName"));
(coder == null ? null : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self.isInport, "isInport"));
}
,["void","CPCoder"])]);
class_addMethods(meta_class, [new objj_method(sel_getUid("inportWithName:"), function $CSGPort__inportWithName_(self, _cmd, name)
{
return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithName:isInport:"] || _objj_forward)(___r1, "initWithName:isInport:", name, YES));
var ___r1;
}
,["id","CPString"]), new objj_method(sel_getUid("outportWithName:"), function $CSGPort__outportWithName_(self, _cmd, name)
{
return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithName:isInport:"] || _objj_forward)(___r1, "initWithName:isInport:", name, NO));
var ___r1;
}
,["id","CPString"])]);
}
p;20;CSGActor+Rendering.jt;8356;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;10;CSGActor.ji;10;CSGTheme.ji;18;CSGGeometryUtils.jt;8236;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGActor.j", YES);objj_executeFile("CSGTheme.j", YES);objj_executeFile("CSGGeometryUtils.j", YES);{
var the_class = objj_getClass("CSGActor")
if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CSGActor\"");
var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("computeBounds"), function $CSGActor__computeBounds(self, _cmd)
{
var font = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12);
var width_port = 0.0,
width_hdr,
rows = Math.max(self.inports.length, self.outports.length) + 2,
allPorts = self.inports.concat(self.outports);
for (var i = 0; i < allPorts.length; i++)
{
width_port = Math.max(width_port, ((___r1 = allPorts[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["size"] || _objj_forward)(___r1, "size")).width);
}
width_hdr = Math.max(((___r1 = self.name), ___r1 == null ? null : (___r1.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(___r1, "sizeWithFont:", font)).width, ((___r1 = self.type), ___r1 == null ? null : (___r1.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(___r1, "sizeWithFont:", font)).width);
(self.isa.method_msgSend["setSize:"] || _objj_forward)(self, "setSize:", CPMakeSize(Math.max(width_hdr, 2 * width_port + CSGColPadding) + 2 * CSGColPadding, rows * CSGRowHeight));
self.validBounds = YES;
var ___r1;
}
,["void"]), new objj_method(sel_getUid("anchorPointForPort:"), function $CSGActor__anchorPointForPort_(self, _cmd, port)
{
var ports = (port == null ? null : (port.isa.method_msgSend["isInport"] || _objj_forward)(port, "isInport")) ? self.inports : self.outports,
row = 2;
for (var i = 0; i < ports.length; i++)
{
if (port === ports[i])
{
break;
}
row++;
}
var local = CPMakePoint((port == null ? null : (port.isa.method_msgSend["isInport"] || _objj_forward)(port, "isInport")) ? 0.0 : (self.isa.method_msgSend["size"] || _objj_forward)(self, "size").width, row * CSGRowHeight + CSGRowHeight / 2.0 + CSGPadYOffset);
return CSGAddPoints((self.isa.method_msgSend["origin"] || _objj_forward)(self, "origin"), local);
}
,["GCPoint","CSGPort"]), new objj_method(sel_getUid("drawStatusIndicator:"), function $CSGActor__drawStatusIndicator_(self, _cmd, rect)
{
var m = CSGRowHeight / 8.0,
s = CSGRowHeight / 4.0,
x = rect.origin.x,
y = rect.origin.y,
w = rect.size.width,
h = rect.size.height,
r = CPMakeRect(x + w - s - m, y + m, s, s);
if ((self.isa.method_msgSend["hasValidMandatoryArgs"] || _objj_forward)(self, "hasValidMandatoryArgs"))
{
return;
}
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGErrorColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
((___r1 = (CPBezierPath.isa.method_msgSend["bezierPathWithOvalInRect:"] || _objj_forward)(CPBezierPath, "bezierPathWithOvalInRect:", r)), ___r1 == null ? null : (___r1.isa.method_msgSend["fill"] || _objj_forward)(___r1, "fill"));
var ___r1;
}
,["void","CGRect"]), new objj_method(sel_getUid("renderInBounds:dirtyRect:"), function $CSGActor__renderInBounds_dirtyRect_(self, _cmd, _bounds, dirtyRect)
{
if (self.validBounds === NO)
{
(self.isa.method_msgSend["computeBounds"] || _objj_forward)(self, "computeBounds");
}
var hexBackColor,
hexNameColor,
hexTypeColor,
hexFrameColor;
if ((self.isa.method_msgSend["isComponent"] || _objj_forward)(self, "isComponent"))
{
hexBackColor = CSGComponentActorBgColorHEX;
hexNameColor = CSGComponentActorNameBgColorHEX;
hexTypeColor = CSGComponentActorTypeBgColorHEX;
hexFrameColor = CSGComponentActorFrameColorHEX;
}
else
{
hexBackColor = CSGActorBgColorHEX;
hexNameColor = CSGActorNameBgColorHEX;
hexTypeColor = CSGActorTypeBgColorHEX;
hexFrameColor = CSGActorFrameColorHEX;
}
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", hexBackColor)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
var bgRect = CGRectCreateCopy(self.bounds);
(CPBezierPath.isa.method_msgSend["fillRect:"] || _objj_forward)(CPBezierPath, "fillRect:", bgRect);
bgRect.size.height = CSGRowHeight;
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", hexNameColor)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(CPBezierPath.isa.method_msgSend["fillRect:"] || _objj_forward)(CPBezierPath, "fillRect:", bgRect);
((___r1 = self.name), ___r1 == null ? null : (___r1.isa.method_msgSend["drawInBounds:withAlignment:"] || _objj_forward)(___r1, "drawInBounds:withAlignment:", bgRect, CPCenterTextAlignment));
(self.isa.method_msgSend["drawStatusIndicator:"] || _objj_forward)(self, "drawStatusIndicator:", bgRect);
bgRect.origin.y += CSGRowHeight;
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", hexTypeColor)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(CPBezierPath.isa.method_msgSend["fillRect:"] || _objj_forward)(CPBezierPath, "fillRect:", bgRect);
((___r1 = self.type), ___r1 == null ? null : (___r1.isa.method_msgSend["drawInBounds:withAlignment:"] || _objj_forward)(___r1, "drawInBounds:withAlignment:", bgRect, CPCenterTextAlignment));
var row = 2,
portCount = Math.max(self.inports.length, self.outports.length);
for (var i = 0; i < portCount; i++)
{
bgRect.origin.y = self.bounds.origin.y + (i + row) * CSGRowHeight;
if (i < self.inports.length)
{
((___r1 = self.inports[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["renderInBounds:"] || _objj_forward)(___r1, "renderInBounds:", bgRect));
}
if (i < self.outports.length)
{
((___r1 = self.outports[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["renderInBounds:"] || _objj_forward)(___r1, "renderInBounds:", bgRect));
}
}
var frameColor = (self.isa.method_msgSend["identifier"] || _objj_forward)(self, "identifier") ? "00FF00" : hexFrameColor;
if ((self.isa.method_msgSend["isSelected"] || _objj_forward)(self, "isSelected"))
{
frameColor = CSGEditorHighlightColorHEX;
}
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", frameColor)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(CPBezierPath.isa.method_msgSend["strokeRect:"] || _objj_forward)(CPBezierPath, "strokeRect:", self.bounds);
bgRect.origin.y = self.bounds.origin.y - CSGRowHeight;
((___r1 = self.nodeName ? self.nodeName : "---"), ___r1 == null ? null : (___r1.isa.method_msgSend["drawInBounds:withAlignment:"] || _objj_forward)(___r1, "drawInBounds:withAlignment:", bgRect, CPCenterTextAlignment));
var ___r1;
}
,["void","CGRect","CGRect"]), new objj_method(sel_getUid("portAtPoint:"), function $CSGActor__portAtPoint_(self, _cmd, point)
{
var pos = CSGSubtractPoints((self.isa.method_msgSend["origin"] || _objj_forward)(self, "origin"), point),
isOutport = YES,
row = Math.floor(pos.y / CSGRowHeight - 2);
if (row < 0)
{
return nil;
}
if (pos.x >= 0.0 && pos.x <= CSGColPadding)
{
isOutport = NO;
}
else if (pos.x < (self.isa.method_msgSend["size"] || _objj_forward)(self, "size").width - CSGColPadding || pos.x > (self.isa.method_msgSend["size"] || _objj_forward)(self, "size").width)
{
return nil;
}
var ports = isOutport ? self.outports : self.inports;
if (row >= ports.count)
{
return nil;
}
return ports[row];
}
,["CSGPort","GCPoint"])]);
}
p;16;CSGActorUIView.jt;25501;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;10;CSGTheme.jt;25418;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGTheme.j", YES);{
var the_class = objj_getClass("CPTextView")
if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CPTextView\"");
var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("appendText:"), function $CPTextView__appendText_(self, _cmd, aString)
{
var isAttributed = (aString == null ? null : (aString.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(aString, "isKindOfClass:", CPAttributedString)),
string = isAttributed ? (aString == null ? null : (aString.isa.method_msgSend["string"] || _objj_forward)(aString, "string")) : aString;
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "objectValue");
((___r1 = self._textStorage), ___r1 == null ? null : (___r1.isa.method_msgSend["replaceCharactersInRange:withAttributedString:"] || _objj_forward)(___r1, "replaceCharactersInRange:withAttributedString:", CPMakeRangeCopy(self._selectionRange), aString));
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "objectValue");
(self.isa.method_msgSend["_continuouslyReverseSetBinding"] || _objj_forward)(self, "_continuouslyReverseSetBinding");
var selectionRange = CPMakeRange(((___r1 = (self.isa.method_msgSend["string"] || _objj_forward)(self, "string")), ___r1 == null ? null : (___r1.isa.method_msgSend["length"] || _objj_forward)(___r1, "length")), 0);
(self.isa.method_msgSend["_setSelectedRange:affinity:stillSelecting:overwriteTypingAttributes:"] || _objj_forward)(self, "_setSelectedRange:affinity:stillSelecting:overwriteTypingAttributes:", selectionRange, 0, NO, NO);
self._startTrackingLocation = self._selectionRange.location;
(self.isa.method_msgSend["didChangeText"] || _objj_forward)(self, "didChangeText");
((___r1 = self._layoutManager), ___r1 == null ? null : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs"));
(self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit");
(self.isa.method_msgSend["scrollRangeToVisible:"] || _objj_forward)(self, "scrollRangeToVisible:", self._selectionRange);
self._stickyXLocation = MAX(0, self._caret._rect.origin.x - 1);
var ___r1;
}
,["void","CPAttributedString"])]);
}
{var the_class = objj_allocateClassPair(CPButton, "CSGButton"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("mouseDownAction", "SEL")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("mouseDownAction"), function $CSGButton__mouseDownAction(self, _cmd)
{
return self.mouseDownAction;
}
,["SEL"]), new objj_method(sel_getUid("setMouseDownAction:"), function $CSGButton__setMouseDownAction_(self, _cmd, newValue)
{
self.mouseDownAction = newValue;
}
,["void","SEL"]), new objj_method(sel_getUid("mouseDown:"), function $CSGButton__mouseDown_(self, _cmd, anEvent)
{
if ((self.isa.method_msgSend["mouseDownAction"] || _objj_forward)(self, "mouseDownAction"))
{
(CPApp == null ? null : (CPApp.isa.method_msgSend["sendAction:to:from:"] || _objj_forward)(CPApp, "sendAction:to:from:", (self.isa.method_msgSend["mouseDownAction"] || _objj_forward)(self, "mouseDownAction"), (self.isa.method_msgSend["target"] || _objj_forward)(self, "target"), self));
}
(objj_getClass("CSGButton").super_class.method_dtable["mouseDown:"] || _objj_forward)(self, "mouseDown:", anEvent);
}
,["void","CPEvent"])]);
}
{var the_class = objj_allocateClassPair(CPTextField, "CSGBuzzer"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("sound", "JSObject")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("sound"), function $CSGBuzzer__sound(self, _cmd)
{
return self.sound;
}
,["JSObject"]), new objj_method(sel_getUid("setSound:"), function $CSGBuzzer__setSound_(self, _cmd, newValue)
{
self.sound = newValue;
}
,["void","JSObject"]), new objj_method(sel_getUid("initWithFrame:"), function $CSGBuzzer__initWithFrame_(self, _cmd, aFrame)
{
self = (objj_getClass("CSGBuzzer").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", aFrame);
if (self)
{
self.sound = new webkitAudioContext();
var oscillator = self.sound.createOscillator();
console.log(self.sound, oscillator);
oscillator.type = 'square';
oscillator.frequency.value = 440;
oscillator.connect(self.sound.destination);
oscillator.start();
if (self.sound)
{
self.sound.suspend();
}
}
return self;
}
,["id","CGRect"]), new objj_method(sel_getUid("setObjectValue:"), function $CSGBuzzer__setObjectValue_(self, _cmd, obj)
{
console.log();
var volume = obj || 0;
if (volume === 0)
{
if (self.sound)
{
self.sound.suspend();
}
}
else
{
if (self.sound)
{
self.sound.resume();
}
}
(objj_getClass("CSGBuzzer").super_class.method_dtable["setObjectValue:"] || _objj_forward)(self, "setObjectValue:", obj);
}
,["void","id"])]);
}
{var the_class = objj_allocateClassPair(CPView, "CSGActorUIView"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("actor", "CSGActor"), new objj_ivar("imageView", "CPImageView"), new objj_ivar("defaultImage", "CPImage"), new objj_ivar("alternateImage", "CPImage"), new objj_ivar("dragLocation", "CGPoint"), new objj_ivar("layout", "JSObject"), new objj_ivar("_console_attrs", "CPDictionary")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("actor"), function $CSGActorUIView__actor(self, _cmd)
{
return self.actor;
}
,["CSGActor"]), new objj_method(sel_getUid("setActor:"), function $CSGActorUIView__setActor_(self, _cmd, newValue)
{
self.actor = newValue;
}
,["void","CSGActor"]), new objj_method(sel_getUid("initWithActor:config:origin:"), function $CSGActorUIView__initWithActor_config_origin_(self, _cmd, anActor, config, origin)
{
self = (objj_getClass("CSGActorUIView").super_class.method_dtable["initWithFrame:"] || _objj_forward)(self, "initWithFrame:", CGRectMakeZero());
if (self)
{
self.actor = anActor;
self._console_attrs = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [(CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGUIConsoleTextColorHEX), (CPFont.isa.method_msgSend["fontWithName:size:"] || _objj_forward)(CPFont, "fontWithName:size:", CSGUIConsoleFontName, CSGUIConsoleFontSize)], [CPForegroundColorAttributeName, CPFontAttributeName]));
self.layout = (CSGActorUIView.isa.method_msgSend["layout:"] || _objj_forward)(CSGActorUIView, "layout:", config);
(self == null ? null : (self.isa.method_msgSend["setFrameSize:"] || _objj_forward)(self, "setFrameSize:", self.layout.frame.size));
(self == null ? null : (self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", origin));
(self == null ? null : (self.isa.method_msgSend["setup:"] || _objj_forward)(self, "setup:", config));
}
return self;
var ___r1;
}
,["id","CSGActor","JSObject","CGPoint"]), new objj_method(sel_getUid("setup:"), function $CSGActorUIView__setup_(self, _cmd, config)
{
var label = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", self.layout.name_frame));
(label == null ? null : (label.isa.method_msgSend["setEditable:"] || _objj_forward)(label, "setEditable:", NO));
(label == null ? null : (label.isa.method_msgSend["setAlignment:"] || _objj_forward)(label, "setAlignment:", CPCenterTextAlignment));
(label == null ? null : (label.isa.method_msgSend["bind:toObject:withKeyPath:options:"] || _objj_forward)(label, "bind:toObject:withKeyPath:options:", CPValueBinding, self.actor, "name", nil));
(self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", label);
(self.isa.method_msgSend["_loadImages:"] || _objj_forward)(self, "_loadImages:", config);
self.imageView = ((___r1 = (CPImageView.isa.method_msgSend["alloc"] || _objj_forward)(CPImageView, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", self.layout.image_frame));
((___r1 = self.imageView), ___r1 == null ? null : (___r1.isa.method_msgSend["setImageScaling:"] || _objj_forward)(___r1, "setImageScaling:", CPImageScaleProportionallyDown));
((___r1 = self.imageView), ___r1 == null ? null : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", self.defaultImage));
(self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", self.imageView);
var control = (self.isa.method_msgSend["_physicalControl:"] || _objj_forward)(self, "_physicalControl:", config.control);
(self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", control);
var ___r1;
}
,["void","JSObject"]), new objj_method(sel_getUid("_loadImages:"), function $CSGActorUIView___loadImages_(self, _cmd, config)
{
var imageName = "Resources/" + config.image + ".png";
self.defaultImage = ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithContentsOfFile:"] || _objj_forward)(___r1, "initWithContentsOfFile:", imageName));
imageName = "Resources/" + config.image + "_alt.png";
self.alternateImage = ((___r1 = (CPImage.isa.method_msgSend["alloc"] || _objj_forward)(CPImage, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initByReferencingFile:size:"] || _objj_forward)(___r1, "initByReferencingFile:size:", imageName, CGSizeMake(-1, -1)));
((___r1 = self.alternateImage), ___r1 == null ? null : (___r1.isa.method_msgSend["setDelegate:"] || _objj_forward)(___r1, "setDelegate:", self));
((___r1 = self.alternateImage), ___r1 == null ? null : (___r1.isa.method_msgSend["load"] || _objj_forward)(___r1, "load"));
var ___r1;
}
,["void","JSObject"]), new objj_method(sel_getUid("imageDidError:"), function $CSGActorUIView__imageDidError_(self, _cmd, image)
{
if (image == self.alternateImage)
{
self.alternateImage = nil;
}
}
,["void","CPImage"]), new objj_method(sel_getUid("_physicalControl:"), function $CSGActorUIView___physicalControl_(self, _cmd, cConfig)
{
var control = nil;
if (cConfig.sensor)
{
control = (self.isa.method_msgSend["_physicalSensor:"] || _objj_forward)(self, "_physicalSensor:", cConfig);
}
else
{
control = (self.isa.method_msgSend["_physicalActuator:"] || _objj_forward)(self, "_physicalActuator:", cConfig);
}
return control;
}
,["id","JSObject"]), new objj_method(sel_getUid("_physicalSensor:"), function $CSGActorUIView___physicalSensor_(self, _cmd, cConfig)
{
var control;
if (cConfig.type === "boolean")
{
control = ((___r1 = (CSGButton.isa.method_msgSend["alloc"] || _objj_forward)(CSGButton, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", self.layout.control_frame));
(control == null ? null : (control.isa.method_msgSend["setTarget:"] || _objj_forward)(control, "setTarget:", nil));
if (cConfig.behaviour === "momentary")
{
(control == null ? null : (control.isa.method_msgSend["setButtonType:"] || _objj_forward)(control, "setButtonType:", CPMomentaryPushInButton));
(control == null ? null : (control.isa.method_msgSend["setState:"] || _objj_forward)(control, "setState:", cConfig['default'] ? 0 : 1));
(control == null ? null : (control.isa.method_msgSend["setMouseDownAction:"] || _objj_forward)(control, "setMouseDownAction:", sel_getUid("uiSetAction:")));
(control == null ? null : (control.isa.method_msgSend["setAction:"] || _objj_forward)(control, "setAction:", sel_getUid("uiResetAction:")));
}
else
{
(control == null ? null : (control.isa.method_msgSend["setButtonType:"] || _objj_forward)(control, "setButtonType:", CPPushOnPushOffButton));
(control == null ? null : (control.isa.method_msgSend["setState:"] || _objj_forward)(control, "setState:", cConfig['default'] ? 1 : 0));
(control == null ? null : (control.isa.method_msgSend["setAction:"] || _objj_forward)(control, "setAction:", sel_getUid("uiAction:")));
}
}
else
{
control = ((___r1 = (CPSlider.isa.method_msgSend["alloc"] || _objj_forward)(CPSlider, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", self.layout.control_frame));
(control == null ? null : (control.isa.method_msgSend["setTarget:"] || _objj_forward)(control, "setTarget:", nil));
(control == null ? null : (control.isa.method_msgSend["setAction:"] || _objj_forward)(control, "setAction:", sel_getUid("uiAction:")));
(control == null ? null : (control.isa.method_msgSend["setMaxValue:"] || _objj_forward)(control, "setMaxValue:", cConfig.max));
(control == null ? null : (control.isa.method_msgSend["setMinValue:"] || _objj_forward)(control, "setMinValue:", cConfig.min));
(control == null ? null : (control.isa.method_msgSend["setContinuous:"] || _objj_forward)(control, "setContinuous:", NO));
(control == null ? null : (control.isa.method_msgSend["setObjectValue:"] || _objj_forward)(control, "setObjectValue:", cConfig['default']));
}
return control;
var ___r1;
}
,["id","JSObject"]), new objj_method(sel_getUid("_physicalActuator:"), function $CSGActorUIView___physicalActuator_(self, _cmd, cConfig)
{
var control;
if (cConfig.type == "console")
{
var scrollview = ((___r1 = (CPScrollView.isa.method_msgSend["alloc"] || _objj_forward)(CPScrollView, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", self.layout.control_frame));
(scrollview == null ? null : (scrollview.isa.method_msgSend["setHasVerticalScroller:"] || _objj_forward)(scrollview, "setHasVerticalScroller:", YES));
(scrollview == null ? null : (scrollview.isa.method_msgSend["setHasHorizontalScroller:"] || _objj_forward)(scrollview, "setHasHorizontalScroller:", NO));
(scrollview == null ? null : (scrollview.isa.method_msgSend["setAutohidesScrollers:"] || _objj_forward)(scrollview, "setAutohidesScrollers:", YES));
(scrollview == null ? null : (scrollview.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(scrollview, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable));
control = ((___r1 = (CPTextView.isa.method_msgSend["alloc"] || _objj_forward)(CPTextView, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", (scrollview == null ? null : (scrollview.isa.method_msgSend["bounds"] || _objj_forward)(scrollview, "bounds"))));
(control == null ? null : (control.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(control, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable));
(control == null ? null : (control.isa.method_msgSend["setEditable:"] || _objj_forward)(control, "setEditable:", NO));
(control == null ? null : (control.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(control, "setBackgroundColor:", (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGUIConsoleBgColorHEX)));
(scrollview == null ? null : (scrollview.isa.method_msgSend["setDocumentView:"] || _objj_forward)(scrollview, "setDocumentView:", control));
((___r1 = self.actor), ___r1 == null ? null : (___r1.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(___r1, "addObserver:forKeyPath:options:context:", self, "uiState", CPKeyValueChangeSetting, scrollview));
((___r1 = self.actor), ___r1 == null ? null : (___r1.isa.method_msgSend["setUiState:"] || _objj_forward)(___r1, "setUiState:", ""));
control = scrollview;
}
else if (cConfig.behaviour === "audio")
{
control = ((___r1 = (CSGBuzzer.isa.method_msgSend["alloc"] || _objj_forward)(CSGBuzzer, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", self.layout.control_frame));
(control == null ? null : (control.isa.method_msgSend["setEditable:"] || _objj_forward)(control, "setEditable:", NO));
(control == null ? null : (control.isa.method_msgSend["setAlignment:"] || _objj_forward)(control, "setAlignment:", CPCenterTextAlignment));
(control == null ? null : (control.isa.method_msgSend["bind:toObject:withKeyPath:options:"] || _objj_forward)(control, "bind:toObject:withKeyPath:options:", CPValueBinding, self.actor, "uiState", nil));
((___r1 = self.actor), ___r1 == null ? null : (___r1.isa.method_msgSend["setUiState:"] || _objj_forward)(___r1, "setUiState:", cConfig['default'] || 0));
}
else
{
control = ((___r1 = (CPTextField.isa.method_msgSend["alloc"] || _objj_forward)(CPTextField, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithFrame:"] || _objj_forward)(___r1, "initWithFrame:", self.layout.control_frame));
(control == null ? null : (control.isa.method_msgSend["setEditable:"] || _objj_forward)(control, "setEditable:", NO));
(control == null ? null : (control.isa.method_msgSend["setAlignment:"] || _objj_forward)(control, "setAlignment:", CPCenterTextAlignment));
(control == null ? null : (control.isa.method_msgSend["bind:toObject:withKeyPath:options:"] || _objj_forward)(control, "bind:toObject:withKeyPath:options:", CPValueBinding, self.actor, "uiState", nil));
if (cConfig.type === "boolean" || cConfig.type === "int")
{
((___r1 = self.actor), ___r1 == null ? null : (___r1.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(___r1, "addObserver:forKeyPath:options:context:", self, "uiState", CPKeyValueChangeSetting, nil));
}
((___r1 = self.actor), ___r1 == null ? null : (___r1.isa.method_msgSend["setUiState:"] || _objj_forward)(___r1, "setUiState:", cConfig['default'] || 0));
}
return control;
var ___r1;
}
,["id","JSObject"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CSGActorUIView__observeValueForKeyPath_ofObject_change_context_(self, _cmd, keyPath, object, change, context)
{
if (context)
{
var text = ((___r1 = (CPAttributedString.isa.method_msgSend["alloc"] || _objj_forward)(CPAttributedString, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithString:attributes:"] || _objj_forward)(___r1, "initWithString:attributes:", "" + object.uiState, self._console_attrs));
((___r1 = (context == null ? null : (context.isa.method_msgSend["documentView"] || _objj_forward)(context, "documentView"))), ___r1 == null ? null : (___r1.isa.method_msgSend["appendText:"] || _objj_forward)(___r1, "appendText:", text));
return;
}
if (self.alternateImage === nil)
{
return;
}
((___r1 = self.imageView), ___r1 == null ? null : (___r1.isa.method_msgSend["setImage:"] || _objj_forward)(___r1, "setImage:", ((___r2 = object.uiState), ___r2 == null ? null : (___r2.isa.method_msgSend["boolValue"] || _objj_forward)(___r2, "boolValue")) ? self.alternateImage : self.defaultImage));
var ___r1, ___r2;
}
,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("updateVisibility:"), function $CSGActorUIView__updateVisibility_(self, _cmd, actorsOnRuntime)
{
var hidden = YES;
if (actorsOnRuntime)
{
for (var i = 0; i < actorsOnRuntime.length; i++)
{
if (self.actor.identifier === actorsOnRuntime[i])
{
hidden = NO;
break;
}
}
}
(self.isa.method_msgSend["setHidden:"] || _objj_forward)(self, "setHidden:", hidden);
}
,["void","CPArray"]), new objj_method(sel_getUid("mouseDown:"), function $CSGActorUIView__mouseDown_(self, _cmd, anEvent)
{
self.dragLocation = (anEvent == null ? null : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow"));
}
,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $CSGActorUIView__mouseDragged_(self, _cmd, anEvent)
{
var location = (anEvent == null ? null : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")),
origin = (self.isa.method_msgSend["frame"] || _objj_forward)(self, "frame").origin;
if (self.dragLocation == nil)
{
self.dragLocation = location;
}
(self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", CGPointMake(origin.x + location.x - self.dragLocation.x, origin.y + location.y - self.dragLocation.y));
self.dragLocation = location;
}
,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $CSGActorUIView__mouseUp_(self, _cmd, anEvent)
{
var aPoint = (anEvent == null ? null : (anEvent.isa.method_msgSend["locationInWindow"] || _objj_forward)(anEvent, "locationInWindow")).origin;
(self.isa.method_msgSend["setFrameOrigin:"] || _objj_forward)(self, "setFrameOrigin:", aPoint);
}
,["void","CPEvent"]), new objj_method(sel_getUid("drawRect:"), function $CSGActorUIView__drawRect_(self, _cmd, aRect)
{
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGEditorViewBgColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(CPBezierPath.isa.method_msgSend["fillRect:"] || _objj_forward)(CPBezierPath, "fillRect:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"));
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGActorNameBgColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(CPBezierPath.isa.method_msgSend["fillRect:"] || _objj_forward)(CPBezierPath, "fillRect:", self.layout.title_frame);
if (((___r1 = self.actor), ___r1 == null ? null : (___r1.isa.method_msgSend["isSelected"] || _objj_forward)(___r1, "isSelected")))
{
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGEditorHighlightColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
}
else
{
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGComponentActorFrameColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
}
(CPBezierPath.isa.method_msgSend["strokeRect:"] || _objj_forward)(CPBezierPath, "strokeRect:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"));
var ___r1;
}
,["void","CPRect"])]);
class_addMethods(meta_class, [new objj_method(sel_getUid("layout:"), function $CSGActorUIView__layout_(self, _cmd, config)
{
var layout = {};
switch(config.control.type) {
case "console":
layout.title_frame = CGRectMake(0, 0, CSGUIConsoleWidth, CSGRowHeight);
layout.name_frame = CGRectInset(CGRectCreateCopy(layout.title_frame), CSGUIElementInset, CSGUIElementInset);
layout.image_frame = CGRectMakeZero();
layout.control_frame = CGRectMake(0, CSGRowHeight, CSGUIConsoleWidth, CSGUIConsoleHeight);
layout.control_frame = CGRectInset(layout.control_frame, CSGUIElementInset, CSGUIElementInset);
layout.frame = CGRectMake(0, 0, CSGUIConsoleWidth, CSGRowHeight + CSGUIConsoleHeight);
break;
default:
layout.title_frame = CGRectMake(0, 0, CSGUIDeviceWidth, CSGRowHeight);
layout.name_frame = CGRectInset(CGRectCreateCopy(layout.title_frame), CSGUIElementInset, CSGUIElementInset);
layout.image_frame = CGRectMake((CSGUIDeviceWidth - CSGUIDeviceImageWidth) / 2.0, CSGRowHeight + CSGUIDevicePadding, CSGUIDeviceImageWidth, CSGUIDeviceImageHeight);
layout.control_frame = CGRectMake(0, CSGRowHeight + CSGUIDevicePadding * 2.0 + CSGUIDeviceImageHeight, CSGUIDeviceWidth, CSGRowHeight);
layout.control_frame = CGRectInset(layout.control_frame, CSGUIDevicePadding, 0);
layout.frame = CGRectMake(0, 0, CSGUIDeviceWidth, CSGRowHeight * 2.0 + CSGUIDevicePadding * 3.0 + CSGUIDeviceImageHeight);
break;
}
return layout;
}
,["JSObject","JSObject"])]);
}
p;19;CSGPort+Rendering.jt;3034;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;9;CSGPort.ji;10;CSGTheme.jt;2939;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGPort.j", YES);objj_executeFile("CSGTheme.j", YES);{
var the_class = objj_getClass("CSGPort")
if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CSGPort\"");
var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("computeSize"), function $CSGPort__computeSize(self, _cmd)
{
var font = (CPFont.isa.method_msgSend["systemFontOfSize:"] || _objj_forward)(CPFont, "systemFontOfSize:", 12);
var labelSize = ((___r1 = self.portName), ___r1 == null ? null : (___r1.isa.method_msgSend["sizeWithFont:"] || _objj_forward)(___r1, "sizeWithFont:", font));
self.portSize = CPMakeSize(labelSize.width + CSGColPadding, CSGRowHeight);
var ___r1;
}
,["void"]), new objj_method(sel_getUid("size"), function $CSGPort__size(self, _cmd)
{
if (self.portSize.width == 0)
{
(self.isa.method_msgSend["computeSize"] || _objj_forward)(self, "computeSize");
}
return self.portSize;
}
,["CGSize"]), new objj_method(sel_getUid("renderPadInBounds:"), function $CSGPort__renderPadInBounds_(self, _cmd, bounds)
{
var pad = (CPBezierPath.isa.method_msgSend["bezierPath"] || _objj_forward)(CPBezierPath, "bezierPath"),
h = CSGPadScale * CSGRowHeight,
w = CSGPadScale * CSGColPadding,
x = bounds.origin.x + (self.isInport ? 0.0 : bounds.size.width - w),
y = bounds.origin.y + (CSGRowHeight - h) / 2.0 + CSGPadYOffset;
(pad == null ? null : (pad.isa.method_msgSend["moveToPoint:"] || _objj_forward)(pad, "moveToPoint:", CPMakePoint(x, y)));
(pad == null ? null : (pad.isa.method_msgSend["lineToPoint:"] || _objj_forward)(pad, "lineToPoint:", CPMakePoint(x, y + h)));
(pad == null ? null : (pad.isa.method_msgSend["lineToPoint:"] || _objj_forward)(pad, "lineToPoint:", CPMakePoint(x + w, y + h / 2.0)));
(pad == null ? null : (pad.isa.method_msgSend["closePath"] || _objj_forward)(pad, "closePath"));
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGActorPortColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(pad == null ? null : (pad.isa.method_msgSend["fill"] || _objj_forward)(pad, "fill"));
var ___r1;
}
,["void","CGRect"]), new objj_method(sel_getUid("renderInBounds:"), function $CSGPort__renderInBounds_(self, _cmd, bounds)
{
(self.isa.method_msgSend["renderPadInBounds:"] || _objj_forward)(self, "renderPadInBounds:", bounds);
var insetBounds = CGRectInset(bounds, CSGColPadding, 0);
((___r1 = self.portName), ___r1 == null ? null : (___r1.isa.method_msgSend["drawInBounds:withAlignment:"] || _objj_forward)(___r1, "drawInBounds:withAlignment:", insetBounds, self.isInport ? CPLeftTextAlignment : CPRightTextAlignment));
var ___r1;
}
,["void","CGRect"])]);
}
p;22;CSGProjectController.jt;21298;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;12;CSGProgram.ji;16;CSGProgramView.ji;12;CSGProject.ji;12;CSGBackend.ji;20;CSGDataPersistance.jt;21133;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGProgram.j", YES);objj_executeFile("CSGProgramView.j", YES);objj_executeFile("CSGProject.j", YES);objj_executeFile("CSGBackend.j", YES);objj_executeFile("CSGDataPersistance.j", YES);
{var the_class = objj_allocateClassPair(CPViewController, "CSGProjectController"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("projects", "CPMutableArray"), new objj_ivar("currentProject", "CSGProject"), new objj_ivar("backend", "CSGBackend"), new objj_ivar("openSheet", "CPWindow"), new objj_ivar("projectTable", "CPTableView"), new objj_ivar("availableProjects", "CPArray"), new objj_ivar("tentativeProjectName", "CPString"), new objj_ivar("saveSheet", "CPWindow"), new objj_ivar("saveProjectName", "CPTextField"), new objj_ivar("saveUserName", "CPTextField"), new objj_ivar("savePassword", "CPSecureTextField"), new objj_ivar("programView", "CSGProgramView"), new objj_ivar("untitled_count", "int")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("projects"), function $CSGProjectController__projects(self, _cmd)
{
return self.projects;
}
,["CPMutableArray"]), new objj_method(sel_getUid("setProjects:"), function $CSGProjectController__setProjects_(self, _cmd, newValue)
{
self.projects = newValue;
}
,["void","CPMutableArray"]), new objj_method(sel_getUid("currentProject"), function $CSGProjectController__currentProject(self, _cmd)
{
return self.currentProject;
}
,["CSGProject"]), new objj_method(sel_getUid("setCurrentProject:"), function $CSGProjectController__setCurrentProject_(self, _cmd, newValue)
{
self.currentProject = newValue;
}
,["void","CSGProject"]), new objj_method(sel_getUid("availableProjects"), function $CSGProjectController__availableProjects(self, _cmd)
{
return self.availableProjects;
}
,["CPArray"]), new objj_method(sel_getUid("setAvailableProjects:"), function $CSGProjectController__setAvailableProjects_(self, _cmd, newValue)
{
self.availableProjects = newValue;
}
,["void","CPArray"]), new objj_method(sel_getUid("programView"), function $CSGProjectController__programView(self, _cmd)
{
return self.programView;
}
,["CSGProgramView"]), new objj_method(sel_getUid("init"), function $CSGProjectController__init(self, _cmd)
{
self = (objj_getClass("CSGProjectController").super_class.method_dtable["initWithCibName:bundle:externalNameTable:"] || _objj_forward)(self, "initWithCibName:bundle:externalNameTable:", "ProjectView", nil, nil);
if (self)
{
self.untitled_count = 0;
self.projects = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
self.backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
}
return self;
var ___r1;
}
,["id"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CSGProjectController__acceptsFirstResponder(self, _cmd)
{
return YES;
}
,["BOOL"]), new objj_method(sel_getUid("nameForUntitled"), function $CSGProjectController__nameForUntitled(self, _cmd)
{
var suffix = self.untitled_count ? (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "-%d", self.untitled_count) : "";
self.untitled_count++;
return "Untitled" + suffix;
}
,["CPString"]), new objj_method(sel_getUid("setCurrentProject:"), function $CSGProjectController__setCurrentProject_(self, _cmd, project)
{
if (project == self.currentProject)
{
return;
}
((___r1 = self.currentProject), ___r1 == null ? null : (___r1.isa.method_msgSend["deactivate"] || _objj_forward)(___r1, "deactivate"));
self.currentProject = project;
((___r1 = self.currentProject), ___r1 == null ? null : (___r1.isa.method_msgSend["activate"] || _objj_forward)(___r1, "activate"));
var ___r1;
}
,["void","CSGProject"]), new objj_method(sel_getUid("currentProgram"), function $CSGProjectController__currentProgram(self, _cmd)
{
return ((___r1 = self.currentProject), ___r1 == null ? null : (___r1.isa.method_msgSend["program"] || _objj_forward)(___r1, "program"));
var ___r1;
}
,["CSGProgram"]), new objj_method(sel_getUid("projectWithAppID:"), function $CSGProjectController__projectWithAppID_(self, _cmd, app_id)
{
for (var i = 0; i < self.projects.length; i++)
{
var proj = self.projects[i];
if ((proj == null ? null : (proj.isa.method_msgSend["appID"] || _objj_forward)(proj, "appID")) === app_id)
{
return proj;
}
}
return nil;
}
,["CSGProject","CPString"]), new objj_method(sel_getUid("awakeFromCib"), function $CSGProjectController__awakeFromCib(self, _cmd)
{
if (self.untitled_count > 0)
{
CPLog.debug("CSGProjectController::awakeFromCib - been here, done that.");
return;
}
var win = ((___r1 = (CPApp == null ? null : (CPApp.isa.method_msgSend["delegate"] || _objj_forward)(CPApp, "delegate"))), ___r1 == null ? null : (___r1.isa.method_msgSend["theWindow"] || _objj_forward)(___r1, "theWindow"));
var nextResponder = (win == null ? null : (win.isa.method_msgSend["nextResponder"] || _objj_forward)(win, "nextResponder"));
(win == null ? null : (win.isa.method_msgSend["setNextResponder:"] || _objj_forward)(win, "setNextResponder:", self));
(self.isa.method_msgSend["setNextResponder:"] || _objj_forward)(self, "setNextResponder:", nextResponder);
(self.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", self.programView, "currentProject", CPKeyValueObservingOptionNew | CPKeyValueObservingOptionOld, nil);
(self.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(self, "addObserver:forKeyPath:options:context:", (CPApp == null ? null : (CPApp.isa.method_msgSend["delegate"] || _objj_forward)(CPApp, "delegate")), "currentProject.appID", CPKeyValueObservingOptionNew, nil);
var proj = ((___r1 = (CSGProject.isa.method_msgSend["alloc"] || _objj_forward)(CSGProject, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithName:"] || _objj_forward)(___r1, "initWithName:", (self.isa.method_msgSend["nameForUntitled"] || _objj_forward)(self, "nameForUntitled")));
(self.isa.method_msgSend["setProjects:"] || _objj_forward)(self, "setProjects:", (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithObjects:count:"] || _objj_forward)(___r1, "initWithObjects:count:", [proj], 1)));
(self.isa.method_msgSend["setCurrentProject:"] || _objj_forward)(self, "setCurrentProject:", proj);
var ___r1;
}
,["void"]), new objj_method(sel_getUid("newProject:"), function $CSGProjectController__newProject_(self, _cmd, sender)
{
var proj = ((___r1 = (CSGProject.isa.method_msgSend["alloc"] || _objj_forward)(CSGProject, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithName:"] || _objj_forward)(___r1, "initWithName:", (self.isa.method_msgSend["nameForUntitled"] || _objj_forward)(self, "nameForUntitled")));
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "projects");
((___r1 = self.projects), ___r1 == null ? null : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", proj));
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "projects");
(self.isa.method_msgSend["setCurrentProject:"] || _objj_forward)(self, "setCurrentProject:", proj);
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("closeProject:"), function $CSGProjectController__closeProject_(self, _cmd, sender)
{
var index = ((___r1 = self.projects), ___r1 == null ? null : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", self.currentProject));
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "projects");
((___r1 = self.projects), ___r1 == null ? null : (___r1.isa.method_msgSend["removeObjectAtIndex:"] || _objj_forward)(___r1, "removeObjectAtIndex:", index));
if (self.projects.length === 0)
{
var proj = ((___r1 = (CSGProject.isa.method_msgSend["alloc"] || _objj_forward)(CSGProject, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithName:"] || _objj_forward)(___r1, "initWithName:", (self.isa.method_msgSend["nameForUntitled"] || _objj_forward)(self, "nameForUntitled")));
((___r1 = self.projects), ___r1 == null ? null : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", proj));
}
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "projects");
index--;
index = (index + self.projects.length) % self.projects.length;
(self.isa.method_msgSend["setCurrentProject:"] || _objj_forward)(self, "setCurrentProject:", ((___r1 = self.projects), ___r1 == null ? null : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index)));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("saveProject:"), function $CSGProjectController__saveProject_(self, _cmd, sender)
{
var current = (self.isa.method_msgSend["currentProject"] || _objj_forward)(self, "currentProject");
if ((current == null ? null : (current.isa.method_msgSend["isUntitled"] || _objj_forward)(current, "isUntitled")))
{
(self.isa.method_msgSend["saveProjectAs:"] || _objj_forward)(self, "saveProjectAs:", self);
}
else
{
var db = ((___r1 = (CSGLocalPersistence.isa.method_msgSend["alloc"] || _objj_forward)(CSGLocalPersistence, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
(db == null ? null : (db.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(db, "setValue:forKey:", current, (current == null ? null : (current.isa.method_msgSend["name"] || _objj_forward)(current, "name"))));
}
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("revertProjectToSaved:"), function $CSGProjectController__revertProjectToSaved_(self, _cmd, sender)
{
if (((___r1 = self.currentProject), ___r1 == null ? null : (___r1.isa.method_msgSend["isUntitled"] || _objj_forward)(___r1, "isUntitled")))
{
return;
}
var index = ((___r1 = self.projects), ___r1 == null ? null : (___r1.isa.method_msgSend["indexOfObject:"] || _objj_forward)(___r1, "indexOfObject:", self.currentProject));
var db = ((___r1 = (CSGLocalPersistence.isa.method_msgSend["alloc"] || _objj_forward)(CSGLocalPersistence, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
(db == null ? null : (db.isa.method_msgSend["valueForKey:responseBlock:"] || _objj_forward)(db, "valueForKey:responseBlock:", ((___r1 = self.currentProject), ___r1 == null ? null : (___r1.isa.method_msgSend["name"] || _objj_forward)(___r1, "name")), function(proj)
{
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "projects");
((___r1 = self.projects), ___r1 == null ? null : (___r1.isa.method_msgSend["replaceObjectAtIndex:withObject:"] || _objj_forward)(___r1, "replaceObjectAtIndex:withObject:", index, proj));
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "projects");
(self.isa.method_msgSend["setCurrentProject:"] || _objj_forward)(self, "setCurrentProject:", proj);
var ___r1;
}));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("addProject:"), function $CSGProjectController__addProject_(self, _cmd, aProject)
{
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "projects");
var name = (aProject == null ? null : (aProject.isa.method_msgSend["name"] || _objj_forward)(aProject, "name"));
var didReplace = NO;
for (var i = 0; i < self.projects.length; i++)
{
var proj = self.projects[i];
if ((proj == null ? null : (proj.isa.method_msgSend["name"] || _objj_forward)(proj, "name")) === name)
{
self.projects[i] = aProject;
didReplace = YES;
break;
}
}
if (!didReplace)
{
((___r1 = self.projects), ___r1 == null ? null : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", aProject));
}
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "projects");
(self.isa.method_msgSend["setCurrentProject:"] || _objj_forward)(self, "setCurrentProject:", aProject);
var ___r1;
}
,["void","CSGProject"]), new objj_method(sel_getUid("closeSheet:"), function $CSGProjectController__closeSheet_(self, _cmd, sender)
{
var retCode = (sender == null ? null : (sender.isa.method_msgSend["title"] || _objj_forward)(sender, "title")) === "OK" ? 1 : 0;
(CPApp == null ? null : (CPApp.isa.method_msgSend["endSheet:returnCode:"] || _objj_forward)(CPApp, "endSheet:returnCode:", (sender == null ? null : (sender.isa.method_msgSend["window"] || _objj_forward)(sender, "window")), retCode));
}
,["void","id"]), new objj_method(sel_getUid("saveProjectAs:"), function $CSGProjectController__saveProjectAs_(self, _cmd, sender)
{
var db = ((___r1 = (CSGLocalPersistence.isa.method_msgSend["alloc"] || _objj_forward)(CSGLocalPersistence, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
var win = (CPApp == null ? null : (CPApp.isa.method_msgSend["mainWindow"] || _objj_forward)(CPApp, "mainWindow"));
if (self.saveSheet === nil)
{
var cib = (db == null ? null : (db.isa.method_msgSend["needsAuthentication"] || _objj_forward)(db, "needsAuthentication")) ? "SaveAuthSheet" : "SaveSheet";
(CPBundle.isa.method_msgSend["loadCibNamed:owner:"] || _objj_forward)(CPBundle, "loadCibNamed:owner:", cib, self);
}
((___r1 = self.saveProjectName), ___r1 == null ? null : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", ((___r2 = self.currentProject), ___r2 == null ? null : (___r2.isa.method_msgSend["name"] || _objj_forward)(___r2, "name"))));
(CPApp == null ? null : (CPApp.isa.method_msgSend["beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:"] || _objj_forward)(CPApp, "beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:", self.saveSheet, win, self, sel_getUid("didEndSaveSheet:returnCode:contextInfo:"), db));
var ___r1, ___r2;
}
,["void","id"]), new objj_method(sel_getUid("didEndSaveSheet:returnCode:contextInfo:"), function $CSGProjectController__didEndSaveSheet_returnCode_contextInfo_(self, _cmd, sheet, returnCode, contextInfo)
{
(sheet == null ? null : (sheet.isa.method_msgSend["orderOut:"] || _objj_forward)(sheet, "orderOut:", self));
var db = contextInfo;
if (returnCode == 1)
{
var aName = ((___r1 = self.saveProjectName), ___r1 == null ? null : (___r1.isa.method_msgSend["stringValue"] || _objj_forward)(___r1, "stringValue"));
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "projects");
((___r1 = self.currentProject), ___r1 == null ? null : (___r1.isa.method_msgSend["setName:"] || _objj_forward)(___r1, "setName:", aName));
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "projects");
if ((db == null ? null : (db.isa.method_msgSend["needsAuthentication"] || _objj_forward)(db, "needsAuthentication")))
{
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["authenticatePersistanceUser:withPassword:responseBlock:"] || _objj_forward)(___r1, "authenticatePersistanceUser:withPassword:responseBlock:", ((___r2 = self.saveUserName), ___r2 == null ? null : (___r2.isa.method_msgSend["stringValue"] || _objj_forward)(___r2, "stringValue")), ((___r2 = self.savePassword), ___r2 == null ? null : (___r2.isa.method_msgSend["stringValue"] || _objj_forward)(___r2, "stringValue")), function(token)
{
(db == null ? null : (db.isa.method_msgSend["setAuthToken:"] || _objj_forward)(db, "setAuthToken:", token));
(db == null ? null : (db.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(db, "setValue:forKey:", self.currentProject, aName));
}));
}
else
{
(db == null ? null : (db.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(db, "setValue:forKey:", self.currentProject, aName));
}
}
var ___r1, ___r2;
}
,["void","CPWindow","CPInteger","id"]), new objj_method(sel_getUid("loadProject:"), function $CSGProjectController__loadProject_(self, _cmd, sender)
{
var db = ((___r1 = (CSGLocalPersistence.isa.method_msgSend["alloc"] || _objj_forward)(CSGLocalPersistence, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
var win = (CPApp == null ? null : (CPApp.isa.method_msgSend["mainWindow"] || _objj_forward)(CPApp, "mainWindow"));
(self.isa.method_msgSend["setAvailableProjects:"] || _objj_forward)(self, "setAvailableProjects:", []);
(db == null ? null : (db.isa.method_msgSend["allKeysUsingResponseBlock:"] || _objj_forward)(db, "allKeysUsingResponseBlock:", function(keys)
{
(self.isa.method_msgSend["setAvailableProjects:"] || _objj_forward)(self, "setAvailableProjects:", keys);
}));
if (self.openSheet === nil)
{
(CPBundle.isa.method_msgSend["loadCibNamed:owner:"] || _objj_forward)(CPBundle, "loadCibNamed:owner:", "OpenSheet", self);
}
(CPApp == null ? null : (CPApp.isa.method_msgSend["beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:"] || _objj_forward)(CPApp, "beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:", self.openSheet, win, self, sel_getUid("didEndOpenSheet:returnCode:contextInfo:"), db));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("didEndOpenSheet:returnCode:contextInfo:"), function $CSGProjectController__didEndOpenSheet_returnCode_contextInfo_(self, _cmd, sheet, returnCode, contextInfo)
{
(sheet == null ? null : (sheet.isa.method_msgSend["orderOut:"] || _objj_forward)(sheet, "orderOut:", self));
var db = contextInfo;
var selectionIndex = ((___r1 = self.projectTable), ___r1 == null ? null : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow"));
var validSelection = returnCode == 1 && selectionIndex >= 0;
if (validSelection)
{
self.tentativeProjectName = self.availableProjects[selectionIndex];
(db == null ? null : (db.isa.method_msgSend["valueForKey:responseBlock:"] || _objj_forward)(db, "valueForKey:responseBlock:", self.tentativeProjectName, function(proj)
{
(self.isa.method_msgSend["addProject:"] || _objj_forward)(self, "addProject:", proj);
}));
}
var ___r1;
}
,["void","CPWindow","CPInteger","id"]), new objj_method(sel_getUid("runProject:"), function $CSGProjectController__runProject_(self, _cmd, sender)
{
((___r1 = self.currentProject), ___r1 == null ? null : (___r1.isa.method_msgSend["run"] || _objj_forward)(___r1, "run"));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("stopProject:"), function $CSGProjectController__stopProject_(self, _cmd, sender)
{
((___r1 = self.currentProject), ___r1 == null ? null : (___r1.isa.method_msgSend["stop"] || _objj_forward)(___r1, "stop"));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("stopAll:"), function $CSGProjectController__stopAll_(self, _cmd, sender)
{
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["updateAvailableApplicationsUsingBlock:"] || _objj_forward)(___r1, "updateAvailableApplicationsUsingBlock:", function(applist)
{
for (var i = 0; i < applist.length; i++)
{
var app_id = applist[i];
var proj = (self.isa.method_msgSend["projectWithAppID:"] || _objj_forward)(self, "projectWithAppID:", app_id);
if (proj)
{
(proj == null ? null : (proj.isa.method_msgSend["stop"] || _objj_forward)(proj, "stop"));
} else
{
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["stopAppWithID:responseBlock:"] || _objj_forward)(___r1, "stopAppWithID:responseBlock:", app_id, function()
{
CPLog("Stopping application not started in this session.");
}));
} } var ___r1;
}));
var ___r1;
}
,["void","id"])]);
}
p;18;CSGGeometryUtils.jt;195;@STATIC;1.0;t;177;CSGSubtractPoints = function(p0, p1)
{
return CPMakePoint(p1.x - p0.x, p1.y - p0.y);
}
CSGAddPoints = function(p0, p1)
{
return CPMakePoint(p1.x + p0.x, p1.y + p0.y);
}
p;25;CSGConnection+Rendering.jt;2401;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;15;CSGConnection.ji;10;CSGTheme.jt;2299;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGConnection.j", YES);objj_executeFile("CSGTheme.j", YES);{
var the_class = objj_getClass("CSGConnection")
if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CSGConnection\"");
var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("renderWithDirtyRect:"), function $CSGConnection__renderWithDirtyRect_(self, _cmd, dirtyRect)
{
var srcLocation = ((___r1 = self.src), ___r1 == null ? null : (___r1.isa.method_msgSend["anchorPointForPort:"] || _objj_forward)(___r1, "anchorPointForPort:", self.srcPort)),
dstLocation = ((___r1 = self.dst), ___r1 == null ? null : (___r1.isa.method_msgSend["anchorPointForPort:"] || _objj_forward)(___r1, "anchorPointForPort:", self.dstPort)),
scrCtrlLocation,
dstCtrlLocation;
if ((dstLocation.x - srcLocation.x) / 2.0 < CSGMinControlDist)
{
var dy = self.src === self.dst && srcLocation.y - dstLocation.y < 1.0 ? CSGSameActorRowDist : 0.0;
scrCtrlLocation = CPMakePoint(srcLocation.x + CSGMinControlDist, srcLocation.y - dy);
dstCtrlLocation = CPMakePoint(dstLocation.x - CSGMinControlDist, dstLocation.y + dy);
}
else
{
scrCtrlLocation = CPMakePoint((srcLocation.x + dstLocation.x) / 2, srcLocation.y);
dstCtrlLocation = CPMakePoint((srcLocation.x + dstLocation.x) / 2, dstLocation.y);
}
var path = (CPBezierPath.isa.method_msgSend["bezierPath"] || _objj_forward)(CPBezierPath, "bezierPath");
(path == null ? null : (path.isa.method_msgSend["moveToPoint:"] || _objj_forward)(path, "moveToPoint:", srcLocation));
(path == null ? null : (path.isa.method_msgSend["curveToPoint:controlPoint1:controlPoint2:"] || _objj_forward)(path, "curveToPoint:controlPoint1:controlPoint2:", dstLocation, scrCtrlLocation, dstCtrlLocation));
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGConnectionColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(path == null ? null : (path.isa.method_msgSend["stroke"] || _objj_forward)(path, "stroke"));
var ___r1;
}
,["void","CGRect"])]);
}
p;14;CSGInspector.jt;11188;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;14;CSGComponent.ji;10;CSGActor.ji;15;CSGConnection.ji;10;CSGTheme.jt;11051;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGComponent.j", YES);objj_executeFile("CSGActor.j", YES);objj_executeFile("CSGConnection.j", YES);objj_executeFile("CSGTheme.j", YES);
{var the_class = objj_allocateClassPair(CPViewController, "CSGInspector"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("component", "CSGComponent"), new objj_ivar("delegate", "id"), new objj_ivar("keys", "CPArray"), new objj_ivar("optKeys", "CPArray"), new objj_ivar("mandatoryCount", "CPInteger"), new objj_ivar("totalCount", "CPInteger"), new objj_ivar("docs", "CPString"), new objj_ivar("panelNameField", "CPTextField"), new objj_ivar("panelTypeField", "CPTextField"), new objj_ivar("panelTableView", "CPTableView")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("docs"), function $CSGInspector__docs(self, _cmd)
{
return self.docs;
}
,["CPString"]), new objj_method(sel_getUid("setDocs:"), function $CSGInspector__setDocs_(self, _cmd, newValue)
{
self.docs = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("initWithDelegate:"), function $CSGInspector__initWithDelegate_(self, _cmd, inspectorDelegate)
{
self = (objj_getClass("CSGInspector").super_class.method_dtable["initWithCibName:bundle:externalNameTable:"] || _objj_forward)(self, "initWithCibName:bundle:externalNameTable:", "InspectorView", nil, nil);
if (self)
{
self.delegate = inspectorDelegate;
((___r1 = (self == null ? null : (self.isa.method_msgSend["view"] || _objj_forward)(self, "view"))), ___r1 == null ? null : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES));
self.docs = "";
}
return self;
var ___r1;
}
,["id","id"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CSGInspector__observeValueForKeyPath_ofObject_change_context_(self, _cmd, keyPath, object, change, context)
{
var newSel = (change == null ? null : (change.isa.method_msgSend["objectForKey:"] || _objj_forward)(change, "objectForKey:", "CPKeyValueChangeNewKey"));
(self.isa.method_msgSend["setComponent:"] || _objj_forward)(self, "setComponent:", newSel);
}
,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("setComponent:"), function $CSGInspector__setComponent_(self, _cmd, comp)
{
self.component = comp;
if ((comp == null ? null : (comp.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(comp, "isKindOfClass:", (CSGActor.isa.method_msgSend["class"] || _objj_forward)(CSGActor, "class"))))
{
((___r1 = (self.isa.method_msgSend["view"] || _objj_forward)(self, "view")), ___r1 == null ? null : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO));
((___r1 = self.panelNameField), ___r1 == null ? null : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", comp.name));
((___r1 = self.panelTypeField), ___r1 == null ? null : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", comp.type));
(self.isa.method_msgSend["setDocs:"] || _objj_forward)(self, "setDocs:", comp.docs);
self.keys = ((___r1 = ((___r2 = comp.mandatoryArgs), ___r2 == null ? null : (___r2.isa.method_msgSend["allKeys"] || _objj_forward)(___r2, "allKeys"))), ___r1 == null ? null : (___r1.isa.method_msgSend["sortedArrayUsingSelector:"] || _objj_forward)(___r1, "sortedArrayUsingSelector:", sel_getUid("caseInsensitiveCompare:")));
self.optKeys = ((___r1 = ((___r2 = comp.optionalArgs), ___r2 == null ? null : (___r2.isa.method_msgSend["allKeys"] || _objj_forward)(___r2, "allKeys"))), ___r1 == null ? null : (___r1.isa.method_msgSend["sortedArrayUsingSelector:"] || _objj_forward)(___r1, "sortedArrayUsingSelector:", sel_getUid("caseInsensitiveCompare:")));
self.mandatoryCount = ((___r1 = self.keys), ___r1 == null ? null : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"));
self.totalCount = self.mandatoryCount + ((___r1 = self.optKeys), ___r1 == null ? null : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"));
}
else
{
self.totalCount = 0;
((___r1 = (self.isa.method_msgSend["view"] || _objj_forward)(self, "view")), ___r1 == null ? null : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES));
(self.isa.method_msgSend["setDocs:"] || _objj_forward)(self, "setDocs:", "");
}
((___r1 = self.panelTableView), ___r1 == null ? null : (___r1.isa.method_msgSend["reloadData"] || _objj_forward)(___r1, "reloadData"));
var ___r1, ___r2;
}
,["void","CGSComponent"]), new objj_method(sel_getUid("updateName:"), function $CSGInspector__updateName_(self, _cmd, sender)
{
if (self.component === nil || !((___r1 = self.component), ___r1 == null ? null : (___r1.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(___r1, "isKindOfClass:", (CSGActor.isa.method_msgSend["class"] || _objj_forward)(CSGActor, "class"))))
{
console.log("ERROR: updateName BAD COMPONENT", self.component, sender);
return;
}
if (((___r1 = self.delegate), ___r1 == null ? null : (___r1.isa.method_msgSend["shouldSetName:forActor:"] || _objj_forward)(___r1, "shouldSetName:forActor:", (sender == null ? null : (sender.isa.method_msgSend["stringValue"] || _objj_forward)(sender, "stringValue")), self.component)))
{
((___r1 = self.component), ___r1 == null ? null : (___r1.isa.method_msgSend["setName:"] || _objj_forward)(___r1, "setName:", (sender == null ? null : (sender.isa.method_msgSend["stringValue"] || _objj_forward)(sender, "stringValue"))));
((___r1 = self.delegate), ___r1 == null ? null : (___r1.isa.method_msgSend["refreshViewForActor:"] || _objj_forward)(___r1, "refreshViewForActor:", self.component));
}
else
{
(sender == null ? null : (sender.isa.method_msgSend["setStringValue:"] || _objj_forward)(sender, "setStringValue:", ((___r1 = self.component), ___r1 == null ? null : (___r1.isa.method_msgSend["name"] || _objj_forward)(___r1, "name"))));
}
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("controlTextDidEndEditing:"), function $CSGInspector__controlTextDidEndEditing_(self, _cmd, aNotification)
{
var row = ((___r1 = self.panelTableView), ___r1 == null ? null : (___r1.isa.method_msgSend["selectedRow"] || _objj_forward)(___r1, "selectedRow"));
if (row < 0)
{
return;
}
var textField = (aNotification == null ? null : (aNotification.isa.method_msgSend["object"] || _objj_forward)(aNotification, "object"));
var value = (textField == null ? null : (textField.isa.method_msgSend["stringValue"] || _objj_forward)(textField, "stringValue"));
if (row < self.mandatoryCount)
{
var key = self.keys[row];
((___r1 = self.component), ___r1 == null ? null : (___r1.isa.method_msgSend["setMandatoryValue:forKey:"] || _objj_forward)(___r1, "setMandatoryValue:forKey:", value, key));
}
else
{
var key = self.optKeys[row - self.mandatoryCount];
((___r1 = self.component), ___r1 == null ? null : (___r1.isa.method_msgSend["setOptionalValue:forKey:"] || _objj_forward)(___r1, "setOptionalValue:forKey:", value, key));
}
(self.isa.method_msgSend["_updateTextField:atRow:forKey:"] || _objj_forward)(self, "_updateTextField:atRow:forKey:", textField, row, key);
((___r1 = self.delegate), ___r1 == null ? null : (___r1.isa.method_msgSend["refreshViewForActor:"] || _objj_forward)(___r1, "refreshViewForActor:", self.component));
var ___r1;
}
,["void","CPNotification"]), new objj_method(sel_getUid("_updateTextField:atRow:forKey:"), function $CSGInspector___updateTextField_atRow_forKey_(self, _cmd, textField, row, key)
{
var bgColors = ((___r1 = self.panelTableView), ___r1 == null ? null : (___r1.isa.method_msgSend["alternatingRowBackgroundColors"] || _objj_forward)(___r1, "alternatingRowBackgroundColors"));
var valid = ((___r1 = self.component.argOK), ___r1 == null ? null : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", key));
var bgColor = valid ? bgColors[row % 2] : (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGEditorHighlightErrorColorHEX);
(textField == null ? null : (textField.isa.method_msgSend["setBackgroundColor:"] || _objj_forward)(textField, "setBackgroundColor:", bgColor));
(textField == null ? null : (textField.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(textField, "setNeedsDisplay:", YES));
var ___r1;
}
,["void","CPTextField","CPInteger","CPString"]), new objj_method(sel_getUid("numberOfRowsInTableView:"), function $CSGInspector__numberOfRowsInTableView_(self, _cmd, tv)
{
return self.totalCount;
}
,["CPInteger","CPTableView"]), new objj_method(sel_getUid("tableView:viewForTableColumn:row:"), function $CSGInspector__tableView_viewForTableColumn_row_(self, _cmd, table, tableColumn, row)
{
var key,
displayKey,
value,
colId = tableColumn._identifier;
if (row < self.mandatoryCount)
{
key = self.keys[row];
displayKey = key;
value = ((___r1 = self.component.mandatoryArgs), ___r1 == null ? null : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", key));
}
else
{
key = self.optKeys[row - self.mandatoryCount];
value = ((___r1 = self.component.optionalArgs), ___r1 == null ? null : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", key));
displayKey = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "(%@)", key);
}
var textField = (table == null ? null : (table.isa.method_msgSend["makeViewWithIdentifier:owner:"] || _objj_forward)(table, "makeViewWithIdentifier:owner:", colId, self));
if ((colId == null ? null : (colId.isa.method_msgSend["isEqualToString:"] || _objj_forward)(colId, "isEqualToString:", "args")))
{
(textField == null ? null : (textField.isa.method_msgSend["setStringValue:"] || _objj_forward)(textField, "setStringValue:", displayKey));
}
else if ((colId == null ? null : (colId.isa.method_msgSend["isEqualToString:"] || _objj_forward)(colId, "isEqualToString:", "vals")))
{
(textField == null ? null : (textField.isa.method_msgSend["setStringValue:"] || _objj_forward)(textField, "setStringValue:", value));
(self.isa.method_msgSend["_updateTextField:atRow:forKey:"] || _objj_forward)(self, "_updateTextField:atRow:forKey:", textField, row, key);
}
else
{
(textField == null ? null : (textField.isa.method_msgSend["setStringValue:"] || _objj_forward)(textField, "setStringValue:", "ERROR"));
}
return textField;
var ___r1;
}
,["CPView","CPTableView","CPTableColumn","CPInteger"])]);
}
p;10;CSGTheme.jt;1310;@STATIC;1.0;t;1291;CSGErrorColorHEX = "FF0000";
CSGOKColorHEX = "00FF00";
CSGEditorViewBgColorHEX = "FFFFFF";
CSGEditorHighlightColorHEX = "EEA420";
CSGEditorHighlightErrorColorHEX = "FCCFD0";
CSGOutlineViewBgColorHEX = "E4E4E2";
CSGInfoViewBgColorHEX = "E4E4E2";
CSGActorBgColorHEX = "FFFFFF";
CSGActorFrameColorHEX = "091637";
CSGActorNameBgColorHEX = "9ECFE0";
CSGActorTypeBgColorHEX = "FFFFFF";
CSGActorPortColorHEX = "B6B6B6";
CSGComponentActorBgColorHEX = "FFFFFF";
CSGComponentActorFrameColorHEX = "091637";
CSGComponentActorNameBgColorHEX = "FFFFD8";
CSGComponentActorTypeBgColorHEX = "FFFFFF";
CSGConnectionColorHEX = "091637";
CSGConnectionPendingColorHEX = "0994BB";
CSGDefaultColorPalette = ["E16E22", "4F0946", "CF1C21", "EEA420", "68B134", "004C43", "0994BB", "767476", "AAAAAA", "EEEEEE", "C8DFA6", "FDE9BE"];
(CSGRowHeight = 20.0, CSGColPadding = 10.0, CSGPadScale = 0.7, CSGPadYOffset = -2.0, CSGMinControlDist = 80.0, CSGSameActorRowDist = 40.0);
CSGUIConsoleBgColorHEX = "555555";
CSGUIConsoleTextColorHEX = "EEEEEE";
CSGUIDeviceWidth = 120.0;
CSGUIDevicePadding = 10.0;
CSGUIDeviceImageHeight = 64.0;
CSGUIDeviceImageWidth = CSGUIDeviceImageHeight;
CSGUIElementInset = 3.0;
CSGUIConsoleWidth = 300.0;
CSGUIConsoleHeight = 200.0;
CSGUIConsoleFontName = "Courier";
CSGUIConsoleFontSize = 12;
p;15;CSGHostConfig.jt;7491;@STATIC;1.0;I;23;Foundation/Foundation.jI;22;AppKit/CPApplication.jt;7417;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/CPApplication.j", NO);CSGCalvinHostKey = "calvinHost";
CSGCalvinPortKey = "calvinPort";
CSGPersistanceHostKey = "persistanceHost";
CSGPersistancePortKey = "persistancePort";
CSGAuthHostKey = "authHost";
CSGAuthPortKey = "authPort";
CSGConsoleHostKey = "consoleHost";
CSGConsolePortKey = "consolePort";
CSGContainerIDKey = "containerID";
CGSDefaultConfigPrivate = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", ["127.0.0.1", 5001, "localhost", 8081, "localhost", 8081, "localhost", 8087, ""], [CSGCalvinHostKey, CSGCalvinPortKey, CSGPersistanceHostKey, CSGPersistancePortKey, CSGAuthHostKey, CSGAuthPortKey, CSGConsoleHostKey, CSGConsolePortKey, CSGContainerIDKey]));
var sharedHostConfigInstance = nil;
{var the_class = objj_allocateClassPair(CPObject, "CSGHostConfig"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("calvinHost", "CPString"), new objj_ivar("persistanceHost", "CPString"), new objj_ivar("authHost", "CPString"), new objj_ivar("consoleHost", "CPString"), new objj_ivar("calvinPort", "int"), new objj_ivar("persistancePort", "int"), new objj_ivar("authPort", "int"), new objj_ivar("consolePort", "int"), new objj_ivar("containerID", "CPString")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("calvinHost"), function $CSGHostConfig__calvinHost(self, _cmd)
{
return self.calvinHost;
}
,["CPString"]), new objj_method(sel_getUid("setCalvinHost:"), function $CSGHostConfig__setCalvinHost_(self, _cmd, newValue)
{
self.calvinHost = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("persistanceHost"), function $CSGHostConfig__persistanceHost(self, _cmd)
{
return self.persistanceHost;
}
,["CPString"]), new objj_method(sel_getUid("setPersistanceHost:"), function $CSGHostConfig__setPersistanceHost_(self, _cmd, newValue)
{
self.persistanceHost = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("authHost"), function $CSGHostConfig__authHost(self, _cmd)
{
return self.authHost;
}
,["CPString"]), new objj_method(sel_getUid("setAuthHost:"), function $CSGHostConfig__setAuthHost_(self, _cmd, newValue)
{
self.authHost = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("consoleHost"), function $CSGHostConfig__consoleHost(self, _cmd)
{
return self.consoleHost;
}
,["CPString"]), new objj_method(sel_getUid("setConsoleHost:"), function $CSGHostConfig__setConsoleHost_(self, _cmd, newValue)
{
self.consoleHost = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("calvinPort"), function $CSGHostConfig__calvinPort(self, _cmd)
{
return self.calvinPort;
}
,["int"]), new objj_method(sel_getUid("setCalvinPort:"), function $CSGHostConfig__setCalvinPort_(self, _cmd, newValue)
{
self.calvinPort = newValue;
}
,["void","int"]), new objj_method(sel_getUid("persistancePort"), function $CSGHostConfig__persistancePort(self, _cmd)
{
return self.persistancePort;
}
,["int"]), new objj_method(sel_getUid("setPersistancePort:"), function $CSGHostConfig__setPersistancePort_(self, _cmd, newValue)
{
self.persistancePort = newValue;
}
,["void","int"]), new objj_method(sel_getUid("authPort"), function $CSGHostConfig__authPort(self, _cmd)
{
return self.authPort;
}
,["int"]), new objj_method(sel_getUid("setAuthPort:"), function $CSGHostConfig__setAuthPort_(self, _cmd, newValue)
{
self.authPort = newValue;
}
,["void","int"]), new objj_method(sel_getUid("consolePort"), function $CSGHostConfig__consolePort(self, _cmd)
{
return self.consolePort;
}
,["int"]), new objj_method(sel_getUid("setConsolePort:"), function $CSGHostConfig__setConsolePort_(self, _cmd, newValue)
{
self.consolePort = newValue;
}
,["void","int"]), new objj_method(sel_getUid("containerID"), function $CSGHostConfig__containerID(self, _cmd)
{
return self.containerID;
}
,["CPString"]), new objj_method(sel_getUid("setContainerID:"), function $CSGHostConfig__setContainerID_(self, _cmd, newValue)
{
self.containerID = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("init"), function $CSGHostConfig__init(self, _cmd)
{
(CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", "CSGHostConfig", "Singleton. Use +sharedHostConfig");
}
,["id"]), new objj_method(sel_getUid("_init"), function $CSGHostConfig___init(self, _cmd)
{
self = (objj_getClass("CSGHostConfig").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
var defaults = CGSDefaultConfigPrivate;
var kwargs = ((___r1 = (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication")), ___r1 == null ? null : (___r1.isa.method_msgSend["namedArguments"] || _objj_forward)(___r1, "namedArguments"));
(defaults == null ? null : (defaults.isa.method_msgSend["addEntriesFromDictionary:"] || _objj_forward)(defaults, "addEntriesFromDictionary:", kwargs));
var keys = (defaults == null ? null : (defaults.isa.method_msgSend["allKeys"] || _objj_forward)(defaults, "allKeys"));
for (var i = 0; i < keys.length; i++)
{
var key = keys[i];
var value = (defaults == null ? null : (defaults.isa.method_msgSend["valueForKey:"] || _objj_forward)(defaults, "valueForKey:", key));
try {
(self == null ? null : (self.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(self, "setValue:forKey:", value, key));
}
catch(err) {
console.log(err, key);
}
}
}
return self;
var ___r1;
}
,["id"]), new objj_method(sel_getUid("runtimeBase"), function $CSGHostConfig__runtimeBase(self, _cmd)
{
if (self.containerID !== "")
{
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "http://%@:%d/calvin/%@", self.calvinHost, self.calvinPort, self.containerID);
}
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "http://%@:%d", self.calvinHost, self.calvinPort);
}
,["CPString"]), new objj_method(sel_getUid("authBase"), function $CSGHostConfig__authBase(self, _cmd)
{
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "http://%@:%d", self.authHost, self.authPort);
}
,["CPString"]), new objj_method(sel_getUid("persistanceBase"), function $CSGHostConfig__persistanceBase(self, _cmd)
{
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "http://%@:%d", self.persistanceHost, self.persistancePort);
}
,["CPString"])]);
class_addMethods(meta_class, [new objj_method(sel_getUid("sharedHostConfig"), function $CSGHostConfig__sharedHostConfig(self, _cmd)
{
if (!sharedHostConfigInstance)
{
sharedHostConfigInstance = ((___r1 = (CSGHostConfig.isa.method_msgSend["alloc"] || _objj_forward)(CSGHostConfig, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["_init"] || _objj_forward)(___r1, "_init"));
}
return sharedHostConfigInstance;
var ___r1;
}
,["id"])]);
}
p;18;CSGActorTreeNode.jt;4064;@STATIC;1.0;I;23;Foundation/Foundation.ji;10;CSGActor.jt;4002;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CSGActor.j", YES);
{var the_class = objj_allocateClassPair(CPObject, "CSGActorTreeNode"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("data", "CPString"), new objj_ivar("path", "CPString"), new objj_ivar("info", "JSObject"), new objj_ivar("documentation", "CPString"), new objj_ivar("isLeaf", "BOOL"), new objj_ivar("children", "CPMutableArray")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("data"), function $CSGActorTreeNode__data(self, _cmd)
{
return self.data;
}
,["CPString"]), new objj_method(sel_getUid("path"), function $CSGActorTreeNode__path(self, _cmd)
{
return self.path;
}
,["CPString"]), new objj_method(sel_getUid("setPath:"), function $CSGActorTreeNode__setPath_(self, _cmd, newValue)
{
self.path = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("info"), function $CSGActorTreeNode__info(self, _cmd)
{
return self.info;
}
,["JSObject"]), new objj_method(sel_getUid("setInfo:"), function $CSGActorTreeNode__setInfo_(self, _cmd, newValue)
{
self.info = newValue;
}
,["void","JSObject"]), new objj_method(sel_getUid("documentation"), function $CSGActorTreeNode__documentation(self, _cmd)
{
return self.documentation;
}
,["CPString"]), new objj_method(sel_getUid("setDocumentation:"), function $CSGActorTreeNode__setDocumentation_(self, _cmd, newValue)
{
self.documentation = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("isLeaf"), function $CSGActorTreeNode__isLeaf(self, _cmd)
{
return self.isLeaf;
}
,["BOOL"]), new objj_method(sel_getUid("setIsLeaf:"), function $CSGActorTreeNode__setIsLeaf_(self, _cmd, newValue)
{
self.isLeaf = newValue;
}
,["void","BOOL"]), new objj_method(sel_getUid("initWithData:"), function $CSGActorTreeNode__initWithData_(self, _cmd, string)
{
if (self = (objj_getClass("CSGActorTreeNode").super_class.method_dtable["init"] || _objj_forward)(self, "init"))
{
self.children = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
self.data = string;
self.path = string;
self.documentation = string;
self.isLeaf = NO;
}
return self;
var ___r1;
}
,["id","CPString"]), new objj_method(sel_getUid("description"), function $CSGActorTreeNode__description(self, _cmd)
{
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "TreeNode%@(%@)", self.isLeaf ? "Leaf" : "", self.path);
}
,["CPString"]), new objj_method(sel_getUid("addChild:"), function $CSGActorTreeNode__addChild_(self, _cmd, child)
{
if (self.data !== "")
{
(child == null ? null : (child.isa.method_msgSend["setPath:"] || _objj_forward)(child, "setPath:", self.data + "." + child.data));
}
((___r1 = self.children), ___r1 == null ? null : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", child));
var ___r1;
}
,["void","CSGActorTreeNode"]), new objj_method(sel_getUid("childAtIndex:"), function $CSGActorTreeNode__childAtIndex_(self, _cmd, index)
{
return ((___r1 = self.children), ___r1 == null ? null : (___r1.isa.method_msgSend["objectAtIndex:"] || _objj_forward)(___r1, "objectAtIndex:", index));
var ___r1;
}
,["CSGActorTreeNode","int"]), new objj_method(sel_getUid("count"), function $CSGActorTreeNode__count(self, _cmd)
{
return ((___r1 = self.children), ___r1 == null ? null : (___r1.isa.method_msgSend["count"] || _objj_forward)(___r1, "count"));
var ___r1;
}
,["int"]), new objj_method(sel_getUid("setInfo:"), function $CSGActorTreeNode__setInfo_(self, _cmd, actorInfo)
{
self.info = actorInfo;
(self.isa.method_msgSend["setDocumentation:"] || _objj_forward)(self, "setDocumentation:", CSGActorDocsFromJSONRep(actorInfo));
}
,["void","JSObject"])]);
}
p;16;CSGAppUIViewer.jt;4862;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;14;CSGAppUIView.ji;12;CSGBackend.ji;18;CSGEventListener.jt;4736;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGAppUIView.j", YES);objj_executeFile("CSGBackend.j", YES);objj_executeFile("CSGEventListener.j", YES);
{var the_class = objj_allocateClassPair(CPWindowController, "CSGAppUIViewer"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CSGEventListening");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CSGEventListening\"");
class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("project", "CSGProject"), new objj_ivar("appUIView", "CSGAppUIView")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("initWithProject:"), function $CSGAppUIViewer__initWithProject_(self, _cmd, aProject)
{
self = (objj_getClass("CSGAppUIViewer").super_class.method_dtable["initWithWindowCibName:"] || _objj_forward)(self, "initWithWindowCibName:", "AppUIViewer");
if (self)
{
self.project = aProject;
((___r1 = (self == null ? null : (self.isa.method_msgSend["window"] || _objj_forward)(self, "window"))), ___r1 == null ? null : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", "Device Simulation"));
((___r1 = self.appUIView), ___r1 == null ? null : (___r1.isa.method_msgSend["addActors:definitions:"] || _objj_forward)(___r1, "addActors:definitions:", ((___r2 = self.project), ___r2 == null ? null : (___r2.isa.method_msgSend["uiActors"] || _objj_forward)(___r2, "uiActors")), ((___r2 = self.project), ___r2 == null ? null : (___r2.isa.method_msgSend["uiDefinitions"] || _objj_forward)(___r2, "uiDefinitions"))));
}
return self;
var ___r1, ___r2;
}
,["id","CSGProject"]), new objj_method(sel_getUid("updateVisibility:"), function $CSGAppUIViewer__updateVisibility_(self, _cmd, actorsOnRuntime)
{
((___r1 = self.appUIView), ___r1 == null ? null : (___r1.isa.method_msgSend["updateVisibility:"] || _objj_forward)(___r1, "updateVisibility:", actorsOnRuntime));
var ___r1;
}
,["void","CPArray"]), new objj_method(sel_getUid("uiAction:"), function $CSGAppUIViewer__uiAction_(self, _cmd, sender)
{
var data = nil;
switch((sender == null ? null : (sender.isa.method_msgSend["class"] || _objj_forward)(sender, "class"))) {
case CPButton:
case CSGButton:
data = (sender == null ? null : (sender.isa.method_msgSend["state"] || _objj_forward)(sender, "state"));
break;
case CPSlider:
data = (sender == null ? null : (sender.isa.method_msgSend["floatValue"] || _objj_forward)(sender, "floatValue"));
break;
default:
console.log("FIXME: get value", sender);
break;
}
if (data !== nil)
{
(self.isa.method_msgSend["eventFor:withData:"] || _objj_forward)(self, "eventFor:withData:", sender, data);
}
}
,["void","id"]), new objj_method(sel_getUid("eventFor:withData:"), function $CSGAppUIViewer__eventFor_withData_(self, _cmd, control, data)
{
var actor_id = ((___r1 = (control == null ? null : (control.isa.method_msgSend["superview"] || _objj_forward)(control, "superview"))), ___r1 == null ? null : (___r1.isa.method_msgSend["actor"] || _objj_forward)(___r1, "actor")).identifier;
var backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
(backend == null ? null : (backend.isa.method_msgSend["generateEventForActor:withData:"] || _objj_forward)(backend, "generateEventForActor:withData:", actor_id, data));
var ___r1;
}
,["void","id","JSObject"]), new objj_method(sel_getUid("uiSetAction:"), function $CSGAppUIViewer__uiSetAction_(self, _cmd, sender)
{
(self.isa.method_msgSend["eventFor:withData:"] || _objj_forward)(self, "eventFor:withData:", sender, 1);
}
,["void","id"]), new objj_method(sel_getUid("uiResetAction:"), function $CSGAppUIViewer__uiResetAction_(self, _cmd, sender)
{
(self.isa.method_msgSend["eventFor:withData:"] || _objj_forward)(self, "eventFor:withData:", sender, 0);
}
,["void","id"]), new objj_method(sel_getUid("eventWithData:sender:"), function $CSGAppUIViewer__eventWithData_sender_(self, _cmd, data, sender)
{
var actors = ((___r1 = self.project.program), ___r1 == null ? null : (___r1.isa.method_msgSend["actors"] || _objj_forward)(___r1, "actors"));
for (var i = 0; i < actors.length; i++)
{
var actor = actors[i];
if (data.client_id == actor.identifier)
{
(actor == null ? null : (actor.isa.method_msgSend["setUiState:"] || _objj_forward)(actor, "setUiState:", data.state));
break;
}
}
var ___r1;
}
,["void","id","CSGEventListener"])]);
}
p;24;CSGActorTreeController.jt;10288;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;12;CSGBackend.ji;18;CSGActorTreeNode.jt;10180;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGBackend.j", YES);objj_executeFile("CSGActorTreeNode.j", YES);
{var the_class = objj_allocateClassPair(CPViewController, "CSGActorTreeController"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("outlineView", "CPOutlineView"), new objj_ivar("spinner", "CPProgressIndicator"), new objj_ivar("selectedItem", "CSGActorTreeNode"), new objj_ivar("backend", "CSGBackend"), new objj_ivar("root", "CSGActorTreeNode"), new objj_ivar("outstanding", "int")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("outlineView"), function $CSGActorTreeController__outlineView(self, _cmd)
{
return self.outlineView;
}
,["CPOutlineView"]), new objj_method(sel_getUid("setOutlineView:"), function $CSGActorTreeController__setOutlineView_(self, _cmd, newValue)
{
self.outlineView = newValue;
}
,["void","CPOutlineView"]), new objj_method(sel_getUid("spinner"), function $CSGActorTreeController__spinner(self, _cmd)
{
return self.spinner;
}
,["CPProgressIndicator"]), new objj_method(sel_getUid("setSpinner:"), function $CSGActorTreeController__setSpinner_(self, _cmd, newValue)
{
self.spinner = newValue;
}
,["void","CPProgressIndicator"]), new objj_method(sel_getUid("selectedItem"), function $CSGActorTreeController__selectedItem(self, _cmd)
{
return self.selectedItem;
}
,["CSGActorTreeNode"]), new objj_method(sel_getUid("setSelectedItem:"), function $CSGActorTreeController__setSelectedItem_(self, _cmd, newValue)
{
self.selectedItem = newValue;
}
,["void","CSGActorTreeNode"]), new objj_method(sel_getUid("init"), function $CSGActorTreeController__init(self, _cmd)
{
self = (objj_getClass("CSGActorTreeController").super_class.method_dtable["initWithCibName:bundle:externalNameTable:"] || _objj_forward)(self, "initWithCibName:bundle:externalNameTable:", "ActorView", nil, nil);
if (self)
{
self.backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
self.root = ((___r1 = (CSGActorTreeNode.isa.method_msgSend["alloc"] || _objj_forward)(CSGActorTreeNode, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithData:"] || _objj_forward)(___r1, "initWithData:", ""));
self.outstanding = 0;
}
return self;
var ___r1;
}
,["id"]), new objj_method(sel_getUid("awakeFromCib"), function $CSGActorTreeController__awakeFromCib(self, _cmd)
{
((___r1 = self.spinner), ___r1 == null ? null : (___r1.isa.method_msgSend["stopAnimation:"] || _objj_forward)(___r1, "stopAnimation:", self));
(self.isa.method_msgSend["reload"] || _objj_forward)(self, "reload");
var ___r1;
}
,["void"]), new objj_method(sel_getUid("reload"), function $CSGActorTreeController__reload(self, _cmd)
{
self.root = ((___r1 = (CSGActorTreeNode.isa.method_msgSend["alloc"] || _objj_forward)(CSGActorTreeNode, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithData:"] || _objj_forward)(___r1, "initWithData:", ""));
self.outstanding = 0;
(self.isa.method_msgSend["getDataForNode:"] || _objj_forward)(self, "getDataForNode:", self.root);
var ___r1;
}
,["void"]), new objj_method(sel_getUid("_beginUpdate"), function $CSGActorTreeController___beginUpdate(self, _cmd)
{
if (self.outstanding === 0)
{
((___r1 = self.spinner), ___r1 == null ? null : (___r1.isa.method_msgSend["startAnimation:"] || _objj_forward)(___r1, "startAnimation:", self));
}
self.outstanding += 1;
var ___r1;
}
,["void"]), new objj_method(sel_getUid("_completeUpdate"), function $CSGActorTreeController___completeUpdate(self, _cmd)
{
self.outstanding -= 1;
if (self.outstanding === 0)
{
((___r1 = self.spinner), ___r1 == null ? null : (___r1.isa.method_msgSend["stopAnimation:"] || _objj_forward)(___r1, "stopAnimation:", self));
((___r1 = self.outlineView), ___r1 == null ? null : (___r1.isa.method_msgSend["reloadData"] || _objj_forward)(___r1, "reloadData"));
}
var ___r1;
}
,["void"]), new objj_method(sel_getUid("_createChildren:forNode:isLeaf:"), function $CSGActorTreeController___createChildren_forNode_isLeaf_(self, _cmd, children, node, leaf)
{
for (var i = 0; i < children.length; i++)
{
var newNode = ((___r1 = (CSGActorTreeNode.isa.method_msgSend["alloc"] || _objj_forward)(CSGActorTreeNode, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithData:"] || _objj_forward)(___r1, "initWithData:", children[i]));
(newNode == null ? null : (newNode.isa.method_msgSend["setIsLeaf:"] || _objj_forward)(newNode, "setIsLeaf:", leaf));
(node == null ? null : (node.isa.method_msgSend["addChild:"] || _objj_forward)(node, "addChild:", newNode));
if ((newNode == null ? null : (newNode.isa.method_msgSend["isLeaf"] || _objj_forward)(newNode, "isLeaf")))
{
(self.isa.method_msgSend["getDataForNode:"] || _objj_forward)(self, "getDataForNode:", newNode);
}
}
var ___r1;
}
,["void","CPArray","CSGActorTreeNode","BOOL"]), new objj_method(sel_getUid("getDataForNode:"), function $CSGActorTreeController__getDataForNode_(self, _cmd, node)
{
(self.isa.method_msgSend["_beginUpdate"] || _objj_forward)(self, "_beginUpdate");
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["docFor:responseBlock:"] || _objj_forward)(___r1, "docFor:responseBlock:", node.path, function(body)
{
(self.isa.method_msgSend["updateNode:withData:"] || _objj_forward)(self, "updateNode:withData:", node, body);
}));
var ___r1;
}
,["void","CSGActorTreeNode"]), new objj_method(sel_getUid("updateNode:withData:"), function $CSGActorTreeController__updateNode_withData_(self, _cmd, node, data)
{
if (data.actors === undefined && data.modules === undefined && data.type === undefined)
{
console.log("skipping", data);
(self.isa.method_msgSend["_completeUpdate"] || _objj_forward)(self, "_completeUpdate");
return;
}
(node == null ? null : (node.isa.method_msgSend["setInfo:"] || _objj_forward)(node, "setInfo:", data));
if (!data.hasOwnProperty('type'))
{
(self.isa.method_msgSend["_createChildren:forNode:isLeaf:"] || _objj_forward)(self, "_createChildren:forNode:isLeaf:", data.modules.sort(), node, NO);
(self.isa.method_msgSend["_createChildren:forNode:isLeaf:"] || _objj_forward)(self, "_createChildren:forNode:isLeaf:", data.actors.sort(), node, YES);
}
(self.isa.method_msgSend["_completeUpdate"] || _objj_forward)(self, "_completeUpdate");
}
,["void","CSGActorTreeNode","JSObject"]), new objj_method(sel_getUid("outlineView:numberOfChildrenOfItem:"), function $CSGActorTreeController__outlineView_numberOfChildrenOfItem_(self, _cmd, outlineView, item)
{
if (item === nil)
{
item = self.root;
}
if (item !== self.root && (item == null ? null : (item.isa.method_msgSend["count"] || _objj_forward)(item, "count")) === 0)
{
(self.isa.method_msgSend["getDataForNode:"] || _objj_forward)(self, "getDataForNode:", item);
}
return (item == null ? null : (item.isa.method_msgSend["count"] || _objj_forward)(item, "count"));
}
,["int","CPOutlineView","id"]), new objj_method(sel_getUid("outlineView:isItemExpandable:"), function $CSGActorTreeController__outlineView_isItemExpandable_(self, _cmd, outlineView, item)
{
return !(item == null ? null : (item.isa.method_msgSend["isLeaf"] || _objj_forward)(item, "isLeaf"));
}
,["BOOL","CPOutlineView","id"]), new objj_method(sel_getUid("outlineView:child:ofItem:"), function $CSGActorTreeController__outlineView_child_ofItem_(self, _cmd, outlineView, index, item)
{
if (item === nil)
{
item = self.root;
}
return (item == null ? null : (item.isa.method_msgSend["childAtIndex:"] || _objj_forward)(item, "childAtIndex:", index));
}
,["id","CPOutlineView","int","id"]), new objj_method(sel_getUid("outlineView:objectValueForTableColumn:byItem:"), function $CSGActorTreeController__outlineView_objectValueForTableColumn_byItem_(self, _cmd, outlineView, tableColumn, item)
{
return item;
}
,["id","CPOutlineView","CPTableColumn","id"]), new objj_method(sel_getUid("outlineView:shouldEditTableColumn:item:"), function $CSGActorTreeController__outlineView_shouldEditTableColumn_item_(self, _cmd, outlineView, tableColumn, item)
{
return NO;
}
,["BOOL","CPOutlineView","CPTableColumn","id"]), new objj_method(sel_getUid("outlineViewSelectionDidChange:"), function $CSGActorTreeController__outlineViewSelectionDidChange_(self, _cmd, notification)
{
var ov = (notification == null ? null : (notification.isa.method_msgSend["object"] || _objj_forward)(notification, "object"));
var si = (ov == null ? null : (ov.isa.method_msgSend["itemAtRow:"] || _objj_forward)(ov, "itemAtRow:", (ov == null ? null : (ov.isa.method_msgSend["selectedRow"] || _objj_forward)(ov, "selectedRow"))));
(self.isa.method_msgSend["setSelectedItem:"] || _objj_forward)(self, "setSelectedItem:", si);
}
,["void","CPNotification"]), new objj_method(sel_getUid("outlineView:writeItems:toPasteboard:"), function $CSGActorTreeController__outlineView_writeItems_toPasteboard_(self, _cmd, outlineView, items, pboard)
{
var item = items[0];
if (!(item == null ? null : (item.isa.method_msgSend["isLeaf"] || _objj_forward)(item, "isLeaf")))
{
return NO;
}
if ((pboard == null ? null : (pboard.isa.method_msgSend["availableTypeFromArray:"] || _objj_forward)(pboard, "availableTypeFromArray:", [CPStringPboardType])) === nil)
{
(pboard == null ? null : (pboard.isa.method_msgSend["declareTypes:owner:"] || _objj_forward)(pboard, "declareTypes:owner:", [CPStringPboardType], self));
}
(pboard == null ? null : (pboard.isa.method_msgSend["setData:forType:"] || _objj_forward)(pboard, "setData:forType:", (CPString.isa.method_msgSend["JSONFromObject:"] || _objj_forward)(CPString, "JSONFromObject:", item.info), CPStringPboardType));
return YES;
}
,["BOOL","CPOutlineView","CPArray","CPPasteboard"])]);
}
p;22;CSGProgram+Rendering.jt;1862;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;20;CPString+Rendering.ji;12;CSGProgram.ji;20;CSGActor+Rendering.ji;19;CSGPort+Rendering.ji;25;CSGConnection+Rendering.ji;18;CSGGeometryUtils.ji;10;CSGTheme.jt;1636;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CPString+Rendering.j", YES);objj_executeFile("CSGProgram.j", YES);objj_executeFile("CSGActor+Rendering.j", YES);objj_executeFile("CSGPort+Rendering.j", YES);objj_executeFile("CSGConnection+Rendering.j", YES);objj_executeFile("CSGGeometryUtils.j", YES);objj_executeFile("CSGTheme.j", YES);{
var the_class = objj_getClass("CSGProgram")
if(!the_class) throw new SyntaxError("*** Could not find definition for class \"CSGProgram\"");
var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_getUid("renderInBounds:dirtyRect:"), function $CSGProgram__renderInBounds_dirtyRect_(self, _cmd, bounds, dirtyRect)
{
for (var i = self.connections.length - 1; i >= 0; i--)
{
((___r1 = self.connections[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["renderWithDirtyRect:"] || _objj_forward)(___r1, "renderWithDirtyRect:", dirtyRect));
}
for (var i = self.instances.length - 1; i >= 0; i--)
{
((___r1 = self.instances[i]), ___r1 == null ? null : (___r1.isa.method_msgSend["renderInBounds:dirtyRect:"] || _objj_forward)(___r1, "renderInBounds:dirtyRect:", bounds, dirtyRect));
}
var ___r1;
}
,["void","CGRect","CGRect"]), new objj_method(sel_getUid("instanceAtPoint:"), function $CSGProgram__instanceAtPoint_(self, _cmd, point)
{
for (var i = 0; i < self.instances.length; i++)
{
var a = self.instances[i];
if (CGRectContainsPoint(a.bounds, point))
{
return a;
}
}
return nil;
}
,["CSGActor","CGPoint"])]);
}
p;17;CSGScriptViewer.jt;1739;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.jt;1672;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);
{var the_class = objj_allocateClassPair(CPWindowController, "CSGScriptViewer"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("scriptView", "CPTextView")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CSGScriptViewer__init(self, _cmd)
{
self = (objj_getClass("CSGScriptViewer").super_class.method_dtable["initWithWindowCibName:"] || _objj_forward)(self, "initWithWindowCibName:", "ScriptViewer");
if (self)
{
}
return self;
}
,["id"]), new objj_method(sel_getUid("setReleasedWhenClosed:"), function $CSGScriptViewer__setReleasedWhenClosed_(self, _cmd, flag)
{
console.log("FIXME: [[self window] setReleasedWhenClosed:flag];");
}
,["void","BOOL"]), new objj_method(sel_getUid("setTitle:"), function $CSGScriptViewer__setTitle_(self, _cmd, title)
{
((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? null : (___r1.isa.method_msgSend["setTitle:"] || _objj_forward)(___r1, "setTitle:", title));
var ___r1;
}
,["void","CPString"]), new objj_method(sel_getUid("setScript:"), function $CSGScriptViewer__setScript_(self, _cmd, script)
{
((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? null : (___r1.isa.method_msgSend["orderFront:"] || _objj_forward)(___r1, "orderFront:", self));
((___r1 = self.scriptView), ___r1 == null ? null : (___r1.isa.method_msgSend["setString:"] || _objj_forward)(___r1, "setString:", script));
var ___r1;
}
,["void","CPString"])]);
}
p;12;CSGBackend.jt;31456;@STATIC;1.0;I;23;Foundation/Foundation.ji;15;CSGHostConfig.jt;31388;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CSGHostConfig.j", YES);
{var the_class = objj_allocateClassPair(CPURLConnection, "CSGURLConnection"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("header", "CPDictionary"), new objj_ivar("responseHandler", "Function")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("initWithRequest:responseBlock:"), function $CSGURLConnection__initWithRequest_responseBlock_(self, _cmd, aRequest, aFunction)
{
self = (objj_getClass("CSGURLConnection").super_class.method_dtable["initWithRequest:delegate:startImmediately:"] || _objj_forward)(self, "initWithRequest:delegate:startImmediately:", aRequest, self, NO);
if (self)
{
self._isLocalFileConnection = NO;
self.responseHandler = aFunction;
(self == null ? null : (self.isa.method_msgSend["start"] || _objj_forward)(self, "start"));
}
return self;
}
,["id","CPURLRequest","Function"]), new objj_method(sel_getUid("connection:didReceiveData:"), function $CSGURLConnection__connection_didReceiveData_(self, _cmd, connection, data)
{
self.responseHandler(self.header, data, nil);
}
,["void","CSGURLConnection","CPString"]), new objj_method(sel_getUid("connection:didFailWithError:"), function $CSGURLConnection__connection_didFailWithError_(self, _cmd, connection, error)
{
self.responseHandler(self.header, nil, error);
}
,["void","CSGURLConnection","CPError"]), new objj_method(sel_getUid("connection:didReceiveResponse:"), function $CSGURLConnection__connection_didReceiveResponse_(self, _cmd, connection, response)
{
if ((response == null ? null : (response.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(response, "isKindOfClass:", (CPHTTPURLResponse.isa.method_msgSend["class"] || _objj_forward)(CPHTTPURLResponse, "class"))))
{
self.header = (response == null ? null : (response.isa.method_msgSend["allHeaderFields"] || _objj_forward)(response, "allHeaderFields"));
}
}
,["void","CSGURLConnection","CPURLResponse"])]);
class_addMethods(meta_class, [new objj_method(sel_getUid("connectionWithRequest:responseBlock:"), function $CSGURLConnection__connectionWithRequest_responseBlock_(self, _cmd, aRequest, aFunction)
{
return ((___r1 = (self.isa.method_msgSend["alloc"] || _objj_forward)(self, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithRequest:responseBlock:"] || _objj_forward)(___r1, "initWithRequest:responseBlock:", aRequest, aFunction));
var ___r1;
}
,["CSGURLConnection","CPURLRequest","Function"])]);
}
var sharedBackendInstance = nil;
{var the_class = objj_allocateClassPair(CPObject, "CSGBackend"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("config", "CSGHostConfig")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CSGBackend__init(self, _cmd)
{
(CPException.isa.method_msgSend["raise:reason:"] || _objj_forward)(CPException, "raise:reason:", "CSGHostConfig", "Singleton. Use +sharedHostConfig");
}
,["id"]), new objj_method(sel_getUid("_init"), function $CSGBackend___init(self, _cmd)
{
if (self = (objj_getClass("CSGBackend").super_class.method_dtable["init"] || _objj_forward)(self, "init"))
{
self.config = (CSGHostConfig.isa.method_msgSend["sharedHostConfig"] || _objj_forward)(CSGHostConfig, "sharedHostConfig");
}
return self;
}
,["id"]), new objj_method(sel_getUid("generateEventForActor:withData:"), function $CSGBackend__generateEventForActor_withData_(self, _cmd, actorID, data)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/uicalvinsys"),
body = {"client_id": actorID, "state": data};
(request == null ? null : (request.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(request, "setHTTPMethod:", "POST"));
(request == null ? null : (request.isa.method_msgSend["setValue:forHTTPHeaderField:"] || _objj_forward)(request, "setValue:forHTTPHeaderField:", "application/json", "Content-Type"));
(request == null ? null : (request.isa.method_msgSend["setHTTPBody:"] || _objj_forward)(request, "setHTTPBody:", (CPString.isa.method_msgSend["JSONFromObject:"] || _objj_forward)(CPString, "JSONFromObject:", body)));
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error sending update event", error);
return;
} });
var ___r1;
}
,["void","CPString","JSObject"]), new objj_method(sel_getUid("getUIDefinitions:responseBlock:"), function $CSGBackend__getUIDefinitions_responseBlock_(self, _cmd, appID, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/uicalvinsys/" + appID);
var req = (CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var defs = (body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON"));
responseBlock(defs);
});
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("getRuntimeCapabilitiesResponseBlock:"), function $CSGBackend__getRuntimeCapabilitiesResponseBlock_(self, _cmd, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/index/node/attribute/node_name");
var req = (CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var response = (body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON"));
var runtimeList = response.result;
var capabilities = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
runtimeList.forEach( function(rtID)
{
(self.isa.method_msgSend["_namedRuntime:action:"] || _objj_forward)(self, "_namedRuntime:action:", rtID, function(name, url)
{
var info = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", [rtID, url, []], ["id", "url", "capabilities"]));
(capabilities == null ? null : (capabilities.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(capabilities, "setValue:forKey:", info, name));
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", url + "/capabilities");
var req = (CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
(info == null ? null : (info.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(info, "setValue:forKey:", (body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON")), "capabilities"));
responseBlock(capabilities);
});
var ___r1;
});
});
var ___r1;
});
var ___r1;
}
,["void","Function"]), new objj_method(sel_getUid("getRuntimeInfoResponseBlock:"), function $CSGBackend__getRuntimeInfoResponseBlock_(self, _cmd, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/index/node/attribute/node_name");
var req = (CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var response = (body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON"));
var runtimeList = response.result;
var runtimeNameAndID = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
runtimeList.forEach( function(rtID)
{
(self.isa.method_msgSend["_namedRuntime:action:"] || _objj_forward)(self, "_namedRuntime:action:", rtID, function(name, url)
{
(runtimeNameAndID == null ? null : (runtimeNameAndID.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(runtimeNameAndID, "setValue:forKey:", rtID, name));
responseBlock(runtimeNameAndID);
});
});
var ___r1;
});
var ___r1;
}
,["void","Function"]), new objj_method(sel_getUid("_namedRuntime:action:"), function $CSGBackend___namedRuntime_action_(self, _cmd, rtID, action)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/node/" + rtID);
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var shield = "[" + body + "]";
var jsObject = (shield == null ? null : (shield.isa.method_msgSend["objectFromJSON"] || _objj_forward)(shield, "objectFromJSON"));
if (jsObject.length === 0)
{
console.log("-_namedRuntime:action: - Empty body returned, BAILING!");
return;
} else
{
var attrs = jsObject[0].attributes.indexed_public;
var re = /\/node\/attribute\/node_name\/[A-Za-z0-9_\-\.\/]*\/([A-Za-z0-9_-]+)/;
for (var i = 0; i < attrs.length; i++)
{
var m = attrs[i].match(re);
if (m)
{
action(m[1], jsObject[0].control_uris);
} } } });
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("authenticatePersistanceUser:withPassword:responseBlock:"), function $CSGBackend__authenticatePersistanceUser_withPassword_responseBlock_(self, _cmd, user, passwd, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["authBase"] || _objj_forward)(___r1, "authBase")) + "/token"),
body = {"username": user, "password": passwd};
(request == null ? null : (request.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(request, "setHTTPMethod:", "POST"));
(request == null ? null : (request.isa.method_msgSend["setValue:forHTTPHeaderField:"] || _objj_forward)(request, "setValue:forHTTPHeaderField:", "application/json", "Content-Type"));
(request == null ? null : (request.isa.method_msgSend["setHTTPBody:"] || _objj_forward)(request, "setHTTPBody:", (CPString.isa.method_msgSend["JSONFromObject:"] || _objj_forward)(CPString, "JSONFromObject:", body)));
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error authenticating", error);
return;
} responseBlock(body);
});
var ___r1;
}
,["void","CPString","CPString","Function"]), new objj_method(sel_getUid("storeValue:forKey:authToken:"), function $CSGBackend__storeValue_forKey_authToken_(self, _cmd, value, key, authToken)
{
var dataString = ((___r1 = (CPKeyedArchiver.isa.method_msgSend["archivedDataWithRootObject:"] || _objj_forward)(CPKeyedArchiver, "archivedDataWithRootObject:", value)), ___r1 == null ? null : (___r1.isa.method_msgSend["rawString"] || _objj_forward)(___r1, "rawString"));
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["persistanceBase"] || _objj_forward)(___r1, "persistanceBase")) + "/store/" + key);
(request == null ? null : (request.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(request, "setHTTPMethod:", "POST"));
(request == null ? null : (request.isa.method_msgSend["setValue:forHTTPHeaderField:"] || _objj_forward)(request, "setValue:forHTTPHeaderField:", "application/json", "Content-Type"));
var body = {"token": authToken, "data": dataString};
(request == null ? null : (request.isa.method_msgSend["setHTTPBody:"] || _objj_forward)(request, "setHTTPBody:", (CPString.isa.method_msgSend["JSONFromObject:"] || _objj_forward)(CPString, "JSONFromObject:", body)));
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error saving", error);
return;
} console.log("saveHandler - save complete");
});
var ___r1;
}
,["void","id","CPString","CPString"]), new objj_method(sel_getUid("fetchValueForKey:responseBlock:"), function $CSGBackend__fetchValueForKey_responseBlock_(self, _cmd, key, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["persistanceBase"] || _objj_forward)(___r1, "persistanceBase")) + "/fetch/" + key);
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error loading", error);
return;
} responseBlock((CPKeyedUnarchiver.isa.method_msgSend["unarchiveObjectWithData:"] || _objj_forward)(CPKeyedUnarchiver, "unarchiveObjectWithData:", (CPData.isa.method_msgSend["dataWithRawString:"] || _objj_forward)(CPData, "dataWithRawString:", body)));
});
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("fetchAllKeysUsingResponseBlock:"), function $CSGBackend__fetchAllKeysUsingResponseBlock_(self, _cmd, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["persistanceBase"] || _objj_forward)(___r1, "persistanceBase")) + "/fetch/");
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error loading", error);
return;
} responseBlock((body == null ? null : (body.isa.method_msgSend["componentsSeparatedByString:"] || _objj_forward)(body, "componentsSeparatedByString:", "\n")));
});
var ___r1;
}
,["void","Function"]), new objj_method(sel_getUid("docFor:responseBlock:"), function $CSGBackend__docFor_responseBlock_(self, _cmd, what, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/actor_doc/" + what);
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error getting docs", error);
return;
} responseBlock((body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON")));
});
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("deployScript:withName:responseBlock:"), function $CSGBackend__deployScript_withName_responseBlock_(self, _cmd, script, name, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/deploy");
(request == null ? null : (request.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(request, "setHTTPMethod:", "POST"));
(request == null ? null : (request.isa.method_msgSend["setHTTPBody:"] || _objj_forward)(request, "setHTTPBody:", (CPString.isa.method_msgSend["JSONFromObject:"] || _objj_forward)(CPString, "JSONFromObject:", {"name": name, "script": script})));
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error deploying script", error);
return;
} var response = (body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON"));
responseBlock(response);
});
var ___r1;
}
,["void","CPString","CPString","Function"]), new objj_method(sel_getUid("stopAppWithID:responseBlock:"), function $CSGBackend__stopAppWithID_responseBlock_(self, _cmd, appID, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/application/" + appID);
(request == null ? null : (request.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(request, "setHTTPMethod:", "DELETE"));
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error stopping script", error);
return;
} responseBlock();
});
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("setDeployInfo:forAppID:sender:"), function $CSGBackend__setDeployInfo_forAppID_sender_(self, _cmd, deployInfo, appID, sender)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/application/" + appID + "/migrate");
(request == null ? null : (request.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(request, "setHTTPMethod:", "POST"));
(request == null ? null : (request.isa.method_msgSend["setHTTPBody:"] || _objj_forward)(request, "setHTTPBody:", deployInfo));
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
if (error !== nil)
{
console.log("Error sending deploy info", error);
return;
} setTimeout( function()
{
(sender == null ? null : (sender.isa.method_msgSend["updateActorViewForApp:reason:"] || _objj_forward)(sender, "updateActorViewForApp:reason:", appID, "migrate"));
}, 2000);
});
var ___r1;
}
,["void","CPString","CPString","id"]), new objj_method(sel_getUid("updateAvailableApplicationsUsingBlock:"), function $CSGBackend__updateAvailableApplicationsUsingBlock_(self, _cmd, block)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/applications");
var req = (CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var data = (body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON"));
block(data);
});
var ___r1;
}
,["void","Function"]), new objj_method(sel_getUid("infoForAppID:usingBlock:"), function $CSGBackend__infoForAppID_usingBlock_(self, _cmd, appid, block)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/application/" + appid);
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var data = (body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON"));
block(data);
});
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("infoForActorID:withResponseBlock:"), function $CSGBackend__infoForActorID_withResponseBlock_(self, _cmd, actorID, block)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/actor/" + actorID);
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var shield = "[" + body + "]";
var jsObject = (shield == null ? null : (shield.isa.method_msgSend["objectFromJSON"] || _objj_forward)(shield, "objectFromJSON"));
if (jsObject.length === 0)
{
console.log("-infoForActorID:withResponseBlock: - Empty body returned, BAILING!");
return;
} else
{
block(jsObject[0]);
} });
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("infoForNode:actor:port:responseBlock:"), function $CSGBackend__infoForNode_actor_port_responseBlock_(self, _cmd, nodeID, actorID, portID, responseBlock)
{
if (actorID === nil || portID === nil)
{
return;
}
(self.isa.method_msgSend["getControlURI_OfNodeId:withResponseBlock:"] || _objj_forward)(self, "getControlURI_OfNodeId:withResponseBlock:", nodeID, function(url)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", url + "/actor/" + actorID + "/port/" + portID + "/state");
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
responseBlock((body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON")));
});
});
}
,["void","CPString","CPString","CPString","Function"]), new objj_method(sel_getUid("setNodeNameForActorID:sender:"), function $CSGBackend__setNodeNameForActorID_sender_(self, _cmd, actorID, sender)
{
var ip_request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/actor/" + actorID);
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", ip_request, function(header, body, error)
{
var shield = "[" + body + "]";
var jsObject = (shield == null ? null : (shield.isa.method_msgSend["objectFromJSON"] || _objj_forward)(shield, "objectFromJSON"));
if (jsObject.length === 0)
{
console.log("-setNodeNameForActorID:sender: - Empty body returned, BAILING!");
return;
} else
{
var nodeID = jsObject[0].node_id;
(sender == null ? null : (sender.isa.method_msgSend["setNodeID:"] || _objj_forward)(sender, "setNodeID:", nodeID));
} (self.isa.method_msgSend["_namedRuntime:action:"] || _objj_forward)(self, "_namedRuntime:action:", nodeID, function(name, url)
{
(sender == null ? null : (sender.isa.method_msgSend["setNodeName:"] || _objj_forward)(sender, "setNodeName:", name));
});
});
var ___r1;
}
,["void","CPString","id"]), new objj_method(sel_getUid("actorsOnUIRuntime:"), function $CSGBackend__actorsOnUIRuntime_(self, _cmd, responseBlock)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/actors");
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var actors = (body == null ? null : (body.isa.method_msgSend["objectFromJSON"] || _objj_forward)(body, "objectFromJSON"));
responseBlock(actors);
});
var ___r1;
}
,["void","Function"]), new objj_method(sel_getUid("migrateActor:toNode:onURL:withResponseBlock:"), function $CSGBackend__migrateActor_toNode_onURL_withResponseBlock_(self, _cmd, actor, peer_nodeID, url, block)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", url + "/actor/" + (actor == null ? null : (actor.isa.method_msgSend["identifier"] || _objj_forward)(actor, "identifier")) + "/migrate");
(request == null ? null : (request.isa.method_msgSend["setHTTPMethod:"] || _objj_forward)(request, "setHTTPMethod:", "POST"));
(request == null ? null : (request.isa.method_msgSend["setHTTPBody:"] || _objj_forward)(request, "setHTTPBody:", (CPString.isa.method_msgSend["JSONFromObject:"] || _objj_forward)(CPString, "JSONFromObject:", {"peer_node_id": peer_nodeID})));
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
block(body);
(actor == null ? null : (actor.isa.method_msgSend["setNodeName:"] || _objj_forward)(actor, "setNodeName:", "<migrating>"));
setTimeout( function()
{
(self.isa.method_msgSend["setNodeNameForActorID:sender:"] || _objj_forward)(self, "setNodeNameForActorID:sender:", (actor == null ? null : (actor.isa.method_msgSend["identifier"] || _objj_forward)(actor, "identifier")), actor);
}, 2000);
});
}
,["void","CSGActor","CPString","CPString","Function"]), new objj_method(sel_getUid("getControlURI_OfNodeId:withResponseBlock:"), function $CSGBackend__getControlURI_OfNodeId_withResponseBlock_(self, _cmd, nodeID, block)
{
var request = (CPURLRequest.isa.method_msgSend["requestWithURL:"] || _objj_forward)(CPURLRequest, "requestWithURL:", ((___r1 = self.config), ___r1 == null ? null : (___r1.isa.method_msgSend["runtimeBase"] || _objj_forward)(___r1, "runtimeBase")) + "/node/" + nodeID);
(CSGURLConnection.isa.method_msgSend["connectionWithRequest:responseBlock:"] || _objj_forward)(CSGURLConnection, "connectionWithRequest:responseBlock:", request, function(header, body, error)
{
var shield = "[" + body + "]";
var jsObject = (shield == null ? null : (shield.isa.method_msgSend["objectFromJSON"] || _objj_forward)(shield, "objectFromJSON"));
if (jsObject.length === 0)
{
console.log("-getControlURI_OfNodeId:withResponseBlock: - Empty body returned, BAILING!");
return;
} else
{
block(jsObject[0].control_uris[0]);
} });
var ___r1;
}
,["void","CPString","Function"]), new objj_method(sel_getUid("migrateActor:toNode:"), function $CSGBackend__migrateActor_toNode_(self, _cmd, actor, peer_nodeID)
{
(self.isa.method_msgSend["infoForActorID:withResponseBlock:"] || _objj_forward)(self, "infoForActorID:withResponseBlock:", (actor == null ? null : (actor.isa.method_msgSend["identifier"] || _objj_forward)(actor, "identifier")), function(actorInfo)
{
(self.isa.method_msgSend["getControlURI_OfNodeId:withResponseBlock:"] || _objj_forward)(self, "getControlURI_OfNodeId:withResponseBlock:", actorInfo.node_id, function(url)
{
(self.isa.method_msgSend["migrateActor:toNode:onURL:withResponseBlock:"] || _objj_forward)(self, "migrateActor:toNode:onURL:withResponseBlock:", actor, peer_nodeID, url, function()
{
});
});
});
}
,["void","CSGActor","CPString"])]);
class_addMethods(meta_class, [new objj_method(sel_getUid("sharedBackend"), function $CSGBackend__sharedBackend(self, _cmd)
{
if (!sharedBackendInstance)
{
sharedBackendInstance = ((___r1 = (CSGBackend.isa.method_msgSend["alloc"] || _objj_forward)(CSGBackend, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["_init"] || _objj_forward)(___r1, "_init"));
}
return sharedBackendInstance;
var ___r1;
}
,["id"])]);
}
p;14;CSGAppUIView.jt;2420;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;16;CSGActorUIView.jt;2332;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGActorUIView.j", YES);
{var the_class = objj_allocateClassPair(CPView, "CSGAppUIView"),
meta_class = the_class.isa;objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("addActors:definitions:"), function $CSGAppUIView__addActors_definitions_(self, _cmd, actors, defs)
{
var delta = 10;
for (var i = 0; i < actors.length; i++)
{
var actor = actors[i];
var config = defs[actor.type];
var origin = CGPointMake(delta, delta);
delta += 20;
var new_ui = ((___r1 = (CSGActorUIView.isa.method_msgSend["alloc"] || _objj_forward)(CSGActorUIView, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithActor:config:origin:"] || _objj_forward)(___r1, "initWithActor:config:origin:", actor, config, origin));
(self.isa.method_msgSend["addSubview:"] || _objj_forward)(self, "addSubview:", new_ui);
}
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
var ___r1;
}
,["void","CPArray","JSObject"]), new objj_method(sel_getUid("updateVisibility:"), function $CSGAppUIView__updateVisibility_(self, _cmd, actorsOnRuntime)
{
var actorUIViews = (self.isa.method_msgSend["subviews"] || _objj_forward)(self, "subviews");
for (var i = 0; i < actorUIViews.length; i++)
{
var actorUIView = actorUIViews[i];
(actorUIView == null ? null : (actorUIView.isa.method_msgSend["updateVisibility:"] || _objj_forward)(actorUIView, "updateVisibility:", actorsOnRuntime));
}
}
,["void","CPArray"]), new objj_method(sel_getUid("drawRect:"), function $CSGAppUIView__drawRect_(self, _cmd, dirtyRect)
{
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGEditorViewBgColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(CPBezierPath.isa.method_msgSend["fillRect:"] || _objj_forward)(CPBezierPath, "fillRect:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"));
var ___r1;
}
,["void","CGRect"]), new objj_method(sel_getUid("isFlipped"), function $CSGAppUIView__isFlipped(self, _cmd)
{
return YES;
}
,["BOOL"])]);
}
p;15;AppController.jt;15909;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;24;CSGActorTreeController.ji;22;CSGProjectController.ji;16;CSGProgramView.ji;10;CSGActor.ji;14;CSGInspector.ji;21;CSGRuntimeInspector.ji;17;CSGScriptViewer.ji;26;CSGCapabilitiesInspector.ji;15;CSGHelpViewer.ji;15;CSGHostConfig.ji;12;CSGConsole.jt;15594;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGActorTreeController.j", YES);objj_executeFile("CSGProjectController.j", YES);objj_executeFile("CSGProgramView.j", YES);objj_executeFile("CSGActor.j", YES);objj_executeFile("CSGInspector.j", YES);objj_executeFile("CSGRuntimeInspector.j", YES);objj_executeFile("CSGScriptViewer.j", YES);objj_executeFile("CSGCapabilitiesInspector.j", YES);objj_executeFile("CSGHelpViewer.j", YES);objj_executeFile("CSGHostConfig.j", YES);objj_executeFile("CSGConsole.j", YES);
{var the_class = objj_allocateClassPair(CPObject, "AppController"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("inspector", "CSGInspector"), new objj_ivar("runtimeInspector", "CSGRuntimeInspector"), new objj_ivar("activeInspector", "id"), new objj_ivar("capsInspector", "CSGCapabilitiesInspector"), new objj_ivar("scriptViewer", "CSGScriptViewer"), new objj_ivar("helpViewer", "CSGHelpViewer"), new objj_ivar("appUIViewer", "CSGAppUIViewer"), new objj_ivar("actorTreeController", "CSGActorTreeController"), new objj_ivar("projectController", "CSGProjectController"), new objj_ivar("theWindow", "CPWindow"), new objj_ivar("projectView", "CPView"), new objj_ivar("inspectorView", "CPView"), new objj_ivar("capsView", "CPView"), new objj_ivar("actorView", "CPView"), new objj_ivar("preferencesSheet", "CPWindow"), new objj_ivar("preferencesCalvinHost", "CPTextField"), new objj_ivar("preferencesCalvinPort", "CPTextField")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("activeInspector"), function $AppController__activeInspector(self, _cmd)
{
return self.activeInspector;
}
,["id"]), new objj_method(sel_getUid("setActiveInspector:"), function $AppController__setActiveInspector_(self, _cmd, newValue)
{
self.activeInspector = newValue;
}
,["void","id"]), new objj_method(sel_getUid("theWindow"), function $AppController__theWindow(self, _cmd)
{
return self.theWindow;
}
,["CPWindow"]), new objj_method(sel_getUid("setTheWindow:"), function $AppController__setTheWindow_(self, _cmd, newValue)
{
self.theWindow = newValue;
}
,["void","CPWindow"]), new objj_method(sel_getUid("insertAndSetupView:intoSuperview:"), function $AppController__insertAndSetupView_intoSuperview_(self, _cmd, view, superview)
{
(superview == null ? null : (superview.isa.method_msgSend["addSubview:"] || _objj_forward)(superview, "addSubview:", view));
(view == null ? null : (view.isa.method_msgSend["setFrame:"] || _objj_forward)(view, "setFrame:", (superview == null ? null : (superview.isa.method_msgSend["bounds"] || _objj_forward)(superview, "bounds"))));
(view == null ? null : (view.isa.method_msgSend["setAutoresizingMask:"] || _objj_forward)(view, "setAutoresizingMask:", CPViewWidthSizable | CPViewHeightSizable));
}
,["void","CPView","CPView"]), new objj_method(sel_getUid("applicationDidFinishLaunching:"), function $AppController__applicationDidFinishLaunching_(self, _cmd, aNotification)
{
var infoDict = ((___r1 = (CPBundle.isa.method_msgSend["mainBundle"] || _objj_forward)(CPBundle, "mainBundle")), ___r1 == null ? null : (___r1.isa.method_msgSend["infoDictionary"] || _objj_forward)(___r1, "infoDictionary"));
CPLog("infoDict:\n%@", (infoDict == null ? null : (infoDict.isa.method_msgSend["valueForKey:"] || _objj_forward)(infoDict, "valueForKey:", "CalvinInfo")));
var reqVersion = (infoDict == null ? null : (infoDict.isa.method_msgSend["valueForKeyPath:"] || _objj_forward)(infoDict, "valueForKeyPath:", "CalvinInfo.RequiredVersion.Commit"));
var opts = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithObjects:forKeys:"] || _objj_forward)(___r1, "initWithObjects:forKeys:", ["Requires Calvin >= " + reqVersion], ["Version"]));
(CPApp == null ? null : (CPApp.isa.method_msgSend["orderFrontStandardAboutPanelWithOptions:"] || _objj_forward)(CPApp, "orderFrontStandardAboutPanelWithOptions:", opts));
setTimeout( function()
{
((___r1 = CPApp._aboutPanel), ___r1 == null ? null : (___r1.isa.method_msgSend["orderOut:"] || _objj_forward)(___r1, "orderOut:", self));
var ___r1;
}, 10000);
self.projectController = ((___r1 = (CSGProjectController.isa.method_msgSend["alloc"] || _objj_forward)(CSGProjectController, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
(self.isa.method_msgSend["insertAndSetupView:intoSuperview:"] || _objj_forward)(self, "insertAndSetupView:intoSuperview:", ((___r1 = self.projectController), ___r1 == null ? null : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")), self.projectView);
self.actorTreeController = ((___r1 = (CSGActorTreeController.isa.method_msgSend["alloc"] || _objj_forward)(CSGActorTreeController, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
(self.isa.method_msgSend["insertAndSetupView:intoSuperview:"] || _objj_forward)(self, "insertAndSetupView:intoSuperview:", ((___r1 = self.actorTreeController), ___r1 == null ? null : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")), self.actorView);
self.capsInspector = ((___r1 = (CSGCapabilitiesInspector.isa.method_msgSend["alloc"] || _objj_forward)(CSGCapabilitiesInspector, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
(self.isa.method_msgSend["insertAndSetupView:intoSuperview:"] || _objj_forward)(self, "insertAndSetupView:intoSuperview:", ((___r1 = self.capsInspector), ___r1 == null ? null : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")), self.capsView);
self.inspector = ((___r1 = (CSGInspector.isa.method_msgSend["alloc"] || _objj_forward)(CSGInspector, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithDelegate:"] || _objj_forward)(___r1, "initWithDelegate:", self));
(self.isa.method_msgSend["insertAndSetupView:intoSuperview:"] || _objj_forward)(self, "insertAndSetupView:intoSuperview:", ((___r1 = self.inspector), ___r1 == null ? null : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")), self.inspectorView);
self.runtimeInspector = ((___r1 = (CSGRuntimeInspector.isa.method_msgSend["alloc"] || _objj_forward)(CSGRuntimeInspector, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
(self.isa.method_msgSend["insertAndSetupView:intoSuperview:"] || _objj_forward)(self, "insertAndSetupView:intoSuperview:", ((___r1 = self.runtimeInspector), ___r1 == null ? null : (___r1.isa.method_msgSend["view"] || _objj_forward)(___r1, "view")), self.inspectorView);
(self.isa.method_msgSend["setActiveInspector:"] || _objj_forward)(self, "setActiveInspector:", self.inspector);
self.scriptViewer = ((___r1 = (CSGScriptViewer.isa.method_msgSend["alloc"] || _objj_forward)(CSGScriptViewer, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
self.helpViewer = ((___r1 = (CSGHelpViewer.isa.method_msgSend["alloc"] || _objj_forward)(CSGHelpViewer, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
var ___r1;
}
,["void","CPNotification"]), new objj_method(sel_getUid("awakeFromCib"), function $AppController__awakeFromCib(self, _cmd)
{
((___r1 = ((___r2 = self.projectController), ___r2 == null ? null : (___r2.isa.method_msgSend["programView"] || _objj_forward)(___r2, "programView"))), ___r1 == null ? null : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES));
((___r1 = self.theWindow), ___r1 == null ? null : (___r1.isa.method_msgSend["setFullPlatformWindow:"] || _objj_forward)(___r1, "setFullPlatformWindow:", YES));
var ___r1, ___r2;
}
,["void"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $AppController__observeValueForKeyPath_ofObject_change_context_(self, _cmd, keyPath, object, change, context)
{
if (keyPath === "currentProject.appID")
{
(self.isa.method_msgSend["updateInspector"] || _objj_forward)(self, "updateInspector");
}
}
,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("preferences:"), function $AppController__preferences_(self, _cmd, sender)
{
if (self.preferencesSheet === nil)
{
(CPBundle.isa.method_msgSend["loadCibNamed:owner:"] || _objj_forward)(CPBundle, "loadCibNamed:owner:", "PreferencesSheet", self);
}
var config = (CSGHostConfig.isa.method_msgSend["sharedHostConfig"] || _objj_forward)(CSGHostConfig, "sharedHostConfig");
((___r1 = self.preferencesCalvinHost), ___r1 == null ? null : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (config == null ? null : (config.isa.method_msgSend["calvinHost"] || _objj_forward)(config, "calvinHost"))));
((___r1 = self.preferencesCalvinPort), ___r1 == null ? null : (___r1.isa.method_msgSend["setIntegerValue:"] || _objj_forward)(___r1, "setIntegerValue:", (config == null ? null : (config.isa.method_msgSend["calvinPort"] || _objj_forward)(config, "calvinPort"))));
((___r1 = (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication")), ___r1 == null ? null : (___r1.isa.method_msgSend["beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:"] || _objj_forward)(___r1, "beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:", self.preferencesSheet, self.theWindow, self, sel_getUid("didEndPreferencesSheet:returnCode:contextInfo:"), ""));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("closePreferencesSheet:"), function $AppController__closePreferencesSheet_(self, _cmd, sender)
{
var retCode = (sender == null ? null : (sender.isa.method_msgSend["title"] || _objj_forward)(sender, "title")) === "OK" ? 1 : 0;
((___r1 = (CPApplication.isa.method_msgSend["sharedApplication"] || _objj_forward)(CPApplication, "sharedApplication")), ___r1 == null ? null : (___r1.isa.method_msgSend["endSheet:returnCode:"] || _objj_forward)(___r1, "endSheet:returnCode:", self.preferencesSheet, retCode));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("didEndPreferencesSheet:returnCode:contextInfo:"), function $AppController__didEndPreferencesSheet_returnCode_contextInfo_(self, _cmd, sheet, returnCode, contextInfo)
{
(sheet == null ? null : (sheet.isa.method_msgSend["orderOut:"] || _objj_forward)(sheet, "orderOut:", self));
if (returnCode == 1)
{
var config = (CSGHostConfig.isa.method_msgSend["sharedHostConfig"] || _objj_forward)(CSGHostConfig, "sharedHostConfig");
(config == null ? null : (config.isa.method_msgSend["setCalvinHost:"] || _objj_forward)(config, "setCalvinHost:", ((___r1 = self.preferencesCalvinHost), ___r1 == null ? null : (___r1.isa.method_msgSend["stringValue"] || _objj_forward)(___r1, "stringValue"))));
(config == null ? null : (config.isa.method_msgSend["setCalvinPort:"] || _objj_forward)(config, "setCalvinPort:", ((___r1 = self.preferencesCalvinPort), ___r1 == null ? null : (___r1.isa.method_msgSend["integerValue"] || _objj_forward)(___r1, "integerValue"))));
((___r1 = self.actorTreeController), ___r1 == null ? null : (___r1.isa.method_msgSend["reload"] || _objj_forward)(___r1, "reload"));
((___r1 = self.capsInspector), ___r1 == null ? null : (___r1.isa.method_msgSend["reload"] || _objj_forward)(___r1, "reload"));
}
var ___r1;
}
,["void","CPWindow","CPInteger","id"]), new objj_method(sel_getUid("showHelp:"), function $AppController__showHelp_(self, _cmd, sender)
{
((___r1 = self.helpViewer), ___r1 == null ? null : (___r1.isa.method_msgSend["showHelp"] || _objj_forward)(___r1, "showHelp"));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("showScript:"), function $AppController__showScript_(self, _cmd, sender)
{
var script = ((___r1 = ((___r2 = self.projectController), ___r2 == null ? null : (___r2.isa.method_msgSend["currentProgram"] || _objj_forward)(___r2, "currentProgram"))), ___r1 == null ? null : (___r1.isa.method_msgSend["scriptRepresentation"] || _objj_forward)(___r1, "scriptRepresentation"));
((___r1 = self.scriptViewer), ___r1 == null ? null : (___r1.isa.method_msgSend["setScript:"] || _objj_forward)(___r1, "setScript:", script));
var ___r1, ___r2;
}
,["void","id"]), new objj_method(sel_getUid("updateInspector"), function $AppController__updateInspector(self, _cmd)
{
(self.isa.method_msgSend["setActiveInspector:"] || _objj_forward)(self, "setActiveInspector:", ((___r1 = ((___r2 = self.projectController), ___r2 == null ? null : (___r2.isa.method_msgSend["currentProject"] || _objj_forward)(___r2, "currentProject"))), ___r1 == null ? null : (___r1.isa.method_msgSend["isRunning"] || _objj_forward)(___r1, "isRunning")) ? self.runtimeInspector : self.inspector);
var ___r1, ___r2;
}
,["void"]), new objj_method(sel_getUid("setActiveInspector:"), function $AppController__setActiveInspector_(self, _cmd, newInspector)
{
var mainView = ((___r1 = self.projectController), ___r1 == null ? null : (___r1.isa.method_msgSend["programView"] || _objj_forward)(___r1, "programView"));
if (self.activeInspector)
{
(mainView == null ? null : (mainView.isa.method_msgSend["removeObserver:forKeyPath:"] || _objj_forward)(mainView, "removeObserver:forKeyPath:", self.activeInspector, "selection"));
((___r1 = self.activeInspector), ___r1 == null ? null : (___r1.isa.method_msgSend["setComponent:"] || _objj_forward)(___r1, "setComponent:", nil));
}
self.activeInspector = newInspector;
(mainView == null ? null : (mainView.isa.method_msgSend["addObserver:forKeyPath:options:context:"] || _objj_forward)(mainView, "addObserver:forKeyPath:options:context:", newInspector, "selection", CPKeyValueObservingOptionNew | CPKeyValueObservingOptionOld, nil));
(mainView == null ? null : (mainView.isa.method_msgSend["setSelection:"] || _objj_forward)(mainView, "setSelection:", (mainView == null ? null : (mainView.isa.method_msgSend["selection"] || _objj_forward)(mainView, "selection"))));
(mainView == null ? null : (mainView.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(mainView, "setNeedsDisplay:", YES));
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("shouldSetName:forActor:"), function $AppController__shouldSetName_forActor_(self, _cmd, newName, actor)
{
return ((___r1 = ((___r2 = ((___r3 = self.projectController), ___r3 == null ? null : (___r3.isa.method_msgSend["currentProject"] || _objj_forward)(___r3, "currentProject"))), ___r2 == null ? null : (___r2.isa.method_msgSend["program"] || _objj_forward)(___r2, "program"))), ___r1 == null ? null : (___r1.isa.method_msgSend["isValidActorName:"] || _objj_forward)(___r1, "isValidActorName:", newName));
var ___r1, ___r2, ___r3;
}
,["BOOL","CPString","CSGActor"]), new objj_method(sel_getUid("refreshViewForActor:"), function $AppController__refreshViewForActor_(self, _cmd, actor)
{
((___r1 = ((___r2 = self.projectController), ___r2 == null ? null : (___r2.isa.method_msgSend["programView"] || _objj_forward)(___r2, "programView"))), ___r1 == null ? null : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES));
var ___r1, ___r2;
}
,["void","CSGActor"])]);
}
p;6;main.jt;292;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;15;AppController.jt;206;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("AppController.j", YES);main = function(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
p;21;CSGRuntimeInspector.jt;10928;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;14;CSGComponent.ji;10;CSGActor.ji;15;CSGConnection.ji;12;CSGBackend.jt;10789;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGComponent.j", YES);objj_executeFile("CSGActor.j", YES);objj_executeFile("CSGConnection.j", YES);objj_executeFile("CSGBackend.j", YES);
{var the_class = objj_allocateClassPair(CPViewController, "CSGRuntimeInspector"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("component", "CSGComponent"), new objj_ivar("ports", "CPArray"), new objj_ivar("panelNameField", "CPTextField"), new objj_ivar("panelTypeField", "CPTextField"), new objj_ivar("runtimeDict", "CPMutableDictionary"), new objj_ivar("runtimeList", "CPArray"), new objj_ivar("backend", "CSGBackend")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("ports"), function $CSGRuntimeInspector__ports(self, _cmd)
{
return self.ports;
}
,["CPArray"]), new objj_method(sel_getUid("setPorts:"), function $CSGRuntimeInspector__setPorts_(self, _cmd, newValue)
{
self.ports = newValue;
}
,["void","CPArray"]), new objj_method(sel_getUid("init"), function $CSGRuntimeInspector__init(self, _cmd)
{
self = (objj_getClass("CSGRuntimeInspector").super_class.method_dtable["initWithCibName:bundle:externalNameTable:"] || _objj_forward)(self, "initWithCibName:bundle:externalNameTable:", "RuntimeInspectorView", nil, nil);
if (self)
{
self.backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
((___r1 = (self == null ? null : (self.isa.method_msgSend["view"] || _objj_forward)(self, "view"))), ___r1 == null ? null : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES));
self.runtimeList = [];
self.runtimeDict = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["getRuntimeInfoResponseBlock:"] || _objj_forward)(___r1, "getRuntimeInfoResponseBlock:", function(dict)
{
(self == null ? null : (self.isa.method_msgSend["setRuntimeDict:"] || _objj_forward)(self, "setRuntimeDict:", dict));
}));
}
return self;
var ___r1;
}
,["id"]), new objj_method(sel_getUid("setRuntimeDict:"), function $CSGRuntimeInspector__setRuntimeDict_(self, _cmd, dict)
{
var names = (dict == null ? null : (dict.isa.method_msgSend["allKeys"] || _objj_forward)(dict, "allKeys"));
names.sort();
self.runtimeDict = dict;
(self.isa.method_msgSend["setRuntimeList:"] || _objj_forward)(self, "setRuntimeList:", names);
}
,["void","id"]), new objj_method(sel_getUid("runtimeDict"), function $CSGRuntimeInspector__runtimeDict(self, _cmd)
{
return self.runtimeDict;
}
,["CPDictionary"]), new objj_method(sel_getUid("setRuntimeList:"), function $CSGRuntimeInspector__setRuntimeList_(self, _cmd, list)
{
self.runtimeList = list;
}
,["void","id"]), new objj_method(sel_getUid("runtimeList"), function $CSGRuntimeInspector__runtimeList(self, _cmd)
{
return self.runtimeList;
}
,["CPArray"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CSGRuntimeInspector__observeValueForKeyPath_ofObject_change_context_(self, _cmd, keyPath, object, change, context)
{
var newSel = (change == null ? null : (change.isa.method_msgSend["objectForKey:"] || _objj_forward)(change, "objectForKey:", "CPKeyValueChangeNewKey"));
(self.isa.method_msgSend["setComponent:"] || _objj_forward)(self, "setComponent:", newSel);
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["getRuntimeInfoResponseBlock:"] || _objj_forward)(___r1, "getRuntimeInfoResponseBlock:", function(dict)
{
(self.isa.method_msgSend["setRuntimeDict:"] || _objj_forward)(self, "setRuntimeDict:", dict);
}));
var ___r1;
}
,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("setComponent:"), function $CSGRuntimeInspector__setComponent_(self, _cmd, comp)
{
self.component = comp;
if ((comp == null ? null : (comp.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(comp, "isKindOfClass:", (CSGActor.isa.method_msgSend["class"] || _objj_forward)(CSGActor, "class"))))
{
((___r1 = (self.isa.method_msgSend["view"] || _objj_forward)(self, "view")), ___r1 == null ? null : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", NO));
((___r1 = self.panelNameField), ___r1 == null ? null : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", comp.name));
((___r1 = self.panelTypeField), ___r1 == null ? null : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", comp.type));
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["infoForActorID:withResponseBlock:"] || _objj_forward)(___r1, "infoForActorID:withResponseBlock:", (comp == null ? null : (comp.isa.method_msgSend["identifier"] || _objj_forward)(comp, "identifier")), function(info)
{
(self.isa.method_msgSend["setActorInfo:"] || _objj_forward)(self, "setActorInfo:", info);
}));
}
else
{
((___r1 = (self.isa.method_msgSend["view"] || _objj_forward)(self, "view")), ___r1 == null ? null : (___r1.isa.method_msgSend["setHidden:"] || _objj_forward)(___r1, "setHidden:", YES));
}
var ___r1;
}
,["void","CGSComponent"]), new objj_method(sel_getUid("setActorInfo:"), function $CSGRuntimeInspector__setActorInfo_(self, _cmd, info)
{
if (info.is_shadow === undefined)
{
((___r1 = self.component), ___r1 == null ? null : (___r1.isa.method_msgSend["setStatus:"] || _objj_forward)(___r1, "setStatus:", "Undefined"));
}
else
{
((___r1 = self.component), ___r1 == null ? null : (___r1.isa.method_msgSend["setStatus:"] || _objj_forward)(___r1, "setStatus:", info.is_shadow ? "Shadow" : "Running"));
}
var tmpPorts = [];
var inports = info.inports;
for (var i = 0; i < inports.length; i++)
{
var port = (CPMutableDictionary.isa.method_msgSend["dictionaryWithJSObject:"] || _objj_forward)(CPMutableDictionary, "dictionaryWithJSObject:", inports[i]);
(port == null ? null : (port.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(port, "setValue:forKey:", "in", "direction"));
(port == null ? null : (port.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(port, "setValue:forKey:", 0, "tokenCount"));
(tmpPorts == null ? null : (tmpPorts.isa.method_msgSend["addObject:"] || _objj_forward)(tmpPorts, "addObject:", port));
var port_id = (port == null ? null : (port.isa.method_msgSend["valueForKey:"] || _objj_forward)(port, "valueForKey:", "id"));
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["infoForNode:actor:port:responseBlock:"] || _objj_forward)(___r1, "infoForNode:actor:port:responseBlock:", info.node_id, ((___r2 = self.component), ___r2 == null ? null : (___r2.isa.method_msgSend["identifier"] || _objj_forward)(___r2, "identifier")), port_id, function(info)
{
(self.isa.method_msgSend["setPort:info:"] || _objj_forward)(self, "setPort:info:", port_id, info);
}));
}
var outports = info.outports;
for (var i = 0; i < outports.length; i++)
{
var port = (CPMutableDictionary.isa.method_msgSend["dictionaryWithJSObject:"] || _objj_forward)(CPMutableDictionary, "dictionaryWithJSObject:", outports[i]);
(port == null ? null : (port.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(port, "setValue:forKey:", "out", "direction"));
(port == null ? null : (port.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(port, "setValue:forKey:", 0, "tokenCount"));
(tmpPorts == null ? null : (tmpPorts.isa.method_msgSend["addObject:"] || _objj_forward)(tmpPorts, "addObject:", port));
var port_id = (port == null ? null : (port.isa.method_msgSend["valueForKey:"] || _objj_forward)(port, "valueForKey:", "id"));
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["infoForNode:actor:port:responseBlock:"] || _objj_forward)(___r1, "infoForNode:actor:port:responseBlock:", info.node_id, ((___r2 = self.component), ___r2 == null ? null : (___r2.isa.method_msgSend["identifier"] || _objj_forward)(___r2, "identifier")), port_id, function(info)
{
(self.isa.method_msgSend["setPort:info:"] || _objj_forward)(self, "setPort:info:", port_id, info);
}));
}
(self.isa.method_msgSend["setPorts:"] || _objj_forward)(self, "setPorts:", tmpPorts);
var ___r1, ___r2;
}
,["void","JSObject"]), new objj_method(sel_getUid("setPort:info:"), function $CSGRuntimeInspector__setPort_info_(self, _cmd, portID, info)
{
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "ports");
var wpos = info.write_pos;
var rpos_object = info.read_pos;
var rpos_list = [];
for (var property in rpos_object)
{
if (rpos_object.hasOwnProperty(property))
{
(rpos_list == null ? null : (rpos_list.isa.method_msgSend["addObject:"] || _objj_forward)(rpos_list, "addObject:", rpos_object[property]));
}
}
var rpos = Math.min.apply(null, rpos_list);
for (var i = 0; i < self.ports.length; i++)
{
var port = self.ports[i];
if ((port == null ? null : (port.isa.method_msgSend["valueForKey:"] || _objj_forward)(port, "valueForKey:", "id")) === portID)
{
(port == null ? null : (port.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(port, "setValue:forKey:", wpos - rpos, "tokenCount"));
break;
}
}
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "ports");
}
,["void","CPString","JSObject"]), new objj_method(sel_getUid("migrate:"), function $CSGRuntimeInspector__migrate_(self, _cmd, sender)
{
var selection = ((___r1 = (sender == null ? null : (sender.isa.method_msgSend["selectedItem"] || _objj_forward)(sender, "selectedItem"))), ___r1 == null ? null : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title"));
var rtID = ((___r1 = self.runtimeDict), ___r1 == null ? null : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", selection));
((___r1 = self.backend), ___r1 == null ? null : (___r1.isa.method_msgSend["migrateActor:toNode:"] || _objj_forward)(___r1, "migrateActor:toNode:", self.component, rtID));
var ___r1;
}
,["void","id"])]);
}
p;16;CSGProgramView.jt;14039;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;14;CSGComponent.ji;10;CSGActor.ji;12;CSGProgram.ji;22;CSGProgram+Rendering.jt;13893;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGComponent.j", YES);objj_executeFile("CSGActor.j", YES);objj_executeFile("CSGProgram.j", YES);objj_executeFile("CSGProgram+Rendering.j", YES);
{var the_class = objj_allocateClassPair(CPView, "CSGProgramView"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("program", "CSGProgram"), new objj_ivar("dragObject", "CSGActor"), new objj_ivar("dragPad", "CPString"), new objj_ivar("selection", "CSGComponent"), new objj_ivar("mouseDraggedAction", "SEL"), new objj_ivar("mouseUpAction", "SEL"), new objj_ivar("dragOffset", "CGPoint"), new objj_ivar("trackingStartLocation", "CGPoint"), new objj_ivar("trackingLocation", "CGPoint")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("selection"), function $CSGProgramView__selection(self, _cmd)
{
return self.selection;
}
,["CSGComponent"]), new objj_method(sel_getUid("setSelection:"), function $CSGProgramView__setSelection_(self, _cmd, newValue)
{
self.selection = newValue;
}
,["void","CSGComponent"]), new objj_method(sel_getUid("awakeFromCib"), function $CSGProgramView__awakeFromCib(self, _cmd)
{
(self.isa.method_msgSend["registerForDraggedTypes:"] || _objj_forward)(self, "registerForDraggedTypes:", [CPStringPboardType]);
self.mouseDraggedAction = sel_getUid("_nilAction:");
self.mouseUpAction = sel_getUid("_nilAction:");
}
,["void"]), new objj_method(sel_getUid("drawRect:"), function $CSGProgramView__drawRect_(self, _cmd, dirtyRect)
{
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGEditorViewBgColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(CPBezierPath.isa.method_msgSend["fillRect:"] || _objj_forward)(CPBezierPath, "fillRect:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"));
((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["renderInBounds:dirtyRect:"] || _objj_forward)(___r1, "renderInBounds:dirtyRect:", (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds"), dirtyRect));
if (self.dragPad !== nil)
{
var path = (CPBezierPath.isa.method_msgSend["bezierPath"] || _objj_forward)(CPBezierPath, "bezierPath");
(path == null ? null : (path.isa.method_msgSend["moveToPoint:"] || _objj_forward)(path, "moveToPoint:", self.trackingStartLocation));
(path == null ? null : (path.isa.method_msgSend["lineToPoint:"] || _objj_forward)(path, "lineToPoint:", self.trackingLocation));
((___r1 = (CPColor.isa.method_msgSend["colorWithHexString:"] || _objj_forward)(CPColor, "colorWithHexString:", CSGConnectionPendingColorHEX)), ___r1 == null ? null : (___r1.isa.method_msgSend["set"] || _objj_forward)(___r1, "set"));
(path == null ? null : (path.isa.method_msgSend["stroke"] || _objj_forward)(path, "stroke"));
}
var ___r1;
}
,["void","CGRect"]), new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"), function $CSGProgramView__observeValueForKeyPath_ofObject_change_context_(self, _cmd, keyPath, object, change, context)
{
if (keyPath === "currentProject")
{
(self.isa.method_msgSend["setSelection:"] || _objj_forward)(self, "setSelection:", nil);
var newProject = (change == null ? null : (change.isa.method_msgSend["objectForKey:"] || _objj_forward)(change, "objectForKey:", "CPKeyValueChangeNewKey"));
self.program = (newProject == null ? null : (newProject.isa.method_msgSend["program"] || _objj_forward)(newProject, "program"));
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
}
}
,["void","CPString","id","CPDictionary","id"]), new objj_method(sel_getUid("isFlipped"), function $CSGProgramView__isFlipped(self, _cmd)
{
return YES;
}
,["BOOL"]), new objj_method(sel_getUid("setSelection:"), function $CSGProgramView__setSelection_(self, _cmd, comp)
{
if (self.selection !== nil)
{
((___r1 = self.selection), ___r1 == null ? null : (___r1.isa.method_msgSend["setSelected:"] || _objj_forward)(___r1, "setSelected:", NO));
}
if (comp !== nil)
{
self.selection = comp;
(comp == null ? null : (comp.isa.method_msgSend["setSelected:"] || _objj_forward)(comp, "setSelected:", YES));
}
else
{
self.selection = nil;
}
var ___r1;
}
,["void","CSGComponent"]), new objj_method(sel_getUid("acceptsFirstResponder"), function $CSGProgramView__acceptsFirstResponder(self, _cmd)
{
return YES;
}
,["BOOL"]), new objj_method(sel_getUid("keyDown:"), function $CSGProgramView__keyDown_(self, _cmd, event)
{
var keyCode = (event == null ? null : (event.isa.method_msgSend["keyCode"] || _objj_forward)(event, "keyCode"));
if (keyCode === CPDeleteForwardKeyCode || keyCode === CPDeleteKeyCode)
{
((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["removeComponent:"] || _objj_forward)(___r1, "removeComponent:", self.selection));
self.selection = nil;
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
}
var ___r1;
}
,["void","CPEvent"]), new objj_method(sel_getUid("mouseDown:"), function $CSGProgramView__mouseDown_(self, _cmd, event)
{
var dragStart = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (event == null ? null : (event.isa.method_msgSend["locationInWindow"] || _objj_forward)(event, "locationInWindow")), nil);
self.dragObject = ((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["instanceAtPoint:"] || _objj_forward)(___r1, "instanceAtPoint:", dragStart));
(self.isa.method_msgSend["setSelection:"] || _objj_forward)(self, "setSelection:", self.dragObject);
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
if (self.dragObject === nil)
{
return;
}
self.dragOffset = CSGSubtractPoints(dragStart, self.dragObject.bounds.origin);
self.dragPad = ((___r1 = self.dragObject), ___r1 == null ? null : (___r1.isa.method_msgSend["portAtPoint:"] || _objj_forward)(___r1, "portAtPoint:", dragStart));
if (self.dragPad === nil)
{
self.mouseDraggedAction = sel_getUid("_updateDragWithEvent:");
self.mouseUpAction = sel_getUid("_updateDragWithEvent:");
}
else
{
self.mouseDraggedAction = sel_getUid("_updateConnectDragWithEvent:");
self.mouseUpAction = sel_getUid("_finishConnectDragWithEvent:");
}
var existingConn = nil;
if (self.dragPad !== nil && ((___r1 = self.dragPad), ___r1 == null ? null : (___r1.isa.method_msgSend["isInport"] || _objj_forward)(___r1, "isInport")))
{
existingConn = ((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["connectionForActor:inport:"] || _objj_forward)(___r1, "connectionForActor:inport:", self.dragObject, self.dragPad));
}
if (existingConn !== nil)
{
self.dragObject = (existingConn == null ? null : (existingConn.isa.method_msgSend["srcActor"] || _objj_forward)(existingConn, "srcActor"));
self.dragPad = (existingConn == null ? null : (existingConn.isa.method_msgSend["srcPort"] || _objj_forward)(existingConn, "srcPort"));
self.trackingStartLocation = ((___r1 = self.dragObject), ___r1 == null ? null : (___r1.isa.method_msgSend["anchorPointForPort:"] || _objj_forward)(___r1, "anchorPointForPort:", self.dragPad));
self.trackingLocation = dragStart;
((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["removeComponent:"] || _objj_forward)(___r1, "removeComponent:", existingConn));
}
else
{
self.trackingStartLocation = dragStart;
self.trackingLocation = dragStart;
}
var ___r1;
}
,["void","CPEvent"]), new objj_method(sel_getUid("mouseDragged:"), function $CSGProgramView__mouseDragged_(self, _cmd, event)
{
(self.isa.method_msgSend["autoscroll:"] || _objj_forward)(self, "autoscroll:", event);
(self.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(self, "performSelector:withObject:", self.mouseDraggedAction, event);
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
}
,["void","CPEvent"]), new objj_method(sel_getUid("mouseUp:"), function $CSGProgramView__mouseUp_(self, _cmd, event)
{
(self.isa.method_msgSend["performSelector:withObject:"] || _objj_forward)(self, "performSelector:withObject:", self.mouseUpAction, event);
self.mouseUpAction = sel_getUid("_nilAction:");
self.mouseDraggedAction = sel_getUid("_nilAction:");
self.dragObject = nil;
self.dragPad = nil;
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
}
,["void","CPEvent"]), new objj_method(sel_getUid("constrainPoint:"), function $CSGProgramView__constrainPoint_(self, _cmd, aPoint)
{
var documentBounds = (self.isa.method_msgSend["bounds"] || _objj_forward)(self, "bounds");
aPoint.x = MAX(0.0, MIN(aPoint.x, CGRectGetWidth(documentBounds)));
aPoint.y = MAX(0.0, MIN(aPoint.y, CGRectGetHeight(documentBounds)));
return aPoint;
}
,["CGPoint","CGPoint"]), new objj_method(sel_getUid("_nilAction:"), function $CSGProgramView___nilAction_(self, _cmd, object)
{
return;
}
,["void","id"]), new objj_method(sel_getUid("_updateDragWithEvent:"), function $CSGProgramView___updateDragWithEvent_(self, _cmd, event)
{
var loc = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (event == null ? null : (event.isa.method_msgSend["locationInWindow"] || _objj_forward)(event, "locationInWindow")), nil);
loc = (self.isa.method_msgSend["constrainPoint:"] || _objj_forward)(self, "constrainPoint:", loc);
self.dragObject.bounds.origin = CSGAddPoints(loc, self.dragOffset);
}
,["void","CPEvent"]), new objj_method(sel_getUid("_updateConnectDragWithEvent:"), function $CSGProgramView___updateConnectDragWithEvent_(self, _cmd, event)
{
var loc = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (event == null ? null : (event.isa.method_msgSend["locationInWindow"] || _objj_forward)(event, "locationInWindow")), nil);
self.trackingLocation = (self.isa.method_msgSend["constrainPoint:"] || _objj_forward)(self, "constrainPoint:", loc);
}
,["void","CPEvent"]), new objj_method(sel_getUid("_finishConnectDragWithEvent:"), function $CSGProgramView___finishConnectDragWithEvent_(self, _cmd, event)
{
var dropPoint = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (event == null ? null : (event.isa.method_msgSend["locationInWindow"] || _objj_forward)(event, "locationInWindow")), nil),
dropObject = ((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["instanceAtPoint:"] || _objj_forward)(___r1, "instanceAtPoint:", dropPoint));
if (dropObject === nil)
{
return;
}
var dropPad = (dropObject == null ? null : (dropObject.isa.method_msgSend["portAtPoint:"] || _objj_forward)(dropObject, "portAtPoint:", dropPoint));
if (dropPad === nil)
{
return;
}
var isValid = ((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["addConnectionFrom:fromPort:to:toPort:"] || _objj_forward)(___r1, "addConnectionFrom:fromPort:to:toPort:", self.dragObject, self.dragPad, dropObject, dropPad));
if (isValid)
{
(self.isa.method_msgSend["setSelection:"] || _objj_forward)(self, "setSelection:", dropObject);
}
var ___r1;
}
,["void","CPEvent"]), new objj_method(sel_getUid("prepareForDragOperation:"), function $CSGProgramView__prepareForDragOperation_(self, _cmd, draggingInfo)
{
return YES;
}
,["BOOL","CPDraggingInfo"]), new objj_method(sel_getUid("performDragOperation:"), function $CSGProgramView__performDragOperation_(self, _cmd, draggingInfo)
{
var pasteboard = (draggingInfo == null ? null : (draggingInfo.isa.method_msgSend["draggingPasteboard"] || _objj_forward)(draggingInfo, "draggingPasteboard"));
var item = (pasteboard == null ? null : (pasteboard.isa.method_msgSend["dataForType:"] || _objj_forward)(pasteboard, "dataForType:", CPStringPboardType)),
loc = (self.isa.method_msgSend["convertPoint:fromView:"] || _objj_forward)(self, "convertPoint:fromView:", (draggingInfo == null ? null : (draggingInfo.isa.method_msgSend["draggingLocation"] || _objj_forward)(draggingInfo, "draggingLocation")), nil),
actor = ((___r1 = (CSGActor.isa.method_msgSend["alloc"] || _objj_forward)(CSGActor, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithJSObject:"] || _objj_forward)(___r1, "initWithJSObject:", (item == null ? null : (item.isa.method_msgSend["objectFromJSON"] || _objj_forward)(item, "objectFromJSON"))));
if (actor !== nil)
{
((___r1 = self.program), ___r1 == null ? null : (___r1.isa.method_msgSend["addInstance:"] || _objj_forward)(___r1, "addInstance:", actor));
(actor == null ? null : (actor.isa.method_msgSend["setOrigin:"] || _objj_forward)(actor, "setOrigin:", loc));
(self.isa.method_msgSend["setSelection:"] || _objj_forward)(self, "setSelection:", actor);
}
else
{
console.log("Not adding invalid actor", actor);
}
return YES;
var ___r1;
}
,["BOOL","CPDraggingInfo"]), new objj_method(sel_getUid("concludeDragOperation:"), function $CSGProgramView__concludeDragOperation_(self, _cmd, draggingInfo)
{
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
}
,["void","CPDraggingInfo"])]);
}
p;15;CSGConnection.jt;6585;@STATIC;1.0;I;23;Foundation/Foundation.ji;14;CSGComponent.ji;9;CSGPort.jt;6506;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CSGComponent.j", YES);objj_executeFile("CSGPort.j", YES);
{var the_class = objj_allocateClassPair(CSGComponent, "CSGConnection"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CPCoding");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPCoding\"");
class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("src", "CSGActor"), new objj_ivar("dst", "CSGActor"), new objj_ivar("srcPort", "CSGPort"), new objj_ivar("dstPort", "CSGPort")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("srcActor"), function $CSGConnection__srcActor(self, _cmd)
{
return self.src;
}
,["CSGActor"]), new objj_method(sel_getUid("setSrc:"), function $CSGConnection__setSrc_(self, _cmd, newValue)
{
self.src = newValue;
}
,["void","CSGActor"]), new objj_method(sel_getUid("srcPort"), function $CSGConnection__srcPort(self, _cmd)
{
return self.srcPort;
}
,["CSGPort"]), new objj_method(sel_getUid("setSrcPort:"), function $CSGConnection__setSrcPort_(self, _cmd, newValue)
{
self.srcPort = newValue;
}
,["void","CSGPort"]), new objj_method(sel_getUid("initWithSrc:srcPort:dst:dstPort:"), function $CSGConnection__initWithSrc_srcPort_dst_dstPort_(self, _cmd, theSrcActor, theSrcPort, theDstActor, theDstPort)
{
if (self = (objj_getClass("CSGConnection").super_class.method_dtable["init"] || _objj_forward)(self, "init"))
{
self.src = theSrcActor;
self.dst = theDstActor;
self.srcPort = theSrcPort;
self.dstPort = theDstPort;
}
return self;
}
,["id","CSGActor","CSGPort","CSGActor","CSGPort"]), new objj_method(sel_getUid("initWithCoder:"), function $CSGConnection__initWithCoder_(self, _cmd, coder)
{
self = (objj_getClass("CSGConnection").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
self.src = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "src"));
self.dst = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "dst"));
self.srcPort = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "srcPort"));
self.dstPort = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "dstPort"));
}
return self;
}
,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CSGConnection__encodeWithCoder_(self, _cmd, coder)
{
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.src, "src"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.dst, "dst"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.srcPort, "srcPort"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.dstPort, "dstPort"));
}
,["void","CPCoder"]), new objj_method(sel_getUid("isEqualToConnection:"), function $CSGConnection__isEqualToConnection_(self, _cmd, connection)
{
if (!connection)
{
return NO;
}
if (!((___r1 = self.src), ___r1 == null ? null : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", connection.src)) || !((___r1 = self.dst), ___r1 == null ? null : (___r1.isa.method_msgSend["isEqual:"] || _objj_forward)(___r1, "isEqual:", connection.dst)))
{
return NO;
}
if (self.srcPort !== connection.srcPort || self.dstPort !== connection.dstPort)
{
return NO;
}
return YES;
var ___r1;
}
,["BOOL","CSGConnection"]), new objj_method(sel_getUid("isEqual:"), function $CSGConnection__isEqual_(self, _cmd, object)
{
if (self === object)
{
return YES;
}
if (!(object == null ? null : (object.isa.method_msgSend["isKindOfClass:"] || _objj_forward)(object, "isKindOfClass:", (CSGConnection.isa.method_msgSend["class"] || _objj_forward)(CSGConnection, "class"))))
{
return NO;
}
return (self.isa.method_msgSend["isEqualToConnection:"] || _objj_forward)(self, "isEqualToConnection:", object);
}
,["BOOL","id"]), new objj_method(sel_getUid("hasSameDestinationPortAsConnection:"), function $CSGConnection__hasSameDestinationPortAsConnection_(self, _cmd, conn)
{
return conn.dst === self.dst && conn.dstPort === self.dstPort;
}
,["BOOL","CSGConnection"]), new objj_method(sel_getUid("isConnectedToActor:"), function $CSGConnection__isConnectedToActor_(self, _cmd, actor)
{
return self.src === actor || self.dst === actor;
}
,["BOOL","CSGActor"]), new objj_method(sel_getUid("isConnectedToActor:inport:"), function $CSGConnection__isConnectedToActor_inport_(self, _cmd, actor, port)
{
return self.dst === actor && self.dstPort === port;
}
,["BOOL","CSGActor","CSGPort"]), new objj_method(sel_getUid("isConnectedToActor:outport:"), function $CSGConnection__isConnectedToActor_outport_(self, _cmd, actor, port)
{
return self.src === actor && self.srcPort === port;
}
,["BOOL","CSGActor","CSGPort"]), new objj_method(sel_getUid("description"), function $CSGConnection__description(self, _cmd)
{
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@:%@ -> %@:%@", self.src, self.srcPort, self.dst, self.dstPort);
}
,["CPString"]), new objj_method(sel_getUid("scriptRepresentation"), function $CSGConnection__scriptRepresentation(self, _cmd)
{
var line = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@.%@ > %@.%@", ((___r1 = self.src), ___r1 == null ? null : (___r1.isa.method_msgSend["name"] || _objj_forward)(___r1, "name")), ((___r1 = self.srcPort), ___r1 == null ? null : (___r1.isa.method_msgSend["name"] || _objj_forward)(___r1, "name")), ((___r1 = self.dst), ___r1 == null ? null : (___r1.isa.method_msgSend["name"] || _objj_forward)(___r1, "name")), ((___r1 = self.dstPort), ___r1 == null ? null : (___r1.isa.method_msgSend["name"] || _objj_forward)(___r1, "name")));
return line;
var ___r1;
}
,["CPString"])]);
}
p;10;CSGActor.jt;20639;@STATIC;1.0;I;23;Foundation/Foundation.ji;14;CSGComponent.ji;9;CSGPort.jt;20559;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CSGComponent.j", YES);objj_executeFile("CSGPort.j", YES);CSGActorDocsFromJSONRep = function(jrep)
{
if (!jrep)
{
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "No documentation");
}
if (!jrep.name)
{
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@\n", jrep["long_desc"]);
}
var docs = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@.%@\n\n%@\n", jrep["ns"], jrep["name"], jrep["long_desc"]),
ports = jrep["inputs"];
if (ports.length > 0)
{
docs = (docs == null ? null : (docs.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(docs, "stringByAppendingString:", "\nInports:\n"));
}
for (var i = 0; i < ports.length; i++)
{
var pstring = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\t%s : %s\n", ports[i], jrep.input_docs[ports[i]]);
docs = (docs == null ? null : (docs.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(docs, "stringByAppendingString:", pstring));
}
ports = jrep["outputs"];
if (ports.length > 0)
{
docs = (docs == null ? null : (docs.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(docs, "stringByAppendingString:", "\nOutports:\n"));
}
for (var i = 0; i < ports.length; i++)
{
var pstring = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "\t%s : %s\n", ports[i], jrep.output_docs[ports[i]]);
docs = (docs == null ? null : (docs.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(docs, "stringByAppendingString:", pstring));
}
var reqs = jrep["requires"] || [];
if (reqs.length > 0)
{
docs = (docs == null ? null : (docs.isa.method_msgSend["stringByAppendingString:"] || _objj_forward)(docs, "stringByAppendingString:", "\nRequirements:\n\t" + reqs.join(", ")));
}
return docs;
}
{var the_class = objj_allocateClassPair(CSGComponent, "CSGActor"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CPCoding");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CPCoding\"");
class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("mandatoryArgs", "CPMutableDictionary"), new objj_ivar("argOK", "CPMutableDictionary"), new objj_ivar("optionalArgs", "CPMutableDictionary"), new objj_ivar("inports", "CPArray"), new objj_ivar("outports", "CPArray"), new objj_ivar("type", "CPString"), new objj_ivar("name", "CPString"), new objj_ivar("isComponent", "BOOL"), new objj_ivar("docs", "CPString"), new objj_ivar("bounds", "CGRect"), new objj_ivar("validBounds", "BOOL"), new objj_ivar("identifier", "CPString"), new objj_ivar("status", "CPString"), new objj_ivar("nodeID", "CPString"), new objj_ivar("nodeName", "CPString"), new objj_ivar("uiState", "CPString")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("mandatoryArgs"), function $CSGActor__mandatoryArgs(self, _cmd)
{
return self.mandatoryArgs;
}
,["CPMutableDictionary"]), new objj_method(sel_getUid("setMandatoryArgs:"), function $CSGActor__setMandatoryArgs_(self, _cmd, newValue)
{
self.mandatoryArgs = newValue;
}
,["void","CPMutableDictionary"]), new objj_method(sel_getUid("argOK"), function $CSGActor__argOK(self, _cmd)
{
return self.argOK;
}
,["CPMutableDictionary"]), new objj_method(sel_getUid("setArgOK:"), function $CSGActor__setArgOK_(self, _cmd, newValue)
{
self.argOK = newValue;
}
,["void","CPMutableDictionary"]), new objj_method(sel_getUid("optionalArgs"), function $CSGActor__optionalArgs(self, _cmd)
{
return self.optionalArgs;
}
,["CPMutableDictionary"]), new objj_method(sel_getUid("setOptionalArgs:"), function $CSGActor__setOptionalArgs_(self, _cmd, newValue)
{
self.optionalArgs = newValue;
}
,["void","CPMutableDictionary"]), new objj_method(sel_getUid("inports"), function $CSGActor__inports(self, _cmd)
{
return self.inports;
}
,["CPArray"]), new objj_method(sel_getUid("setInports:"), function $CSGActor__setInports_(self, _cmd, newValue)
{
self.inports = newValue;
}
,["void","CPArray"]), new objj_method(sel_getUid("outports"), function $CSGActor__outports(self, _cmd)
{
return self.outports;
}
,["CPArray"]), new objj_method(sel_getUid("setOutports:"), function $CSGActor__setOutports_(self, _cmd, newValue)
{
self.outports = newValue;
}
,["void","CPArray"]), new objj_method(sel_getUid("type"), function $CSGActor__type(self, _cmd)
{
return self.type;
}
,["CPString"]), new objj_method(sel_getUid("setType:"), function $CSGActor__setType_(self, _cmd, newValue)
{
self.type = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("name"), function $CSGActor__name(self, _cmd)
{
return self.name;
}
,["CPString"]), new objj_method(sel_getUid("setName:"), function $CSGActor__setName_(self, _cmd, newValue)
{
self.name = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("isComponent"), function $CSGActor__isComponent(self, _cmd)
{
return self.isComponent;
}
,["BOOL"]), new objj_method(sel_getUid("setIsComponent:"), function $CSGActor__setIsComponent_(self, _cmd, newValue)
{
self.isComponent = newValue;
}
,["void","BOOL"]), new objj_method(sel_getUid("docs"), function $CSGActor__docs(self, _cmd)
{
return self.docs;
}
,["CPString"]), new objj_method(sel_getUid("identifier"), function $CSGActor__identifier(self, _cmd)
{
return self.identifier;
}
,["CPString"]), new objj_method(sel_getUid("setIdentifier:"), function $CSGActor__setIdentifier_(self, _cmd, newValue)
{
self.identifier = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("status"), function $CSGActor__status(self, _cmd)
{
return self.status;
}
,["CPString"]), new objj_method(sel_getUid("setStatus:"), function $CSGActor__setStatus_(self, _cmd, newValue)
{
self.status = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("nodeID"), function $CSGActor__nodeID(self, _cmd)
{
return self.nodeID;
}
,["CPString"]), new objj_method(sel_getUid("setNodeID:"), function $CSGActor__setNodeID_(self, _cmd, newValue)
{
self.nodeID = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("nodeName"), function $CSGActor__nodeName(self, _cmd)
{
return self.nodeName;
}
,["CPString"]), new objj_method(sel_getUid("setNodeName:"), function $CSGActor__setNodeName_(self, _cmd, newValue)
{
self.nodeName = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("uiState"), function $CSGActor__uiState(self, _cmd)
{
return self.uiState;
}
,["CPString"]), new objj_method(sel_getUid("setUiState:"), function $CSGActor__setUiState_(self, _cmd, newValue)
{
self.uiState = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("initWithJSObject:"), function $CSGActor__initWithJSObject_(self, _cmd, jrep)
{
self = (objj_getClass("CSGActor").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
self.mandatoryArgs = (CPMutableDictionary.isa.method_msgSend["dictionary"] || _objj_forward)(CPMutableDictionary, "dictionary");
var keys = jrep["args"]["mandatory"];
for (var i = 0; i < keys.length; i++)
{
((___r1 = self.mandatoryArgs), ___r1 == null ? null : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", "", keys[i]));
}
var proto = jrep["args"]["optional"];
keys = Object.keys(proto);
self.optionalArgs = (CPMutableDictionary.isa.method_msgSend["dictionary"] || _objj_forward)(CPMutableDictionary, "dictionary");
for (var i = 0; i < keys.length; i++)
{
var key = keys[i];
var arg = JSON.stringify(proto[key]);
((___r1 = self.optionalArgs), ___r1 == null ? null : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", arg, key));
}
self.inports = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array");
proto = jrep["inputs"];
for (var i = 0; i < proto.length; i++)
{
var pname = proto[i];
((___r1 = self.inports), ___r1 == null ? null : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", (CSGPort.isa.method_msgSend["inportWithName:"] || _objj_forward)(CSGPort, "inportWithName:", pname)));
}
self.outports = (CPMutableArray.isa.method_msgSend["array"] || _objj_forward)(CPMutableArray, "array");
proto = jrep["outputs"];
for (var i = 0; i < proto.length; i++)
{
var pname = proto[i];
((___r1 = self.outports), ___r1 == null ? null : (___r1.isa.method_msgSend["addObject:"] || _objj_forward)(___r1, "addObject:", (CSGPort.isa.method_msgSend["outportWithName:"] || _objj_forward)(CSGPort, "outportWithName:", pname)));
}
self.type = (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@.%@", jrep["ns"], jrep["name"]);
self.name = "prototype";
self.isComponent = !((___r1 = "actor"), ___r1 == null ? null : (___r1.isa.method_msgSend["isEqualToString:"] || _objj_forward)(___r1, "isEqualToString:", jrep["type"]));
self.docs = CSGActorDocsFromJSONRep(jrep);
self.bounds = CPMakeRect(0, 0, 0, 0);
self.validBounds = NO;
self.argOK = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
(self == null ? null : (self.isa.method_msgSend["validateAll:"] || _objj_forward)(self, "validateAll:", self.mandatoryArgs));
(self == null ? null : (self.isa.method_msgSend["validateAll:"] || _objj_forward)(self, "validateAll:", self.optionalArgs));
}
return self;
var ___r1;
}
,["id","Object"]), new objj_method(sel_getUid("initWithCoder:"), function $CSGActor__initWithCoder_(self, _cmd, coder)
{
self = (objj_getClass("CSGActor").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
self.mandatoryArgs = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "mandatoryArgs"));
self.optionalArgs = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "optionalArgs"));
self.inports = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "inports"));
self.outports = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "outports"));
self.type = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "type"));
self.name = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "name"));
self.isComponent = (coder == null ? null : (coder.isa.method_msgSend["decodeBoolForKey:"] || _objj_forward)(coder, "decodeBoolForKey:", "isComponent"));
self.docs = (coder == null ? null : (coder.isa.method_msgSend["decodeObjectForKey:"] || _objj_forward)(coder, "decodeObjectForKey:", "docs"));
self.bounds = (coder == null ? null : (coder.isa.method_msgSend["decodeRectForKey:"] || _objj_forward)(coder, "decodeRectForKey:", "bounds"));
self.validBounds = NO;
self.argOK = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
(self == null ? null : (self.isa.method_msgSend["validateAll:"] || _objj_forward)(self, "validateAll:", self.mandatoryArgs));
(self == null ? null : (self.isa.method_msgSend["validateAll:"] || _objj_forward)(self, "validateAll:", self.optionalArgs));
}
return self;
var ___r1;
}
,["id","CPCoder"]), new objj_method(sel_getUid("encodeWithCoder:"), function $CSGActor__encodeWithCoder_(self, _cmd, coder)
{
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.mandatoryArgs, "mandatoryArgs"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.optionalArgs, "optionalArgs"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.inports, "inports"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.outports, "outports"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.type, "type"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.name, "name"));
(coder == null ? null : (coder.isa.method_msgSend["encodeBool:forKey:"] || _objj_forward)(coder, "encodeBool:forKey:", self.isComponent, "isComponent"));
(coder == null ? null : (coder.isa.method_msgSend["encodeObject:forKey:"] || _objj_forward)(coder, "encodeObject:forKey:", self.docs, "docs"));
(coder == null ? null : (coder.isa.method_msgSend["encodeRect:forKey:"] || _objj_forward)(coder, "encodeRect:forKey:", self.bounds, "bounds"));
}
,["void","CPCoder"]), new objj_method(sel_getUid("hasValidMandatoryArgs"), function $CSGActor__hasValidMandatoryArgs(self, _cmd)
{
var ok_list = ((___r1 = self.argOK), ___r1 == null ? null : (___r1.isa.method_msgSend["allValues"] || _objj_forward)(___r1, "allValues"));
for (var i = 0; i < ok_list.length; i++)
{
if (!ok_list[i])
{
return NO;
}
}
return YES;
var ___r1;
}
,["BOOL"]), new objj_method(sel_getUid("isValidArg:"), function $CSGActor__isValidArg_(self, _cmd, arg)
{
try {
var json_value = JSON.parse(arg);
}
catch(e) {
return NO;
}
return YES;
}
,["BOOl","CPString"]), new objj_method(sel_getUid("validateAll:"), function $CSGActor__validateAll_(self, _cmd, argDict)
{
var keys = (argDict == null ? null : (argDict.isa.method_msgSend["allKeys"] || _objj_forward)(argDict, "allKeys"));
keys.forEach( function(key)
{
(self.isa.method_msgSend["validate:forKey:"] || _objj_forward)(self, "validate:forKey:", argDict, key);
});
}
,["void","CPDictionary"]), new objj_method(sel_getUid("validate:forKey:"), function $CSGActor__validate_forKey_(self, _cmd, argDict, key)
{
var value = (argDict == null ? null : (argDict.isa.method_msgSend["valueForKey:"] || _objj_forward)(argDict, "valueForKey:", key));
var isValid = (self.isa.method_msgSend["isValidArg:"] || _objj_forward)(self, "isValidArg:", value);
((___r1 = self.argOK), ___r1 == null ? null : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", isValid, key));
var ___r1;
}
,["void","CPDictionary","CPString"]), new objj_method(sel_getUid("setMandatoryValue:forKey:"), function $CSGActor__setMandatoryValue_forKey_(self, _cmd, value, key)
{
((___r1 = self.mandatoryArgs), ___r1 == null ? null : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", value, key));
(self.isa.method_msgSend["validate:forKey:"] || _objj_forward)(self, "validate:forKey:", self.mandatoryArgs, key);
var ___r1;
}
,["void","id","CPString"]), new objj_method(sel_getUid("setOptionalValue:forKey:"), function $CSGActor__setOptionalValue_forKey_(self, _cmd, value, key)
{
((___r1 = self.optionalArgs), ___r1 == null ? null : (___r1.isa.method_msgSend["setValue:forKey:"] || _objj_forward)(___r1, "setValue:forKey:", value, key));
(self.isa.method_msgSend["validate:forKey:"] || _objj_forward)(self, "validate:forKey:", self.optionalArgs, key);
var ___r1;
}
,["void","id","CPString"]), new objj_method(sel_getUid("origin"), function $CSGActor__origin(self, _cmd)
{
return self.bounds.origin;
}
,["CGPoint"]), new objj_method(sel_getUid("setOrigin:"), function $CSGActor__setOrigin_(self, _cmd, origin)
{
self.bounds.origin = origin;
}
,["void","CGPoint"]), new objj_method(sel_getUid("size"), function $CSGActor__size(self, _cmd)
{
return self.bounds.size;
}
,["CGSize"]), new objj_method(sel_getUid("setSize:"), function $CSGActor__setSize_(self, _cmd, size)
{
self.bounds.size = size;
}
,["void","CGSize"]), new objj_method(sel_getUid("inportWithName:"), function $CSGActor__inportWithName_(self, _cmd, aName)
{
return (self.isa.method_msgSend["portWithName:isOutport:"] || _objj_forward)(self, "portWithName:isOutport:", aName, NO);
}
,["CSGPort","CPString"]), new objj_method(sel_getUid("outportWithName:"), function $CSGActor__outportWithName_(self, _cmd, aName)
{
return (self.isa.method_msgSend["portWithName:isOutport:"] || _objj_forward)(self, "portWithName:isOutport:", aName, YES);
}
,["CSGPort","CPString"]), new objj_method(sel_getUid("portWithName:isOutport:"), function $CSGActor__portWithName_isOutport_(self, _cmd, aName, isOutport)
{
var ports = isOutport ? self.outports : self.inports;
for (var i = 0; i < ports.length; i++)
{
var port = ports[i];
if ((port == null ? null : (port.isa.method_msgSend["name"] || _objj_forward)(port, "name")) === aName)
{
return port;
}
}
return (CPNull.isa.method_msgSend["null"] || _objj_forward)(CPNull, "null");
}
,["CSGPort","CPString","BOOL"]), new objj_method(sel_getUid("scriptRepresentation"), function $CSGActor__scriptRepresentation(self, _cmd)
{
formatArg = function(key, value)
{
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@=%@", key, value);
}
var args = ((___r1 = (CPMutableArray.isa.method_msgSend["alloc"] || _objj_forward)(CPMutableArray, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init")),
keys = ((___r1 = ((___r2 = self.mandatoryArgs), ___r2 == null ? null : (___r2.isa.method_msgSend["allKeys"] || _objj_forward)(___r2, "allKeys"))), ___r1 == null ? null : (___r1.isa.method_msgSend["sortedArrayUsingSelector:"] || _objj_forward)(___r1, "sortedArrayUsingSelector:", sel_getUid("caseInsensitiveCompare:"))),
optKeys = ((___r1 = ((___r2 = self.optionalArgs), ___r2 == null ? null : (___r2.isa.method_msgSend["allKeys"] || _objj_forward)(___r2, "allKeys"))), ___r1 == null ? null : (___r1.isa.method_msgSend["sortedArrayUsingSelector:"] || _objj_forward)(___r1, "sortedArrayUsingSelector:", sel_getUid("caseInsensitiveCompare:")));
for (var i = 0; i < keys.length; i++)
{
var key = keys[i];
var validArg = ((___r1 = self.argOK), ___r1 == null ? null : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", key));
if (validArg)
{
(args == null ? null : (args.isa.method_msgSend["addObject:"] || _objj_forward)(args, "addObject:", formatArg(key, ((___r1 = self.mandatoryArgs), ___r1 == null ? null : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", key)))));
}
}
for (var i = 0; i < optKeys.length; i++)
{
var key = optKeys[i];
(args == null ? null : (args.isa.method_msgSend["addObject:"] || _objj_forward)(args, "addObject:", formatArg(key, ((___r1 = self.optionalArgs), ___r1 == null ? null : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", key)))));
}
var argRep = (args == null ? null : (args.isa.method_msgSend["componentsJoinedByString:"] || _objj_forward)(args, "componentsJoinedByString:", ", "));
return (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "%@ : %@(%@)", self.name, self.type, argRep);
var ___r1, ___r2;
}
,["CPString"])]);
}
p;12;CSGConsole.jt;3463;@STATIC;1.0;I;23;Foundation/Foundation.ji;18;CSGEventListener.ji;15;CSGHostConfig.jt;3373;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("CSGEventListener.j", YES);objj_executeFile("CSGHostConfig.j", YES);
{var the_class = objj_allocateClassPair(CPObject, "CSGConsole"),
meta_class = the_class.isa;
var aProtocol = objj_getProtocol("CSGEventListening");
if (!aProtocol) throw new SyntaxError("*** Could not find definition for protocol \"CSGEventListening\"");
class_addProtocol(the_class, aProtocol);class_addIvars(the_class, [new objj_ivar("consoleBase", "CPString"), new objj_ivar("maxItems", "int"), new objj_ivar("items", "CPMutableArray"), new objj_ivar("listener", "CSGEventListener")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("consoleBase"), function $CSGConsole__consoleBase(self, _cmd)
{
return self.consoleBase;
}
,["CPString"]), new objj_method(sel_getUid("setConsoleBase:"), function $CSGConsole__setConsoleBase_(self, _cmd, newValue)
{
self.consoleBase = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("maxItems"), function $CSGConsole__maxItems(self, _cmd)
{
return self.maxItems;
}
,["int"]), new objj_method(sel_getUid("setMaxItems:"), function $CSGConsole__setMaxItems_(self, _cmd, newValue)
{
self.maxItems = newValue;
}
,["void","int"]), new objj_method(sel_getUid("items"), function $CSGConsole__items(self, _cmd)
{
return self.items;
}
,["CPMutableArray"]), new objj_method(sel_getUid("setItems:"), function $CSGConsole__setItems_(self, _cmd, newValue)
{
self.items = newValue;
}
,["void","CPMutableArray"]), new objj_method(sel_getUid("init"), function $CSGConsole__init(self, _cmd)
{
self = (objj_getClass("CSGConsole").super_class.method_dtable["init"] || _objj_forward)(self, "init");
if (self)
{
var config = (CSGHostConfig.isa.method_msgSend["sharedHostConfig"] || _objj_forward)(CSGHostConfig, "sharedHostConfig");
(self == null ? null : (self.isa.method_msgSend["setItems:"] || _objj_forward)(self, "setItems:", []));
(self == null ? null : (self.isa.method_msgSend["setConsoleBase:"] || _objj_forward)(self, "setConsoleBase:", (CPString.isa.method_msgSend["stringWithFormat:"] || _objj_forward)(CPString, "stringWithFormat:", "http://%@:%d", (config == null ? null : (config.isa.method_msgSend["valueForKey:"] || _objj_forward)(config, "valueForKey:", CSGConsoleHostKey)), (config == null ? null : (config.isa.method_msgSend["valueForKey:"] || _objj_forward)(config, "valueForKey:", CSGConsolePortKey)))));
self.maxItems = 100;
}
return self;
}
,["id"]), new objj_method(sel_getUid("eventWithData:sender:"), function $CSGConsole__eventWithData_sender_(self, _cmd, data, sender)
{
(self.isa.method_msgSend["willChangeValueForKey:"] || _objj_forward)(self, "willChangeValueForKey:", "items");
if (self.items.length == self.maxItems)
{
self.items.shift();
}
self.items.push((JSON.parse(data)).msg);
(self.isa.method_msgSend["didChangeValueForKey:"] || _objj_forward)(self, "didChangeValueForKey:", "items");
}
,["void","id","CSGEventListener"]), new objj_method(sel_getUid("setMaxItems:"), function $CSGConsole__setMaxItems_(self, _cmd, n)
{
if (n < self.maxItems)
{
(self.isa.method_msgSend["setItems:"] || _objj_forward)(self, "setItems:", self.items.slice(-n));
}
self.maxItems = n;
}
,["void","int"])]);
}
p;18;CSGEventListener.jt;4684;@STATIC;1.0;I;23;Foundation/Foundation.jt;4637;objj_executeFile("Foundation/Foundation.j", NO);{var the_typedef = objj_allocateTypeDef("CSGEventDataFormat");
objj_registerTypeDef(the_typedef);
}CSGInvalidDataFormat = 0;
CSGRawDataFormat = 1;
CSGJSONStringDataFormat = 2;
CSGJSONDataFormat = 3;
{var the_protocol = objj_allocateProtocol("CSGEventListening");
objj_registerProtocol(the_protocol);
protocol_addMethodDescriptions(the_protocol, [new objj_method(sel_getUid("eventWithData:sender:"), Nil
,["void","id","CSGEventListener"])], true, true);
}
{var the_class = objj_allocateClassPair(CPObject, "CSGEventListener"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("dataFormat", "CSGEventDataFormat"), new objj_ivar("eventName", "CPString"), new objj_ivar("delegate", "id"), new objj_ivar("eventSource", "Object"), new objj_ivar("dataConverter", "Function"), new objj_ivar("listener", "Function")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("dataFormat"), function $CSGEventListener__dataFormat(self, _cmd)
{
return self.dataFormat;
}
,["CSGEventDataFormat"]), new objj_method(sel_getUid("setDataFormat:"), function $CSGEventListener__setDataFormat_(self, _cmd, newValue)
{
self.dataFormat = newValue;
}
,["void","CSGEventDataFormat"]), new objj_method(sel_getUid("eventType"), function $CSGEventListener__eventType(self, _cmd)
{
return self.eventName;
}
,["CPString"]), new objj_method(sel_getUid("setEventName:"), function $CSGEventListener__setEventName_(self, _cmd, newValue)
{
self.eventName = newValue;
}
,["void","CPString"]), new objj_method(sel_getUid("delegate"), function $CSGEventListener__delegate(self, _cmd)
{
return self.delegate;
}
,["id"]), new objj_method(sel_getUid("setDelegate:"), function $CSGEventListener__setDelegate_(self, _cmd, newValue)
{
self.delegate = newValue;
}
,["void","id"]), new objj_method(sel_getUid("initWithURL:eventType:dataFormat:"), function $CSGEventListener__initWithURL_eventType_dataFormat_(self, _cmd, anURL, eventType, fmt)
{
if (self = (objj_getClass("CSGEventListener").super_class.method_dtable["init"] || _objj_forward)(self, "init"))
{
self.eventSource = new EventSource(anURL);
self.eventName = eventType;
(self == null ? null : (self.isa.method_msgSend["_setDataFormat:"] || _objj_forward)(self, "_setDataFormat:", fmt));
self.eventSource.onerror = function(e)
{
console.log("EventSource failed ", self);
};
}
return self;
}
,["id","CPURL","CPString","CSGEventDataFormat"]), new objj_method(sel_getUid("_setDataFormat:"), function $CSGEventListener___setDataFormat_(self, _cmd, fmt)
{
switch(fmt) {
case CSGRawDataFormat:
self.dataFormat = fmt;
self.dataConverter = function(x)
{
return x;
};
break;
case CSGJSONStringDataFormat:
self.dataFormat = fmt;
self.dataConverter = JSON.parse;
break;
default:
self.dataFormat = CSGInvalidDataFormat;
self.dataConverter = function(x)
{
return x;
};
break;
}
}
,["void","CSGEventDataFormat"]), new objj_method(sel_getUid("isListening"), function $CSGEventListener__isListening(self, _cmd)
{
return self.listener != nil;
}
,["BOOL"]), new objj_method(sel_getUid("startListening"), function $CSGEventListener__startListening(self, _cmd)
{
if (self.listener)
{
return;
}
self.listener = function(evt)
{
if (self.delegate)
{
((___r1 = self.delegate), ___r1 == null ? null : (___r1.isa.method_msgSend["eventWithData:sender:"] || _objj_forward)(___r1, "eventWithData:sender:", self.dataConverter(evt.data), self));
((___r1 = (CPRunLoop.isa.method_msgSend["currentRunLoop"] || _objj_forward)(CPRunLoop, "currentRunLoop")), ___r1 == null ? null : (___r1.isa.method_msgSend["limitDateForMode:"] || _objj_forward)(___r1, "limitDateForMode:", CPDefaultRunLoopMode));
} else
{
console.log("No delegate, dropping event:", evt);
} var ___r1;
};
self.eventSource.addEventListener(self.eventName, self.listener, false);
}
,["void"]), new objj_method(sel_getUid("stopListening"), function $CSGEventListener__stopListening(self, _cmd)
{
if (!self.listener)
{
return;
}
self.eventSource.removeEventListener(self.eventName, self.listener, false);
self.eventSource.close();
self.listener = nil;
}
,["void"])]);
}
p;26;CSGCapabilitiesInspector.jt;6031;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.ji;12;CSGBackend.jt;5947;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);objj_executeFile("CSGBackend.j", YES);
{var the_class = objj_allocateClassPair(CPViewController, "CSGCapabilitiesInspector"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("rtSelect", "CPPopUpButton"), new objj_ivar("runtimeNames", "CPMutableArray"), new objj_ivar("capabilities", "CPMutableArray"), new objj_ivar("url", "CPTextField"), new objj_ivar("runtimeCapabilities", "CPDictionary")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("runtimeNames"), function $CSGCapabilitiesInspector__runtimeNames(self, _cmd)
{
return self.runtimeNames;
}
,["CPMutableArray"]), new objj_method(sel_getUid("setRuntimeNames:"), function $CSGCapabilitiesInspector__setRuntimeNames_(self, _cmd, newValue)
{
self.runtimeNames = newValue;
}
,["void","CPMutableArray"]), new objj_method(sel_getUid("capabilities"), function $CSGCapabilitiesInspector__capabilities(self, _cmd)
{
return self.capabilities;
}
,["CPMutableArray"]), new objj_method(sel_getUid("setCapabilities:"), function $CSGCapabilitiesInspector__setCapabilities_(self, _cmd, newValue)
{
self.capabilities = newValue;
}
,["void","CPMutableArray"]), new objj_method(sel_getUid("runtimeCapabilities"), function $CSGCapabilitiesInspector__runtimeCapabilities(self, _cmd)
{
return self.runtimeCapabilities;
}
,["CPDictionary"]), new objj_method(sel_getUid("setRuntimeCapabilities:"), function $CSGCapabilitiesInspector__setRuntimeCapabilities_(self, _cmd, newValue)
{
self.runtimeCapabilities = newValue;
}
,["void","CPDictionary"]), new objj_method(sel_getUid("init"), function $CSGCapabilitiesInspector__init(self, _cmd)
{
self = (objj_getClass("CSGCapabilitiesInspector").super_class.method_dtable["initWithCibName:bundle:externalNameTable:"] || _objj_forward)(self, "initWithCibName:bundle:externalNameTable:", "CapabilitiesView", nil, nil);
if (self)
{
self.runtimeNames = [];
self.url = "";
self.runtimeCapabilities = (___r1 = (CPDictionary.isa.method_msgSend["alloc"] || _objj_forward)(CPDictionary, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["init"] || _objj_forward)(___r1, "init"));
self.capabilities = (___r1 = (CPArray.isa.method_msgSend["alloc"] || _objj_forward)(CPArray, "alloc"), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithObjects:count:"] || _objj_forward)(___r1, "initWithObjects:count:", ["loading..."], 1));
}
return self;
var ___r1;
}
,["id"]), new objj_method(sel_getUid("awakeFromCib"), function $CSGCapabilitiesInspector__awakeFromCib(self, _cmd)
{
(self.isa.method_msgSend["reload"] || _objj_forward)(self, "reload");
}
,["void"]), new objj_method(sel_getUid("reload"), function $CSGCapabilitiesInspector__reload(self, _cmd)
{
var backend = (CSGBackend.isa.method_msgSend["sharedBackend"] || _objj_forward)(CSGBackend, "sharedBackend");
(backend == null ? null : (backend.isa.method_msgSend["getRuntimeCapabilitiesResponseBlock:"] || _objj_forward)(backend, "getRuntimeCapabilitiesResponseBlock:", function(caps)
{
(self.isa.method_msgSend["setRuntimeCapabilities:"] || _objj_forward)(self, "setRuntimeCapabilities:", caps);
}));
}
,["void"]), new objj_method(sel_getUid("updateDetail:"), function $CSGCapabilitiesInspector__updateDetail_(self, _cmd, sender)
{
var key = ((___r1 = ((___r2 = self.rtSelect), ___r2 == null ? null : (___r2.isa.method_msgSend["selectedItem"] || _objj_forward)(___r2, "selectedItem"))), ___r1 == null ? null : (___r1.isa.method_msgSend["title"] || _objj_forward)(___r1, "title"));
if (!((___r1 = self.runtimeCapabilities), ___r1 == null ? null : (___r1.isa.method_msgSend["containsKey:"] || _objj_forward)(___r1, "containsKey:", key)))
{
setTimeout( function()
{
(self.isa.method_msgSend["updateDetail:"] || _objj_forward)(self, "updateDetail:", self);
}, 2000);
return;
}
var info = ((___r1 = self.runtimeCapabilities), ___r1 == null ? null : (___r1.isa.method_msgSend["valueForKey:"] || _objj_forward)(___r1, "valueForKey:", key));
((___r1 = self.url), ___r1 == null ? null : (___r1.isa.method_msgSend["setStringValue:"] || _objj_forward)(___r1, "setStringValue:", (info == null ? null : (info.isa.method_msgSend["valueForKey:"] || _objj_forward)(info, "valueForKey:", "url"))));
var capList = (info == null ? null : (info.isa.method_msgSend["valueForKey:"] || _objj_forward)(info, "valueForKey:", "capabilities"));
if (!capList)
{
return;
}
capList.forEach( function(cap, i, list)
{
list[i] = cap.replace(/^calvinsys\./, "");
});
(self.isa.method_msgSend["setCapabilities:"] || _objj_forward)(self, "setCapabilities:", capList.sort());
if (self.capabilities.length == 0)
{
setTimeout( function()
{
(self.isa.method_msgSend["updateDetail:"] || _objj_forward)(self, "updateDetail:", self);
}, 2000);
}
var ___r1, ___r2;
}
,["void","id"]), new objj_method(sel_getUid("setRuntimeCapabilities:"), function $CSGCapabilitiesInspector__setRuntimeCapabilities_(self, _cmd, dict)
{
self.runtimeCapabilities = (dict == null ? null : (dict.isa.method_msgSend["copy"] || _objj_forward)(dict, "copy"));
var names = (dict == null ? null : (dict.isa.method_msgSend["allKeys"] || _objj_forward)(dict, "allKeys"));
names.sort();
(self.isa.method_msgSend["setRuntimeNames:"] || _objj_forward)(self, "setRuntimeNames:", names);
(self.isa.method_msgSend["updateDetail:"] || _objj_forward)(self, "updateDetail:", self);
}
,["void","CPDictionary"]), new objj_method(sel_getUid("refresh:"), function $CSGCapabilitiesInspector__refresh_(self, _cmd, sender)
{
(self.isa.method_msgSend["reload"] || _objj_forward)(self, "reload");
}
,["void","id"])]);
}
p;15;CSGHelpViewer.jt;1602;@STATIC;1.0;I;23;Foundation/Foundation.jI;15;AppKit/AppKit.jt;1535;objj_executeFile("Foundation/Foundation.j", NO);objj_executeFile("AppKit/AppKit.j", NO);
{var the_class = objj_allocateClassPair(CPWindowController, "CSGHelpViewer"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("webView", "CPWebView"), new objj_ivar("helpURL", "CPURL")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("init"), function $CSGHelpViewer__init(self, _cmd)
{
self = (objj_getClass("CSGHelpViewer").super_class.method_dtable["initWithWindowCibName:"] || _objj_forward)(self, "initWithWindowCibName:", "HelpViewer");
if (self)
{
self.helpURL = ((___r1 = (CPURL.isa.method_msgSend["alloc"] || _objj_forward)(CPURL, "alloc")), ___r1 == null ? null : (___r1.isa.method_msgSend["initWithString:"] || _objj_forward)(___r1, "initWithString:", "help/help.html"));
}
return self;
var ___r1;
}
,["id"]), new objj_method(sel_getUid("showHelp"), function $CSGHelpViewer__showHelp(self, _cmd)
{
((___r1 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r1 == null ? null : (___r1.isa.method_msgSend["orderFront:"] || _objj_forward)(___r1, "orderFront:", self));
((___r1 = self.webView), ___r1 == null ? null : (___r1.isa.method_msgSend["setMainFrameURL:"] || _objj_forward)(___r1, "setMainFrameURL:", self.helpURL));
((___r1 = self.webView), ___r1 == null ? null : (___r1.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(___r1, "setNeedsDisplay:", YES));
var ___r1;
}
,["void"])]);
}
e; | Objective-J | 5 | gabrielcercel/calvin-base | calvinextras/CalvinGUI/Build/GUI/CommonJS.environment/EACalvin.sj | [
"Apache-2.0"
] |
'******************************************************************************
' Spin Method Pointer Test Routines
' Copyright (c) 2010 - 2014 Dave Hein
' See end of file for terms of use.
'******************************************************************************
obj
ser : "fds1"
mp : "MethodPointer"
var
long instance
pub SetInstance(instnum)
instance := instnum
pub Func1(parm1)
ser.str(string("Hello from test1["))
ser.dec(instance)
ser.str(string("].Func1", 13))
pub Func2(parm1)
ser.str(string("Hello from test1["))
ser.dec(instance)
ser.str(string("].Func2", 13))
pub Func3(parm1)
ser.str(string("Hello from test1["))
ser.dec(instance)
ser.str(string("].Func3", 13))
pub Func4(callback)
mp.CallMethod1(string("Callback test", 13), callback)
{{
+--------------------------------------------------------------------
| TERMS OF USE: MIT License
+--------------------------------------------------------------------
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.
+------------------------------------------------------------------
}} | Propeller Spin | 4 | deets/propeller | libraries/community/p1/All/MethodPointer/test1.spin | [
"MIT"
] |
/* Copyright (c) 2017-2019 Netronome Systems, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_32=0x0
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_33=0x0
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_34=0xdeadbeef
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_35=0xdeadbeef
#include "pkt_mpls_ipv4_udp_x84.uc"
#include <global.uc>
#include "actions_harness.uc"
#include <actions.uc>
#include "actions_classify_veb_insertion.uc"
.reg expected_pv_broadcast
.reg key[2]
.reg action[2]
move(key[0], 0xfff02233)
move(key[1], 0x44556677)
move(action[0], 0xeeffc000)
move(action[1], 0xefbeadde)
move(expected_pv_broadcast, NULL_VLAN<<BF_L(PV_VLAN_ID_bf))
veb_entry_insert(key, action, continue#)
continue#:
local_csr_wr[T_INDEX, (32 * 4)]
immed[__actions_t_idx, (32 * 4)]
test_assert_equal($__actions[0], 0x0)
test_assert_equal($__actions[1], 0x0)
alu[__actions_t_idx, t_idx_ctx, OR, &$__actions[0], <<2]
nop
local_csr_wr[T_INDEX, __actions_t_idx]
nop
nop
nop
__actions_veb_lookup(pkt_vec, discards_filter_mac#)
//test_assert_equal(pkt_vec[PV_VLAN_wrd], expected_pv_broadcast)
test_assert_equal($__actions[0], 0xc0ffee)
test_assert_equal($__actions[1], 0xdeadbeef)
test_assert_equal(*$index++, 0xc0ffee)
test_assert_equal(*$index++, 0xdeadbeef)
test_pass()
discards_filter_mac#:
error_map_fd#:
lookup_not_found#:
test_fail()
PV_SEEK_SUBROUTINE#:
pv_seek_subroutine(pkt_vec)
| UnrealScript | 3 | pcasconnetronome/nic-firmware | test/datapath/actions_classify_mac_vf_match_mpls_ipv4_udp_x84_test.uc | [
"BSD-2-Clause"
] |
(require processor.utils.macro)
(import codecs)
(import [hashlib [md5]])
(import [processor.storage [get-storage]])
;; Uses http://lkiesow.github.io/python-feedgen/
(defn create-feed [data &optional
[title "Rss Feed"]
[description "Without description"]
[link "no link"]]
(import-or-error [feedgen.feed [FeedGenerator]]
"Please, install 'feedgen' library to use 'rss' output.")
(setv feed (FeedGenerator))
(.title feed title)
(.link feed {"rel" "alternate"
"href" link})
(.description feed description)
(for [item data]
(setv feed-item (.add_entry feed))
(setv item-title (get item "title"))
(setv item-id (or (.get item "id")
(.hexdigest (md5 (.encode item-title "utf-8")))))
(setv item-body (.get item "body"))
(.id feed-item item-id)
(.title feed-item item-title)
(if item-body
(.description feed-item item-body)))
(apply .rss_str [feed] {"pretty" True}))
(defn rss [filename &optional [limit 10]]
"Accepts dicts with fields
- title
- body
"
(with-log-fields {"filename" filename "limit" limit}
(log.info "Creating rss output")
(setv [get-value set-value] (get-storage "rss-target")))
(defn rss-updater [obj]
(with-log-fields {"filename" filename
"title" (get obj "title")}
(log.info "Adding item to the feed")
(setv data (get-value filename []))
(.append data obj)
(setv data (cut data (- limit)))
(set-value filename data)
(log.info "Writing to the file")
(with [f (open filename "wb")]
(.write f (create-feed data))))))
| Hy | 4 | svetlyak40wt/python-processor | src/processor/outputs/rss.hy | [
"BSD-2-Clause"
] |
" Vim syntax file
" Language: Squid config file
" Maintainer: Klaus Muth <klaus@hampft.de>
" Last Change: 2005 Jun 12
" URL: http://www.hampft.de/vim/syntax/squid.vim
" ThanksTo: Ilya Sher <iso8601@mail.ru>,
" Michael Dotzler <Michael.Dotzler@leoni.com>
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" squid.conf syntax seems to be case insensitive
syn case ignore
syn keyword squidTodo contained TODO
syn match squidComment "#.*$" contains=squidTodo,squidTag
syn match squidTag contained "TAG: .*$"
" Lots & lots of Keywords!
syn keyword squidConf acl always_direct announce_host announce_period
syn keyword squidConf announce_port announce_to anonymize_headers
syn keyword squidConf append_domain as_whois_server auth_param_basic
syn keyword squidConf authenticate_children authenticate_program
syn keyword squidConf authenticate_ttl broken_posts buffered_logs
syn keyword squidConf cache_access_log cache_announce cache_dir
syn keyword squidConf cache_dns_program cache_effective_group
syn keyword squidConf cache_effective_user cache_host cache_host_acl
syn keyword squidConf cache_host_domain cache_log cache_mem
syn keyword squidConf cache_mem_high cache_mem_low cache_mgr
syn keyword squidConf cachemgr_passwd cache_peer cache_peer_access
syn keyword squidConf cahce_replacement_policy cache_stoplist
syn keyword squidConf cache_stoplist_pattern cache_store_log cache_swap
syn keyword squidConf cache_swap_high cache_swap_log cache_swap_low
syn keyword squidConf client_db client_lifetime client_netmask
syn keyword squidConf connect_timeout coredump_dir dead_peer_timeout
syn keyword squidConf debug_options delay_access delay_class
syn keyword squidConf delay_initial_bucket_level delay_parameters
syn keyword squidConf delay_pools deny_info dns_children dns_defnames
syn keyword squidConf dns_nameservers dns_testnames emulate_httpd_log
syn keyword squidConf err_html_text fake_user_agent firewall_ip
syn keyword squidConf forwarded_for forward_snmpd_port fqdncache_size
syn keyword squidConf ftpget_options ftpget_program ftp_list_width
syn keyword squidConf ftp_passive ftp_user half_closed_clients
syn keyword squidConf header_access header_replace hierarchy_stoplist
syn keyword squidConf high_response_time_warning high_page_fault_warning
syn keyword squidConf htcp_port http_access http_anonymizer httpd_accel
syn keyword squidConf httpd_accel_host httpd_accel_port
syn keyword squidConf httpd_accel_uses_host_header
syn keyword squidConf httpd_accel_with_proxy http_port http_reply_access
syn keyword squidConf icp_access icp_hit_stale icp_port
syn keyword squidConf icp_query_timeout ident_lookup ident_lookup_access
syn keyword squidConf ident_timeout incoming_http_average
syn keyword squidConf incoming_icp_average inside_firewall ipcache_high
syn keyword squidConf ipcache_low ipcache_size local_domain local_ip
syn keyword squidConf logfile_rotate log_fqdn log_icp_queries
syn keyword squidConf log_mime_hdrs maximum_object_size
syn keyword squidConf maximum_single_addr_tries mcast_groups
syn keyword squidConf mcast_icp_query_timeout mcast_miss_addr
syn keyword squidConf mcast_miss_encode_key mcast_miss_port memory_pools
syn keyword squidConf memory_pools_limit memory_replacement_policy
syn keyword squidConf mime_table min_http_poll_cnt min_icp_poll_cnt
syn keyword squidConf minimum_direct_hops minimum_object_size
syn keyword squidConf minimum_retry_timeout miss_access negative_dns_ttl
syn keyword squidConf negative_ttl neighbor_timeout neighbor_type_domain
syn keyword squidConf netdb_high netdb_low netdb_ping_period
syn keyword squidConf netdb_ping_rate never_direct no_cache
syn keyword squidConf passthrough_proxy pconn_timeout pid_filename
syn keyword squidConf pinger_program positive_dns_ttl prefer_direct
syn keyword squidConf proxy_auth proxy_auth_realm query_icmp quick_abort
syn keyword squidConf quick_abort quick_abort_max quick_abort_min
syn keyword squidConf quick_abort_pct range_offset_limit read_timeout
syn keyword squidConf redirect_children redirect_program
syn keyword squidConf redirect_rewrites_host_header reference_age
syn keyword squidConf reference_age refresh_pattern reload_into_ims
syn keyword squidConf request_body_max_size request_size request_timeout
syn keyword squidConf shutdown_lifetime single_parent_bypass
syn keyword squidConf siteselect_timeout snmp_access
syn keyword squidConf snmp_incoming_address snmp_port source_ping
syn keyword squidConf ssl_proxy store_avg_object_size
syn keyword squidConf store_objects_per_bucket strip_query_terms
syn keyword squidConf swap_level1_dirs swap_level2_dirs
syn keyword squidConf tcp_incoming_address tcp_outgoing_address
syn keyword squidConf tcp_recv_bufsize test_reachability udp_hit_obj
syn keyword squidConf udp_hit_obj_size udp_incoming_address
syn keyword squidConf udp_outgoing_address unique_hostname
syn keyword squidConf unlinkd_program uri_whitespace useragent_log
syn keyword squidConf visible_hostname wais_relay wais_relay_host
syn keyword squidConf wais_relay_port
syn keyword squidOpt proxy-only weight ttl no-query default
syn keyword squidOpt round-robin multicast-responder
syn keyword squidOpt on off all deny allow
syn keyword squidopt via parent no-digest heap lru realm
syn keyword squidopt children credentialsttl none disable
syn keyword squidopt offline_toggle diskd q1 q2
" Security Actions for cachemgr_passwd
syn keyword squidAction shutdown info parameter server_list
syn keyword squidAction client_list
syn match squidAction "stats/\(objects\|vm_objects\|utilization\|ipcache\|fqdncache\|dns\|redirector\|io\|reply_headers\|filedescriptors\|netdb\)"
syn match squidAction "log\(/\(status\|enable\|disable\|clear\)\)\="
syn match squidAction "squid\.conf"
" Keywords for the acl-config
syn keyword squidAcl url_regex urlpath_regex referer_regex port proto
syn keyword squidAcl req_mime_type rep_mime_type
syn keyword squidAcl method browser user src dst
syn keyword squidAcl time dstdomain ident snmp_community
syn match squidNumber "\<\d\+\>"
syn match squidIP "\<\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\>"
syn match squidStr "\(^\s*acl\s\+\S\+\s\+\(\S*_regex\|re[pq]_mime_type\|browser\|_domain\|user\)\+\s\+\)\@<=.*" contains=squidRegexOpt
syn match squidRegexOpt contained "\(^\s*acl\s\+\S\+\s\+\S\+\(_regex\|_mime_type\)\s\+\)\@<=[-+]i\s\+"
" All config is in one line, so this has to be sufficient
" Make it fast like hell :)
syn sync minlines=3
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link squidTodo Todo
hi def link squidComment Comment
hi def link squidTag Special
hi def link squidConf Keyword
hi def link squidOpt Constant
hi def link squidAction String
hi def link squidNumber Number
hi def link squidIP Number
hi def link squidAcl Keyword
hi def link squidStr String
hi def link squidRegexOpt Special
let b:current_syntax = "squid"
" vim: ts=8
| VimL | 4 | uga-rosa/neovim | runtime/syntax/squid.vim | [
"Vim"
] |
<script src="shared.js"></script>
<link rel="stylesheet" href="shared.css" />
<style>
html, body {
min-width: 286px;
min-height: 33px;
}
</style>
<p>
<b>This is a restricted browser page.</b>
<br />
React devtools cannot access this page.
</p>
| HTML | 2 | GBKstc/react-analysis | packages/react-devtools-extensions/popups/restricted.html | [
"MIT"
] |
merge_lists := function( list1, list2 )
local i, j, merged_list;
merged_list := [ ];
i := 1;
j := 1;
while i <= Length( list1 ) and j <= Length( list2 ) do
if list1[ i ] <= list2[ j ] then
Add( merged_list, list1[ i ] );
i := i + 1;
else
Add( merged_list, list2[ j ] );
j := j + 1;
fi;
od;
if i <= Length( list1 ) then
Append( merged_list, list1{[ i .. Length( list1 ) ]} );
else
Append( merged_list, list2{[ j .. Length( list2 ) ]} );
fi;
return merged_list;
end;
merge_sort := function( list )
local lists_to_merge;
if Length( list ) = 1 then
return list;
fi;
lists_to_merge := [ ];
lists_to_merge[ 1 ] := merge_sort( list{[ 1 .. Int( Length( list ) / 2 ) ]} );
lists_to_merge[ 2 ] := merge_sort( list{[ Int( Length( list ) / 2 ) + 1 .. Length( list ) ]} );
return merge_lists( lists_to_merge[ 1 ], lists_to_merge[ 2 ] );
end;
| GAP | 4 | Mynogs/Algorithm-Implementations | Merge_Sort/GAP/sebasguts/merge_sort.gi | [
"MIT"
] |
use("ispec")
describe(DefaultBehavior,
describe("FlowControl",
describe("cond",
it("should return nil for an empty statement",
cond should be nil
)
it("should evaluate and return the result of one statement",
cond(42+2) should == 44
)
it("should evaluate a condition and not do it's then part if it's false",
Ground condTests = []
cond(false, condTests << :ran) should be nil
condTests should == []
)
it("should do the then part for a true statement",
Ground condTests = []
cond(true, condTests << :ran. 42) should == 42
condTests should == [:ran]
)
it("should return the then part for a true statement",
cond(true, 42+4) should == 46
)
it("should not execute conditions after the first true one",
Ground condTests = []
cond(
true, nil,
condTests << :cond. false, nil
)
condTests should == []
)
it("should not execute more than one true condition",
Ground condTests = []
cond(
condTests << :one. true, nil,
condTests << :two. true, nil,
condTests << :three. true, nil
)
condTests should == [:one]
)
it("should evaluate all conditions and return the else part if they are false",
cond(false, false, false, false, 42) should == 42
)
)
)
)
| Ioke | 4 | olabini/ioke | test/cond_spec.ik | [
"ICU",
"MIT"
] |
#!/usr/bin/env bash
# Copyright 2018 The Kubernetes Authors.
#
# 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.
set -o errexit
set -o nounset
set -o pipefail
run_kubectl_config_set_tests() {
set -o nounset
set -o errexit
create_and_use_new_namespace
kube::log::status "Testing kubectl(v1:config set)"
kubectl config set-cluster test-cluster --server="https://does-not-work"
# Get the api cert and add a comment to avoid flag parsing problems
cert_data=$(echo "#Comment" && cat "${TMPDIR:-/tmp}/apiserver.crt")
kubectl config set clusters.test-cluster.certificate-authority-data "$cert_data" --set-raw-bytes
r_written=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster")].cluster.certificate-authority-data}')
encoded=$(echo -n "$cert_data" | base64)
kubectl config set clusters.test-cluster.certificate-authority-data "$encoded"
e_written=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster")].cluster.certificate-authority-data}')
test "$e_written" == "$r_written"
set +o nounset
set +o errexit
}
run_kubectl_config_set_cluster_tests() {
set -o nounset
set -o errexit
create_and_use_new_namespace
kube::log::status "Testing kubectl config set-cluster"
ca_file="${TMPDIR:-/tmp}/apiserver.crt"
ca_data=$(base64 -w0 "$ca_file")
# Set cert file
kubectl config set-cluster test-cluster-1 --certificate-authority "$ca_file"
expected="$ca_file"
actual=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster-1")].cluster.certificate-authority}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Certificate authority did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
# Embed cert from file
kubectl config set-cluster test-cluster-2 --embed-certs --certificate-authority "$ca_file"
expected="$ca_data"
actual=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster-2")].cluster.certificate-authority-data}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Certificate authority embedded from file did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
# Embed cert using process substitution
kubectl config set-cluster test-cluster-3 --embed-certs --certificate-authority <(cat "$ca_file")
expected="$ca_data"
actual=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster-3")].cluster.certificate-authority-data}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Certificate authority embedded using process substitution did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
set +o nounset
set +o errexit
}
run_kubectl_config_set_credentials_tests() {
set -o nounset
set -o errexit
create_and_use_new_namespace
kube::log::status "Testing kubectl config set-credentials"
cert_file="${TMPDIR:-/tmp}/test-client-certificate.crt"
key_file="${TMPDIR:-/tmp}/test-client-key.crt"
cat << EOF > "$cert_file"
-----BEGIN CERTIFICATE-----
MIIDazCCAlOgAwIBAgIUdSrvuXs0Bft9Ao/AFnC7fNBqD+owDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMDA1MTExODMyNDJaFw0yMTA1
MTExODMyNDJaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQCrS5/kYM3TjdFw4OYMdSOys0+4aHPgtXqePWrn1pBP
W9D1yhjI/JS1/uPAWLi+1nnn0PBMCbqo+ZEsRIlSAABJE4fVbRPg+AuBPDdlCex5
QfKNi3vwp0Gy756SKTNZmIx42I9in0WeocCDliTEM2KsawCrVzuE3gwcHHkOnmLX
DEc4bajkQxcaJITG3hsJ2Cm5OBMLPwrsq/77VzOdC12r9j8+w0f7lCJfOm2ui7rm
Vl76V2Nits6U0ZrF1yzYtVQ1iWqCnOudPPf3jyc7KcSetGwozgoydkcqfUS9iMs9
2OV3v17GX6+sd8zY8tA95d/Vj6yU/l03GI9V6X9LXHSTAgMBAAGjUzBRMB0GA1Ud
DgQWBBQo2BKDxo4XI5FJDj9ZUuDst9ck7DAfBgNVHSMEGDAWgBQo2BKDxo4XI5FJ
Dj9ZUuDst9ck7DAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAL
LjJ5k5kNdOUXFL2XhKO8w25tpkjd71vD3vKvPIN0Q5BgVmu5Bg476/WPBnSMvTVU
QYLQR5aGMLPdWuiSJnwO0BChKjOHaoCnP6D3cs2xP9hLBGoENaXMJRM4ZvFBRbES
Q6iTfq4OBPh5yCDDrjlppjhSnqaZuksmFnPFHLB/km003w8fgCD3VhmC2UFscl2K
nHaxK6uzIxisyE84ZDZYhjnPPib1wXGL8yu1dq0cbktE5+xJ2FHQkBJ6qaujkgV0
jpuWE9zk3CImFRkzPEwTF+3s5eP2XTIyWbtJGvJMmO0kHFx2PqCiAkdFldPKfrRh
M007Wf15dtkqyLNkzOxv
-----END CERTIFICATE-----
EOF
cat << EOF > "$key_file"
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCrS5/kYM3TjdFw
4OYMdSOys0+4aHPgtXqePWrn1pBPW9D1yhjI/JS1/uPAWLi+1nnn0PBMCbqo+ZEs
RIlSAABJE4fVbRPg+AuBPDdlCex5QfKNi3vwp0Gy756SKTNZmIx42I9in0WeocCD
liTEM2KsawCrVzuE3gwcHHkOnmLXDEc4bajkQxcaJITG3hsJ2Cm5OBMLPwrsq/77
VzOdC12r9j8+w0f7lCJfOm2ui7rmVl76V2Nits6U0ZrF1yzYtVQ1iWqCnOudPPf3
jyc7KcSetGwozgoydkcqfUS9iMs92OV3v17GX6+sd8zY8tA95d/Vj6yU/l03GI9V
6X9LXHSTAgMBAAECggEASKlTsfS+WrcV2OQNscse0XbuojLstK1GzkkPSDjkDkXM
ZfbMfLVn/6uXwMfh1lH0dDlVNWwLGhKDWlvYREhr1pPKUuZqQEv31WJNvTZwcR9g
XFqGwJayb8zlXurLNX5YWArFB/i394p1t1vBTNjfSnQ5XHUscjgeuu35DBJzqvSA
mh1nDUBFIMC4ruPzD7OMI7rXBN02PbfTBpoL8MGoesW0S/BFQciMS07rELL2hFih
zZPJE+E6h3GMoSPAzqx+ubSkhMbxb/xQQSw4gfp8zii2SMuq8Ith9xaGhdj1TuaX
NqZahgSRe7bbgYyHWHXYbd7gQa4fxxoT7Qyh0cSKwQKBgQDZP0yYcFfNADFfnw62
eWgNHnfPsOTYa/gAXdKgueUekT+linGvAUQtdXxnLoVMiLXSVxaJbW1rAP0avJt8
EJiTdtTXkKqTqwtfbUP/bmxjYNExvGfIOpJbDsCX+kwpCoWzHupXeQlZn7UDEmKR
l0DWUVzqNnhO0WWaM9J4MD4BjwKBgQDJ2elu8h7V/U/0dr2e4GG1/Xoa1nIcct8C
rn0cG2GJ6UxN9Rr/brrLZuBewlhul9VjGtcmD7ZvEEsR4EUHUguvheAg90rpAqSE
c6LOYdGAsUa21iuVLPKPMFwd4MhtrP2JcwHO+oqlUK4939TlZEtyiMWsMJGuugh1
nrudZ9LSvQKBgBFG83R8Gr928HZGVAk3BotkjOq7irebfpGo5INbxVj0/DbSF9Bv
LVjgKxCZpog7pxofSu+LAFSuM3LY5RSszTWNEchC/Q3ZYIIqUmoSAhS1Mm3eKfLG
lbUgKzjq8vuglpl0L/bc7V1vUhn4cFZbzRA+UEFgK5k5Ffd5f5eHXqcJAoGBAJmA
hVwg9sBHfnlrn3JmMwiCdkxYjrkBxoS0i2JHlFqbt7KFVn2wCI/McY6+fx/Dibxv
WfSQ+Gzn2B8FDZmulEJsLfED/szKfLBZfBM1Imya5CsBHm24m9G2tibmnaWCa+EO
O+7aa3uiqo9VXAMCzbmRN7plyTQ2N16zUvw2S4aFAoGARoPL2cJ+7HHcnc4SzKm4
Su5nLwVPj+IJUwI5SRsRdnUKqo4gaX54p/u/TlA6fm7esRqPu5LK0oIyItVP7wmT
nUCUFtnE53Rm2QT+BlYg7CewkaRiUHgQR31RDsQP8XtQouy0Si2jG53QLtBm+b7D
zpqQAUELuiSK67vTd+D96ss=
-----END PRIVATE KEY-----
EOF
cert_data=$(base64 -w0 "$cert_file")
key_data=$(base64 -w0 "$key_file")
# Set client certificate and client key files
kubectl config set-credentials user1 --client-certificate="$cert_file" --client-key="$key_file"
expected="$cert_file"
actual=$(kubectl config view --raw -o jsonpath='{.users[?(@.name == "user1")].user.client-certificate}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Client certificate did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
expected="$key_file"
actual=$(kubectl config view --raw -o jsonpath='{.users[?(@.name == "user1")].user.client-key}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Client key did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
# Embed client certificate and client key from files
kubectl config set-credentials user2 --client-certificate="$cert_file" --client-key="$key_file" --embed-certs=true
expected="$cert_data"
actual=$(kubectl config view --raw -o jsonpath='{.users[?(@.name == "user2")].user.client-certificate-data}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Client certificate data embedded from file did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
expected="$key_data"
actual=$(kubectl config view --raw -o jsonpath='{.users[?(@.name == "user2")].user.client-key-data}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Client key data embedded from file did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
# Embed client certificate and client key using process substitution
kubectl config set-credentials user3 --client-certificate=<(cat "$cert_file") --client-key=<(cat "$key_file") --embed-certs=true
expected="$cert_data"
actual=$(kubectl config view --raw -o jsonpath='{.users[?(@.name == "user3")].user.client-certificate-data}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Client certificate data embedded using process substitution did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
expected="$key_data"
actual=$(kubectl config view --raw -o jsonpath='{.users[?(@.name == "user3")].user.client-key-data}')
if [ "$expected" != "$actual" ]; then
kube::log::error "Client key data embedded using process substitution did not match the expected value (expected=$expected, actual=$actual)"
exit 1
fi
set +o nounset
set +o errexit
}
run_client_config_tests() {
set -o nounset
set -o errexit
create_and_use_new_namespace
kube::log::status "Testing client config"
# Command
# Pre-condition: kubeconfig "missing" is not a file or directory
output_message=$(! kubectl get pod --context="" --kubeconfig=missing 2>&1)
kube::test::if_has_string "${output_message}" "missing: no such file or directory"
# Pre-condition: kubeconfig "missing" is not a file or directory
# Command
output_message=$(! kubectl get pod --user="" --kubeconfig=missing 2>&1)
# Post-condition: --user contains a valid / empty value, missing config file returns error
kube::test::if_has_string "${output_message}" "missing: no such file or directory"
# Command
output_message=$(! kubectl get pod --cluster="" --kubeconfig=missing 2>&1)
# Post-condition: --cluster contains a "valid" value, missing config file returns error
kube::test::if_has_string "${output_message}" "missing: no such file or directory"
# Pre-condition: context "missing-context" does not exist
# Command
output_message=$(! kubectl get pod --context="missing-context" 2>&1)
kube::test::if_has_string "${output_message}" 'context was not found for specified context: missing-context'
# Post-condition: invalid or missing context returns error
# Pre-condition: cluster "missing-cluster" does not exist
# Command
output_message=$(! kubectl get pod --cluster="missing-cluster" 2>&1)
kube::test::if_has_string "${output_message}" 'no server found for cluster "missing-cluster"'
# Post-condition: invalid or missing cluster returns error
# Pre-condition: user "missing-user" does not exist
# Command
output_message=$(! kubectl get pod --user="missing-user" 2>&1)
kube::test::if_has_string "${output_message}" 'auth info "missing-user" does not exist'
# Post-condition: invalid or missing user returns error
# test invalid config
kubectl config view | sed -E "s/apiVersion: .*/apiVersion: v-1/g" > "${TMPDIR:-/tmp}"/newconfig.yaml
output_message=$(! "${KUBE_OUTPUT_HOSTBIN}/kubectl" get pods --context="" --user="" --kubeconfig="${TMPDIR:-/tmp}"/newconfig.yaml 2>&1)
kube::test::if_has_string "${output_message}" "error loading config file"
output_message=$(! kubectl get pod --kubeconfig=missing-config 2>&1)
kube::test::if_has_string "${output_message}" 'no such file or directory'
set +o nounset
set +o errexit
} | Shell | 5 | lack/kubernetes | test/cmd/kubeconfig.sh | [
"Apache-2.0"
] |
(declare defclass [symbol --> [list [class A]] --> [list [symbol * symbol]] --> symbol])
(datatype subtype
(subtype B A); X : B;
_____________________
X : A;)
(define defclass
Class SuperClasses ClassDef
-> (let Attributes (map fst ClassDef)
Inherited (put-prop Class attributes
(append Attributes (collect-attributes SuperClasses)))
Types (record-attribute-types Class ClassDef)
Assoc (map (/. Attribute [Attribute | fail!]) Inherited)
ClassDef [[class | Class] | Assoc]
Store (put-prop Class classdef ClassDef)
RecordClass (axiom Class Class [class Class])
SubTypes (record-subtypes Class SuperClasses)
Class))
(define record-subtypes
_ [] -> _
Class SuperClasses -> (eval [datatype (concat Class superclasses)
| (record-subtypes-help Class SuperClasses)]))
(define record-subtypes-help
_ [] -> []
Class [SuperClass | SuperClasses] -> [_______________________
[subtype SuperClass Class]; |
(record-subtypes-help Class SuperClasses)])
(define collect-attributes
[] -> []
[SuperClass | SuperClasses] -> (append (get-prop SuperClass attributes [])
(collect-attributes SuperClasses)))
(define axiom
DataType X A -> (eval [datatype DataType
________
X : A;]))
(define record-attribute-types
_ [] -> []
Class [(@p Attribute Type) | ClassDef]
-> (let DataTypeName (concat Class Attribute)
DataType (axiom DataTypeName Attribute [attribute Class Type])
(record-attribute-types Class ClassDef)))
(declare make-instance [[class Class] --> [instance Class]])
(define make-instance
Class -> (let ClassDef (get-prop Class classdef [])
(if (empty? ClassDef)
(error "class ~A does not exist~%" Class)
ClassDef)))
(declare get-value [[attribute Class A] --> [instance Class] --> A])
(define get-value
Attribute Instance -> (let LookUp (assoc Attribute Instance)
(get-value-test LookUp)))
(define get-value-test
[ ] -> (error "no such attribute!~%")
[_ | fail!] -> (error "no such value!~%")
[_ | Value] -> Value)
(declare has-value? [[attribute Class A] --> [instance Class] --> boolean])
(define has-value?
Attribute Instance -> (let LookUp (assoc Attribute Instance)
(has-value-test LookUp)))
(define has-value-test
[ ] -> (error "no such attribute!~%")
[_ | fail!] -> false
_ -> true)
(declare has-attribute? [symbol --> [instance Class] --> boolean])
(define has-attribute?
Attribute Instance -> (let LookUp (assoc Attribute Instance)
(not (empty? LookUp))))
(declare change-value [[instance Class] --> [attribute Class A] --> A --> [instance Class]])
(define change-value
_ class _ -> (error "cannot change the class of an instance!~%")
[ ] _ _ -> (error "no such attribute!~%")
[[Attribute | _] | Instance] Attribute Value
-> [[Attribute | Value] | Instance]
[Slot | Instance] Attribute Value
-> [Slot | (change-value Instance Attribute Value)])
(declare instance-of [[instance Class] --> [class Class]])
(define instance-of
[[class | Class] | _] -> Class
_ -> (error "not a class instance!"))
| Shen | 5 | WilliamStone/Shen.java | shen/test/classes-inheritance.shen | [
"Unlicense"
] |
foo : String
foo = "nested: \{ " \{ 1 + } " }"
| Idris | 0 | ska80/idris-jvm | tests/idris2/perror007/StrError2.idr | [
"BSD-3-Clause"
] |
def isinverse(matrix):
"""
This function checks if a matrix has an inverse and if it does it outputs it, if not returns FALSE.
arguements: A matrix
outputs: if inverse exists - the invese of the matrix
inverse doesn't exist - this matrix has no inverse
"""
try:
return matrix.inverse()
except:
return "This matrix has no inverse"
C = matrix([[-1/2, -1/2], [-2, -1]])
print isinverse(C)
print "The determinant of this matrix is:"
print det(C)
D = matrix([[2, -2, 1], [6, -1, 1], [12, -2, 2]])
print isinverse(D)
print "The determinant of this matrix is:"
print det(D)
E = matrix([[1, 2], [2, 0]])
print isinverse(E)
print "The determinant of this matrix is:"
print det(E)
| Sage | 4 | dyhla/atom-script | examples/example.sage | [
"MIT"
] |
(defmodule recs-test
(export all))
;; Defines records #urec{a,b,c}, #trec{a,b,c}.
;;(include-file "include_recs.hrl")
(include-file "include-recs.lfe")
;; Make records functions.
(defun r1 () (make-urec))
(defun r2 (b) (make-trec b (foo:bar b)))
;; Some access functions.
(defun r3 (u) (urec-b u))
(defun r4a (t) ;Setting one
(set-trec-b t (foo:bar 1)))
(defun r4b (t)
(set-trec t b (foo:bar 1)))
(defun r5 (t) ;Setting some
(set-trec t b (foo:bar 1) c (zip:zap 42)))
;; Some access functions for a big record.
(defrecord brec a b c d e f g h i j k l m n o p q r s t u v w x y z)
(defun r6 () (make-brec))
(defun r7 (t) (brec-m t))
(defun r8a (t) ;Setting one
(set-brec-l t (foo:bar 1)))
(defun r8b (t)
(set-brec t l (foo:bar 1)))
(defun r9 (t) ;Setting many
(set-brec t j (foo:bar 1) p (zip:zap 42)))
(defun r10 (t)
(set-brec t a (foo:bar 2) j (foo:bar 1) p (zip:zap 42) z (zip:zap 1)))
| LFE | 3 | haetze/lfe | dev/recs-test.lfe | [
"Apache-2.0"
] |
/*
* Copyright (C) 2012-2017 Netronome Systems, Inc. All rights reserved.
*
* File: cmsg_map.uc
* Description: Handles parsing and processing of control messages for ebpf maps
*
* API calls:
* cmsg_init() - declare global and local resources
* cmsg_rx() - receive from workq and process cmsg
* cmsg_desc_workq() - create GRO descriptors destined for cmsg workq
*
* typical use
* from datapath action
* cmsg_init()
*
* to send to cmsg process ME
* .reg $gro_meta[GRO_META_SIZE_LW]
* .xfer_order $gro_meta
* cmsg_desc_workq($gro_meta, in_pkt_vec, EGRESS_LABEL)
* gro_cli_send(seq_ctx, seq_no, $gro_meta, 0)
*
* from cmsg handler ME
* cmsg_init()
*
* cmsg_rx()
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#ifndef _CMSG_MAP_
#define _CMSG_MAP_
#include <bitfields.uc>
#include <stdmac.uc>
#include <preproc.uc>
#include <journal.uc>
#include <nfd_user_cfg.h>
#include <ov.uc>
#include <nfd_in.uc>
#include <nfd_out.uc>
#include <gro.uc>
#include <endian.uc>
#include "pkt_buf.uc"
#ifndef NUM_CONTEXT
#define NUM_CONTEXT 4
.num_contexts 4
#endif
#ifndef INCL_CMSG_MAP_PROC
#include "cmsg_map_types.h"
#include "slicc_hash.h"
#include "hashmap.uc"
#include "hashmap_priv.uc"
#endif
#define CMSG_DESC_LW 3
#ifndef NFD_META_MAX_LW
#define NFD_META_MAX_LW NFP_NET_META_FIELD_SIZE
#endif
#macro cmsg_lm_handles_define()
lm_handle_alloc(CMSG_KEY_LM_HANDLE)
#define_eval CMSG_KEY_LM_HANDLE _LM_NEXT_HANDLE
#define_eval CMSG_KEY_LM_INDEX _LM_NEXT_INDEX
lm_handle_alloc(CMSG_VALUE_LM_HANDLE)
#define_eval CMSG_VALUE_LM_HANDLE _LM_NEXT_HANDLE
#define_eval CMSG_VALUE_LM_INDEX _LM_NEXT_INDEX
#endm
#macro cmsg_lm_handles_undef()
lm_handle_free(CMSG_KEY_LM_HANDLE)
#undef CMSG_KEY_LM_HANDLE
#undef CMSG_KEY_LM_INDEX
lm_handle_free(CMSG_VALUE_LM_HANDLE)
#undef CMSG_VALUE_LM_HANDLE
#undef CMSG_VALUE_LM_INDEX
#endm
#macro nfd_lm_handle_define()
lm_handle_alloc(NFD_LM_HANDLE)
#define_eval NFD_LM_HANDLE _LM_NEXT_HANDLE
#define_eval NFD_LM_INDEX _LM_NEXT_INDEX
#endm
#macro nfd_lm_handle_undef()
lm_handle_free(NFD_LM_HANDLE)
#undef NFD_LM_HANDLE
#undef NFD_LM_INDEX
#endm
#macro cmsg_bm_lm_define()
lm_handle_alloc(CMSG_BM_LM_HANDLE)
#define_eval CMSG_BM_LM_HANDLE _LM_NEXT_HANDLE
#define_eval CMSG_BM_LM_INDEX _LM_NEXT_INDEX
#endm
#macro cmsg_bm_lm_undef()
lm_handle_free(CMSG_BM_LM_HANDLE)
#undef CMSG_BM_LM_HANDLE
#undef CMSG_BM_LM_INDEX
#endm
#define CMSG_LM_FIELD_SZ (CMSG_MAP_KEY_VALUE_LW * 4)
#define_eval CMSG_LM_FIELD_SZ_SHFT (LOG2(CMSG_LM_FIELD_SZ))
#define MAP_CMSG_IN_WQ_SZ 4096
#macro cmsg_init()
.alloc_resource MAP_CMSG_Q_IDX emem0_queues global 1
#ifdef CMSG_MAP_PROC
.init_csr mecsr:CtxEnables.NNreceiveConfig 0x2 const ; 0x2=NN path from CTM MiscEngine
slicc_hash_init_nn()
pkt_counter_decl(cmsg_enq)
pkt_counter_decl(cmsg_rx)
pkt_counter_decl(cmsg_tx)
pkt_counter_decl(cmsg_err)
pkt_counter_decl(cmsg_err_no_credits)
pkt_counter_decl(cmsg_rx_bad_type)
pkt_counter_decl(cmsg_dbg_enq)
pkt_counter_decl(cmsg_dbg_rxq)
.alloc_mem MAP_CMSG_Q_BASE emem0 global MAP_CMSG_IN_WQ_SZ MAP_CMSG_IN_WQ_SZ
.init_mu_ring MAP_CMSG_Q_IDX MAP_CMSG_Q_BASE 0
#define CMSG_NUM_FD_BM_LW ((HASHMAP_MAX_TID_EBPF+31)/32)
.alloc_mem LM_CMSG_FD_BITMAP lm me (CMSG_NUM_FD_BM_LW * 4) 8
.init LM_CMSG_FD_BITMAP 0
.alloc_mem LM_CMSG_BASE lm me (NUM_CONTEXT * (CMSG_LM_FIELD_SZ * 4)) 8
.init LM_CMSG_BASE 0
#define CMSG_TXFR_COUNT 16
#define HASHMAP_TXFR_COUNT 16
#define HASHMAP_RXFR_COUNT 16
.reg volatile read $map_rxfr[HASHMAP_RXFR_COUNT]
.xfer_order $map_rxfr
.reg write $map_txfr[HASHMAP_TXFR_COUNT]
.xfer_order $map_txfr
__hashmap_set($map_txfr)
.reg read $map_cam[8]
.xfer_order $map_cam
#define MAP_RDXR $map_rxfr
#define MAP_TXFR $map_txfr
#define MAP_RXCAM $map_cam[0]
nfd_out_send_init()
#endif
#endm
#macro cmsg_free_mem_buffer(in_nfd)
.begin
.reg isl
.reg bls
.reg mu_addr
.reg pkt_num
bitfield_extract(bls, BF_AML(in_nfd, NFD_OUT_BLS_fld))
bitfield_extract(mu_addr, BF_AML(in_nfd, NFD_OUT_MUADDR_fld))
bitfield_extract(pkt_num, BF_AML(in_nfd, NFD_OUT_PKTNUM_fld))
bitfield_extract(isl, BF_AML(in_nfd, NFD_OUT_CTM_ISL_fld))
pkt_buf_free_mu_buffer(bls, mu_addr)
pkt_buf_free_ctm_buffer(isl, pkt_num)
.end
#endm
#macro cmsg_get_mem_addr(out_mem_addr, in_nfd)
.begin
.reg mu_ptr
bitfield_extract__sz1(mu_ptr, BF_AML(in_nfd, NFD_OUT_MUADDR_fld)) ;
#define __MU_PTR_msb__ 28
alu[out_mem_addr, --, B, mu_ptr, <<(31 - __MU_PTR_msb__)]
#undef __MU_PTR_msb__
.end
#endm
#macro cmsg_lm_ctx_addr(out_lm_fld1,out_lm_fld2, in_ctx)
.begin
.reg lm_off
/* 4 context mode */
#define_eval __LM_CTX_SZ_SHFT__ (LOG2(CMSG_LM_FIELD_SZ))
immed[out_lm_fld1, LM_CMSG_BASE]
alu[lm_off, --, b, in_ctx, <<__LM_CTX_SZ_SHFT__]
alu[out_lm_fld1, out_lm_fld1, +, lm_off]
alu[out_lm_fld2, out_lm_fld1, +, CMSG_LM_FIELD_SZ]
#undef __LM_CTX_SZ_SHFT__
.end
#endm
#macro cmsg_alloc_fd_from_bm(out_tid, NO_FREE_TID_LABEL)
.begin
.reg lm_addr
.reg bitmap
.reg count
.reg bm_idx
.reg bm_offset
immed[lm_addr, LM_CMSG_FD_BITMAP]
cmsg_bm_lm_define()
local_csr_wr[ACTIVE_LM_ADDR_/**/CMSG_BM_LM_HANDLE, lm_addr]
immed[count, CMSG_NUM_FD_BM_LW]
immed[out_tid, 0]
immed[bm_offset, 0]
loop#:
alu[bitmap, --, ~b, CMSG_BM_LM_INDEX]
beq[next#] ; no free slots
ffs[bm_idx, bitmap]
alu[--, bm_idx, or, 0]
alu[bitmap, CMSG_BM_LM_INDEX, or, 1, <<indirect]
alu[CMSG_BM_LM_INDEX, --, b, bitmap]
alu[bm_idx, bm_idx, +, 1]
alu[out_tid, bm_idx, +, bm_offset]
br[ret#]
next#:
alu[--, --, b, CMSG_BM_LM_INDEX++]
alu[bm_offset, bm_offset, +, 32]
alu[count, count, -, 1]
bne[loop#]
br[NO_FREE_TID_LABEL]
ret#:
cmsg_bm_lm_undef()
.end
#endm
#macro cmsg_free_fd_from_bm(in_tid, ERROR_LABEL)
.begin
.reg lm_addr
.reg bitmap
.reg bm_offset
.reg bm_idx
.reg tid
.reg tmp
alu[--, in_tid, -, HASHMAP_MAX_TID_EBPF]
bgt[ERROR_LABEL]
immed[lm_addr, LM_CMSG_FD_BITMAP]
alu[tid, in_tid, -, 1]
alu[bm_offset, --, b, tid, >>5]
alu[tmp, --, b, bm_offset, <<2]
alu[lm_addr, lm_addr, +, tmp]
cmsg_bm_lm_define()
local_csr_wr[ACTIVE_LM_ADDR_/**/CMSG_BM_LM_HANDLE, lm_addr]
alu[bm_offset, --, b, bm_offset, <<5]
alu[bm_idx, tid, -, bm_offset]
nop
alu[--, bm_idx, or, 0]
alu[CMSG_BM_LM_INDEX, CMSG_BM_LM_INDEX, and~, 1, <<indirect]
cmsg_bm_lm_undef()
.end
#endm
/*
* we're working on nfd out descriptor format
*/
#macro cmsg_reply(in_nfd_out_desc, in_pkt_len, NO_CREDIT_LABEL)
.begin
.reg nfdo_desc[NFD_OUT_DESC_SIZE_LW]
.reg nfd_credit
.reg pkt_offset
.reg meta_len
.reg nfd_bls
.reg mu_ptr, mu_addr
.reg plen
.reg $credit
.sig credit_sig
#define __WAIT_FOR_CREDITS
#define NO_CREDIT_SLEEP 500
nfd_out_get_credits($credit, NIC_PCI, NFD_CTRL_QUEUE, 1, credit_sig, SIG_WAIT)
alu[--, --, b, $credit]
beq[NO_CREDIT_LABEL]
#ifdef __WAIT_FOR_CREDITS
.while ($credit == 0)
#define_eval _SLEEP_TICKS (NO_CREDIT_SLEEP / 16)
timestamp_sleep(_SLEEP_TICKS)
#undef _SLEEP_TICKS
nfd_out_get_credits($credit, NIC_PCI, NFD_CTRL_QUEUE, 1, credit_sig,
SIG_WAIT)
.endw
#endif
alu[plen, --, b, in_pkt_len]
move(pkt_offset, NFD_IN_DATA_OFFSET)
immed[meta_len, 0]
// meta prepend is not needed
bitfield_extract(nfd_bls, BF_AML(in_nfd_out_desc, NFD_OUT_BLS_fld))
bitfield_extract(mu_ptr, BF_AML(in_nfd_out_desc, NFD_OUT_MUADDR_fld))
.reg ctm_pnum
.reg ctm_isl
bitfield_extract(ctm_pnum, BF_AML(in_nfd_out_desc, NFD_OUT_PKTNUM_fld))
bitfield_extract(ctm_isl, BF_AML(in_nfd_out_desc, NFD_OUT_CTM_ISL_fld))
pkt_buf_free_ctm_buffer(ctm_isl, ctm_pnum)
nfd_out_fill_desc(nfdo_desc, 0, 0, nfd_bls,
mu_ptr, plen, 0, pkt_offset,
meta_len)
nfd_lm_handle_define()
nfd_out_send(nfdo_desc, NIC_PCI, NFD_CTRL_QUEUE, NFD_LM_HANDLE)
nfd_lm_handle_undef()
pkt_counter_incr(cmsg_tx)
.end
#endm
/**
* GRO descriptor for delivery via workq
* word 0: GRO specific
* word 1-3: NFD OUT desc
*
* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
* Word +--------------+-------------+-------------------+-------+------+
* 0 | q_hi | unused | qnum | dest |type |
* +-------------------------------+-------------------------------+
* 1 | CTM ISL |C| Packet Number |SPL|0| Starting Offset |
* +-+---+-----+-+-----------------+---+-+-------------------------+
* 2 |N|BLS| MU Buffer Address [39:11] |
* +-+---+---------+---------------+-------------------------------+
* 3 |D| Meta Length | RX Queue | Data Length |
* +-+-------------+---------------+-------------------------------+
*
*/
#macro cmsg_get_gro_workq_desc(out_desc, in_vec, q_idx)
.begin
.reg buf_list
.reg ctm_buf_sz
.reg ctm_only
.reg desc
.reg meta_len
.reg offset
.reg pkt_len
.reg pkt_num
#if (SS != 0)
#error "Only targets PCIe = 0"
#endif
#ifdef SPLIT_EMU_RINGS
// NFD supports SPLIT_EMU_RINGS (separate EMU rings for each NBI)
// by providing the "N" bit extending the BLS field. In practice
// If SPLIT_EMU_RINGS is _not_ used, then N is simply zero for all
// NBIs.
#error "SPLIT_EMU_RINGS configuration not supported."
#endif
// Word 0
#define __NUM_WORKQ_DESC__ 3
#define __WORKQ_ISL__ 24
move(desc, __NUM_WORKQ_DESC__ | ((__WORKQ_ISL__ | 0x80) << GRO_META_RINGHI_shf))
alu_shf[desc, desc, or, q_idx, <<GRO_META_MEM_RING_RINGLO_shf]
alu_shf[out_desc[0], desc, or, GRO_DEST_MEM_RING_3WORD, <<GRO_META_DEST_shf]
// word 1 -- NFD_OUT_SPLIT_wrd+1
alu[desc, BF_A(in_vec, PV_NUMBER_bf), AND~, BF_MASK(PV_BLS_bf), <<BF_L(PV_BLS_bf)] ; PV_NUMBER_bf, PV_BLS_bf
alu[pkt_len, 0, +16, desc]
alu[pkt_num, desc, -, pkt_len]
alu[offset, 0x7f, AND, BF_A(in_vec, PV_OFFSET_bf), >>1] ; PV_OFFSET_bf
alu[ctm_only, 1, AND~, BF_A(in_vec, PV_SPLIT_bf), >>BF_L(PV_SPLIT_bf)] ; PV_SPLIT_bf
alu[desc, offset, OR, ctm_only, <<NFD_OUT_CTM_ONLY_shf] ; C + offset
alu[desc, desc, or, pkt_num]
alu[desc, desc, OR, __ISLAND, <<NFD_OUT_CTM_ISL_shf] ;CTM ISL
bitfield_extract__sz1(ctm_buf_sz, BF_AML(in_vec, PV_CBS_bf)) ; PV_CBS_bf
alu[out_desc[1], desc, OR, ctm_buf_sz, <<NFD_OUT_SPLIT_shf] ; SPL
// Word 2 -- NFD_OUT_BLS_wrd+1
alu[desc, BF_A(in_vec, PV_MU_ADDR_bf), AND~, ((BF_MASK(PV_SPLIT_bf) << BF_WIDTH(PV_CBS_bf)) | BF_MASK(PV_CBS_bf)), <<BF_L(PV_CBS_bf)]
bitfield_extract__sz1(buf_list, BF_AML(in_vec, PV_BLS_bf)) ; PV_BLS_bf
alu[out_desc[2], desc, OR, buf_list, <<NFD_OUT_BLS_shf]
// Word 3 -- NFD_OUT_QID_wrd+1
#ifndef GRO_EVEN_NFD_OFFSETS_ONLY
alu[desc, pkt_len, OR, BF_A(in_vec, PV_OFFSET_bf), <<31]
alu[out_desc[3], desc, OR, BF_A(in_vec, PV_QUEUE_IN_bf), <<NFD_OUT_QID_shf]
#else
alu[out_desc[3], pkt_len, OR, BF_A(in_vec, PV_QUEUE_IN_bf), <<NFD_OUT_QID_shf]
#endif
.end
#undef __NUM_WORKQ_DESC__
#undef __WORKQ_ISL__
#endm
#macro cmsg_desc_workq(o_gro_meta, in_vec, SUCCESS_LABEL)
.begin
.reg q_idx
.reg word, dest
.reg desc
.reg msk
move(q_idx, MAP_CMSG_Q_IDX)
cmsg_get_gro_workq_desc(o_gro_meta, in_vec, q_idx)
br[SUCCESS_LABEL]
.end
#endm
#macro cmsg_recv_workq(out_cmsg, SIGNAL, SIGTYPE)
.begin
.reg q_base_hi
.reg q_idx
move(q_base_hi, (((MAP_CMSG_Q_BASE >>32) & 0xff) <<24))
immed[q_idx, MAP_CMSG_Q_IDX]
#if (streq('SIGTYPE', 'SIG_DONE'))
mem[qadd_thread, out_cmsg[0], q_base_hi, <<8, q_idx, CMSG_DESC_LW], sig_done[SIGNAL]
#elif (streq('SIGTYPE', 'SIG_WAIT'))
mem[qadd_thread, out_cmsg[0], q_base_hi, <<8, q_idx, CMSG_DESC_LW], ctx_swap[SIGNAL]
#else
#error "unknown signal type"
#endif
pkt_counter_incr(cmsg_dbg_rxq)
.end
#endm
#macro cmsg_rx()
.begin
.reg q_base_hi
.reg q_idx
.reg $nfd_data[4]
.xfer_order $nfd_data
.sig q_sig
.sig cmsg_type_read_sig
.reg nfd_pkt_meta[CMSG_DESC_LW] ; need to save first 3 words of nfd meta
.reg cmsg_addr_hi
.reg cmsg_type
.reg cmsg_reply_pktlen
.reg nfd_meta_len
.reg c_offset
.reg read $cmsg_data[6]
.xfer_order $cmsg_data
.reg cmsg_hdr_w0
.reg cmsg_tag
// Fetch work from queue.
#define_eval __CMSG_Q_BASE__ MAP_CMSG_Q_BASE
#define_eval __CMSG_Q_IDX__ MAP_CMSG_Q_IDX
move(q_base_hi, (((__CMSG_Q_BASE__ >>32) & 0xff) <<24))
immed[q_idx, __CMSG_Q_IDX__]
#undef __CMSG_Q_BASE__
#undef __CMSG_Q_IDX__
mem[qadd_thread, $nfd_data[0], q_base_hi, <<8, q_idx, CMSG_DESC_LW], ctx_swap[q_sig]
pkt_counter_incr(cmsg_rx)
alu[nfd_pkt_meta[0], --, b, $nfd_data[0]]
alu[nfd_pkt_meta[1], --, b, $nfd_data[1]]
alu[nfd_pkt_meta[2], --, b, $nfd_data[2]]
// extract buffer address.
cmsg_get_mem_addr(cmsg_addr_hi, $nfd_data)
.sig read_sig
move(c_offset, NFD_IN_DATA_OFFSET)
mem[read32, $cmsg_data[0], c_offset, cmsg_addr_hi, <<8, 6], ctx_swap[read_sig]
alu[cmsg_hdr_w0, --, b, $cmsg_data[0]]
cmsg_validate(cmsg_type, cmsg_tag, cmsg_hdr_w0, cmsg_error#)
cmsg_proc($cmsg_data, cmsg_exit_free_error#, cmsg_exit_free#)
cmsg_reply(nfd_pkt_meta, cmsg_reply_pktlen, cmsg_no_credit#)
br[cmsg_exit#]
cmsg_error#:
pkt_counter_incr(cmsg_err)
cmsg_no_credit#:
cmsg_exit_free_error#:
pkt_counter_incr(cmsg_err_no_credits)
cmsg_pkt_error#:
// free CTM + MU buffers
cmsg_exit_free#:
cmsg_free_mem_buffer(nfd_pkt_meta)
br[cmsg_exit#]
cmsg_exit_no_free#:
cmsg_exit#:
.end
#endm
/* Format of the control message -- common to all
* Bit 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
* -----\ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
* Word +---------------+---------------+---------------+---------------+
* 0 | type | version | tag |
* +---------------+---------------+-------------------------------+
*/
#macro cmsg_validate(o_msg_type, o_tag, in_ctrl_w0, ERROR_LABEL)
.begin
.reg version
ld_field_w_clr[o_msg_type, 0001, in_ctrl_w0, >>24]
.if(o_msg_type > CMSG_TYPE_MAP_MAX)
br[ERROR_LABEL]
.endif
ld_field_w_clr[version, 0001, in_ctrl_w0, >>16]
.if(version > CMSG_MAP_VERSION)
br[ERROR_LABEL]
.endif
ld_field_w_clr[o_tag, 0011, in_ctrl_w0]
.end
#endm
#macro cmsg_set_reply(out_cmsg, in_cmsg_type, in_cmsg_tag)
.begin
.reg v
.reg t
ld_field_w_clr[v, 0100, CMSG_MAP_VERSION, <<16]
ld_field[v, 0011, in_cmsg_tag]
alu[t, --, b, in_cmsg_type]
alu[t, t, or, 1, <<CMSG_TYPE_MAP_REPLY_BIT]
alu[out_cmsg, v, or, t, <<24]
.end
#endm
#macro cmsg_proc(HDR_DATA, ERROR_LABEL, FREE_LABEL)
.begin
.reg read $pkt_data[CMSG_TXFR_COUNT]
.xfer_order $pkt_data
.reg write $reply[3]
.xfer_order $reply
.sig rd_sig
.reg ctx_num
.reg addr_lo
.reg count, flags
.reg key_offset, value_offset
.reg rc
.sig sig_reply_map_ops
.reg map_op
.reg l_cmsg_type
.reg cur_fd
.reg map_type
#define __CMSG_DATA_OFFSET__ (NFD_IN_DATA_OFFSET)
immed[addr_lo, __CMSG_DATA_OFFSET__]
#undef __CMSG_DATA_OFFSET__
local_csr_rd[ACTIVE_CTX_STS]
immed[ctx_num, 0]
alu[ctx_num, ctx_num, and, 7]
immed[cmsg_reply_pktlen, 0]
alu[l_cmsg_type, --, b, cmsg_type]
// cmsg type has been validated
// Process the control message.
#define_eval MAX_JUMP (CMSG_TYPE_MAP_MAX + 1)
preproc_jump_targets(j, MAX_JUMP)
#ifdef _CMSG_LOOP
#error "_CMSG_LOOP is already defined" (_CMSG_LOOP)
#endif
#define_eval _CMSG_LOOP 0
jump[cmsg_type, j0#], targets[PREPROC_LIST]
#while (_CMSG_LOOP < MAX_JUMP)
j/**/_CMSG_LOOP#:
br[s/**/_CMSG_LOOP#]
#define_eval _CMSG_LOOP (_CMSG_LOOP + 1)
#endloop
#undef _CMSG_LOOP
#undef MAX_JUMP
s/**/CMSG_TYPE_MAP_ALLOC#:
.begin
.reg keysz, valuesz, maxent
alu[keysz, --, b, HDR_DATA[CMSG_MAP_ALLOC_KEYSZ_IDX]]
alu[valuesz, --, b, HDR_DATA[CMSG_MAP_ALLOC_VALUESZ_IDX]]
alu[maxent, --, b, HDR_DATA[CMSG_MAP_ALLOC_MAXENT_IDX]]
alu[map_type, --, b, HDR_DATA[CMSG_MAP_ALLOC_TYPE_IDX]]
bne[alloc_cont#]
immed[map_type, BPF_MAP_TYPE_HASH] ; default is hash
alloc_cont#:
_cmsg_alloc_fd(keysz, valuesz, maxent, swap, map_type)
br[cmsg_proc_ret#]
.end
s0#:
s/**/CMSG_TYPE_MAP_FREE#:
alu[cur_fd, --, b, HDR_DATA[CMSG_MAP_TID_IDX]]
_cmsg_free_fd(cur_fd)
br[cmsg_proc_ret#]
s/**/CMSG_TYPE_MAP_LOOKUP#:
s/**/CMSG_TYPE_MAP_ADD#:
s/**/CMSG_TYPE_MAP_DELETE#:
s/**/CMSG_TYPE_MAP_GETNEXT#:
s/**/CMSG_TYPE_MAP_GETFIRST#:
.begin
.reg lm_key_offset
.reg lm_value_offset
.reg save_rc
.reg l_cmsg_type
.reg rtn_count
.reg map_type
.reg max_entries
.reg cur_key
.reg le_key
cmsg_lm_ctx_addr(lm_key_offset,lm_value_offset, ctx_num)
cmsg_lm_handles_define()
immed[cmsg_reply_pktlen, 0]
immed[rtn_count, 0]
immed[cur_key, 0]
immed[le_key, 0]
alu[cur_fd, --, b, HDR_DATA[CMSG_MAP_TID_IDX]]
alu[count, --, b, HDR_DATA[CMSG_MAP_OP_COUNT_IDX]]
alu[flags, --, b, HDR_DATA[CMSG_MAP_OP_FLAGS_IDX]]
alu[key_offset, addr_lo, +, (CMSG_OP_HDR_LW*4)]
alu[l_cmsg_type, --, b, cmsg_type]
immed[save_rc, CMSG_RC_ERR_MAP_FD]
hashmap_get_fd_attr(cur_fd, map_type, max_entries, done#)
immed[save_rc, CMSG_RC_SUCCESS]
.if (cmsg_type == CMSG_TYPE_MAP_ADD)
.if (flags == CMSG_BPF_NOEXIST)
immed[l_cmsg_type, HASHMAP_OP_ADD_ONLY]
.elif (flags == CMSG_BPF_EXIST)
immed[l_cmsg_type, HASHMAP_OP_UPDATE]
.endif
.endif
proc_loop#:
local_csr_wr[ACTIVE_LM_ADDR_/**/CMSG_KEY_LM_HANDLE, lm_key_offset]
local_csr_wr[ACTIVE_LM_ADDR_/**/CMSG_VALUE_LM_HANDLE, lm_value_offset]
nop
nop
alu[--, map_type, -, BPF_MAP_TYPE_ARRAY]
beq[proc_array_map#]
ov_single(OV_LENGTH, CMSG_TXFR_COUNT, OVF_SUBTRACT_ONE) // Length in 32-bit LWs
mem[read32_swap, $pkt_data[0], cmsg_addr_hi, <<8, key_offset, max_/**/CMSG_TXFR_COUNT], indirect_ref, sig_done[rd_sig]
ctx_arb[rd_sig]
aggregate_copy(CMSG_KEY_LM_INDEX, ++, $pkt_data, 0, (CMSG_TXFR_COUNT-1))
br[proc_loop_cont#]
proc_array_map#:
mem[read32_swap, $pkt_data[0], cmsg_addr_hi, <<8, key_offset, 1], sig_done[rd_sig]
ctx_arb[rd_sig]
alu[cur_key, --, b, $pkt_data[0]]
.if (l_cmsg_type == CMSG_TYPE_MAP_GETFIRST)
br[array_map_setkey#], defer[2]
immed[cur_key, 0]
immed[l_cmsg_type, CMSG_TYPE_MAP_ARRAY_GETNEXT]
.elif (l_cmsg_type == CMSG_TYPE_MAP_GETNEXT)
immed[l_cmsg_type, CMSG_TYPE_MAP_ARRAY_GETNEXT]
alu[cur_key, cur_key, +, 1]
alu[--, max_entries, -, cur_key]
bge[array_map_setkey#]
immed[cur_key, 0]
br[array_map_setkey#]
.endif
alu[--, max_entries, -, cur_key]
bgt[array_map_setkey#]
immed[save_rc, CMSG_RC_ERR_E2BIG]
br[done#], defer[2]
alu[value_offset, key_offset, +,64]
alu[cmsg_reply_pktlen, cmsg_reply_pktlen, +, (64*2)]
array_map_setkey#:
alu[CMSG_KEY_LM_INDEX++, --, b, cur_key]
proc_loop_cont#:
alu[value_offset, key_offset, +, 64] ; value & key offset in cmsg
ov_single(OV_LENGTH, CMSG_TXFR_COUNT, OVF_SUBTRACT_ONE) // Length in 32-bit LWs
mem[read32_swap, $pkt_data[0], cmsg_addr_hi, <<8, value_offset, max_/**/CMSG_TXFR_COUNT], indirect_ref, sig_done[rd_sig]
ctx_arb[rd_sig]
aggregate_copy(CMSG_VALUE_LM_INDEX, ++, $pkt_data, 0, CMSG_TXFR_COUNT)
cmsg_lm_handles_undef()
do_op#:
swap(le_key, cur_key, NO_LOAD_CC)
_cmsg_hashmap_op(l_cmsg_type, cur_fd, lm_key_offset, lm_value_offset, cmsg_addr_hi, key_offset, value_offset, flags, rc, swap, le_key, cur_key)
/* check if reply required */
alu[--, cur_fd, -, SRIOV_TID]
beq[FREE_LABEL]
alu[key_offset, value_offset, +, 64]
alu[cmsg_reply_pktlen, cmsg_reply_pktlen, +, (64*2)]
alu[save_rc, save_rc, or, rc]
.if (rc == CMSG_RC_SUCCESS)
alu[rtn_count, 1, +, rtn_count]
.endif
alu[count, count, -, 1]
beq[done#]
.if (l_cmsg_type == CMSG_TYPE_MAP_GETFIRST)
immed[l_cmsg_type, CMSG_TYPE_MAP_GETNEXT]
.endif
.if (l_cmsg_type == CMSG_TYPE_MAP_GETNEXT)
.if (rc != CMSG_RC_SUCCESS)
br[done#]
.endif
br[do_op#], defer[1]
alu[value_offset, key_offset, +, 64]
.elif (l_cmsg_type == CMSG_TYPE_MAP_ARRAY_GETNEXT)
alu[cur_key, cur_key, +, 1]
alu[--, max_entries, -, cur_key]
beq[done#]
br[do_op#], defer[1]
alu[value_offset, key_offset, +, 64]
.endif
br[proc_loop#]
done#:
/* fill in header here */
cmsg_set_reply($reply[0], cmsg_type, cmsg_tag)
alu[$reply[1], --, b, save_rc]
alu[$reply[2], --, b, rtn_count]
immed[addr_lo, NFD_IN_DATA_OFFSET]
mem[write32, $reply[0], cmsg_addr_hi, <<8, addr_lo, 3], sig_done[sig_reply_map_ops]
alu[cmsg_reply_pktlen, cmsg_reply_pktlen, +, (4*4)]
ctx_arb[sig_reply_map_ops]
.end
cmsg_proc_ret#:
.end
#endm
#macro _cmsg_alloc_fd(key_sz, value_sz, max_entries, endian, map_type)
.begin
.reg fd
.reg $reply[3]
.xfer_order $reply
.sig sig_reply_map_alloc
.reg addr_lo
immed[$reply[1], CMSG_RC_ERR_MAP_FD] ; error
immed[fd, 0]
alu[$reply[2], --, b, fd] ; fd=0 error
cmsg_alloc_fd_from_bm(fd, cont#) ; skip alloc if no free slots
// driver will initialize arraymap
hashmap_alloc_fd(fd, key_sz, value_sz, max_entries, cont#, endian, map_type)
immed[$reply[1], CMSG_RC_SUCCESS] ; success
alu[$reply[2], --, b, fd]
cont#:
cmsg_set_reply($reply[0], CMSG_TYPE_MAP_ALLOC, cmsg_tag)
immed[addr_lo, NFD_IN_DATA_OFFSET]
mem[write32, $reply[0], cmsg_addr_hi, <<8, addr_lo, 3], sig_done[sig_reply_map_alloc]
immed[cmsg_reply_pktlen, (3<<2)]
ctx_arb[sig_reply_map_alloc]
ret#:
.end
#endm
#macro _cmsg_free_fd(in_fd)
.begin
.reg del_entries
.reg $reply[3]
.xfer_order $reply
.sig sig_reply_map_free
.reg addr_lo
.reg key_sz
.reg value_sz
.reg ent_state, ent_addr_hi, ent_offset, mu_partition, ent_index
.reg tbl_addr_hi, out_ent_lw
immed[del_entries, 0]
immed[$reply[1], CMSG_RC_ERR_MAP_FD] ;
cmsg_free_fd_from_bm(in_fd, ret#)
__hashmap_table_delete(in_fd) /* set num entries to 0 */
immed[ent_index, 0]
loop#:
__hashmap_lock_init(ent_state, ent_addr_hi, ent_offset, mu_partition, ent_index)
alu[tbl_addr_hi, --, b, ent_addr_hi]
__hashmap_lock_shared(ent_index, in_fd, cont#, cont#)
cont#:
/* check overflow first */
__hashmap_ov_getnext(tbl_addr_hi, ent_index, in_fd, ent_addr_hi, ent_offset, ent_state, del_ent#)
__hashmap_lock_release(ent_index, ent_state)
__hashmap_select_next_/**/HASHMAP_PARTITIONS/**/_partition(mu_partition,ent_index, end_loop#)
__hashmap_lock_init(ent_state, tbl_addr_hi, ent_offset, mu_partition, ent_index)
__hashmap_lock_shared(ent_index, in_fd, cont#, cont#)
alu[ent_addr_hi, --, b, tbl_addr_hi]
del_ent#:
__hashmap_lock_upgrade(ent_index, ent_state, loop#)
__hashmap_set_opt_field(out_ent_lw, 0)
br_bset[ent_state, __HASHMAP_DESC_OV_BIT, delete_ov_ent#]
__hashmap_lock_release_and_invalidate(ent_index, ent_state, in_fd)
alu[del_entries, 1, +, del_entries]
br[loop#]
delete_ov_ent#:
__hashmap_ov_delete(tbl_addr_hi, ent_index, ent_offset, ent_state)
__hashmap_lock_release(ent_index, ent_state)
alu[del_entries, 1, +, del_entries]
br[loop#]
end_loop#:
immed[$reply[1], CMSG_RC_SUCCESS]
ret#:
alu[$reply[2], --, b, del_entries]
cmsg_set_reply($reply[0], CMSG_TYPE_MAP_FREE, cmsg_tag)
immed[addr_lo, NFD_IN_DATA_OFFSET]
mem[write32, $reply[0], cmsg_addr_hi, <<8, addr_lo, 3], sig_done[sig_reply_map_free]
immed[cmsg_reply_pktlen, (3<<2)]
ctx_arb[sig_reply_map_free]
.end
#endm
#define_eval _CMSG_FLD_LW (CMSG_MAP_KEY_VALUE_LW)
#define_eval _CMSG_FLD_LW_MINUS_1 (_CMSG_FLD_LW - 1)
#macro _cmsg_hashmap_op(in_op, in_fd, in_lm_key, in_lm_value, in_addr_hi, in_key_offset, in_value_offset, in_flags, out_rc, endian, array_lekey, array_bekey)
.begin
.reg op
.sig sig_read_ent
.sig sig_reply_map_ops
.reg $ent_reply[_CMSG_FLD_LW]
.xfer_order $ent_reply
.sig sig_write_reply
.reg reply_lw
.reg error_value
.reg r_addr[2]
.reg ent_offset
.reg tmp
aggregate_directive(.set, $ent_reply, _CMSG_FLD_LW)
#define_eval __HASHMAP_OP__ (CMSG_TYPE_MAP_LOOKUP - HASHMAP_OP_LOOKUP)
.if (in_op == CMSG_TYPE_MAP_ARRAY_GETNEXT)
cmsg_lm_handles_define()
local_csr_wr[ACTIVE_LM_ADDR_/**/CMSG_KEY_LM_HANDLE, lm_key_offset]
immed[op, CMSG_TYPE_MAP_LOOKUP]
alu[$ent_reply[0], --, b, array_lekey]
mem[write32, $ent_reply[0], in_addr_hi, <<8, in_key_offset, 1], sig_done[sig_reply_map_ops]
alu[CMSG_KEY_LM_INDEX, --, b, array_bekey]
cmsg_lm_handles_undef()
ctx_arb[sig_reply_map_ops]
.else
alu[op, in_op, -, __HASHMAP_OP__]
.endif
#undef __HASHMAP_OP__
#define_eval MAX_JUMP (HASHMAP_OP_MAX + 1)
preproc_jump_targets(j, MAX_JUMP)
#ifdef _CMSG_LOOP
#error "_CMSG_LOOP is already defined" (_CMSG_LOOP)
#endif
#define_eval _CMSG_LOOP 0
jump[op, j0#], targets[PREPROC_LIST]
#while (_CMSG_LOOP < MAX_JUMP)
j/**/_CMSG_LOOP#:
br[s/**/_CMSG_LOOP#]
#define_eval _CMSG_LOOP (_CMSG_LOOP + 1)
#endloop
#undef _CMSG_LOOP
#undef MAX_JUMP
s0#:
s1#:
s2#:
br[error_map_function#], defer[1]
immed[out_rc, CMSG_RC_ERR_MAP_PARSE]
s/**/HASHMAP_OP_LOOKUP#:
hashmap_ops(in_fd, in_lm_key, --, HASHMAP_OP_LOOKUP, error_map_fd#, not_found#,HASHMAP_RTN_ADDR,reply_lw, --, r_addr, endian, out_rc)
alu[--, reply_lw, -, 0] ;error if 0
bne[reply_value#]
br[error_map_function#], defer[1]
immed[out_rc, CMSG_RC_ERR_MAP_ERR]
s/**/HASHMAP_OP_ADD_ANY#:
hashmap_ops(in_fd, in_lm_key, in_lm_value, HASHMAP_OP_ADD_ANY, error_map_fd#, not_found#,HASHMAP_RTN_ADDR,reply_lw, --, --, endian, out_rc)
br[ret#]
s/**/HASHMAP_OP_UPDATE#:
hashmap_ops(in_fd, in_lm_key, in_lm_value, HASHMAP_OP_UPDATE, error_map_fd#, not_found#,HASHMAP_RTN_ADDR,reply_lw, --, --, endian, out_rc)
br[ret#]
s/**/HASHMAP_OP_ADD_ONLY#:
hashmap_ops(in_fd, in_lm_key, in_lm_value, HASHMAP_OP_ADD_ONLY, error_map_fd#, not_found#,HASHMAP_RTN_ADDR,reply_lw, --, --, endian, out_rc)
br[ret#]
s/**/HASHMAP_OP_REMOVE#:
hashmap_ops(in_fd, in_lm_key, in_lm_value, HASHMAP_OP_REMOVE, error_map_fd#, not_found#,HASHMAP_RTN_ADDR,reply_lw, --, r_addr, endian, out_rc)
br[ret#]
s/**/HASHMAP_OP_GETNEXT#:
hashmap_ops(in_fd, in_lm_key, in_lm_value, HASHMAP_OP_GETNEXT, error_map_fd#, not_found#,HASHMAP_RTN_ADDR,reply_lw, --, r_addr, endian, out_rc)
alu[--, reply_lw, -, 0] ;error if 0
bne[reply_keys#]
br[error_map_function#], defer[1]
immed[out_rc, CMSG_RC_ERR_MAP_ERR]
s/**/HASHMAP_OP_GETFIRST#:
#pragma warning(push)
#pragma warning(disable: 4702) // disable warning "unreachable code"
hashmap_ops(in_fd, in_lm_key, in_lm_value, HASHMAP_OP_GETFIRST, error_map_fd#, not_found#,HASHMAP_RTN_ADDR,reply_lw, --, r_addr, endian, out_rc)
alu[--, reply_lw, -, 0] ;error if 0
bne[reply_keys#]
br[error_map_function#], defer[1]
immed[out_rc, CMSG_RC_ERR_MAP_ERR]
#pragma warning(pop)
error_map_fd#:
br[error_map_function#], defer[1]
immed[out_rc, CMSG_RC_ERR_MAP_FD]
not_found#:
br[error_map_function#], defer[1]
immed[out_rc, CMSG_RC_ERR_MAP_NOENT]
error_map_function#:
.if (out_rc == CMSG_RC_ERR_EEXIST)
immed[out_rc, CMSG_RC_ERR_MAP_EXIST]
.elif (out_rc == CMSG_RC_ERR_ENOMEM)
immed[out_rc, CMSG_RC_ERR_NOMEM]
.endif
move(error_value, 0xffff0000)
alu[$ent_reply[0], error_value, or, out_rc]
alu[ent_offset, in_key_offset, +, (15*4)] ; write FFs and rc to last 1 words of key
mem[write32, $ent_reply[0], in_addr_hi, <<8, ent_offset, 1], sig_done[sig_reply_map_ops]
ctx_arb[sig_reply_map_ops], br[ret#]
reply_keys#:
alu[--, reply_lw, -, 0]
beq[error_map_function#], defer[1]
immed[out_rc, CMSG_RC_ERR_MAP_ERR]
ov_start(OV_LENGTH)
ov_set_use(OV_LENGTH, reply_lw, OVF_SUBTRACT_ONE) ; length is in 32-bit LWs
ov_clean
mem[read32, $ent_reply[0], r_addr[0], <<8, r_addr[1], max_/**/_CMSG_FLD_LW], indirect_ref, sig_done[sig_read_ent]
aggregate_zero($ent_reply, _CMSG_FLD_LW)
ctx_arb[sig_read_ent]
unroll_copy($ent_reply, 0, $ent_reply, 0, reply_lw, _CMSG_FLD_LW, --)
ov_single(OV_LENGTH, _CMSG_FLD_LW, OVF_SUBTRACT_ONE)
mem[write32, $ent_reply[0], in_addr_hi, <<8, in_key_offset, max_/**/_CMSG_FLD_LW], indirect_ref, sig_done[sig_reply_map_ops]
/* copy keys to LM for getnext & getfirst */
cmsg_lm_handles_define()
local_csr_wr[ACTIVE_LM_ADDR_/**/CMSG_KEY_LM_HANDLE, lm_key_offset]
nop
nop
nop
aggregate_copy(CMSG_KEY_LM_INDEX, ++, $ent_reply, 0, _CMSG_FLD_LW_MINUS_1)
cmsg_lm_handles_undef()
alu[tmp, --, b, reply_lw, <<2]
__hashmap_calc_value_addr(r_addr[1], tmp, r_addr[1])
alu[reply_lw, 16, -, reply_lw]
ctx_arb[sig_reply_map_ops] ; falls thru
reply_value#:
alu[--, reply_lw, -, 0]
beq[error_map_function#], defer[1]
immed[out_rc, CMSG_RC_ERR_MAP_ERR]
ov_start(OV_LENGTH)
ov_set_use(OV_LENGTH, reply_lw, OVF_SUBTRACT_ONE) ; length is in 32-bit LWs
ov_clean
mem[read32, $ent_reply[0], r_addr[0], <<8, r_addr[1], max_/**/_CMSG_FLD_LW], indirect_ref, sig_done[sig_read_ent]
aggregate_zero($ent_reply, _CMSG_FLD_LW)
ctx_arb[sig_read_ent]
unroll_copy($ent_reply, 0, $ent_reply, 0, reply_lw, _CMSG_FLD_LW, --)
ov_single(OV_LENGTH, _CMSG_FLD_LW, OVF_SUBTRACT_ONE)
mem[write32, $ent_reply[0], in_addr_hi, <<8, in_value_offset, max_/**/_CMSG_FLD_LW], indirect_ref, sig_done[sig_reply_map_ops]
immed[out_rc, CMSG_RC_SUCCESS]
ctx_arb[sig_reply_map_ops]
ret#:
.end
#endm
/*
* This macro is currently not used. Driver initializes arraymap
* init array map entries
* array maps: key_size = 4, key = 0..max_entries-1
* value_size must be zeroed
* TABLE_OP = INIT or CLEANUP
*/
#macro _cmsg_arraymap_table_op(in_fd, in_num_entries, SUCCESS_LABEL, TABLE_OP)
.begin
.reg lm_key_offset
.reg lm_value_offset
.reg ctx_num
.reg array_ndx
.reg reply_lw
//.reg le_key
local_csr_rd[ACTIVE_CTX_STS]
immed[ctx_num, 0]
alu[ctx_num, ctx_num, and, 7]
cmsg_lm_ctx_addr(lm_key_offset, lm_value_offset, ctx_num)
cmsg_lm_handles_define()
local_csr_wr[ACTIVE_LM_ADDR_/**/CMSG_VALUE_LM_HANDLE, lm_value_offset]
immed[array_ndx, 0]
nop
nop
aggregate_zero(CMSG_VALUE_LM_INDEX, CMSG_TXFR_COUNT)
init_loop#:
local_csr_wr[ACTIVE_LM_ADDR_/**/CMSG_KEY_LM_HANDLE, lm_key_offset]
nop
swap(le_key, array_ndx, NO_LOAD_CC)
alu[CMSG_KEY_LM_INDEX++, --, b, le_key]
cmsg_lm_handles_undef()
#if (streq('TABLE_OP', 'INIT'))
hashmap_ops(in_fd, lm_key_offset, lm_value_offset, HASHMAP_OP_ADD_ANY, error_rtn#, error_rtn#, HASHMAP_RTN_ADDR, reply_lw, --, --, be)
#else
hashmap_ops(in_fd, lm_key_offset, lm_value_offset, HASHMAP_OP_REMOVE, error_rtn#, error_rtn#, HASHMAP_RTN_ADDR, reply_lw, --, --, be)
#endif
alu[--, reply_lw, -, 0]
bne[error_rtn#]
alu[array_ndx, 1, +, array_ndx]
alu[--, in_num_entries, -, array_ndx]
bne[init_loop#]
br[SUCCESS_LABEL]
error_rtn#:
.end
#endm
#endif
| UnrealScript | 5 | pcasconnetronome/nic-firmware | firmware/apps/nic/maps/cmsg_map.uc | [
"BSD-2-Clause"
] |
"Conversaciones con Juan" by Xavi (in spanish)
The story headline is "Hablar por hablar".
Include Basic Screen Effects SP by Emily Short.
Include Quip-Based Conversation SP by Michael Martin.
Use no scoring and no deprecated features.
Chapter 1 - The Setup
When play begins, say "¡Habla con Juan!"
Bar is a room. "Estás en el bar."
Juan is a man in Bar. The description is "Aquí está tu colega Juan." The litany of Juan is the Table of Juan Comments.
The greeting of yourself is selftalk.
Casting Xyzzy is an action applying to nothing. Understand "xyzzy" as casting xyzzy. Carry out casting xyzzy: deliver the xyzzy quip; run a conversation on the Table of Magic Followups.
Chapter 2 - The Script
Section 1 - The Text
Table of Quip Texts (continued)
quip quiptext
selftalk "Hablar contigo no es particularmente divertido."
who-am-i "'Mal. Inform me odia.'"
why-hate "'Intento compilar pero me salen 40 errores.'"
yay-inform "'¿Has hecho un tutorial? ¡Voy a leerlo!"
hate-you "'¡Te odio!'[paragraph break] Juan te mata."
hate-you-2 "'¡Te odio!'[paragraph break] Juan te mata.."
hate-you-3 "'¡Te odio!'[paragraph break] Juan te mata."
hate-pedants "'¡Odio a los pedantes como tú!'[paragraph break] Juan te mata."
yay-monkeys "'Claro que me gustan los monos.'"
yay-you "'¡Ahora somos realmente amigos!'"
say-nothing "Te quedas callado."
ehn-apes "'Los gorilas molan, claro que sí.'"
ehn-lemurs "'No tengo una opinión formada sobre los lemures.'"
xyzzy "¿Cuál es la otra palabra mágica?"
Table of Juan Comments
prompt response enabled
"¿Qué tal, Juan?" who-am-i 1
"¿Porqué te odia Inform?" why-hate 0
"Ahá... ¿has leído mi tutorial?" yay-inform 0
"No me extraña..." hate-you 0
"Ja ja ja, ¡Inform te odia!" hate-you-2 0
"Hey, ¿te gustan los monos?" yay-monkeys 1
"¡Solo a los locos les gustan!" hate-you-3 0
"Pensaba que sabías más sobre simios." hate-pedants 0
"A mí también me gustan." yay-you 0
"Mejor me callo." say-nothing 1
Table of Quip Followups (continued)
quip option result
yay-monkeys "¿Y los gorilas?" ehn-apes
yay-monkeys "¿Y los lemures?" ehn-lemurs
Table of Magic Followups
prompt response enabled
"PLUGH" yay-you 1
"Hay al menos dos más, ¿cuál de ellas?" hate-pedants 1
Section 2 - Dialogue affects itself
After quipping when the current quip is who-am-i:
enable the why-hate quip;
enable the hate-you quip.
After quipping when the current quip is why-hate:
disable the hate-you quip;
enable the hate-you-2 quip;
enable the yay-inform quip.
After quipping when the current quip is yay-monkeys:
disable the who-am-i quip;
enable the hate-you-3 quip;
enable the hate-pedants quip;
enable the yay-you quip.
After quipping when the current quip is say-nothing:
enable the say-nothing quip;
terminate the conversation.
Section 3 - Dialogue affects the game
After quipping when the current quip is hate-you: end the story saying "Estás muerto".
After quipping when the current quip is hate-you-2: end the story saying "Estás muerto".
After quipping when the current quip is hate-you-3: end the story saying "Estás muerto".
After quipping when the current quip is hate-pedants: end the story saying "Estás muerto".
After quipping when the current quip is yay-inform: end the story finally saying "Has ganado".
After quipping when the current quip is yay-you: end the story finally saying "Has ganado".
| Inform 7 | 3 | brtl-fhc/I7-Spanish | EJEMPLOS/XaviTutorial/Cap05_C.ni | [
"Artistic-2.0"
] |
<template name="oembedBaseWidget">
{{> Template.dynamic template=template }}
</template> | HTML | 4 | subramanir2143/Rocket.Chat | app/oembed/client/baseWidget.html | [
"MIT"
] |
D:/gitee/tmp/tinyriscv/tests/riscv-compliance/build_generated/rv32Zicsr/I-CSRRSI-01.elf: file format elf32-littleriscv
Disassembly of section .text.init:
00000000 <_start>:
0: 04c0006f j 4c <reset_vector>
00000004 <trap_vector>:
4: 34202f73 csrr t5,mcause
8: 00800f93 li t6,8
c: 03ff0a63 beq t5,t6,40 <write_tohost>
10: 00900f93 li t6,9
14: 03ff0663 beq t5,t6,40 <write_tohost>
18: 00b00f93 li t6,11
1c: 03ff0263 beq t5,t6,40 <write_tohost>
20: 00000f17 auipc t5,0x0
24: fe0f0f13 addi t5,t5,-32 # 0 <_start>
28: 000f0463 beqz t5,30 <trap_vector+0x2c>
2c: 000f0067 jr t5
30: 34202f73 csrr t5,mcause
34: 000f5463 bgez t5,3c <handle_exception>
38: 0040006f j 3c <handle_exception>
0000003c <handle_exception>:
3c: 5391e193 ori gp,gp,1337
00000040 <write_tohost>:
40: 00001f17 auipc t5,0x1
44: fc3f2023 sw gp,-64(t5) # 1000 <tohost>
48: ff9ff06f j 40 <write_tohost>
0000004c <reset_vector>:
4c: 00000193 li gp,0
50: 00000297 auipc t0,0x0
54: fb428293 addi t0,t0,-76 # 4 <trap_vector>
58: 30529073 csrw mtvec,t0
5c: 30005073 csrwi mstatus,0
60: 00000297 auipc t0,0x0
64: 02028293 addi t0,t0,32 # 80 <begin_testcode>
68: 34129073 csrw mepc,t0
6c: 00000293 li t0,0
70: 10000337 lui t1,0x10000
74: 01030313 addi t1,t1,16 # 10000010 <_end+0xfffde0c>
78: 00532023 sw t0,0(t1)
7c: 30200073 mret
00000080 <begin_testcode>:
80: 00002797 auipc a5,0x2
84: f8078793 addi a5,a5,-128 # 2000 <begin_signature>
88: 34001073 csrw mscratch,zero
8c: 3400e0f3 csrrsi ra,mscratch,1
90: 340010f3 csrrw ra,mscratch,zero
94: 34006173 csrrsi sp,mscratch,0
98: 34001173 csrrw sp,mscratch,zero
9c: 340fe1f3 csrrsi gp,mscratch,31
a0: 340011f3 csrrw gp,mscratch,zero
a4: 34086273 csrrsi tp,mscratch,16
a8: 34001273 csrrw tp,mscratch,zero
ac: 3407e2f3 csrrsi t0,mscratch,15
b0: 340012f3 csrrw t0,mscratch,zero
b4: 0007a023 sw zero,0(a5)
b8: 0017a223 sw ra,4(a5)
bc: 0027a423 sw sp,8(a5)
c0: 0037a623 sw gp,12(a5)
c4: 0047a823 sw tp,16(a5)
c8: 0057aa23 sw t0,20(a5)
cc: 00002297 auipc t0,0x2
d0: f4c28293 addi t0,t0,-180 # 2018 <test_A2_res>
d4: 34001073 csrw mscratch,zero
d8: 3400e5f3 csrrsi a1,mscratch,1
dc: 34006673 csrrsi a2,mscratch,0
e0: 340fe6f3 csrrsi a3,mscratch,31
e4: 34086773 csrrsi a4,mscratch,16
e8: 3407e7f3 csrrsi a5,mscratch,15
ec: 34006873 csrrsi a6,mscratch,0
f0: 0002a023 sw zero,0(t0)
f4: 00b2a223 sw a1,4(t0)
f8: 00c2a423 sw a2,8(t0)
fc: 00d2a623 sw a3,12(t0)
100: 00e2a823 sw a4,16(t0)
104: 00f2aa23 sw a5,20(t0)
108: 0102ac23 sw a6,24(t0)
10c: 00002097 auipc ra,0x2
110: f2808093 addi ra,ra,-216 # 2034 <test_B_res>
114: 32165a37 lui s4,0x32165
118: 498a0a13 addi s4,s4,1176 # 32165498 <_end+0x32163294>
11c: 340a1073 csrw mscratch,s4
120: 3407e073 csrsi mscratch,15
124: 340a1af3 csrrw s5,mscratch,s4
128: 0000a023 sw zero,0(ra)
12c: 0150a223 sw s5,4(ra)
130: 0140a423 sw s4,8(ra)
134: 00002297 auipc t0,0x2
138: ecc28293 addi t0,t0,-308 # 2000 <begin_signature>
13c: 10000337 lui t1,0x10000
140: 00830313 addi t1,t1,8 # 10000008 <_end+0xfffde04>
144: 00532023 sw t0,0(t1)
148: 00002297 auipc t0,0x2
14c: ef828293 addi t0,t0,-264 # 2040 <end_signature>
150: 10000337 lui t1,0x10000
154: 00c30313 addi t1,t1,12 # 1000000c <_end+0xfffde08>
158: 00532023 sw t0,0(t1)
15c: 00100293 li t0,1
160: 10000337 lui t1,0x10000
164: 01030313 addi t1,t1,16 # 10000010 <_end+0xfffde0c>
168: 00532023 sw t0,0(t1)
16c: 00000013 nop
170: 00100193 li gp,1
174: 00000073 ecall
00000178 <end_testcode>:
178: c0001073 unimp
...
Disassembly of section .tohost:
00001000 <tohost>:
...
00001100 <fromhost>:
...
Disassembly of section .data:
00002000 <begin_signature>:
2000: ffff 0xffff
2002: ffff 0xffff
2004: ffff 0xffff
2006: ffff 0xffff
2008: ffff 0xffff
200a: ffff 0xffff
200c: ffff 0xffff
200e: ffff 0xffff
2010: ffff 0xffff
2012: ffff 0xffff
2014: ffff 0xffff
2016: ffff 0xffff
00002018 <test_A2_res>:
2018: ffff 0xffff
201a: ffff 0xffff
201c: ffff 0xffff
201e: ffff 0xffff
2020: ffff 0xffff
2022: ffff 0xffff
2024: ffff 0xffff
2026: ffff 0xffff
2028: ffff 0xffff
202a: ffff 0xffff
202c: ffff 0xffff
202e: ffff 0xffff
2030: ffff 0xffff
2032: ffff 0xffff
00002034 <test_B_res>:
2034: ffff 0xffff
2036: ffff 0xffff
2038: ffff 0xffff
203a: ffff 0xffff
203c: ffff 0xffff
203e: ffff 0xffff
00002040 <end_signature>:
...
00002100 <begin_regstate>:
2100: 0080 addi s0,sp,64
...
00002200 <end_regstate>:
2200: 0004 0x4
...
| ObjDump | 3 | DuBirdFly/TinyRISCV_Learn | tests/riscv-compliance/build_generated/rv32Zicsr/I-CSRRSI-01.elf.objdump | [
"Apache-2.0"
] |
*** Test Cases ***
If passing
IF True
Log reached this
END
If failing
[Documentation] FAIL failing inside if
IF '1' == '1'
Fail failing inside if
END
If not executed
IF False
Fail should not go here
END
If not executed failing
[Documentation] FAIL after not passing
IF 'a' == 'b'
Pass Execution should go here
END
Fail after not passing
If else - if executed
IF 1 > 0
Log does go through here
ELSE
Fail should not go here
END
If else - else executed
IF 0 > 1
Fail should not go here
ELSE
Log does go through here
END
If else - if executed - failing
[Documentation] FAIL expected
IF 1 > 0
Fail expected
ELSE
Log unexpected
END
If else - else executed - failing
[Documentation] FAIL expected
IF 0 > 1
Log unexpected
ELSE
Fail expected
END
If passing in keyword
Passing if keyword
If passing in else keyword
Passing else keyword
If failing in keyword
[Documentation] FAIL expected
Failing if keyword
If failing in else keyword
[Documentation] FAIL expected
Failing else keyword
*** Keywords ***
Passing if keyword
IF ${1}
Log expected
ELSE IF 12 < 14
Fail should not go here
ELSE
Fail not here
END
Passing else keyword
IF ${False}
Fail not here
ELSE
Log expected
END
Failing if keyword
IF ${1}
Fail expected
ELSE IF 12 < 14
Log should not go here
ELSE
Log not here
END
Failing else keyword
IF ${False}
Log should not here
ELSE
Fail expected
END
| RobotFramework | 4 | rdagum/robotframework | atest/testdata/running/if/if_else.robot | [
"ECL-2.0",
"Apache-2.0"
] |
// Copyright (c) 2015, XMOS Ltd, All rights reserved
#include "i2c.h"
#include "xs1.h"
#include "debug_print.h"
enum i2c_slave_state {
WAITING_FOR_START_OR_STOP,
READING_ADDR,
ACK_ADDR,
MASTER_WRITE,
MASTER_READ
};
[[combinable]]
void i2c_slave(client i2c_slave_callback_if i,
port p_scl, port p_sda,
uint8_t device_addr)
{
enum i2c_slave_state state = WAITING_FOR_START_OR_STOP;
int sda_val = 0;
int scl_val;
int bitnum = 0;
int data;
int rw = 0;
int stop_bit_check = 0;
int ignore_stop_bit = 1;
p_sda when pinseq(1) :> void;
while (1) {
select {
case i.shutdown():
return;
case state != WAITING_FOR_START_OR_STOP => p_scl when pinseq(scl_val) :> void:
switch (state) {
case READING_ADDR:
// If clock has gone low, wait for it to go high before doing anything
if (scl_val == 0) {
scl_val = 1;
break;
}
int bit;
p_sda :> bit;
if (bitnum < 7) {
data = (data << 1) | bit;
bitnum++;
scl_val = 0;
break;
}
// We have gathered the whole device address sent by the master.
if (data != device_addr) {
// No match, just wait for the next start bit.
state = WAITING_FOR_START_OR_STOP;
sda_val = 0;
break;;
}
state = ACK_ADDR;
scl_val = 0;
rw = bit;
break;
case ACK_ADDR:
int ack;
p_scl <: 0;
// Callback to the application to determine whether to ACK
// or NACK the address.
if (rw) {
i.start_write_request();
ack = i.ack_write_request();
} else {
i.start_read_request();
ack = i.ack_read_request();
}
ignore_stop_bit = 0;
if (ack == I2C_SLAVE_NACK) {
p_sda :> void;
state = WAITING_FOR_START_OR_STOP;
sda_val = 0;
} else if (rw) {
p_sda <: 0;
state = MASTER_WRITE;
data = 0;
scl_val = 1;
bitnum = 0;
} else {
p_sda <: 0;
state = MASTER_READ;
scl_val = 1;
bitnum = 0;
}
p_scl :> void;
break;
case MASTER_READ:
if (scl_val == 1 && bitnum == 9) {
int bit;
p_sda :> bit;
if (bit) {
// Master has NACKed so the transaction is finished
state = WAITING_FOR_START_OR_STOP;
sda_val = 0;
} else {
bitnum = 0;
scl_val = 0;
}
} else if (scl_val == 1) {
scl_val = 0;
} else {
if (bitnum < 8) {
if (bitnum == 0) {
p_scl <: 0;
i.start_master_read();
data = i.master_requires_data();
p_scl :> void;
}
int bit = data >> 7;
p_sda <: data >> 7;
data <<= 1;
} else {
p_sda :> void;
}
bitnum++;
scl_val = 1;
}
break;
case MASTER_WRITE:
if (scl_val == 1) {
int bit;
if (bitnum == 0) {
scl_val = 0;
} else if (bitnum == 9) {
state = WAITING_FOR_START_OR_STOP;
p_sda :> sda_val;
sda_val = 1-sda_val;
} else {
p_sda :> bit;
data = (data << 1) | bit;
if (bit == 0) {
sda_val = 1;
stop_bit_check = 1;
}
}
scl_val = 0;
bitnum++;
} else if (bitnum == 9) {
p_scl <: 0;
stop_bit_check = 0;
i.start_master_write();
int ack = i.master_sent_data(data);
if (ack == I2C_SLAVE_NACK) {
p_sda :> void;
} else {
p_sda <: 0;
data = 0;
bitnum = 0;
}
scl_val = 1;
p_scl :> void;
} else {
stop_bit_check = 0;
p_sda :> void;
scl_val = 1;
}
break;
}
break;
case (state == WAITING_FOR_START_OR_STOP) || stop_bit_check =>
p_sda when pinseq(sda_val) :> void:
// debug_printf("%d\n", sda_val);
if (sda_val == 1) {
// SDA has transitioned from low to high, if SCL is high
// then it is a stop bit.
int val;
p_scl :> val;
if (val) {
if (!ignore_stop_bit)
i.stop_bit();
state = WAITING_FOR_START_OR_STOP;
ignore_stop_bit = 1;
sda_val = 0;
} else {
sda_val = 0;
}
} else {
// SDA has transitioned from high to low, if SCL is high
// then it is a start bit.
int val;
p_scl :> val;
if (val == 1) {
state = READING_ADDR;
bitnum = 0;
data = 0;
scl_val = 0;
stop_bit_check = 0;
} else {
sda_val = 1;
}
}
break;
}
}
} | XC | 4 | smola/language-dataset | data/github.com/sncn-hub/imu_demo/988975866194bf46d9396e5f1931ee10c842596c/lib_i2c/src/i2c_slave.xc | [
"MIT"
] |
rotate(a=45, v=[1,1,0]) {
cube(size=[10, 10, 10], center=false);
} | OpenSCAD | 3 | heristhesiya/OpenJSCAD.org | packages/io/scad-deserializer/tests/transformations/rotateEx2.scad | [
"MIT"
] |
BEGIN {
FS = "\t";
}
# Skip commented line starting with # or //
/^(#|\/\/)/ {next}
function ltsv(key) {
for (i = 1; i <= NF; i++) {
match($i, ":");
xs[substr($i, 0, RSTART)] = substr($i, RSTART+1);
};
return xs[key":"];
}
| Awk | 4 | d3dave/enhancd | functions/enhancd/lib/ltsv.awk | [
"MIT"
] |
exec("swigtest.start", -1);
try
foo = new_Foo();
catch
swigtesterror();
end
checkequal(Foo_x_get(foo), 0, "Foo_x_get()");
checkequal(Foo_y_get(foo), 0, "Foo_y_get()");
checkequal(Foo_z_get(foo), 0, "Foo_y_get()");
checkequal(Foo_f_get(foo), 0, "Foo_f_get()");
checkequal(Foo_seq_get(foo), 0, "Foo_seq_get()");
try
Foo_x_set(foo, 5);
catch
swigtesterror();
end
checkequal(Foo_x_get(foo), 5, "Foo_x_get()");
try
Foo_y_set(foo, 5);
catch
swigtesterror();
end
checkequal(Foo_y_get(foo), 5, "Foo_y_get()");
try
Foo_f_set(foo, 1);
catch
swigtesterror();
end
checkequal(Foo_f_get(foo), 1, "Foo_f_get()");
try
Foo_z_set(foo, 13);
catch
swigtesterror();
end
checkequal(Foo_z_get(foo), 13, "Foo_z_get()");
try
Foo_seq_set(foo, 3);
catch
swigtesterror();
end
checkequal(Foo_seq_get(foo), 3, "Foo_seq_get()");
try
delete_Foo(foo);
catch
swigtesterror();
end
exec("swigtest.quit", -1);
| Scilab | 3 | kyletanyag/LL-Smartcard | cacreader/swig-4.0.2/Examples/test-suite/scilab/anonymous_bitfield_runme.sci | [
"BSD-3-Clause"
] |
doc("this is a doc for goodbye")
void goodbye() {
}
doc("this is a *doc* for _hello_ world
* a list
* with bullets
# And a header #
with text below
> a simple quote with `some code inside`
public class Foo {
hello();
}
[Ceylon-IDEA](https://github.com/ceylon/ceylon-ide-intellij) is great.
" )
throws(`class Exception`)
shared void helloAgain() {
print("Hello, beautiful world!");
}
doc("this is a doc for MyClass")
see(`class Integer`)
throws(`class Exception`, "sometimes")
class MyClass() {
}
doc("this is an interface")
by("Bastien")
interface MyInterface {
}
//"this is a declaration without definition"
//by("Bastien")
//class MyClassDeclaration; | Ceylon | 3 | Kopilov/ceylon-ide-intellij | testdata/CeylonTest/src/MultiDeclarations.ceylon | [
"Apache-2.0"
] |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Test configs for range."""
import tensorflow.compat.v1 as tf
from tensorflow.lite.testing.zip_test_utils import create_scalar_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
from tensorflow.lite.testing.zip_test_utils import register_make_test_function
@register_make_test_function()
def make_range_tests(options):
"""Make a set of tests to do range."""
test_parameters = [{
"dtype": [tf.int32, tf.float32],
"offset": [10, 100, 1000, 0],
"delta": [1, 2, 3, 4, -1, -2, -3, -4],
}]
def build_graph(parameters):
"""Build the range op testing graph."""
input_tensor = tf.compat.v1.placeholder(
dtype=parameters["dtype"], name=("start"), shape=[])
if parameters["delta"] < 0:
offset = parameters["offset"] * -1
else:
offset = parameters["offset"]
delta = parameters["delta"]
limit_tensor = input_tensor + offset
delta_tensor = tf.constant(delta, dtype=parameters["dtype"])
out = tf.range(input_tensor, limit_tensor, delta_tensor)
return [input_tensor], [out]
def build_inputs(parameters, sess, inputs, outputs):
input_value = create_scalar_data(parameters["dtype"])
return [input_value], sess.run(
outputs, feed_dict=dict(zip(inputs, [input_value])))
make_zip_of_tests(options, test_parameters, build_graph, build_inputs)
| Python | 5 | EricRemmerswaal/tensorflow | tensorflow/lite/testing/op_tests/range.py | [
"Apache-2.0"
] |
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Logger, LogLevel} from './logger';
const RESET = '\x1b[0m';
const RED = '\x1b[31m';
const YELLOW = '\x1b[33m';
const BLUE = '\x1b[36m';
export const DEBUG = `${BLUE}Debug:${RESET}`;
export const WARN = `${YELLOW}Warning:${RESET}`;
export const ERROR = `${RED}Error:${RESET}`;
/**
* A simple logger that outputs directly to the Console.
*
* The log messages can be filtered based on severity via the `logLevel`
* constructor parameter.
*/
export class ConsoleLogger implements Logger {
constructor(public level: LogLevel) {}
debug(...args: string[]) {
if (this.level <= LogLevel.debug) console.debug(DEBUG, ...args);
}
info(...args: string[]) {
if (this.level <= LogLevel.info) console.info(...args);
}
warn(...args: string[]) {
if (this.level <= LogLevel.warn) console.warn(WARN, ...args);
}
error(...args: string[]) {
if (this.level <= LogLevel.error) console.error(ERROR, ...args);
}
}
| TypeScript | 5 | raghavendramohan/angular | packages/compiler-cli/src/ngtsc/logging/src/console_logger.ts | [
"MIT"
] |
if(__caffe2_allowlist_included)
return()
endif()
set(__caffe2_allowlist_included TRUE)
set(CAFFE2_ALLOWLISTED_FILES)
if(NOT CAFFE2_ALLOWLIST)
return()
endif()
# First read the allowlist file and break it by line.
file(READ "${CAFFE2_ALLOWLIST}" allowlist_content)
# Convert file contents into a CMake list
string(REGEX REPLACE "\n" ";" allowlist_content ${allowlist_content})
foreach(item ${allowlist_content})
file(GLOB_RECURSE tmp ${item})
set(CAFFE2_ALLOWLISTED_FILES ${CAFFE2_ALLOWLISTED_FILES} ${tmp})
endforeach()
macro(caffe2_do_allowlist output allowlist)
set(_tmp)
foreach(item ${${output}})
list(FIND ${allowlist} ${item} _index)
if(${_index} GREATER -1)
set(_tmp ${_tmp} ${item})
endif()
endforeach()
set(${output} ${_tmp})
endmacro()
| CMake | 4 | Hacky-DH/pytorch | cmake/Allowlist.cmake | [
"Intel"
] |
@import "mystyle.css";
@import url("mystyle.css");
@import url("bluish.css") projection, tv;
@base: #f938ab;
.box-shadow(@style, @c) when (iscolor(@c)) {
border-radius: @style @c;
}
.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) {
.box-shadow(@style, rgba(0, 0, 0, @alpha));
}
.box {
color: saturate(@base, 5%);
border-color: lighten(@base, 30%);
div {
.box-shadow((0 0 5px), 30%);
}
}
#header {
h1 {
font-size: 26px;
font-weight: bold;
}
p { font-size: 12px;
a { text-decoration: none;
&:hover { border-width: 1px }
}
}
}
@the-border: 1px;
@base-color: #111;
@red: #842210;
#header {
color: (@base-color * 3);
border-left: @the-border;
border-right: (@the-border * 2);
}
#footer {
color: (@base-color + #003300);
border-color: desaturate(@red, 10%);
}
| Less | 4 | sbj42/vscode | extensions/vscode-colorize-tests/test/colorize-fixtures/test.less | [
"MIT"
] |
-- @shouldFailWith NoInstanceFound
module Main where
import Prim.Coerce (class Coercible)
import Safe.Coerce (coerce)
data D a = D a
newtype N a = N (D (N a))
nonCanonicalSameTyVarEq :: forall a. Coercible a (D a) => a -> N a
nonCanonicalSameTyVarEq = coerce
| PureScript | 4 | andys8/purescript | tests/purs/failing/CoercibleNonCanonical1.purs | [
"BSD-3-Clause"
] |
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
msgid "foo"
msgstr "bar"
msgid "bar"
msgstr "foo"
# Comment 1
# Comment 2
#, fuzzy,another
#: src/file_1 src/file_2:50
msgid "foo_bar"
msgstr "foobar"
# Comment
#, fuzzy
#: src/file_1
msgid "bar_foo"
msgstr "barfoo"
| Gettext Catalog | 3 | simonberger/symfony | src/Symfony/Component/Translation/Tests/fixtures/resources.po | [
"MIT"
] |
root = (window ? global).Templating = {}
viewMarkup = {}
replacements =
'<': '<'
'>': '>'
'&': '&'
escapeHtml = (str)->
if typeof str == 'string' then str.replace /[<>&]/g, (c)-> replacements[c]
else str
shadowCount = 0
rendering = false
Important: this does not remove old ids, yet, from data-view-ids on updates
createTemplateRenderer = (type, template, shadow, cont)->
comp = Handlebars.compile template
viewMarkup[type] = (data, target, preserveContents, block, update, link)->
updateAttr = if block then " data-view-type='#{type}'" else ""
updateAttr += " data-view='true'"
if block then updateAttr = "#{updateAttr} data-view-block='#{block._id}'"
if target
for node in target
try
oldRendering = rendering
if !rendering
rendering = true
shadowCount = 0
oldData = Templating.currentViewData
oldViewLink = Templating.currentViewLink
oldView = Templating.currentView
oldInputCount = Templating.currentInputCount
Templating.currentViewData = data
Templating.currentViewLink = node
Templating.currentInputCount = 0
html = "<span class='view'#{updateAttr}>#{comp data}</span>"
el = if update
node.innerHTML = comp data
Templating.currentViewLink = link
numberInputs node
el = node
node = node.parentNode
el
else if shadow
n = $(node)
if !preserveContents
n.append "<span class='hidden'>#{escapeHtml n.text()}</span>"
el = setShadowHtml node, html, true
numberInputs el
el
else
clearView node
content = createFragment(html).firstChild
root.nonOrg content
node.appendChild content
Templating.currentView = el
if block then addBlockInfo Templating.currentViewLink, block, el
activateScripts viewRoots node
if cont then cont(data, target, block, update)
finally
Templating.currentViewData = oldData
Templating.currentViewLink = oldViewLink
Templating.currentView = oldView
Templating.currentInputCount = oldInputCount
rendering = oldRendering
else if block
addBlockInfo Templating.currentViewLink, block
"<span#{updateAttr}>#{comp data}</span>"
else comp data
createFragment = (txt)->
scratch = document.createElement 'DIV'
scratch.innerHTML = txt
frag = document.createDocumentFragment()
while scratch.firstChild
frag.appendChild scratch.firstChild
frag
addBlockInfo = (el, block, view)->
addId el, block._id
for node in $(view).find "[data-org-index]"
addIndex el, node.getAttribute 'data-org-index'
addId = (el, id)->
for node in $(el).not("[data-view-ids~=#{id}]")
old = node.getAttribute('data-view-ids')
node.setAttribute 'data-view-ids', "#{if old then old + ' ' else ''}#{id}"
addIndex = (el, index)->
for node in $(el).not("[data-view-indexes~=#{index}]")
old = node.getAttribute('data-view-indexes')
node.setAttribute 'data-view-indexes', "#{if old then old + ' ' else ''}#{index}"
numberInputs = (el)->
for input in $(el).find('input')
input.setAttribute 'data-shadow-id', shadowCount++
activating = false
viewRoots = (el)-> $(el).children().filter('[data-view]')
activateScripts = (el)->
if !activating
activating = true
try
for script in $(el).find('script')
if !script.type || script.type == 'text/javascript'
newScript = document.createElement 'script'
newScript.type = 'text/javascript'
newScript.textContent = script.textContent
newScript.src = script.src
Templating.currentScript = newScript
script.parentNode.insertBefore newScript, script
script.parentNode.removeChild script
for script in $(el).find('script[type="text/coffeescript"]').add($(el).find 'script[type="text/literate-coffeescript"]')
Templating.currentScript = script
CoffeeScript.run script.innerHTML
finally
Templating.currentScript = null
activating = false
createNode = (txt)->
if typeof txt == 'string'
d = document.createElement 'div'
d.innerHTML = txt
d.firstChild
else $(txt)[0]
nodeText uses innerHTML to validate HTML text
nodeText = (txt)->
if typeof txt == 'string'
d = document.createElement 'div'
d.innerHTML = txt
d.innerHTML
else $(txt).html(true)
setShadowHtml = (holder, html, noactivate)->
if !(el = holder.shadowRoot)
holder.setAttribute 'data-shadowholder', 'true'
el = holder.createShadowRoot()
el.applyAuthorStyles=true
el.innerHTML = "<span></span>"
el.firstChild.innerHTML = html
$(el.firstChild).attr 'data-shadowdom', 'true'
if !noactivate then activateScripts el.firstChild
el.firstChild
appendAndActivate = (holder, html)->
n = $(html)
n.attr 'data-rendered', true
holder.children().filter("[data-rendered]").remove()
holder.append n
activateScripts n
clearView = (holder)->
for child in Array.prototype.slice.call holder.childNodes
if child.nodeType == Node.ELEMENT_NODE && child.hasAttribute 'data-view'
child.remove()
getDeepestActiveElement = ->
el = document.activeElement
while next = el.shadowRoot?.activeElement
el = next
el
root.createTemplateRenderer = createTemplateRenderer
root.setShadowHtml = setShadowHtml
root.activateScripts = activateScripts
root.clearView = clearView
root.viewRoots = viewRoots
root.viewMarkup = viewMarkup
root.escapeHtml = escapeHtml
root.getDeepestActiveElement = getDeepestActiveElement
root.createNode = createNode
root.nodeText = nodeText
| Literate CoffeeScript | 4 | zot/Leisure | METEOR-OLD/client/20-templating.litcoffee | [
"Zlib"
] |
Abstract Refinements {#induction}
=================================
Decoupling Invariants & Code
----------------------------
<br>
Abstract refinements decouple invariants from code
<br>
<div class="fragment">
**Next:** Precise Specifications for HOFs
<div class="hidden">
\begin{code}
module Loop where
import Prelude hiding ((!!), foldr, length, (++))
import Data.Set hiding (insert, foldr,size,filter, append)
-- import Measures
import Language.Haskell.Liquid.Prelude
{-@ LIQUID "--no-termination" @-}
{-@ LIQUID "--short-names" @-}
{-@ measure size :: (L a) -> Int
size (N) = 0
size (C x xs) = 1 + (size xs) @-}
{-@ measure elems :: L a -> (Set a)
elems (N) = (Set_empty 0)
elems (C x xs) = (Set_cup (Set_sng x) (elems xs))
@-}
{-@ type UnElems Xs Ys = {v:_ | elems v = Set_cup (elems Xs) (elems Ys)} @-}
size :: L a -> Int
add :: Int -> Int -> Int
loop :: Int -> Int -> α -> (Int -> α -> α) -> α
ifoldr :: (L a -> a -> b -> b) -> b -> L a -> b
\end{code}
</div>
<!-- BEGIN CUT
Induction
=========
Example: A Higher Order `loop`
-------------------------------
<br>
<br>
\begin{code}
loop lo hi base f = go lo base
where
go i acc
| i < hi = go (i+1) (f i acc)
| otherwise = acc
\end{code}
Iteration Dependence
--------------------
We can use `loop` to write
<br>
\begin{spec}
{-@ add :: n:Nat -> m:Nat -> {v:Nat|v=m+n} @-}
add n m = loop' 0 m n (\_ i -> i + 1)
\end{spec}
<br>
<div class="fragment">
**Problem** But cannot prove `add n m :: {v:_ | v = n + m}`
- As property only holds after *last* loop iteration...
- ... cannot instantiate `α` with `{v:Int | v = n + m}`
</div>
Iteration Dependence
--------------------
We used `loop` to write
<br>
\begin{spec}
{-@ add :: n:Nat -> m:Nat -> {v:Nat|v=m+n} @-}
add n m = loop 0 m n (\_ i -> i + 1)
\end{spec}
<br>
**Problem**
Need invariant relating *iteration* `i` with *accumulator* `acc`
Iteration Dependence
--------------------
We used `loop` to write
\begin{spec} <br>
{-@ add :: n:Nat -> m:Nat -> {v:Nat|v=m+n} @-}
add n m = loop 0 m n (\_ i -> i + 1)
\end{spec}
<br>
**Solution**
- Abstract Refinement `p :: Int -> a -> Prop`
- `(p i acc)` relates *iteration* `i` with *accumulator* `acc`
Induction in `loop` (by hand)
-----------------------------
\begin{code}
loop lo hi base f = go lo base
where
go i acc
| i < hi = go (i+1) (f i acc)
| otherwise = acc
\end{code}
<br>
<div class="fragment">
<div align="center">
------------ --- ----------------------------
**Assume** : `out = loop lo hi base f`
**Prove** : `(p hi out)`
------------ --- ----------------------------
</div>
</div>
Induction in `loop` (by hand)
-----------------------------
\begin{spec} <br>
loop lo hi base f = go lo base
where
go i acc
| i < hi = go (i+1) (f i acc)
| otherwise = acc
\end{spec}
<br>
**Base Case:** Initial accumulator `base` satisfies invariant
`(p lo base)`
Induction in `loop` (by hand)
-----------------------------
\begin{spec} <br>
loop lo hi base f = go lo base
where
go i acc
| i < hi = go (i+1) (f i acc)
| otherwise = acc
\end{spec}
<br>
**Inductive Step:** `f` *preserves* invariant at `i`
`(p i acc) => (p (i+1) (f i acc))`
Induction in `loop` (by hand)
-----------------------------
\begin{spec} <br>
loop lo hi base f = go lo base
where
go i acc
| i < hi = go (i+1) (f i acc)
| otherwise = acc
\end{spec}
<br>
**"By Induction"** `out` satisfies invariant at `hi`
`(p hi out)`
Induction in `loop` (by type)
-----------------------------
Induction is an **abstract refinement type** for `loop`
<br>
\begin{code}
{-@ loop :: forall a <p :: Int -> a -> Prop>.
lo:Int
-> hi:{Int | lo <= hi}
-> base:a<p lo>
-> f:(i:Int -> a<p i> -> a<p (i+1)>)
-> a<p hi> @-}
\end{code}
<br>
Induction in `loop` (by type)
-----------------------------
`p` is the *index dependent* invariant!
\begin{spec}<br>
p :: Int -> a -> Prop -- invt
base :: a<p lo> -- base
f :: i:Int -> a<p i> -> a<p(i+1)> -- step
out :: a<p hi> -- goal
\end{spec}
Using Induction
---------------
\begin{code}
{-@ add :: n:Nat -> m:Nat -> {v:Nat| v=m+n} @-}
add n m = loop 0 m n (\_ z -> z + 1)
\end{code}
<br>
**Verified** by *instantiating* the abstract refinement of `loop`
`p := \i acc -> acc = i + n`
Generalizes To Structures
-------------------------
Same idea applies for induction over *structures* ...
<br>
<br>
[DEMO 02_AbstractRefinements.hs #2](../hs/02_AbstractRefinements.hs)
END CUT -->
Structural Induction
====================
Example: Lists
--------------
<br>
\begin{code}
data L a = N
| C a (L a)
\end{code}
<br>
<div class="fragment">
Lets write a generic loop over lists ...
</div>
Example: `foldr`
----------------
<br>
<br>
\begin{code}
foldr :: (α -> β -> β) -> β -> L α -> β
foldr f acc N = acc
foldr f acc (C x xs) = f x (foldr f acc xs)
\end{code}
Problem
-------
Recall our *failed attempt* to write `append` with `foldr`
<br>
\begin{spec}
{-@ app :: xs:_ -> ys:_ -> UnElems xs ys @-}
app xs ys = foldr C ys xs
\end{spec}
<br>
<div class="fragment">
- Property holds after *last* iteration
- Cannot instantiate `α` with `UnElems xs ys`
</div>
Problem
-------
Recall our *failed attempt* to write `append` with `foldr`
<br>
\begin{spec}
{-@ app :: xs:_ -> ys:_ -> UnElems xs ys @-}
app xs ys = foldr C ys xs
\end{spec}
<br>
Need to **relate** each *iteration* with *accumulator* `acc`
Solution: Inductive `foldr`
---------------------------
<br>
<br>
<div class="fragment">
Lets brace ourselves for the type...
</div>
Solution: Inductive `foldr`
---------------------------
\begin{code}
{-@ ifoldr ::
forall a b <p :: L a -> b -> Prop>.
(xs:_ -> x:_ -> b<p xs> -> b<p(C x xs)>)
-> b<p N>
-> ys:L a
-> b<p ys> @-}
ifoldr f b N = b
ifoldr f b (C x xs) = f xs x (ifoldr f b xs)
\end{code}
<br>
<div class="fragment">
Lets step through the type...
</div>
`ifoldr`: Abstract Refinement
-----------------------------
\begin{spec} <div/>
p :: L a -> b -> Prop
step :: xs:_ -> x:_ -> b<p xs> -> b<p(C x xs)>
base :: b<p N>
ys :: L a
out :: b<p ys>
\end{spec}
<br>
`(p xs b)` relates `b` with **folded** `xs`
`p :: L a -> b -> Prop`
`ifoldr`: Base Case
-------------------
\begin{spec} <div/>
p :: L a -> b -> Prop
step :: xs:_ -> x:_ -> b<p xs> -> b<p(C x xs)>
base :: b<p N>
ys :: L a
out :: b<p ys>
\end{spec}
<br>
`base` is related to **empty** list `N`
`base :: b<p N>`
`ifoldr`: Ind. Step
-------------------
\begin{spec} <div/>
p :: L a -> b -> Prop
step :: xs:_ -> x:_ -> b<p xs> -> b<p(C x xs)>
base :: b<p N>
ys :: L a
out :: b<p ys>
\end{spec}
<br>
`step` **extends** relation from `xs` to `C x xs`
`step :: xs:_ -> x:_ -> b<p xs> -> b<p (C x xs)>`
`ifoldr`: Output
----------------
\begin{spec} <div/>
p :: L a -> b -> Prop
step :: xs:_ -> x:_ -> b<p xs> -> b<p(C x xs)>
base :: b<p N>
ys :: L a
out :: b<p ys>
\end{spec}
<br>
Hence, relation holds between `out` and **entire input** list `ys`
`out :: b<p ys>`
Using `ifoldr`: Size
-------------------
We can now verify
<br>
\begin{code}
{-@ size :: xs:_ -> {v:Int| v = size xs} @-}
size = ifoldr (\_ _ n -> n + 1) 0
\end{code}
<br>
<div class="fragment">
by *automatically instantiating* `p` with
`\xs acc -> acc = size xs`
</div>
Using `foldr`: Append
---------------------
We can now verify
<br>
\begin{code}
{-@ (++) :: xs:_ -> ys:_ -> UnElems xs ys @-}
xs ++ ys = ifoldr (\_ -> C) ys xs
\end{code}
<br>
<br>
<div class="fragment">
By *automatically* instantiating `p` with
`\xs acc -> elems acc = Set_cup (elems xs) (elems ys)`
</div>
More Examples
-------------
Induction over *structures* from `GHC.List`
<br>
+ `length`
+ `append`
+ `filter`
+ ...
<br>
[DEMO 02_AbstractRefinements.hs #2](../hs/02_AbstractRefinements.hs)
Recap
-----
<br>
Abstract refinements *decouple* **invariant** from **iteration**
<br>
<div class="fragment">**Precise** specs for higher-order functions.</div>
<br>
<div class="fragment">**Automatic** checking and instantiation by SMT.</div>
Recap
-----
1. Refinements: Types + Predicates
2. Subtyping: SMT Implication
3. Measures: Strengthened Constructors
4. Abstract: Refinements over Type Signatures
+ <div class="fragment">**Functions**</div>
+ <div class="fragment">**Recursive Data** <a href="08_Recursive.lhs.slides.html" target="_blank">[continue]</a></div>
5. <div class="fragment">[Evaluation](11_Evaluation.lhs.slides.html)</div>
| Literate Haskell | 5 | curiousleo/liquidhaskell | docs/slides/BOS14/lhs/06_Inductive.lhs | [
"MIT",
"BSD-3-Clause"
] |
@rem Script to build Lua under "Visual Studio .NET Command Prompt".
@rem Do not run from this directory; run it from the toplevel: etc\luavs.bat .
@rem It creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src.
@rem (contributed by David Manura and Mike Pall)
@setlocal
@set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE
@set MYLINK=link /nologo
@set MYMT=mt /nologo
cd src
%MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c
del lua.obj luac.obj
%MYLINK% /DLL /out:lua51.dll l*.obj
if exist lua51.dll.manifest^
%MYMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
%MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c
%MYLINK% /out:lua.exe lua.obj lua51.lib
if exist lua.exe.manifest^
%MYMT% -manifest lua.exe.manifest -outputresource:lua.exe
%MYCOMPILE% l*.c print.c
del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj^
loslib.obj ltablib.obj lstrlib.obj loadlib.obj
%MYLINK% /out:luac.exe *.obj
if exist luac.exe.manifest^
%MYMT% -manifest luac.exe.manifest -outputresource:luac.exe
del *.obj *.manifest
cd ..
| Batchfile | 4 | zh1029/redis | deps/lua/etc/luavs.bat | [
"BSD-3-Clause"
] |
#region Copyright notice and license
// Copyright 2015 gRPC authors.
//
// 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.
#endregion
using System;
using Grpc.Core.Utils;
namespace Grpc.Core
{
/// <summary>
/// Encapsulates the logic for serializing and deserializing messages.
/// </summary>
public class Marshaller<T>
{
readonly Func<T, byte[]> serializer;
readonly Func<byte[], T> deserializer;
readonly Action<T, SerializationContext> contextualSerializer;
readonly Func<DeserializationContext, T> contextualDeserializer;
/// <summary>
/// Initializes a new marshaller from simple serialize/deserialize functions.
/// </summary>
/// <param name="serializer">Function that will be used to serialize messages.</param>
/// <param name="deserializer">Function that will be used to deserialize messages.</param>
public Marshaller(Func<T, byte[]> serializer, Func<byte[], T> deserializer)
{
this.serializer = GrpcPreconditions.CheckNotNull(serializer, nameof(serializer));
this.deserializer = GrpcPreconditions.CheckNotNull(deserializer, nameof(deserializer));
// contextual serialization/deserialization is emulated to make the marshaller
// usable with the grpc library (required for backward compatibility).
this.contextualSerializer = EmulateContextualSerializer;
this.contextualDeserializer = EmulateContextualDeserializer;
}
/// <summary>
/// Initializes a new marshaller from serialize/deserialize fuctions that can access serialization and deserialization
/// context. Compared to the simple serializer/deserializer functions, using the contextual version provides more
/// flexibility and can lead to increased efficiency (and better performance).
/// Note: This constructor is part of an experimental API that can change or be removed without any prior notice.
/// </summary>
/// <param name="serializer">Function that will be used to serialize messages.</param>
/// <param name="deserializer">Function that will be used to deserialize messages.</param>
public Marshaller(Action<T, SerializationContext> serializer, Func<DeserializationContext, T> deserializer)
{
this.contextualSerializer = GrpcPreconditions.CheckNotNull(serializer, nameof(serializer));
this.contextualDeserializer = GrpcPreconditions.CheckNotNull(deserializer, nameof(deserializer));
// gRPC only uses contextual serializer/deserializer internally, so emulating the legacy
// (de)serializer is not necessary.
this.serializer = (msg) => { throw new NotImplementedException(); };
this.deserializer = (payload) => { throw new NotImplementedException(); };
}
/// <summary>
/// Gets the serializer function.
/// </summary>
public Func<T, byte[]> Serializer => this.serializer;
/// <summary>
/// Gets the deserializer function.
/// </summary>
public Func<byte[], T> Deserializer => this.deserializer;
/// <summary>
/// Gets the serializer function.
/// Note: experimental API that can change or be removed without any prior notice.
/// </summary>
public Action<T, SerializationContext> ContextualSerializer => this.contextualSerializer;
/// <summary>
/// Gets the serializer function.
/// Note: experimental API that can change or be removed without any prior notice.
/// </summary>
public Func<DeserializationContext, T> ContextualDeserializer => this.contextualDeserializer;
// for backward compatibility, emulate the contextual serializer using the simple one
private void EmulateContextualSerializer(T message, SerializationContext context)
{
var payload = this.serializer(message);
context.Complete(payload);
}
// for backward compatibility, emulate the contextual deserializer using the simple one
private T EmulateContextualDeserializer(DeserializationContext context)
{
return this.deserializer(context.PayloadAsNewBuffer());
}
}
/// <summary>
/// Utilities for creating marshallers.
/// </summary>
public static class Marshallers
{
/// <summary>
/// Creates a marshaller from specified serializer and deserializer.
/// </summary>
public static Marshaller<T> Create<T>(Func<T, byte[]> serializer, Func<byte[], T> deserializer)
{
return new Marshaller<T>(serializer, deserializer);
}
/// <summary>
/// Creates a marshaller from specified contextual serializer and deserializer.
/// Note: This method is part of an experimental API that can change or be removed without any prior notice.
/// </summary>
public static Marshaller<T> Create<T>(Action<T, SerializationContext> serializer, Func<DeserializationContext, T> deserializer)
{
return new Marshaller<T>(serializer, deserializer);
}
/// <summary>
/// Returns a marshaller for <c>string</c> type. This is useful for testing.
/// </summary>
public static Marshaller<string> StringMarshaller
{
get
{
return new Marshaller<string>(System.Text.Encoding.UTF8.GetBytes,
System.Text.Encoding.UTF8.GetString);
}
}
}
}
| C# | 5 | samotarnik/grpc | src/csharp/Grpc.Core/Marshaller.cs | [
"Apache-2.0"
] |
(%
% rowl - 1st generation
% Copyright (C) 2010 nineties
%
% $Id: startup.rl 2010-04-05 13:03:15 nineties $
%);
export _start;
_start: (p0) {
init_io();
exit(main(*(&p0-4), &p0)); (% argc and argv %);
};
| Ragel in Ruby Host | 3 | waldo2590/amber-1 | amber/startup.rl | [
"MIT"
] |
<p>if you wish to cancel your subscription, it would make us very sad, but nevertheless you can do it here.</p>
<p> </p>
<textarea id="cancel-subscription-reason" cols="30" rows="8" placeholder="please let us know why ... what can we do better? how can we improve? we don't track your usage behavior. so if you won't tell us what to improve, we won't ever know."></textarea>
<p> </p>
<button id="cancel-subscription-button" class="red">cancel subscription</button> | Kit | 2 | pws1453/web-client | source/imports/app/account-tab-plan-payments-cancel-subscription.kit | [
"MIT"
] |
## Licensed to Cloudera, Inc. under one
## or more contributor license agreements. See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership. Cloudera, Inc. licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
<%!
import logging
import sys
from desktop.views import commonheader, commonfooter
LOG = logging.getLogger(__name__)
%>
<%namespace name="layout" file="about_layout.mako" />
${ layout.menubar(section='dump_config') }
<style type="text/css">
.card-heading .pull-right {
font-size: 12px;
font-weight: normal;
}
</style>
<div id="aboutConfiguration">
<!-- ko component: { name: 'hue-config-tree' } --><!-- /ko -->
</div>
<script type="text/javascript">
$(document).ready(function () {
ko.applyBindings({}, $('#aboutConfiguration')[0]);
});
</script>
| Mako | 3 | yetsun/hue | desktop/core/src/desktop/templates/dump_config.mako | [
"Apache-2.0"
] |
#%RAML 0.8
title: Simple Light
version: v1.0-20150910
schemas:
- LightSchema: !include simple-light.json
LightSchemaError: !include simple-light-error.json
/sample/light:
description: Resource to be exposed by any Simple Device that can act as Light.
displayName: Simple Light
get:
responses:
200:
body:
application/json:
schema: LightSchema
example: |
{
"resourceType": "sample.light",
"power": "off"
}
put:
body:
application/json:
schema: LightSchema
example: |
{
"power": "off",
"intensity": 5
}
responses:
200:
body:
application/json:
schema: LightSchema
example: |
{
"power": "off",
"intensity": 5
}
403:
description: |
This response is generated by the Server when the client sends:
An update with an out of range property value for intensity.
The server responds with the range property illustrating the error.
body:
application/json:
schema: LightSchemaError
example: |
{
"range": "1,20"
}
post:
body:
application/json:
schema: LightSchema
example: |
{
"power": "off"
}
responses:
200:
body:
application/json:
schema: LightSchema
example: |
{
"power": "off"
}
403:
description: |
This response is generated by the Server when the client sends:
An update with an out of range property value for intensity.
The server responds with the range property illustrating the error.
body:
application/json:
schema: LightSchemaError
example: |
{
"range": "1,20"
}
| RAML | 4 | gerald-yang/ubuntu-iotivity-demo | iotivity-1.0.1/service/simulator/java/eclipse-plugin/ServiceProviderPlugin/resource/Light/simple-light.raml | [
"Apache-2.0"
] |
vcl 4.0;
acl invalidators {
"127.0.0.1";
}
include "../../../../resources/config/varnish/fos_debug.vcl";
include "../../../../resources/config/varnish/fos_refresh.vcl";
include "../../../../resources/config/varnish/fos_purge.vcl";
include "../../../../resources/config/varnish/fos_tags_xkey.vcl";
include "../../../../resources/config/varnish/fos_ban.vcl";
backend default {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
call fos_ban_recv;
call fos_purge_recv;
call fos_refresh_recv;
call fos_tags_xkey_recv;
}
sub vcl_backend_response {
call fos_ban_backend_response;
}
sub vcl_deliver {
call fos_debug_deliver;
call fos_ban_deliver;
call fos_tags_xkey_deliver;
}
| VCL | 3 | PeerJ/FOSHttpCache | tests/Functional/Fixtures/varnish/fos_xkey.vcl | [
"MIT"
] |
{
# Name of our deployment
network.description = "HelloWorld";
# Enable rolling back to previous versions of our infrastructure
network.enableRollback = true;
# It consists of a single server named 'helloserver'
helloserver =
# Every server gets passed a few arguments, including a reference
# to nixpkgs (pkgs)
{ config, pkgs, ... }:
let
# We import our custom packages from ./default passing pkgs as argument
packages = import ./default.nix { pkgs = pkgs; };
# This is the nodejs version specified in default.nix
nodejs = packages.nodejs;
# And this is the application we'd like to deploy
app = packages.app;
in
{
# We'll be running our application on port 8080, because a regular
# user cannot bind to port 80
# Then, using some iptables magic we'll forward traffic designated to port 80 to 8080
networking.firewall.enable = true;
# We will open up port 22 (SSH) as well otherwise we're locking ourselves out
networking.firewall.allowedTCPPorts = [ 80 8080 22 ];
networking.firewall.allowPing = true;
# Port forwarding using iptables
networking.firewall.extraCommands = ''
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
'';
# To run our node.js program we're going to use a systemd service
# We can configure the service to automatically start on boot and to restart
# the process in case it crashes
systemd.services.helloserver = {
description = "Hello world application";
# Start the service after the network is available
after = [ "network.target" ];
# We're going to run it on port 8080 in production
environment = { PORT = "8080"; };
serviceConfig = {
# The actual command to run
ExecStart = "${nodejs}/bin/node ${app}/server.js";
# For security reasons we'll run this process as a special 'nodejs' user
User = "nodejs";
Restart = "always";
};
};
# And lastly we ensure the user we run our application as is created
users.extraUsers = {
nodejs = { };
};
};
} | Nix | 5 | websharks/ace-builds | demo/kitchen-sink/docs/Nix.nix | [
"BSD-3-Clause"
] |
package date_test
import "testing"
import "date"
option now = () => 2030-01-01T00:00:00Z
inData =
"
#datatype,string,long,dateTime:RFC3339,string,string,double
#group,false,false,false,true,true,false
#default,_result,,,,,
,result,table,_time,_measurement,_field,_value
,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1
,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1
,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1
,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1
,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1
,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1
,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1
,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1
,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1
,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1
,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1
,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1
,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1
,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1
,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1
"
outData =
"
#group,false,false,true,true,true,true,false,false
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long
#default,_result,,,,,,,
,result,table,_start,_stop,_field,_measurement,_time,_value
,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254
,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748
,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947
,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538
,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676
,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786
,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823
"
t_time_millisecond = (table=<-) =>
table
|> range(start: 2018-01-01T00:00:00Z)
|> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)}))
test _time_millisecond = () =>
({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})
| FLUX | 3 | metrico/flux | stdlib/date/millisecond_test.flux | [
"MIT"
] |
$$ MODE TUSCRIPT
setofstrings="this is a set of strings to sort This Is A Set Of Strings To Sort"
unsorted=SPLIT (setofstrings,": :")
PRINT "1. setofstrings unsorted"
index=""
LOOP l=unsorted
PRINT l
length=LENGTH (l),index=APPEND(index,length)
ENDLOOP
index =DIGIT_INDEX (index)
sorted=INDEX_SORT (unsorted,index)
PRINT "2. setofstrings sorted"
*{sorted}
| Turing | 3 | LaudateCorpus1/RosettaCodeData | Task/Sort-using-a-custom-comparator/TUSCRIPT/sort-using-a-custom-comparator.tu | [
"Info-ZIP"
] |
<cfcomponent>
<cffunction name="foo">
<cfloop list="AdminUser_ID,AdminGroup_ID,AdminPriv" index="key">
</cfloop>
</cffunction>
</cfcomponent> | ColdFusion | 2 | tonym128/CFLint | src/test/resources/com/cflint/tests/ParseError/cfloop_359.cfm | [
"BSD-3-Clause"
] |
import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";
export default createSvgIcon( /*#__PURE__*/_jsx("path", {
d: "M19 4h-4c-.55 0-1 .45-1 1s.45 1 1 1h1.58l-3.97 3.97C11.73 9.36 10.66 9 9.5 9 6.46 9 4 11.46 4 14.5S6.46 20 9.5 20s5.5-2.46 5.5-5.5c0-1.16-.36-2.23-.97-3.12L18 7.42V9c0 .55.45 1 1 1s1-.45 1-1V5c0-.55-.45-1-1-1zM9.5 18C7.57 18 6 16.43 6 14.5S7.57 11 9.5 11s3.5 1.57 3.5 3.5S11.43 18 9.5 18z"
}), 'MaleRounded'); | JavaScript | 4 | good-gym/material-ui | packages/material-ui-icons/lib/esm/MaleRounded.js | [
"MIT"
] |
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_LINUX_UNITY_SERVICE_H_
#define SHELL_BROWSER_LINUX_UNITY_SERVICE_H_
namespace unity {
// Returns whether unity is currently running.
bool IsRunning();
// If unity is running, sets the download counter in the dock icon. Any value
// other than 0 displays the badge.
void SetDownloadCount(int count);
// If unity is running, sets the download progress bar in the dock icon. Any
// value between 0.0 and 1.0 (exclusive) shows the progress bar.
void SetProgressFraction(float percentage);
} // namespace unity
#endif // SHELL_BROWSER_LINUX_UNITY_SERVICE_H_
| C | 4 | lingxiao-Zhu/electron | shell/browser/linux/unity_service.h | [
"MIT"
] |
defmodule Mix.Tasks.Local.Phx do
use Mix.Task
@shortdoc "Updates the Phoenix project generator locally"
@moduledoc """
Updates the Phoenix project generator locally.
$ mix local.phx
Accepts the same command line options as `archive.install hex phx_new`.
"""
@impl true
def run(args) do
Mix.Task.run("archive.install", ["hex", "phx_new" | args])
end
end
| Elixir | 4 | faheempatel/phoenix | installer/lib/mix/tasks/local.phx.ex | [
"MIT"
] |
<%inherit file="/base.mako"/>
%if trans.user:
<h2>${_('User preferences')}</h2>
<p>You are currently logged in as ${trans.user.email|h}.</p>
<ul>
<li><a href="${h.url_for( controller='user', action='manage_user_info', cntrller=cntrller )}">${_('Manage your information')}</a></li>
<li><a href="${h.url_for( controller='user', action='change_password', id=trans.app.security.encode_id(trans.user.id) )}">${_('Change your password')}</a></li>
<li><a href="${h.url_for( controller='user', action='api_keys', cntrller=cntrller )}">${_('Manage your API keys')}</a></li>
<li><a href="${h.url_for( controller='repository', action='manage_email_alerts', cntrller=cntrller )}">${_('Manage your email alerts')}</a></li>
<li><a href="${h.url_for( controller='user', action='logout', logout_all=True )}" target="_top">${_('Logout')}</a> ${_('of all user sessions')}</li>
</ul>
%else:
%if not message:
<p>${n_('You are currently not logged in.')}</p>
%endif
<ul>
<li><a href="${h.url_for( controller='user', action='login' )}">${_('Login')}</li>
<li><a href="${h.url_for( controller='user', action='create', cntrller='user' )}">${_('Register')}</a></li>
</ul>
%endif
| Mako | 3 | rikeshi/galaxy | lib/tool_shed/webapp/templates/webapps/tool_shed/user/index.mako | [
"CC-BY-3.0"
] |
INSERT INTO t () VALUES (), (), (), (), (), ();
| SQL | 0 | suryatmodulus/tidb | br/tests/lightning_default-columns/data/defcol.t.1.sql | [
"Apache-2.0",
"BSD-3-Clause"
] |
@import "ui-variables";
.selection-bar-absolute-enter {
opacity: 0;
.inner {
top: -100%;
}
}
.selection-bar-absolute-enter.selection-bar-absolute-enter-active {
opacity: 1;
.inner {
top:0;
}
}
.selection-bar-absolute-leave {
opacity: 1;
.inner {
top:0;
}
}
.selection-bar-absolute-leave.selection-bar-absolute-leave-active {
opacity: 0;
.inner {
top: -100%;
}
}
.sheet-toolbar .selection-bar {
// This item sits in the toolbar and takes up all the remaining
// space from the toolbar-spacer divs, but flex-shrink means that
// it shrinks before any other element when not enough space is available.
// This is important because the spacers will prevent items from being clickable,
// (webkit-app-region:drag) even if we're covering them up. We need to make them
// 0px wide!
width: 100%;
flex-shrink:100;
height:38px;
z-index: 10000;
-webkit-app-region: drag;
.absolute {
position: absolute;
left: -1px;
right:-1px;
top: 0;
height:37px;
border-left:1px solid @border-color-divider;
border-right:1px solid @border-color-divider;
background-color: @background-primary;
transition: opacity 0.2s ease-in-out;
.inner {
position: absolute;
width: 100%;
display:flex;
-webkit-app-region: no-drag;
transition: top 0.2s ease-in-out;
.centered {
flex: 1;
cursor:default;
text-align: center;
color:@text-color-subtle;
line-height: 38px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
-webkit-app-region: drag;
}
}
}
}
.list-container {
.list-rows > div {
// Note: This allows rows to be animated in and out!
transition: top ease-out 120ms;
}
.list-item {
font-size: @font-size-base;
color: @text-color;
background: @list-bg;
&:hover {
background: darken(@list-bg, 5%);
}
&.selected {
background: @list-selected-bg;
color: @list-selected-color;
border-bottom: 1px solid @list-selected-border;
}
&.next-is-selected {
border-bottom: 1px solid @list-selected-border;
}
&.focused {
background: @list-focused-bg;
color: @list-focused-color;
border-bottom: 1px solid @list-focused-border;
}
}
}
body.is-blurred {
.list-container {
.list-item {
&.selected {
background: fadeout(desaturate(@list-selected-bg, 100%), 65%);
border-bottom: 1px solid fadeout(desaturate(@list-selected-border, 100%), 65%);
color: @text-color;
}
&.focused {
background: fadeout(desaturate(@list-focused-bg, 100%), 65%);
border-bottom: 1px solid fadeout(desaturate(@list-focused-border, 100%), 65%);
color: @text-color;
}
}
}
}
.list-tabular {
flex: 1;
width: 100%;
height: 100%;
.list-tabular-item {
position: relative;
width: 100%;
display: flex;
align-items: center;
border-bottom: 1px solid @list-border;
border-left:4px solid transparent;
&:hover {
cursor: default;
}
&.keyboard-cursor {
border-left:4px solid @list-focused-bg;
}
&.selected {
.checkmark .inner {
background-color: @accent-primary;
background-image: url(images/thread-list/checkbox-checkmark@2x.png);
border:none;
border-radius: 2px;
}
}
&.selected.focused {
.checkmark .inner {
background-color: @list-bg;
background-image: url(images/thread-list/checkbox-checkmark-activerow@2x.png);
border:none;
border-radius: 2px;
}
}
&.focused {
.checkmark .inner {
border:1px solid @accent-primary;
}
}
.checkmark {
padding: 11px;
position: absolute;
top: 0;
left: 0;
.inner {
width:14px;
height:14px;
border:1px solid @list-border;
border-radius: 2px;
background: transparent;
background-size: 12px 9px;
background-repeat: no-repeat;
background-position: center;
}
}
}
.list-column {
// The width is set by React.
display: inherit;
padding: 0 @padding-base-horizontal;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
align-items: center;
&:first-child {
padding-left: @padding-base-horizontal - 4;
}
&:last-child {
text-align: right;
}
}
}
| Less | 4 | cnheider/nylas-mail | packages/client-app/static/components/list-tabular.less | [
"MIT"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.