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 |
|---|---|---|---|---|---|
$nyquist plug-in
$version 4
$type tool analyze
$debugbutton false
$debugflags trace
$name (_ "Regular Interval Labels")
$manpage "Regular_Interval_Labels"
$action (_ "Adding equally-spaced labels to the label track...")
$author (_ "Steve Daulton")
$release 2.3.1
$copyright (_ "Released under terms of the GNU General Public License version 2")
;; TODO: Rewrite as an AUD-DO script so as to remove the requirement for an audio selection.
;; Original version by David R. Sky (http://www.garyallendj.com/davidsky/) 2007.
;; Based on an idea by Sami Jumppanen, with contributions from
;; Alex S.Brown, Dominic Mazzoni, Pierre M.I., Gale Andrews.
;; Released under terms of the GNU General Public License version 2:
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
;;
;; For information about writing and modifying Nyquist plug-ins:
;; https://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference
;i18n-hint: Refers to the controls 'Number of labels' and 'Label interval'.
$control mode (_ "Create labels based on") choice (("Both" (_ "Number & Interval"))
("Number" (_ "Number of Labels"))
("Interval" (_ "Label Interval"))) 0
$control totalnum (_ "Number of labels") int-text "" 10 1 1000
$control interval (_ "Label interval (seconds)") float-text "" 10 0.001 3600
$control region (_ "Length of label region (seconds)") float-text "" 0 0 3600
$control adjust (_ "Adjust label interval to fit length") choice ((_ "No")
(_ "Yes")) 0
$control labeltext (_ "Label text") string "" (_ "Label")
$control zeros (_ "Minimum number of digits in label") choice (("TextOnly" (_ "None - Text Only"))
("OneBefore" (_ "1 (Before Label)"))
("TwoBefore" (_ "2 (Before Label)"))
("ThreeBefore" (_ "3 (Before Label)"))
("OneAfter" (_ "1 (After Label)"))
("TwoAfter" (_ "2 (After Label)"))
("ThreeAfter" (_ "3 (After Label)"))) 2
$control firstnum (_ "Begin numbering from") int-text "" 1 0 nil
$control verbose (_ "Message on completion") choice ((_ "Details")
("Warnings" (_ "Warnings only"))
(_ "None")) 0
(defun make-labels (&aux labels)
"Generate labels at regular intervals"
;; Get parameters
(case mode
(1 ;Number
(setf interval
(if (= region 0)
(/ (- (get-duration 1) region) totalnum)
(/ (- (get-duration 1) region) (1- totalnum)))))
(2 ;Interval
(setf totalnum (get-interval-count))
(when (= adjust 1)
(setf interval (/ (- (get-duration 1) region) totalnum))))
(t ;Number and Interval
))
;; Loop for required number of labels
(do* ((count 0 (1+ count))
(time 0 (* count interval)))
((= count totalnum))
(push (make-one-label time (+ firstnum count)) labels))
(when (and (> region 0)(= mode 2)(= adjust 1))
(push (make-one-label (- (get-duration 1) region)
(+ firstnum totalnum))
labels))
;; Create confirmation message
(when (< verbose 2)
(message totalnum interval))
labels)
(defun message (number interval)
"Generate output message in debug window."
(if (> region interval)
(setf msg (format nil (_ "Warning: Overlapping region labels.~%")))
(setf msg ""))
(cond
((= verbose 1) ;Warnings only
(format t msg))
(t (if (> region 0)
;i18n-hint: Type of label
(setf labeltype (_ "region labels"))
(setf labeltype (_ "point labels")))
(when (and (> region 0)(= mode 2)(= adjust 1))
(setf number (1+ number)))
(setf msg
;i18n-hint: Number of labels produced at specified intervals.
(format nil (_ "~a~a ~a at intervals of ~a seconds.~%")
msg number labeltype interval))
(if (> region 0)
(format t (_ "~aRegion length = ~a seconds.")
msg region)
(format t msg)))))
(defun get-interval-count (&aux dur)
"Number of labels when interval is specified"
(setf dur (- (get-duration 1) region))
(case adjust
;; Interval is user input value
(0 (let ((n (truncate (/ dur interval))))
(if (< (* n interval) dur)
(1+ n)
n)))
;; Adjust interval to fit length
(1 (let* ((min-num (truncate (/ dur interval)))
(max-num (1+ min-num)))
(if (and (> min-num 0)
(< (abs (- interval (/ dur min-num)))
(abs (- interval (/ dur max-num)))))
min-num
max-num)))))
(defun make-one-label (time num)
"Make a single label"
(let* ((num-text (format nil "~a" num))
(non-zero-digits (length num-text)))
(if (= zeros 0)
(setf num-text "")
(dotimes (i (max 0 (- zeros non-zero-digits)))
(setf num-text (format nil "~a~a" "0" num-text))))
(if num-before-text
(setf text (format nil "~a~a" num-text labeltext))
(setf text (format nil "~a~a" labeltext num-text)))
(list time (+ time region) text)))
(defun lasttrackp ()
"True when processing the final selected track"
(let ((index (get '*track* 'index))
(num (length (get '*selection* 'tracks))))
(= index num)))
(setf num-before-text (<= zeros 3))
(setf zeros (1+ (rem (1- zeros) 3)))
;; Analyze plug-ins may return text message per track but
;; we only want error messages once, and only one set of labels.
(if (lasttrackp)
(make-labels)
"") ;No-op
| Common Lisp | 5 | joshrose/audacity | plug-ins/equalabel.ny | [
"CC-BY-3.0"
] |
from cpython.datetime cimport (
datetime,
timedelta,
tzinfo,
)
cdef tzinfo utc_pytz
cpdef bint is_utc(tzinfo tz)
cdef bint is_tzlocal(tzinfo tz)
cdef bint treat_tz_as_pytz(tzinfo tz)
cpdef bint tz_compare(tzinfo start, tzinfo end)
cpdef object get_timezone(tzinfo tz)
cpdef tzinfo maybe_get_tz(object tz)
cdef timedelta get_utcoffset(tzinfo tz, datetime obj)
cdef bint is_fixed_offset(tzinfo tz)
cdef object get_dst_info(tzinfo tz)
| Cython | 5 | 13rianlucero/CrabAgePrediction | crabageprediction/venv/Lib/site-packages/pandas/_libs/tslibs/timezones.pxd | [
"MIT"
] |
# An input file for running a "slow" build.
# Use like: ninja -f misc/long-slow-build.ninja all
rule sleep
command = sleep 1
description = SLEEP $out
build 0: sleep README
build 1: sleep README
build 2: sleep README
build 3: sleep README
build 4: sleep README
build 5: sleep README
build 6: sleep README
build 7: sleep README
build 8: sleep README
build 9: sleep README
build 10: sleep 0
build 11: sleep 1
build 12: sleep 2
build 13: sleep 3
build 14: sleep 4
build 15: sleep 5
build 16: sleep 6
build 17: sleep 7
build 18: sleep 8
build 19: sleep 9
build 20: sleep 10
build 21: sleep 11
build 22: sleep 12
build 23: sleep 13
build 24: sleep 14
build 25: sleep 15
build 26: sleep 16
build 27: sleep 17
build 28: sleep 18
build 29: sleep 19
build all: phony 20 21 22 23 24 25 26 27 28 29
| Ninja | 2 | phkrl/ninja | misc/long-slow-build.ninja | [
"Apache-2.0"
] |
"""The gogogate2 component."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_DEVICE, Platform
from homeassistant.core import HomeAssistant
from .common import get_data_update_coordinator
from .const import DEVICE_TYPE_GOGOGATE2
PLATFORMS = [Platform.COVER, Platform.SENSOR]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Do setup of Gogogate2."""
# Update the config entry.
config_updates = {}
if CONF_DEVICE not in entry.data:
config_updates = {
**entry.data,
**{CONF_DEVICE: DEVICE_TYPE_GOGOGATE2},
}
if config_updates:
hass.config_entries.async_update_entry(entry, data=config_updates)
data_update_coordinator = get_data_update_coordinator(hass, entry)
await data_update_coordinator.async_config_entry_first_refresh()
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload Gogogate2 config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
| Python | 4 | MrDelik/core | homeassistant/components/gogogate2/__init__.py | [
"Apache-2.0"
] |
body {
background-color: lightGray
}
.dark {
background-color: black;
color: white;
}
.light {
background-color: #f1f1f1;
color: #ccc;
} | CSS | 3 | zeesh49/tutorials | spring-thymeleaf/src/main/webapp/WEB-INF/css/styles.css | [
"MIT"
] |
#pragma once
#include <optional>
#include <string>
#include <string_view>
std::optional<std::wstring> ObtainActiveUserName();
std::wstring ObtainStableGlobalNameForKernelObject(const std::wstring_view name, const bool restricted); | C | 2 | szlatkow/PowerToys | src/modules/videoconference/VideoConferenceShared/username.h | [
"MIT"
] |
<div id="healthdata-firstlaunch-popup" class="healthdata-firstlaunch-container">
<div>
<p class='healthdata-popup-close-button'>×</p>
</div>
<div >
<p class="healthdata-dialog-title">{{Strings.HEALTH_FIRST_POPUP_TITLE}}</p>
</div>
<div>
<p class="healthdata-dialog-message">{{{Strings.HEALTH_DATA_NOTIFICATION_MESSAGE}}}</p>
</div>
</div>
| HTML | 2 | ravitejavalluri/brackets | src/extensions/default/HealthData/htmlContent/healthdata-popup.html | [
"MIT"
] |
int main()
{
int x;
chan c;
par {
c <: 0;
c :> x;
}
return x;
}
| XC | 2 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/XC/main.xc | [
"MIT"
] |
30 3 0 0 111
0 1 9 8 4 7 9 2 6 3 5 1 [0] [0] [0] [0] [0] [0] [0] [0] [0]
1 1 5 30 28 15 26 13 [25] [14] [-5] [26] [7]
2 1 3 16 10 11 [-5] [22] [27]
3 1 2 21 19 [3] [0]
4 1 4 11 14 13 26 [19] [13] [18] [6]
5 1 5 23 26 17 22 28 [0] [0] [1] [-1] [0]
6 1 2 26 11 [-6] [9]
7 1 2 26 24 [8] [8]
8 1 4 29 22 18 13 [1] [3] [18] [9]
9 1 6 26 22 14 17 11 23 [9] [6] [4] [9] [2] [8]
10 1 5 29 19 22 12 27 [16] [-7] [17] [12] [-3]
11 1 5 30 29 28 27 25 [5] [0] [3] [5] [2]
12 1 3 26 14 18 [5] [13] [0]
13 1 2 25 27 [8] [26]
14 1 5 28 25 12 4 30 [0] [-1] [-26] [-21] [5]
15 1 3 25 27 29 [10] [9] [17]
16 1 3 23 28 30 [18] [9] [2]
17 1 4 30 20 21 25 [11] [-17] [-12] [12]
18 1 2 20 28 [1] [15]
19 1 3 10 11 23 [-5] [23] [15]
20 1 2 21 17 [-12] [-2]
21 1 3 18 16 11 [7] [12] [19]
22 1 5 24 19 25 9 30 [-7] [-27] [0] [-18] [1]
23 1 2 15 13 [7] [9]
24 1 3 14 21 22 [6] [11] [-6]
25 1 4 1 11 15 31 [-60] [-44] [-31] [6]
26 1 1 31 [7]
27 1 1 31 [3]
28 1 1 31 [3]
29 1 3 11 31 16 [-20] [1] [-72]
30 1 1 31 [4]
31 1 0
0 1 0 0 0 0
1 1 9 3 3 1
2 1 10 3 1 5
3 1 1 4 1 3
4 1 8 1 1 1
5 1 2 2 5 2
6 1 9 4 4 4
7 1 4 5 2 5
8 1 6 5 2 4
9 1 3 4 4 2
10 1 6 3 5 1
11 1 2 3 3 2
12 1 7 5 2 3
13 1 10 5 1 2
14 1 2 3 4 1
15 1 7 5 2 2
16 1 6 1 3 2
17 1 6 4 4 2
18 1 6 5 4 1
19 1 10 3 1 3
20 1 6 3 1 2
21 1 8 5 3 3
22 1 1 4 5 3
23 1 3 4 3 2
24 1 9 3 1 5
25 1 6 5 4 1
26 1 7 5 3 2
27 1 3 5 4 1
28 1 3 3 2 5
29 1 1 1 2 2
30 1 4 1 1 1
31 1 0 0 0 0
4 4 8
| Eagle | 1 | klorel/or-tools | examples/data/rcpsp/single_mode_investment/rip30/rip139.sch | [
"Apache-2.0"
] |
grammar RetryCondition;
condition
: WS* (criteria|Never) WS* EOF
;
criteria
: criteriaField=Quoted WS+ operator=IsEmpty #FieldOperatorCriteria
| criteriaField=Quoted WS+ operator=(Contains|Is) WS+ criteriaValue=Quoted #FieldOperatorValueCriteria
| criteria WS+ And WS+ criteria #AndCriteria
| criteria WS+ Or WS+ criteria #OrCriteria
| Not WS* LParens WS* criteria WS* RParens #NotCriteria
| LParens WS* criteria WS* RParens #ParensCriteria
;
Never
: 'never'
;
Contains
: 'contains'
;
Is
: 'is'
;
IsEmpty
: 'is' WS+ 'empty'
;
And
: 'and'
;
Or
: 'or'
;
Not
: 'not'
;
LParens
: '('
;
RParens
: ')'
;
Quoted
: '"' ('\\'.|~[\\"])+? '"'
;
WS
: ' '
;
Identifier
: [a-zA-Z0-9:_/\\+\-;]+
;
| ANTLR | 5 | sasaie/onedev | server-core/src/main/java/io/onedev/server/buildspec/job/retrycondition/RetryCondition.g4 | [
"MIT"
] |
WRITE $ASCII("M")
WRITE $CHAR(77)
| M | 3 | mullikine/RosettaCodeData | Task/Character-codes/MUMPS/character-codes.mumps | [
"Info-ZIP"
] |
set title "Utilisation of Compressed Classes space"
plot for [i in "CCSU CCSC"] datafile using 1:i title columnheader(i) with lines
| Gnuplot | 3 | rmartinc/keycloak | testsuite/performance/tests/src/main/gnuplot/jstat/gc-cc.gp | [
"Apache-2.0"
] |
// run-pass
#![allow(unused_must_use)]
#![allow(deprecated)]
// ignore-emscripten no threads support
use std::sync::mpsc::{TryRecvError, channel};
use std::thread;
pub fn main() {
let (tx, rx) = channel();
let t = thread::spawn(move||{
thread::sleep_ms(10);
tx.send(()).unwrap();
});
loop {
match rx.try_recv() {
Ok(()) => break,
Err(TryRecvError::Empty) => {}
Err(TryRecvError::Disconnected) => unreachable!()
}
}
t.join();
}
| Rust | 3 | Eric-Arellano/rust | src/test/ui/issues/issue-9396.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
// Imports
import {PreviewServerError} from '../../lib/preview-server/preview-error';
// Tests
describe('PreviewServerError', () => {
let err: PreviewServerError;
beforeEach(() => err = new PreviewServerError(999, 'message'));
it('should extend Error', () => {
expect(err).toBeInstanceOf(PreviewServerError);
expect(err).toBeInstanceOf(Error);
expect(Object.getPrototypeOf(err)).toBe(PreviewServerError.prototype);
});
it('should have a \'status\' property', () => {
expect(err.status).toBe(999);
});
it('should have a \'message\' property', () => {
expect(err.message).toBe('message');
});
it('should have a 500 \'status\' by default', () => {
expect(new PreviewServerError().status).toBe(500);
});
it('should have an empty \'message\' by default', () => {
expect(new PreviewServerError().message).toBe('');
expect(new PreviewServerError(999).message).toBe('');
});
});
| TypeScript | 4 | raghavendramohan/angular | aio/aio-builds-setup/dockerbuild/scripts-js/test/preview-server/preview-error.spec.ts | [
"MIT"
] |
definition f {A : Type} {B : Type} (f : A → B → Prop) ⦃C : Type⦄ {R : C → C → Prop} {c : C} (H : R c c) : R c c
:= H
constant g : Prop → Prop → Prop
constant H : true ∧ true
#check f g H
| Lean | 3 | JLimperg/lean | tests/lean/run/implicit.lean | [
"Apache-2.0"
] |
.content.row
.profile
.picture
i.fa.fa-list
.summary
p = t('.description')
= datagrid_form_for @account_versions_grid, url: account_versions_path
.versions
= datagrid_table(@account_versions_grid, @assets, html: {:class => 'datagrid table-striped table-hover account_versions_grid'})
| Slim | 4 | gsmlg/peatio | app/views/private/account_versions/index.html.slim | [
"MIT"
] |
Import mojo
Import brl
Class MyApp Extends App
Field data:DataBuffer
Field data2:DataBuffer
Field image:Image
Method OnCreate()
data=DataBuffer.Load( "monkey://data/test.dat" )
If data
#If LANG<>"js" And LANG<>"as"
Local file:=FileStream.Open( "monkey://internal/test.png","w" )
If file
file.Write data,0,data.Length
file.Close
data2=DataBuffer.Load( "monkey://internal/test.png" )
image=LoadImage( "monkey://internal/test.png",1,Image.MidHandle )
Endif
#endif
Endif
SetUpdateRate 60
End
Method OnUpdate()
End
Method OnRender()
Cls 128,0,255
DrawText "Hello World!",0,0
If data DrawText "data.Length="+data.Length,0,12
If data2 DrawText "data2.Length="+data.Length,0,24
If image DrawImage image,DeviceWidth/2,DeviceHeight/2
End
End
Function Main()
New MyApp
End
| Monkey | 3 | blitz-research/monkey | bananas/mak/fileiotest/fileiotest.monkey | [
"Zlib"
] |
### Relevant Articles:
- [Copying Files With Maven](https://www.baeldung.com/maven-copy-files)
| Markdown | 4 | DBatOWL/tutorials | maven-modules/maven-copy-files/README.md | [
"MIT"
] |
VarComparability
none
ListImplementors
java.util.List
DECLARE
foo.f():::ENTER
x
int
int
22
y
int
int
22
z
int
int
22
DECLARE
foo.g():::ENTER
p
int
int
22
q
int
int
22
r
int
int
22
DECLARE
foo.f():::EXIT35
x
int
int
22
y
int
int
22
z
int
int
22
DECLARE
foo.g():::EXIT40
p
int
int
22
q
int
int
22
r
int
int
22
| BlitzBasic | 0 | eurecom-s3/invscov | daikon/java/daikon/test/SampleTester.decls | [
"Apache-2.0"
] |
\require "a"
\pinclude "inc/include2.ly"
| LilyPond | 0 | HolgerPeters/lyp | spec/user_files/include1.ly | [
"MIT"
] |
export PYTHONPATH="../":"${PYTHONPATH}"
python use_own_knowledge_dataset.py
ray start --head
python finetune_rag.py \
--model_name_or_path facebook/rag-token-base \
--model_type rag_token \
--context_encoder_name facebook/dpr-ctx_encoder-multiset-base \
--fp16 \
--gpus 1 \
--profile \
--end2end \
--index_name custom
ray stop
| Shell | 3 | liminghao1630/transformers | examples/research_projects/rag-end2end-retriever/test_run/test_rag_new_features.sh | [
"Apache-2.0"
] |
--TEST--
BIND_STATIC may destroy a variable with a throwing destructor
--FILE--
<?php
class Test {
function __destruct() {
throw new Exception("Foo");
}
}
try {
$new = new Test;
static $new;
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Foo
| PHP | 3 | NathanFreeman/php-src | Zend/tests/bind_static_exception.phpt | [
"PHP-3.01"
] |
# Copyright 2020-2021 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
@0xa0082c6893796a86;
using Java = import "/capnp/java.capnp";
$Java.package("com.xilinx.rapidwright.interchange");
$Java.outerClassname("References");
enum ReferenceType {
root @0;
rootValue @1;
parent @2;
}
enum ImplementationType {
enumerator @0;
}
| Cap'n Proto | 4 | antmicro/fpga-interchange-schema | interchange/References.capnp | [
"Apache-2.0"
] |
;; Copyright (c) 2020 Duncan McGreggor <oubiwann@cogitat.io>
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; http://www.apache.org/licenses/LICENSE-2.0
;;
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.
;; File : guessing-game2.lfe
;; Author : Duncan McGreggor
;; Purpose : Demonstrating a random-number guessing game (classic BASIC-era
;; demo) using a simple client and server, message-passing, and
;; pattern-matching
;; This file contains a simple demo for guessing a random number, chosen by
;; "the computer". Outwardly, this example behaves exactly like the first
;; guessing game example. Internally, however, this one differs significantly:
;;
;; 1. It uses a record to track game state
;; 2. It has abstrated a client behaviour and a server behaviour
;; 3. It uses message-passing between these two
;; 4. It uses pattern matching of records in the function heads as well as the
;; receives to perform flow control (instead of the 'cond' and `if` forms)
;;
;; To use, do the following:
;;
;; $ ./bin/lfe
;;
;; > (slurp "examples/guessing-game2.lfe")
;; #(ok guessing-game)
;; lfe> (main)
;; Guess the number I have chosen, between 1 and 10.
;; Guess number: 1
;; Your guess is too low.
;; Guess number: 10
;; Your guess is too high.
;; Guess number: 5
;; Your guess is too low.
;; Guess number: 7
;; Your guess is too high.
;; Guess number: 6
;; Well-guessed!!
;; game-over
(defmodule guessing-game2
(export
(main 0)))
(defrecord state
server
client
answer
guess
status)
(defun guess-server
(((match-state answer a))
(receive
((= (match-state client p guess g) game) (when (== g a))
(! p (set-state-status game 'game-over)))
((= (match-state client p guess g) game) (when (> g a))
(! p (set-state-status game 'too-high))
(guess-server game))
((= (match-state client p guess g) game) (when (< g a))
(! p (set-state-status game 'too-low))
(guess-server game)))))
(defun guess-client
(((match-state status 'game-over))
(io:format "Well-guessed!!~n")
'game-over)
(((= (match-state status 'started) game))
(io:format "Guess the number I have chosen, between 1 and 10.~n")
(guess-client (set-state-status game 'running)))
(((= (match-state status 'too-high) game))
(io:format "Your guess is too high.~n")
(guess-client (set-state-status game 'running)))
(((= (match-state status 'too-low) game))
(io:format "Your guess is too low.~n")
(guess-client (set-state-status game 'running)))
(((= (match-state server p) game))
(let ((`#(ok (,g)) (io:fread "Guess number: " "~d")))
(! p (set-state game client (self) guess g))
(receive
(game (guess-client game))))))
(defun main ()
(let* ((a (random:uniform 10))
(s (make-state answer a
guess 'undefined
status 'started))
(p (spawn (lambda () (guess-server s)))))
(guess-client (set-state-server s p))))
| LFE | 5 | haetze/lfe | examples/guessing-game2.lfe | [
"Apache-2.0"
] |
package unit.issues;
import unit.Test;
class Issue2676 extends Test {
function test() {
function match1(s:String) {
return switch(s) {
case "foo": 1;
case _.toUpperCase() => "BAR": 2;
case _ + "," + _ => "abc,abc": 3;
case _: 4;
}
}
eq(1, match1("foo"));
eq(4, match1("foo2"));
eq(2, match1("bAr"));
eq(2, match1("BAR"));
eq(2, match1("bar"));
eq(4, match1("barz"));
eq(3, match1("abc"));
eq(4, match1("ab"));
// check side effect handling
function func(i1:Int, i2:Int, i3:Int) {
return '$i1;$i2;$i3';
}
var i = 0;
var s = switch(9) {
case func(i++, i++, i++) => "0;1;2": "ok";
case _: "not ok";
}
eq("ok", s);
}
} | Haxe | 4 | bendmorris/haxe | tests/unit/issues/Issue2676.hx | [
"MIT"
] |
--TEST--
Cannot declare class, because the name is already in use
--FILE--
<?php
function test() {
class A {}
}
test();
test();
?>
--EXPECTF--
Fatal error: Cannot declare class A, because the name is already in use in %s on line %d
| PHP | 3 | thiagooak/php-src | Zend/tests/declare_already_in_use.phpt | [
"PHP-3.01"
] |
h1. JsDoc2 Template with Bootstrap
h2. Abstract
This template make beautiful and functional documents.
h2. Overview
See "JsDoc2 Template with Bootstrap":http://orgachem.github.com/JsDoc2-Template-Bootstrap/ .
h2. Install
bq. To produce output files you must use a template to format the generated documentation. Use the @-t@ option to specify which template you wish to use.
bc. java -jar jsrun.jar app/run.js myscripts/ -t=templates/jsdoc
Show the official "documents":http://code.google.com/p/jsdoc-toolkit/wiki/CommandlineOptions#Using_a_Template , if you want more informations.
| Textile | 3 | jackyhwei/sipml5 | jsdoc-toolkit/templates/OrgaChem-JsDoc2-Template-Bootstrap/README.textile | [
"Apache-2.0",
"BSD-3-Clause"
] |
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Deep Learning Models -- A collection of various deep learning architectures, models, and tips for TensorFlow and PyTorch in Jupyter Notebooks.\n",
"- Author: Sebastian Raschka\n",
"- GitHub Repository: https://github.com/rasbt/deeplearning-models"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Sebastian Raschka \n",
"\n",
"CPython 3.7.1\n",
"IPython 7.2.0\n",
"\n",
"torch 1.0.0\n"
]
}
],
"source": [
"%load_ext watermark\n",
"%watermark -a 'Sebastian Raschka' -v -p torch"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- Runs on CPU or GPU (if available)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Model Zoo -- Logistic Regression"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Implementation of *classic* logistic regression for binary class labels."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Imports"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from io import BytesIO\n",
"\n",
"import torch\n",
"import torch.nn.functional as F"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Preparing a toy dataset"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAa4AAACqCAYAAAD1E6s4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAFftJREFUeJzt3XGMFNd9B/Dv7zbn6KRERwinWD7ugDruOchQIU6GiD9QwBXEhfiCGxTcWqZFQpEcpQkRCsgWspErUyGRBtX9AxWLVnaIqLAvDrgiNlSxauWo70wCOITIjmu4c6TgWpBIPYnj7tc/5pbbvZ3Zndl5s++9me9HQucd9mZ/rOftb/bNb35PVBVERES+aLMdABERURJMXERE5BUmLiIi8goTFxEReYWJi4iIvMLERUREXmHiIiIirzBxERGRV5i4iIjIK5+w8aLz5s3ThQsX2nhpIiNGRkY+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DMO2Q6gDldjY1z54PP7xdjtsBo7r3EREZFX+I2LiIi8wsRFREReYeKqICJfE5F3RGRKRKyXqYrIehG5LCLvisgu2/GUicjzIvJ7EbloO5ZKItIjIv8pIpem/z/+ne2YfODacR+Hq2MjDlfHTyMujS8mrmoXAWwC8IbtQESkBOA5AF8GsBjAFhFZbDeq244AWG87iBC3AHxXVb8AYCWAxx16z1zmzHEfh+NjI44jcHP8NOLM+GLiqqCql1TVleVJ7wfwrqr+VlVvAvgRgIca/E5LqOobAD62Hcdsqvo7VX17+r//COASAHY4bcCx4z4OZ8dGHK6On0ZcGl9MXO7qBnC14vEo+CEcm4gsBLAMwFm7kVAGODYssz2+CtcdXkReB3BnyF89UV7IzxESso33LsQgIp8CcBzAt1X1D7bjcYFHx30cHBsWuTC+Cpe4VPUB2zHENAqgp+LxfAAfWorFGyLSjmBQvaiqL9mOxxUeHfdxcGxY4sr44lShu94CcI+ILBKROwB8HcArlmNymgQrLx4GcElVD9iOhzLDsWGBS+OLiauCiHxVREYBfBHASRE5ZSsWVb0F4JsATiG4CHpMVd+xFU8lETkK4OcA+kRkVES22Y5p2ioAjwJYIyK/mP7zoO2gXOfScR+Hy2MjDofHTyPOjC+2fCIiIq/wGxcREXmFiYuIiLzCxEVERF5h4iIiIq8wcRERkVeYuIiIyCtMXERE5JX/B/s1FOrL5PWOAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 504x180 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"##########################\n",
"### DATASET\n",
"##########################\n",
"\n",
"ds = np.lib.DataSource()\n",
"fp = ds.open('http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data')\n",
"\n",
"x = np.genfromtxt(BytesIO(fp.read().encode()), delimiter=',', usecols=range(2), max_rows=100)\n",
"y = np.zeros(100)\n",
"y[50:] = 1\n",
"\n",
"np.random.seed(1)\n",
"idx = np.arange(y.shape[0])\n",
"np.random.shuffle(idx)\n",
"X_test, y_test = x[idx[:25]], y[idx[:25]]\n",
"X_train, y_train = x[idx[25:]], y[idx[25:]]\n",
"mu, std = np.mean(X_train, axis=0), np.std(X_train, axis=0)\n",
"X_train, X_test = (X_train - mu) / std, (X_test - mu) / std\n",
"\n",
"fig, ax = plt.subplots(1, 2, figsize=(7, 2.5))\n",
"ax[0].scatter(X_train[y_train == 1, 0], X_train[y_train == 1, 1])\n",
"ax[0].scatter(X_train[y_train == 0, 0], X_train[y_train == 0, 1])\n",
"ax[1].scatter(X_test[y_test == 1, 0], X_test[y_test == 1, 1])\n",
"ax[1].scatter(X_test[y_test == 0, 0], X_test[y_test == 0, 1])\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Low-level implementation with manual gradients"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n",
"\n",
"\n",
"def custom_where(cond, x_1, x_2):\n",
" return (cond * x_1) + ((1-cond) * x_2)\n",
"\n",
"\n",
"class LogisticRegression1():\n",
" def __init__(self, num_features):\n",
" self.num_features = num_features\n",
" self.weights = torch.zeros(num_features, 1, \n",
" dtype=torch.float32, device=device)\n",
" self.bias = torch.zeros(1, dtype=torch.float32, device=device)\n",
"\n",
" def forward(self, x):\n",
" linear = torch.add(torch.mm(x, self.weights), self.bias)\n",
" probas = self._sigmoid(linear)\n",
" return probas\n",
" \n",
" def backward(self, probas, y): \n",
" errors = y - probas.view(-1)\n",
" return errors\n",
" \n",
" def predict_labels(self, x):\n",
" probas = self.forward(x)\n",
" labels = custom_where(probas >= .5, 1, 0)\n",
" return labels \n",
" \n",
" def evaluate(self, x, y):\n",
" labels = self.predict_labels(x).float()\n",
" accuracy = torch.sum(labels.view(-1) == y) / y.size()[0]\n",
" return accuracy\n",
" \n",
" def _sigmoid(self, z):\n",
" return 1. / (1. + torch.exp(-z))\n",
" \n",
" def _logit_cost(self, y, proba):\n",
" tmp1 = torch.mm(-y.view(1, -1), torch.log(proba))\n",
" tmp2 = torch.mm((1 - y).view(1, -1), torch.log(1 - proba))\n",
" return tmp1 - tmp2\n",
" \n",
" def train(self, x, y, num_epochs, learning_rate=0.01):\n",
" for e in range(num_epochs):\n",
" \n",
" #### Compute outputs ####\n",
" probas = self.forward(x)\n",
" \n",
" #### Compute gradients ####\n",
" errors = self.backward(probas, y)\n",
" neg_grad = torch.mm(x.transpose(0, 1), errors.view(-1, 1))\n",
" \n",
" #### Update weights ####\n",
" self.weights += learning_rate * neg_grad\n",
" self.bias += learning_rate * torch.sum(errors)\n",
" \n",
" #### Logging ####\n",
" print('Epoch: %03d' % (e+1), end=\"\")\n",
" print(' | Train ACC: %.3f' % self.evaluate(x, y), end=\"\")\n",
" print(' | Cost: %.3f' % self._logit_cost(y, self.forward(x)))"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch: 001 | Train ACC: 0.000 | Cost: 5.581\n",
"Epoch: 002 | Train ACC: 0.000 | Cost: 4.882\n",
"Epoch: 003 | Train ACC: 1.000 | Cost: 4.381\n",
"Epoch: 004 | Train ACC: 1.000 | Cost: 3.998\n",
"Epoch: 005 | Train ACC: 1.000 | Cost: 3.693\n",
"Epoch: 006 | Train ACC: 1.000 | Cost: 3.443\n",
"Epoch: 007 | Train ACC: 1.000 | Cost: 3.232\n",
"Epoch: 008 | Train ACC: 1.000 | Cost: 3.052\n",
"Epoch: 009 | Train ACC: 1.000 | Cost: 2.896\n",
"Epoch: 010 | Train ACC: 1.000 | Cost: 2.758\n",
"\n",
"Model parameters:\n",
" Weights: tensor([[ 4.2267],\n",
" [-2.9613]], device='cuda:0')\n",
" Bias: tensor([0.0994], device='cuda:0')\n"
]
}
],
"source": [
"X_train_tensor = torch.tensor(X_train, dtype=torch.float32, device=device)\n",
"y_train_tensor = torch.tensor(y_train, dtype=torch.float32, device=device)\n",
"\n",
"logr = LogisticRegression1(num_features=2)\n",
"logr.train(X_train_tensor, y_train_tensor, num_epochs=10, learning_rate=0.1)\n",
"\n",
"print('\\nModel parameters:')\n",
"print(' Weights: %s' % logr.weights)\n",
"print(' Bias: %s' % logr.bias)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Evaluating the Model"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Test set accuracy: 100.00%\n"
]
}
],
"source": [
"X_test_tensor = torch.tensor(X_test, dtype=torch.float32, device=device)\n",
"y_test_tensor = torch.tensor(y_test, dtype=torch.float32, device=device)\n",
"\n",
"test_acc = logr.evaluate(X_test_tensor, y_test_tensor)\n",
"print('Test set accuracy: %.2f%%' % (test_acc*100))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAa4AAADFCAYAAAAMsRa3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VNX9//HXISYk7AJhSwiLIotAWAIJpWoVLVgXKCiWVUBC69e61P5wqVT9ClrQ1hWFsgsEkEXBokJZxIWvBBLWQMAYEEhAloSIbCYk5/fHJDHLJJnJ3Jl778zn+Xj4eJibyZ0PkDPvued+5hyltUYIIYSwixpmFyCEEEK4Q4JLCCGErUhwCSGEsBUJLiGEELYiwSWEEMJWJLiEEELYigSXEEIIW5HgEkIIYSsSXEIIIWzlGjOetHHjxrp169ZmPLUQhkhOTj6rtQ43u44iMqaEP3B1XJkSXK1btyYpKcmMpxbCEEqpo148dyjwJVATxxhdqbV+obKfkTEl/IGr48qU4BJCVOpn4Dat9QWlVDDwtVLqM631NrMLE8IKJLiEsBjtWPn6Qu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TWHi+RrpRKqu40jDdIPZWTeowjY8ocUk/lrFaPR1dcWushRhUihJAxJYQrLLXkkxBCCFEVqwbXLLMLKEPqqZzUY31W+zuReion9VTCo3tcQgghhK9Z9YpLCCGEcEqCSwghhK1YNriUUq8ppQ4qpfYqpT5SSjUwuZ77lVL7lVIFSilT2kKVUgOUUoeUUt8ppZ4xo4Yy9cxTSp1WSqVYoJaWSqnPlVKphf9Oj5tdk9XImHJag4ypimux7JiybHABG4DOWuuuwLfAsybXkwIMBr4048mVUkHAu8CdQCdgmFKqkxm1lLAAGGByDUWuAn/VWncE4oBHLPD3YzUypkqQMVUly44pywaX1vq/WuurhV9uAyJNridVa33IxBJ6A99prQ9rrXOBZTj2bTKN1vpLINvMGoporU9qrXcW/v9PQCoQYW5V1iJjqhwZU5Ww8piybHCVMQ74zOwiTBYBHC/xdQYW+SWyGqVUa6A7kGhuJZYmY0rGlMusNqY83tbEE66skq2Ueg7HJWuCFeoxkXJyTD7LUIZSqg6wCniizN5WAUHGlFtkTLnAimPK1OCqapVspdSDwN1AP+2DD5y5sWq3GTKAliW+jgQ82tLd3yilgnEMsASt9Ydm12MGGVNukTFVBauOKctOFSqlBgBPA/dqrS+ZXY8F7ADaKaXaKKVCgD8AH5tck2UopRQwF0jVWr9udj1WJGOqHBlTlbDymLJscAHTgbrABqXUbqXUTDOLUUr9XimVAfQBPlFKrffl8xfeVP8zsB7HTdLlWuv9vqyhLKXUUuAboL1SKkMp9ZCJ5fQFRgG3Ff6+7FZK/c7EeqxIxlQJMqaqZNkxJUs+CSGEsBUrX3EJIYQQ5UhwCSGEsBUJLiGEELYiwSWEEMJWJLiEEELYigSXEEIIW5HgEkIIYSv/Hx6L8u+u5Y/dAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 504x216 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"##########################\n",
"### 2D Decision Boundary\n",
"##########################\n",
"\n",
"w, b = logr.weights, logr.bias\n",
"\n",
"x_min = -2\n",
"y_min = ( (-(w[0] * x_min) - b[0]) \n",
" / w[1] )\n",
"\n",
"x_max = 2\n",
"y_max = ( (-(w[0] * x_max) - b[0]) \n",
" / w[1] )\n",
"\n",
"\n",
"fig, ax = plt.subplots(1, 2, sharex=True, figsize=(7, 3))\n",
"\n",
"ax[0].plot([x_min, x_max], [y_min, y_max])\n",
"ax[1].plot([x_min, x_max], [y_min, y_max])\n",
"\n",
"ax[0].scatter(X_train[y_train==0, 0], X_train[y_train==0, 1], label='class 0', marker='o')\n",
"ax[0].scatter(X_train[y_train==1, 0], X_train[y_train==1, 1], label='class 1', marker='s')\n",
"\n",
"ax[1].scatter(X_test[y_test==0, 0], X_test[y_test==0, 1], label='class 0', marker='o')\n",
"ax[1].scatter(X_test[y_test==1, 0], X_test[y_test==1, 1], label='class 1', marker='s')\n",
"\n",
"ax[1].legend(loc='upper left')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Low-level implementation using autograd"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"def custom_where(cond, x_1, x_2):\n",
" return (cond * x_1) + ((1-cond) * x_2)\n",
"\n",
"\n",
"class LogisticRegression2():\n",
" def __init__(self, num_features):\n",
" self.num_features = num_features\n",
" \n",
" self.weights = torch.zeros(num_features, 1, \n",
" dtype=torch.float32,\n",
" device=device,\n",
" requires_grad=True) # req. for autograd!\n",
" self.bias = torch.zeros(1, \n",
" dtype=torch.float32,\n",
" device=device,\n",
" requires_grad=True) # req. for autograd!\n",
"\n",
" def forward(self, x):\n",
" linear = torch.add(torch.mm(x, self.weights), self.bias)\n",
" probas = self._sigmoid(linear)\n",
" return probas\n",
" \n",
" def predict_labels(self, x):\n",
" probas = self.forward(x)\n",
" labels = custom_where((probas >= .5).float(), 1, 0)\n",
" return labels \n",
" \n",
" def evaluate(self, x, y):\n",
" labels = self.predict_labels(x)\n",
" accuracy = (torch.sum(labels.view(-1) == y.view(-1))).float() / y.size()[0]\n",
" return accuracy\n",
" \n",
" def _sigmoid(self, z):\n",
" return 1. / (1. + torch.exp(-z))\n",
" \n",
" def _logit_cost(self, y, proba):\n",
" tmp1 = torch.mm(-y.view(1, -1), torch.log(proba))\n",
" tmp2 = torch.mm((1 - y).view(1, -1), torch.log(1 - proba))\n",
" return tmp1 - tmp2\n",
" \n",
" def train(self, x, y, num_epochs, learning_rate=0.01):\n",
" \n",
" for e in range(num_epochs):\n",
" \n",
" #### Compute outputs ####\n",
" proba = self.forward(x)\n",
" cost = self._logit_cost(y, proba)\n",
" \n",
" #### Compute gradients ####\n",
" cost.backward()\n",
" \n",
" #### Update weights ####\n",
" \n",
" tmp = self.weights.detach()\n",
" tmp -= learning_rate * self.weights.grad\n",
" \n",
" tmp = self.bias.detach()\n",
" tmp -= learning_rate * self.bias.grad\n",
" \n",
" #### Reset gradients to zero for next iteration ####\n",
" self.weights.grad.zero_()\n",
" self.bias.grad.zero_()\n",
" \n",
" #### Logging ####\n",
" print('Epoch: %03d' % (e+1), end=\"\")\n",
" print(' | Train ACC: %.3f' % self.evaluate(x, y), end=\"\")\n",
" print(' | Cost: %.3f' % self._logit_cost(y, self.forward(x)))\n",
" \n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch: 001 | Train ACC: 0.987 | Cost: 5.581\n",
"Epoch: 002 | Train ACC: 0.987 | Cost: 4.882\n",
"Epoch: 003 | Train ACC: 1.000 | Cost: 4.381\n",
"Epoch: 004 | Train ACC: 1.000 | Cost: 3.998\n",
"Epoch: 005 | Train ACC: 1.000 | Cost: 3.693\n",
"Epoch: 006 | Train ACC: 1.000 | Cost: 3.443\n",
"Epoch: 007 | Train ACC: 1.000 | Cost: 3.232\n",
"Epoch: 008 | Train ACC: 1.000 | Cost: 3.052\n",
"Epoch: 009 | Train ACC: 1.000 | Cost: 2.896\n",
"Epoch: 010 | Train ACC: 1.000 | Cost: 2.758\n",
"\n",
"Model parameters:\n",
" Weights: tensor([[ 4.2267],\n",
" [-2.9613]], device='cuda:0', requires_grad=True)\n",
" Bias: tensor([0.0994], device='cuda:0', requires_grad=True)\n"
]
}
],
"source": [
"X_train_tensor = torch.tensor(X_train, dtype=torch.float32, device=device)\n",
"y_train_tensor = torch.tensor(y_train, dtype=torch.float32, device=device)\n",
"\n",
"logr = LogisticRegression2(num_features=2)\n",
"logr.train(X_train_tensor, y_train_tensor, num_epochs=10, learning_rate=0.1)\n",
"\n",
"print('\\nModel parameters:')\n",
"print(' Weights: %s' % logr.weights)\n",
"print(' Bias: %s' % logr.bias)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Evaluating the Model"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Test set accuracy: 100.00%\n"
]
}
],
"source": [
"X_test_tensor = torch.tensor(X_test, dtype=torch.float32, device=device)\n",
"y_test_tensor = torch.tensor(y_test, dtype=torch.float32, device=device)\n",
"\n",
"test_acc = logr.evaluate(X_test_tensor, y_test_tensor)\n",
"print('Test set accuracy: %.2f%%' % (test_acc*100))"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAa4AAADFCAYAAAAMsRa3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VNX9//HXISYk7AJhSwiLIotAWAIJpWoVLVgXKCiWVUBC69e61P5wqVT9ClrQ1hWFsgsEkEXBokJZxIWvBBLWQMAYEEhAloSIbCYk5/fHJDHLJJnJ3Jl778zn+Xj4eJibyZ0PkDPvued+5hyltUYIIYSwixpmFyCEEEK4Q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hwCSGEsBUJLiGEELYiwSWEEMJWJLiEEELYigSXEEIIW5HgEkIIYSv/Hx6L8u+u5Y/dAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 504x216 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"##########################\n",
"### 2D Decision Boundary\n",
"##########################\n",
"\n",
"w, b = logr.weights, logr.bias\n",
"\n",
"x_min = -2\n",
"y_min = ( (-(w[0] * x_min) - b[0]) \n",
" / w[1] )\n",
"\n",
"x_max = 2\n",
"y_max = ( (-(w[0] * x_max) - b[0]) \n",
" / w[1] )\n",
"\n",
"\n",
"fig, ax = plt.subplots(1, 2, sharex=True, figsize=(7, 3))\n",
"\n",
"ax[0].plot([x_min, x_max], [y_min, y_max])\n",
"ax[1].plot([x_min, x_max], [y_min, y_max])\n",
"\n",
"ax[0].scatter(X_train[y_train==0, 0], X_train[y_train==0, 1], label='class 0', marker='o')\n",
"ax[0].scatter(X_train[y_train==1, 0], X_train[y_train==1, 1], label='class 1', marker='s')\n",
"\n",
"ax[1].scatter(X_test[y_test==0, 0], X_test[y_test==0, 1], label='class 0', marker='o')\n",
"ax[1].scatter(X_test[y_test==1, 0], X_test[y_test==1, 1], label='class 1', marker='s')\n",
"\n",
"ax[1].legend(loc='upper left')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## High-level implementation using the nn.Module API"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"class LogisticRegression3(torch.nn.Module):\n",
"\n",
" def __init__(self, num_features):\n",
" super(LogisticRegression3, self).__init__()\n",
" self.linear = torch.nn.Linear(num_features, 1)\n",
" # initialize weights to zeros here,\n",
" # since we used zero weights in the\n",
" # manual approach\n",
" \n",
" self.linear.weight.detach().zero_()\n",
" self.linear.bias.detach().zero_()\n",
" # Note: the trailing underscore\n",
" # means \"in-place operation\" in the context\n",
" # of PyTorch\n",
" \n",
" def forward(self, x):\n",
" logits = self.linear(x)\n",
" probas = torch.sigmoid(logits)\n",
" return probas\n",
"\n",
"model = LogisticRegression3(num_features=2).to(device)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"##### Define cost function and set up optimizer #####\n",
"cost_fn = torch.nn.BCELoss(reduction='sum')\n",
"# average_size=False to match results in\n",
"# manual approach, where we did not normalize\n",
"# the cost by the batch size\n",
"optimizer = torch.optim.SGD(model.parameters(), lr=0.1)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch: 001 | Train ACC: 0.987 | Cost: 5.581\n",
"Epoch: 002 | Train ACC: 0.987 | Cost: 4.882\n",
"Epoch: 003 | Train ACC: 1.000 | Cost: 4.381\n",
"Epoch: 004 | Train ACC: 1.000 | Cost: 3.998\n",
"Epoch: 005 | Train ACC: 1.000 | Cost: 3.693\n",
"Epoch: 006 | Train ACC: 1.000 | Cost: 3.443\n",
"Epoch: 007 | Train ACC: 1.000 | Cost: 3.232\n",
"Epoch: 008 | Train ACC: 1.000 | Cost: 3.052\n",
"Epoch: 009 | Train ACC: 1.000 | Cost: 2.896\n",
"Epoch: 010 | Train ACC: 1.000 | Cost: 2.758\n",
"\n",
"Model parameters:\n",
" Weights: Parameter containing:\n",
"tensor([[ 4.2267, -2.9613]], device='cuda:0', requires_grad=True)\n",
" Bias: Parameter containing:\n",
"tensor([0.0994], device='cuda:0', requires_grad=True)\n"
]
}
],
"source": [
"def comp_accuracy(label_var, pred_probas):\n",
" pred_labels = custom_where((pred_probas > 0.5).float(), 1, 0).view(-1)\n",
" acc = torch.sum(pred_labels == label_var.view(-1)).float() / label_var.size(0)\n",
" return acc\n",
"\n",
"\n",
"num_epochs = 10\n",
"\n",
"X_train_tensor = torch.tensor(X_train, dtype=torch.float32, device=device)\n",
"y_train_tensor = torch.tensor(y_train, dtype=torch.float32, device=device).view(-1, 1)\n",
"\n",
"\n",
"for epoch in range(num_epochs):\n",
" \n",
" #### Compute outputs ####\n",
" out = model(X_train_tensor)\n",
" \n",
" #### Compute gradients ####\n",
" cost = cost_fn(out, y_train_tensor)\n",
" optimizer.zero_grad()\n",
" cost.backward()\n",
" \n",
" #### Update weights #### \n",
" optimizer.step()\n",
" \n",
" #### Logging #### \n",
" pred_probas = model(X_train_tensor)\n",
" acc = comp_accuracy(y_train_tensor, pred_probas)\n",
" print('Epoch: %03d' % (epoch + 1), end=\"\")\n",
" print(' | Train ACC: %.3f' % acc, end=\"\")\n",
" print(' | Cost: %.3f' % cost_fn(pred_probas, y_train_tensor))\n",
"\n",
"\n",
" \n",
"print('\\nModel parameters:')\n",
"print(' Weights: %s' % model.linear.weight)\n",
"print(' Bias: %s' % model.linear.bias)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Evaluating the Model"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Test set accuracy: 100.00%\n"
]
}
],
"source": [
"X_test_tensor = torch.tensor(X_test, dtype=torch.float32, device=device)\n",
"y_test_tensor = torch.tensor(y_test, dtype=torch.float32, device=device)\n",
"\n",
"pred_probas = model(X_test_tensor)\n",
"test_acc = comp_accuracy(y_test_tensor, pred_probas)\n",
"\n",
"print('Test set accuracy: %.2f%%' % (test_acc*100))"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAa4AAADFCAYAAAAMsRa3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VNX9//HXISYk7AJhSwiLIotAWAIJpWoVLVgXKCiWVUBC69e61P5wqVT9ClrQ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VP8zsB7HTdLlWuv9vqyhLKXUUuAboL1SKkMp9ZCJ5fQFRgG3Ff6+7FZK/c7EeqxIxlQJMqaqZNkxJUs+CSGEsBUrX3EJIYQQ5UhwCSGEsBUJLiGEELYiwSWEEMJWJLiEEELYigSXEEIIW5HgEkIIYSv/Hx6L8u+u5Y/dAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 504x216 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"##########################\n",
"### 2D Decision Boundary\n",
"##########################\n",
"\n",
"w, b = logr.weights, logr.bias\n",
"\n",
"x_min = -2\n",
"y_min = ( (-(w[0] * x_min) - b[0]) \n",
" / w[1] )\n",
"\n",
"x_max = 2\n",
"y_max = ( (-(w[0] * x_max) - b[0]) \n",
" / w[1] )\n",
"\n",
"\n",
"fig, ax = plt.subplots(1, 2, sharex=True, figsize=(7, 3))\n",
"ax[0].plot([x_min, x_max], [y_min, y_max])\n",
"ax[1].plot([x_min, x_max], [y_min, y_max])\n",
"\n",
"ax[0].scatter(X_train[y_train==0, 0], X_train[y_train==0, 1], label='class 0', marker='o')\n",
"ax[0].scatter(X_train[y_train==1, 0], X_train[y_train==1, 1], label='class 1', marker='s')\n",
"\n",
"ax[1].scatter(X_test[y_test==0, 0], X_test[y_test==0, 1], label='class 0', marker='o')\n",
"ax[1].scatter(X_test[y_test==1, 0], X_test[y_test==1, 1], label='class 1', marker='s')\n",
"\n",
"ax[1].legend(loc='upper left')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"matplotlib 3.0.2\n",
"numpy 1.15.4\n",
"torch 1.0.0\n",
"\n"
]
}
],
"source": [
"%watermark -iv"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
},
"toc": {
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}
| Jupyter Notebook | 5 | XiaoshengLin/deeplearning-models | pytorch_ipynb/basic-ml/logistic-regression.ipynb | [
"MIT"
] |
module com.networknt.ip.whitelist {
exports com.networknt.whitelist;
requires com.networknt.config;
requires com.networknt.handler;
requires com.networknt.utility;
requires undertow.core;
requires xnio.api;
requires org.slf4j;
requires java.logging;
} | Jasmin | 3 | KellyShao/light-4j | ip-whitelist/src/main/java/module-info.j | [
"Apache-2.0"
] |
/* Copyright (c) 2017-2019 Netronome Systems, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <single_ctx_test.uc>
#include "pkt_ipv6_tcp_lso_fixup.uc"
#include <config.h>
#include <global.uc>
#include <pv.uc>
#include <stdmac.uc>
/* Test __pv_lso_fixup() on an IPv6 pkt, last segment */
#define PV_TEST_SIZE_LW (PV_SIZE_LW/2)
.sig s
.reg addrlo
.reg addrhi
.reg loop_cntr
.reg loop_cntr_masked
.reg tmp
.reg addr
.reg args
.reg value
.reg pkt_no
.reg drop_flag
.reg expected[20]
.reg write $nfd_desc_wr[NFD_IN_META_SIZE_LW]
.reg volatile read $nfd_desc_rd[NFD_IN_META_SIZE_LW]
.xfer_order $nfd_desc_wr
.xfer_order $nfd_desc_rd
.reg read $pkt_rd[20]
.xfer_order $pkt_rd
.reg global port_tun_args
.set port_tun_args
.reg global rtn_addr_reg
.set rtn_addr_reg
move(port_tun_args, 0)
move(args, (6000 << 2))
move(addr, 0x00)
move($nfd_desc_wr[0], 0)
move($nfd_desc_wr[1], 0x13000000) // buf_addr
alu[$nfd_desc_wr[3], --, B, pkt_vec[0], <<16] // data_len
// TX_LSO = 1, lso seq cnt = 2, mss = 1
alu[value, --, B, 1, <<BF_L(NFD_IN_FLAGS_TX_LSO_fld)]
alu[value, value, OR, 1, <<BF_L(NFD_IN_LSO_END_fld)]
alu[value, value, OR, 2, <<BF_L(NFD_IN_LSO_SEQ_CNT_fld)]
alu[value, value, OR, 1, <<BF_L(NFD_IN_LSO_MSS_fld)]
alu[$nfd_desc_wr[2], --, B, value]
move(pkt_no, 0) // anything other than 0 causes the test to time out
aggregate_zero(expected, PV_TEST_SIZE_LW)
aggregate_zero(pkt_vec, PV_SIZE_LW)
mem[write32, $nfd_desc_wr[0], 0, <<8, addr, NFD_IN_META_SIZE_LW], ctx_swap[s]
mem[read32, $nfd_desc_rd[0], 0, <<8, addr, NFD_IN_META_SIZE_LW], ctx_swap[s]
pv_init_nfd(pkt_vec, pkt_no, $nfd_desc_rd, args, error#)
// Check PV
alu[value, --, B, $nfd_desc_rd[3], >>16] // Packet Length
alu[value, value, OR, NFD_IN_BLM_REG_BLS, <<BF_L(PV_BLS_bf)]
alu[expected[0], value, OR, pkt_no, <<16] // Packet Number
alu[expected[0], expected[0], OR, 32, <<BF_L(PV_CTM_ISL_bf)] // CTM Island
move(expected[1], 0x13000000) // Split = 0, MU Buffer Address [39:11]
move(value, 0x80000080) // A = 1, Offset = 0x80
alu[expected[2], value, OR, pkt_no, <<16] // Packet Number
immed[value, PV_GRO_NFD_START]
alu[expected[3], PROTO_IPV6_TCP, OR, value, <<8]
#define_eval _PV_OUTER_L3_OFFSET (14)
#define_eval _PV_OUTER_L4_OFFSET (14 + 40)
#define_eval _PV_INNER_L3_OFFSET (_PV_OUTER_L3_OFFSET)
#define_eval _PV_INNER_L4_OFFSET (_PV_OUTER_L4_OFFSET)
move(expected[5], ((_PV_OUTER_L3_OFFSET << 24) | (_PV_OUTER_L4_OFFSET << 16) | \
(_PV_INNER_L3_OFFSET << 8) | (_PV_INNER_L4_OFFSET << 0)))
move(expected[6], 0x000fff00)
#define_eval _PV_CHK_LOOP 0
#while (_PV_CHK_LOOP < PV_TEST_SIZE_LW)
#define_eval _PKT_VEC 'pkt_vec[/**/_PV_CHK_LOOP/**/]'
move(value, _PKT_VEC)
#define_eval _PV_INIT_EXPECT 'expected[/**/_PV_CHK_LOOP/**/]'
test_assert_equal(value, _PV_INIT_EXPECT)
#define_eval _PV_CHK_LOOP (_PV_CHK_LOOP + 1)
#endloop
alu[expected[7], --, B, $nfd_desc_rd[3], >>16] // Original Packet Length
test_assert_equal(pre_meta[7], expected[7])
// Check packet data in CTM
move(expected[0], 0x00154d12)
move(expected[1], 0x2cc60000)
move(expected[2], 0x0b000300)
move(expected[3], 0x86dd6fff)
move(expected[4], 0xffff0018) // Total Length = PV Packet Length(0x4e) - (14 + 40)
move(expected[5], 0x06fffe80)
move(expected[6], 0x00000000)
move(expected[7], 0x00000200)
move(expected[8], 0x0bfffe00)
move(expected[9], 0x03003555)
move(expected[10], 0x55556666)
move(expected[11], 0x66667777)
move(expected[12], 0x77778888)
move(expected[13], 0x8888ffff)
move(expected[14], 0xffff0000)
move(expected[15], 0x0001ffff) // Seq num = 1 (TCP_SEQ += (mss * (lso_seq - 1)))
move(expected[16], 0xffff51ff)
move(expected[17], 0xffffffff)
move(expected[18], 0xffff6acf)
move(expected[19], 0x14990000)
move(addrlo, 0x80)
move(addrhi, 0)
// nfp6000 indirect format requires 1 less
alu[value, --, B, 19, <<8]
alu[--, value, OR, 1, <<7]
mem[read32, $pkt_rd[0], addrhi, <<8, addrlo, max_20], ctx_swap[s], indirect_ref
#define_eval _PV_CHK_LOOP 0
#while (_PV_CHK_LOOP <= 19)
#define_eval _PKT_VEC '$pkt_rd[/**/_PV_CHK_LOOP/**/]'
move(value, _PKT_VEC)
#define_eval _PKT_EXPECT 'expected[/**/_PV_CHK_LOOP/**/]'
test_assert_equal(value, _PKT_EXPECT)
#define_eval _PV_CHK_LOOP (_PV_CHK_LOOP + 1)
#endloop
test_pass()
error#:
test_fail()
PV_HDR_PARSE_SUBROUTINE#:
pv_hdr_parse_subroutine(pkt_vec)
PV_SEEK_SUBROUTINE#:
pv_seek_subroutine(pkt_vec)
| UnrealScript | 4 | pcasconnetronome/nic-firmware | test/datapath/pv_init_nfd_lso_fixup_ipv6_end_test.uc | [
"BSD-2-Clause"
] |
<?xml version="1.0" encoding="UTF-8"?>
<!-- ******************************************************************* -->
<!-- -->
<!-- © Copyright IBM Corp. 2010, 2012 -->
<!-- -->
<!-- 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. -->
<!-- -->
<!-- ******************************************************************* -->
<faces-config>
<faces-config-extension>
<namespace-uri>http://www.ibm.com/xsp/coreex</namespace-uri>
<default-prefix>xe</default-prefix>
</faces-config-extension>
<complex-type>
<description>Abstract class for data source for lists coming from a data accessor</description>
<display-name>Abstract List Data Source Using Accessor</display-name>
<complex-id>com.ibm.xsp.extlib.model.DataAccessorSource</complex-id>
<complex-class>com.ibm.xsp.extlib.model.DataAccessorSource</complex-class>
<group-type-ref>com.ibm.xsp.model.group.DataSource</group-type-ref>
<property>
<!-- # "beforeRenderingPhase" should not be translated -->
<description>Indicates if the data should be refreshed each time it is rendered. If specified - occurs during "beforeRenderingPhase" notification processing. Default is not to refresh.</description>
<display-name>Clear on Rendering</display-name>
<property-name>clearOnRendering</property-name>
<property-class>boolean</property-class>
</property>
<property>
<!-- # "applicationScope" and "sessionScope" are technical terms and should not be translated. -->
<description>Used when the data source is using either the applicationScope or the sessionScope, and thus can be shared by multiple pages. This ID is used to identify the cached data.</description>
<display-name>Cache Suffix for Data Storage</display-name>
<property-name>cacheSuffix</property-name>
<property-class>java.lang.String</property-class>
</property>
<complex-extension>
<base-complex-id>dataInterface</base-complex-id>
</complex-extension>
</complex-type>
<complex-type>
<description>Abstract class for data source managing blocks of data. Block size is initially set to 20 of data items and will be changed dynamically depending on a count of items requested by some code.</description>
<display-name>Abstract List Data Source Using Accessor and Managing Data Blocks</display-name>
<complex-id>com.ibm.xsp.extlib.model.DataAccessorBlockSource</complex-id>
<complex-class>com.ibm.xsp.extlib.model.DataAccessorBlockSource</complex-class>
<property>
<description>Used by the data source if it caches blocks of data. Default is 0. Values of 0 and 1 mean that an existing block is discarded when a new block is added.</description>
<display-name>Max Block Count</display-name>
<property-name>maxBlockCount</property-name>
<property-class>int</property-class>
</property>
<property>
<description>Defines the timeout, in seconds, for a block of data. When a block times out, then it is discarded from memory and another data access is performed.</description>
<display-name>Block Timeout</display-name>
<property-name>timeout</property-name>
<property-class>int</property-class>
</property>
<complex-extension>
<base-complex-id>com.ibm.xsp.extlib.model.DataAccessorSource</base-complex-id>
</complex-extension>
</complex-type>
<complex-type>
<description>An object data source creates and manipulate an object (Java or JavaScript). The object must be serializable and owned by the data source (should not be a bean owned by a scope).</description>
<display-name>Object Data Source</display-name>
<complex-id>com.ibm.xsp.extlib.model.ObjectDataSource</complex-id>
<complex-class>com.ibm.xsp.extlib.model.ObjectDataSource</complex-class>
<group-type-ref>com.ibm.xsp.model.group.DataSource</group-type-ref>
<property>
<!-- # "false" should not be translated -->
<description>Value "true" indicates that this data source is read only. Default is "false".</description>
<display-name>Read Only Flag</display-name>
<property-name>readonly</property-name>
<property-class>boolean</property-class>
<property-extension>
</property-extension>
</property>
<property>
<description>This script is triggered to create the object handled by the data source.</description>
<display-name>Create an Object Script Expression</display-name>
<property-name>createObject</property-name>
<property-class>javax.faces.el.MethodBinding</property-class>
<property-extension>
<required>true</required>
<method-binding-property>true</method-binding-property>
</property-extension>
</property>
<property>
<!-- # "true" should not be translated -->
<description>This script is triggered to save the object handled by the data source. It will not be used if the Read Only Flag property is set to "true".</description>
<display-name>Save an Object Script Expression</display-name>
<property-name>saveObject</property-name>
<property-class>javax.faces.el.MethodBinding</property-class>
<property-extension>
<method-binding-property>true</method-binding-property>
</property-extension>
</property>
<complex-extension>
<tag-name>objectData</tag-name>
<base-complex-id>dataInterface</base-complex-id>
<designer-extension>
</designer-extension>
</complex-extension>
</complex-type>
</faces-config>
| XPages | 4 | jesse-gallagher/XPagesExtensionLibrary | extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/raw-extlib-datasource.xsp-config | [
"Apache-2.0"
] |
package {
public class Test {
}
}
function assert_modulo(val1, val2) {
trace(val1 % val2);
}
trace("//true % true");
assert_modulo(true, true);
trace("//false % true");
assert_modulo(false, true);
trace("//null % true");
assert_modulo(null, true);
trace("//undefined % true");
assert_modulo(undefined, true);
trace("//\"\" % true");
assert_modulo("", true);
trace("//\"str\" % true");
assert_modulo("str", true);
trace("//\"true\" % true");
assert_modulo("true", true);
trace("//\"false\" % true");
assert_modulo("false", true);
trace("//0.0 % true");
assert_modulo(0.0, true);
trace("//NaN % true");
assert_modulo(NaN, true);
trace("//-0.0 % true");
assert_modulo(-0.0, true);
trace("//Infinity % true");
assert_modulo(Infinity, true);
trace("//1.0 % true");
assert_modulo(1.0, true);
trace("//-1.0 % true");
assert_modulo(-1.0, true);
trace("//0xFF1306 % true");
assert_modulo(0xFF1306, true);
trace("//new Object() % true");
assert_modulo({}, true);
trace("//\"0.0\" % true");
assert_modulo("0.0", true);
trace("//\"NaN\" % true");
assert_modulo("NaN", true);
trace("//\"-0.0\" % true");
assert_modulo("-0.0", true);
trace("//\"Infinity\" % true");
assert_modulo("Infinity", true);
trace("//\"1.0\" % true");
assert_modulo("1.0", true);
trace("//\"-1.0\" % true");
assert_modulo("-1.0", true);
trace("//\"0xFF1306\" % true");
assert_modulo("0xFF1306", true);
trace("//true % false");
assert_modulo(true, false);
trace("//false % false");
assert_modulo(false, false);
trace("//null % false");
assert_modulo(null, false);
trace("//undefined % false");
assert_modulo(undefined, false);
trace("//\"\" % false");
assert_modulo("", false);
trace("//\"str\" % false");
assert_modulo("str", false);
trace("//\"true\" % false");
assert_modulo("true", false);
trace("//\"false\" % false");
assert_modulo("false", false);
trace("//0.0 % false");
assert_modulo(0.0, false);
trace("//NaN % false");
assert_modulo(NaN, false);
trace("//-0.0 % false");
assert_modulo(-0.0, false);
trace("//Infinity % false");
assert_modulo(Infinity, false);
trace("//1.0 % false");
assert_modulo(1.0, false);
trace("//-1.0 % false");
assert_modulo(-1.0, false);
trace("//0xFF1306 % false");
assert_modulo(0xFF1306, false);
trace("//new Object() % false");
assert_modulo({}, false);
trace("//\"0.0\" % false");
assert_modulo("0.0", false);
trace("//\"NaN\" % false");
assert_modulo("NaN", false);
trace("//\"-0.0\" % false");
assert_modulo("-0.0", false);
trace("//\"Infinity\" % false");
assert_modulo("Infinity", false);
trace("//\"1.0\" % false");
assert_modulo("1.0", false);
trace("//\"-1.0\" % false");
assert_modulo("-1.0", false);
trace("//\"0xFF1306\" % false");
assert_modulo("0xFF1306", false);
trace("//true % null");
assert_modulo(true, null);
trace("//false % null");
assert_modulo(false, null);
trace("//null % null");
assert_modulo(null, null);
trace("//undefined % null");
assert_modulo(undefined, null);
trace("//\"\" % null");
assert_modulo("", null);
trace("//\"str\" % null");
assert_modulo("str", null);
trace("//\"true\" % null");
assert_modulo("true", null);
trace("//\"false\" % null");
assert_modulo("false", null);
trace("//0.0 % null");
assert_modulo(0.0, null);
trace("//NaN % null");
assert_modulo(NaN, null);
trace("//-0.0 % null");
assert_modulo(-0.0, null);
trace("//Infinity % null");
assert_modulo(Infinity, null);
trace("//1.0 % null");
assert_modulo(1.0, null);
trace("//-1.0 % null");
assert_modulo(-1.0, null);
trace("//0xFF1306 % null");
assert_modulo(0xFF1306, null);
trace("//new Object() % null");
assert_modulo({}, null);
trace("//\"0.0\" % null");
assert_modulo("0.0", null);
trace("//\"NaN\" % null");
assert_modulo("NaN", null);
trace("//\"-0.0\" % null");
assert_modulo("-0.0", null);
trace("//\"Infinity\" % null");
assert_modulo("Infinity", null);
trace("//\"1.0\" % null");
assert_modulo("1.0", null);
trace("//\"-1.0\" % null");
assert_modulo("-1.0", null);
trace("//\"0xFF1306\" % null");
assert_modulo("0xFF1306", null);
trace("//true % undefined");
assert_modulo(true, undefined);
trace("//false % undefined");
assert_modulo(false, undefined);
trace("//null % undefined");
assert_modulo(null, undefined);
trace("//undefined % undefined");
assert_modulo(undefined, undefined);
trace("//\"\" % undefined");
assert_modulo("", undefined);
trace("//\"str\" % undefined");
assert_modulo("str", undefined);
trace("//\"true\" % undefined");
assert_modulo("true", undefined);
trace("//\"false\" % undefined");
assert_modulo("false", undefined);
trace("//0.0 % undefined");
assert_modulo(0.0, undefined);
trace("//NaN % undefined");
assert_modulo(NaN, undefined);
trace("//-0.0 % undefined");
assert_modulo(-0.0, undefined);
trace("//Infinity % undefined");
assert_modulo(Infinity, undefined);
trace("//1.0 % undefined");
assert_modulo(1.0, undefined);
trace("//-1.0 % undefined");
assert_modulo(-1.0, undefined);
trace("//0xFF1306 % undefined");
assert_modulo(0xFF1306, undefined);
trace("//new Object() % undefined");
assert_modulo({}, undefined);
trace("//\"0.0\" % undefined");
assert_modulo("0.0", undefined);
trace("//\"NaN\" % undefined");
assert_modulo("NaN", undefined);
trace("//\"-0.0\" % undefined");
assert_modulo("-0.0", undefined);
trace("//\"Infinity\" % undefined");
assert_modulo("Infinity", undefined);
trace("//\"1.0\" % undefined");
assert_modulo("1.0", undefined);
trace("//\"-1.0\" % undefined");
assert_modulo("-1.0", undefined);
trace("//\"0xFF1306\" % undefined");
assert_modulo("0xFF1306", undefined);
trace("//true % \"\"");
assert_modulo(true, "");
trace("//false % \"\"");
assert_modulo(false, "");
trace("//null % \"\"");
assert_modulo(null, "");
trace("//undefined % \"\"");
assert_modulo(undefined, "");
trace("//\"\" % \"\"");
assert_modulo("", "");
trace("//\"str\" % \"\"");
assert_modulo("str", "");
trace("//\"true\" % \"\"");
assert_modulo("true", "");
trace("//\"false\" % \"\"");
assert_modulo("false", "");
trace("//0.0 % \"\"");
assert_modulo(0.0, "");
trace("//NaN % \"\"");
assert_modulo(NaN, "");
trace("//-0.0 % \"\"");
assert_modulo(-0.0, "");
trace("//Infinity % \"\"");
assert_modulo(Infinity, "");
trace("//1.0 % \"\"");
assert_modulo(1.0, "");
trace("//-1.0 % \"\"");
assert_modulo(-1.0, "");
trace("//0xFF1306 % \"\"");
assert_modulo(0xFF1306, "");
trace("//new Object() % \"\"");
assert_modulo({}, "");
trace("//\"0.0\" % \"\"");
assert_modulo("0.0", "");
trace("//\"NaN\" % \"\"");
assert_modulo("NaN", "");
trace("//\"-0.0\" % \"\"");
assert_modulo("-0.0", "");
trace("//\"Infinity\" % \"\"");
assert_modulo("Infinity", "");
trace("//\"1.0\" % \"\"");
assert_modulo("1.0", "");
trace("//\"-1.0\" % \"\"");
assert_modulo("-1.0", "");
trace("//\"0xFF1306\" % \"\"");
assert_modulo("0xFF1306", "");
trace("//true % \"str\"");
assert_modulo(true, "str");
trace("//false % \"str\"");
assert_modulo(false, "str");
trace("//null % \"str\"");
assert_modulo(null, "str");
trace("//undefined % \"str\"");
assert_modulo(undefined, "str");
trace("//\"\" % \"str\"");
assert_modulo("", "str");
trace("//\"str\" % \"str\"");
assert_modulo("str", "str");
trace("//\"true\" % \"str\"");
assert_modulo("true", "str");
trace("//\"false\" % \"str\"");
assert_modulo("false", "str");
trace("//0.0 % \"str\"");
assert_modulo(0.0, "str");
trace("//NaN % \"str\"");
assert_modulo(NaN, "str");
trace("//-0.0 % \"str\"");
assert_modulo(-0.0, "str");
trace("//Infinity % \"str\"");
assert_modulo(Infinity, "str");
trace("//1.0 % \"str\"");
assert_modulo(1.0, "str");
trace("//-1.0 % \"str\"");
assert_modulo(-1.0, "str");
trace("//0xFF1306 % \"str\"");
assert_modulo(0xFF1306, "str");
trace("//new Object() % \"str\"");
assert_modulo({}, "str");
trace("//\"0.0\" % \"str\"");
assert_modulo("0.0", "str");
trace("//\"NaN\" % \"str\"");
assert_modulo("NaN", "str");
trace("//\"-0.0\" % \"str\"");
assert_modulo("-0.0", "str");
trace("//\"Infinity\" % \"str\"");
assert_modulo("Infinity", "str");
trace("//\"1.0\" % \"str\"");
assert_modulo("1.0", "str");
trace("//\"-1.0\" % \"str\"");
assert_modulo("-1.0", "str");
trace("//\"0xFF1306\" % \"str\"");
assert_modulo("0xFF1306", "str");
trace("//true % \"true\"");
assert_modulo(true, "true");
trace("//false % \"true\"");
assert_modulo(false, "true");
trace("//null % \"true\"");
assert_modulo(null, "true");
trace("//undefined % \"true\"");
assert_modulo(undefined, "true");
trace("//\"\" % \"true\"");
assert_modulo("", "true");
trace("//\"str\" % \"true\"");
assert_modulo("str", "true");
trace("//\"true\" % \"true\"");
assert_modulo("true", "true");
trace("//\"false\" % \"true\"");
assert_modulo("false", "true");
trace("//0.0 % \"true\"");
assert_modulo(0.0, "true");
trace("//NaN % \"true\"");
assert_modulo(NaN, "true");
trace("//-0.0 % \"true\"");
assert_modulo(-0.0, "true");
trace("//Infinity % \"true\"");
assert_modulo(Infinity, "true");
trace("//1.0 % \"true\"");
assert_modulo(1.0, "true");
trace("//-1.0 % \"true\"");
assert_modulo(-1.0, "true");
trace("//0xFF1306 % \"true\"");
assert_modulo(0xFF1306, "true");
trace("//new Object() % \"true\"");
assert_modulo({}, "true");
trace("//\"0.0\" % \"true\"");
assert_modulo("0.0", "true");
trace("//\"NaN\" % \"true\"");
assert_modulo("NaN", "true");
trace("//\"-0.0\" % \"true\"");
assert_modulo("-0.0", "true");
trace("//\"Infinity\" % \"true\"");
assert_modulo("Infinity", "true");
trace("//\"1.0\" % \"true\"");
assert_modulo("1.0", "true");
trace("//\"-1.0\" % \"true\"");
assert_modulo("-1.0", "true");
trace("//\"0xFF1306\" % \"true\"");
assert_modulo("0xFF1306", "true");
trace("//true % \"false\"");
assert_modulo(true, "false");
trace("//false % \"false\"");
assert_modulo(false, "false");
trace("//null % \"false\"");
assert_modulo(null, "false");
trace("//undefined % \"false\"");
assert_modulo(undefined, "false");
trace("//\"\" % \"false\"");
assert_modulo("", "false");
trace("//\"str\" % \"false\"");
assert_modulo("str", "false");
trace("//\"true\" % \"false\"");
assert_modulo("true", "false");
trace("//\"false\" % \"false\"");
assert_modulo("false", "false");
trace("//0.0 % \"false\"");
assert_modulo(0.0, "false");
trace("//NaN % \"false\"");
assert_modulo(NaN, "false");
trace("//-0.0 % \"false\"");
assert_modulo(-0.0, "false");
trace("//Infinity % \"false\"");
assert_modulo(Infinity, "false");
trace("//1.0 % \"false\"");
assert_modulo(1.0, "false");
trace("//-1.0 % \"false\"");
assert_modulo(-1.0, "false");
trace("//0xFF1306 % \"false\"");
assert_modulo(0xFF1306, "false");
trace("//new Object() % \"false\"");
assert_modulo({}, "false");
trace("//\"0.0\" % \"false\"");
assert_modulo("0.0", "false");
trace("//\"NaN\" % \"false\"");
assert_modulo("NaN", "false");
trace("//\"-0.0\" % \"false\"");
assert_modulo("-0.0", "false");
trace("//\"Infinity\" % \"false\"");
assert_modulo("Infinity", "false");
trace("//\"1.0\" % \"false\"");
assert_modulo("1.0", "false");
trace("//\"-1.0\" % \"false\"");
assert_modulo("-1.0", "false");
trace("//\"0xFF1306\" % \"false\"");
assert_modulo("0xFF1306", "false");
trace("//true % 0.0");
assert_modulo(true, 0.0);
trace("//false % 0.0");
assert_modulo(false, 0.0);
trace("//null % 0.0");
assert_modulo(null, 0.0);
trace("//undefined % 0.0");
assert_modulo(undefined, 0.0);
trace("//\"\" % 0.0");
assert_modulo("", 0.0);
trace("//\"str\" % 0.0");
assert_modulo("str", 0.0);
trace("//\"true\" % 0.0");
assert_modulo("true", 0.0);
trace("//\"false\" % 0.0");
assert_modulo("false", 0.0);
trace("//0.0 % 0.0");
assert_modulo(0.0, 0.0);
trace("//NaN % 0.0");
assert_modulo(NaN, 0.0);
trace("//-0.0 % 0.0");
assert_modulo(-0.0, 0.0);
trace("//Infinity % 0.0");
assert_modulo(Infinity, 0.0);
trace("//1.0 % 0.0");
assert_modulo(1.0, 0.0);
trace("//-1.0 % 0.0");
assert_modulo(-1.0, 0.0);
trace("//0xFF1306 % 0.0");
assert_modulo(0xFF1306, 0.0);
trace("//new Object() % 0.0");
assert_modulo({}, 0.0);
trace("//\"0.0\" % 0.0");
assert_modulo("0.0", 0.0);
trace("//\"NaN\" % 0.0");
assert_modulo("NaN", 0.0);
trace("//\"-0.0\" % 0.0");
assert_modulo("-0.0", 0.0);
trace("//\"Infinity\" % 0.0");
assert_modulo("Infinity", 0.0);
trace("//\"1.0\" % 0.0");
assert_modulo("1.0", 0.0);
trace("//\"-1.0\" % 0.0");
assert_modulo("-1.0", 0.0);
trace("//\"0xFF1306\" % 0.0");
assert_modulo("0xFF1306", 0.0);
trace("//true % NaN");
assert_modulo(true, NaN);
trace("//false % NaN");
assert_modulo(false, NaN);
trace("//null % NaN");
assert_modulo(null, NaN);
trace("//undefined % NaN");
assert_modulo(undefined, NaN);
trace("//\"\" % NaN");
assert_modulo("", NaN);
trace("//\"str\" % NaN");
assert_modulo("str", NaN);
trace("//\"true\" % NaN");
assert_modulo("true", NaN);
trace("//\"false\" % NaN");
assert_modulo("false", NaN);
trace("//0.0 % NaN");
assert_modulo(0.0, NaN);
trace("//NaN % NaN");
assert_modulo(NaN, NaN);
trace("//-0.0 % NaN");
assert_modulo(-0.0, NaN);
trace("//Infinity % NaN");
assert_modulo(Infinity, NaN);
trace("//1.0 % NaN");
assert_modulo(1.0, NaN);
trace("//-1.0 % NaN");
assert_modulo(-1.0, NaN);
trace("//0xFF1306 % NaN");
assert_modulo(0xFF1306, NaN);
trace("//new Object() % NaN");
assert_modulo({}, NaN);
trace("//\"0.0\" % NaN");
assert_modulo("0.0", NaN);
trace("//\"NaN\" % NaN");
assert_modulo("NaN", NaN);
trace("//\"-0.0\" % NaN");
assert_modulo("-0.0", NaN);
trace("//\"Infinity\" % NaN");
assert_modulo("Infinity", NaN);
trace("//\"1.0\" % NaN");
assert_modulo("1.0", NaN);
trace("//\"-1.0\" % NaN");
assert_modulo("-1.0", NaN);
trace("//\"0xFF1306\" % NaN");
assert_modulo("0xFF1306", NaN);
trace("//true % -0.0");
assert_modulo(true, -0.0);
trace("//false % -0.0");
assert_modulo(false, -0.0);
trace("//null % -0.0");
assert_modulo(null, -0.0);
trace("//undefined % -0.0");
assert_modulo(undefined, -0.0);
trace("//\"\" % -0.0");
assert_modulo("", -0.0);
trace("//\"str\" % -0.0");
assert_modulo("str", -0.0);
trace("//\"true\" % -0.0");
assert_modulo("true", -0.0);
trace("//\"false\" % -0.0");
assert_modulo("false", -0.0);
trace("//0.0 % -0.0");
assert_modulo(0.0, -0.0);
trace("//NaN % -0.0");
assert_modulo(NaN, -0.0);
trace("//-0.0 % -0.0");
assert_modulo(-0.0, -0.0);
trace("//Infinity % -0.0");
assert_modulo(Infinity, -0.0);
trace("//1.0 % -0.0");
assert_modulo(1.0, -0.0);
trace("//-1.0 % -0.0");
assert_modulo(-1.0, -0.0);
trace("//0xFF1306 % -0.0");
assert_modulo(0xFF1306, -0.0);
trace("//new Object() % -0.0");
assert_modulo({}, -0.0);
trace("//\"0.0\" % -0.0");
assert_modulo("0.0", -0.0);
trace("//\"NaN\" % -0.0");
assert_modulo("NaN", -0.0);
trace("//\"-0.0\" % -0.0");
assert_modulo("-0.0", -0.0);
trace("//\"Infinity\" % -0.0");
assert_modulo("Infinity", -0.0);
trace("//\"1.0\" % -0.0");
assert_modulo("1.0", -0.0);
trace("//\"-1.0\" % -0.0");
assert_modulo("-1.0", -0.0);
trace("//\"0xFF1306\" % -0.0");
assert_modulo("0xFF1306", -0.0);
trace("//true % Infinity");
assert_modulo(true, Infinity);
trace("//false % Infinity");
assert_modulo(false, Infinity);
trace("//null % Infinity");
assert_modulo(null, Infinity);
trace("//undefined % Infinity");
assert_modulo(undefined, Infinity);
trace("//\"\" % Infinity");
assert_modulo("", Infinity);
trace("//\"str\" % Infinity");
assert_modulo("str", Infinity);
trace("//\"true\" % Infinity");
assert_modulo("true", Infinity);
trace("//\"false\" % Infinity");
assert_modulo("false", Infinity);
trace("//0.0 % Infinity");
assert_modulo(0.0, Infinity);
trace("//NaN % Infinity");
assert_modulo(NaN, Infinity);
trace("//-0.0 % Infinity");
assert_modulo(-0.0, Infinity);
trace("//Infinity % Infinity");
assert_modulo(Infinity, Infinity);
trace("//1.0 % Infinity");
assert_modulo(1.0, Infinity);
trace("//-1.0 % Infinity");
assert_modulo(-1.0, Infinity);
trace("//0xFF1306 % Infinity");
assert_modulo(0xFF1306, Infinity);
trace("//new Object() % Infinity");
assert_modulo({}, Infinity);
trace("//\"0.0\" % Infinity");
assert_modulo("0.0", Infinity);
trace("//\"NaN\" % Infinity");
assert_modulo("NaN", Infinity);
trace("//\"-0.0\" % Infinity");
assert_modulo("-0.0", Infinity);
trace("//\"Infinity\" % Infinity");
assert_modulo("Infinity", Infinity);
trace("//\"1.0\" % Infinity");
assert_modulo("1.0", Infinity);
trace("//\"-1.0\" % Infinity");
assert_modulo("-1.0", Infinity);
trace("//\"0xFF1306\" % Infinity");
assert_modulo("0xFF1306", Infinity);
trace("//true % 1.0");
assert_modulo(true, 1.0);
trace("//false % 1.0");
assert_modulo(false, 1.0);
trace("//null % 1.0");
assert_modulo(null, 1.0);
trace("//undefined % 1.0");
assert_modulo(undefined, 1.0);
trace("//\"\" % 1.0");
assert_modulo("", 1.0);
trace("//\"str\" % 1.0");
assert_modulo("str", 1.0);
trace("//\"true\" % 1.0");
assert_modulo("true", 1.0);
trace("//\"false\" % 1.0");
assert_modulo("false", 1.0);
trace("//0.0 % 1.0");
assert_modulo(0.0, 1.0);
trace("//NaN % 1.0");
assert_modulo(NaN, 1.0);
trace("//-0.0 % 1.0");
assert_modulo(-0.0, 1.0);
trace("//Infinity % 1.0");
assert_modulo(Infinity, 1.0);
trace("//1.0 % 1.0");
assert_modulo(1.0, 1.0);
trace("//-1.0 % 1.0");
assert_modulo(-1.0, 1.0);
trace("//0xFF1306 % 1.0");
assert_modulo(0xFF1306, 1.0);
trace("//new Object() % 1.0");
assert_modulo({}, 1.0);
trace("//\"0.0\" % 1.0");
assert_modulo("0.0", 1.0);
trace("//\"NaN\" % 1.0");
assert_modulo("NaN", 1.0);
trace("//\"-0.0\" % 1.0");
assert_modulo("-0.0", 1.0);
trace("//\"Infinity\" % 1.0");
assert_modulo("Infinity", 1.0);
trace("//\"1.0\" % 1.0");
assert_modulo("1.0", 1.0);
trace("//\"-1.0\" % 1.0");
assert_modulo("-1.0", 1.0);
trace("//\"0xFF1306\" % 1.0");
assert_modulo("0xFF1306", 1.0);
trace("//true % -1.0");
assert_modulo(true, -1.0);
trace("//false % -1.0");
assert_modulo(false, -1.0);
trace("//null % -1.0");
assert_modulo(null, -1.0);
trace("//undefined % -1.0");
assert_modulo(undefined, -1.0);
trace("//\"\" % -1.0");
assert_modulo("", -1.0);
trace("//\"str\" % -1.0");
assert_modulo("str", -1.0);
trace("//\"true\" % -1.0");
assert_modulo("true", -1.0);
trace("//\"false\" % -1.0");
assert_modulo("false", -1.0);
trace("//0.0 % -1.0");
assert_modulo(0.0, -1.0);
trace("//NaN % -1.0");
assert_modulo(NaN, -1.0);
trace("//-0.0 % -1.0");
assert_modulo(-0.0, -1.0);
trace("//Infinity % -1.0");
assert_modulo(Infinity, -1.0);
trace("//1.0 % -1.0");
assert_modulo(1.0, -1.0);
trace("//-1.0 % -1.0");
assert_modulo(-1.0, -1.0);
trace("//0xFF1306 % -1.0");
assert_modulo(0xFF1306, -1.0);
trace("//new Object() % -1.0");
assert_modulo({}, -1.0);
trace("//\"0.0\" % -1.0");
assert_modulo("0.0", -1.0);
trace("//\"NaN\" % -1.0");
assert_modulo("NaN", -1.0);
trace("//\"-0.0\" % -1.0");
assert_modulo("-0.0", -1.0);
trace("//\"Infinity\" % -1.0");
assert_modulo("Infinity", -1.0);
trace("//\"1.0\" % -1.0");
assert_modulo("1.0", -1.0);
trace("//\"-1.0\" % -1.0");
assert_modulo("-1.0", -1.0);
trace("//\"0xFF1306\" % -1.0");
assert_modulo("0xFF1306", -1.0);
trace("//true % 0xFF1306");
assert_modulo(true, 0xFF1306);
trace("//false % 0xFF1306");
assert_modulo(false, 0xFF1306);
trace("//null % 0xFF1306");
assert_modulo(null, 0xFF1306);
trace("//undefined % 0xFF1306");
assert_modulo(undefined, 0xFF1306);
trace("//\"\" % 0xFF1306");
assert_modulo("", 0xFF1306);
trace("//\"str\" % 0xFF1306");
assert_modulo("str", 0xFF1306);
trace("//\"true\" % 0xFF1306");
assert_modulo("true", 0xFF1306);
trace("//\"false\" % 0xFF1306");
assert_modulo("false", 0xFF1306);
trace("//0.0 % 0xFF1306");
assert_modulo(0.0, 0xFF1306);
trace("//NaN % 0xFF1306");
assert_modulo(NaN, 0xFF1306);
trace("//-0.0 % 0xFF1306");
assert_modulo(-0.0, 0xFF1306);
trace("//Infinity % 0xFF1306");
assert_modulo(Infinity, 0xFF1306);
trace("//1.0 % 0xFF1306");
assert_modulo(1.0, 0xFF1306);
trace("//-1.0 % 0xFF1306");
assert_modulo(-1.0, 0xFF1306);
trace("//0xFF1306 % 0xFF1306");
assert_modulo(0xFF1306, 0xFF1306);
trace("//new Object() % 0xFF1306");
assert_modulo({}, 0xFF1306);
trace("//\"0.0\" % 0xFF1306");
assert_modulo("0.0", 0xFF1306);
trace("//\"NaN\" % 0xFF1306");
assert_modulo("NaN", 0xFF1306);
trace("//\"-0.0\" % 0xFF1306");
assert_modulo("-0.0", 0xFF1306);
trace("//\"Infinity\" % 0xFF1306");
assert_modulo("Infinity", 0xFF1306);
trace("//\"1.0\" % 0xFF1306");
assert_modulo("1.0", 0xFF1306);
trace("//\"-1.0\" % 0xFF1306");
assert_modulo("-1.0", 0xFF1306);
trace("//\"0xFF1306\" % 0xFF1306");
assert_modulo("0xFF1306", 0xFF1306);
trace("//true % new Object()");
assert_modulo(true, {});
trace("//false % new Object()");
assert_modulo(false, {});
trace("//null % new Object()");
assert_modulo(null, {});
trace("//undefined % new Object()");
assert_modulo(undefined, {});
trace("//\"\" % new Object()");
assert_modulo("", {});
trace("//\"str\" % new Object()");
assert_modulo("str", {});
trace("//\"true\" % new Object()");
assert_modulo("true", {});
trace("//\"false\" % new Object()");
assert_modulo("false", {});
trace("//0.0 % new Object()");
assert_modulo(0.0, {});
trace("//NaN % new Object()");
assert_modulo(NaN, {});
trace("//-0.0 % new Object()");
assert_modulo(-0.0, {});
trace("//Infinity % new Object()");
assert_modulo(Infinity, {});
trace("//1.0 % new Object()");
assert_modulo(1.0, {});
trace("//-1.0 % new Object()");
assert_modulo(-1.0, {});
trace("//0xFF1306 % new Object()");
assert_modulo(0xFF1306, {});
trace("//new Object() % new Object()");
assert_modulo({}, {});
trace("//\"0.0\" % new Object()");
assert_modulo("0.0", {});
trace("//\"NaN\" % new Object()");
assert_modulo("NaN", {});
trace("//\"-0.0\" % new Object()");
assert_modulo("-0.0", {});
trace("//\"Infinity\" % new Object()");
assert_modulo("Infinity", {});
trace("//\"1.0\" % new Object()");
assert_modulo("1.0", {});
trace("//\"-1.0\" % new Object()");
assert_modulo("-1.0", {});
trace("//\"0xFF1306\" % new Object()");
assert_modulo("0xFF1306", {});
trace("//true % \"0.0\"");
assert_modulo(true, "0.0");
trace("//false % \"0.0\"");
assert_modulo(false, "0.0");
trace("//null % \"0.0\"");
assert_modulo(null, "0.0");
trace("//undefined % \"0.0\"");
assert_modulo(undefined, "0.0");
trace("//\"\" % \"0.0\"");
assert_modulo("", "0.0");
trace("//\"str\" % \"0.0\"");
assert_modulo("str", "0.0");
trace("//\"true\" % \"0.0\"");
assert_modulo("true", "0.0");
trace("//\"false\" % \"0.0\"");
assert_modulo("false", "0.0");
trace("//0.0 % \"0.0\"");
assert_modulo(0.0, "0.0");
trace("//NaN % \"0.0\"");
assert_modulo(NaN, "0.0");
trace("//-0.0 % \"0.0\"");
assert_modulo(-0.0, "0.0");
trace("//Infinity % \"0.0\"");
assert_modulo(Infinity, "0.0");
trace("//1.0 % \"0.0\"");
assert_modulo(1.0, "0.0");
trace("//-1.0 % \"0.0\"");
assert_modulo(-1.0, "0.0");
trace("//0xFF1306 % \"0.0\"");
assert_modulo(0xFF1306, "0.0");
trace("//new Object() % \"0.0\"");
assert_modulo({}, "0.0");
trace("//\"0.0\" % \"0.0\"");
assert_modulo("0.0", "0.0");
trace("//\"NaN\" % \"0.0\"");
assert_modulo("NaN", "0.0");
trace("//\"-0.0\" % \"0.0\"");
assert_modulo("-0.0", "0.0");
trace("//\"Infinity\" % \"0.0\"");
assert_modulo("Infinity", "0.0");
trace("//\"1.0\" % \"0.0\"");
assert_modulo("1.0", "0.0");
trace("//\"-1.0\" % \"0.0\"");
assert_modulo("-1.0", "0.0");
trace("//\"0xFF1306\" % \"0.0\"");
assert_modulo("0xFF1306", "0.0");
trace("//true % \"NaN\"");
assert_modulo(true, "NaN");
trace("//false % \"NaN\"");
assert_modulo(false, "NaN");
trace("//null % \"NaN\"");
assert_modulo(null, "NaN");
trace("//undefined % \"NaN\"");
assert_modulo(undefined, "NaN");
trace("//\"\" % \"NaN\"");
assert_modulo("", "NaN");
trace("//\"str\" % \"NaN\"");
assert_modulo("str", "NaN");
trace("//\"true\" % \"NaN\"");
assert_modulo("true", "NaN");
trace("//\"false\" % \"NaN\"");
assert_modulo("false", "NaN");
trace("//0.0 % \"NaN\"");
assert_modulo(0.0, "NaN");
trace("//NaN % \"NaN\"");
assert_modulo(NaN, "NaN");
trace("//-0.0 % \"NaN\"");
assert_modulo(-0.0, "NaN");
trace("//Infinity % \"NaN\"");
assert_modulo(Infinity, "NaN");
trace("//1.0 % \"NaN\"");
assert_modulo(1.0, "NaN");
trace("//-1.0 % \"NaN\"");
assert_modulo(-1.0, "NaN");
trace("//0xFF1306 % \"NaN\"");
assert_modulo(0xFF1306, "NaN");
trace("//new Object() % \"NaN\"");
assert_modulo({}, "NaN");
trace("//\"0.0\" % \"NaN\"");
assert_modulo("0.0", "NaN");
trace("//\"NaN\" % \"NaN\"");
assert_modulo("NaN", "NaN");
trace("//\"-0.0\" % \"NaN\"");
assert_modulo("-0.0", "NaN");
trace("//\"Infinity\" % \"NaN\"");
assert_modulo("Infinity", "NaN");
trace("//\"1.0\" % \"NaN\"");
assert_modulo("1.0", "NaN");
trace("//\"-1.0\" % \"NaN\"");
assert_modulo("-1.0", "NaN");
trace("//\"0xFF1306\" % \"NaN\"");
assert_modulo("0xFF1306", "NaN");
trace("//true % \"-0.0\"");
assert_modulo(true, "-0.0");
trace("//false % \"-0.0\"");
assert_modulo(false, "-0.0");
trace("//null % \"-0.0\"");
assert_modulo(null, "-0.0");
trace("//undefined % \"-0.0\"");
assert_modulo(undefined, "-0.0");
trace("//\"\" % \"-0.0\"");
assert_modulo("", "-0.0");
trace("//\"str\" % \"-0.0\"");
assert_modulo("str", "-0.0");
trace("//\"true\" % \"-0.0\"");
assert_modulo("true", "-0.0");
trace("//\"false\" % \"-0.0\"");
assert_modulo("false", "-0.0");
trace("//0.0 % \"-0.0\"");
assert_modulo(0.0, "-0.0");
trace("//NaN % \"-0.0\"");
assert_modulo(NaN, "-0.0");
trace("//-0.0 % \"-0.0\"");
assert_modulo(-0.0, "-0.0");
trace("//Infinity % \"-0.0\"");
assert_modulo(Infinity, "-0.0");
trace("//1.0 % \"-0.0\"");
assert_modulo(1.0, "-0.0");
trace("//-1.0 % \"-0.0\"");
assert_modulo(-1.0, "-0.0");
trace("//0xFF1306 % \"-0.0\"");
assert_modulo(0xFF1306, "-0.0");
trace("//new Object() % \"-0.0\"");
assert_modulo({}, "-0.0");
trace("//\"0.0\" % \"-0.0\"");
assert_modulo("0.0", "-0.0");
trace("//\"NaN\" % \"-0.0\"");
assert_modulo("NaN", "-0.0");
trace("//\"-0.0\" % \"-0.0\"");
assert_modulo("-0.0", "-0.0");
trace("//\"Infinity\" % \"-0.0\"");
assert_modulo("Infinity", "-0.0");
trace("//\"1.0\" % \"-0.0\"");
assert_modulo("1.0", "-0.0");
trace("//\"-1.0\" % \"-0.0\"");
assert_modulo("-1.0", "-0.0");
trace("//\"0xFF1306\" % \"-0.0\"");
assert_modulo("0xFF1306", "-0.0");
trace("//true % \"Infinity\"");
assert_modulo(true, "Infinity");
trace("//false % \"Infinity\"");
assert_modulo(false, "Infinity");
trace("//null % \"Infinity\"");
assert_modulo(null, "Infinity");
trace("//undefined % \"Infinity\"");
assert_modulo(undefined, "Infinity");
trace("//\"\" % \"Infinity\"");
assert_modulo("", "Infinity");
trace("//\"str\" % \"Infinity\"");
assert_modulo("str", "Infinity");
trace("//\"true\" % \"Infinity\"");
assert_modulo("true", "Infinity");
trace("//\"false\" % \"Infinity\"");
assert_modulo("false", "Infinity");
trace("//0.0 % \"Infinity\"");
assert_modulo(0.0, "Infinity");
trace("//NaN % \"Infinity\"");
assert_modulo(NaN, "Infinity");
trace("//-0.0 % \"Infinity\"");
assert_modulo(-0.0, "Infinity");
trace("//Infinity % \"Infinity\"");
assert_modulo(Infinity, "Infinity");
trace("//1.0 % \"Infinity\"");
assert_modulo(1.0, "Infinity");
trace("//-1.0 % \"Infinity\"");
assert_modulo(-1.0, "Infinity");
trace("//0xFF1306 % \"Infinity\"");
assert_modulo(0xFF1306, "Infinity");
trace("//new Object() % \"Infinity\"");
assert_modulo({}, "Infinity");
trace("//\"0.0\" % \"Infinity\"");
assert_modulo("0.0", "Infinity");
trace("//\"NaN\" % \"Infinity\"");
assert_modulo("NaN", "Infinity");
trace("//\"-0.0\" % \"Infinity\"");
assert_modulo("-0.0", "Infinity");
trace("//\"Infinity\" % \"Infinity\"");
assert_modulo("Infinity", "Infinity");
trace("//\"1.0\" % \"Infinity\"");
assert_modulo("1.0", "Infinity");
trace("//\"-1.0\" % \"Infinity\"");
assert_modulo("-1.0", "Infinity");
trace("//\"0xFF1306\" % \"Infinity\"");
assert_modulo("0xFF1306", "Infinity");
trace("//true % \"1.0\"");
assert_modulo(true, "1.0");
trace("//false % \"1.0\"");
assert_modulo(false, "1.0");
trace("//null % \"1.0\"");
assert_modulo(null, "1.0");
trace("//undefined % \"1.0\"");
assert_modulo(undefined, "1.0");
trace("//\"\" % \"1.0\"");
assert_modulo("", "1.0");
trace("//\"str\" % \"1.0\"");
assert_modulo("str", "1.0");
trace("//\"true\" % \"1.0\"");
assert_modulo("true", "1.0");
trace("//\"false\" % \"1.0\"");
assert_modulo("false", "1.0");
trace("//0.0 % \"1.0\"");
assert_modulo(0.0, "1.0");
trace("//NaN % \"1.0\"");
assert_modulo(NaN, "1.0");
trace("//-0.0 % \"1.0\"");
assert_modulo(-0.0, "1.0");
trace("//Infinity % \"1.0\"");
assert_modulo(Infinity, "1.0");
trace("//1.0 % \"1.0\"");
assert_modulo(1.0, "1.0");
trace("//-1.0 % \"1.0\"");
assert_modulo(-1.0, "1.0");
trace("//0xFF1306 % \"1.0\"");
assert_modulo(0xFF1306, "1.0");
trace("//new Object() % \"1.0\"");
assert_modulo({}, "1.0");
trace("//\"0.0\" % \"1.0\"");
assert_modulo("0.0", "1.0");
trace("//\"NaN\" % \"1.0\"");
assert_modulo("NaN", "1.0");
trace("//\"-0.0\" % \"1.0\"");
assert_modulo("-0.0", "1.0");
trace("//\"Infinity\" % \"1.0\"");
assert_modulo("Infinity", "1.0");
trace("//\"1.0\" % \"1.0\"");
assert_modulo("1.0", "1.0");
trace("//\"-1.0\" % \"1.0\"");
assert_modulo("-1.0", "1.0");
trace("//\"0xFF1306\" % \"1.0\"");
assert_modulo("0xFF1306", "1.0");
trace("//true % \"-1.0\"");
assert_modulo(true, "-1.0");
trace("//false % \"-1.0\"");
assert_modulo(false, "-1.0");
trace("//null % \"-1.0\"");
assert_modulo(null, "-1.0");
trace("//undefined % \"-1.0\"");
assert_modulo(undefined, "-1.0");
trace("//\"\" % \"-1.0\"");
assert_modulo("", "-1.0");
trace("//\"str\" % \"-1.0\"");
assert_modulo("str", "-1.0");
trace("//\"true\" % \"-1.0\"");
assert_modulo("true", "-1.0");
trace("//\"false\" % \"-1.0\"");
assert_modulo("false", "-1.0");
trace("//0.0 % \"-1.0\"");
assert_modulo(0.0, "-1.0");
trace("//NaN % \"-1.0\"");
assert_modulo(NaN, "-1.0");
trace("//-0.0 % \"-1.0\"");
assert_modulo(-0.0, "-1.0");
trace("//Infinity % \"-1.0\"");
assert_modulo(Infinity, "-1.0");
trace("//1.0 % \"-1.0\"");
assert_modulo(1.0, "-1.0");
trace("//-1.0 % \"-1.0\"");
assert_modulo(-1.0, "-1.0");
trace("//0xFF1306 % \"-1.0\"");
assert_modulo(0xFF1306, "-1.0");
trace("//new Object() % \"-1.0\"");
assert_modulo({}, "-1.0");
trace("//\"0.0\" % \"-1.0\"");
assert_modulo("0.0", "-1.0");
trace("//\"NaN\" % \"-1.0\"");
assert_modulo("NaN", "-1.0");
trace("//\"-0.0\" % \"-1.0\"");
assert_modulo("-0.0", "-1.0");
trace("//\"Infinity\" % \"-1.0\"");
assert_modulo("Infinity", "-1.0");
trace("//\"1.0\" % \"-1.0\"");
assert_modulo("1.0", "-1.0");
trace("//\"-1.0\" % \"-1.0\"");
assert_modulo("-1.0", "-1.0");
trace("//\"0xFF1306\" % \"-1.0\"");
assert_modulo("0xFF1306", "-1.0");
trace("//true % \"0xFF1306\"");
assert_modulo(true, "0xFF1306");
trace("//false % \"0xFF1306\"");
assert_modulo(false, "0xFF1306");
trace("//null % \"0xFF1306\"");
assert_modulo(null, "0xFF1306");
trace("//undefined % \"0xFF1306\"");
assert_modulo(undefined, "0xFF1306");
trace("//\"\" % \"0xFF1306\"");
assert_modulo("", "0xFF1306");
trace("//\"str\" % \"0xFF1306\"");
assert_modulo("str", "0xFF1306");
trace("//\"true\" % \"0xFF1306\"");
assert_modulo("true", "0xFF1306");
trace("//\"false\" % \"0xFF1306\"");
assert_modulo("false", "0xFF1306");
trace("//0.0 % \"0xFF1306\"");
assert_modulo(0.0, "0xFF1306");
trace("//NaN % \"0xFF1306\"");
assert_modulo(NaN, "0xFF1306");
trace("//-0.0 % \"0xFF1306\"");
assert_modulo(-0.0, "0xFF1306");
trace("//Infinity % \"0xFF1306\"");
assert_modulo(Infinity, "0xFF1306");
trace("//1.0 % \"0xFF1306\"");
assert_modulo(1.0, "0xFF1306");
trace("//-1.0 % \"0xFF1306\"");
assert_modulo(-1.0, "0xFF1306");
trace("//0xFF1306 % \"0xFF1306\"");
assert_modulo(0xFF1306, "0xFF1306");
trace("//new Object() % \"0xFF1306\"");
assert_modulo({}, "0xFF1306");
trace("//\"0.0\" % \"0xFF1306\"");
assert_modulo("0.0", "0xFF1306");
trace("//\"NaN\" % \"0xFF1306\"");
assert_modulo("NaN", "0xFF1306");
trace("//\"-0.0\" % \"0xFF1306\"");
assert_modulo("-0.0", "0xFF1306");
trace("//\"Infinity\" % \"0xFF1306\"");
assert_modulo("Infinity", "0xFF1306");
trace("//\"1.0\" % \"0xFF1306\"");
assert_modulo("1.0", "0xFF1306");
trace("//\"-1.0\" % \"0xFF1306\"");
assert_modulo("-1.0", "0xFF1306");
trace("//\"0xFF1306\" % \"0xFF1306\"");
assert_modulo("0xFF1306", "0xFF1306"); | ActionScript | 3 | Sprak1/ruffle | tests/tests/swfs/avm2/modulo/Test.as | [
"Apache-2.0",
"Unlicense"
] |
Particle p1;
Particle p2;
void setup() {
size(600,400);
p1 = new Particle(100,100,50);
p2 = new Particle(500,200,100);
}
void draw() {
background(0);
if (p2.overlaps(p1)) {
background(255,0,0);
}
p2.x = mouseX;
p2.y = mouseY;
p1.display();
p2.display();
}
| Processing | 4 | aerinkayne/website | Tutorials/Processing/8_OOP/sketch_8_4_communication/sketch_8_4_communication.pde | [
"MIT"
] |
#pragma once
#include "envoy/upstream/retry.h"
#include "envoy/upstream/upstream.h"
namespace Envoy {
class OmitCanaryHostsRetryPredicate : public Upstream::RetryHostPredicate {
public:
bool shouldSelectAnotherHost(const Upstream::Host& candidate_host) override {
return candidate_host.canary();
}
void onHostAttempted(Upstream::HostDescriptionConstSharedPtr) override {}
};
} // namespace Envoy
| C | 4 | dcillera/envoy | source/extensions/retry/host/omit_canary_hosts/omit_canary_hosts.h | [
"Apache-2.0"
] |
// start custom scss snippet
li.toc-h1:first-child {
height: 38px;
overflow: hidden;
margin-top: 26px;
}
// end custom scss snippet
| SCSS | 2 | nhancv/fijkplayer-0.8.8 | docs/_sass/custom.scss | [
"MIT"
] |
// Shouldn't compile
var x: { a: number; } = { b: 5 }; | TypeScript | 3 | nilamjadhav/TypeScript | tests/cases/compiler/objectLitStructuralTypeMismatch.ts | [
"Apache-2.0"
] |
This is version 0_1 of bfcl
bfcl is a BrainFuck compiler for Linux written itself in BrainFuck
It reads the input from stdin and outputs a Linux ELF binary on stdout
Currently no optimization at all is done (which is another reason why
this thing is so sloooooooow on my system :) but that is planned for
version 0_2
Conventions assumed in this program:
fields are one byte long and decreasing zero is possible
Conventions in the binaries compiled with bfcl:
a) fields are one byte long
b) there are 30 000 fields
c) moving the pointer outside this area will lead to your computer
catching fire;
nothing is done to prevent you from doing that however
d) when end of file is encountered the program stores whatever
the Linux syscall returns (I believe it's zero but I'm too lazy to
check)
e) No checks are made on matching parentheses; maybe for version 0_3 :)
And yes; I know the code is far from pretty; far from optimized; and not
very well documented; but I'm sending it out anyway because the longer I
stare at it the more my head hurts
Final word of thanks: many ideas are shamelessly stolen from Brian
Raiter's 171 byte BF compiler available from www_muppetlabs_com/~breadbox/
For questions and comments you can reach me at
vissers@theochem dot kun dot nl
You will forgive me for not typing the dots :)
Ge Vissers
17 april 2003
**************************************************************************
>>>>>>> reserve some extra space
so we can shift the program later
Read the program
Reading a character is a bit of a nuisance since different compilers
use different strategies:
a) leave byte unchanged
b) set byte to zero
c) set byte to 0xff
I *believe* the following code snippets catches all three possibilities above
so that the program ends on either a null or a 0xff byte
>- set character to 0xff
, read a character
[<+>->+<] copy byte to previous and next field
>[+<]> if byte is not zero
add one to it
[ if it is still not zero
[-]< clear the copy
+++++[<-------->-]<--- subtract plus from input
[ if char is not plus
- subtract 1 from char
[ if char is not comma
- subtract 1 from char
[ if char is not minus
- subtract 1 from char
[ if char is not dot
-------------- subtract 14 from char
[ if char is not left angle
-- subtract 2 from char
[ if char is not right angle
>+++[<---------->-]<+ subtract 29 from char
[ if char is not left bracket
-- subtract 2 from char
[ if char is not right bracket
<--------> set opcode to minus 8
[-] clear character
]
<+> increase opcode
] end if (char is not left bracket)
<+> increase opcode
] end if (char is not right angle)
<+> increase opcode
] end if (char is not left angle)
<+> increase opcode
] end if (char is not dot)
<+> increase opcode
] end if (char is not minus)
<+> increase opcode
] end if (char is not comma)
<+> increase opcode
] end if (char is not plus)
<+ increase opcode
[ if opcode is not zero
> move to next field
] end if (opcode is not zero)
>>-, read in a new character
[<+>->+<] copy to previous and next field
>[+<]> if not null check if it's 0xff
] end while not EOF
<<[+] clear possible 0xff
>>++++++++[<++++++++++>-]<++++< 84 bytes for ELF header
>++++++++++++< 12 bytes to initialize program
>++++++< 6 bytes to end program
Calculate file size
<<[<]> move to first opcode
[ while opcode exists
[<<+<+>>>-]<< copy to two previous fields
- decrease
[ if opcode is not plus
- decrease opcode
[ if opcode is not comma
- decrease opcode
[ if opcode is not minus
- decrease opcode
[ if opcode is not dot
- decrease opcode
[ if opcode is not left angle
- decrease opcode
[ if opcode is not right angle
- decrease opcode
[ if opcode is not left bracket
>>>[>]>+++++ indicate 5 bytes should be added
<<[<]-<< set indicator to minus one
-
] end if (opcode is not left bracket)
>>[<-<->>+]<[>-<+]<+ copy indicator and increase
[ else (opcode is left bracket)
>>>[>]>++++++++ indicate 8 bytes should be added
<<[<]-<< set indicator to minus one
-
] end else (opcode is left bracket)
] end if (opcode is not right angle)
>>[<-<->>+]<[>-<+]<+ copy indicator and increase
[ else (opcode is right angle)
>>>[>]>+ indicate 1 byte should be added
<<[<]-<< set indicator to minus 1
-
] end else (opcode is right angle)
] end if (opcode is not left angle)
>>[<-<->>+]<[>-<+]<+ copy indicator and increase
[ else (opcode is left angle)
>>>[>]>+ indicate 1 byte should be added
<<[<]-<< set indicator to minus 1
-
] end else (opcode is left angle)
] end if (opcode is not dot)
>>[<-<->>+]<[>-<+]<+ copy indicator and increase
[ else (opcode is dot)
>>>[>]>++++++ indicate 6 bytes should be added
<<[<]-<< set indicator to minus 1
-
] end else (opcode is dot)
] end if (opcode is not minus)
>>[<-<->>+]<[>-<+]<+ copy indicator and increase
[ else (opcode is minus)
>>>[>]>++ indicate 2 bytes should be added
<<[<]-<< set indicator to minus 1
-
] end else (opcode is minus)
] end if (opcode is not comma)
>>[<-<->>+]<[>-<+]<+ copy indicator and increase
[ else (opcode is comma)
>>>[>]>++++++ indicate 6 bytes should be added
<<[<]-<< set indicator to minus 1
-
] end else (opcode is comma)
] end if (opcode is not plus)
>>[<-<->>+]<[>-<+]<+ copy indicator and increase
[ else (opcode is plus)
>>>[>]>++ indicate 2 bytes should be added
<<[<]-<< set indicator to minus 1
-
] end else (opcode is plus)
>>+>[>]> move to increment
[>+ increase byte 1
[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-] copy byte 1
<[>-<[-]] if no overflow set field to minus 1
>+[- if overflow
<<<<+ increase byte 2
[>>>+>+<<<<-]>>>>[<<<<+>>>>-] copy byte 2
<[>-<[-]] if no overflow set field to minus 1
>+[- if overflow
<<<+ increase byte 3
[>>+>+<<<-]>>>[<<<+>>>-] copy byte 3
<[>-<[-]] if no overflow set field to minus 1
>+[- if overflow
<<+ increase byte 4
>>
] end if
] end if
] end if
<<<<<<- decrease increment
]
<<[<]> move to next opcode
]
>>>>>> move behind file size
>++++++++[<++++++++++++++++>-]<-. output ELF magic bytes
>+++++++[<-------->-]<--.
+++++++.------.
[-]+...-.........++.--.+++.---.+.-... print rest of ELF header
>++++++++[<++++++++++>-]<++++.
>++++++[<+++++++>-]<++.[-]++++.++++.
>++++++[<+++++++>-]<++.[-]...........
>+++++++[<+++++++>-]<+++.>.++++
[<----->-]<.>.+.-.<++++++++.[-].....
+.-........>
++++++++[<++++++++++++++++>-]<.>++++.
++++.>.<<.>----.++++.
<<<<<.>.>.>. this is file size
Copy the file size since we need it to initialize ecx
>[-]>[-]<< clear the fields
<<<[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-] copy the bytes
<<<<[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-]
<<<<[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-]
<<<<[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-]
We have to add 30 000 = 0x75 30 to the file size
Start with 0x30
>>>++++++[<++++++++>-]< set to 0x30
[ while increment is not 0
<<<<<<+ increase byte 1
[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-] copy byte 1
<[>-<[-]] if no overflow set field to minus 1
>+[-
<<<<+ if overflow increase byte 2
[>>>+>+<<<<-]>>>>[<<<<+>>>>-] copy byte 2
<[>-<[-]] if no overflow set field to minus 1
>+[-
<<<+ if overflow increase byte 3
[>>+>+<<<-]>>>[<<<+>>>-] copy byte 3
<[>-<[-]] if no overflow set field to minus 1
>+[<<+>>-] if overflow increase byte 4
]
]
>- decrease increment
]
<<<<<<. print first byte
Now do 0x75 00
>>>>>>>
+++++++[<++++++++++++++++>-]<+++++ set increment
[ while increment is not 0
<<<<<+ increase byte 2
[>>>+>+<<<<-]>>>>[<<<<+>>>>-] copy byte 2
<[>-<[-]] if no overflow set field to minus 1
>+[-
<<<+ if overflow increase byte 3
[>>+>+<<<-]>>>[<<<+>>>-] copy byte 3
<[>-<[-]] if no overflow set field to minus 1
>+[<<+>>-] if overflow increase byte 4
]
>- decrease increment
]
<<<<<.>.>. print other 3 bytes
[-]<[-]<[-]<[-] clear up
++++++.------....++++++++++++++++. print rest of header
[-]..
add 0x80 00 to file size
>++++++++[<++++++++++++++++>-]< set counter to 0x80
[<<<+ increase byte 2
[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-] copy byte 2
<[>-<[-]] if no overflow set indicator to minus 1
>+[- if overflow
<<<<+ increase byte 3
[>>>+>+<<<<]>>>>[<<<<+>>>>-] copy byte 3
<[>-<[-]] if no overflow set indicator to minus 1
>+[<<<+>>>-] if overflow increase byte 4
]
<<- decrease counter
] loop until counter is zero
add 0x04 00 00 to file size
++++ set counter to 0x04
[<<+ increase byte 3
[>>>+>+<<<<-]>>>>[<<<<+>>>>-] copy byte 3
<[>-<[-]] if no overflow set indicator to minus 1
>+[<<<+>>>-] if overflow increase byte 4
<<- decrease counter
] loop until counter is zero
add 0x08 00 00 00 to file size
<++++++++>
Initialize registers
>>+++++++[<+++++++>-]<. xor eax eax
>>++++++++++++[<++++++++++++++++>-]<.
<.>>+++[<+++++++++>-]<. xor ebx ebx
>++++[<-------->-]<--.<<<<<<.>.>.>. mov ecx filesize
>>.>>+++++[<+++++>-]<. xor edx edx
>++++[<<++++>>-]<<+. inc edx
Now start compiling
>[-]<[-]<[-]<[-]<[-]<[-]<[-] clean up
<<<<<<[<]> move to first instruction
[ while opcode exists
- decrease opcode
[ if opcode is not plus
- decrease opcode
[ if opcode is not comma
- decrease opcode
[ if opcode is not minus
- decrease opcode
[ if opcode is not dot
- decrease opcode
[ if opcode is not left angle
- decrease opcode
[ if opcode is not right angle
- decrease opcode
[ if opcode is not left bracket
<++++[>------<-]>. output e9
[-] clear this field
>[>]>>>>>>>>[>>>>>>] move to end of loop size stack
-------->->->-<<< initialize increment
<<<<< move to byte 1 of size
[ while byte 1 is not zero
>>>>>- decrease byte 1
[>>>>+>+<<<<<-] copy byte 1
>>>>>[<<<<<+>>>>>-]
<[>-<[-]] if no underflow set field to minus 1
>+[- if underflow
<<<<- decrease byte 2
[>>>+>+<<<<-] copy byte 2
>>>>[<<<<+>>>>-]
<[>-<[-]] if no underflow set field to minus 1
>+[- if underflow
<<<- decrease byte 3
[>>+>+<<<-] copy byte 3
>>>[<<<+>>>-]
<[>-<[-]] if no underflow set field to minus 1
>+[-<<->>] if underflow decrease byte 4
] end if
] end if
<<<<<<<<<<- decrease byte 1 of size
] end while
> move to byte 2 of size
[ while byte 2 is not zero
>>>>>- decrease byte 2
[>>>+>+<<<<-] copy byte two
>>>>[<<<<+>>>>-]
<[>-<[-]] if no underflow set field to minus 1
>+[- if underflow
<<<- decrease byte 3
[>>+>+<<<-] copy byte 3
>>>[<<<+>>>-]
<[>-<[-]] if no underflow set field to minus 1
>+[-<<->>] if underflow decrease byte 4
] end if
<<<<<<<<<- decrease byte 2 of size
] end while
> move to byte 3 of size
[ while byte 3 is not zero
>>>>>- decrease byte 3
[>>+>+<<<-] copy byte 3
>>>[<<<+>>>-]
<[>-<[-]] if no underflow set field to minus 1
>+[-<<->>] if underflow decrease byte 4
<<<<<<<<- decrease byte 3 of size
]
> move to byte 4 of size
[ while byte 4 is not zero
>>>>>-<<<<<- decrease byte 4
]
>->.>.>.>. print increment
[+]<[+]<[+]<[+] clear increment
<<<<<<- remove size from stack
<[<<<<<<]<<<<<<<<[<] move back to opcode
<-> set indicator to minus 1
] end if (opcode is not left bracket)
<+ increase indicator
[ else (opcode is left bracket)
++++++[>++++++++<-] set to 38
>++.---------. output 3a 31
<+++++++++++++++. output 0f
+[>+++++<-]>+++. output 84
[-] clear this byte
clear the byte counter
+ set nesting level to one
[ while nesting greater than 0
>[<<<+<+>>>>-] copy opcode before nesting level
<<<------- subtract 7 from opcode
[ if opcode is not left bracket
- decrease opcode
[ if opcode is not right bracket
[+] clear field
>-< set indicator to minus 1
] end if opcode is not right braket
>+ increase indicator
[ else (opcode is right bracket)
>-<- decrease nesting level
] end else (opcode is right bracket)
-< set indicator to minus 1
] end if (opcode is not left bracket)
>+ increase indicator
[ else (opcode is left bracket)
>+<- increase nesting level
] end else (opcode is left bracket)
>[>+<-]> copy nesting to next field
] end while (nesting greater than 0)
<<<< move to last opcode in loop
[ while there are opcodes
[>>>+>+<<<<-] copy the opcode twice
>>> move to first copy
- decrease opcode
[ if opcode is not plus
- decrease opcode
[ if opcode is not comma
- decrease opcode
[ if opcode is not minus
- decrease opcode
[ if opcode is not dot
- decrease opcode
[ if opcode is not left angle
- decrease opcode
[ if opcode is not right angle
- decrease opcode
[ if opcode is not left bracket
- then it must be right bracket
set increment to five bytes
<<+++++>->
] end if (opcode is not left bracket)
<+ increase indicator
[ else (opcode is left bracket)
set increment to 8 bytes
<++++++++>-
] end else (opcode is left bracket)
-> set indicator to minus 1
] end if (opcode is not right angle)
<+ increase indicator
[ else (opcode is right angle)
<+>- set increment to 1 byte
] end else (opcode is right angle)
-> set indicator to minus 1
] end if (opcode is not left angle)
<+ increase indicator
[ else (opcode is left angle)
<+>- set increment to 1 byte
] end else (opcode is left angle)
-> set indicator to minus 1
] end else (opcode is not dot)
<+ increase indicator
[ else (opcode is dot)
<++++++>- set increment to 6 bytes
] end else (opcode is dot)
-> set indicator to minus 1
] end if (opcode is not minus)
<+ increase indicator
[ else (opcode is minus)
<++>- set increment to two bytes
] end else (opcode is minus)
-> set indicator to minus 1
] end if (opcode is not comma)
<+ increase indicator
[ else (opcode is comma)
<++++++>- set increment to 6 bytes
] end else (opcode is comma)
-> set indicator to minus 1
] end if (opcode is not plus)
<+ increase indicator
[ else (opcode is plus)
<++>- set increment to 2 bytes
] end else (opcode is plus)
<[>>>[>]>+<<[<]<<-] copy increment behind program
>>>[>]> move to increment
[ while increment is not zero
>+ increase byte 1
[>>>>+>+<<<<<-] copy byte 1
>>>>>[<<<<<+>>>>>-]
<[>-<[-]] if no overflow set field to minus 1
>+[- if overflow
<<<<+ increase byte 2
[>>>+>+<<<<-] copy byte 2
>>>>[<<<<+>>>>-]
<[>-<[-]] if no overflow set field to minus 1
>+[- if overflow
<<<+ increase byte 3
[>>+>+<<<-] copy byte 3
>>>[<<<+>>>-]
<[>-<[-]] if no overflow set field to minus 1
>+[- if overflow
<<+>> increase byte 4
]
] end if
] end if
<<<<<<- decrease increment
] end while
<<[<]<<<< move to next opcode
] end while opcode exists
>>>>>[>]>>.>.>.>. output the loop increment
<<< move to byte 1
copy byte 1 on stack
[>>>>>>[>>>>>>]>+<<[<<<<<<]<<<<<-]
> move to byte 2
copy byte 2 on stack
[>>>>>[>>>>>>]>>+<<<[<<<<<<]<<<<-]
> move to byte 3
copy byte 3 on stack
[>>>>[>>>>>>]>>>+<<<<[<<<<<<]<<<-]
> move to byte 4
copy byte 4 on stack
[>>>[>>>>>>]>>>>+<<<<<[<<<<<<]<<-]
set surrounding 1 bytes
>>>[>>>>>>]+>>>>>+<<<<<<[<<<<<<]<<
<<<<<<[<] move back to start of loop
< move to indicator field
] end else (opcode is left bracket)
-> set indicator to minus 1
] end if (opcode is not right angle)
<+ increase indicator
[ else (opcode is right angle)
+++++++[>++++++++<-]>+ set to 41
.[-]< output 41 and clear up
] end else (opcode is right angle)
-> set indicator to minus 1
] end if (opcode is not left angle)
<+ increase indicator
[ else (opcode is left angle)
+++++++[>+++++++++<-]>+. output 49
[-]< clear up
] end else (opcode is left angle)
-> set indicator to minus 1
] end if (opcode is not dot)
<+ increase indicator
[ else (opcode is dot)
++++++++++ set to b0
[>++++++++++++++++<-]>. output b0
<++++.>+++.<---. output 04 b3 01
+[>+++++++++++++<-]>. output cd
<+++++++[>-----------<-]>. output 80
[-]< clear up
] end else (opcode is dot)
-> set indicator to minus 1
] end if (opcode is not minus)
<+ increase indicator
[ else (opcode is minus)
>--.++<++++++++.--------- output fe 09
] end else (opcode is minus)
-> set indicator to minus 1
] end if (opcode is not comma)
<+ increase indicator
[ else (opcode is comma)
++++++++++[>++++++++++++++++<-] set to b0
>.<+++.>+++.<---. output b0 03 b3 00
++[>+++++++++++++<-]>.< output cd
+++++++[>-----------<-]>. output 80
[-]< clear up
] end else (opcode is comma)
-> set indicator to minus one
] end if (opcode is not plus)
<+ increase indicator
[ else (opcode is plus)
---.+++.- output fe 01
] end else (opcode is plus)
>> move to next opcode
]
[>]>
Clean up
>+++++++++++[<++++++++++++++++>-]<. mov al 1
>+.
<+++.>-. mov bl 0
++++[<++++++>-]<++. int 0x80
>>++++++++[<++++++++++++++++>-]<. | Brainfuck | 5 | RubenNL/brainheck | examples/compiler/bfcl.bf | [
"Apache-2.0"
] |
ruleset io.picolabs.manifold.email_notifications {
meta {
shares __testing, getRecipient, isVerified
use module io.picolabs.wrangler alias wrangler
}
global {
__testing = { "queries":
[ { "name": "__testing" } ]
, "events":
[ { "domain": "email", "type": "notification", "attrs": [ "recipient", "Body" ] }]
}
getRecipient = function(id, rs) {
ent:recipient{id}{rs}
}
getDefaultRecipient = function(contacts) {
default_recipient = contacts.filter(function(x) {
(x{"email"} != null && x{"favorite"} == "true");
});
email = default_recipient.values()[0]{"email"};
(email.isnull()) =>
((contacts{"google"}{"email"}.isnull()) => contacts.filter(function(x) {
x{"email"} != null
}).values()[0]{"email"} | contacts{"google"}{"email"})
| email
}
isVerified = function(email) {
ent:verified >< email
}
isFlagged = function(email) {
ent:flagged >< email
}
html = function(content) {
<<<!DOCTYPE HTML>
<html>
<head>
<title>Manifold Verification</title>
<meta charset="UTF-8">
</head>
<style>
body {
text-align: center;
}
.card {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
display: inline-block;
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
.container {
padding: 2px 16px;
}
</style>
<body>
#{content}
</body>
</html>
>>
}
verifiedPage = function() {
content = <<
<div class="container">
<div class="card">
<div class="container">
<img src="https://manifold.picolabs.io/img/manifold_logo.png" />
</div>
<div class="container">
<h1>Email Verified!</h1>
<p>Thank you for using Manifold. Your email is now ready to receive notifications through Manifold or any other service provided through Manifold.</p>
</div>
</div>
</div>
>>;
html(content)
};
blockedPage = function() {
content = <<
<div class="container">
<div class="card">
<div class="container">
<img src="https://manifold.picolabs.io/img/manifold_logo.png" />
</div>
<div class="container">
<h1>Email Unsubscribed!</h1>
<p>Sorry for the inconvenience. You will no longer receive any emails from us</p>
</div>
</div>
</div>
>>;
html(content)
};
}
rule setDefaulRecipient {
select when email set_default_recipient
pre {
rs = event:attr("rs");
id = event:attr("id");
owner_eci = wrangler:parent_eci().klog("parentEci");
contacts = wrangler:skyQuery(owner_eci, "io.picolabs.profile", "getContacts").klog("contacts")
default_recipient = getDefaultRecipient(contacts).klog("default_recipient")
}
if default_recipient then noop();
fired {
raise email event "set_recipient"
attributes {"recipient": default_recipient, "ruleSet": rs, "id": id}
if ent:recipient{id}{rs} == null
}
}
rule setRecipient {
select when email set_recipient
pre {
recipient = event:attr("recipient");
rs = event:attr("ruleSet");
id = event:attr("id");
}
always {
ent:recipient := (ent:recipient == null) => {}.put(id, {}.put(rs, recipient)) |
(ent:recipient{id} == null) => ent:recipient.put(id, {}.put(rs, recipient)) |
(ent:recipient{id}{rs} == null) => ent:recipient.put([id, rs], recipient) |
ent:recipient.set([id,rs], recipient);
raise email event "start_verification" attributes ({"email": recipient})
}
}
rule saveVerifiedEmail {
select when email save_verified_email
pre {
email = event:attr("email")
}
if not isVerified(email) then noop()
fired {
ent:verified := ent:verified.defaultsTo([]).append(email)
}
}
rule startVerification {
select when email start_verification
pre {
email = event:attr("email")
}
if not isFlagged(email) && not isVerified(email) then
event:send({
"eci": "7jA58wCfVQEY7X56eqVeST", "eid": "email_verification",
"domain": "email", "type": "send_verification",
"attrs": { "recipient": email, "eci": meta:eci }
})
}
rule receiveVerification {
select when email verified or email subscribed
pre {
email = event:attr("email")
flagged = ent:flagged.defaultsTo([]).filter(function(x) { x != email });
}
send_directive("_html", {"content": verifiedPage()})
fired {
ent:flagged := flagged;
ent:verified := ent:verified.defaultsTo([]).append(email) if not isVerified(email)
}
}
rule blockEmail {
select when email blocked
pre {
email = event:attr("email")
verified = ent:verified.defaultsTo([]).filter(function(x) { x != email });
}
send_directive("_html", {"content": blockedPage()})
fired {
ent:flagged := ent:flagged.defaultsTo([]).append(email) if not isFlagged(email);
ent:verified := verified
}
}
rule send_notification {
select when email notification
pre {
id = event:attr("id");
rs = event:attr("rs");
thing = event:attr("thing")
recipient = ent:recipient{id}{rs};
}
if not isFlagged(recipient) && isVerified(recipient) then event:send({
"eci": "7jA58wCfVQEY7X56eqVeST", "eid": "email_notification",
"domain": "email", "type": "notification",
"attrs": { "recipient": recipient, "Body": event:attr("Body"), "thing": thing }
})
}
}
| KRL | 4 | Picolab/ManifoldRewrite | Manifold_krl/io.picolabs.manifold.email_notifications.krl | [
"MIT"
] |
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url('./OpenSans-Light.ttf') format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans Regular'), local('OpenSans-Regular'), url('./OpenSans-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), url('./OpenSans-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('./OpenSans-SemiBold.ttf') format('truetype');
}
| CSS | 4 | coreyscherbing/angular | third_party/fonts.google.com/open-sans/open-sans.css | [
"MIT"
] |
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#"
py:extends="'base.kid'"
lang="en">
<head>
<title>${title}</title>
</head>
<body>
<div>${greeting(user)}</div>
<div>${greeting('me')}</div>
<div>${greeting('world')}</div>
<h2>Loop</h2>
<ul py:if="items">
<li py:for="idx, item in enumerate(items)" py:content="item"
class="${idx + 1 == len(items) and 'last' or None}" />
</ul>
</body>
</html>
| Genshi | 3 | grounzeroj/AsBuiltReport | examples/bench/kid/template.kid | [
"MIT"
] |
/* Copyright 2018 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.
==============================================================================*/
#include "tensorflow/compiler/xla/client/lib/loops.h"
#include "tensorflow/compiler/xla/client/lib/constants.h"
#include "tensorflow/compiler/xla/client/xla_builder.h"
#include "tensorflow/compiler/xla/shape_util.h"
#include "tensorflow/compiler/xla/status_macros.h"
namespace xla {
StatusOr<std::vector<XlaOp>> WhileLoopHelper(
const WhileLoopHelperConditionFunction& condition_function,
const WhileLoopHelperBodyFunction& body_function,
absl::Span<const XlaOp> initial_values, absl::string_view name,
XlaBuilder* builder) {
int arity = initial_values.size();
std::vector<Shape> var_shapes;
var_shapes.reserve(arity);
for (const XlaOp& input : initial_values) {
TF_ASSIGN_OR_RETURN(auto shape, builder->GetShape(input));
var_shapes.push_back(std::move(shape));
}
Shape tuple_shape = ShapeUtil::MakeTupleShape(var_shapes);
// Unpacks a tuple into its component parts.
auto unpack_tuple = [](XlaOp tuple, int arity, XlaBuilder* builder) {
std::vector<XlaOp> elements(arity);
for (int i = 0; i < arity; ++i) {
elements[i] = GetTupleElement(tuple, i);
}
return elements;
};
// Build the condition.
std::unique_ptr<XlaBuilder> cond_builder =
builder->CreateSubBuilder(absl::StrCat(name, "_condition"));
{
auto parameter = Parameter(cond_builder.get(), 0, tuple_shape, "parameter");
TF_RETURN_IF_ERROR(
condition_function(unpack_tuple(parameter, arity, cond_builder.get()),
cond_builder.get())
.status());
}
TF_ASSIGN_OR_RETURN(auto cond, cond_builder->Build());
// Build the body.
std::unique_ptr<XlaBuilder> body_builder =
builder->CreateSubBuilder(absl::StrCat(name, "_body"));
{
auto parameter = Parameter(body_builder.get(), 0, tuple_shape, "parameter");
TF_ASSIGN_OR_RETURN(
auto result,
body_function(unpack_tuple(parameter, arity, body_builder.get()),
body_builder.get()));
TF_RET_CHECK(result.size() == initial_values.size());
Tuple(body_builder.get(), result);
}
TF_ASSIGN_OR_RETURN(auto body, body_builder->Build());
auto outputs = While(cond, body, Tuple(builder, initial_values));
return unpack_tuple(outputs, arity, builder);
}
StatusOr<std::vector<XlaOp>> ForEachIndex(
int64_t num_iterations, PrimitiveType num_iterations_type,
const ForEachIndexBodyFunction& body_function,
absl::Span<const XlaOp> initial_values, absl::string_view name,
XlaBuilder* builder) {
auto while_cond_fn = [&](absl::Span<const XlaOp> values,
XlaBuilder* cond_builder) -> StatusOr<XlaOp> {
return Lt(values[0], ConstantR0WithType(cond_builder, num_iterations_type,
num_iterations));
};
auto while_body_fn =
[&](absl::Span<const XlaOp> values,
XlaBuilder* body_builder) -> StatusOr<std::vector<XlaOp>> {
XlaOp iteration = values[0];
std::vector<XlaOp> updated_values;
updated_values.reserve(values.size());
updated_values.push_back(Add(
iteration,
ConstantLiteral(body_builder, LiteralUtil::One(num_iterations_type))));
values.remove_prefix(1);
TF_ASSIGN_OR_RETURN(std::vector<XlaOp> body_outputs,
body_function(iteration, values, body_builder));
updated_values.insert(updated_values.end(), body_outputs.begin(),
body_outputs.end());
return updated_values;
};
std::vector<XlaOp> values;
values.reserve(initial_values.size() + 1);
values.push_back(
ConstantLiteral(builder, LiteralUtil::Zero(num_iterations_type)));
values.insert(values.end(), initial_values.begin(), initial_values.end());
TF_ASSIGN_OR_RETURN(values, WhileLoopHelper(while_cond_fn, while_body_fn,
values, name, builder));
values.erase(values.begin(), values.begin() + 1);
return values;
}
} // namespace xla
| C++ | 5 | EricRemmerswaal/tensorflow | tensorflow/compiler/xla/client/lib/loops.cc | [
"Apache-2.0"
] |
{{
Simple demo showing uses of Strings Library v2
}}
CON
{ ==[ CLOCK SET ]== }
_CLKMODE = XTAL1 + PLL2X
_XINFREQ = 5_000_000 ' 5MHz Crystal
OBJ
DEBUG : "FullDuplexSerial"
STR : "STRINGS2"
VAR
byte str_test[50]
PUB Main | strh
DEBUG.start(31, 30, 0, 57600)
waitcnt(clkfreq + cnt)
DEBUG.tx($0D)
DEBUG.str(STR.StrToUpper(string("aAbBcCxXyYzZ tEsT 1234567890 ;'!@#$%^&*()[]`{} TEst")))
'Result: "AABBCCXXYYZZ TEST 1234567890 ;'!@#$%^&*()[]`{} TEST"
DEBUG.tx($0D)
DEBUG.str(STR.StrToLower(string("aAbBcCxXyYzZ tEsT 1234567890 ;'!@#$%^&*()[]`{} TEst")))
'Result: "aabbccxxyyzz test 1234567890 ;'!@#$%^&*()[]`{} test"
DEBUG.tx($0D)
DEBUG.str(STR.SubStr(string("The claw has chosen! I go to a better place."), -13, 6))
'Result: "better"
DEBUG.tx($0D)
DEBUG.str(STR.SubStr(string("The claw has chosen! I go to a better place."), 4, 4))
'Result: "claw"
DEBUG.tx($0D)
DEBUG.str(STR.StrStr(string("The claw has chosen! I go to a better place."), string("chosen"), 0))
'Result: "chosen! I go to a better place."
DEBUG.tx($0D)
DEBUG.dec(STR.StrPos(string("aAbBcCxXyYzZ tEsT 1234567890 ;'!@#$%^&*()[]`{} TEst"), string("tEsT"), 0))
'Result: 13
DEBUG.tx($0D)
strh := string("hello this is test asdf tssdisdfe isis a")
bytefill(@str_test, 0, 50)
bytemove(@str_test, strh, strsize(strh))
DEBUG.str(STR.StrReplace(@str_test, string("is "), string("12345")))
'Result: "hello th1234512345test asdf tssdisdfe is12345a"
DEBUG.tx($0D)
strh := string("beginning of a")
bytefill(@str_test, 0, 50)
bytemove(@str_test, strh, strsize(strh))
DEBUG.str(STR.Concatenate(@str_test, string("n incomplete string.")))
'Result: "beginning of an incomplete string."
DEBUG.tx($0D)
DEBUG.str(STR.StrRev(string("0123456789 nwod tnuoc This is backwards")))
'Result: "sdrawkcab si sihT count down 9876543210"
DEBUG.tx($0D)
DEBUG.str(STR.Trim(string(" <-- See no blank space --> ",13)))
'Result: "<-- See no blank space -->"
DEBUG.tx($0D)
strh := string("short")
bytefill(@str_test, 0, 50)
bytemove(@str_test, strh, strsize(strh))
DEBUG.str(STR.Pad(@str_test, 10, string("-_-"), STR#PAD_RIGHT))
'Result: "short-_--_"
DEBUG.tx($0D)
strh := string("\_/")
bytefill(@str_test, 0, 50)
bytemove(@str_test, strh, strsize(strh))
DEBUG.str(STR.StrRepeat(@str_test, 7))
'Result: "\_/\_/\_/\_/\_/\_/\_/"
DEBUG.tx($0D)
DEBUG.str(STR.Capitalize(string("i'm too lazy to capitalize properly.")))
'Result: "I'm Too Lazy To Capitalize Properly."
DEBUG.tx($0D)
| Propeller Spin | 5 | deets/propeller | libraries/community/p1/All/Strings Library v2/STRINGS2/STRINGS_simple_demo.spin | [
"MIT"
] |
#version 450 core
#define PRECISION $precision
layout(std430) buffer;
/* Qualifiers: layout - storage - precision - memory */
layout(set = 0, binding = 0) uniform PRECISION restrict writeonly image3D uOutput;
layout(set = 0, binding = 1) uniform PRECISION sampler3D uInput;
layout(set = 0, binding = 2) uniform PRECISION restrict Block {
ivec4 size;
ivec3 isize;
} uBlock;
shared vec4 sh_mem[64];
layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
void main() {
const ivec3 pos = ivec3(gl_GlobalInvocationID);
const ivec3 tid = ivec3(gl_LocalInvocationID);
const ivec3 group_size = ivec3(gl_WorkGroupSize);
if (pos.z < uBlock.isize.z) {
vec4 sum = vec4(0);
for (int y = tid.y; y < uBlock.isize.y; y+=group_size.y) {
for (int x = tid.x; x < uBlock.isize.x; x+=group_size.x) {
sum += texelFetch(uInput, ivec3(x, y, pos.z), 0);
}
}
sh_mem[tid.z * group_size.y * group_size.x + tid.y * group_size.x + tid.x] = sum;
}
memoryBarrierShared();
barrier();
if (tid.y > 0 || tid.x > 0 || pos.z >= uBlock.isize.z) {
return;
}
vec4 total = vec4(0);
for (int y = 0; y < group_size.y; ++y) {
for (int x = 0; x < group_size.x; ++x) {
total += sh_mem[tid.z * group_size.y * group_size.x + y * group_size.x + x];
}
}
const vec4 outtex = total / uBlock.size.w;
const int zoutx = 4*pos.z;
const int width = uBlock.size.x;
const int maxlen = uBlock.size.x * uBlock.size.y;
const int zouty = min(zoutx + 1, maxlen);
ivec3 posy = ivec3((zouty)%width, (zouty)/width, 0);
vec4 outy = vec4(outtex.y, 0, 0, 0);
imageStore(uOutput, posy, outy);
const int zoutz = min(zoutx + 2, maxlen);
ivec3 posz = ivec3((zoutz)%width, (zoutz)/width, 0);
vec4 outz = vec4(outtex.z, 0, 0, 0);
imageStore(uOutput, posz, outz);
const int zoutw = min(zoutx + 3, maxlen);
ivec3 posw = ivec3((zoutw)%width, (zoutw)/width, 0);
vec4 outw = vec4(outtex.w, 0, 0, 0);
imageStore(uOutput, posw, outw);
ivec3 posx = ivec3(zoutx%width, zoutx/width, 0);
vec4 outx = vec4(outtex.x, 0, 0, 0);
imageStore(uOutput, posx, outx);
}
| GLSL | 3 | Hacky-DH/pytorch | aten/src/ATen/native/vulkan/glsl/mean2d.glsl | [
"Intel"
] |
DROP TABLE "public"."t2";
| SQL | 0 | gh-oss-contributor/graphql-engine-1 | cli/pkg/migrate/testdata/projectv3/migrations/s2/1623841485323_create_table_public_t2/down.sql | [
"Apache-2.0",
"MIT"
] |
FORMAT: 1A
# Testing 'text/plain' Request API
# POST /data
+ Request (text/plain)
+ Body
test equals to 42
+ Response 200 (application/json; charset=utf-8)
+ Body
{"test": "OK"}
| API Blueprint | 3 | tomoyamachi/dredd | packages/dredd/test/fixtures/request/text-plain.apib | [
"MIT"
] |
(* ****** ****** *)
//
// HX-2013-11
//
// Implementing a variant of
// the problem of Dining Philosophers
//
(* ****** ****** *)
#include
"share/atspre_define.hats"
(* ****** ****** *)
staload "{$LIBATSHWXI}/teaching/mythread/SATS/channel.sats"
(* ****** ****** *)
%{#
#define NPHIL 5
%} // end of [%{#]
#define NPHIL 5
(* ****** ****** *)
typedef nphil = natLt(NPHIL)
(* ****** ****** *)
fun phil_left (n: nphil): nphil
fun phil_right (n: nphil): nphil
(* ****** ****** *)
//
fun phil_loop (n: nphil): void
//
(* ****** ****** *)
fun cleaner_loop ((*void*)): void
(* ****** ****** *)
absvtype fork_vtype = ptr
vtypedef fork = fork_vtype
(* ****** ****** *)
fun fork_get_num (!fork): nphil
(* ****** ****** *)
fun phil_dine
(n: nphil, lf: !fork, rf: !fork): void
// end of [phil_dine]
fun phil_think (n: nphil): void
(* ****** ****** *)
fun cleaner_wash (f: !fork): void
fun cleaner_return (f: fork): void
(* ****** ****** *)
//
fun fork_changet (n: nphil): channel(fork)
//
fun forktray_changet ((*void*)): channel(fork)
//
(* ****** ****** *)
(* end of [DiningPhil2.sats] *)
| ATS | 3 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/ATS/DiningPhil2.sats | [
"MIT"
] |
{{- define "gateway.name" -}}
{{- if eq .Release.Name "RELEASE-NAME" -}}
{{- .Values.name | default "istio-ingressgateway" -}}
{{- else -}}
{{- .Values.name | default .Release.Name | default "istio-ingressgateway" -}}
{{- end -}}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "gateway.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "gateway.labels" -}}
helm.sh/chart: {{ include "gateway.chart" . }}
{{ include "gateway.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: {{ include "gateway.name" . }}
{{- range $key, $val := .Values.labels }}
{{- if not (or (eq $key "app") (eq $key "istio")) }}
{{ $key | quote }}: {{ $val | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- define "gateway.selectorLabels" -}}
{{- if hasKey .Values.labels "app" }}
{{- with .Values.labels.app }}app: {{.|quote}}
{{- end}}
{{- else }}app: {{ include "gateway.name" . }}
{{- end }}
{{- if hasKey .Values.labels "istio" }}
{{- with .Values.labels.istio }}
istio: {{.|quote}}
{{- end}}
{{- else }}
istio: {{ include "gateway.name" . | trimPrefix "istio-" }}
{{- end }}
{{- end }}
{{- define "gateway.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- .Values.serviceAccount.name | default (include "gateway.name" .) }}
{{- else }}
{{- .Values.serviceAccount.name | default "default" }}
{{- end }}
{{- end }}
| Smarty | 4 | rveerama1/istio | manifests/charts/gateway/templates/_helpers.tpl | [
"Apache-2.0"
] |
package scala.tools.eclipse.contribution.weaving.jdt.launching;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.internal.junit.launcher.TestKind;
import org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationTab;
@SuppressWarnings("restriction")
public privileged aspect JUnitLaunchConfigurationTabAspect {
pointcut getMethodsForType(IJavaProject javaProject, IType type, TestKind testKind):
execution(private Set<String> JUnitLaunchConfigurationTab.getMethodsForType(IJavaProject, IType, TestKind)) && args(javaProject, type, testKind);
Set<String> around(IJavaProject javaProject, IType type, TestKind testKind) : getMethodsForType(javaProject, type, testKind) {
if ((testKind == null) || testKind.getId().startsWith("org.eclipse.jdt.junit.loader")) {
return proceed(javaProject, type, testKind);
} else if (testKind.getFinder() instanceof ISearchMethods) {
return ((ISearchMethods)testKind.getFinder()).getTestMethods(javaProject, type);
} else
return new HashSet<String>();
}
}
| AspectJ | 3 | elemgee/scala-ide | org.scala-ide.sdt.aspects/src/scala/tools/eclipse/contribution/weaving/jdt/launching/JUnitLaunchConfigurationTabAspect.aj | [
"BSD-3-Clause"
] |
/* 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 <bitfields.uc>
#include "actions_rss.uc"
#include "pkt_ipv4_tcp_x88.uc"
.reg queue
.reg queue_offset
move(queue, 0)
.while (queue < 256)
rss_reset_test(pkt_vec)
bitfield_insert__sz2(BF_AML(pkt_vec, PV_QUEUE_OFFSET_bf), queue)
__actions_rss(pkt_vec)
test_assert_unequal(BF_A(pkt_vec, PV_META_TYPES_bf), 0)
test_assert(BF_A(pkt_vec, PV_QUEUE_OFFSET_bf) > 0)
bitfield_extract__sz1(queue_offset, BF_AML(pkt_vec, PV_QUEUE_OFFSET_bf)) ; PV_QUEUE_OFFSET_bf
test_assert(queue_offset <= 0x80)
alu[queue, queue, +, 1]
.endw
move(queue, 0)
.while (queue < 0x2f)
rss_reset_test(pkt_vec)
bitfield_insert__sz2(BF_AML(pkt_vec, PV_QUEUE_OFFSET_bf), queue)
bits_set(BF_AL(pkt_vec, PV_QUEUE_SELECTED_bf), 1)
__actions_rss(pkt_vec)
test_assert_equal(BF_A(pkt_vec, PV_META_TYPES_bf), 0)
bitfield_extract__sz1(queue_offset, BF_AML(pkt_vec, PV_QUEUE_OFFSET_bf)) ; PV_QUEUE_OFFSET_bf
test_assert_equal(queue_offset, queue)
alu[queue, queue, +, 1]
.endw
rss_reset_test(pkt_vec)
bitfield_insert__sz2(BF_AML(pkt_vec, PV_QUEUE_OFFSET_bf), queue)
bits_set(BF_AL(pkt_vec, PV_QUEUE_SELECTED_bf), 1)
__actions_rss(pkt_vec)
//test_assert_unequal(BF_A(pkt_vec, PV_META_TYPES_bf), 0)
bitfield_extract__sz1(queue_offset, BF_AML(pkt_vec, PV_QUEUE_OFFSET_bf)) ; PV_QUEUE_OFFSET_bf
test_assert(queue_offset > 0)
test_assert(queue_offset <= 0x80)
test_pass()
PV_SEEK_SUBROUTINE#:
pv_seek_subroutine(pkt_vec)
| UnrealScript | 3 | pcasconnetronome/nic-firmware | test/datapath/actions_rss_queue_select_test.uc | [
"BSD-2-Clause"
] |
{
"tokens": true,
"BABEL_8_BREAKING": false
}
| JSON | 0 | fatash89/babel | packages/babel-parser/test/fixtures/core/opts/private-name-tokens-true-babel-7/options.json | [
"MIT"
] |
package com.alibaba.json.bvt.bug;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import junit.framework.TestCase;
public class Bug_for_lenolix_5 extends TestCase {
public void test_for_objectKey() throws Exception {
final Map<Object, Object> obj = new HashMap<Object, Object>();
final Object obja = new Object();
final Object objb = new Object();
obj.put(obja, objb);
final String newJsonString = JSON.toJSONString(obj, SerializerFeature.WriteMapNullValue,
SerializerFeature.WriteClassName);
System.out.println(newJsonString);
final Object newObject = JSON.parse(newJsonString);
System.out.println(newObject);
}
}
| Java | 4 | Czarek93/fastjson | src/test/java/com/alibaba/json/bvt/bug/Bug_for_lenolix_5.java | [
"Apache-2.0"
] |
----------------------------------------------------------------------------------
-- Engineer: Mike Field <hamster@snap.net.nz>
--
-- Description: Cheapscope - captures signals and then sends them as ASCII
-- to the serial port
--
-- I've put this together for my personal use. You are welcome to use it however
-- your like. Just because it fits my needs it may not fit yours, if so, bad luck.
--
-- v2.0 Changed BRAM to 4bit/16bit to reduce logic count
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
Library UNISIM;
use UNISIM.vcomponents.all;
entity cheapscope is
generic (tx_freq : natural);
Port ( capture_clk : in STD_LOGIC;
tx_clk : in STD_LOGIC;
probes : in STD_LOGIC_VECTOR (15 downto 0);
serial_tx : out STD_LOGIC);
end cheapscope;
architecture Behavioral of cheapscope is
COMPONENT Transmitter
generic (FREQUENCY : natural );
PORT(
clk : IN std_logic;
ram_data : IN std_logic_vector(3 downto 0);
capture_done : IN std_logic;
trigger_address : IN std_logic_vector(9 downto 0);
serial_tx : OUT std_logic;
ram_address : OUT std_logic_vector(11 downto 0);
arm_again : OUT std_logic
);
END COMPONENT;
COMPONENT Capture
PORT(
clk : IN std_logic;
probes : IN std_logic_vector(15 downto 0);
write_address : OUT std_logic_vector( 9 downto 0);
write_data : OUT std_logic_vector(15 downto 0);
write_enable : OUT std_logic;
capture_done : OUT std_logic;
trigger_address : OUT std_logic_vector(9 downto 0);
arm_again : IN std_logic
);
END COMPONENT;
signal write_address: STD_LOGIC_VECTOR(9 downto 0) := (others => '0');
signal read_address: STD_LOGIC_VECTOR(11 downto 0) := (others => '0');
signal write_data : STD_LOGIC_VECTOR(15 downto 0);
signal read_data : STD_LOGIC_VECTOR(3 downto 0);
signal capture_done : STD_LOGIC;
signal trigger_address : STD_LOGIC_VECTOR(9 downto 0);
signal arm_again : STD_LOGIC;
signal write_enable : STD_LOGIC;
begin
RAMB16_S18_S18_inst : RAMB16_S4_S18
generic map (
INIT_A => X"000", -- Value of output RAM registers on Port A at startup
INIT_B => X"000", -- Value of output RAM registers on Port B at startup
SRVAL_A => X"000", -- Port A ouput value upon SSR assertion
SRVAL_B => X"000", -- Port B ouput value upon SSR assertion
WRITE_MODE_A => "WRITE_FIRST", -- WRITE_FIRST, READ_FIRST or NO_CHANGE
WRITE_MODE_B => "WRITE_FIRST", -- WRITE_FIRST, READ_FIRST or NO_CHANGE
SIM_COLLISION_CHECK => "ALL") -- "NONE", "WARNING", "GENERATE_X_ONLY", "ALL"
port map (
DOA => read_data, -- Port A 4-bit Data Output
ADDRA => read_address, -- Port A 11-bit Address Input
CLKA => tx_clk, -- Port A Clock
DIA => (others=>'0'), -- Port A 4-bit Data Input
ENA => '1', -- Port A RAM Enable Input
SSRA => '0', -- Port A Synchronous Set/Reset Input
WEA => '0', -- Port A Write Enable Input
DOB => open, -- Port B 16-bit Data Output
DOPB => open, -- Port B 2-bit Parity Output
ADDRB => write_address, -- Port B 11-bit Address Input
CLKB => capture_clk, -- Port B Clock
DIB => write_data, -- Port B 16-bit Data Input
DIPB => "00", -- Port B 2-bit parity Input
ENB => '1', -- Port B RAM Enable Input
SSRB => '0', -- Port B Synchronous Set/Reset Input
WEB => write_enable -- Port B Write Enable Input
);
Inst_Transmitter: Transmitter GENERIC MAP (
frequency => tx_freq
) PORT MAP(
clk => tx_clk,
serial_tx => serial_tx,
ram_data => read_data,
ram_address => read_address,
capture_done => capture_done,
trigger_address => trigger_address,
arm_again => arm_again
);
Inst_Capture: Capture PORT MAP(
clk => capture_clk,
probes => probes,
write_address => write_address,
write_data => write_data,
capture_done => capture_done,
arm_again => arm_again,
trigger_address => trigger_address,
write_enable => write_enable
);
end Behavioral;
| VHDL | 5 | AmigaPorts/amiga2000-gfxcard | attic/PapPro-sdram_verilog_v0.1/cheapscope.vhd | [
"MIT",
"IJG",
"Unlicense"
] |
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
inherit python git-2
PYTHON_DEPEND="2:2.4"
RESTRICT_PYTHON_ABIS="3.*"
DESCRIPTION="Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others)."
HOMEPAGE="https://github.com/BrightcoveOS/Diamond"
LICENSE="MIT"
KEYWORDS="amd64 x86"
SLOT="0"
IUSE="
-test
-mongo
-mysql
-snmp
-redis
"
RDEPEND="
dev-python/configobj
dev-python/setproctitle
test? ( dev-python/mock )
mongo? ( dev-python/pymongo )
mysql? ( dev-python/mysql-python )
snmp? ( dev-python/pysnmp )
redis? ( dev-python/redis-py )
"
DEPEND="
${RDEPEND}
"
EGIT_REPO_URI="https://github.com/BrightcoveOS/Diamond.git"
EGIT_COMMIT="GIT_HASH"
pkg_setup() {
python_set_active_version 2
python_pkg_setup
}
src_test() {
make test || eerror "Make test failed. See above for details."
}
src_install() {
default
newinitd "${S}/gentoo/init.d" diamond
}
pkg_info() {
"${ROOT}"/usr/bin/diamond --version
}
| Gentoo Ebuild | 3 | hermdog/Diamond | gentoo/diamond.ebuild | [
"MIT"
] |
=pod
=head1 NAME
b2i_PVK_bio, b2i_PVK_bio_ex, i2b_PVK_bio, i2b_PVK_bio_ex - Decode and encode
functions for reading and writing MSBLOB format private keys
=head1 SYNOPSIS
#include <openssl/pem.h>
EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
EVP_PKEY *b2i_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u,
OSSL_LIB_CTX *libctx, const char *propq);
int i2b_PVK_bio(BIO *out, const EVP_PKEY *pk, int enclevel,
pem_password_cb *cb, void *u);
int i2b_PVK_bio_ex(BIO *out, const EVP_PKEY *pk, int enclevel,
pem_password_cb *cb, void *u,
OSSL_LIB_CTX *libctx, const char *propq);
=head1 DESCRIPTION
b2i_PVK_bio_ex() decodes a private key of MSBLOB format read from a B<BIO>. It
attempts to automatically determine the key type. If the key is encrypted then
I<cb> is called with the user data I<u> in order to obtain a password to decrypt
the key. The supplied library context I<libctx> and property query
string I<propq> are used in any decrypt operation.
b2i_PVK_bio() does the same as b2i_PVK_bio_ex() except that the default
library context and property query string are used.
i2b_PVK_bio_ex() encodes I<pk> using MSBLOB format. If I<enclevel> is 1 then
a password obtained via I<pem_password_cb> is used to encrypt the private key.
If I<enclevel> is 0 then no encryption is applied. The user data in I<u> is
passed to the password callback. The supplied library context I<libctx> and
property query string I<propq> are used in any decrypt operation.
i2b_PVK_bio() does the same as i2b_PVK_bio_ex() except that the default
library context and property query string are used.
=head1 RETURN VALUES
The b2i_PVK_bio() and b2i_PVK_bio_ex() functions return a valid B<EVP_KEY>
structure or B<NULL> if an error occurs. The error code can be obtained by calling
L<ERR_get_error(3)>.
i2b_PVK_bio() and i2b_PVK_bio_ex() return the number of bytes successfully
encoded or a negative value if an error occurs. The error code can be obtained
by calling L<ERR_get_error(3)>.
=head1 SEE ALSO
L<crypto(7)>,
L<d2i_PKCS8PrivateKey_bio(3)>
=head1 HISTORY
b2i_PVK_bio_ex() and i2b_PVK_bio_ex() were added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
| Pod | 5 | pmesnier/openssl | doc/man3/b2i_PVK_bio_ex.pod | [
"Apache-2.0"
] |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { deepStrictEqual } from 'assert';
import { deserializeEnvironmentVariableCollection, serializeEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariableShared';
import { EnvironmentVariableMutatorType, IEnvironmentVariableMutator } from 'vs/workbench/contrib/terminal/common/environmentVariable';
suite('EnvironmentVariable - deserializeEnvironmentVariableCollection', () => {
test('should construct correctly with 3 arguments', () => {
const c = deserializeEnvironmentVariableCollection([
['A', { value: 'a', type: EnvironmentVariableMutatorType.Replace }],
['B', { value: 'b', type: EnvironmentVariableMutatorType.Append }],
['C', { value: 'c', type: EnvironmentVariableMutatorType.Prepend }]
]);
const keys = [...c.keys()];
deepStrictEqual(keys, ['A', 'B', 'C']);
deepStrictEqual(c.get('A'), { value: 'a', type: EnvironmentVariableMutatorType.Replace });
deepStrictEqual(c.get('B'), { value: 'b', type: EnvironmentVariableMutatorType.Append });
deepStrictEqual(c.get('C'), { value: 'c', type: EnvironmentVariableMutatorType.Prepend });
});
});
suite('EnvironmentVariable - serializeEnvironmentVariableCollection', () => {
test('should correctly serialize the object', () => {
const collection = new Map<string, IEnvironmentVariableMutator>();
deepStrictEqual(serializeEnvironmentVariableCollection(collection), []);
collection.set('A', { value: 'a', type: EnvironmentVariableMutatorType.Replace });
collection.set('B', { value: 'b', type: EnvironmentVariableMutatorType.Append });
collection.set('C', { value: 'c', type: EnvironmentVariableMutatorType.Prepend });
deepStrictEqual(serializeEnvironmentVariableCollection(collection), [
['A', { value: 'a', type: EnvironmentVariableMutatorType.Replace }],
['B', { value: 'b', type: EnvironmentVariableMutatorType.Append }],
['C', { value: 'c', type: EnvironmentVariableMutatorType.Prepend }]
]);
});
});
| TypeScript | 4 | sbj42/vscode | src/vs/workbench/contrib/terminal/test/common/environmentVariableShared.test.ts | [
"MIT"
] |
*-------------------------------------------------------------------------------
* Defining the sets
*-------------------------------------------------------------------------------
sets
h 'all hours' /0*166439/
first(h) 'first hour'
last(h) 'last hour'
m 'month' /1*228/
tec 'technology' /offshore, onshore, pv, river, lake, biogas, gas, phs, battery, methanation/
gen(tec) 'power plants' /offshore, onshore, pv, river, lake, biogas, gas/
vre(tec) 'variable tecs' /offshore, onshore, pv, river/
ncomb(tec) 'non-combustible generation' /offshore, onshore, pv, river, lake, phs, battery/
comb(tec) 'combustible generation techs' /biogas, methanation/
str(tec) 'storage technologies' /phs, battery, methanation/
frr(tec) 'technologies for upward FRR' /lake, phs, battery, gas/
;
first(h) = ord(h)=1;
last(h) = ord(h)=card(h);
alias(h,hh);
*-------------------------------------------------------------------------------
* Inputs
*-------------------------------------------------------------------------------
$Offlisting
parameter month(h) 'each month matched to its hour'
/
$ondelim
$include inputs/months_19.csv
$offdelim
/;
parameter load_factor(vre,h) 'Production profiles of VRE'
/
$ondelim
$include inputs/vre_profiles_19r.csv
$offdelim
/;
parameter demand(h) 'demand profile in each hour in GW'
/
$ondelim
$include inputs/demand_2050ADEME_19.csv
$offdelim
/;
Parameter lake_inflows(m) 'monthly lake inflows in GWh'
/
$ondelim
$include inputs/lake19.csv
$offdelim
/ ;
parameter epsilon(vre) 'additional FRR requirement for variable renewable energies because of forecast errors'
/
$ondelim
$include inputs/reserve_requirements.csv
$offdelim
/ ;
parameter capa_ex(tec) 'existing capacities of the technologies by December 2017 in GW'
/
$ondelim
$include inputs/existing_capasn.csv
$offdelim
/ ;
parameter capa_max(tec) 'maximum capacities of the technologies in GW'
/
$ondelim
$include inputs/max_capasn.csv
$offdelim
/ ;
parameter capex(tec) 'annualized power capex cost in M€/GW/year'
/
$ondelim
$include inputs/annuities_19.csv
$offdelim
/ ;
parameter capex_en(str) 'annualized energy capex cost of storage technologies in M€/GWh/year'
/
$ondelim
$include inputs/str_annuities_19.csv
$offdelim
/ ;
parameter fOM(tec) 'annualized fixed operation and maintenance costs M€/GW/year'
/
$ondelim
$include inputs/fO&M_19.csv
$offdelim
/ ;
Parameter vOM(tec) 'Variable operation and maintenance costs in M€/GWh'
/
$ondelim
$include inputs/vO&M.csv
$offdelim
/ ;
$Onlisting
parameter s_capex(str) 'charging related annuity of storage in M€/GW/year' /PHS 0, battery 0, methanation 1671.013948/;
parameter s_opex(str) 'charging related fOM of storage in M€/GW/year' /PHS 0, battery 0, methanation 1125.75/;
parameter eta_in(str) 'charging efifciency of storage technologies' /PHS 0.95, battery 0.9, methanation 0.59/;
parameter eta_out(str) 'discharging efficiency of storage technolgoies' /PHS 0.9, battery 0.95, methanation 0.45/;
scalar pump_capa 'pumping capacity in GW' /9.3/;
scalar max_phs 'maximum volume of energy can be stored in PHS reservoir in TWh' /0.18/;
scalar max_biogas 'maxium yearly energy can be generated by biogas in TWh' /15/;
scalar max_methanation 'maximum energy storable in methanation to not fonction as inter-annual storage in TWh' /16/
scalar load_uncertainty 'uncertainty coefficient for hourly demand' /0.01/;
scalar delta 'load variation factor' /0.1/;
*-------------------------------------------------------------------------------
* Model
*-------------------------------------------------------------------------------
variables GENE(tec,h) 'hourly energy generation in TWh'
CAPA(tec) 'overal yearly installed capacity in GW'
STORAGE(str,h) 'hourly electricity input of each storagetechnology GW'
STORED(str,h) 'energy stored in each storage technology in GWh'
CAPACITY(str) 'energy volume of storage technologies in GWh'
S(str) 'storage charging capacities in GW'
RSV(frr,h) 'required upward frequency restoration reserve in GW'
COST 'final investment cost in b€'
positive variables GENE(tec,h),CAPA(tec),STORAGE(str,h),STORED(str,h),CAPACITY(str), S(str),RSV(frr,h) ;
equations gene_vre 'variables renewable profiles generation'
gene_capa 'capacity and genration relation for technologies'
combustion 'the relationship of combustible technologies'
capa_frr 'capacity needed for the secondary reserve requirements'
storing 'the definition of stored energy in the storage options'
storage_const 'storage in the first hour is equal to the storage in the last hour'
storage_con 'charging power is equal or less than discharge power'
storage_capa 'hourly storage should be less than charging capacity of storage technology'
lake_res 'constraint on water for lake reservoirs'
stored_cap 'maximum energy that is stored in storage units'
biogas_const 'maximum energy can be produced by biogas'
reserves 'FRR requirement'
adequacy 'supply/demand relation'
obj 'the final objective function which is COST';
gene_vre(vre,h).. GENE(vre,h) =e= CAPA(vre)*load_factor(vre,h);
gene_capa(tec,h).. CAPA(tec) =g= GENE(tec,h);
combustion(h).. GENE('gas',h) =e= sum(comb,GENE(comb,h));
capa_frr(frr,h).. CAPA(frr) =g= GENE(frr,h) + RSV(frr,h);
storing(h,h+1,str).. STORED(str,h+1) =e= STORED(str,h) + STORAGE(str,h)*eta_in(str) - GENE(str,h)/eta_out(str);
storage_const(str,first,last).. STORED(str,first) =e= STORED(str,last) + STORAGE(str,last)*eta_in(str) - GENE(str,last)/eta_out(str);
lake_res(m).. lake_inflows(m) =g= sum(h$(month(h) = ord(m)),GENE('lake',h))/1000;
stored_cap(str,h).. STORED(str,h) =l= CAPACITY(str);
storage_con(str).. S(str) =l= CAPA(str);
storage_capa(str,h).. S(str) =g= STORAGE(str,h);
biogas_const.. sum(h,GENE('biogas',h)) =l= max_biogas*1000*19;
reserves(h).. sum(frr, RSV(frr,h)) =e= sum(vre,epsilon(vre)*CAPA(vre))+ demand(h)*load_uncertainty*(1+delta);
adequacy(h).. sum(ncomb,GENE(ncomb,h))+GENE('gas',h) =g= demand(h) + sum(str,STORAGE(str,h));
obj.. COST =e= (sum(tec,(CAPA(tec)-capa_ex(tec))*capex(tec))+ sum(str,CAPACITY(str)*capex_en(str))+sum(tec,(CAPA(tec)*fOM(tec)))+sum(str, S(str)*(s_opex(str)+s_capex(str))) +sum((tec,h),GENE(tec,h)*vOM(tec)))/1000;
*-------------------------------------------------------------------------------
* Initial and fixed values
*-------------------------------------------------------------------------------
CAPA.fx('phs') = pump_capa;
*CAPA.fx('river')= capa_ex('river');
CAPA.fx('lake') = 10.1;
S.fx('phs') = pump_capa;
CAPACITY.fx('phs') = max_phs*1000;
CAPACITY.up('methanation') = max_methanation*1000;
CAPA.up(vre) = capa_max(vre);
*----------------------------------------------------
*-------------------------------------------------------------------------------
* Model options
*-------------------------------------------------------------------------------
model RES_long /all/;
option solvelink=0;
option RESLIM = 1000000;
option lp=CPLEX;
option Savepoint=1;
option solveopt = replace;
option limcol = 0;
option limrow = 0;
option SOLPRINT = OFF;
*-------------------------------------------------------------------------------
* Solve statement
*-------------------------------------------------------------------------------
$If exist RES_long_p.gdx execute_loadpoint 'RES_long_p';
Solve RES_long using lp minimizing COST;
*-------------------------------------------------------------------------------
* Display statement
*-------------------------------------------------------------------------------
parameter sumdemand 'the whole demand per period in TWh';
sumdemand = sum(h,demand(h))/1000;
parameter gene_tec(tec) 'the whole generation of each technology in TWh' ;
gene_tec(tec) = sum(h,GENE.l(tec,h))/1000;
parameter sumgene 'the whole generation per year in TWh';
sumgene = sum((gen,h),GENE.l(gen,h))/1000 - gene_tec('gas');
parameter sum_FRR 'the whole yearly energy budgeted for reserves in TWh';
sum_FRR = sum((h,frr),RSV.l(frr,h))/1000;
parameter reserve(frr) 'capacity allocated for reserve from each FRR tech in GW';
reserve(frr) = smax(h,RSV.l(frr,h));
Parameter lcoe(gen);
lcoe(gen) = (CAPA.l(gen)*(fOM(gen)+capex(gen))+ gene_tec(gen)*vOM(gen)*1000)/gene_tec(gen);
parameter lcos(str);
lcos(str) = ((CAPA.l(str)*(fOM(str)+capex(str)))+(sum(h,GENE.l(str,h))*vOM(str))+CAPACITY.l(str)*capex_en(str))/gene_tec(str);
parameter cf(gen) 'load factor of generation technologies';
cf(gen) = gene_tec(gen)*1000/(166440*CAPA.l(gen));
parameter str_loss 'storage losses in % of power production';
str_loss = (sum((str,h),STORAGE.l(str,h))-sum(str,gene_tec(str)*1000))/(sumgene*10);
parameter lc 'load curtailment in %';
lc = ((sumgene-sumdemand)*100/sumgene) - str_loss;
parameter lcoe_sys1 'the overall MWh cost of electricity in €';
lcoe_sys1 = COST.l*1000/sumgene;
parameter lcoe_sys2 'the overall MWh cost of electricity in €';
lcoe_sys2 = COST.l*1000/sumdemand;
parameter spot_price(h) 'marginal cost' ;
spot_price(h) = 1000000*adequacy.m(h);
parameter marginal_cost 'average value over the year of spot price in €/MWh';
marginal_cost = sum(h,spot_price(h))/166440;
*-------------------------------------------------------------------------------
display cost.l;
display capa.l;
display gene_tec;
display sumdemand;
display sumgene;
display sum_FRR;
display lcoe;
display lcos;
display CAPACITY.l;
display cf;
display str_loss;
display lc;
display lcoe_sys1;
display lcoe_sys2;
display marginal_cost;
*-------------------------------------------------------------------------------
* Output
*-------------------------------------------------------------------------------
file results /'outputs/2000-2018.txt'/ ;
put results;
put ' the main results' //
//
'I)Overall investment cost is' cost.l 'b€' //
//
'II)the Renewable capacity ' //
'Offshore 'CAPA.l('offshore')' GW'//
'onsore 'CAPA.l('onshore')' GW' //
'PV 'CAPA.l('PV')' GW'//
'run of river 'CAPA.l('river') 'GW' //
'lake 'CAPA.l('lake') 'GW' //
'biogas 'CAPA.l('biogas')' GW'//
'gas 'CAPA.l('gas')' GW'//
'Battery 'CAPA.l('battery')' GW'//
'PHS 'CAPA.l('phs')' GW'//
'methanation 'CAPA.l('methanation')' GW'//
//
//
'III)Needed storage volume' //
'Battery Storage 'CAPACITY.l('battery')' GWh' //
'PHS Storage 'CAPACITY.l('phs')' GWh'//
'methane storage 'CAPACITY.l('methanation')' GWh'//
//
'IV)Secondary reserve requirements'//
'lake 'reserve('lake') 'GW'//
'gas 'reserve('gas') 'GW'//
'Pumped Storage 'reserve('phs') 'GW'//
'Battery 'reserve('battery') 'GW'//
//
'V)Overall yearly energy generation of each technology'//
'Offshore 'gene_tec('offshore')' TWh'//
'onsore 'gene_tec('onshore')' TWh' //
'PV 'gene_tec('PV')' TWh'//
'run of river 'gene_tec('river') 'TWh' //
'lake 'gene_tec('lake') 'TWh' //
'biogas 'gene_tec('biogas')' TWh'//
'gas 'gene_tec('gas')' TWh'//
'battery 'gene_tec('battery')' TWh'//
'phs 'gene_tec('phs')' TWh'//
'Methanation 'gene_tec('methanation')'TWh'//
//
'VI)more details'//
'LCOE for Offshore ' lcoe('offshore')' €/MWh'//
'LCOE for Onshore ' lcoe('onshore')' €/MWh'//
'LCOE for PV ' lcoe('pv')' €/MWh'//
'LCOE for Run-of-river ' lcoe('river')' €/MWh'//
'LCOE for Lake ' lcoe('lake')' €/MWh'//
'LCOE for Biogas ' lcoe('biogas')' €/MWh'//
'LCOE for Gas ' lcoe('gas')' €/MWh'//
'LCOS for battery ' lcos('battery')' €/MWh'//
'LCOS for pumped storage ' lcos('phs')' €/MWh'//
'LCOS for methanation ' lcos('methanation')' €/MWh'//
//
'Load Curtailment' lc'% and storage loss is 'str_loss'% of the produced power'//
'system LCOE is ' lcoe_sys1 ' €/MWh or ' lcoe_sys2 ' €/MWh'//
'and average spot price 'marginal_cost' €/MWh' //
//
'capacity factors'//
'Offshore 'cf('offshore')//
'onsore 'cf('onshore')//
'PV 'cf('PV')//
'run of river 'cf('river')//
'lake 'cf('lake')//
'biogas 'cf('biogas')//
'gas 'cf('gas')//
;
*-------------------------------------------------------------------------------
file hourly_generation /'outputs/2000-2018.csv' / ;
parameter nSTORAGE(str,h);
nSTORAGE(str,h) = 0 - STORAGE.l(str,h);
put hourly_generation;
hourly_generation.pc=5;
put 'hour'; loop(tec, put tec.tl;); put 'demand' ;put 'ElecStr' ;put 'Pump' ; put 'CH4' ; put 'price' / ;
loop (h,
put h.tl; loop(tec, put gene.l(tec,h);) ;put demand(h); put nSTORAGE('PHS',h) ; put nSTORAGE('battery',h) ; put nSTORAGE('methanation',h) ; put spot_price(h)/
;);
*-------------------------------------------------------------------------------
* The End :D
*-------------------------------------------------------------------------------
| GAMS | 5 | BehrangShirizadeh/VRE_2016 | model/EOLES_elecRES_long.gms | [
"CC-BY-4.0"
] |
#!/usr/bin/env bash
# Copyright 2015 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.
#
# Bootstraps a CEPH server.
# It creates two OSDs on local machine, creates RBD pool there
# and imports 'block' device there.
#
# We must create fresh OSDs and filesystem here, because shipping it
# in a container would increase the image by ~300MB.
#
# Create /etc/ceph/ceph.conf
sh ./ceph.conf.sh "$(hostname -i)"
# Configure and start ceph-mon
sh ./mon.sh "$(hostname -i)"
# Configure and start 2x ceph-osd
mkdir -p /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-1
sh ./osd.sh 0
sh ./osd.sh 1
# Configure and start cephfs metadata server
sh ./mds.sh
# Prepare a RBD volume "foo" (only with layering feature, the others may
# require newer clients).
# NOTE: we need Ceph kernel modules on the host that runs the client!
# As the default pool `rbd` might not be created on arm64 platform for ceph deployment,
# should create it if it does not exist.
arch=$(uname -m)
if [[ ${arch} = 'aarch64' || ${arch} = 'arm64' ]]; then
if [[ $(ceph osd lspools) = "" ]]; then
ceph osd pool create rbd 8
rbd pool init rbd
fi
fi
rbd import --image-feature layering block foo
# Prepare a cephfs volume
ceph osd pool create cephfs_data 4
ceph osd pool create cephfs_metadata 4
ceph fs new cephfs cephfs_metadata cephfs_data
# Put index.html into the volume
# It takes a while until the volume created above is mountable,
# 1 second is usually enough, but try indefinetily.
sleep 1
while ! ceph-fuse -m "$(hostname -i):6789" /mnt; do
echo "Waiting for cephfs to be up"
sleep 1
done
echo "Hello Ceph!" > /mnt/index.html
chmod 644 /mnt/index.html
umount /mnt
echo "Ceph is ready"
# Wait forever
while true; do
sleep 10
done
| Shell | 4 | 767829413/kubernetes | test/images/volume/rbd/bootstrap.sh | [
"Apache-2.0"
] |
(defpackage :ql-to-nix-util
(:use :common-lisp)
(:export #:nix-prefetch-url #:wrap #:pathname-as-directory #:copy-directory-tree #:with-temporary-directory #:sym #:with-temporary-asdf-cache #:with-asdf-cache)
(:documentation
"A collection of useful functions and macros that ql-to-nix will use."))
(in-package :ql-to-nix-util)
(declaim (optimize (debug 3) (speed 0) (space 0) (compilation-speed 0) (safety 3)))
;; This file cannot have any dependencies beyond quicklisp and asdf.
;; Otherwise, we'll miss some dependencies!
(defun pathname-as-directory (pathname)
"Given a pathname, make it into a path to a directory.
This is sort of like putting a / at the end of the path."
(unless (pathname-name pathname)
(return-from pathname-as-directory pathname))
(let* ((old-dir (pathname-directory pathname))
(old-name (pathname-name pathname))
(old-type (pathname-type pathname))
(last-dir
(cond
(old-type
(format nil "~A.~A" old-name old-type))
(t
old-name)))
(new-dir (if old-dir
(concatenate 'list old-dir (list last-dir))
(list :relative last-dir))))
(make-pathname :name nil :directory new-dir :type nil :defaults pathname)))
(defvar *nix-prefetch-url-bin*
(namestring (merge-pathnames #P"bin/nix-prefetch-url" (pathname-as-directory (uiop:getenv "nix-prefetch-url"))))
"The path to the nix-prefetch-url binary")
(defun nix-prefetch-url (url &key expected-sha256)
"Invoke the nix-prefetch-url program.
Returns a plist with two keys.
:sha256 => The sha of the fetched file
:path => The path to the file in the nix store"
(when expected-sha256
(setf expected-sha256 (list expected-sha256)))
(let* ((stdout
(with-output-to-string (so)
(uiop:run-program
`(,*nix-prefetch-url-bin* "--print-path" ,url ,@expected-sha256)
:output so)))
(stream (make-string-input-stream stdout)))
(list
:sha256 (read-line stream)
:path (read-line stream))))
(defmacro wrap (package symbol-name)
"Create a function which looks up the named symbol at runtime and
invokes it with the same arguments.
If you can't load a system until runtime, this macro gives you an
easier way to write
(funcall (intern \"SYMBOL-NAME\" :package-name) arg)
Instead, you can write
(wrap :package-name symbol-name)
(symbol-name arg)"
(let ((args (gensym "ARGS")))
`(defun ,symbol-name (&rest ,args)
(apply (sym ',package ',symbol-name) ,args))))
(defun copy-directory-tree (src-dir target-dir)
"Recursively copy every file in `src-dir' into `target-dir'.
This function traverses symlinks."
(when (or (not (pathname-directory target-dir))
(pathname-name target-dir))
(error "target-dir must be a dir"))
(when (or (not (pathname-directory src-dir))
(pathname-name src-dir))
(error "src-dir must be a dir"))
(let ((src-wild (make-pathname :name :wild :type :wild :defaults src-dir)))
(dolist (entity (uiop:directory* src-wild))
(if (pathname-name entity)
(uiop:copy-file entity (make-pathname :type (pathname-type entity) :name (pathname-name entity) :defaults target-dir))
(let ((new-target-dir
(make-pathname
:directory (concatenate 'list (pathname-directory target-dir) (last (pathname-directory entity))))))
(ensure-directories-exist new-target-dir)
(copy-directory-tree entity new-target-dir))))))
(defun call-with-temporary-directory (function)
"Create a temporary directory, invoke the given function by passing
in the pathname for the directory, and then delete the directory."
(let* ((dir (uiop:run-program '("mktemp" "-d") :output :line))
(parsed (parse-namestring dir))
(parsed-as-dir (pathname-as-directory parsed)))
(assert (uiop:absolute-pathname-p dir))
(unwind-protect
(funcall function parsed-as-dir)
(uiop:delete-directory-tree
parsed-as-dir
:validate
(lambda (path)
(and (uiop:absolute-pathname-p path)
(equal (subseq (pathname-directory path) 0 (length (pathname-directory parsed-as-dir)))
(pathname-directory parsed-as-dir))))))))
(defmacro with-temporary-directory ((dir-name) &body body)
"See `call-with-temporary-directory'."
`(call-with-temporary-directory (lambda (,dir-name) ,@body)))
(defun sym (package sym)
"A slightly less picky version of `intern'.
Unlike `intern', the `sym' argument can be a string or a symbol. If
it is a symbol, then the `symbol-name' is `intern'ed into the
specified package.
The arguments are also reversed so that the package comes first."
(etypecase sym
(symbol (setf sym (symbol-name sym)))
(string))
(intern sym package))
(defvar *touch-bin*
(namestring (merge-pathnames #P"bin/touch" (pathname-as-directory (uiop:getenv "touch"))))
"Path to the touch binary.")
(defvar *cache-dir* nil
"When asdf cache remapping is in effect (see `with-asdf-cache'),
this stores the path to the fasl cache directory.")
(defvar *src-dir* nil
"When asdf cache remapping is in effect (see `with-asdf-cache'),
this stores the path to the source directory.
Only lisp files within the source directory will have their fasls
cached in the cache directory.")
(defun remap (path prefix)
"Implements the cache policy described in `with-asdf-cache'."
(declare (ignore prefix))
(let* ((ql-dirs (pathname-directory *src-dir*))
(ql-dirs-length (length ql-dirs))
(path-prefix (subseq (pathname-directory path) 0 ql-dirs-length))
(path-postfix (subseq (pathname-directory path) ql-dirs-length)))
(unless (equal path-prefix ql-dirs)
(return-from remap path))
(let ((result (make-pathname :directory (concatenate 'list (pathname-directory *cache-dir*) path-postfix) :defaults path)))
(with-open-file (s result :direction :probe :if-does-not-exist nil)
(when s
(uiop:run-program `(,*touch-bin* ,(namestring result)))))
result)))
(defmacro with-temporary-asdf-cache ((src-dir) &body body)
"Create a temporary directory, and then use it as the ASDF cache
directory for source files in `src-dir'.
See `with-asdf-cache'."
(let ((tmp-dir (gensym "ORIGINAL-VALUE")))
`(with-temporary-directory (,tmp-dir)
(with-asdf-cache (,src-dir ,tmp-dir)
,@body))))
(defmacro with-asdf-cache ((src-dir cache-dir) &body body)
"When ASDF compiles a lisp file in `src-dir', store the fasl in `cache-dir'."
(let ((original-value (gensym "ORIGINAL-VALUE")))
`(let ((,original-value asdf:*output-translations-parameter*)
(*src-dir* ,src-dir)
(*cache-dir* ,cache-dir))
(unwind-protect
(progn
(asdf:initialize-output-translations
'(:output-translations
:INHERIT-CONFIGURATION
;; FIXME: Shouldn't we only be remaping things
;; actually in the src dir? Oh well.
(t (:function remap))))
,@body)
(asdf:initialize-output-translations ,original-value)))))
| Common Lisp | 4 | collinwright/nixpkgs | pkgs/development/lisp-modules/quicklisp-to-nix/util.lisp | [
"MIT"
] |
Red [
Needs: View
Config: [GUI-engine: 'test]
]
hello: name: tl: none
win: view/no-wait [
hello: button "Hello" [print "ok"]
name: field ;on-key ['done]
tl: text-list ["a" "b" "c"]
bb: base white on-down [face/color: red]
]
set-focus hello
do-event 'click
set-focus name
do-event/with 'key #"4"
do-event/with 'key #"2"
do-event/with 'key 'enter
probe name/text
probe name/data
set-focus tl
do-event/with 'select 2
probe tl/selected
probe bb/color
do-event/at 'down bb/offset + 5x5
probe bb/color | Red | 3 | 0xflotus/red | tests/test-backend.red | [
"BSL-1.0",
"BSD-3-Clause"
] |
import io
import multiprocessing.queues
from multiprocessing.reduction import ForkingPickler
import pickle
class ConnectionWrapper(object):
"""Proxy class for _multiprocessing.Connection which uses ForkingPickler to
serialize objects"""
def __init__(self, conn):
self.conn = conn
def send(self, obj):
buf = io.BytesIO()
ForkingPickler(buf, pickle.HIGHEST_PROTOCOL).dump(obj)
self.send_bytes(buf.getvalue())
def recv(self):
buf = self.recv_bytes()
return pickle.loads(buf)
def __getattr__(self, name):
if 'conn' in self.__dict__:
return getattr(self.conn, name)
raise AttributeError("'{}' object has no attribute '{}'".format(
type(self).__name__, 'conn'))
class Queue(multiprocessing.queues.Queue):
def __init__(self, *args, **kwargs):
super(Queue, self).__init__(*args, **kwargs)
self._reader: ConnectionWrapper = ConnectionWrapper(self._reader)
self._writer: ConnectionWrapper = ConnectionWrapper(self._writer)
self._send = self._writer.send
self._recv = self._reader.recv
class SimpleQueue(multiprocessing.queues.SimpleQueue):
def _make_methods(self):
if not isinstance(self._reader, ConnectionWrapper):
self._reader: ConnectionWrapper = ConnectionWrapper(self._reader)
self._writer: ConnectionWrapper = ConnectionWrapper(self._writer)
super(SimpleQueue, self)._make_methods() # type: ignore[misc]
| Python | 4 | Hacky-DH/pytorch | torch/multiprocessing/queue.py | [
"Intel"
] |
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import im.ricochet 1.0
Label {
text: {
if (torControl.status === TorControl.Error)
return qsTr("Connection failed")
if (torControl.status < TorControl.Connected) {
//: \u2026 is ellipsis
return qsTr("Connecting\u2026")
}
if (torControl.torStatus === TorControl.TorUnknown ||
torControl.torStatus === TorControl.TorOffline)
{
var bootstrap = torControl.bootstrapStatus
if (bootstrap['recommendation'] === 'warn')
return qsTr("Connection failed")
else if (bootstrap['progress'] === undefined)
return qsTr("Connecting\u2026")
else {
//: %1 is progress percentage, e.g. 100
return qsTr("Connecting\u2026 (%1%)").arg(bootstrap['progress'])
}
}
if (torControl.torStatus === TorControl.TorReady) {
// Indicates whether we've verified that the hidden services is connectable
if (userIdentity.isOnline)
return qsTr("Online")
else
return qsTr("Connected")
}
}
}
| QML | 4 | garrettr/ricochet | src/ui/qml/TorStateWidget.qml | [
"OpenSSL"
] |
#N struct help-setsize-template float x float y array array1 help-setsize-array1-template
;
#N struct help-setsize-array1-template float y;
#N canvas 568 117 643 519 12;
#X text 58 443 see also:;
#N canvas 393 50 495 265 help-setsize-template 0;
#X obj 27 174 filledpolygon 509 509 0 -10 -10 10 -10 10 10 -10 10;
#X obj 27 76 plot array1 500 1 10 15 10;
#X obj 24 16 struct help-setsize-template float x float y array array1
help-setsize-array1-template;
#X restore 46 379 pd help-setsize-template;
#N canvas 190 215 299 169 help-setsize-data 1;
#X scalar help-setsize-template 31 23 \; 0 \; 10 \; 0 \; 10 \; 20 \;
10 \; 20 \; 70 \; 0 \; 0 \; 0 \; \;;
#X restore 45 358 pd help-setsize-data;
#N canvas 196 292 369 138 help-setsize-array1-template 0;
#X obj 30 71 filledpolygon 0 0 0 -5 0 0 5 5 0 0 -5;
#X obj 32 27 struct help-setsize-array1-template float y;
#X restore 45 402 pd help-setsize-array1-template;
#X obj 123 464 pointer;
#X obj 248 465 setsize;
#X obj 302 265 pointer;
#X msg 302 241 traverse pd-help-setsize-data \, next;
#X floatatom 25 238 5 0 0 0 - - -;
#X text 320 321 arguments: template \, field name;
#X obj 25 322 setsize help-setsize-template array1, f 40;
#X text 115 292 inlet for pointer;
#X obj 37 11 setsize;
#X obj 186 464 element;
#X text 31 205 number sets;
#X text 30 219 size;
#X text 100 12 -- resize an array;
#X text 26 34 "setsize" takes a pointer to a scalar at left and a number
at right. Its creation arguments specify the template of the pointer
and the name of an array field. Sending a number then sets the number
of elements of the array.;
#X text 24 100 The smallest possible size is one. If the array is resized
downward the extra data are lost. If resized upward \, the new elements
are initialized to default values.;
#X msg 502 370 bang;
#X text 304 222 click here first;
#N canvas 458 61 439 176 readit 0;
#X msg 66 65 \; pd-help-setsize-data read setsize.txt;
#X obj 67 29 inlet;
#X msg 62 123 \; pd-help-setsize-data write setsize.txt;
#X connect 1 0 0 0;
#X restore 502 396 pd readit;
#X obj 65 464 struct;
#X text 404 456 updated for Pd version 0.47;
#X text 68 250 set template and field name;
#X text 21 154 If you don't know the template name you may specify
"-" \, in which case the object will figure out the template name itself
\, at some possible cost in efficiency and clarity.;
#X msg 34 272 set help-setsize-template array1;
#X text 296 369 click to reload from file =>;
#X connect 6 0 10 1;
#X connect 7 0 6 0;
#X connect 8 0 10 0;
#X connect 19 0 21 0;
#X connect 26 0 10 0;
| Pure Data | 4 | mcclure/pure-data | doc/5.reference/setsize-help.pd | [
"TCL"
] |
{} (:package |test-fn)
:configs $ {} (:init-fn |test-fn.main/main!) (:reload-fn |test-fn.main/reload!)
:files $ {}
|test-fn.main $ {}
:ns $ quote
ns test-fn.main $ :require
util.core :refer $ log-title
:defs $ {}
|main! $ quote
defn main! ()
log-title "|Testing fn"
assert= 1 (.call identity 1)
assert= 3 (.call &+ 1 2)
assert= 3 (.call-args &+ ([] 1 2))
| Cirru | 3 | calcit-lang/calcit.rs | calcit/test-fn.cirru | [
"MIT"
] |
$TTL 300
_ntp._udp IN SRV 0 0 1 zeros.foo.com.
IN SRV 1 100 123 one.foo.com.
IN SRV 2 100 123 two.foo.com.
IN SRV 3 100 123 localhost.foo.com.
IN SRV 4 100 123 three.example.com.
| DNS Zone | 3 | IT-Sumpfling/dnscontrol | pkg/js/parse_tests/021-srv/foo.com.zone | [
"MIT"
] |
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: fcaps.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @BLURB: function to set POSIX file-based capabilities
# @DESCRIPTION:
# This eclass provides a function to set file-based capabilities on binaries.
# This is not the same as USE=caps which controls runtime capability changes,
# often via packages like libcap.
#
# Due to probable capability-loss on moving or copying, this happens in
# pkg_postinst phase (at least for now).
#
# @EXAMPLE:
# You can manually set the caps on ping and ping6 by doing:
# @CODE
# pkg_postinst() {
# fcaps cap_net_raw bin/ping bin/ping6
# }
# @CODE
#
# Or set it via the global ebuild var FILECAPS:
# @CODE
# FILECAPS=(
# cap_net_raw bin/ping bin/ping6
# )
# @CODE
if [[ -z ${_FCAPS_ECLASS} ]]; then
_FCAPS_ECLASS=1
IUSE="+filecaps"
# We can't use libcap-ng atm due to #471414.
DEPEND="filecaps? ( sys-libs/libcap )"
# @ECLASS-VARIABLE: FILECAPS
# @DEFAULT_UNSET
# @DESCRIPTION:
# An array of fcap arguments to use to automatically execute fcaps. See that
# function for more details.
#
# All args are consumed until the '--' marker is found. So if you have:
# @CODE
# FILECAPS=( moo cow -- fat cat -- chubby penguin )
# @CODE
#
# This will end up executing:
# @CODE
# fcaps moo cow
# fcaps fat cat
# fcaps chubby penguin
# @CODE
#
# Note: If you override pkg_postinst, you must call fcaps_pkg_postinst yourself.
# @FUNCTION: fcaps
# @USAGE: [-o <owner>] [-g <group>] [-m <mode>] [-M <caps mode>] <capabilities> <file[s]>
# @DESCRIPTION:
# Sets the specified capabilities on the specified files.
#
# The caps option takes the form as expected by the cap_from_text(3) man page.
# If no action is specified, then "=ep" will be used as a default.
#
# If the file is a relative path (e.g. bin/foo rather than /bin/foo), then the
# appropriate path var ($D/$ROOT/etc...) will be prefixed based on the current
# ebuild phase.
#
# The caps mode (default 711) is used to set the permission on the file if
# capabilities were properly set on the file.
#
# If the system is unable to set capabilities, it will use the specified user,
# group, and mode (presumably to make the binary set*id). The defaults there
# are root:0 and 4711. Otherwise, the ownership and permissions will be
# unchanged.
fcaps() {
debug-print-function ${FUNCNAME} "$@"
# Process the user options first.
local owner='root'
local group='0'
local mode='4711'
local caps_mode='711'
while [[ $# -gt 0 ]] ; do
case $1 in
-o) owner=$2; shift;;
-g) group=$2; shift;;
-m) mode=$2; shift;;
-M) caps_mode=$2; shift;;
*) break;;
esac
shift
done
[[ $# -lt 2 ]] && die "${FUNCNAME}: wrong arg count"
local caps=$1
[[ ${caps} == *[-=+]* ]] || caps+="=ep"
shift
local root
case ${EBUILD_PHASE} in
compile|install|preinst)
root=${ED:-${D}}
;;
postinst)
root=${EROOT:-${ROOT}}
;;
esac
root=${root%/}
# Process every file!
local file
for file ; do
[[ ${file} != /* ]] && file="${root}/${file}"
if use filecaps ; then
# Try to set capabilities. Ignore errors when the
# fs doesn't support it, but abort on all others.
debug-print "${FUNCNAME}: setting caps '${caps}' on '${file}'"
# If everything goes well, we don't want the file to be readable
# by people.
chmod ${caps_mode} "${file}" || die
# Set/verify funcs for sys-libs/libcap.
_libcap() { setcap "${caps}" "${file}" ; }
_libcap_verify() { setcap -v "${caps}" "${file}" >/dev/null ; }
# Set/verify funcs for sys-libs/libcap-ng.
# Note: filecap only supports =ep mode.
# It also expects a different form:
# setcap cap_foo,cap_bar
# filecap foo bar
_libcap_ng() {
local caps=",${caps%=ep}"
filecap "${file}" "${caps//,cap_}"
}
_libcap_ng_verify() {
# libcap-ng has a crappy interface
local rcaps icaps caps=",${caps%=ep}"
rcaps=$(filecap "${file}" | \
sed -nr \
-e "s:^.{${#file}} +::" \
-e 's:, +:\n:g' \
-e 2p | \
LC_ALL=C sort)
[[ ${PIPESTATUS[0]} -eq 0 ]] || return 1
icaps=$(echo "${caps//,cap_}" | LC_ALL=C sort)
[[ ${rcaps} == ${icaps} ]]
}
local out cmd notfound=0
for cmd in _libcap _libcap_ng ; do
if ! out=$(LC_ALL=C ${cmd} 2>&1) ; then
case ${out} in
*"command not found"*)
: $(( ++notfound ))
continue
;;
# ENOTSUP and EOPNOTSUPP might be the same value which means
# strerror() on them is unstable -- we can get both. #559608
*"Not supported"*|\
*"Operation not supported"*)
local fstype=$(stat -f -c %T "${file}")
ewarn "Could not set caps on '${file}' due to missing filesystem support:"
ewarn "* enable XATTR support for '${fstype}' in your kernel (if configurable)"
ewarn "* mount the fs with the user_xattr option (if not the default)"
ewarn "* enable the relevant FS_SECURITY option (if configurable)"
break
;;
*)
eerror "Setting caps '${caps}' on file '${file}' failed:"
eerror "${out}"
die "could not set caps"
;;
esac
else
# Sanity check that everything took.
${cmd}_verify || die "Checking caps '${caps}' on '${file}' failed"
# Everything worked. Move on to the next file.
continue 2
fi
done
if [[ ${notfound} -eq 2 ]] && [[ -z ${_FCAPS_WARNED} ]] ; then
_FCAPS_WARNED="true"
ewarn "Could not find cap utils; make sure libcap or libcap-ng is available."
fi
fi
# If we're still here, setcaps failed.
debug-print "${FUNCNAME}: setting owner/mode on '${file}'"
chown "${owner}:${group}" "${file}" || die
chmod ${mode} "${file}" || die
done
}
# @FUNCTION: fcaps_pkg_postinst
# @DESCRIPTION:
# Process the FILECAPS array.
fcaps_pkg_postinst() {
local arg args=()
for arg in "${FILECAPS[@]}" "--" ; do
if [[ ${arg} == "--" ]] ; then
fcaps "${args[@]}"
args=()
else
args+=( "${arg}" )
fi
done
}
EXPORT_FUNCTIONS pkg_postinst
fi
| Gentoo Eclass | 5 | NighttimeDriver50000/Sabayon-Packages | local_overlay/eclass/fcaps.eclass | [
"MIT"
] |
#*****************************************************************************
# *
# Make file for VMS *
# Author : J.Jansen (joukj@hrem.stm.tudelft.nl) *
# Date : 9 November 1999 *
# *
#*****************************************************************************
.first
set def [-]
wx_curdir = f$environment("default")
wx_sub = f$element(0,"]",wx_curdir)
wx_fuldir = "''wx_sub'.]"
define/job/trans=(concealed) wx_root "''wx_fuldir'"
set def [.wxwidgets]
all :
set default [.include.wx]
if f$search("DEPRECATED.DIR") .eqs. "" then set file/enter=[]deprecated.dir [--.contrib.include.wx]deprecated.dir
set default [--]
make gtk
purge [...]
delete [...]*.obj;
make motif
purge [...]
delete [...]*.obj;
make x11
purge [...]
delete [...]*.obj;
gtk : [.include.wx]setup.h
set default [.src.generic]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.common]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.html]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.xml]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.xrc]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.unix]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.gtk]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [--.contrib.src.deprecated]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [---.demos.bombs]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [--.samples.calendar]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.caret]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.checklst]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.config]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.controls]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.db]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.dialogs]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.dialup]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.dnd]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.docview]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.drawing]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.font]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.image]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.mdi]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.menu]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.minimal]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [-.richedit]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1)
set default [--]
x11 : [.include.wx]setup.h
set default [.src.generic]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.common]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.html]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.xml]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.xrc]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.unix]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.x11]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.univ]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [--.contrib.src.deprecated]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [---.demos.bombs]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [--.samples.calendar]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.caret]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.checklst]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.config]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.controls]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.db]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.dialogs]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.dialup]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.dnd]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.docview]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.drawing]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.font]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.image]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.mdi]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.menu]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.minimal]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [-.richedit]
# $(MMS)$(MMSQUALIFIERS)/macro=(__WXX11__=1,__WXUNIVERSAL__=1)
set default [--]
motif : [.include.wx]setup.h
set default [.src.generic]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.common]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.unix]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.motif]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.x11]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [--.contrib.src.deprecated]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [---.demos.bombs]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [--.samples.calendar]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.caret]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.checklst]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.config]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.dialogs]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.image]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.mdi]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.menu]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [-.minimal]
$(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1)
set default [--]
[.include.wx]setup.h : setup.h_vms
copy setup.h_vms [.include.wx]setup.h
| Module Management System | 3 | Bloodknight/NeuTorsion | code/wxWidgets/descrip.mms | [
"MIT"
] |
import structs/HashMap
import ../Thread, ThreadUnix
include unistd
version(unix || apple) {
include pthread
pthread_self: extern func -> PThread
ThreadLocalUnix: class <T> extends ThreadLocal<T> {
values := HashMap<PThread, T> new()
valuesMutex := Mutex new()
init: func ~unix {
}
set: func (value: T) {
valuesMutex lock()
values put(pthread_self(), value)
valuesMutex unlock()
}
get: func -> T {
valuesMutex lock()
value := values get(pthread_self())
valuesMutex unlock()
value
}
hasValue?: func -> Bool {
valuesMutex lock()
has := values contains?(pthread_self())
valuesMutex unlock()
has
}
}
}
| ooc | 4 | fredrikbryntesson/launchtest | sdk/threading/native/ThreadLocalUnix.ooc | [
"MIT"
] |
# API name
# Group Users
## User [/users/{id}{?country,active,votes}]
### Retrieve User [GET]
+ Parameters
+ id: pavan (string, required) - Username
+ country
+ active (boolean)
+ votes (number)
+ Response 200 (application/json)
{}
| API Blueprint | 4 | darkcl/drafter | test/fixtures/api/action-parameters.apib | [
"MIT"
] |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!319 &31900000
AvatarMask:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Archer_avatarMask
m_Mask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
m_Elements:
- m_Path:
m_Weight: 1
- m_Path: Archer
m_Weight: 0
- m_Path: Archer/Archer_Arrow
m_Weight: 0
- m_Path: Archer/Archer_Body
m_Weight: 0
- m_Path: Archer/Archer_Bow
m_Weight: 0
- m_Path: unityHumanoidJoint_grp
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Archer_Arrow_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Archer_Bow_01_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Archer_Bow_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Archer_BowArrow_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/LeftUpperLeg
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/LeftUpperLeg/LeftLowerLeg
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/LeftUpperLeg/LeftLowerLeg/LeftFoot
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/LeftUpperLeg/LeftLowerLeg/LeftFoot/LeftToes
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/RightUpperLeg
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/RightUpperLeg/RightLowerLeg
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/RightUpperLeg/RightLowerLeg/RightFoot
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/RightUpperLeg/RightLowerLeg/RightFoot/RightToes
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftIndexProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftIndexProximal/LeftIndexIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftIndexProximal/LeftIndexIntermediate/LeftIndexDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftLittleProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftLittleProximal/LeftLittleIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftLittleProximal/LeftLittleIntermediate/LeftLittleDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftMiddleProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftMiddleProximal/LeftMiddleIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftMiddleProximal/LeftMiddleIntermediate/LeftMiddleDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftRingProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftRingProximal/LeftRingIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftRingProximal/LeftRingIntermediate/LeftRingDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftThumbProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftThumbProximal/LeftThumbIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/LeftShoulder/LeftUpperArm/LeftLowerArm/LeftHand/LeftThumbProximal/LeftThumbIntermediate/LeftThumbDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairBack_01_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairBack_01_jnt/hairBack_02_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairBack_01_jnt/hairBack_02_jnt/hairBack_03_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairBack_01_jnt/hairBack_02_jnt/hairBack_03_jnt/hairBack_04_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairFront_L_01_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairFront_L_01_jnt/hairFront_L_02_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairFront_L_01_jnt/hairFront_L_02_jnt/hairFront_L_03_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairFront_R_01_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairFront_R_01_jnt/hairFront_R_02_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/hairFront_R_01_jnt/hairFront_R_02_jnt/hairFront_R_03_jnt
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/Jaw
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/Jaw/JawTop
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/LeftEye
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/Neck/Head/RightEye
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightIndexProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightIndexProximal/RightIndexIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightIndexProximal/RightIndexIntermediate/RightIndexDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightLittleProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightLittleProximal/RightLittleIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightLittleProximal/RightLittleIntermediate/RightLittleDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightMiddleProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightMiddleProximal/RightMiddleIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightMiddleProximal/RightMiddleIntermediate/RightMiddleDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightRingProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightRingProximal/RightRingIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightRingProximal/RightRingIntermediate/RightRingDistal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightThumbProximal
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightThumbProximal/RightThumbIntermediate
m_Weight: 1
- m_Path: unityHumanoidJoint_grp/Hips/Spine/Chest/UpperChest/RightShoulder/RightUpperArm/RightLowerArm/RightHand/RightThumbProximal/RightThumbIntermediate/RightThumbDistal
m_Weight: 1
| Mask | 2 | Kijung-Luke-Kim/unity-tps | Assets/Prefabs/Characters/Archer/Model/Archer_avatarMask.mask | [
"MIT"
] |
defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web_namespace, schema.alias) %>Live.FormComponent do
use <%= inspect context.web_module %>, :live_component
alias <%= inspect context.module %>
@impl true
def update(%{<%= schema.singular %>: <%= schema.singular %>} = assigns, socket) do
changeset = <%= inspect context.alias %>.change_<%= schema.singular %>(<%= schema.singular %>)
{:ok,
socket
|> assign(assigns)
|> assign(:changeset, changeset)}
end
@impl true
def handle_event("validate", %{"<%= schema.singular %>" => <%= schema.singular %>_params}, socket) do
changeset =
socket.assigns.<%= schema.singular %>
|> <%= inspect context.alias %>.change_<%= schema.singular %>(<%= schema.singular %>_params)
|> Map.put(:action, :validate)
{:noreply, assign(socket, :changeset, changeset)}
end
def handle_event("save", %{"<%= schema.singular %>" => <%= schema.singular %>_params}, socket) do
save_<%= schema.singular %>(socket, socket.assigns.action, <%= schema.singular %>_params)
end
defp save_<%= schema.singular %>(socket, :edit, <%= schema.singular %>_params) do
case <%= inspect context.alias %>.update_<%= schema.singular %>(socket.assigns.<%= schema.singular %>, <%= schema.singular %>_params) do
{:ok, _<%= schema.singular %>} ->
{:noreply,
socket
|> put_flash(:info, "<%= schema.human_singular %> updated successfully")
|> push_redirect(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, :changeset, changeset)}
end
end
defp save_<%= schema.singular %>(socket, :new, <%= schema.singular %>_params) do
case <%= inspect context.alias %>.create_<%= schema.singular %>(<%= schema.singular %>_params) do
{:ok, _<%= schema.singular %>} ->
{:noreply,
socket
|> put_flash(:info, "<%= schema.human_singular %> created successfully")
|> push_redirect(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, changeset: changeset)}
end
end
end
| Elixir | 4 | faheempatel/phoenix | priv/templates/phx.gen.live/form_component.ex | [
"MIT"
] |
import { isFunction, map, filter, extend, omit, identity, range, isEmpty } from "lodash";
import React from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
import Table from "antd/lib/table";
import Skeleton from "antd/lib/skeleton";
import FavoritesControl from "@/components/FavoritesControl";
import TimeAgo from "@/components/TimeAgo";
import { durationHumanize, formatDate, formatDateTime } from "@/lib/utils";
// `this` refers to previous function in the chain (`Columns.***`).
// Adds `sorter: true` field to column definition
function sortable(...args) {
return extend(this(...args), { sorter: true });
}
export const Columns = {
favorites(overrides) {
return extend(
{
width: "1%",
render: (text, item) => <FavoritesControl item={item} />,
},
overrides
);
},
avatar(overrides, formatTitle) {
formatTitle = isFunction(formatTitle) ? formatTitle : identity;
return extend(
{
width: "1%",
render: (user, item) => (
<img
src={item.user.profile_image_url}
className="profile__image_thumb"
alt={formatTitle(user.name, item)}
title={formatTitle(user.name, item)}
/>
),
},
overrides
);
},
date(overrides) {
return extend(
{
render: text => formatDate(text),
},
overrides
);
},
dateTime(overrides) {
return extend(
{
render: text => formatDateTime(text),
},
overrides
);
},
duration(overrides) {
return extend(
{
width: "1%",
className: "text-nowrap",
render: text => durationHumanize(text),
},
overrides
);
},
timeAgo(overrides, timeAgoCustomProps = undefined) {
return extend(
{
render: value => <TimeAgo date={value} {...timeAgoCustomProps} />,
},
overrides
);
},
custom(render, overrides) {
return extend(
{
render,
},
overrides
);
},
};
Columns.date.sortable = sortable;
Columns.dateTime.sortable = sortable;
Columns.duration.sortable = sortable;
Columns.timeAgo.sortable = sortable;
Columns.custom.sortable = sortable;
export default class ItemsTable extends React.Component {
static propTypes = {
loading: PropTypes.bool,
// eslint-disable-next-line react/forbid-prop-types
items: PropTypes.arrayOf(PropTypes.object),
columns: PropTypes.arrayOf(
PropTypes.shape({
field: PropTypes.string, // data field
orderByField: PropTypes.string, // field to order by (defaults to `field`)
render: PropTypes.func, // (prop, item) => text | node; `prop` is `item[field]`
isAvailable: PropTypes.func, // return `true` to show column and `false` to hide; if omitted: show column
})
),
showHeader: PropTypes.bool,
onRowClick: PropTypes.func, // (event, item) => void
orderByField: PropTypes.string,
orderByReverse: PropTypes.bool,
toggleSorting: PropTypes.func,
"data-test": PropTypes.string,
rowKey: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
};
static defaultProps = {
loading: false,
items: [],
columns: [],
showHeader: true,
onRowClick: null,
orderByField: null,
orderByReverse: false,
toggleSorting: () => {},
};
prepareColumns() {
const { orderByField, orderByReverse, toggleSorting } = this.props;
const orderByDirection = orderByReverse ? "descend" : "ascend";
return map(
map(
filter(this.props.columns, column => (isFunction(column.isAvailable) ? column.isAvailable() : true)),
column => extend(column, { orderByField: column.orderByField || column.field })
),
(column, index) => {
// Bind click events only to sortable columns
const onHeaderCell = column.sorter ? () => ({ onClick: () => toggleSorting(column.orderByField) }) : null;
// Wrap render function to pass correct arguments
const render = isFunction(column.render) ? (text, row) => column.render(text, row.item) : identity;
return extend(omit(column, ["field", "orderByField", "render"]), {
key: "column" + index,
dataIndex: ["item", column.field],
defaultSortOrder: column.orderByField === orderByField ? orderByDirection : null,
onHeaderCell,
render,
});
}
);
}
getRowKey = record => {
const { rowKey } = this.props;
if (rowKey) {
if (isFunction(rowKey)) {
return rowKey(record.item);
}
return record.item[rowKey];
}
return record.key;
};
render() {
const tableDataProps = {
columns: this.prepareColumns(),
dataSource: map(this.props.items, (item, index) => ({ key: "row" + index, item })),
};
// Bind events only if `onRowClick` specified
const onTableRow = isFunction(this.props.onRowClick)
? row => ({
onClick: event => {
this.props.onRowClick(event, row.item);
},
})
: null;
const { showHeader } = this.props;
if (this.props.loading) {
if (isEmpty(tableDataProps.dataSource)) {
tableDataProps.columns = tableDataProps.columns.map(column => ({
...column,
sorter: false,
render: () => <Skeleton active paragraph={false} />,
}));
tableDataProps.dataSource = range(10).map(key => ({ key: `${key}` }));
} else {
tableDataProps.loading = { indicator: null };
}
}
return (
<Table
className={classNames("table-data", { "ant-table-headerless": !showHeader })}
showHeader={showHeader}
rowKey={this.getRowKey}
pagination={false}
onRow={onTableRow}
data-test={this.props["data-test"]}
{...tableDataProps}
/>
);
}
}
| JSX | 5 | zero1number/redash | client/app/components/items-list/components/ItemsTable.jsx | [
"BSD-2-Clause"
] |
<!doctype html>
<html lang="en" data-framework="riotjs">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Riot.js • TodoMVC</title>
<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
</head>
<body>
<todo></todo>
<script src="node_modules/todomvc-common/base.js"></script>
<script src="js/todo.html" type="riot/tag"></script>
<script src="node_modules/riot/riot+compiler.min.js"></script>
<script src="js/store.js"></script>
<script src="js/app.js"></script>
</body>
</html>
| HTML | 2 | dtelaroli/todomvc | examples/riotjs/index.html | [
"MIT"
] |
nvd erase_entire pref
rm d:\autoexec.ash
reboot yes
| AGS Script | 0 | waltersgrey/autoexechack | RebootGoPro/Hero3Black/autoexec.ash | [
"MIT"
] |
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>New Window</title>
</head>
<body style="margin:0">
<div style="width: 100%; height: 50px; background-color: green; -webkit-app-region: drag;">
</div>
This is the popup window<br/>
<script>
var enable = false;
var gui = require('nw.gui');
var win = gui.Window.get();
win.on('close', function() {
if (enable)
this.close(true);
else
console.log('This window can not be closed.');
});
win.on('enter-fullscreen', function() {
console.log('Enter fullscreen');
});
win.on('leave-fullscreen', function() {
console.log('Leave fullscreen');
});
win.on('focus', function() {
console.log('Window is focused');
});
win.on('blur', function() {
console.log('Window lost focus');
});
win.on('minimize', function() {
console.log('Window is minimized');
});
win.on('restore', function() {
console.log('Window is restored');
});
win.on('maximize', function() {
console.log('Window is maximized');
});
win.on('move', function(x, y) {
console.log('Window move: ' + x + ' ' + y);
});
win.on('resize', function(w, h) {
console.log('Window resize: ' + w + ' ' + h);
});
win.on('unmaximize', function() {
console.log('Window is unmaximized');
});
win.on('zoom', function(level) {
document.getElementById('zoom').innerText = level;
});
window.onload = function() {
gui.Window.get().show();
}
document.write("zoomLevel = <div id='zoom'>" + win.zoomLevel + '</div>');
</script>
<br/>
<button onclick="javascript:enable = true;">Enable to be closed</button>
<br/>
<button onclick="win.leaveFullscreen()">Leave fullscreen</button>
<div style="margin-top:10px;border-top: 1px solid #000;">
<img id="image" width="400" />
</div>
</body>
</html>
| HTML | 4 | frank-dspeed/nw.js | test/manual/window/popup.html | [
"MIT"
] |
package unit.issues;
#if (java || cs)
@:keep
private class Overloader {
public function new() {
}
public function toString() {
return "Overloader!";
}
@:generic static public function genericMe<T>(t:T) {
return test(t);
}
@:generic static public function genericMeMember<T>(m:Overloader, t:T) {
return m.testMember(t);
}
overload static public function test(d:Dynamic) {
return "Dynamic: " + d;
}
overload static public function test(i:Int) {
return "Int: " + i;
}
overload static public function test(s:String) {
return "String: " + s;
}
overload public function testMember(d:Dynamic) {
return "Dynamic: " + d;
}
overload public function testMember(i:Int) {
return "Int: " + i;
}
overload public function testMember(s:String) {
return "String: " + s;
}
}
#end
class Issue7599 extends unit.Test {
#if (java || cs)
function testGeneric() {
var overloader = new Overloader();
eq("String: foo", Overloader.genericMe("foo"));
eq("Int: 12", Overloader.genericMe(12));
eq("Dynamic: Overloader!", Overloader.genericMe(overloader));
eq("String: foo", Overloader.genericMeMember(overloader, "foo"));
eq("Int: 12", Overloader.genericMeMember(overloader, 12));
eq("Dynamic: Overloader!", Overloader.genericMeMember(overloader, overloader));
}
#end
} | Haxe | 4 | wiltonlazary/haxe | tests/unit/src/unit/issues/Issue7599.hx | [
"MIT"
] |
#console.log "meteor: ", Meteor
#console.log "plugin: ", Plugin
#console.log "hello"
#console.log "org?", global.Org?
{Compiler} = Org = require?('org') ? global.Org
handler = (compileStep, isLiterate)->
inputFile = compileStep.inputPath
source = compileStep.read().toString('utf8')
outputFile = inputFile + ".js"
try
{code, map} = new Compiler(source, inputFile, outputFile).generate()
#console.log "code: #{code}"
#console.log "map:", map.toJSON()
catch e
# XXX better error handling, once the Plugin interface support it
throw new Error(
inputFile + ':' +
(if e.location then (e.location.first_line + ': ') else ' ') +
e.message
)
compileStep.addJavaScript
path: outputFile
sourcePath: inputFile
data: code
sourceMap: map.toJSON()
Plugin.registerSourceHandler "lorg", handler
| Literate CoffeeScript | 4 | zot/Leisure | leisure/plugin/compilerPlugin.litcoffee | [
"Zlib"
] |
redo-ifchange LD yellow.o
./LD "$3" yellow.o
../sleep 2
| Stata | 1 | BlameJohnny/redo | t/110-compile/bellow.do | [
"Apache-2.0"
] |
// Copyright 2019 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.
// This is a "No Compile Test" suite.
// https://dev.chromium.org/developers/testing/no-compile-tests
#include "base/sequence_checker.h"
namespace {
class SequenceAffine {
public:
void BuggyIncrement();
void Increment() VALID_CONTEXT_REQUIRED(sequence_checker_) {
++counter_;
}
private:
int counter_ GUARDED_BY_CONTEXT(sequence_checker_);
SEQUENCE_CHECKER(sequence_checker_);
};
#if defined(NCTEST_ACCESS_WITHOUT_CHECK) // [r"fatal error: writing variable 'counter_' requires holding mutex 'sequence_checker_' exclusively"]
void SequenceAffine::BuggyIncrement() {
// Member access without sequence_checker_ assertion.
++counter_;
}
#elif defined(NCTEST_CALL_WITHOUT_CHECK) // [r"fatal error: calling function 'Increment' requires holding mutex 'sequence_checker_' exclusively"]
void SequenceAffine::BuggyIncrement() {
// Function call without sequence_checker_ assertion.
Increment();
}
#endif
} // namespace | nesC | 4 | thorium-cfx/fivem | vendor/chromium/base/sequence_checker_unittest.nc | [
"MIT"
] |
### 请求 /system/user/profile/get 接口 => 没有权限
GET {{baseUrl}}/system/user/profile/get
Authorization: Bearer test1
| HTTP | 1 | cksspk/ruoyi-vue-pro | yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/user/SysUserProfileController.http | [
"MIT"
] |
plugin simpleObject AlembicNull
name:"AlembicNull"
classID:#(0x76ff9f2a, 0x71fd65c7)
category:"Alembic"
(
rollout params "Do not use!"
(
label testLabA "This is not intended for use."
label testLabB "It is part of the ACB Time Control"
label testLabC "gizmo display"
)
on buildMesh do
(
setMesh mesh \
verts:#([50,0,0],[43.168,25.2249,0],[25.2249,43.168,0],[-9.53674e-007,50,0],[-25.2249,43.168,0],[-43.168,25.2249,0],[-50,-7.62939e-006,0],[-43.168,-25.2249,0],[-25.2249,-43.168,0],[1.90735e-006,-50,0],[25.2249,-43.168,0],[43.168,-25.2249,0],[50,0,4],[43.168,25.2249,4],[25.2249,43.168,4],[-9.53674e-007,50,4],[-25.2249,43.168,4],[-43.168,25.2249,4],[-50,-7.62939e-006,4],[-43.168,-25.2249,4],[-25.2249,-43.168,4],[1.90735e-006,-50,4],[25.2249,-43.168,4],[43.168,-25.2249,4],[24.0404,37.9944,0],[39.2424,22.016,0],[45,0,0],[39.2423,-22.0162,0],[24.0402,-37.9946,0],[2.5,-44.7979,0],[2.5,-32.5,0],[-2.5,-32.5,0],[-2.5,-44.7979,0],[-24.0404,-37.9944,0],[-39.2424,-22.016,0],[-45,-9.53674e-006,0],[-39.2423,22.0162,0],[-24.0402,37.9946,0],[-2.5,44.7979,0],[-2.5,32.5,0],[2.5,32.5,0],[2.5,44.7979,0],[24.0404,37.9944,4],[39.2424,22.016,4],[45,0,4],[39.2423,-22.0162,4],[24.0402,-37.9946,4],[2.5,-44.7979,4],[2.5,-32.5,4],[-2.5,-32.5,4],[-2.5,-44.7979,4],[-24.0404,-37.9944,4],[-39.2424,-22.016,4],[-45,-9.53674e-006,4],[-39.2423,22.0162,4],[-24.0402,37.9946,4],[-2.5,44.7979,4],[-2.5,32.5,4],[2.5,32.5,4],[2.5,44.7979,4],[-0.473067,-2.54767,0],[15.3411,-21.3942,0],[18.4053,-18.8231,0],[2.57567,0.0418816,0],[2.51075,0.573839,0],[2.34277,1.06679,0],[2.08339,1.50936,0],[17.7735,35.1576,0],[15.5077,36.2141,0],[-0.185986,2.5685,0],[-1.40598,2.16262,0],[-2.26547,1.2454,0],[-2.5906,-0.00930786,0],[-2.30914,-1.18206,0],[-1.55712,-2.07465,0],[-0.473067,-2.54767,4],[15.3411,-21.3942,4],[18.4053,-18.8231,4],[2.57567,0.0418816,4],[2.51075,0.573839,4],[2.34277,1.06679,4],[2.08339,1.50936,4],[17.7735,35.1576,4],[15.5077,36.2141,4],[-0.185986,2.5685,4],[-1.40598,2.16262,4],[-2.26547,1.2454,4],[-2.5906,-0.00930786,4],[-2.30914,-1.18206,4],[-1.55712,-2.07465,4],[-32.6477,8.525,5.64978],[-36.1504,8.525,5.64978],[-42.325,-7.5,5.64978],[-38.8664,-7.5,5.64978],[-37.5445,-3.85,5.64978],[-31.1469,-3.85,5.64978],[-29.7684,-7.5,5.64978],[-26.25,-7.5,5.64978],[-32.6477,8.525,9.64978],[-36.1504,8.525,9.64978],[-42.325,-7.5,9.64978],[-38.8664,-7.5,9.64978],[-37.5445,-3.85,9.64978],[-31.1469,-3.85,9.64978],[-29.7684,-7.5,9.64978],[-26.25,-7.5,9.64978],[-36.5668,-1.15,5.64978],[-34.4125,4.8,5.64978],[-32.1926,-1.15,5.64978],[-36.5668,-1.15,9.64978],[-34.4125,4.8,9.64978],[-32.1926,-1.15,9.64978],[-24.525,-7.5,5.64978],[-19.0801,-7.5,5.64978],[-15.1844,-7.39063,5.64978],[-13.0182,-6.63164,5.64978],[-11.6324,-4.98203,5.64978],[-11.125,-2.85742,5.64978],[-11.9072,-0.443163,5.64978],[-14.1449,1.00977,5.64978],[-12.5049,2.4209,5.64978],[-11.9,4.48828,5.64978],[-12.3914,6.36446,5.64978],[-13.6201,7.7045,5.64978],[-15.2912,8.36641,5.64978],[-18.125,8.525,5.64978],[-24.525,8.525,5.64978],[-24.525,-7.5,9.64978],[-19.0801,-7.5,9.64978],[-15.1844,-7.39063,9.64978],[-13.0182,-6.63164,9.64978],[-11.6324,-4.98203,9.64978],[-11.125,-2.85742,9.64978],[-11.9072,-0.443163,9.64978],[-14.1449,1.00977,9.64978],[-12.5049,2.4209,9.64978],[-11.9,4.48828,9.64978],[-12.3914,6.36446,9.64978],[-13.6201,7.7045,9.64978],[-15.2912,8.36641,9.64978],[-18.125,8.525,9.64978],[-24.525,8.525,9.64978],[-19.4426,5.85,5.64978],[-16.6781,5.79531,5.64978],[-15.4598,5.2334,5.64978],[-15.05,4.02734,5.64978],[-15.5254,2.77754,5.64978],[-16.8309,2.20469,5.64978],[-19.1801,2.15,5.64978],[-21.3,2.15,5.64978],[-21.3,5.85,5.64978],[-19.4426,5.85,9.64978],[-16.6781,5.79531,9.64978],[-15.4598,5.2334,9.64978],[-15.05,4.02734,9.64978],[-15.5254,2.77754,9.64978],[-16.8309,2.20469,9.64978],[-19.1801,2.15,9.64978],[-21.3,2.15,9.64978],[-21.3,5.85,9.64978],[-18.6848,-0.525002,5.64978],[-15.8123,-0.754101,5.64978],[-14.8002,-1.48477,5.64978],[-14.45,-2.70625,5.64978],[-14.9041,-4.06387,5.64978],[-16.0805,-4.70195,5.64978],[-18.3016,-4.8,5.64978],[-21.3,-4.8,5.64978],[-21.3,-0.524998,5.64978],[-18.6848,-0.525002,9.64978],[-15.8123,-0.754101,9.64978],[-14.8002,-1.48477,9.64978],[-14.45,-2.70625,9.64978],[-14.9041,-4.06387,9.64978],[-16.0805,-4.70195,9.64978],[-18.3016,-4.8,9.64978],[-21.3,-4.8,9.64978],[-21.3,-0.524998,9.64978],[0.534763,-4.18008,5.64978],[-1.69531,-5,5.64978],[-4.55137,-3.71191,5.64978],[-5.65,0.610939,5.64978],[-4.53731,4.74785,5.64978],[-1.6375,6.025,5.64978],[0.560547,5.30059,5.64978],[1.75,3.325,5.64978],[4.95,4.1,5.64978],[3.30938,7.0582,5.64978],[-1.4711,8.8,5.64978],[-6.90762,6.58594,5.64978],[-8.975,0.370312,5.64978],[-6.91758,-5.59375,5.64978],[-1.66485,-7.775,5.64978],[2.59785,-6.49434,5.64978],[5,-2.575,5.64978],[1.875,-1.6,5.64978],[0.534763,-4.18008,9.64978],[-1.69531,-5,9.64978],[-4.55137,-3.71191,9.64978],[-5.65,0.610939,9.64978],[-4.53731,4.74785,9.64978],[-1.6375,6.025,9.64978],[0.560547,5.30059,9.64978],[1.75,3.325,9.64978],[4.95,4.1,9.64978],[3.30938,7.0582,9.64978],[-1.4711,8.8,9.64978],[-6.90762,6.58594,9.64978],[-8.975,0.370312,9.64978],[-6.91758,-5.59375,9.64978],[-1.66485,-7.775,9.64978],[2.59785,-6.49434,9.64978],[5,-2.575,9.64978],[1.875,-1.6,9.64978],[22.075,-7.5,5.64978],[22.075,5.825,5.64978],[26.8,5.825,5.64978],[26.8,8.525,5.64978],[14.125,8.525,5.64978],[14.125,5.825,5.64978],[18.85,5.825,5.64978],[18.85,-7.5,5.64978],[22.075,-7.5,9.64978],[22.075,5.825,9.64978],[26.8,5.825,9.64978],[26.8,8.525,9.64978],[14.125,8.525,9.64978],[14.125,5.825,9.64978],[18.85,5.825,9.64978],[18.85,-7.5,9.64978],[37.8598,-4.18008,5.64978],[35.6297,-5,5.64978],[32.7736,-3.71192,5.64978],[31.675,0.610939,5.64978],[32.7877,4.74785,5.64978],[35.6875,6.025,5.64978],[37.8855,5.30058,5.64978],[39.075,3.325,5.64978],[42.275,4.1,5.64978],[40.6344,7.0582,5.64978],[35.8539,8.8,5.64978],[30.4174,6.58594,5.64978],[28.35,0.370312,5.64978],[30.4074,-5.59375,5.64978],[35.6602,-7.775,5.64978],[39.9228,-6.49434,5.64978],[42.325,-2.575,5.64978],[39.2,-1.6,5.64978],[37.8598,-4.18008,9.64978],[35.6297,-5,9.64978],[32.7736,-3.71192,9.64978],[31.675,0.610939,9.64978],[32.7877,4.74785,9.64978],[35.6875,6.025,9.64978],[37.8855,5.30058,9.64978],[39.075,3.325,9.64978],[42.275,4.1,9.64978],[40.6344,7.0582,9.64978],[35.8539,8.8,9.64978],[30.4174,6.58594,9.64978],[28.35,0.370312,9.64978],[30.4074,-5.59375,9.64978],[35.6602,-7.775,9.64978],[39.9228,-6.49434,9.64978],[42.325,-2.575,9.64978],[39.2,-1.6,9.64978]) \
faces:#([1,2,14],[1,14,13],[2,3,15],[2,15,14],[3,4,16],[3,16,15],[4,5,17],[4,17,16],[5,6,18],[5,18,17],[6,7,19],[6,19,18],[7,8,20],[7,20,19],[8,9,21],[8,21,20],[9,10,22],[9,22,21],[10,11,23],[10,23,22],[11,12,24],[11,24,23],[12,1,13],[12,13,24],[25,26,44],[25,44,43],[26,27,45],[26,45,44],[27,28,46],[27,46,45],[28,29,47],[28,47,46],[29,30,48],[29,48,47],[30,31,49],[30,49,48],[31,32,50],[31,50,49],[32,33,51],[32,51,50],[33,34,52],[33,52,51],[34,35,53],[34,53,52],[35,36,54],[35,54,53],[36,37,55],[36,55,54],[37,38,56],[37,56,55],[38,39,57],[38,57,56],[39,40,58],[39,58,57],[40,41,59],[40,59,58],[41,42,60],[41,60,59],[42,25,43],[42,43,60],[61,62,77],[61,77,76],[62,63,78],[62,78,77],[63,64,79],[63,79,78],[64,65,80],[64,80,79],[65,66,81],[65,81,80],[66,67,82],[66,82,81],[67,68,83],[67,83,82],[68,69,84],[68,84,83],[69,70,85],[69,85,84],[70,71,86],[70,86,85],[71,72,87],[71,87,86],[72,73,88],[72,88,87],[73,74,89],[73,89,88],[74,75,90],[74,90,89],[75,61,76],[75,76,90],[12,27,1],[12,28,27],[27,2,1],[26,2,27],[11,28,12],[11,29,28],[26,3,2],[25,3,26],[42,3,25],[42,4,3],[11,30,29],[10,30,11],[39,41,40],[39,42,41],[39,4,42],[39,5,4],[38,5,39],[38,6,5],[37,6,38],[37,7,6],[36,7,37],[36,8,7],[35,8,36],[35,9,8],[34,9,35],[33,9,34],[33,10,9],[33,30,10],[33,31,30],[32,31,33],[62,64,63],[61,64,62],[67,69,68],[67,70,69],[75,64,61],[74,64,75],[73,64,74],[72,64,73],[71,64,72],[70,64,71],[67,64,70],[67,65,64],[67,66,65],[24,13,45],[24,45,46],[45,13,14],[44,45,14],[23,24,46],[23,46,47],[44,14,15],[43,44,15],[60,43,15],[60,15,16],[23,47,48],[22,23,48],[57,58,59],[57,59,60],[57,60,16],[57,16,17],[56,57,17],[56,17,18],[55,56,18],[55,18,19],[54,55,19],[54,19,20],[53,54,20],[53,20,21],[52,53,21],[51,52,21],[51,21,22],[51,22,48],[51,48,49],[50,51,49],[77,78,79],[76,77,79],[82,83,84],[82,84,85],[90,76,79],[89,90,79],[88,89,79],[87,88,79],[86,87,79],[85,86,79],[82,85,79],[82,79,80],[82,80,81],[91,92,100],[91,100,99],[92,93,101],[92,101,100],[93,94,102],[93,102,101],[94,95,103],[94,103,102],[95,96,104],[95,104,103],[96,97,105],[96,105,104],[97,98,106],[97,106,105],[98,91,99],[98,99,106],[107,108,111],[107,111,110],[108,109,112],[108,112,111],[109,107,110],[109,110,112],[113,114,129],[113,129,128],[114,115,130],[114,130,129],[115,116,131],[115,131,130],[116,117,132],[116,132,131],[117,118,133],[117,133,132],[118,119,134],[118,134,133],[119,120,135],[119,135,134],[120,121,136],[120,136,135],[121,122,137],[121,137,136],[122,123,138],[122,138,137],[123,124,139],[123,139,138],[124,125,140],[124,140,139],[125,126,141],[125,141,140],[126,127,142],[126,142,141],[127,113,128],[127,128,142],[143,144,153],[143,153,152],[144,145,154],[144,154,153],[145,146,155],[145,155,154],[146,147,156],[146,156,155],[147,148,157],[147,157,156],[148,149,158],[148,158,157],[149,150,159],[149,159,158],[150,151,160],[150,160,159],[151,143,152],[151,152,160],[161,162,171],[161,171,170],[162,163,172],[162,172,171],[163,164,173],[163,173,172],[164,165,174],[164,174,173],[165,166,175],[165,175,174],[166,167,176],[166,176,175],[167,168,177],[167,177,176],[168,169,178],[168,178,177],[169,161,170],[169,170,178],[179,180,198],[179,198,197],[180,181,199],[180,199,198],[181,182,200],[181,200,199],[182,183,201],[182,201,200],[183,184,202],[183,202,201],[184,185,203],[184,203,202],[185,186,204],[185,204,203],[186,187,205],[186,205,204],[187,188,206],[187,206,205],[188,189,207],[188,207,206],[189,190,208],[189,208,207],[190,191,209],[190,209,208],[191,192,210],[191,210,209],[192,193,211],[192,211,210],[193,194,212],[193,212,211],[194,195,213],[194,213,212],[195,196,214],[195,214,213],[196,179,197],[196,197,214],[215,216,224],[215,224,223],[216,217,225],[216,225,224],[217,218,226],[217,226,225],[218,219,227],[218,227,226],[219,220,228],[219,228,227],[220,221,229],[220,229,228],[221,222,230],[221,230,229],[222,215,223],[222,223,230],[231,232,250],[231,250,249],[232,233,251],[232,251,250],[233,234,252],[233,252,251],[234,235,253],[234,253,252],[235,236,254],[235,254,253],[236,237,255],[236,255,254],[237,238,256],[237,256,255],[238,239,257],[238,257,256],[239,240,258],[239,258,257],[240,241,259],[240,259,258],[241,242,260],[241,260,259],[242,243,261],[242,261,260],[243,244,262],[243,262,261],[244,245,263],[244,263,262],[245,246,264],[245,264,263],[246,247,265],[246,265,264],[247,248,266],[247,266,265],[248,231,249],[248,249,266],[98,108,91],[98,109,108],[108,92,91],[108,93,92],[107,93,108],[107,94,93],[107,95,94],[107,96,95],[109,96,107],[98,96,109],[98,97,96],[162,147,146],[127,150,113],[127,151,150],[126,151,127],[126,143,151],[162,148,147],[126,144,143],[125,144,126],[161,148,162],[161,149,148],[169,149,161],[169,150,149],[169,113,150],[168,113,169],[168,114,113],[167,114,168],[167,115,114],[166,115,167],[125,145,144],[124,145,125],[123,145,124],[122,145,123],[122,146,145],[121,146,122],[120,146,121],[120,162,146],[120,163,162],[119,163,120],[118,163,119],[118,164,163],[117,164,118],[117,165,164],[116,165,117],[115,165,116],[166,165,115],[186,188,187],[185,188,186],[185,189,188],[184,189,185],[184,190,189],[183,190,184],[183,191,190],[182,191,183],[182,192,191],[181,192,182],[181,193,192],[180,193,181],[180,194,193],[179,194,180],[179,195,194],[179,196,195],[221,215,222],[221,216,215],[219,221,220],[218,221,219],[218,216,221],[218,217,216],[238,240,239],[237,240,238],[237,241,240],[236,241,237],[236,242,241],[235,242,236],[235,243,242],[234,243,235],[234,244,243],[233,244,234],[233,245,244],[232,245,233],[232,246,245],[231,246,232],[231,247,246],[231,248,247],[106,99,111],[106,111,112],[111,99,100],[111,100,101],[110,111,101],[110,101,102],[110,102,103],[110,103,104],[112,110,104],[106,112,104],[106,104,105],[171,155,156],[142,128,159],[142,159,160],[141,142,160],[141,160,152],[171,156,157],[141,152,153],[140,141,153],[170,171,157],[170,157,158],[178,170,158],[178,158,159],[178,159,128],[177,178,128],[177,128,129],[176,177,129],[176,129,130],[175,176,130],[140,153,154],[139,140,154],[138,139,154],[137,138,154],[137,154,155],[136,137,155],[135,136,155],[135,155,171],[135,171,172],[134,135,172],[133,134,172],[133,172,173],[132,133,173],[132,173,174],[131,132,174],[130,131,174],[175,130,174],[204,205,206],[203,204,206],[203,206,207],[202,203,207],[202,207,208],[201,202,208],[201,208,209],[200,201,209],[200,209,210],[199,200,210],[199,210,211],[198,199,211],[198,211,212],[197,198,212],[197,212,213],[197,213,214],[229,230,223],[229,223,224],[227,228,229],[226,227,229],[226,229,224],[226,224,225],[256,257,258],[255,256,258],[255,258,259],[254,255,259],[254,259,260],[253,254,260],[253,260,261],[252,253,261],[252,261,262],[251,252,262],[251,262,263],[250,251,263],[250,263,264],[249,250,264],[249,264,265],[249,265,266])
edgeVisAr = #(true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,false,false,true,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,true,true,false,true,false,false,false,false,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,false,true,false,false,false,false,false,true,false,true,false,true,false,true,true,false,false,true,false,true,true,false,true,false,false,false,true,false,false,true,false,false,true,false,false,true,false,false,true,false,false,true,false,false,false,false,true,false,true,true,false,true,false,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,true,true,false,false,true,false,false,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,true,false,false,false,true,false,false,false,false,false,true,false,true,false,true,true,true,false,true,false,false,true,true,false,false,true,false,true,false,false,true,false,false,true,false,false,true,false,false,true,false,false,true,false,false,false,false,false,false,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,false,false,true,false,true,false,false,true,false,false,true,false,false,false,true,false,true,false,false,true,false,false,true,false,false,false,true,false,false,false,true,true,false,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,false,true,false,true,false,false,false,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,false,false,true,false,true,false,false,false,true,false,false,true,false,false,false,false,true,false,false,false,true,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,true,false,false,false,true,true,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,true,true,false,false,true,true,false,true,false,false,true,true,false,false,true,false,false,false,true,true,false,false,true,true,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,true,true,false,true,false,false,false,true,false,false,true,false,false,true,false,true,false,false,false,true,false,false,true,false,false,true,false,true,false,false,false,false,false,false,true,true,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,true,false,false,false,true,false,false,false,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,true,false,false,true,false,false,false,true,false,true,false,false,true,false,false,false,false,false,false,true,false,true,false,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,true,false,false,false,false,true,true,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,true,true,true,false,false,true,false,true,true,false,true,false,false,false,false,false,false,true,true,true,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,true)
edgeVisArCounter = 1
for i = 1 to edgeVisAr.count/3 do
(
setEdgeVis mesh i 1 edgeVisAr[edgeVisArCounter]
edgeVisArCounter += 1
setEdgeVis mesh i 2 edgeVisAr[edgeVisArCounter]
edgeVisArCounter += 1
setEdgeVis mesh i 3 edgeVisAr[edgeVisArCounter]
edgeVisArCounter += 1
)
)
on buildMesh do
(
setMesh mesh \
verts:#([50,0,0],[43.168,25.2249,0],[25.2249,43.168,0],[-9.53674e-007,50,0],[-25.2249,43.168,0],[-43.168,25.2249,0],[-50,-7.62939e-006,0],[-43.168,-25.2249,0],[-25.2249,-43.168,0],[1.90735e-006,-50,0],[25.2249,-43.168,0],[43.168,-25.2249,0],[50,0,4],[43.168,25.2249,4],[25.2249,43.168,4],[-9.53674e-007,50,4],[-25.2249,43.168,4],[-43.168,25.2249,4],[-50,-7.62939e-006,4],[-43.168,-25.2249,4],[-25.2249,-43.168,4],[1.90735e-006,-50,4],[25.2249,-43.168,4],[43.168,-25.2249,4],[24.0404,37.9944,0],[39.2424,22.016,0],[45,0,0],[39.2423,-22.0162,0],[24.0402,-37.9946,0],[2.5,-44.7979,0],[2.5,-32.5,0],[-2.5,-32.5,0],[-2.5,-44.7979,0],[-24.0404,-37.9944,0],[-39.2424,-22.016,0],[-45,-9.53674e-006,0],[-39.2423,22.0162,0],[-24.0402,37.9946,0],[-2.5,44.7979,0],[-2.5,32.5,0],[2.5,32.5,0],[2.5,44.7979,0],[24.0404,37.9944,4],[39.2424,22.016,4],[45,0,4],[39.2423,-22.0162,4],[24.0402,-37.9946,4],[2.5,-44.7979,4],[2.5,-32.5,4],[-2.5,-32.5,4],[-2.5,-44.7979,4],[-24.0404,-37.9944,4],[-39.2424,-22.016,4],[-45,-9.53674e-006,4],[-39.2423,22.0162,4],[-24.0402,37.9946,4],[-2.5,44.7979,4],[-2.5,32.5,4],[2.5,32.5,4],[2.5,44.7979,4],[-0.473067,-2.54767,0],[15.3411,-21.3942,0],[18.4053,-18.8231,0],[2.57567,0.0418816,0],[2.51075,0.573839,0],[2.34277,1.06679,0],[2.08339,1.50936,0],[17.7735,35.1576,0],[15.5077,36.2141,0],[-0.185986,2.5685,0],[-1.40598,2.16262,0],[-2.26547,1.2454,0],[-2.5906,-0.00930786,0],[-2.30914,-1.18206,0],[-1.55712,-2.07465,0],[-0.473067,-2.54767,4],[15.3411,-21.3942,4],[18.4053,-18.8231,4],[2.57567,0.0418816,4],[2.51075,0.573839,4],[2.34277,1.06679,4],[2.08339,1.50936,4],[17.7735,35.1576,4],[15.5077,36.2141,4],[-0.185986,2.5685,4],[-1.40598,2.16262,4],[-2.26547,1.2454,4],[-2.5906,-0.00930786,4],[-2.30914,-1.18206,4],[-1.55712,-2.07465,4],[-32.6477,8.525,5.64978],[-36.1504,8.525,5.64978],[-42.325,-7.5,5.64978],[-38.8664,-7.5,5.64978],[-37.5445,-3.85,5.64978],[-31.1469,-3.85,5.64978],[-29.7684,-7.5,5.64978],[-26.25,-7.5,5.64978],[-32.6477,8.525,9.64978],[-36.1504,8.525,9.64978],[-42.325,-7.5,9.64978],[-38.8664,-7.5,9.64978],[-37.5445,-3.85,9.64978],[-31.1469,-3.85,9.64978],[-29.7684,-7.5,9.64978],[-26.25,-7.5,9.64978],[-36.5668,-1.15,5.64978],[-34.4125,4.8,5.64978],[-32.1926,-1.15,5.64978],[-36.5668,-1.15,9.64978],[-34.4125,4.8,9.64978],[-32.1926,-1.15,9.64978],[-24.525,-7.5,5.64978],[-19.0801,-7.5,5.64978],[-15.1844,-7.39063,5.64978],[-13.0182,-6.63164,5.64978],[-11.6324,-4.98203,5.64978],[-11.125,-2.85742,5.64978],[-11.9072,-0.443163,5.64978],[-14.1449,1.00977,5.64978],[-12.5049,2.4209,5.64978],[-11.9,4.48828,5.64978],[-12.3914,6.36446,5.64978],[-13.6201,7.7045,5.64978],[-15.2912,8.36641,5.64978],[-18.125,8.525,5.64978],[-24.525,8.525,5.64978],[-24.525,-7.5,9.64978],[-19.0801,-7.5,9.64978],[-15.1844,-7.39063,9.64978],[-13.0182,-6.63164,9.64978],[-11.6324,-4.98203,9.64978],[-11.125,-2.85742,9.64978],[-11.9072,-0.443163,9.64978],[-14.1449,1.00977,9.64978],[-12.5049,2.4209,9.64978],[-11.9,4.48828,9.64978],[-12.3914,6.36446,9.64978],[-13.6201,7.7045,9.64978],[-15.2912,8.36641,9.64978],[-18.125,8.525,9.64978],[-24.525,8.525,9.64978],[-19.4426,5.85,5.64978],[-16.6781,5.79531,5.64978],[-15.4598,5.2334,5.64978],[-15.05,4.02734,5.64978],[-15.5254,2.77754,5.64978],[-16.8309,2.20469,5.64978],[-19.1801,2.15,5.64978],[-21.3,2.15,5.64978],[-21.3,5.85,5.64978],[-19.4426,5.85,9.64978],[-16.6781,5.79531,9.64978],[-15.4598,5.2334,9.64978],[-15.05,4.02734,9.64978],[-15.5254,2.77754,9.64978],[-16.8309,2.20469,9.64978],[-19.1801,2.15,9.64978],[-21.3,2.15,9.64978],[-21.3,5.85,9.64978],[-18.6848,-0.525002,5.64978],[-15.8123,-0.754101,5.64978],[-14.8002,-1.48477,5.64978],[-14.45,-2.70625,5.64978],[-14.9041,-4.06387,5.64978],[-16.0805,-4.70195,5.64978],[-18.3016,-4.8,5.64978],[-21.3,-4.8,5.64978],[-21.3,-0.524998,5.64978],[-18.6848,-0.525002,9.64978],[-15.8123,-0.754101,9.64978],[-14.8002,-1.48477,9.64978],[-14.45,-2.70625,9.64978],[-14.9041,-4.06387,9.64978],[-16.0805,-4.70195,9.64978],[-18.3016,-4.8,9.64978],[-21.3,-4.8,9.64978],[-21.3,-0.524998,9.64978],[0.534763,-4.18008,5.64978],[-1.69531,-5,5.64978],[-4.55137,-3.71191,5.64978],[-5.65,0.610939,5.64978],[-4.53731,4.74785,5.64978],[-1.6375,6.025,5.64978],[0.560547,5.30059,5.64978],[1.75,3.325,5.64978],[4.95,4.1,5.64978],[3.30938,7.0582,5.64978],[-1.4711,8.8,5.64978],[-6.90762,6.58594,5.64978],[-8.975,0.370312,5.64978],[-6.91758,-5.59375,5.64978],[-1.66485,-7.775,5.64978],[2.59785,-6.49434,5.64978],[5,-2.575,5.64978],[1.875,-1.6,5.64978],[0.534763,-4.18008,9.64978],[-1.69531,-5,9.64978],[-4.55137,-3.71191,9.64978],[-5.65,0.610939,9.64978],[-4.53731,4.74785,9.64978],[-1.6375,6.025,9.64978],[0.560547,5.30059,9.64978],[1.75,3.325,9.64978],[4.95,4.1,9.64978],[3.30938,7.0582,9.64978],[-1.4711,8.8,9.64978],[-6.90762,6.58594,9.64978],[-8.975,0.370312,9.64978],[-6.91758,-5.59375,9.64978],[-1.66485,-7.775,9.64978],[2.59785,-6.49434,9.64978],[5,-2.575,9.64978],[1.875,-1.6,9.64978],[22.075,-7.5,5.64978],[22.075,5.825,5.64978],[26.8,5.825,5.64978],[26.8,8.525,5.64978],[14.125,8.525,5.64978],[14.125,5.825,5.64978],[18.85,5.825,5.64978],[18.85,-7.5,5.64978],[22.075,-7.5,9.64978],[22.075,5.825,9.64978],[26.8,5.825,9.64978],[26.8,8.525,9.64978],[14.125,8.525,9.64978],[14.125,5.825,9.64978],[18.85,5.825,9.64978],[18.85,-7.5,9.64978],[37.8598,-4.18008,5.64978],[35.6297,-5,5.64978],[32.7736,-3.71192,5.64978],[31.675,0.610939,5.64978],[32.7877,4.74785,5.64978],[35.6875,6.025,5.64978],[37.8855,5.30058,5.64978],[39.075,3.325,5.64978],[42.275,4.1,5.64978],[40.6344,7.0582,5.64978],[35.8539,8.8,5.64978],[30.4174,6.58594,5.64978],[28.35,0.370312,5.64978],[30.4074,-5.59375,5.64978],[35.6602,-7.775,5.64978],[39.9228,-6.49434,5.64978],[42.325,-2.575,5.64978],[39.2,-1.6,5.64978],[37.8598,-4.18008,9.64978],[35.6297,-5,9.64978],[32.7736,-3.71192,9.64978],[31.675,0.610939,9.64978],[32.7877,4.74785,9.64978],[35.6875,6.025,9.64978],[37.8855,5.30058,9.64978],[39.075,3.325,9.64978],[42.275,4.1,9.64978],[40.6344,7.0582,9.64978],[35.8539,8.8,9.64978],[30.4174,6.58594,9.64978],[28.35,0.370312,9.64978],[30.4074,-5.59375,9.64978],[35.6602,-7.775,9.64978],[39.9228,-6.49434,9.64978],[42.325,-2.575,9.64978],[39.2,-1.6,9.64978]) \
faces:#([1,2,14],[1,14,13],[2,3,15],[2,15,14],[3,4,16],[3,16,15],[4,5,17],[4,17,16],[5,6,18],[5,18,17],[6,7,19],[6,19,18],[7,8,20],[7,20,19],[8,9,21],[8,21,20],[9,10,22],[9,22,21],[10,11,23],[10,23,22],[11,12,24],[11,24,23],[12,1,13],[12,13,24],[25,26,44],[25,44,43],[26,27,45],[26,45,44],[27,28,46],[27,46,45],[28,29,47],[28,47,46],[29,30,48],[29,48,47],[30,31,49],[30,49,48],[31,32,50],[31,50,49],[32,33,51],[32,51,50],[33,34,52],[33,52,51],[34,35,53],[34,53,52],[35,36,54],[35,54,53],[36,37,55],[36,55,54],[37,38,56],[37,56,55],[38,39,57],[38,57,56],[39,40,58],[39,58,57],[40,41,59],[40,59,58],[41,42,60],[41,60,59],[42,25,43],[42,43,60],[61,62,77],[61,77,76],[62,63,78],[62,78,77],[63,64,79],[63,79,78],[64,65,80],[64,80,79],[65,66,81],[65,81,80],[66,67,82],[66,82,81],[67,68,83],[67,83,82],[68,69,84],[68,84,83],[69,70,85],[69,85,84],[70,71,86],[70,86,85],[71,72,87],[71,87,86],[72,73,88],[72,88,87],[73,74,89],[73,89,88],[74,75,90],[74,90,89],[75,61,76],[75,76,90],[12,27,1],[12,28,27],[27,2,1],[26,2,27],[11,28,12],[11,29,28],[26,3,2],[25,3,26],[42,3,25],[42,4,3],[11,30,29],[10,30,11],[39,41,40],[39,42,41],[39,4,42],[39,5,4],[38,5,39],[38,6,5],[37,6,38],[37,7,6],[36,7,37],[36,8,7],[35,8,36],[35,9,8],[34,9,35],[33,9,34],[33,10,9],[33,30,10],[33,31,30],[32,31,33],[62,64,63],[61,64,62],[67,69,68],[67,70,69],[75,64,61],[74,64,75],[73,64,74],[72,64,73],[71,64,72],[70,64,71],[67,64,70],[67,65,64],[67,66,65],[24,13,45],[24,45,46],[45,13,14],[44,45,14],[23,24,46],[23,46,47],[44,14,15],[43,44,15],[60,43,15],[60,15,16],[23,47,48],[22,23,48],[57,58,59],[57,59,60],[57,60,16],[57,16,17],[56,57,17],[56,17,18],[55,56,18],[55,18,19],[54,55,19],[54,19,20],[53,54,20],[53,20,21],[52,53,21],[51,52,21],[51,21,22],[51,22,48],[51,48,49],[50,51,49],[77,78,79],[76,77,79],[82,83,84],[82,84,85],[90,76,79],[89,90,79],[88,89,79],[87,88,79],[86,87,79],[85,86,79],[82,85,79],[82,79,80],[82,80,81],[91,92,100],[91,100,99],[92,93,101],[92,101,100],[93,94,102],[93,102,101],[94,95,103],[94,103,102],[95,96,104],[95,104,103],[96,97,105],[96,105,104],[97,98,106],[97,106,105],[98,91,99],[98,99,106],[107,108,111],[107,111,110],[108,109,112],[108,112,111],[109,107,110],[109,110,112],[113,114,129],[113,129,128],[114,115,130],[114,130,129],[115,116,131],[115,131,130],[116,117,132],[116,132,131],[117,118,133],[117,133,132],[118,119,134],[118,134,133],[119,120,135],[119,135,134],[120,121,136],[120,136,135],[121,122,137],[121,137,136],[122,123,138],[122,138,137],[123,124,139],[123,139,138],[124,125,140],[124,140,139],[125,126,141],[125,141,140],[126,127,142],[126,142,141],[127,113,128],[127,128,142],[143,144,153],[143,153,152],[144,145,154],[144,154,153],[145,146,155],[145,155,154],[146,147,156],[146,156,155],[147,148,157],[147,157,156],[148,149,158],[148,158,157],[149,150,159],[149,159,158],[150,151,160],[150,160,159],[151,143,152],[151,152,160],[161,162,171],[161,171,170],[162,163,172],[162,172,171],[163,164,173],[163,173,172],[164,165,174],[164,174,173],[165,166,175],[165,175,174],[166,167,176],[166,176,175],[167,168,177],[167,177,176],[168,169,178],[168,178,177],[169,161,170],[169,170,178],[179,180,198],[179,198,197],[180,181,199],[180,199,198],[181,182,200],[181,200,199],[182,183,201],[182,201,200],[183,184,202],[183,202,201],[184,185,203],[184,203,202],[185,186,204],[185,204,203],[186,187,205],[186,205,204],[187,188,206],[187,206,205],[188,189,207],[188,207,206],[189,190,208],[189,208,207],[190,191,209],[190,209,208],[191,192,210],[191,210,209],[192,193,211],[192,211,210],[193,194,212],[193,212,211],[194,195,213],[194,213,212],[195,196,214],[195,214,213],[196,179,197],[196,197,214],[215,216,224],[215,224,223],[216,217,225],[216,225,224],[217,218,226],[217,226,225],[218,219,227],[218,227,226],[219,220,228],[219,228,227],[220,221,229],[220,229,228],[221,222,230],[221,230,229],[222,215,223],[222,223,230],[231,232,250],[231,250,249],[232,233,251],[232,251,250],[233,234,252],[233,252,251],[234,235,253],[234,253,252],[235,236,254],[235,254,253],[236,237,255],[236,255,254],[237,238,256],[237,256,255],[238,239,257],[238,257,256],[239,240,258],[239,258,257],[240,241,259],[240,259,258],[241,242,260],[241,260,259],[242,243,261],[242,261,260],[243,244,262],[243,262,261],[244,245,263],[244,263,262],[245,246,264],[245,264,263],[246,247,265],[246,265,264],[247,248,266],[247,266,265],[248,231,249],[248,249,266],[98,108,91],[98,109,108],[108,92,91],[108,93,92],[107,93,108],[107,94,93],[107,95,94],[107,96,95],[109,96,107],[98,96,109],[98,97,96],[162,147,146],[127,150,113],[127,151,150],[126,151,127],[126,143,151],[162,148,147],[126,144,143],[125,144,126],[161,148,162],[161,149,148],[169,149,161],[169,150,149],[169,113,150],[168,113,169],[168,114,113],[167,114,168],[167,115,114],[166,115,167],[125,145,144],[124,145,125],[123,145,124],[122,145,123],[122,146,145],[121,146,122],[120,146,121],[120,162,146],[120,163,162],[119,163,120],[118,163,119],[118,164,163],[117,164,118],[117,165,164],[116,165,117],[115,165,116],[166,165,115],[186,188,187],[185,188,186],[185,189,188],[184,189,185],[184,190,189],[183,190,184],[183,191,190],[182,191,183],[182,192,191],[181,192,182],[181,193,192],[180,193,181],[180,194,193],[179,194,180],[179,195,194],[179,196,195],[221,215,222],[221,216,215],[219,221,220],[218,221,219],[218,216,221],[218,217,216],[238,240,239],[237,240,238],[237,241,240],[236,241,237],[236,242,241],[235,242,236],[235,243,242],[234,243,235],[234,244,243],[233,244,234],[233,245,244],[232,245,233],[232,246,245],[231,246,232],[231,247,246],[231,248,247],[106,99,111],[106,111,112],[111,99,100],[111,100,101],[110,111,101],[110,101,102],[110,102,103],[110,103,104],[112,110,104],[106,112,104],[106,104,105],[171,155,156],[142,128,159],[142,159,160],[141,142,160],[141,160,152],[171,156,157],[141,152,153],[140,141,153],[170,171,157],[170,157,158],[178,170,158],[178,158,159],[178,159,128],[177,178,128],[177,128,129],[176,177,129],[176,129,130],[175,176,130],[140,153,154],[139,140,154],[138,139,154],[137,138,154],[137,154,155],[136,137,155],[135,136,155],[135,155,171],[135,171,172],[134,135,172],[133,134,172],[133,172,173],[132,133,173],[132,173,174],[131,132,174],[130,131,174],[175,130,174],[204,205,206],[203,204,206],[203,206,207],[202,203,207],[202,207,208],[201,202,208],[201,208,209],[200,201,209],[200,209,210],[199,200,210],[199,210,211],[198,199,211],[198,211,212],[197,198,212],[197,212,213],[197,213,214],[229,230,223],[229,223,224],[227,228,229],[226,227,229],[226,229,224],[226,224,225],[256,257,258],[255,256,258],[255,258,259],[254,255,259],[254,259,260],[253,254,260],[253,260,261],[252,253,261],[252,261,262],[251,252,262],[251,262,263],[250,251,263],[250,263,264],[249,250,264],[249,264,265],[249,265,266])
edgeVisAr = #(true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,false,false,true,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,true,true,false,true,false,false,false,false,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,false,true,false,false,false,false,false,true,false,true,false,true,false,true,true,false,false,true,false,true,true,false,true,false,false,false,true,false,false,true,false,false,true,false,false,true,false,false,true,false,false,true,false,false,false,false,true,false,true,true,false,true,false,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,true,true,false,false,true,false,false,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,true,false,false,false,true,false,false,false,false,false,true,false,true,false,true,true,true,false,true,false,false,true,true,false,false,true,false,true,false,false,true,false,false,true,false,false,true,false,false,true,false,false,true,false,false,false,false,false,false,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,true,true,false,false,true,true,false,false,true,false,true,false,false,true,false,false,true,false,false,false,true,false,true,false,false,true,false,false,true,false,false,false,true,false,false,false,true,true,false,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,true,false,false,true,false,false,false,true,false,false,true,false,true,false,false,false,true,false,true,false,false,false,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,false,false,true,false,true,false,false,false,true,false,false,true,false,false,false,false,true,false,false,false,true,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,true,false,false,false,true,true,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,true,true,false,false,true,true,false,true,false,false,true,true,false,false,true,false,false,false,true,true,false,false,true,true,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,true,true,false,true,false,false,false,true,false,false,true,false,false,true,false,true,false,false,false,true,false,false,true,false,false,true,false,true,false,false,false,false,false,false,true,true,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,false,false,true,false,true,false,false,true,false,false,false,true,false,true,false,false,false,true,false,false,false,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,true,false,false,true,false,false,false,true,false,true,false,false,true,false,false,false,false,false,false,true,false,true,false,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,true,false,false,false,false,true,true,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,true,true,true,false,false,true,false,true,true,false,true,false,false,false,false,false,false,true,true,true,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,true,false,false,false,true,false,false,true,true)
edgeVisArCounter = 1
for i = 1 to edgeVisAr.count/3 do
(
setEdgeVis mesh i 1 edgeVisAr[edgeVisArCounter]
edgeVisArCounter += 1
setEdgeVis mesh i 2 edgeVisAr[edgeVisArCounter]
edgeVisArCounter += 1
setEdgeVis mesh i 3 edgeVisAr[edgeVisArCounter]
edgeVisArCounter += 1
)
)
tool create
(
on mousePoint click do
case click of
(
1: nodeTM.translation = gridPoint
2: #stop
)
/*
on mouseMove click do
case click of
(
2: (width = gridDist.x; depth = gridDist.y)
3: height = gridDist.z
)
*/
)
) | MAXScript | 3 | aboellinger/ExocortexCrate | 3DSMax/MaxScripts/ExocortexCrate/Exocortex-Helper-AlembicTimeControl_Mesh.mcr | [
"BSD-3-Clause"
] |
CLASS zcl_abapgit_object_nspc DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_nspc,
namespace TYPE trnspacet-namespace,
replicense TYPE trnspacet-replicense,
sscrflag TYPE trnspacet-sscrflag,
sapflag TYPE trnspacet-sapflag,
gen_only TYPE trnspacet-gen_only,
END OF ty_nspc .
TYPES:
BEGIN OF ty_nspc_text,
spras TYPE trnspacett-spras,
descriptn TYPE trnspacett-descriptn,
owner TYPE trnspacett-owner,
END OF ty_nspc_text .
TYPES:
ty_nspc_texts TYPE STANDARD TABLE OF ty_nspc_text .
METHODS serialize_texts
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_output
RAISING
zcx_abapgit_exception .
METHODS deserialize_texts
IMPORTING
!ii_xml TYPE REF TO zif_abapgit_xml_input
!iv_namespace TYPE namespace
RAISING
zcx_abapgit_exception .
METHODS add_to_transport
IMPORTING
!iv_package TYPE devclass
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_NSPC IMPLEMENTATION.
METHOD add_to_transport.
DATA: li_sap_package TYPE REF TO zif_abapgit_sap_package.
li_sap_package = zcl_abapgit_factory=>get_sap_package( iv_package ).
IF li_sap_package->are_changes_recorded_in_tr_req( ) = abap_true.
corr_insert( iv_package ).
ENDIF.
ENDMETHOD.
METHOD deserialize_texts.
DATA:
ls_trnspacett TYPE trnspacett,
lt_i18n_langs TYPE TABLE OF langu,
lt_nspc_texts TYPE ty_nspc_texts.
FIELD-SYMBOLS:
<lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_nspc_text> LIKE LINE OF lt_nspc_texts.
ii_xml->read( EXPORTING iv_name = 'I18N_LANGS'
CHANGING cg_data = lt_i18n_langs ).
ii_xml->read( EXPORTING iv_name = 'NSPC_TEXTS'
CHANGING cg_data = lt_nspc_texts ).
SORT lt_i18n_langs.
SORT lt_nspc_texts BY spras. " Optimization
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
ls_trnspacett-namespace = iv_namespace.
READ TABLE lt_nspc_texts ASSIGNING <ls_nspc_text> WITH KEY spras = <lv_lang>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |NSPC_TEXTS cannot find lang { <lv_lang> } in XML| ).
ENDIF.
MOVE-CORRESPONDING <ls_nspc_text> TO ls_trnspacett.
MODIFY trnspacett FROM ls_trnspacett.
IF sy-subrc <> 0.
INSERT trnspacett FROM ls_trnspacett.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error upserting text for namespace| ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD serialize_texts.
DATA:
ls_trnspacett TYPE trnspacett,
lt_nspc_texts TYPE ty_nspc_texts,
lt_i18n_langs TYPE TABLE OF langu.
FIELD-SYMBOLS:
<lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_nspc_text> LIKE LINE OF lt_nspc_texts.
IF ii_xml->i18n_params( )-main_language_only = abap_true.
RETURN.
ENDIF.
" Collect additional languages, skip main lang - it was serialized already
SELECT DISTINCT spras AS langu FROM trnspacett INTO TABLE lt_i18n_langs
WHERE namespace = ms_item-obj_name AND spras <> mv_language. "#EC CI_SUBRC
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
SELECT SINGLE * FROM trnspacett INTO ls_trnspacett
WHERE namespace = ms_item-obj_name AND spras = <lv_lang>.
IF sy-subrc = 0.
APPEND INITIAL LINE TO lt_nspc_texts ASSIGNING <ls_nspc_text>.
MOVE-CORRESPONDING ls_trnspacett TO <ls_nspc_text>.
ENDIF.
ENDLOOP.
SORT lt_i18n_langs ASCENDING.
SORT lt_nspc_texts BY spras ASCENDING.
IF lines( lt_i18n_langs ) > 0.
ii_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
ii_xml->add( iv_name = 'NSPC_TEXTS'
ig_data = lt_nspc_texts ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE changeuser FROM trnspacet INTO rv_user
WHERE namespace = ms_item-obj_name.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
RETURN. " not supported
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA:
ls_nspc TYPE ty_nspc,
ls_nspc_text TYPE ty_nspc_text,
lv_modifiable TYPE abap_bool,
ls_trnspacet TYPE trnspacet,
ls_trnspacett TYPE trnspacett.
io_xml->read( EXPORTING iv_name = 'NSPC'
CHANGING cg_data = ls_nspc ).
io_xml->read( EXPORTING iv_name = 'NSPC_TEXT'
CHANGING cg_data = ls_nspc_text ).
add_to_transport( iv_package ).
SELECT SINGLE * FROM trnspacet INTO ls_trnspacet WHERE namespace = ls_nspc-namespace.
IF sy-subrc = 0.
" For existing namespace, check if it's modifiable (SE03)
SELECT SINGLE editflag FROM trnspace INTO lv_modifiable WHERE namespace = ls_nspc-namespace.
IF sy-subrc = 0 AND lv_modifiable = abap_false.
zcx_abapgit_exception=>raise( |Namespace is not modifiable| ).
ENDIF.
" keep existing role
ls_trnspacet-replicense = ls_nspc-replicense.
ls_trnspacet-sscrflag = ls_nspc-sscrflag.
ls_trnspacet-sapflag = ls_nspc-sapflag.
ls_trnspacet-gen_only = ls_nspc-gen_only.
ls_trnspacet-changeuser = sy-uname.
ls_trnspacet-changedate = sy-datum.
MODIFY trnspacet FROM ls_trnspacet.
ELSE.
MOVE-CORRESPONDING ls_nspc TO ls_trnspacet.
ls_trnspacet-role = 'C'. " customer repair license
ls_trnspacet-changeuser = sy-uname.
ls_trnspacet-changedate = sy-datum.
INSERT trnspacet FROM ls_trnspacet.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error upserting namespace| ).
ENDIF.
SELECT SINGLE * FROM trnspacett INTO ls_trnspacett
WHERE namespace = ls_nspc-namespace AND spras = mv_language.
IF sy-subrc = 0.
ls_trnspacett-descriptn = ls_nspc_text-descriptn.
ls_trnspacett-owner = ls_nspc_text-owner.
MODIFY trnspacett FROM ls_trnspacett.
ELSE.
MOVE-CORRESPONDING ls_nspc_text TO ls_trnspacett.
ls_trnspacett-namespace = ls_nspc-namespace.
INSERT trnspacett FROM ls_trnspacett.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error upserting text for namespace| ).
ENDIF.
deserialize_texts( ii_xml = io_xml
iv_namespace = ls_nspc-namespace ).
" Fill trnspace and trnspacel tables
CALL FUNCTION 'TR_ACTIVATE_NAMESPACE'
EXPORTING
iv_namespace = ls_nspc-namespace
EXCEPTIONS
deletion_not_allowed = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error activating namespace| ).
ENDIF.
" Make namespace modifiable
UPDATE trnspace SET editflag = abap_true WHERE namespace = ls_nspc-namespace.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA lv_namespace TYPE trnspace-namespace.
lv_namespace = ms_item-obj_name.
CALL FUNCTION 'TR_CHECK_NAMESPACE'
EXPORTING
iv_namespace = lv_namespace
EXCEPTIONS
namespace_not_valid = 1
OTHERS = 2.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = zif_abapgit_object~exists( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
" Launch general maintenance for namespaces
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
action = 'S'
view_name = 'V_TRNSPACE'
no_warning_for_clientindep = 'X'
variant_for_selection = 'STANDARD'
EXCEPTIONS
client_reference = 1
foreign_lock = 2
invalid_action = 3
no_clientindependent_auth = 4
no_database_function = 5
no_editor_function = 6
no_show_auth = 7
no_tvdir_entry = 8
no_upd_auth = 9
only_show_allowed = 10
system_failure = 11
unknown_field_in_dba_sellist = 12
view_not_found = 13
OTHERS = 14.
rv_exit = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA:
ls_nspc TYPE ty_nspc,
ls_nspc_text TYPE ty_nspc_text.
SELECT SINGLE * FROM trnspacet INTO CORRESPONDING FIELDS OF ls_nspc
WHERE namespace = ms_item-obj_name.
SELECT SINGLE * FROM trnspacett INTO CORRESPONDING FIELDS OF ls_nspc_text
WHERE namespace = ms_item-obj_name AND spras = mv_language.
io_xml->add( iv_name = 'NSPC'
ig_data = ls_nspc ).
io_xml->add( iv_name = 'NSPC_TEXT'
ig_data = ls_nspc_text ).
serialize_texts( io_xml ).
ENDMETHOD.
ENDCLASS.
| ABAP | 4 | IvxLars/abapGit | src/objects/zcl_abapgit_object_nspc.clas.abap | [
"MIT"
] |
import io/[Writer, BufferWriter]
import structs/[Bag, HashBag]
import text/[EscapeSequence]
import Parser
GeneratorError: class extends Exception {
init: super func ~noOrigin
}
EXCLUDE := const "'" // don't escape the '
generate: func <T> (writer: Writer, obj: T) {
match T {
case String => {
if(obj as String == null) {
// Special case: "null as String" should probably not segfault.
writer write("null")
} else {
writer write("\"%s\"" format(EscapeSequence escape(obj as String, EXCLUDE) toCString()))
}
}
case Int => {
writer write(obj as Int toString())
}
case Int64 => {
writer write(obj as Int64 toString())
}
case UInt => {
writer write(obj as UInt toString())
}
case SSizeT => { // for int literals
writer write(obj as SSizeT toString())
}
case Bool => {
writer write((obj as Bool ? "true" : "false"))
}
case Pointer => {
writer write("null")
}
case Number => {
writer write(obj as Number value)
}
case HashBag => {
writer write('{')
bag := obj as HashBag
first := true
for(key: String in bag getKeys()) {
if(first)
first = false
else
writer write(',')
generate(writer, key)
writer write(':')
U := bag getClass(key)
generate(writer, bag get(key, U))
}
writer write('}')
}
case Bag => {
writer write('[')
bag := obj as Bag
first := true
for(i: SizeT in 0..bag getSize()) {
if(first)
first = false
else
writer write(',')
U := bag getClass(i)
generate(writer, bag get(i, U))
}
writer write(']')
}
case => {
GeneratorError new("Unknown type: %s" format(T name toCString())) throw()
}
}
}
generateString: func <T> (obj: T) -> String {
writer := BufferWriter new()
generate(writer, obj)
writer buffer toString()
}
| ooc | 4 | fredrikbryntesson/launchtest | sdk/text/json/Generator.ooc | [
"MIT"
] |
module: dfmc-harp-x86-cg
Author: Nosa Omo
Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
/// ACCESSORS
define sideways method op--load-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset :: <integer>,
#key tagged?) => ()
if (tagged?)
ins--ld-index(back-end, result, base, scaled-index, unset-tag-bit(offset));
else
ins--ld-index-scaled(back-end, result, base, scaled-index, offset);
end if
end method op--load-index;
define sideways method op--load-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset,
#key tagged?) => ()
ins--ld-index-scaled(back-end, result, op--add(back-end, #f, base, offset), scaled-index, 0);
end method op--load-index;
define sideways method op--store-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset :: <integer>,
#key tagged?) => ()
if (tagged?)
ins--st-index(back-end, value, base, scaled-index, unset-tag-bit(offset));
else
ins--st-index-scaled(back-end, value, base, scaled-index, offset);
end if;
ins--move(back-end, result, value);
end method op--store-index;
define sideways method op--store-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset,
#key tagged?) => ()
ins--st-index-scaled(back-end, value, op--add(back-end, #f, base, offset), scaled-index, 0);
ins--move(back-end, result, value);
end method op--store-index;
define sideways method op--load-byte-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset :: <integer>) => ()
ins--ldb-index(back-end, result, base, scaled-index, offset);
end method op--load-byte-index;
define sideways method op--load-byte-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset) => ()
ins--ldb-index(back-end, result, op--add(back-end, #f, base, offset), scaled-index, 0);
end method op--load-byte-index;
define sideways method op--store-byte-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset :: <integer>) => ()
ins--stb-index(back-end, value, base, scaled-index, offset);
ins--move(back-end, result, value);
end method op--store-byte-index;
define sideways method op--store-byte-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset) => ()
ins--stb-index(back-end, value, op--add(back-end, #f, base, offset), scaled-index, 0);
ins--move(back-end, result, value);
end method op--store-byte-index;
define sideways method op--store-bit-index
(back-end :: <harp-x86-back-end>, result, value, base, index, offset, bit) => ()
select (value)
0 =>
ins--bitc-mem(back-end, base, index, offset, bit);
1 =>
ins--bits-mem(back-end, base, index, offset, bit);
otherwise =>
let set-bit-tag = make-tag(back-end);
let done-tag = make-tag(back-end);
ins--bne(back-end, set-bit-tag, value, 0);
ins--bitc-mem(back-end, base, index, offset, bit);
ins--bra(back-end, done-tag);
ins--tag(back-end, set-bit-tag);
ins--bits-mem(back-end, base, index, offset, bit);
ins--tag(back-end, done-tag);
end select;
ins--move(back-end, result, value);
end method op--store-bit-index;
define sideways method op--load-signed-byte-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset :: <integer>) => ()
ins--ldb-index-signed(back-end, result, base, scaled-index, offset);
end method op--load-signed-byte-index;
define sideways method op--load-signed-byte-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset) => ()
ins--ldb-index-signed(back-end, result, op--add(back-end, #f, base, offset), scaled-index, 0);
end method op--load-signed-byte-index;
define sideways method op--store-signed-byte-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset) => ()
op--store-byte-index(back-end, result, value, base, scaled-index, offset);
end method op--store-signed-byte-index;
define sideways method op--load-half-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset :: <integer>) => ()
ins--ldh-index-scaled(back-end, result, base, scaled-index, offset);
end method op--load-half-index;
define sideways method op--load-half-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset) => ()
ins--ldh-index-scaled(back-end, result, op--add(back-end, #f, base, offset), scaled-index, 0);
end method op--load-half-index;
define sideways method op--store-half-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset :: <integer>) => ()
ins--sth-index-scaled(back-end, value, base, scaled-index, offset);
ins--move(back-end, result, value);
end method op--store-half-index;
define sideways method op--store-half-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset) => ()
ins--sth-index-scaled(back-end, value, op--add(back-end, #f, base, offset), scaled-index, 0);
ins--move(back-end, result, value);
end method op--store-half-index;
define sideways method op--load-signed-half-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset :: <integer>) => ()
ins--ldh-index-scaled-signed(back-end, result, base, scaled-index, offset);
end method op--load-signed-half-index;
define sideways method op--load-signed-half-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset) => ()
ins--ldh-index-scaled-signed(back-end, result, op--add(back-end, #f, base, offset), scaled-index, 0);
end method op--load-signed-half-index;
define sideways method op--store-signed-half-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset) => ()
op--store-half-index(back-end, result, value, base, scaled-index, offset);
end method op--store-signed-half-index;
define sideways method op--load-float-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset :: <integer>,
#key tagged?) => ()
if (tagged?)
ins--fld-index(back-end, result, base, scaled-index, unset-tag-bit(offset));
else
ins--fld-index-scaled(back-end, result, base, scaled-index, offset);
end if
end method op--load-float-index;
define sideways method op--load-float-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset,
#key tagged?) => ()
ins--fld-index-scaled(back-end, result, op--add(back-end, #f, base, offset), scaled-index, 0);
end method op--load-float-index;
define sideways method op--store-float-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset :: <integer>,
#key tagged?) => ()
if (tagged?)
ins--fst-index(back-end, value, base, scaled-index, unset-tag-bit(offset));
else
ins--fst-index-scaled(back-end, value, base, scaled-index, offset);
end if;
ins--fmove(back-end, result, value);
end method op--store-float-index;
define sideways method op--store-float-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset,
#key tagged?) => ()
ins--fst-index-scaled(back-end, value, op--add(back-end, #f, base, offset), scaled-index, 0);
ins--fmove(back-end, result, value);
end method op--store-float-index;
define sideways method op--load-dfloat-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset :: <integer>,
#key tagged?) => ()
if (tagged?)
ins--dld-index-scale-2(back-end, result, base, scaled-index, offset - 2);
else
ins--dld-index-scaled(back-end, result, base, scaled-index, offset);
end if
end method op--load-dfloat-index;
define sideways method op--load-dfloat-index
(back-end :: <harp-x86-back-end>, result, base, scaled-index, offset,
#key tagged?) => ()
ins--dld-index-scaled(back-end, result, op--add(back-end, #f, base, offset), scaled-index, 0);
end method op--load-dfloat-index;
define sideways method op--store-dfloat-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset :: <integer>,
#key tagged?) => ()
if (tagged?)
ins--dst-index-scale-2(back-end, value, base, scaled-index, offset - 2);
else
ins--dst-index-scaled(back-end, value, base, scaled-index, offset);
end if;
ins--dmove(back-end, result, value);
end method op--store-dfloat-index;
define sideways method op--store-dfloat-index
(back-end :: <harp-x86-back-end>, result, value, base, scaled-index, offset,
#key tagged?) => ()
ins--dst-index-scaled(back-end, value, op--add(back-end, #f, base, offset), scaled-index, 0);
ins--dmove(back-end, result, value);
end method op--store-dfloat-index;
| Dylan | 3 | kryptine/opendylan | sources/dfmc/harp-x86-cg/x86-primitives.dylan | [
"BSD-2-Clause"
] |
--TEST--
Ensure default ini settings
--SKIPIF--
<?php if (!extension_loaded("grpc")) print "skip"; ?>
--FILE--
<?php
if (ini_get('grpc.enable_fork_support')) {
die('grpc.enable_fork_support not off by default');
}
if (ini_get('grpc.poll_strategy') !== "") {
die('grpc.poll_strategy not empty by default');
}
echo 'ok';
--EXPECT--
ok
| PHP | 3 | mpminardi/grpc | src/php/ext/grpc/tests/grpc-default-ini.phpt | [
"Apache-2.0"
] |
# This file is distributed under the same license as the Django package.
#
# Translators:
# Oleksandr Chernihov <o.chernihov@gmail.com>, 2014
# Illia Volochii <illia.volochii@gmail.com>, 2021
# Jannis Leidel <jannis@leidel.info>, 2011
# Mykola Zamkovoi <nickzam@gmail.com>, 2014
# Vitaliy Kozlovskyi <ubombi@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-15 09:00+0100\n"
"PO-Revision-Date: 2021-01-20 00:12+0000\n"
"Last-Translator: Illia Volochii <illia.volochii@gmail.com>\n"
"Language-Team: Ukrainian (http://www.transifex.com/django/django/language/"
"uk/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: uk\n"
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != "
"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % "
"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || "
"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
msgid "Redirects"
msgstr "Перенаправлення"
msgid "site"
msgstr "сайт"
msgid "redirect from"
msgstr "перенаправлення з"
msgid ""
"This should be an absolute path, excluding the domain name. Example: “/"
"events/search/”."
msgstr ""
"Шлях має бути абсолютним без доменного імені. Наприклад, “/events/search/”."
msgid "redirect to"
msgstr "перенаправлення до"
msgid ""
"This can be either an absolute path (as above) or a full URL starting with a "
"scheme such as “https://”."
msgstr ""
"Шлях може бути або абсолютним (як вказано вище), або повним URL (який "
"починається із схеми, як-от “https://”)."
msgid "redirect"
msgstr "перенаправлення"
msgid "redirects"
msgstr "перенаправлення"
| Gettext Catalog | 2 | Joshua-Barawa/My-Photos | venv/lib/python3.8/site-packages/django/contrib/redirects/locale/uk/LC_MESSAGES/django.po | [
"PostgreSQL",
"Unlicense"
] |
UrlArticle form template.
{{ form.errors }}
| HTML | 0 | ni-ning/django | tests/templates/views/urlarticle_form.html | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] |
static char g_Script_vscript_vbsp[] = R"vscript(
//========= Mapbase - https://github.com/mapbase-source/source-sdk-2013 ============//
//
// Purpose:
//
//=============================================================================//
function UniqueString( string = "" )
{
return ::DoUniqueString( string.tostring() );
}
function __ReplaceClosures( script, scope )
{
if ( !scope )
{
scope = getroottable();
}
local tempParent = { getroottable = function() { return null; } };
local temp = { runscript = script };
temp.set_delegate(tempParent);
temp.runscript()
foreach( key,val in temp )
{
if ( typeof(val) == "function" && key != "runscript" )
{
printl( " Replacing " + key );
scope[key] <- val;
}
}
}
function IncludeScript( name, scope = null )
{
if ( !scope )
{
scope = this;
}
return ::DoIncludeScript( name, scope );
}
// VBSP logs don't support ConColorMsg()
print <- Msg
function printdoc( text )
{
return ::print(text + "\n");
}
)vscript"; | Squirrel | 4 | map-labs-source/Map-Labs | sp/src/utils/vbsp/vscript_vbsp.nut | [
"Unlicense"
] |
# Broken , (should be ;)
PREFIX : <http://example/ns#>
SELECT * WHERE
{ :s :p1 :o1 , :p2 :o2}
| SPARQL | 1 | alpano-unibz/ontop | test/sparql-compliance/src/test/resources/testcases-dawg/data-r2/syntax-sparql3/syn-bad-24.rq | [
"Apache-2.0"
] |
eTab growSize 4
{ 4
"Version" eTab growSize 4
{ 2
"Major" s 2
"Minor" s 1
}
"Project" eTab growSize 4
{ 12
"Name" ea "chat"
"Project Type" i 0
"EosFramework" ea "ChatApp"
"Environment" i 1
"Company Name" eStr null
"Product Name" eStr null
"Product Version" eStr 3 "0.0"
"Copyright Message" eStr null
"Default Dialog Type" eNum ( "Default Dialog Type" 1 )
"App Type" i 3
"Default Deployment" eNum ( "EosProjectGalleryType" 1 )
"Default Layout" eNum ( "Default Layout" 0 )
}
"Types List" eTab growSize 4
{ 2
"ChatApp" eTab growSize 4
{ 12
"Name" ea "ChatApp"
"Super Class" ea "EosFramework"
"EosStructType" eNum ( "EosStructType" 1 )
"Header File" eStr 7 "ChatApp"
"Implementation File" eStr 7 "ChatApp"
"Last HPP Generated" eStr 7 "ChatApp"
"Last CPP Generated" eStr 7 "ChatApp"
"Last Class Generated" eStr 7 "ChatApp"
"Property List" eTab growSize 4
{ 0
}
"Fields" eTab growSize 4
{ 1
"fChatList" eTab growSize 4
{ 5
"Name" ea "fChatList"
"Property List" eTab growSize 4
{ 0
}
"class" ea "ChatApp"
"eos_type" ea "EosString"
"Is Array" eb T
}
}
"Functions" eTab growSize 4
{ 0
}
"Views" eTab growSize 4
{ 0
}
}
"ChatPerson" eTab growSize 4
{ 12
"Name" ea "ChatPerson"
"Super Class" ea "EosObject"
"EosStructType" eNum ( "EosStructType" 1 )
"Header File" eStr 10 "ChatPerson"
"Implementation File" eStr 10 "ChatPerson"
"Last HPP Generated" eStr 10 "ChatPerson"
"Last CPP Generated" eStr 10 "ChatPerson"
"Last Class Generated" eStr 10 "ChatPerson"
"Property List" eTab growSize 4
{ 0
}
"Fields" eTab growSize 4
{ 3
"fChatList" eTab growSize 4
{ 6
"Name" ea "fChatList"
"Property List" eTab growSize 4
{ 0
}
"class" ea "ChatPerson"
"eos_type" ea "EosString"
"Is Array" eb T
"pointer" eb T
}
"fName" eTab growSize 4
{ 4
"Name" ea "fName"
"Property List" eTab growSize 4
{ 0
}
"class" ea "ChatPerson"
"eos_type" ea "EosString"
}
"fSendString" eTab growSize 4
{ 4
"Name" ea "fSendString"
"Property List" eTab growSize 4
{ 0
}
"class" ea "ChatPerson"
"eos_type" ea "EosString"
}
}
"Functions" eTab growSize 4
{ 1
"send" eTab growSize 4
{ 4
"Name" ea "send"
"class" ea "ChatPerson"
"signature" ea "NVNV"
"Property List" eTab growSize 4
{ 0
}
}
}
"Views" eTab growSize 4
{ 1
"Chat" eTab growSize 4
{ 7
"Interactor Name" ea "Chat"
"Constructor" ea "EosJavaEmbeddedView"
"Local Descriptor" eTab growSize 20
{ 1
"View Children" eSeq growSize 3 [ 3 eTab growSize 10
{ 13
"EosViewType" eNum ( "EosViewType" 1 )
"Interactor Name" ea "Java Text"
"Environment Index" l -1
"Caption" eStr 4 "Chat"
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"View Style" eTab growSize 4
{ 2
"Parent" ea "System"
"Font" eFon "F Times New Roman 2 -27 F F"
}
"Min Lines" l 1
"Max Lines" l 100
"Min Chars" l 15
"Desired Chars" l 15
"Max Chars" l 300
"Size to Text" eb T
"Java Class Name" ea "EosLabel"
} growSize 10
{ 17
"EosViewType" eNum ( "EosViewType" 2 )
"Interactor Name" ea "Java List Box"
"Environment Index" l -1
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"EosStructType" eNum ( "EosStructType" 0 )
"Data Type" ea "EosBaseArray"
"Field Name" ea "fChatList"
"Editor Name" ea "EosOVMapEditor"
"Environment Object Id" l -1
"Tab Order" s -1
"Min Lines" l 10
"Desired Lines" l 10
"Max Lines" l 100
"Min Chars" l 20
"Desired Chars" l 20
"Max Chars" l 300
"Java Class Name" ea "EosListBox"
} growSize 10
{ 6
"EosViewType" eNum ( "EosViewType" 0 )
"Interactor Name" ea "Java Grid"
"Environment Index" l -1
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"View Children" eSeq growSize 4 [ 4 eTab growSize 10
{ 12
"EosViewType" eNum ( "EosViewType" 1 )
"Interactor Name" ea "Java Text"
"Environment Index" l -1
"Caption" eStr 8 "My Name:"
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"Min Lines" l 1
"Max Lines" l 100
"Min Chars" l 15
"Desired Chars" l 15
"Max Chars" l 300
"Size to Text" eb T
"Java Class Name" ea "EosLabel"
} growSize 10
{ 9
"EosViewType" eNum ( "EosViewType" 0 )
"Interactor Name" ea "Java Box"
"Environment Index" l -1
"Caption" eStr 8 "Untitled"
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"Margin (Internal)" eb T
"View Children" eSeq growSize 2 [ 2 eTab growSize 10
{ 15
"EosViewType" eNum ( "EosViewType" 2 )
"Interactor Name" ea "Java Type In"
"Environment Index" l -1
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"EosStructType" eNum ( "EosStructType" 0 )
"Data Type" ea "EosString"
"Field Name" ea "fName"
"Editor Name" ea "EosOVMapEditor"
"Environment Object Id" l -1
"Tab Order" s 0
"Desired Lines" l 1
"Min Chars" l 15
"Desired Chars" l 15
"Max Chars" l 300
"Java Class Name" ea "EosTextField"
} growSize 10
{ 19
"EosViewType" eNum ( "EosViewType" 2 )
"Interactor Name" ea "Java Button"
"Environment Index" l -1
"Caption" eStr 4 "Send"
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"Data Type" ea "EosFunction"
"Min Chars" l 15
"Desired Chars" l 15
"Max Chars" l 15
"Min Lines" l 1
"Desired Lines" l 1
"Max Lines" l 1
"EosStructType" eNum ( "EosStructType" 0 )
"Field Name" ea "send"
"Editor Name" ea "EosOVMapEditor"
"Environment Object Id" l -1
"Tab Order" s 2
"Java Class Name" ea "EosButton"
"OK Cancel Neither" s -1
} ]
"Layout Style" eNum ( "EosOrientation" 0 )
"Java Class Name" ea "EosBoxContainer"
} growSize 10
{ 12
"EosViewType" eNum ( "EosViewType" 1 )
"Interactor Name" ea "Java Text"
"Environment Index" l -1
"Caption" eStr 8 "Message:"
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"Min Lines" l 1
"Max Lines" l 100
"Min Chars" l 15
"Desired Chars" l 15
"Max Chars" l 300
"Size to Text" eb T
"Java Class Name" ea "EosLabel"
} growSize 10
{ 15
"EosViewType" eNum ( "EosViewType" 2 )
"Interactor Name" ea "Java Type In"
"Environment Index" l -1
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"EosStructType" eNum ( "EosStructType" 0 )
"Data Type" ea "EosString"
"Field Name" ea "fSendString"
"Editor Name" ea "EosOVMapEditor"
"Environment Object Id" l -1
"Tab Order" s 1
"Desired Lines" l 1
"Min Chars" l 15
"Desired Chars" l 15
"Max Chars" l 300
"Java Class Name" ea "EosTextField"
} ]
"Java Class Name" ea "EosGridContainer"
} ]
}
"Parent Descriptor" eTab growSize 10
{ 17
"EosViewType" eNum ( "EosViewType" 2 )
"Interactor Name" ea "Chat"
"Environment Index" l -1
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"Margin" eb T
"Min Container Width" l 5
"Min Container Height" l 5
"Show Grid" eb F
"EosStructType" eNum ( "EosStructType" 1 )
"Data Type" ea "ChatPerson"
"Field Name" ea ""
"Editor Name" ea "EosContainerEditor"
"Environment Object Id" l -1
"Tab Order" s -1
"Accelerator" s 0
"eosEffectiveTypeName" ea ""
"Java Class Name" ea "EosEmbeddedView"
}
"Shell Descriptor" eTab growSize 10
{ 16
"EosViewType" eNum ( "EosViewType" 0 )
"Interactor Name" ea "Chat"
"Environment Index" l 0
"Caption" eStr 4 "Chat"
"EosInteractorType" eNum ( "EosInteractorType" 0 )
"View Style" ea "System"
"Background Height" eb T
"Min Container Width" l 5
"Min Container Height" l 5
"View Children" eSeq growSize 4 [ 0 eTab ]
"Minimized Icon" eIcn ""
"Modality State" eNum ( "EosModality" 2 )
"X" s 422
"Y" s 139
"Width" s 353
"Height" s 304
}
"Palette Bitmap" eBmp ""
"class" ea "ChatPerson"
}
}
}
}
"Resources List" eTab growSize 4
{ 8
"Icon List" eTab growSize 4
{ 0
}
"Bitmap List" eTab growSize 4
{ 0
}
"Cursor List" eTab growSize 4
{ 0
}
"Font List" eTab growSize 4
{ 1
"F Times New Roman 2 -27 F F" eTab growSize 4
{ 8
"Font Underline" eb F
"Font Strikeout" eb F
"Font Size" i -27
"Character Set" i 0
"Font Style" i 2
"Font Typename" eStr 15 "Times New Roman"
"Is TrueType" eb F
"Font Name" eStr 21 "Times New Roman 20Pt."
}
}
"ImageList List" eTab growSize 4
{ 0
}
"Sound List" eTab growSize 4
{ 0
}
"Video List" eTab growSize 4
{ 0
}
"Resource Seqs" eTab growSize 4
{ 0
}
}
} | Ecere Projects | 2 | sarangbaheti/misc-code | msj_archives/code/Msj1296.src/Thin Client/chat.epj | [
"Unlicense"
] |
@article{lundberg2020local2global,
title={From local explanations to global understanding with explainable AI for trees},
author={Lundberg, Scott M. and Erion, Gabriel and Chen, Hugh and DeGrave, Alex and Prutkin, Jordan M. and Nair, Bala and Katz, Ronit and Himmelfarb, Jonathan and Bansal, Nisha and Lee, Su-In},
journal={Nature Machine Intelligence},
volume={2},
number={1},
pages={2522-5839},
year={2020},
publisher={Nature Publishing Group}
}
| TeX | 1 | santanaangel/shap | docs/references/tree_explainer.bib | [
"MIT"
] |
%{--
- Copyright 2016 SimplifyOps, Inc. (http://simplifyops.com)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--}%
<%--
Created by IntelliJ IDEA.
User: greg
Date: Aug 8, 2008
Time: 5:18:30 PM
To change this template use File | Settings | File Templates.
--%>
<%
def gcal=new java.util.GregorianCalendar()
gcal.setTime(new Date())
def CUR_YEAR=gcal.get(java.util.GregorianCalendar.YEAR)
%>
<tr>
<td colspan="2" id="extDateFilters" style="${!params.recentFilter || params.recentFilter!='-' ? 'display:none;':''} background: #ccc; border:1px solid #aaa; text-align:left;">
<g:if test="${!hidestart}">
<div>
<span class="prompt">
<g:checkBox name="dostartafterFilter"
value="${query?.dostartafterFilter}"
id="dostartafterFilter"
onclick="if(this.checked){\$('startafterfilterCtrls').show()}else{\$('startafterfilterCtrls').hide()}"/>
<label for="dostartafterFilter">Started After:</label>
</span>
<div class="presentation" id="startafterfilterCtrls" style="white-space:nowrap; ${query?.dostartafterFilter?'':'display:none;'}">
<g:datePicker name="startafterFilter"
years="${CUR_YEAR==2007?2007:CUR_YEAR..2007}"
value="${query?.startafterFilter}"
id="startafterFilter"/>
</div>
</div>
<div>
<span class="prompt">
<g:checkBox name="dostartbeforeFilter"
value="${query?.dostartbeforeFilter}"
id="dostartbeforeFilter"
onclick="if(this.checked){\$('startbeforefilterCtrls').show()}else{\$('startbeforefilterCtrls').hide()}"/>
<label for="dostartbeforeFilter">Started Before:</label>
</span>
<div class="presentation" id="startbeforefilterCtrls" style="white-space:nowrap; ${query?.dostartbeforeFilter?'':'display:none'}">
<g:datePicker name="startbeforeFilter"
years="${CUR_YEAR==2007?2007:CUR_YEAR..2007}"
value="${query?.startbeforeFilter}"
id="startbeforeFilter"/>
</div>
</div>
</g:if>
<div>
<span class="prompt">
<g:checkBox name="doendafterFilter"
value="${query?.doendafterFilter}"
id="doendafterFilter"
onclick="if(this.checked){\$('endafterfilterCtrls').show()}else{\$('endafterfilterCtrls').hide()}"/>
<label for="doendafterFilter">Ended After:</label>
</span>
<div class="presentation" id="endafterfilterCtrls" style="white-space:nowrap; ${query?.doendafterFilter?'':'display:none'}">
<g:datePicker name="endafterFilter"
years="${CUR_YEAR==2007?2007:CUR_YEAR..2007}"
value="${query?.endafterFilter}"
id="endafterFilter"/>
</div>
</div>
<div>
<span class="prompt">
<g:checkBox name="doendbeforeFilter"
value="${query?.doendbeforeFilter}"
id="doendbeforeFilter"
onclick="if(this.checked){\$('endbeforefilterCtrls').show()}else{\$('endbeforefilterCtrls').hide()}"/>
<label for="doendbeforeFilter">Ended Before:</label>
</span>
<div class="presentation" id="endbeforefilterCtrls" style="white-space:nowrap; ${query?.doendbeforeFilter?'':'display:none'}">
<g:datePicker name="endbeforeFilter"
years="${CUR_YEAR==2007?2007:CUR_YEAR..2007}"
value="${query?.endbeforeFilter}"
id="endbeforeFilter"/>
</div>
</div>
</td>
</tr> | Groovy Server Pages | 3 | kbens/rundeck | rundeckapp/grails-app/views/reports/_advDateFilters.gsp | [
"Apache-2.0"
] |
#!zsh
alias artisan='php artisan'
alias bob='php artisan bob::build'
# Development
alias pas='php artisan serve'
# Database
alias pam='php artisan migrate'
alias pamf='php artisan migrate:fresh'
alias pamfs='php artisan migrate:fresh --seed'
alias pamr='php artisan migrate:rollback'
alias pads='php artisan db:seed'
# Makers
alias pamm='php artisan make:model'
alias pamc='php artisan make:controller'
alias pams='php artisan make:seeder'
alias pamt='php artisan make:test'
alias pamfa='php artisan make:factory'
alias pamp='php artisan make:policy'
alias pame='php artisan make:event'
alias pamj='php artisan make:job'
alias paml='php artisan make:listener'
alias pamn='php artisan make:notification'
alias pampp='php artisan make:provider'
# Clears
alias pacac='php artisan cache:clear'
alias pacoc='php artisan config:clear'
alias pavic='php artisan view:clear'
alias paroc='php artisan route:clear'
# queues
alias paqf='php artisan queue:failed'
alias paqft='php artisan queue:failed-table'
alias paql='php artisan queue:listen'
alias paqr='php artisan queue:retry'
alias paqt='php artisan queue:table'
alias paqw='php artisan queue:work'
| Shell | 4 | chensanle/ohmyzsh | plugins/laravel/laravel.plugin.zsh | [
"MIT"
] |
#tag Module
Protected Module ApplicationRecoveryWFS
#tag Method, Flags = &h21
Private Function RecoveryCallback(param as UInt32) As UInt32
// This callback method must be a StdCall
#pragma X86CallingConvention StdCall
mCallback.RecoveryCallback( param )
Exception
// If anything bad happened, we failed
RecoveryFinished( false )
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Sub RecoveryFinished(success as Boolean)
#if TargetWin32
Soft Declare Sub ApplicationRecoveryFinished Lib "Kernel32" ( success as Boolean )
if System.IsFunctionAvailable( "ApplicationRecoveryFinished", "Kernel32" ) then
ApplicationRecoveryFinished( success )
end if
#else
#pragma unused success
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1
Protected Function RecoveryInProgress() As Boolean
#if TargetWin32
Soft Declare Sub ApplicationRecoveryInProgress Lib "Kernel32" ( ByRef cancelled as Boolean )
if System.IsFunctionAvailable( "ApplicationRecoveryInProgress", "Kernel32" ) then
dim ret as Boolean
ApplicationRecoveryInProgress( ret )
return ret
end if
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1
Protected Sub RegisterRecoveryCallback(callback as ApplicationRecoveryCallbackProviderWFS, param as UInt32)
#if TargetWin32
Soft Declare Sub RegisterApplicationRecoveryCallback Lib "Kernel32" ( callback as Ptr, param as UInt32, ping as UInt32, flags as UInt32 )
if callback <> nil and System.IsFunctionAvailable( "RegisterApplicationRecoveryCallback", "Kernel32" ) then
mCallback = callback
RegisterApplicationRecoveryCallback( AddressOf RecoveryCallback, param, 0, 0 )
end if
#else
#pragma unused callback
#pragma unused param
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1
Protected Sub RegisterRestart(commandLine as String, flags as Integer)
#if TargetWin32
Soft Declare Sub RegisterApplicationRestart Lib "Kernel32" ( cmdLine as WString, flags as UInt32 )
if System.IsFunctionAvailable( "RegisterApplicationRestart", "Kernel32" ) then
RegisterApplicationRestart( commandLine, flags )
end if
#else
#pragma unused commandLine
#pragma unused flags
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1
Protected Sub UnregisterRestart()
#if TargetWin32
Soft Declare Sub UnregisterApplicationRestart Lib "Kernel32" ()
if System.IsFunctionAvailable( "UnregisterApplicationRestart", "Kernel32" ) then
UnregisterApplicationRestart
end if
#endif
End Sub
#tag EndMethod
#tag Property, Flags = &h21
Private mCallback As ApplicationRecoveryCallbackProviderWFS
#tag EndProperty
#tag ViewBehavior
#tag ViewProperty
Name="Index"
Visible=true
Group="ID"
InitialValue="-2147483648"
InheritedFrom="Object"
#tag EndViewProperty
#tag ViewProperty
Name="Left"
Visible=true
Group="Position"
InitialValue="0"
InheritedFrom="Object"
#tag EndViewProperty
#tag ViewProperty
Name="Name"
Visible=true
Group="ID"
InheritedFrom="Object"
#tag EndViewProperty
#tag ViewProperty
Name="Super"
Visible=true
Group="ID"
InheritedFrom="Object"
#tag EndViewProperty
#tag ViewProperty
Name="Top"
Visible=true
Group="Position"
InitialValue="0"
InheritedFrom="Object"
#tag EndViewProperty
#tag EndViewBehavior
End Module
#tag EndModule
| REALbasic | 4 | bskrtich/WFS | Windows Functionality Suite/Process Management/Modules/ApplicationRecoveryWFS.rbbas | [
"MIT"
] |
package {
import GZ.Gpu.Gpu;
import GZ.Sys.Interface.Interface;
import GZ.Input.Key;
import GZ.Sys.Interface.Context;
import GZ.Sys.Interface.Window;
import GZ.Sys.System;
//import GzWindows.Sys.Message.OpContextLink;
<cpp_h>
#include "Lib_GzWindows/MainHeader.h"
</cpp_h>
<cpp>
#include "Lib_GZ/Lib.h"
extern gzUIntX nTestProgInstance;
</cpp>
<cpp_namespace>
HDC hmemdc;
gzInt* aPixels;
gzInt** p2DArray;
SIZE frameSize;
HBITMAP hbmp;
</cpp_namespace>
public class OpContext overplace Context {
public var sIcon : String;
//public var bCloseBox : Bool = true;
// private static var qaShort : QArray<Int, 1>;
public var hWinClickNew : eWinClick = eWinClick.None;
//public var hWinClickNew : eWinClick;
public function OpContext(_oInterface : Interface, _sWindowName : String, _nFrameWidth : UInt, _nFrameHeight : UInt, _bTransparent : Bool = false, _nBgColor : Int = 0xFFFFFFFF ) : Void{
Debug.fTrace("--Okays--");
Debug.fTrace("---New OpWindows--");
_oInterface.bFrBasedOnTime = true; //TODO if we have VSYnc us BaseOnFrame
Context(_oInterface, _sWindowName, _nFrameWidth, _nFrameHeight, _bTransparent, _nBgColor);
// fCreateForm
}
override public function fIniPixelDrawZone(): CArray<Int32>{
Debug.fTrace("fIniPixelDrawZone");
<cpp>
frameSize.cx = nFrameWidth;
frameSize.cy = nFrameHeight;
</cpp>
//if(oLink.bGpuDraw == false){
<cpp>
//_::hmemdc = CreateCompatibleDC(dcScreen);
hmemdc = CreateCompatibleDC((HDC)nHandleId);
BITMAPINFO bmi;
bmi.bmiHeader.biSize = sizeof(BITMAPINFO);
bmi.bmiHeader.biWidth = nFrameWidth;
bmi.bmiHeader.biHeight = -nFrameHeight; // Negative -> order pixels from top to bottom
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = 0;
bmi.bmiHeader.biXPelsPerMeter = 0;
bmi.bmiHeader.biYPelsPerMeter = 0;
bmi.bmiHeader.biClrUsed = 0;
bmi.bmiHeader.biClrImportant = 0;
bmi.bmiColors[0].rgbBlue = 0;
bmi.bmiColors[0].rgbGreen = 0;
bmi.bmiColors[0].rgbRed = 0;
bmi.bmiColors[0].rgbReserved = 0;
hbmp = CreateDIBSection( hmemdc, &bmi, DIB_RGB_COLORS, (void**)&aPixels, GZ_Null, 0 );
SelectObject( hmemdc, hbmp );
return aPixels;
</cpp>
//}
<cpp>//lite?
//aPixels = new gzInt[nFrameWidth * nFrameHeight];
//return aPixels;
</cpp>
<cpp>//Cpcdos
// Retourner le pointeur du contexte depuis Cpcdos
//return (gzInt32*) oCpcdos->Init_Get_Context_PTR(nIdContextGZE);
</cpp>
}
override public function fBlit():UIntX {
// Debug.fTrace("Blit!!");
if(nHandleId && nWinHandleId){
<cpp>
// if (hWnd && dcScreen) {
//if(oLink->bGpuDraw){
/*
static gzBool _bOneTime = false;
if(!bOnRezize){
_bOneTime = false;
oGpu->fWinBlit(dcScreen,0);
}else{
if(!_bOneTime){
_bOneTime = true;
bResizeRenderReady = true;
}
}*/
//}else{
//GZ_printf("\nsss");
if(!bTransparent){
//BitBlt( dcScreen, 0, 0, nFrameWidth, nFrameHeight, hmemdc, 0, 0, SRCCOPY );
if(nResFacX == 1 && nResFacY == 1){
BitBlt( (HDC)nHandleId, 0, 0, nFrameWidth, nFrameHeight, hmemdc, 0, 0, SRCCOPY );
}else{
StretchBlt( (HDC)nHandleId, 0, 0, nFrameWidth, nFrameHeight, hmemdc, 0, 0, nFrameWidth/nResFacX, nFrameHeight/nResFacY, SRCCOPY );
}
}else{
static BLENDFUNCTION bf = {AC_SRC_OVER, 0, nWinAlpha, AC_SRC_ALPHA};
static POINT ptSrc = {0,0};
UpdateLayeredWindow((HWND)nWinHandleId, (HDC)nHandleId, GZ_Null, &frameSize, hmemdc, &ptSrc, 0, &bf, ULW_ALPHA);
}
//}
//_nHandleId = (gzUIntX)dcScreen;
//_nWinHandleId = (gzUIntX)hWnd;
</cpp>
}
return 0;
}
override function fMove( _nPosX : Int, _nPosY : Int):Void;
override function fMoveAndSize(_nPosX : Int, _nPosY : Int, _nWidth : Int, _nHeight: Int):Void;
override function fShow(_bActive : Bool = true):Void;
override function fHide():Void;
override function fIniProcess():Void;
override function fMinimize():Void;
override function fMaximize():Void;
override function fRestore():Void;
override function fDisable():Void;
// public function fSendData(_nOtherWinId : UInt):Void;
// private function fReceiveMessage( _sMessage : String):Void; //Dummy for dInterProcessMessage
override function drawPixel():Void;
// public function fKeyIsDown(_nKeyVal : Int):Int;
override function fCpuVSyncOnGpu():Void;
override function fIsWindowReady():Bool;
override function fGetMousePosition():Void{
<cpp>
CURSORINFO ci;
ci.cbSize = sizeof(CURSORINFO);
GetCursorInfo(&ci);
POINT point;
point.x = ci.ptScreenPos.x;
point.y = ci.ptScreenPos.y;
ScreenToClient((HWND)nWinHandleId, &point);
nLastMouseX = nMouseX;
nLastMouseY = nMouseY;
nMouseX = gzFloat(point.x) / nResFacX;
nMouseY = gzFloat(point.y) / nResFacY;
bFirstMouseOver = false;
</cpp>
}
override function fStartCaptureOutside():Void;
override function fStopCaptureOutside():Void;
//public function fFrameStart():Void;
override function fFrameEnd():Void;
override function fGetPixelArray():CArray<Int, 2>;
/*
gzInt** cSysWindow::fGetPixelArray() {
return p2DArray;
}
*/
override function fGetKey(_oKey : Key):Void;
}
} | Redcode | 3 | VLiance/GZE | src/SubLib_System/Lib_GzWindows/Overplace/OpContext.cw | [
"Apache-2.0"
] |
/*
* Copyright (c) 2012-2021 Daniele Bartolini et al.
* License: https://github.com/dbartolini/crown/blob/master/LICENSE
*/
using Gee;
namespace Crown
{
[Compact]
public struct Quaternion
{
public double x;
public double y;
public double z;
public double w;
public Quaternion(double x, double y, double z, double w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
public Quaternion.from_array(ArrayList<Value?> arr)
{
this.x = (double)arr[0];
this.y = (double)arr[1];
this.z = (double)arr[2];
this.w = (double)arr[3];
}
public Quaternion.from_axis_angle(Vector3 axis, float angle)
{
double ha = angle * 0.5;
double sa = Math.sin(ha);
double ca = Math.cos(ha);
this.x = axis.x * sa;
this.y = axis.y * sa;
this.z = axis.z * sa;
this.w = ca;
}
public Quaternion.from_euler(double rx, double ry, double rz)
{
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/
double c1 = Math.cos(ry*0.5);
double s1 = Math.sin(ry*0.5);
double c2 = Math.cos(rz*0.5);
double s2 = Math.sin(rz*0.5);
double c3 = Math.cos(rx*0.5);
double s3 = Math.sin(rx*0.5);
double c1c2 = c1*c2;
double s1s2 = s1*s2;
double nw = c1c2*c3 - s1s2*s3;
double nx = c1c2*s3 + s1s2*c3;
double ny = s1*c2*c3 + c1*s2*s3;
double nz = c1*s2*c3 - s1*c2*s3;
this.x = nx;
this.y = ny;
this.z = nz;
this.w = nw;
}
public Quaternion.from_matrix(Matrix4x4 m)
{
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/
double tr = m.x.x + m.y.y + m.z.z;
if (tr > 0.0)
{
double sq = Math.sqrt(1.0 + tr) * 0.5;
double inv = 0.25 / sq;
this.w = sq;
this.x = (m.y.z - m.z.y) * inv;
this.y = (m.z.x - m.x.z) * inv;
this.z = (m.x.y - m.y.x) * inv;
}
else if ((m.x.x > m.y.y) && (m.x.x > m.z.z))
{
double sq = Math.sqrt(1.0 + m.x.x - m.y.y - m.z.z) * 0.5;
double inv = 0.25 / sq;
this.x = sq;
this.w = (m.y.z - m.z.y) * inv;
this.y = (m.x.y + m.y.x) * inv;
this.z = (m.z.x + m.x.z) * inv;
}
else if (m.y.y > m.z.z)
{
double sq = Math.sqrt(1.0 + m.y.y - m.x.x - m.z.z) * 0.5;
double inv = 0.25 / sq;
this.y = sq;
this.w = (m.z.x - m.x.z) * inv;
this.x = (m.x.y + m.y.x) * inv;
this.z = (m.y.z + m.z.y) * inv;
}
else
{
double sq = Math.sqrt(1.0 + m.z.z - m.x.x - m.y.y) * 0.5;
double inv = 0.25 / sq;
this.z = sq;
this.w = (m.x.y - m.y.x) * inv;
this.x = (m.z.x + m.x.z) * inv;
this.y = (m.y.z + m.z.y) * inv;
}
}
/// Returns the dot product between quaternions @a a and @a b.
public double dot(Quaternion b)
{
return this.w * b.w + this.x * b.x + this.y * b.y + this.z * b.z;
}
/// Returns the length of @a q.
public double length()
{
return Math.sqrt(dot(this));
}
public void normalize()
{
double len = length();
double inv_len = 1.0f / len;
this.x *= inv_len;
this.y *= inv_len;
this.z *= inv_len;
this.w *= inv_len;
}
public ArrayList<Value?> to_array()
{
ArrayList<Value?> arr = new ArrayList<Value?>();
arr.add(this.x);
arr.add(this.y);
arr.add(this.z);
arr.add(this.w);
return arr;
}
public Vector3 to_euler()
{
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/
double test = x*y + z*w;
if (test > 0.499)
{ // singularity at north pole
double rx = 0.0;
double ry = 2.0 * Math.atan2(x, w);
double rz = Math.PI*0.5;
return Vector3(rx, ry, rz);
}
if (test < -0.499)
{ // singularity at south pole
double rx = +0.0;
double ry = -2.0 * Math.atan2(x, w);
double rz = -Math.PI*0.5;
return Vector3(rx, ry, rz);
}
double xx = x*x;
double yy = y*y;
double zz = z*z;
double rrx = Math.atan2(2.0*x*w - 2.0*y*z, 1.0 - 2.0*xx - 2.0*zz);
double rry = Math.atan2(2.0*y*w - 2.0*x*z, 1.0 - 2.0*yy - 2.0*zz);
double rrz = Math.asin(2.0*test);
return Vector3(rrx, rry, rrz);
}
public string to_string()
{
return "%f, %f, %f, %f".printf(x, y, z, w);
}
}
public const Quaternion QUATERNION_IDENTITY = { 0.0, 0.0, 0.0, 1.0 };
}
| Vala | 4 | galek/crown | tools/core/math/quaternion.vala | [
"MIT"
] |
proc hpbnet data=sampsio.hmeq nbin=5 structure=Naive TAN PC MB bestmodel
missingint=IMPUTE missingnom=LEVEL;
target Bad;
input Reason Job Delinq Derog Ninq/level=NOM;
input Loan Mortdue Value Yoj Clage Clno Debtinc/level=INT;
output pred=pred network=net parameter=parameter varinfo=varinfo varlevel=varlevel varorder=varorder varselect=varselect validinfo=vi;
code file="U:\SGF_hpbnet_scorecode.sas";
run;
%macro createBNCdiagram(target=Bad, outnetwork=net);
data outstruct;
set &outnetwork;
if strip(upcase(_TYPE_)) eq 'STRUCTURE' then output;
keep _nodeid_ _childnode_ _parentnode_;
run;
data networklink;
set outstruct;
linkid = _N_;
label linkid ="Link ID";
run;
proc sql;
create table work._node1 as
select distinct _CHILDNODE_ as node
from networklink;
create table work._node2 as
select distinct _PARENTNODE_ as node
from networklink;
quit;
proc sql;
create table work._node as
select node
from work._node1
UNION
select node
from work._node2;
quit;
data bnc_networknode;
length NodeType $32.;
set work._node;
if strip(upcase(node)) eq strip(upcase("&target")) then do;
NodeType = "TARGET";
NodeColor=2;
end;
else do;
NodeType = "INPUT";
NodeColor = 1;
end;
label NodeType ="Node Type" ;
label NodeColor ="Node Color" ;
run;
data parents(rename=(_parentnode_ = _node_)) children(rename=(_childnode_ = _node_)) links;
length _parentnode_ _childnode_ $ 32;
set networklink;
keep _parentnode_ _childnode_ ;
run;
*get list of all unique nodes;
data nodes;
set parents children;
run;
proc sort data=nodes;
by _node_;
run;
data nodes;
set nodes;
by _node_;
if first._node_;
_Parentnode_ = _node_;
_childnode_ = "";
run;
/*merge node color and type */
data nodes;
merge nodes bnc_networknode (rename=(node=_node_ nodeColor=_nodeColor_ nodeType=_nodeType_));
by _node_;
run;
/*sort color values to ensure a consistent color mapping across networks */
/*note that the color mapping is HTML style dependent though */
proc sort data=nodes;
by _nodeType_;
run;
*combine nodes and links;
* need outsummaryall for model report;
data bnc_networksummary(drop=_shape_ _nodecolor_ _nodepriority_ _shape_ _nodeID_ _nodetype_ _linkdirection_) bnc_networksummaryall;
length _parentnode_ _childnode_ $ 32;
set nodes links;
drop _node_;
if _childnode_ EQ "" then
do;
_nodeID_ = _parentnode_;
_nodepriority_ = 1;
_shape_= "OVAL";
end;
else do;
_linkdirection_ = "TO";
output bnc_networksummary;
end;
output bnc_networksummaryall;
label _linkdirection_="Link Direction";
run;
proc datasets lib=work nolist nowarn;
delete _node _node1 _node2 nodes links parents children;
run;
quit;
proc template;
define statgraph bpath;
begingraph / DesignHeight=720 DesignWidth=720;
entrytitle "Bayesian Network Diagram";
layout region;
pathdiagram fromid=_parentnode_ toid=_childnode_ /
arrangement=GRIP
nodeid=_nodeid_
nodetitle=_nodeID_
nodeshape=_shape_
nodepriority=_nodepriority_
linkdirection=_linkdirection_
nodeColorGroup=_NodeColor_
textSizeMin = 10
;
endlayout;
endgraph;
end;
run;
ods graphics;
proc sgrender data=bnc_networksummaryall template=bpath;
run;
%mend;
%createBNCdiagram;
| SAS | 5 | sassoftware/enlighten-apply | BayesianNetwork/SGF_HPBNET_example.sas | [
"Apache-2.0"
] |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
.selectContainer {
display: inline;
padding: 5px;
user-select: none;
}
| CSS | 1 | EkaterinaMozheiko/docusaurus | website/src/components/showcase/ShowcaseSelect/styles.module.css | [
"CC-BY-4.0",
"MIT"
] |
using Go = import "go.capnp";
@0x83c2b5818e83ab19;
$Go.package("template_fix");
$Go.import("capnproto.org/go/capnp/v3/capnpc-go/testdata/group");
struct SomeMisguidedStruct {
someGroup :group {
someGroupField @0 :UInt64;
}
}
| Cap'n Proto | 4 | kasvtv/go-capnproto2 | capnpc-go/testdata/group.capnp | [
"MIT"
] |
:: generated from colcon_core/shell/template/hook_append_value.bat.em
@@echo off
@{
import os
if os.path.isabs(subdirectory):
value = subdirectory
else:
value = '%COLCON_CURRENT_PREFIX%'
if subdirectory:
value += '\\' + subdirectory
}@
call:colcon_append_unique_value @(name) "@(value)"
goto :eof
:: function to append a value to a variable
:: which uses semicolons as separators
:: duplicates as well as trailing separators are avoided
:: first argument: the name of the result variable
:: second argument: the value to be appended
:colcon_append_unique_value
setlocal enabledelayedexpansion
:: arguments
set "listname=%~1"
set "value=%~2"
:: get values from variable
set "values=!%listname%!"
set "is_duplicate="
:: skip loop if values is empty
if "%values%" NEQ "" (
:: iterate over existing values in the variable
for %%v in ("%values:;=";"%") do (
:: ignore empty strings
if "%%~v" NEQ "" (
:: ignore value if already present
if "%%~v" EQU "%value%" (
set "is_duplicate=1"
)
if "!all_values!" NEQ "" (
set "all_values=!all_values!;%%~v"
) else (
set "all_values=%%~v"
)
)
)
)
:: if it is not a duplicate append it
if "%is_duplicate%" == "" (
:: if not empty, append a semi-colon
if "!all_values!" NEQ "" (
set "all_values=!all_values!;"
)
:: append the value
set "all_values=!all_values!%value%"
)
:: set result variable in parent scope
endlocal & (
set "%~1=%all_values%"
)
goto:eof
| EmberScript | 4 | esteve/colcon-core | colcon_core/shell/template/hook_append_value.bat.em | [
"Apache-2.0"
] |
Write "Hello world!",!
| M | 0 | rachelktyjohnson/hello-worlds | examples/m/Mumps.mumps | [
"Unlicense"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.