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
sequencelengths 1
8
|
---|---|---|---|---|---|
At: "027.hac":4:
parse error: syntax error
parser stacks:
state value
#STATE# (null)
#STATE# (type-ref) [4:1..4]
#STATE# identifier: a [4:6]
#STATE# (null)
#STATE# [ [4:7]
#STATE# (range) [4:8]
#STATE# } [4:9]
in state #STATE#, possible rules are:
bracketed_sparse_range: '[' range . ']' (#RULE#)
acceptable tokens are:
']' (shift)
| Bison | 0 | broken-wheel/hacktist | hackt_docker/hackt/test/parser/basic/027.stderr.bison | [
"MIT"
] |
/*
* Copyright (c) 2018-2020, Andreas Kling <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/OwnPtr.h>
#include <AK/RefPtr.h>
#include <AK/StringView.h>
#include "Database.h"
namespace PCIDB {
RefPtr<Database> Database::open(const String& filename)
{
auto file_or_error = Core::MappedFile::map(filename);
if (file_or_error.is_error())
return nullptr;
auto res = adopt_ref(*new Database(file_or_error.release_value()));
if (res->init() != 0)
return nullptr;
return res;
}
const StringView Database::get_vendor(u16 vendor_id) const
{
const auto& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value())
return "";
return vendor.value()->name;
}
const StringView Database::get_device(u16 vendor_id, u16 device_id) const
{
const auto& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value())
return "";
const auto& device = vendor.value()->devices.get(device_id);
if (!device.has_value())
return "";
return device.value()->name;
}
const StringView Database::get_subsystem(u16 vendor_id, u16 device_id, u16 subvendor_id, u16 subdevice_id) const
{
const auto& vendor = m_vendors.get(vendor_id);
if (!vendor.has_value())
return "";
const auto& device = vendor.value()->devices.get(device_id);
if (!device.has_value())
return "";
const auto& subsystem = device.value()->subsystems.get((subvendor_id << 16) + subdevice_id);
if (!subsystem.has_value())
return "";
return subsystem.value()->name;
}
const StringView Database::get_class(u8 class_id) const
{
const auto& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
return xclass.value()->name;
}
const StringView Database::get_subclass(u8 class_id, u8 subclass_id) const
{
const auto& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
const auto& subclass = xclass.value()->subclasses.get(subclass_id);
if (!subclass.has_value())
return "";
return subclass.value()->name;
}
const StringView Database::get_programming_interface(u8 class_id, u8 subclass_id, u8 programming_interface_id) const
{
const auto& xclass = m_classes.get(class_id);
if (!xclass.has_value())
return "";
const auto& subclass = xclass.value()->subclasses.get(subclass_id);
if (!subclass.has_value())
return "";
const auto& programming_interface = subclass.value()->programming_interfaces.get(programming_interface_id);
if (!programming_interface.has_value())
return "";
return programming_interface.value()->name;
}
static u8 parse_hex_digit(char digit)
{
if (digit >= '0' && digit <= '9')
return digit - '0';
VERIFY(digit >= 'a' && digit <= 'f');
return 10 + (digit - 'a');
}
template<typename T>
static T parse_hex(StringView str, size_t count)
{
VERIFY(str.length() >= count);
T res = 0;
for (size_t i = 0; i < count; i++)
res = (res << 4) + parse_hex_digit(str[i]);
return res;
}
int Database::init()
{
if (m_ready)
return 0;
m_view = StringView { m_file->bytes() };
ParseMode mode = ParseMode::UnknownMode;
OwnPtr<Vendor> current_vendor {};
OwnPtr<Device> current_device {};
OwnPtr<Class> current_class {};
OwnPtr<Subclass> current_subclass {};
auto commit_device = [&]() {
if (current_device && current_vendor) {
auto id = current_device->id;
current_vendor->devices.set(id, current_device.release_nonnull());
}
};
auto commit_vendor = [&]() {
commit_device();
if (current_vendor) {
auto id = current_vendor->id;
m_vendors.set(id, current_vendor.release_nonnull());
}
};
auto commit_subclass = [&]() {
if (current_subclass && current_class) {
auto id = current_subclass->id;
current_class->subclasses.set(id, current_subclass.release_nonnull());
}
};
auto commit_class = [&]() {
commit_subclass();
if (current_class) {
auto id = current_class->id;
m_classes.set(id, current_class.release_nonnull());
}
};
auto commit_all = [&]() {
commit_vendor();
commit_class();
};
auto lines = m_view.split_view('\n');
for (auto& line : lines) {
if (line.length() < 2 || line[0] == '#')
continue;
if (line[0] == 'C') {
mode = ParseMode::ClassMode;
commit_all();
} else if ((line[0] >= '0' && line[0] <= '9') || (line[0] >= 'a' && line[0] <= 'f')) {
mode = ParseMode::VendorMode;
commit_all();
} else if (line[0] != '\t') {
mode = ParseMode::UnknownMode;
continue;
}
switch (mode) {
case ParseMode::VendorMode:
if (line[0] != '\t') {
commit_vendor();
current_vendor = make<Vendor>();
current_vendor->id = parse_hex<u16>(line, 4);
current_vendor->name = line.substring_view(6, line.length() - 6);
} else if (line[0] == '\t' && line[1] != '\t') {
commit_device();
current_device = make<Device>();
current_device->id = parse_hex<u16>(line.substring_view(1, line.length() - 1), 4);
current_device->name = line.substring_view(7, line.length() - 7);
} else if (line[0] == '\t' && line[1] == '\t') {
auto subsystem = make<Subsystem>();
subsystem->vendor_id = parse_hex<u16>(line.substring_view(2, 4), 4);
subsystem->device_id = parse_hex<u16>(line.substring_view(7, 4), 4);
subsystem->name = line.substring_view(13, line.length() - 13);
current_device->subsystems.set((subsystem->vendor_id << 8) + subsystem->device_id, move(subsystem));
}
break;
case ParseMode::ClassMode:
if (line[0] != '\t') {
commit_class();
current_class = make<Class>();
current_class->id = parse_hex<u8>(line.substring_view(2, 2), 2);
current_class->name = line.substring_view(6, line.length() - 6);
} else if (line[0] == '\t' && line[1] != '\t') {
commit_subclass();
current_subclass = make<Subclass>();
current_subclass->id = parse_hex<u8>(line.substring_view(1, 2), 2);
current_subclass->name = line.substring_view(5, line.length() - 5);
} else if (line[0] == '\t' && line[1] == '\t') {
auto programming_interface = make<ProgrammingInterface>();
programming_interface->id = parse_hex<u8>(line.substring_view(2, 2), 2);
programming_interface->name = line.substring_view(6, line.length() - 6);
current_subclass->programming_interfaces.set(programming_interface->id, move(programming_interface));
}
break;
default:
break;
}
}
commit_all();
m_ready = true;
return 0;
}
}
| C++ | 4 | r00ster91/serenity | Userland/Libraries/LibPCIDB/Database.cpp | [
"BSD-2-Clause"
] |
<%= render inline: 'Some inline content' %>
<%= cache do %>Some cached content<% end %>
| HTML+ERB | 2 | swaathi/rails | actionpack/test/fixtures/functional_caching/inline_fragment_cached.html.erb | [
"MIT"
] |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var _jsxRuntime = require("react/jsx-runtime");
var _default = (0, _createSvgIcon.default)([/*#__PURE__*/(0, _jsxRuntime.jsx)("ellipse", {
cx: "12",
cy: "12",
rx: "3",
ry: "5.74"
}, "0"), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
d: "M7.5 12c0-.97.23-4.16 3.03-6.5C9.75 5.19 8.9 5 8 5c-3.86 0-7 3.14-7 7s3.14 7 7 7c.9 0 1.75-.19 2.53-.5-2.8-2.34-3.03-5.53-3.03-6.5zM16 5c-.9 0-1.75.19-2.53.5.61.51 1.1 1.07 1.49 1.63.33-.08.68-.13 1.04-.13 2.76 0 5 2.24 5 5s-2.24 5-5 5c-.36 0-.71-.05-1.04-.13-.39.56-.88 1.12-1.49 1.63.78.31 1.63.5 2.53.5 3.86 0 7-3.14 7-7s-3.14-7-7-7z"
}, "1")], 'JoinLeftOutlined');
exports.default = _default; | JavaScript | 3 | dany-freeman/material-ui | packages/mui-icons-material/lib/JoinLeftOutlined.js | [
"MIT"
] |
<?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>
<designer-extension>
<control-subpackage-name>dojo.form</control-subpackage-name>
</designer-extension>
</faces-config-extension>
<!-- Start of Dojo Controls Complex Types -->
<complex-type>
<description>Allows adding min and max values as constraints</description>
<display-name>Number Constraints</display-name>
<complex-id>com.ibm.xsp.extlib.component.dojo.form.constraints.NumberConstraints</complex-id>
<complex-class>com.ibm.xsp.extlib.component.dojo.form.constraints.NumberConstraints</complex-class>
<property>
<description>When this property is present the number value in the control is restricted to this minimum value. If the number provided is less than this value, an error will be shown. This minimum may be negative or positive.</description>
<display-name>Minimum Value</display-name>
<property-name>min</property-name>
<property-class>double</property-class>
<!-- Note, the default in the getter is Double.NaN,
but the default in the js control is -Infinity.
Also, this value is a double, where as the js control allows
a JavaScript number, which may be integral.
-->
</property>
<property>
<description>When this property is present the number value in the control is restricted to this maximum value. If the number provided is greater than this value, an error will be shown. This maximum may be negative or positive.</description>
<display-name>Maximum Value</display-name>
<property-name>max</property-name>
<property-class>double</property-class>
<!-- Note, the default in the getter is Double.NaN,
but the default in the js control is +Infinity.
Also, this value is a double, where as the js control allows
a JavaScript number, which may be integral.
-->
</property>
<property>
<!-- #"ISO 4217" and "USD" should not be translated -->
<description>(Currency Only) The ISO 4217 currency code, a three letter sequence like "USD" for US Dollars</description>
<display-name>Currency</display-name>
<property-name>currency</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<!-- Maybe ask for a currency code editor, for here
and the xp:numberConverter currencyCode property -->
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<!-- Only listing the 2 most used reserve currencies,
rather than attempting a larger list and getting it wrong. -->
<editor-parameter>
USD
EUR
</editor-parameter>
</designer-extension>
</property-extension>
</property>
<property>
<!-- # "places" "enable", "disable", "auto", "true", "false", "optional" should not be translated -->
<description>(Currency Only) Where places are implied by the pattern or explicit in the "places" property, this specifies whether to include the fractional portion. Acceptable values are either "enable", "disable", "auto", "true", "false" or "optional".</description>
<display-name>Fractional</display-name>
<property-name>fractional</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<!-- Support for "optional" is new in 9.0.1.v00_09 -->
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
enable
disable
optional
auto
true
false
[true, false]
</editor-parameter>
</designer-extension>
</property-extension>
</property>
<property>
<!-- # "extraLocale" should not be translated -->
<description>Override the locale used to determine formatting rules. Locales must be among the list of "extraLocale" specified during the Dojo bootstrap</description>
<display-name>Locale</display-name>
<property-name>locale</property-name>
<property-class>java.util.Locale</property-class>
<property-extension>
<designer-extension>
<editor>com.ibm.workplace.designer.property.editors.langPicker</editor>
<!-- TODO ProposedBreakingChange Java to Dojo locale format conversion required -->
<tags>
todo
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>Override localized convention with this pattern. As a result, all users will see the same behavior, regardless of locale, and your application may not be globalized. See Unicode Technical Standard 35.</description>
<display-name>Pattern</display-name>
<property-name>pattern</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description>The number of digits to display after the decimal point.</description>
<display-name>Places</display-name>
<property-name>places</property-name>
<property-class>int</property-class>
<property-extension>
<default-value>-1</default-value>
</property-extension>
</property>
<property>
<description>Strict parsing, false by default. When strict mode is false, certain allowances are made to be more tolerant of user input, such as abbreviations, and some white space may be optional, etc.</description>
<display-name>Strict Parsing</display-name>
<property-name>strict</property-name>
<property-class>boolean</property-class>
</property>
<property>
<description>(Currency Only) Override currency symbol. Normally, will be looked up in localized table of supported currencies (Dojo "CLDR") 3-letter ISO 4217 currency code will be used if not found.</description>
<display-name>Currency Symbol</display-name>
<property-name>symbol</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<!-- # "decimal", "scientific", "percent", "currency" should not be translated -->
<description>Choose a format type based on the locale from the following: "decimal", "scientific" (not yet supported), "percent", "currency".</description>
<display-name>Format Type</display-name>
<property-name>type</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
decimal
scientific
percent
currency
</editor-parameter>
</designer-extension>
</property-extension>
</property>
<complex-extension>
<tag-name>djNumberConstraints</tag-name>
</complex-extension>
</complex-type>
<complex-type>
<description>Allows to add constraints such as min, max, valid days of the week etc.</description>
<display-name>Date Time Constraints</display-name>
<complex-id>com.ibm.xsp.extlib.component.dojo.form.constraints.DateTimeConstraints</complex-id>
<complex-class>com.ibm.xsp.extlib.component.dojo.form.constraints.DateTimeConstraints</complex-class>
<property>
<description>Override text for "A.M." in time values</description>
<display-name>Ante Meridiem (A.M.)</display-name>
<property-name>am</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>true</localizable>
<designer-extension>
<tags>
localizable-text
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>Override text for "P.M." in time values</description>
<display-name>Post Meridiem (P.M.)</display-name>
<property-name>pm</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>true</localizable>
<designer-extension>
<tags>
localizable-text
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>(Time Text Box) ISO-8601 formatted text representing the amount by which every clickable element in the time picker increases. For example "T00:15:00" creates 15 minute increments. Must divide "visibleIncrement" evenly.</description>
<display-name>Clickable Increment</display-name>
<property-name>clickableIncrement</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description>Override localized convention with this date pattern. As a result, all users will see the same behavior, regardless of locale, and your application may not be globalized. See Unicode Technical Standard 35 Date Format Patterns.</description>
<display-name>Date Pattern</display-name>
<property-name>datePattern</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description>Override localized convention with this time pattern. As a result, all users will see the same behavior, regardless of locale, and your application may not be globalized. See Unicode Technical Standard 35 Number Format Patterns.</description>
<display-name>Time Pattern</display-name>
<property-name>timePattern</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<!-- # "long", "short", "medium", "full" should not be translated -->
<description>Choose from formats appropriate to the locale either "long", "short", "medium" or "full".</description>
<display-name>Format Length</display-name>
<property-name>formatLength</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
long
short
medium
full
</editor-parameter>
</designer-extension>
</property-extension>
</property>
<property>
<!-- # "extraLocale" should not be translated -->
<description>Override the locale used to determine formatting rules. Locales must be among the list of "extraLocale" specified during the Dojo bootstrap</description>
<display-name>Locale</display-name>
<property-name>locale</property-name>
<property-class>java.util.Locale</property-class>
<property-extension>
<designer-extension>
<editor>com.ibm.workplace.designer.property.editors.langPicker</editor>
<!-- TODO ProposedBreakingChange Java to Dojo locale format conversion required -->
<tags>
todo
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<!-- # "time", "date" should not be translated -->
<description>Choice of "time" or "date", If omitted, default is both date and time</description>
<display-name>Selector</display-name>
<property-name>selector</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
time
date
</editor-parameter>
</designer-extension>
</property-extension>
</property>
<property>
<description>Strict parsing, false by default. If true, parsing matches exactly by regular expression. If false, more tolerant matching is used for abbreviations and some white space.</description>
<display-name>Strict Parsing</display-name>
<property-name>strict</property-name>
<property-class>boolean</property-class>
</property>
<property>
<description>(Time Text Box) ISO-8601 formatted text representing the amount by which every element with a visible time in the time picker increases. For example "T01:00:00" creates text in every 1 hour increment.</description>
<display-name>Visible Increment</display-name>
<property-name>visibleIncrement</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description>(Time Text Box): ISO-8601 formatted text representing the range of this time picker. The time picker will only display times in this range. For example "T05:00:00" displays 5 hours of options</description>
<display-name>Visible Range</display-name>
<property-name>visibleRange</property-name>
<property-class>java.lang.String</property-class>
</property>
<complex-extension>
<tag-name>djDateTimeConstraints</tag-name>
</complex-extension>
</complex-type>
<!-- End of Dojo Controls Complex Types -->
<component>
<description>Base Dojo Form Control</description>
<display-name>Dojo Form Control</display-name>
<component-type>com.ibm.xsp.extlib.dojo.form.FormWidgetBase</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoFormWidgetBase</component-class>
<group-type-ref>com.ibm.xsp.extlib.group.dojo.widgetBase</group-type-ref>
<group-type-ref>com.ibm.xsp.extlib.group.dojo.widget</group-type-ref>
<property>
<!-- # "input" should not be translated -->
<description>Alternate text that should appear should the browser not be able to display - a somewhat uncommon event for forms, although still common enough for images. Corresponds to the native HTML "input" element equivalent.</description>
<display-name>Alternate Text</display-name>
<property-name>alt</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>true</localizable>
<designer-extension>
<category>accessibility</category>
</designer-extension>
</property-extension>
</property>
<property>
<!-- # "submit", "onsubmit", "text" should not be translated -->
<description>Specifies the type of the element when more than one kind is possible. For example, a button might have type "submit" to trigger the form "onsubmit" action; works just like its pure HTML equivalent. If omitted, by default this property is "text".</description>
<display-name>Control Type</display-name>
<property-name>type</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
text
password
checkbox
radio
submit
reset
file
hidden
image
button
</editor-parameter>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies the order in which fields are traversed when using keyboard navigation. If omitted, by default this value is "0".</description>
<display-name>Tab Index</display-name>
<property-name>tabIndex</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>accessibility</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies whether a control should respond to user input. This disables a control so that it cannot receive focus and is skipped in tabbing navigation. Do not attempt to use this property on an element that does not support it. Controls that are disabled are not included in form submissions. This property is false by default.</description>
<display-name>Disabled</display-name>
<property-name>disabled</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies whether changes by the user to this control are prohibited.</description>
<display-name>Read Only Flag</display-name>
<property-name>readOnly</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Whether to fire the "onChange" event for each value change. This property is false by default.</description>
<display-name>Intermediate Changes</display-name>
<property-name>intermediateChanges</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>dojo</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>JavaScript code executed when this control loses focus and its value has been modified since gaining focus</description>
<display-name>Input Change Script</display-name>
<property-name>onChange</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>events</category>
<event>true</event>
<subcategory>change-event</subcategory>
</designer-extension>
</property-extension>
</property>
<property>
<!-- # "constraints" should not be translated -->
<description>This property does nothing as Client Side Validation is always disabled for Dojo controls. That differs from the normal XPages Edit Box control where client-side validation is enabled by default, and the Disable Client Side Validation property can be used to prevent such validation. For Dojo input controls, the normal validation pop-up dialogs will never appear, although for some controls there is a "constraints" property which can configure behavior similar to validation.</description>
<display-name>Disable Client Side Validation (Ignored)</display-name>
<property-name>disableClientSideValidation</property-name>
<property-class>boolean</property-class>
<property-extension>
<!-- This is overriding the superclass property from UIInputEx,
to provide a different description, and some junit skips,
because the property doesn't work in Dojo controls. -->
<allow-run-time-binding>true</allow-run-time-binding>
<designer-extension>
<!-- deprecating the property, so there is a warning in the Problems view
when it is used, as setting the property does nothing. -->
<is-deprecated>true</is-deprecated>
<category>data</category>
<!-- allow-runtime-binding-but-not-invoke prevents
a fail in PropertiesHaveSettersTest. The property allows value bindings
because there may be existing pages where the value is computed,
but the property in the xpage source is no used at runtime,
and the value binding is not invoked. -->
<tags>
allow-runtime-binding-but-not-invoke
</tags>
</designer-extension>
</property-extension>
</property>
<component-extension>
<component-family>javax.faces.Input</component-family>
<base-component-type>com.ibm.xsp.UIInputEx</base-component-type>
<designer-extension>
<!-- TODO Update existing renderers for showreadonlyasdisabled -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<!-- Start of Dojo Form Controls -->
<component>
<description>A basic input field that inherits from the Dojo theme</description>
<display-name>Dojo Text Box</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoTextBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoTextBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.TextBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoTextBox</component-class>
<property>
<description>Remove leading and trailing whitespace</description>
<display-name>Trim Spaces</display-name>
<property-name>trim</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Converts the text to upper case</description>
<display-name>Upper Case</display-name>
<property-name>uppercase</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>format</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Converts the text to lower case</description>
<display-name>Lower Case</display-name>
<property-name>lowercase</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>format</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Converts the first character of each word to upper case</description>
<display-name>Proper Case</display-name>
<property-name>propercase</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>format</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Used for passing through the standard HTML "input" element property "maxlength".</description>
<display-name>Maximum Length</display-name>
<property-name>maxLength</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.FormWidgetBase</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.TextBox</renderer-type>
<tag-name>djTextBox</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText id="inputText1" value="<%=this.value?this.value:''%>"></xp:inputText>
</xp:view>
</render-markup>
</designer-extension>
</component-extension>
</component>
<component>
<description>A text box control that allows validation based on a Regular Expression or based on a client-side JavaScript function. An error will appear if value in the text box fails validation.</description>
<display-name>Dojo Validation Text Box</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoValidationTextBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoValidationTextBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.ValidationTextBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoValidationTextBox</component-class>
<!-- "required" is already defined as part of the std JSF UIInput control
<property>
<description>Property that determines whether the field is required. If left empty when this property is set, the field cannot be valid. false by default.</description>
<display-name>Required</display-name>
<property-name>required</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
-->
<property>
<description>Property used to define a hint for the field when the field has the cursor.</description>
<display-name>Prompt Message</display-name>
<property-name>promptMessage</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>true</localizable>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Property that provides the message to display if the field is invalid</description>
<display-name>Invalid Message</display-name>
<property-name>invalidMessage</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>true</localizable>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Property that provides a regular expression to be used for validation. Do not define this property if "regExpGen" is defined. If omitted, by default this property is ".*" (a regular expression that allows everything).</description>
<display-name>Regular Expression</display-name>
<property-name>regExp</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>data</category>
<editor>com.ibm.xsp.extlib.designer.tooling.editor.RegularExpressionEditor</editor>
</designer-extension>
</property-extension>
</property>
<property>
<description>Property that denotes an overridable function used to generate a regular expression that is dependent upon the key value pairs in the "constraints" property, useful for dynamic situations. Do not define this property if "regExp" is defined.</description>
<display-name>Regular Expression Generator</display-name>
<property-name>regExpGen</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>data</category>
<editor>com.ibm.designer.domino.client.script.editor</editor>
</designer-extension>
</property-extension>
</property>
<property>
<description>Property used to specify the position of the tooltip relative to the control.</description>
<display-name>Tooltip Position</display-name>
<property-name>tooltipPosition</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>format</category>
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
auto
before
after
above
below
top
bottom
</editor-parameter>
<tags>
not-localizable
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>Defines an overridable function used to validate the input.</description>
<display-name>Validator Extension</display-name>
<property-name>validatorExt</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
<editor>com.ibm.designer.domino.client.script.editor</editor>
</designer-extension>
</property-extension>
</property>
<property>
<description>Defines an overridable function to customize the display of Dojo validation errors or hints.</description>
<display-name>Display Message Extension</display-name>
<property-name>displayMessageExt</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>format</category>
<editor>com.ibm.designer.domino.client.script.editor</editor>
<tags>
not-localizable
</tags>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.TextBox</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.ValidationTextBox</renderer-type>
<tag-name>djValidationTextBox</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText id="inputText1" value="<%=this.value?this.value:''%>">
<xp:this.converter>
<xp:convertMask></xp:convertMask>
</xp:this.converter>
</xp:inputText>
</xp:view>
</render-markup>
<!-- TODO from the dojo site:
"Base class for textbox widgets with the ability to validate content of various types and provide user feedback."
which would imply that this is an abstract class that should not have a tag-name,
but it does seem to work OK as a regular expression validation text box -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<description>A base class for a Dojo mapped text box, that is a text box where the value displayed to the user is different from the value sent to the server. Usually the value sent to the server is locale independent.</description>
<display-name>Dojo Mapped Text Box</display-name>
<component-type>com.ibm.xsp.extlib.dojo.form.MappedTextBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoMappedTextBox</component-class>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.ValidationTextBox</base-component-type>
<renderer-type>com.ibm.xsp.extlib.dojo.form.ValidationTextBox</renderer-type>
<component-family>javax.faces.Input</component-family>
</component-extension>
</component>
<component>
<description>A base class for a Dojo range bound text box, that is a text box where the value is within a range of valid values</description>
<display-name>Dojo Range Bound Text Box</display-name>
<component-type>com.ibm.xsp.extlib.dojo.form.RangeBoundTextBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoRangeBoundTextBox</component-class>
<property>
<description>The message to display if value is out of range.</description>
<display-name>Range Invalid Message</display-name>
<property-name>rangeMessage</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>true</localizable>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.MappedTextBox</base-component-type>
<renderer-type>com.ibm.xsp.extlib.dojo.form.ValidationTextBox</renderer-type>
<component-family>javax.faces.Input</component-family>
</component-extension>
</component>
<component>
<description>An input field that will format numbers based on the locale, e.g. adding commas or decimals for the thousands separator</description>
<display-name>Dojo Number Text Box</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoNumberTextBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoNumberTextBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.NumberTextBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoNumberTextBox</component-class>
<property>
<!-- # "double" should not be translated -->
<description>Specifies the Java numeric type of the converted value returned by the server-side converter. If omitted, "double" is used by default.</description>
<display-name>Number Type</display-name>
<property-name>javaType</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>data</category>
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
byte
short
int
long
float
double
</editor-parameter>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies the number constraints</description>
<display-name>Constraints</display-name>
<property-name>constraints</property-name>
<property-class>com.ibm.xsp.extlib.component.dojo.form.constraints.NumberConstraints</property-class>
<property-extension>
<allow-run-time-binding>false</allow-run-time-binding>
<designer-extension>
<category>data</category>
<!-- TODO ApprovedBreakingChange Should be exposed by UIDojoValidationTextBox -->
<tags>
todo
</tags>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.RangeBoundTextBox</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.NumberTextBox</renderer-type>
<tag-name>djNumberTextBox</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText id="inputText1" value="<%=this.value?this.value:''%>">
<xp:this.converter>
<xp:convertNumber type="number"></xp:convertNumber>
</xp:this.converter>
</xp:inputText>
</xp:view>
</render-markup>
</designer-extension>
</component-extension>
</component>
<component>
<description>Similar to the Dojo Number Text Box but with up and down arrows to increase or decrease the value</description>
<display-name>Dojo Number Spinner</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoSpinnerTextBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoSpinnerTextBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.NumberSpinner</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoNumberSpinner</component-class>
<property>
<description>The number of milliseconds a key or button is held down before it becomes typematic. If omitted, 500 by default.</description>
<display-name>Default Timeout</display-name>
<property-name>defaultTimeout</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<!-- # "defaultTimeout" should not be translated -->
<description>The fraction of time that is used to change the typematic timer between events. A value of 1.0 means that each typematic event fires at intervals as specified by the "defaultTimeout" property. A value of less than 1.0 means that each typematic event fires an increasing faster rate. If omitted, this property is 0.90 by default.</description>
<display-name>Timeout Change Rate</display-name>
<property-name>timeoutChangeRate</property-name>
<property-class>double</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The value to adjust the spinner by when using the arrow keys or buttons. If omitted, this property is "1" by default.</description>
<display-name>Small Delta</display-name>
<property-name>smallDelta</property-name>
<property-class>double</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The value to adjust the spinner by when using the Page Up and Page Down keys. If omitted, this property is "10" by default.</description>
<display-name>Large Delta</display-name>
<property-name>largeDelta</property-name>
<property-class>double</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.NumberTextBox</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.NumberSpinner</renderer-type>
<tag-name>djNumberSpinner</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText id="inputText1" value="<%=this.value?this.value:''%>">
<xp:this.converter>
<xp:convertNumber type="number"></xp:convertNumber>
</xp:this.converter>
</xp:inputText>
</xp:view>
</render-markup>
<!-- TODO ApprovedBreakingChange Hierarchy deviation between ExtLib and Dojo, RangeBoundTextBox is the parent of NumberSpinner -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<description>Inherits from the numberTextBox but used for entering monetary values with a currency symbol</description>
<display-name>Dojo Currency Text Box</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoCurrencyTextBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoCurrencyTextBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.CurrencyTextBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoCurrencyTextBox</component-class>
<property>
<description>Specifies the currency constraints</description>
<display-name>Constraints</display-name>
<property-name>constraints</property-name>
<property-class>com.ibm.xsp.extlib.component.dojo.form.constraints.NumberConstraints</property-class>
<property-extension>
<allow-run-time-binding>false</allow-run-time-binding>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.RangeBoundTextBox</base-component-type>
<renderer-type>com.ibm.xsp.extlib.dojo.form.CurrencyTextBox</renderer-type>
<component-family>javax.faces.Input</component-family>
<tag-name>djCurrencyTextBox</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText id="inputText1" value="<%=this.value?this.value:''%>">
<xp:this.converter>
<xp:convertNumber type="number"></xp:convertNumber>
</xp:this.converter>
</xp:inputText>
</xp:view>
</render-markup>
<!-- TODO ProposedBreakingChange Hierarchy deviation between ExtLib and Dojo, NumberTextBox is the parent of CurrencyTextBox -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<description>An input field that allows a user to type or choose a date from a calendar widget</description>
<display-name>Dojo Date Text Box</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoDateTextBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoDateTextBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.DateTextBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoDateTextBox</component-class>
<property>
<description>Specifies the date constraints</description>
<display-name>Constraints</display-name>
<property-name>constraints</property-name>
<property-class>com.ibm.xsp.extlib.component.dojo.form.constraints.DateTimeConstraints</property-class>
<property-extension>
<allow-run-time-binding>false</allow-run-time-binding>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.RangeBoundTextBox</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.DateTextBox</renderer-type>
<tag-name>djDateTextBox</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText id="inputText1" value="<%=this.value?this.value:''%>">
<xp:this.converter>
<xp:convertDateTime type="date"></xp:convertDateTime>
</xp:this.converter>
</xp:inputText>
</xp:view>
</render-markup>
</designer-extension>
</component-extension>
</component>
<component>
<description>An input field that allows a user to type or choose a time from a calendar widget</description>
<display-name>Dojo Time Text Box</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoTimeTextBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoTimeTextBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.TimeTextBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoTimeTextBox</component-class>
<property>
<description>Specifies the time constraints</description>
<display-name>Constraints</display-name>
<property-name>constraints</property-name>
<property-class>com.ibm.xsp.extlib.component.dojo.form.constraints.DateTimeConstraints</property-class>
<property-extension>
<allow-run-time-binding>false</allow-run-time-binding>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.RangeBoundTextBox</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.TimeTextBox</renderer-type>
<tag-name>djTimeTextBox</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText id="inputText1" value="<%=this.value?this.value:''%>">
<xp:this.converter>
<xp:convertDateTime type="date"></xp:convertDateTime>
</xp:this.converter>
</xp:inputText>
</xp:view>
</render-markup>
</designer-extension>
</component-extension>
</component>
<component>
<description>The Dojo Combo Box control provides a list of acceptable values to choose from but also permits user input and displays partially matched values.</description>
<display-name>Dojo Combo Box</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoComboBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoComboBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.ComboBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoComboBox</component-class>
<property>
<!-- # "count" should not be translated -->
<description>Specifies the number of results per page (via the "count" key when making a fetch request from a data provider). Useful when querying large data stores. If omitted, this is infinite by default.</description>
<display-name>Page Size</display-name>
<property-name>pageSize</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies a reference to a Dojo Store compatible data provider.</description>
<display-name>Dojo Store</display-name>
<property-name>store</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>When the control loses focus whether to automatically select the first value from the list of drop-down options populated based on the partial text entered. If omitted, true by default.</description>
<display-name>Automatically Complete</display-name>
<property-name>autoComplete</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>How many milliseconds to wait between when a key is pressed and when to start searching for that value. If omitted, 100 by default.</description>
<display-name>Search Delay</display-name>
<property-name>searchDelay</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The search pattern to match against for the values that should be displayed.</description>
<display-name>Search Attribute</display-name>
<property-name>searchAttr</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The Dojo Data query expression pattern to use. The default expression searches for any value that is a prefix of the current value that is typed in.</description>
<display-name>Query Expression</display-name>
<property-name>queryExpr</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Whether queries should be case sensitive. By default case is ignored.</description>
<display-name>Ignore Case</display-name>
<property-name>ignoreCase</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Whether to display the down arrow button, which can be clicked to display the list of options. The down arrow is present by default.</description>
<display-name>Has Down Arrow</display-name>
<property-name>hasDownArrow</property-name>
<property-class>boolean</property-class>
<property-extension>
<default-value>true</default-value>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.ValidationTextBox</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.ComboBox</renderer-type>
<tag-name>djComboBox</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:comboBox id="comboBox1" value="<%=this.value?this.value:''%>"></xp:comboBox>
</xp:view>
</render-markup>
<!-- TODO Investigate support for extlib data stores as well as dojo data stores (see martin) -->
<!-- TODO Potential new data store control creation required -->
<!-- TODO Addition of new property for storeComponentId to reference to newly created data store -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<description>The Dojo Filtering Select control provides a list of acceptable value pairs to choose from. A value pair consists of the text to be displayed to the user and the value to be sent to the server when the form is submitted. Additionally, this control also permits user input however unmatched values are not submitted.</description>
<display-name>Dojo Filtering Select</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoFilteringSelect_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoFilteringSelect_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.FilteringSelect</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoFilteringSelect</component-class>
<property>
<description>Specifies the field name for an item from the data store to be used as the entries in the drop-down list. If not specified then the "searchAttr" property is used instead.</description>
<display-name>Label Attribute</display-name>
<property-name>labelAttr</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>format</category>
<tags>
not-localizable
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies whether to interpret the "labelAttr" property as "text" (Plain text) or "html" (HTML Markup).</description>
<display-name>Label Type</display-name>
<property-name>labelType</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>format</category>
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
text
html
</editor-parameter>
<!-- TODO Support for ACF required? [note, the label is retrieved from the item client-side.]-->
<!-- TODO Property required htmlFilter, htmlFilterIn -->
<tags>
not-localizable
todo
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>The event handler that is called when the label changes; returns the label that should be displayed.</description>
<display-name>Label Function</display-name>
<property-name>labelFunc</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>format</category>
<tags>
not-localizable
todo
</tags>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.ComboBox</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.FilteringSelect</renderer-type>
<tag-name>djFilteringSelect</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:comboBox id="comboBox1" value="<%=this.value?this.value:''%>"></xp:comboBox>
</xp:view>
</render-markup>
<!-- TODO ApprovedBreakingChange Hierarchy deviation between ExtLib and Dojo, MappedTextBox is the parent of FilteringSelect -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<description>Similar to a HTML TEXTAREA, but will dynamically resize to fit the content of the text inside</description>
<display-name>Dojo Text Area</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoTextarea_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoTextarea_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.Textarea</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoTextarea</component-class>
<property>
<description>Specifies the number of text characters per line to be displayed</description>
<display-name>Columns</display-name>
<property-name>cols</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>format</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies the number of lines of text to be displayed</description>
<display-name>Rows</display-name>
<property-name>rows</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>format</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.TextBox</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.Textarea</renderer-type>
<tag-name>djTextarea</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputTextarea id="inputTextarea1" value="<%=this.value?this.value:''%>"></xp:inputTextarea>
</xp:view>
</render-markup>
<!-- TODO ApprovedBreakingChange Hierarchy deviation between ExtLib and Dojo, SimpleTextarea is the parent of Textarea -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<description>A thin wrapper around the standard HTML TEXTAREA</description>
<display-name>Dojo Simple Text Area</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoSimpleTextArea_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoSimpleTextArea_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.SimpleTextarea</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoSimpleTextarea</component-class>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.Textarea</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.SimpleTextarea</renderer-type>
<tag-name>djSimpleTextarea</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputTextarea id="inputTextarea1" value="<%=this.value?this.value:''%>"></xp:inputTextarea>
</xp:view>
</render-markup>
<!-- TODO ApprovedBreakingChange Hierarchy deviation between ExtLib and Dojo, SimpleTextarea is the parent of Textarea -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<!-- # The values in quotes should not be translated -->
<description>The Dojo version of the HTML "button" element or the "input" element with the "type" attribute set to "submit", "reset", or "button"</description>
<display-name>Dojo Button</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoButton_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoButton_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.Button</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoButton</component-class>
<property>
<description>Used to provide the label text that appears on the button</description>
<display-name>Label</display-name>
<property-name>label</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>true</localizable>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<!-- # "true" should not be translated -->
<description>Indicates whether to display the text label on the Button, "true" by default</description>
<display-name>Show Label</display-name>
<property-name>showLabel</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>A style class specifying an image that can make a button appear like an icon</description>
<display-name>Icon Class</display-name>
<property-name>iconClass</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>styling</category>
<editor>com.ibm.workplace.designer.property.editors.StyleClassEditor</editor>
<!-- This is tagged not-image-path because it is a styleClass,
not a path to an image resource, so the image JUnit test should not complain. -->
<tags>
not-image-path
</tags>
</designer-extension>
</property-extension>
</property>
<!-- redefining the required property from UIInput (in ...xsp.core jsf-xtnd.xsp-config) -->
<property>
<description>This property is obsolete. The Dojo Button control cannot be made required, so this property is ignored.</description>
<display-name>Obsolete: Required</display-name>
<property-name>required</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
<is-deprecated>true</is-deprecated>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.FormWidgetBase</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.Button</renderer-type>
<tag-name>djButton</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:button value="<%=this.label?this.label:''%>" id="button1"></xp:button>
</xp:view>
</render-markup>
<!-- TODO NonBreakingChange faces-config Button.ReadOnly renderer required -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<group>
<!-- redefining the "required" property from EditableValueHolder (in ...xsp.core jsf-ri-core.xsp-config)
In xe:djButton the inherited "required" property is redefined as deprecated,
so any subclasses of xe:djButton where the property is useful need to re-define
the property as non-deprecated. This group contains a non-deprecated copy of the
"required" property, to be used in subclasses of xe:djButton. -->
<group-type>com.ibm.xsp.extlib.group.EditableValueHolder.prop.required</group-type>
<property>
<description>%/javax.faces.component.group.EditableValueHolder/required/descr%</description>
<display-name>%/javax.faces.component.group.EditableValueHolder/required/name%</display-name>
<property-name>required</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<group-extension>
<designer-extension>
<tags>group-in-control</tags>
</designer-extension>
</group-extension>
</group>
<component>
<description>A cross between a button and a check box. It displays as a button but allows the user to toggle between two states.</description>
<display-name>Dojo Toggle Button</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoToggleButton_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoToggleButton_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.ToggleButton</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoToggleButton</component-class>
<!-- re-defining the inherited Required property - superclass prop is deprecated, this is not-deprecated -->
<group-type-ref>com.ibm.xsp.extlib.group.EditableValueHolder.prop.required</group-type-ref>
<property>
<description>Specifies the object saved to the value property when the toggle button is checked</description>
<display-name>Checked Value</display-name>
<property-name>checkedValue</property-name>
<property-class>java.lang.Object</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies the object saved to the value property when the toggle button is unchecked</description>
<display-name>Unchecked Value</display-name>
<property-name>uncheckedValue</property-name>
<property-class>java.lang.Object</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.Button</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.ToggleButton</renderer-type>
<tag-name>djToggleButton</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<!-- TODO NonBreakingChange faces-config ToggleButton.ReadOnly renderer required -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<description>Similar to the HTML check box but with styling provided by Dojo</description>
<display-name>Dojo Check Box</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoCheckBox_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoCheckBox_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.CheckBox</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoCheckBox</component-class>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.ToggleButton</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.CheckBox</renderer-type>
<tag-name>djCheckBox</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:checkBox id="checkBox1" text="<%=this.label?this.label:''%>"></xp:checkBox>
</xp:view>
</render-markup>
</designer-extension>
</component-extension>
</component>
<component>
<description>Similar to the HTML radioButton</description>
<display-name>Dojo Radio Button</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoRadioButton_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoRadioButton_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.RadioButton</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoRadioButton</component-class>
<!-- re-defining the inherited Required property - superclass prop is deprecated, this is not-deprecated -->
<group-type-ref>com.ibm.xsp.extlib.group.EditableValueHolder.prop.required</group-type-ref>
<property>
<description>Specifies the value when the radio button is selected</description>
<display-name>Selected Value</display-name>
<property-name>selectedValue</property-name>
<property-class>java.lang.Object</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Name of the group of radio buttons</description>
<display-name>Group Name</display-name>
<property-name>groupName</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Number of naming containers to skip when computing the name property</description>
<display-name>Skip Containers</display-name>
<property-name>skipContainers</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>data</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.Button</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.RadioButton</renderer-type>
<tag-name>djRadioButton</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:radio id="radio1" text="<%=this.label?this.label:''%>"></xp:radio>
</xp:view>
</render-markup>
<!-- TODO ApprovedBreakingChange Hierarchy deviation between ExtLib and Dojo, CheckBox is the parent of RadioButton -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<component>
<description>The base class for the vertical and horizontal slider controls</description>
<display-name>Dojo Base Slider</display-name>
<component-type>com.ibm.xsp.extlib.dojo.form.SliderBase</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoSliderBase</component-class>
<property>
<description>Whether to show increment and decrement buttons on each end of the slider, "true" by default</description>
<display-name>Show Buttons</display-name>
<property-name>showButtons</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The minimum value allowed, 0 by default</description>
<display-name>Minimum</display-name>
<property-name>minimum</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The maximum value allowed, 100 by default</description>
<display-name>Maximum</display-name>
<property-name>maximum</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The number of discrete value between the minimum and maximum properties inclusively.</description>
<display-name>Discrete Values</display-name>
<property-name>discreteValues</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The amount of adjustment to nudge the slider via the page up and page down keys. 2 by default</description>
<display-name>Page Increment</display-name>
<property-name>pageIncrement</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies whether clicking the slider bar causes the value to change to the clicked location. true by default</description>
<display-name>Click Select</display-name>
<property-name>clickSelect</property-name>
<property-class>boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The time in milliseconds to take to slide the handle from 0% to 100%. Useful for programmatically changing slider values. 1000 by default</description>
<display-name>Slide Duration</display-name>
<property-name>slideDuration</property-name>
<property-class>double</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.FormWidgetBase</base-component-type>
<component-family>javax.faces.Input</component-family>
</component-extension>
</component>
<component>
<description>A slider that allows you to drag left or right to select a value from a range.</description>
<display-name>Dojo Horizontal Slider</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoHorizontalSlider_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoHorizontalSlider_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.HorizontalSlider</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoHorizontalSlider</component-class>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.SliderBase</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.HorizontalSlider</renderer-type>
<tag-name>djHorizontalSlider</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:image url="extlib/designer/markup/DojoHorizontalSlider.jpg" id="image1"></xp:image>
</xp:view>
</render-markup>
</designer-extension>
</component-extension>
</component>
<component>
<description>A slider that allows you to drag up or down to select a value from a range.</description>
<display-name>Dojo Vertical Slider</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoVerticalSlider_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoVerticalSlider_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.VerticalSlider</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoVerticalSlider</component-class>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.SliderBase</base-component-type>
<component-family>javax.faces.Input</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.VerticalSlider</renderer-type>
<tag-name>djVerticalSlider</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:image url="/extlib/designer/markup/DojoVerticalSlider.jpg" id="image1"></xp:image>
</xp:view>
</render-markup>
</designer-extension>
</component-extension>
</component>
<component>
<description>Adds labels to the rule for a horizontal or vertical slider.</description>
<display-name>Dojo Slider Rule</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoSliderRule_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoSliderRule_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.SliderRule</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoSliderRule</component-class>
<property>
<description>Specifies the CSS style rules to apply to individual hash marks</description>
<display-name>Rule Style</display-name>
<property-name>ruleStyle</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>styling</category>
<editor>com.ibm.workplace.designer.property.editors.StylesEditor</editor>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies the number of hash marks to generate. If omitted, this value is 3 by default</description>
<display-name>Count</display-name>
<property-name>count</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Where to apply the label in relation to the slider: "topDecoration" or "bottomDecoration" for Horizontal Slider control. "leftDecoration" or "rightDecoration" for Vertical Slider control.</description>
<display-name>Container</display-name>
<property-name>container</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>format</category>
<editor>com.ibm.workplace.designer.property.editors.comboParameterEditor</editor>
<editor-parameter>
topDecoration
bottomDecoration
leftDecoration
rightDecoration
</editor-parameter>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.Widget</base-component-type>
<component-family>com.ibm.xsp.extlib.dojo.form.SliderRule</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.SliderRule</renderer-type>
<tag-name>djSliderRule</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
</designer-extension>
</component-extension>
</component>
<complex-type>
<description>A localizable label associated with the labels list property of a Dojo Slider Rule Labels control</description>
<display-name>Dojo Slider Rule Label</display-name>
<complex-id>com.ibm.xsp.extlib.dojo.form.SliderRuleLabel</complex-id>
<complex-class>com.ibm.xsp.extlib.dojo.form.SliderRuleLabel</complex-class>
<property>
<description>Specifies a localizable text label</description>
<display-name>Localizable Label</display-name>
<property-name>label</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<localizable>true</localizable>
</property-extension>
</property>
<complex-extension>
<tag-name>djSliderRuleLabel</tag-name>
</complex-extension>
</complex-type>
<component>
<description>Adds a list of labels to be displayed either vertically or horizontally along the slider</description>
<display-name>Dojo Slider Rule Labels</display-name>
<icon>
<small-icon>extlib/designer/icons/DojoSliderRuleLabels_16.png</small-icon>
<large-icon>extlib/designer/icons/DojoSliderRuleLabels_24.png</large-icon>
</icon>
<component-type>com.ibm.xsp.extlib.dojo.form.SliderRuleLabels</component-type>
<component-class>com.ibm.xsp.extlib.component.dojo.form.UIDojoSliderRuleLabels</component-class>
<property>
<description>Specifies the CSS style rules to apply to individual text labels</description>
<display-name>Label Style</display-name>
<property-name>labelStyle</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>styling</category>
<editor>com.ibm.workplace.designer.property.editors.StylesEditor</editor>
<!-- TODO UnitTest If name contains class or ends with style throw query to confirm -->
<tags>
todo
not-localizable
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies a list of text labels to display evenly spaced from left-to-right or top-to-bottom.</description>
<display-name>Labels</display-name>
<property-name>labels</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
<editor>com.ibm.designer.domino.client.script.editor</editor>
<tags>
not-localizable
</tags>
</designer-extension>
</property-extension>
</property>
<property>
<description>Specifies a list of localizable text labels</description>
<display-name>Labels List</display-name>
<property-name>labelsList</property-name>
<property-class>java.util.List</property-class>
<property-extension>
<collection-property>true</collection-property>
<property-item-class>com.ibm.xsp.extlib.dojo.form.SliderRuleLabel</property-item-class>
<property-add-method>addLabel</property-add-method>
<allow-run-time-binding>false</allow-run-time-binding>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>The number of numeric labels that should be omitted from display on each end of the slider. (Useful for omitting obvious start and end values such as 0, the default, and 100.)</description>
<display-name>Numeric Margin</display-name>
<property-name>numericMargin</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>When the "labels" property is not specified, this property specifies the minimum label value for generated numeric labels. If omitted, this value is 0 by default.</description>
<display-name>Minimum</display-name>
<property-name>minimum</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>When the "labels" property is not specified, this property specifies the maximum label value for generated numeric labels. If omitted, this value is 1 by default.</description>
<display-name>Maximum</display-name>
<property-name>maximum</property-name>
<property-class>int</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>When the "labels" property is not specified, this property specifies the options used for formatting of the generated numeric labels.</description>
<display-name>Constraints</display-name>
<property-name>constraints</property-name>
<property-class>com.ibm.xsp.extlib.component.dojo.form.constraints.NumberConstraints</property-class>
<property-extension>
<allow-run-time-binding>false</allow-run-time-binding>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<component-extension>
<base-component-type>com.ibm.xsp.extlib.dojo.form.SliderRule</base-component-type>
<component-family>com.ibm.xsp.extlib.dojo.form.SliderRuleLabels</component-family>
<renderer-type>com.ibm.xsp.extlib.dojo.form.SliderRuleLabels</renderer-type>
<tag-name>djSliderRuleLabels</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>Dojo Form</category>
<!-- TODO UnitTest component family and java inheritance for javax faces input and uicomponent -->
<tags>
todo
</tags>
</designer-extension>
</component-extension>
</component>
<!-- End of Dojo Form Controls -->
</faces-config>
| XPages | 5 | jesse-gallagher/XPagesExtensionLibrary | extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/raw-extlib-dojo-form.xsp-config | [
"Apache-2.0"
] |
<template>
<div class="wrapper">
<input v-model="username" />
<div v-if="error" class="error">{{ error }}</div>
<img src="./logo.png" />
<Card/>
</div>
</template>
<script>
import Card from "../Card/Card.vue"
export default {
name: "Hello",
components: { Card },
data() {
return {
username: "",
};
},
computed: {
error() {
console.log(this.username);
return this.username.trim().length < 7
? "Please enter a longer username"
: "";
},
},
};
</script>
<style scoped>
.wrapper {
background: hotpink;
padding: 30px;
text-align: center;
}
input {
display: block;
margin: 20px auto;
}
img {
width: 50px;
}
</style>
| Vue | 4 | justinforbes/cypress | npm/vite-dev-server/cypress/components/vue/Hello/Hello.vue | [
"MIT"
] |
<% template example() {...}
a = 123
b = "test";
c = 4.5
d = call other()
f = other2()
define g as String
h = true
i = false
j = null
%>
<html>
<head>
<title>Example<title>
<body>
<a href="http://example.com">Test link</a>
<% // Second block
if(a == 123 and b == "test") {
'yes'
} else {
'no'
}
foreach(i in 1..10) {
i & ","
}
foreach(i in #(1,2,3) reverse {
i & ";"
}
%> | Tea | 3 | btashton/pygments | tests/examplefiles/example.tea | [
"BSD-2-Clause"
] |
function foo1(strs: TemplateStringsArray, x: number): string;
function foo1(strs: string[], x: number): number;
function foo1(...stuff: any[]): any {
return undefined;
}
var a = foo1 `${1}`;
var b = foo1([], 1);
function foo2(strs: string[], x: number): number;
function foo2(strs: TemplateStringsArray, x: number): string;
function foo2(...stuff: any[]): any {
return undefined;
}
var c = foo2 `${1}`;
var d = foo2([], 1); | TypeScript | 4 | nilamjadhav/TypeScript | tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts | [
"Apache-2.0"
] |
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Phalcon\Http\Server;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
/**
* Handles a server request and produces a response.
*
* An HTTP request handler process an HTTP request in order to produce an
* HTTP response.
*/
abstract class AbstractRequestHandler implements RequestHandlerInterface
{
/**
* Handles a request and produces a response.
*
* May call other collaborating code to generate the response.
*/
abstract public function handle(<ServerRequestInterface> request) -> <ResponseInterface>;
}
| Zephir | 4 | tidytrax/cphalcon | phalcon/Http/Server/AbstractRequestHandler.zep | [
"BSD-3-Clause"
] |
[[languages]]
= Language Support
:toc: left
:toclevels: 4
:tabsize: 4
:docinfo1:
include::languages/kotlin.adoc[leveloffset=+1]
include::languages/groovy.adoc[leveloffset=+1]
include::languages/dynamic-languages.adoc[leveloffset=+1]
| AsciiDoc | 0 | spreoW/spring-framework | src/docs/asciidoc/languages.adoc | [
"Apache-2.0"
] |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>多媒体文件预览</title>
<script src="js/flv.min.js" type="text/javascript"></script>
<#include "*/commonHeader.ftl">
</head>
<style>
body {
background-color: #404040;
}
.m {
width: 1024px;
margin: 0 auto;
}
</style>
<body>
<div class="m">
<video width="1024" id="videoElement"></video>
</div>
<script>
if (flvjs.isSupported()) {
var videoElement = document.getElementById('videoElement');
var flvPlayer = flvjs.createPlayer({
type: 'flv',
url: '${mediaUrl}'
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
flvPlayer.play();
}
/*初始化水印*/
window.onload = function() {
initWaterMark();
}
</script>
</body>
</html>
| FreeMarker | 3 | jerrykcode/kkFileView | server/src/main/resources/web/flv.ftl | [
"Apache-2.0"
] |
// run-pass
// Simple smoke test that unsafe traits can be compiled etc.
unsafe trait Foo {
fn foo(&self) -> isize;
}
unsafe impl Foo for isize {
fn foo(&self) -> isize { *self }
}
fn take_foo<F:Foo>(f: &F) -> isize { f.foo() }
fn main() {
let x: isize = 22;
assert_eq!(22, take_foo(&x));
}
| Rust | 4 | Eric-Arellano/rust | src/test/ui/traits/trait-safety-ok.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
- dashboard: custom_goal_conversions
title: "[GA4] Custom Goal Conversions"
layout: newspaper
preferred_viewer: dashboards-next
elements:
- name: ''
type: text
title_text: ''
subtitle_text: ''
body_text: "<div style=\"text-align: center;\">\n\t<div>\n\t\t<h1 style=\"font-size:\
\ 28px;\">Custom Conversions</h1><h2 style=\"font-size: 16px;\"><b>Instructions:</b>\
\ Select any permutation of <b>Event Name</b> and/or <b>Page</b> filters at\
\ the top to select your goal(s). Then click the <b>Load/Update</b> button at\
\ the top right.\n<br>\n<b>Optional:</b> Update <b>Audience Selector</b> filter\
\ to update the Conversion Rate by Audience Cohort tile</h2></div>\n</div>\n"
row: 4
col: 0
width: 24
height: 4
- name: " (2)"
type: text
title_text: ''
subtitle_text: ''
body_text: "---\n<div style=\"text-align: center;\">\n\t<div><h2 style=\"font-size:\
\ 16px;\">Sessions that have at least one goal completed compared to total sessions\
\ in timeframe</h2></div>\n</div>\n"
row: 8
col: 0
width: 24
height: 2
- title: Sessions
name: Sessions
model: ga4
explore: sessions
type: single_value
fields: [sessions.total_sessions]
limit: 500
column_limit: 50
custom_color_enabled: true
show_single_value_title: true
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
enable_conditional_formatting: true
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
color_application:
collection_id: legacy
palette_id: looker_classic
custom_color: "#FFF"
single_value_title: Sessions
comparison_label: First Visit Sessions
conditional_formatting: [{type: not null, value: !!null '', background_color: "#F9AB00",
font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false,
strikethrough: false, fields: !!null ''}]
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
limit_displayed_rows: false
legend_position: center
point_style: none
show_value_labels: false
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
defaults_version: 1
series_types: {}
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 10
col: 0
width: 14
height: 2
- title: Sessions with Conversion
name: Sessions with Conversion
model: ga4
explore: sessions
type: single_value
fields: [events.sessions_with_conversions]
sorts: [events.sessions_with_conversions desc]
limit: 500
column_limit: 50
custom_color_enabled: true
show_single_value_title: true
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
enable_conditional_formatting: true
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
color_application:
collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2
palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
y_axes: [{label: '', orientation: bottom, series: [{axisId: events.sessions_with_conversions,
id: events.sessions_with_conversions, name: Sessions with Conversion}],
showLabels: false, showValues: true, unpinAxis: false, tickDensity: default,
tickDensityCustom: 5, type: linear}, {label: !!null '', orientation: bottom,
series: [{axisId: event_data.session_conversion_rate, id: event_data.session_conversion_rate,
name: Session Conversion Rate}], showLabels: false, showValues: false,
unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}]
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
limit_displayed_rows: false
legend_position: center
series_types: {}
point_style: circle
series_colors:
event_data.session_conversion_rate: "#4285F4"
events.sessions_with_conversions: "#34A853"
show_value_labels: false
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
custom_color: "#FFF"
single_value_title: Converting Sessions
comparison_label: First Visit Sessions
conditional_formatting: [{type: not null, value: !!null '', background_color: "#34A853",
font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false,
strikethrough: false, fields: !!null ''}]
defaults_version: 1
hidden_fields: []
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 10
col: 14
width: 5
height: 2
- title: Session CNV Rate
name: Session CNV Rate
model: ga4
explore: sessions
type: single_value
fields: [events.session_conversion_rate]
limit: 500
column_limit: 50
custom_color_enabled: true
show_single_value_title: true
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
enable_conditional_formatting: true
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
color_application:
collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2
palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1
custom_color: "#FFF"
single_value_title: Session CNV Rate
comparison_label: First Visit Sessions
conditional_formatting: [{type: not null, value: !!null '', background_color: "#1A73E8",
font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false,
strikethrough: false, fields: !!null ''}]
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
limit_displayed_rows: false
legend_position: center
point_style: none
show_value_labels: false
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
defaults_version: 1
series_types: {}
hidden_fields: []
y_axes: []
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 10
col: 19
width: 5
height: 2
- title: Custom Goal Conversion Rate
name: Custom Goal Conversion Rate
model: ga4
explore: sessions
type: looker_column
fields: [sessions.total_sessions, sessions.session_date, events.has_completed_goal]
pivots: [events.has_completed_goal]
fill_fields: [sessions.session_date, events.has_completed_goal]
sorts: [events.has_completed_goal, sessions.total_sessions 2]
limit: 500
column_limit: 50
row_total: right
dynamic_fields: [{table_calculation: rolling_7_day_conversion_rate, label: Rolling
7-day Conversion Rate, expression: "pivot_where(\n ${events.has_completed_goal}=yes\n\
\ , mean(\n offset_list(${sessions.total_sessions}/${sessions.total_sessions:row_total},-6,7)\n\
\ )\n)", value_format: !!null '', value_format_name: percent_0, _kind_hint: supermeasure,
_type_hint: number}, {table_calculation: sessions, label: Sessions, expression: "${sessions.total_sessions}",
value_format: !!null '', value_format_name: !!null '', _kind_hint: measure,
_type_hint: number}]
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: normal
limit_displayed_rows: false
legend_position: center
point_style: circle
show_value_labels: false
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
color_application:
collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2
palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1
y_axes: [{label: '', orientation: left, series: [{axisId: No - sessions, id: No
- sessions, name: Sessions}, {axisId: Yes - sessions, id: Yes - sessions,
name: Sessions with Conversion}], showLabels: true, showValues: true,
unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear},
{label: !!null '', orientation: right, series: [{axisId: rolling_7_day_conversion_rate,
id: rolling_7_day_conversion_rate, name: Rolling 7-day Conversion Rate}],
showLabels: true, showValues: true, unpinAxis: false, tickDensity: default,
tickDensityCustom: 5, type: linear}]
hidden_series: [Row Total - sessions.total_sessions]
series_types:
Row Total - sessions.total_sessions: scatter
rolling_7_day_conversion_rate: line
series_colors:
Row Total - sessions.total_sessions: "#e3e6e0"
Yes - sessions: "#34A853"
No - sessions: "#FBBC04"
rolling_7_day_conversion_rate: "#1A73E8"
series_labels:
No - sessions: Sessions
Yes - sessions: Sessions with Conversion
custom_color_enabled: true
show_single_value_title: true
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
enable_conditional_formatting: true
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
custom_color: "#FFF"
single_value_title: Converting Sessions
comparison_label: First Visit Sessions
conditional_formatting: [{type: not null, value: !!null '', background_color: "#34A853",
font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false,
strikethrough: false, fields: !!null ''}]
defaults_version: 1
show_row_numbers: true
transpose: false
truncate_text: true
hide_totals: false
hide_row_totals: false
size_to_fit: true
table_theme: white
header_text_alignment: left
header_font_size: 12
rows_font_size: 12
hidden_fields: [sessions.total_sessions]
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 12
col: 0
width: 14
height: 10
- title: Session Conversion Rate by Audience Cohort
name: Session Conversion Rate by Audience Cohort
model: ga4
explore: sessions
type: looker_bar
fields: [events.sessions_with_conversions, sessions.audience_trait, events.session_conversion_rate]
sorts: [events.sessions_with_conversions desc]
limit: 500
column_limit: 50
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
limit_displayed_rows: false
legend_position: center
point_style: circle
show_value_labels: true
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
color_application:
collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2
palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1
y_axes: [{label: '', orientation: bottom, series: [{axisId: events.sessions_with_conversions,
id: events.sessions_with_conversions, name: Sessions with Conversion}],
showLabels: false, showValues: true, unpinAxis: false, tickDensity: default,
tickDensityCustom: 5, type: linear}, {label: !!null '', orientation: bottom,
series: [{axisId: events.session_conversion_rate, id: events.session_conversion_rate,
name: Session Conversion Rate}], showLabels: false, showValues: false,
unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}]
series_types:
events.session_conversion_rate: scatter
series_colors:
events.sessions_with_conversions: "#34A853"
events.session_conversion_rate: "#4285F4"
custom_color_enabled: true
show_single_value_title: true
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
enable_conditional_formatting: true
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
custom_color: "#FFF"
single_value_title: Converting Sessions
comparison_label: First Visit Sessions
conditional_formatting: [{type: not null, value: !!null '', background_color: "#34A853",
font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false,
strikethrough: false, fields: !!null ''}]
defaults_version: 1
hidden_fields: []
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 12
col: 14
width: 10
height: 10
- name: " (3)"
type: text
title_text: ''
subtitle_text: ''
body_text: "---\n<div style=\"text-align: center;\">\n\t<div>\n\t\t<h1 style=\"\
font-size: 28px;\">Total Conversions</h1><h2 style=\"font-size: 16px;\">Total\
\ number of hits (Page or Event) that match the goals set in dashboard filters</h2></div></div>"
row: 22
col: 0
width: 24
height: 4
- title: Events with Conversion
name: Events with Conversion
model: ga4
explore: sessions
type: single_value
fields: [events.conversion_count]
limit: 500
column_limit: 50
custom_color_enabled: true
show_single_value_title: true
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
enable_conditional_formatting: true
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
color_application:
collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2
palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1
custom_color: "#FFF"
single_value_title: Total Conversions
comparison_label: First Visit Sessions
conditional_formatting: [{type: not null, value: !!null '', background_color: "#B31412",
font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false,
strikethrough: false, fields: !!null ''}]
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
y_axes: [{label: '', orientation: bottom, series: [{axisId: event_data.sessions_with_conversions,
id: event_data.sessions_with_conversions, name: Sessions with Conversion}],
showLabels: false, showValues: true, unpinAxis: false, tickDensity: default,
tickDensityCustom: 5, type: linear}, {label: !!null '', orientation: bottom,
series: [{axisId: event_data.session_conversion_rate, id: event_data.session_conversion_rate,
name: Session Conversion Rate}], showLabels: false, showValues: false,
unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}]
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
limit_displayed_rows: false
legend_position: center
series_types: {}
point_style: circle
series_colors:
event_data.sessions_with_conversions: "#34A853"
event_data.session_conversion_rate: "#4285F4"
show_value_labels: false
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
defaults_version: 1
hidden_fields: []
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 26
col: 0
width: 24
height: 2
- title: Top Goal Completion Page(s)
name: Top Goal Completion Page(s)
model: ga4
explore: sessions
type: looker_bar
fields: [events.conversion_count, events.event_param_page, events.session_conversion_rate]
filters:
events.event_param_page: "-EMPTY"
sorts: [events.conversion_count desc]
limit: 10
column_limit: 50
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
limit_displayed_rows: false
legend_position: center
point_style: circle
show_value_labels: true
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
color_application:
collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2
palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1
y_axes: [{label: !!null '', orientation: bottom, series: [{axisId: events.session_conversion_rate,
id: events.session_conversion_rate, name: Session Conversion Rate}], showLabels: false,
showValues: false, unpinAxis: false, tickDensity: default, tickDensityCustom: 5,
type: linear}, {label: '', orientation: bottom, series: [{axisId: events.conversion_count,
id: events.conversion_count, name: Total Conversions}], showLabels: false,
showValues: false, unpinAxis: false, tickDensity: default, type: linear}]
size_by_field: event_data.session_conversion_rate
series_types:
events.session_conversion_rate: scatter
series_colors:
event_data.sessions_with_conversions: "#34A853"
events.conversion_count: "#B31412"
events.session_conversion_rate: "#4285F4"
custom_color_enabled: true
show_single_value_title: true
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
enable_conditional_formatting: true
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
custom_color: "#FFF"
single_value_title: Total Conversions
comparison_label: First Visit Sessions
conditional_formatting: [{type: not null, value: !!null '', background_color: "#B31412",
font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false,
strikethrough: false, fields: !!null ''}]
defaults_version: 1
hidden_fields: []
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 28
col: 0
width: 12
height: 11
- title: Top Events
name: Top Events
model: ga4
explore: sessions
type: looker_bar
fields: [events.conversion_count, events.full_event]
filters:
events.event_param_page: "-EMPTY"
sorts: [events.conversion_count desc]
limit: 10
column_limit: 50
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
limit_displayed_rows: false
legend_position: center
point_style: circle
show_value_labels: true
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
color_application:
collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2
palette_id: 5d189dfc-4f46-46f3-822b-bfb0b61777b1
y_axes: [{label: !!null '', orientation: bottom, series: [{axisId: event_data.session_conversion_rate,
id: event_data.session_conversion_rate, name: Session Conversion Rate}],
showLabels: false, showValues: false, unpinAxis: false, tickDensity: default,
tickDensityCustom: 5, type: linear}, {label: '', orientation: bottom, series: [
{axisId: events.conversion_count, id: events.conversion_count, name: Total
Conversions}], showLabels: false, showValues: false, unpinAxis: false,
tickDensity: default, type: linear}]
size_by_field: event_data.session_conversion_rate
series_types:
event_data.session_conversion_rate: scatter
series_colors:
event_data.sessions_with_conversions: "#34A853"
event_data.session_conversion_rate: "#4285F4"
events.conversion_count: "#B31412"
custom_color_enabled: true
show_single_value_title: true
show_comparison: false
comparison_type: value
comparison_reverse_colors: false
show_comparison_label: true
enable_conditional_formatting: true
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
custom_color: "#FFF"
single_value_title: Total Conversions
comparison_label: First Visit Sessions
conditional_formatting: [{type: not null, value: !!null '', background_color: "#B31412",
font_color: "#FFF", color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab}, bold: false, italic: false,
strikethrough: false, fields: !!null ''}]
defaults_version: 1
hidden_fields: []
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 28
col: 12
width: 12
height: 11
- name: " (4)"
type: text
title_text: ''
subtitle_text: ''
body_text: "---\n<div style=\"text-align: center;\">\n\t<div>\n\t\t<h1 style=\"\
font-size: 28px;\">Reverse Goal Path</h1><h2 style=\"font-size: 16px;\">Read\
\ Data from Right to Left:</h2></div></div>\n<ul>\n<li>The column furthest to\
\ the right is where the Goal was completed.\n<li>Every subsequent column to\
\ the left is the hit (Page or Event Action) that took place directly before\
\ it.\n<li> Every path that flows into a NULL value is the “Entrance” into the\
\ website (i.e. NULL values represent that the user had not entered the website\
\ yet)</ul>\n\n"
row: 39
col: 0
width: 24
height: 5
- title: Reverse Goal Path
name: Reverse Goal Path
model: ga4
explore: sessions
type: looker_grid
fields: [events.current_page_minus_1, events.current_page_minus_2, events.current_page_minus_3,
events.event_param_page, events.sessions_with_conversions]
filters:
events.has_completed_goal: 'Yes'
sorts: [events.sessions_with_conversions desc]
limit: 50
column_limit: 50
total: true
dynamic_fields: [{table_calculation: of_total_sessions, label: "% of Total Sessions",
expression: "${events.sessions_with_conversions}/${events.sessions_with_conversions:total}",
value_format: !!null '', value_format_name: percent_0, _kind_hint: measure,
_type_hint: number}]
show_view_names: false
show_row_numbers: true
transpose: false
truncate_text: false
hide_totals: false
hide_row_totals: false
size_to_fit: true
table_theme: white
limit_displayed_rows: false
enable_conditional_formatting: true
header_text_alignment: left
header_font_size: '12'
rows_font_size: '12'
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
show_sql_query_menu_options: false
show_totals: false
show_row_totals: true
series_cell_visualizations:
event_data.sessions_with_conversions:
is_active: false
conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#1A73E8",
font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, options: {steps: 5, constraints: {
max: {type: percentile, value: 99}}}}, bold: false, italic: false, strikethrough: false,
fields: [of_total_sessions]}]
x_axis_gridlines: false
y_axis_gridlines: true
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
legend_position: center
point_style: none
show_value_labels: false
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
defaults_version: 1
series_types: {}
hidden_fields: []
y_axes: []
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Audience Selector: sessions.audience_selector
Session Date: sessions.session_date
row: 44
col: 0
width: 12
height: 11
- title: Reverse Event Action Path
name: Reverse Event Action Path
model: ga4
explore: sessions
type: looker_grid
fields: [events.current_event_minus_3, events.current_event_minus_2, events.current_event_minus_1,
events.full_event, events.sessions_with_conversions]
filters:
events.has_completed_goal: 'Yes'
sorts: [events.sessions_with_conversions desc]
limit: 50
column_limit: 50
total: true
dynamic_fields: [{table_calculation: of_total_sessions, label: "% of Total Sessions",
expression: "${events.sessions_with_conversions}/${events.sessions_with_conversions:total}",
value_format: !!null '', value_format_name: percent_0, _kind_hint: measure,
_type_hint: number}]
show_view_names: false
show_row_numbers: true
transpose: false
truncate_text: false
hide_totals: false
hide_row_totals: false
size_to_fit: true
table_theme: white
limit_displayed_rows: false
enable_conditional_formatting: true
header_text_alignment: left
header_font_size: '12'
rows_font_size: '12'
conditional_formatting_include_totals: false
conditional_formatting_include_nulls: false
show_sql_query_menu_options: false
show_totals: false
show_row_totals: true
series_cell_visualizations:
event_data.sessions_with_conversions:
is_active: false
conditional_formatting: [{type: along a scale..., value: !!null '', background_color: "#1A73E8",
font_color: !!null '', color_application: {collection_id: 7c56cc21-66e4-41c9-81ce-a60e1c3967b2,
palette_id: 56d0c358-10a0-4fd6-aa0b-b117bef527ab, options: {steps: 5, constraints: {
max: {type: percentile, value: 99}}}}, bold: false, italic: false, strikethrough: false,
fields: [of_total_sessions]}]
x_axis_gridlines: false
y_axis_gridlines: true
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
y_axis_tick_density_custom: 5
show_x_axis_label: true
show_x_axis_ticks: true
y_axis_scale_mode: linear
x_axis_reversed: false
y_axis_reversed: false
plot_size_by_field: false
trellis: ''
stacking: ''
legend_position: center
point_style: none
show_value_labels: false
label_density: 25
x_axis_scale: auto
y_axis_combined: true
ordering: none
show_null_labels: false
show_totals_labels: false
show_silhouette: false
totals_color: "#808080"
defaults_version: 1
series_types: {}
hidden_fields: []
y_axes: []
listen:
'Goal: Event Name': events.event_name_goal_selection
'Goal: Event Page': events.page_goal_selection
Session Date: sessions.session_date
row: 44
col: 12
width: 12
height: 11
- name: " (5)"
type: text
title_text: ''
subtitle_text: ''
body_text: "<div style=\"border: solid 1px #1A73E8; border-radius: 5px; padding:\
\ 3px 10px; background: #eaf1fe; text-align: center; margin-bottom: 10px;\"\
>\n\t<div>\n\t\t<img style=\"height: 60px; margin-top: 30px;\" src=\"https://www.gstatic.com/analytics-suite/header/suite/v2/ic_analytics.svg\"\
/>\n\t</div><br>\n<nav style=\"font-size: 18px; position: absolute; bottom:\
\ 0; text-align: center;\">\n <a style=\"padding: 5px; line-height: 40px;\"\
\ href=\"/dashboards-next/ga4::overview\">\n \t<svg style=\"height: 16px; fill: #4285F4;\" class=\"\
svg-icon\" viewBox=\"0 0 20 20\">\n\t\t\t\t\t\t\t<path d=\"M17.431,2.156h-3.715c-0.228,0-0.413,0.186-0.413,0.413v6.973h-2.89V6.687c0-0.229-0.186-0.413-0.413-0.413H6.285c-0.228,0-0.413,0.184-0.413,0.413v6.388H2.569c-0.227,0-0.413,0.187-0.413,0.413v3.942c0,0.228,0.186,0.413,0.413,0.413h14.862c0.228,0,0.413-0.186,0.413-0.413V2.569C17.844,2.342,17.658,2.156,17.431,2.156\
\ M5.872,17.019h-2.89v-3.117h2.89V17.019zM9.587,17.019h-2.89V7.1h2.89V17.019z\
\ M13.303,17.019h-2.89v-6.651h2.89V17.019z M17.019,17.019h-2.891V2.982h2.891V17.019z\"\
></path>\n</svg>\nGA Overview</a>\n<a style=\"padding: 5px; line-height: 40px;\"\
\ href=\"/dashboards-next/ga4::audience\">\n<svg style=\"height: 16px; fill: #4285F4;\" class=\"svg-icon\"\
\ viewBox=\"0 0 20 20\">\n<path d=\"M12.075,10.812c1.358-0.853,2.242-2.507,2.242-4.037c0-2.181-1.795-4.618-4.198-4.618S5.921,4.594,5.921,6.775c0,1.53,0.884,3.185,2.242,4.037c-3.222,0.865-5.6,3.807-5.6,7.298c0,0.23,0.189,0.42,0.42,0.42h14.273c0.23,0,0.42-0.189,0.42-0.42C17.676,14.619,15.297,11.677,12.075,10.812\
\ M6.761,6.775c0-2.162,1.773-3.778,3.358-3.778s3.359,1.616,3.359,3.778c0,2.162-1.774,3.778-3.359,3.778S6.761,8.937,6.761,6.775\
\ M3.415,17.69c0.218-3.51,3.142-6.297,6.704-6.297c3.562,0,6.486,2.787,6.705,6.297H3.415z\"\
></path>\n</svg>\nAudience</a>\n<a style=\"padding: 5px; line-height: 40px;\"\
\ href=\"/dashboards-next/ga4::acquisition\">\n<svg style=\"height: 16px; fill: #4285F4;\" class=\"svg-icon\"\
\ viewBox=\"0 0 20 20\">\n<path d=\"M8.749,9.934c0,0.247-0.202,0.449-0.449,0.449H4.257c-0.247,0-0.449-0.202-0.449-0.449S4.01,9.484,4.257,9.484H8.3C8.547,9.484,8.749,9.687,8.749,9.934\
\ M7.402,12.627H4.257c-0.247,0-0.449,0.202-0.449,0.449s0.202,0.449,0.449,0.449h3.145c0.247,0,0.449-0.202,0.449-0.449S7.648,12.627,7.402,12.627\
\ M8.3,6.339H4.257c-0.247,0-0.449,0.202-0.449,0.449c0,0.247,0.202,0.449,0.449,0.449H8.3c0.247,0,0.449-0.202,0.449-0.449C8.749,6.541,8.547,6.339,8.3,6.339\
\ M18.631,4.543v10.78c0,0.248-0.202,0.45-0.449,0.45H2.011c-0.247,0-0.449-0.202-0.449-0.45V4.543c0-0.247,0.202-0.449,0.449-0.449h16.17C18.429,4.094,18.631,4.296,18.631,4.543\
\ M17.732,4.993H2.46v9.882h15.272V4.993z M16.371,13.078c0,0.247-0.202,0.449-0.449,0.449H9.646c-0.247,0-0.449-0.202-0.449-0.449c0-1.479,0.883-2.747,2.162-3.299c-0.434-0.418-0.714-1.008-0.714-1.642c0-1.197,0.997-2.246,2.133-2.246s2.134,1.049,2.134,2.246c0,0.634-0.28,1.224-0.714,1.642C15.475,10.331,16.371,11.6,16.371,13.078M11.542,8.137c0,0.622,0.539,1.348,1.235,1.348s1.235-0.726,1.235-1.348c0-0.622-0.539-1.348-1.235-1.348S11.542,7.515,11.542,8.137\
\ M15.435,12.629c-0.214-1.273-1.323-2.246-2.657-2.246s-2.431,0.973-2.644,2.246H15.435z\"\
></path>\n</svg>\nAcquisition</a>\n<a style=\"padding: 5px; line-height: 40px;\"\
\ href=\"/dashboards-next/ga4::behavior\">\n<svg style=\"height: 16px; fill: #4285F4;\" class=\"\
svg-icon\" viewBox=\"0 0 20 20\">\n<path d=\"M17.237,3.056H2.93c-0.694,0-1.263,0.568-1.263,1.263v8.837c0,0.694,0.568,1.263,1.263,1.263h4.629v0.879c-0.015,0.086-0.183,0.306-0.273,0.423c-0.223,0.293-0.455,0.592-0.293,0.92c0.07,0.139,0.226,0.303,0.577,0.303h4.819c0.208,0,0.696,0,0.862-0.379c0.162-0.37-0.124-0.682-0.374-0.955c-0.089-0.097-0.231-0.252-0.268-0.328v-0.862h4.629c0.694,0,1.263-0.568,1.263-1.263V4.319C18.5,3.625,17.932,3.056,17.237,3.056\
\ M8.053,16.102C8.232,15.862,8.4,15.597,8.4,15.309v-0.89h3.366v0.89c0,0.303,0.211,0.562,0.419,0.793H8.053z\
\ M17.658,13.156c0,0.228-0.193,0.421-0.421,0.421H2.93c-0.228,0-0.421-0.193-0.421-0.421v-1.263h15.149V13.156z\
\ M17.658,11.052H2.509V4.319c0-0.228,0.193-0.421,0.421-0.421h14.308c0.228,0,0.421,0.193,0.421,0.421V11.052z\"\
></path>\n</svg>\nBehavior</a>\n<a style=\"padding: 5px; line-height: 40px;\"\
\ href=\"/dashboards-next/ga4::custom_goal_conversions\">\n<svg style=\"height: 16px; fill: #4285F4;\" class=\"\
svg-icon\" viewBox=\"0 0 20 20\">\n<path d=\"M15.94,10.179l-2.437-0.325l1.62-7.379c0.047-0.235-0.132-0.458-0.372-0.458H5.25c-0.241,0-0.42,0.223-0.373,0.458l1.634,7.376L4.06,10.179c-0.312,0.041-0.446,0.425-0.214,0.649l2.864,2.759l-0.724,3.947c-0.058,0.315,0.277,0.554,0.559,0.401l3.457-1.916l3.456,1.916c-0.419-0.238,0.56,0.439,0.56-0.401l-0.725-3.947l2.863-2.759C16.388,10.604,16.254,10.22,15.94,10.179M10.381,2.778h3.902l-1.536,6.977L12.036,9.66l-1.655-3.546V2.778z\
\ M5.717,2.778h3.903v3.335L7.965,9.66L7.268,9.753L5.717,2.778zM12.618,13.182c-0.092,0.088-0.134,0.217-0.11,0.343l0.615,3.356l-2.938-1.629c-0.057-0.03-0.122-0.048-0.184-0.048c-0.063,0-0.128,0.018-0.185,0.048l-2.938,1.629l0.616-3.356c0.022-0.126-0.019-0.255-0.11-0.343l-2.441-2.354l3.329-0.441c0.128-0.017,0.24-0.099,0.295-0.215l1.435-3.073l1.435,3.073c0.055,0.116,0.167,0.198,0.294,0.215l3.329,0.441L12.618,13.182z\"\
></path>\n</svg>\nConversions</a>\n</nav>\n</div>"
row: 0
col: 0
width: 24
height: 4
filters:
- name: Session Date
title: Session Date
type: field_filter
default_value: 7 day
allow_multiple_values: true
required: false
ui_config:
type: relative_timeframes
display: inline
options: []
model: ga4
explore: sessions
listens_to_filters: []
field: sessions.session_date
- name: 'Goal: Event Name'
title: 'Goal: Event Name'
type: field_filter
default_value: ''
allow_multiple_values: true
required: false
ui_config:
type: advanced
display: popover
model: ga4
explore: sessions
listens_to_filters: []
field: events.event_name_goal_selection
- name: 'Goal: Event Page'
title: 'Goal: Event Page'
type: field_filter
default_value: ''
allow_multiple_values: true
required: false
ui_config:
type: advanced
display: popover
model: ga4
explore: sessions
listens_to_filters: []
field: events.page_goal_selection
- name: Audience Selector
title: Audience Selector
type: field_filter
default_value: Device
allow_multiple_values: true
required: false
ui_config:
type: dropdown_menu
display: inline
options: []
model: ga4
explore: sessions
listens_to_filters: []
field: sessions.audience_selector | LookML | 3 | bcmu/ga_four | dashboards/custom_goal_conversions.dashboard.lookml | [
"MIT"
] |
<!DOCTYPE html>
<html lang="en" class="spf-link no-js">
<head>
{% include meta.liquid %}
<!-- begin spf head -->
{% include styles.liquid %}
<!-- end spf head -->
</head>
<body id="body" class="{{ page.original_layout }}">
<header id="app-bar" class="app-bar promote-layer">
<div class="app-bar-container">
<button id="menu" class="menu" title="Menu"></button>
<h1 class="logo"><a href="{{ site.baseurl }}/">SPF</a></h1>
<section class="app-bar-actions">
<a href="#"><i class="icon octicon octicon-chevron-up"></i> Top</a>
</section>
</div>
</header>
<div class="navdrawer">
<nav id="nav" class="navdrawer-container promote-layer">
<h4>Navigation</h4>
{% include nav.liquid %}
</nav>
</div>
<div id="content">
<!-- begin spf body: content -->
{{ content }}
<!-- end spf body: content -->
</div>
<footer>
<div class="container">
<p class="small">
© 2014 Google.
Code licensed under <a href="https://github.com/youtube/spfjs/blob/master/LICENSE">MIT</a>.
Documentation licensed under <a href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
</p>
</div>
</footer>
<div id="progress"><dt></dt><dd></dd></div>
<!-- begin spf foot -->
{% include scripts.liquid %}
{% include analytics.liquid %}
<!-- end spf foot -->
</body>
</html>
| Liquid | 4 | enterstudio/spfjs | web/layouts/base.liquid | [
"MIT"
] |
/*
* Copyright 2009-2016 the original author or 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.
*/
/**
* @file spk_log_config.h
*
* 日志配置文件解析处理头文件(非线程安全)
*
* @version $Id$
* @since 2005.10.31
*/
#ifndef _SPK_LOG_CONFIG_H
#define _SPK_LOG_CONFIG_H
#include <sutil/types.h>
#include <sutil/logger/spk_log_type.h>
#include <sutil/logger/spk_log_level.h>
#include <sutil/logger/spk_log_mode.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* 常量定义
*/
/** 最大的日志配置数量 */
#define SLOGCFG_MAX_CONFIG_COUNT (32)
/** 最大的日志记录器数量 */
#define SLOGCFG_MAX_APPENDER_NUMBER (16)
/* ------------------------- */
/*
* 日志默认配置定义
*/
#define SLOGCFG_DEFAULT_MIN_LOG_LEVEL SLOG_LEVEL_TRACE
#define SLOGCFG_DEFAULT_MAX_LOG_LEVEL SLOG_LEVEL_FATAL
#define SLOGCFG_DEFAULT_MAX_FILE_LENGTH (300)
#define SLOGCFG_DEFAULT_MAX_BACKUP_COUNT (3)
#define SLOGCFG_MAX_BACKUP_COUNT (1000)
#define SLOGCFG_DEFAULT_ASYNC_QUEUE_SIZE (1000)
#define SLOGCFG_DEFAULT_ASYNC_SHM_ID (0)
#define SLOGCFG_MAX_SECTION_LENGTH (64)
/* ------------------------- */
/*
* 配置文件常量定义
*/
/** 默认的日志根配置区段 */
#define SLOGCFG_KEY_DEFAULT_ROOT_SECTION "log"
/** 默认的日志根配置 */
#define SLOGCFG_KEY_DEFAULT_ROOT_CATEGORY "log.root_category"
/** 多值域的域分隔符 */
#define SLOGCFG_MULTI_VALUE_DELIMITER ","
/* ------------------------- */
/*
* 结构体定义
*/
/**
* 日志配置信息结构
*/
typedef struct _SLogCfgItem {
/** 日志配置区段名称 */
char logSection[SLOGCFG_MAX_SECTION_LENGTH];
/** 日志模式 */
char logMode[SLOG_MAX_MODE_NAME];
/** 日志登记的起始级别 */
char minLogLevel[SLOG_MAX_LEVEL_NAME];
/** 日志登记的最高级别 */
char maxLogLevel[SLOG_MAX_LEVEL_NAME];
/** 日志文件名称 */
char logFile[SPK_MAX_PATH_LEN];
/**
* 日志文件最大长度
* - 日志文件最大长度允许配置为0, 表示无最大长度限制
* - 如果配置值小于 2048 则以兆为单位计算, 否则以字节为单位计算, 最大文件长度为2GB
*/
int32 maxFileLength;
/** 日志文件最大备份数 */
int32 maxBackupCount;
/** 异步日志的消息队列大小 */
int32 asyncQueueSize;
/** 异步日志的共享内存ID (0 表示使用默认值) */
int32 asyncQueueShmId;
} SLogCfgItemT;
/* 结构体初始化值定义 */
#define NULLOBJ_LOG_CFG_ITEM \
{0}, {0}, {0}, {0}, {0}, \
0, 0, \
0, 0
/* ------------------------- */
/**
* 日志配置区段
*/
typedef struct _SLogCfgSectionInfo {
/** 日志配置的区段名称 */
char section[SLOGCFG_MAX_SECTION_LENGTH];
} SLogCfgSectionInfoT;
/* ------------------------- */
/*
* 函数声明
*/
/*
* 尝试加载所有的日志配置区段
*/
int32 SLogCfg_LoadAllConfig(
const char *pConfigFile,
SLogCfgItemT *pOutLogConfigList,
int32 maxLogConfigCount);
/*
* 解析日志配置信息, 读取相关的日志分类列表,并加载所有的日志配置区段
*/
int32 SLogCfg_LoadAllConfigAndCategoryList(
const char *pConfigFile,
const char *pRootSection,
const char *pRootCategoryField,
SLogCfgItemT *pOutLogConfigList,
int32 *pLogConfigCount,
SLogCfgSectionInfoT *pOutLogSectionList,
int32 *pLogSectionCount,
const SLogLevelT **ppOutAllowableMinLogLevel);
/* ------------------------- */
#ifdef __cplusplus
}
#endif
#endif /* _SPK_LOG_CONFIG_H */
| C | 4 | funrunskypalace/vnpy | vnpy/api/oes/include/oes/sutil/logger/spk_log_config.h | [
"MIT"
] |
\\ Copyright (c) 2019 Bruno Deferrari.
\\ BSD 3-Clause License: http://opensource.org/licenses/BSD-3-Clause
\\ Documentation: docs/extensions/launcher.md
(package shen.x.launcher [*argv* success error launch-repl show-help unknown-arguments]
(define quiet-load
File -> (let Contents (read-file File)
(map (/. X (shen.eval-without-macros X)) Contents)))
(define version-string
-> (make-string "~A ~R~%"
(version)
[port [(language) (port)]
implementation [(implementation) (release)]]))
(define help-text
Exe -> (make-string
"Usage: ~A [--version] [--help] <COMMAND> [<ARGS>]
commands:
repl
Launches the interactive REPL.
Default action if no command is supplied.
script <FILE> [<ARGS>]
Runs the script in FILE. *argv* is set to [FILE | ARGS].
eval <ARGS>
Evaluates expressions and files. ARGS are evaluated from
left to right and can be a combination of:
-e, --eval <EXPR>
Evaluates EXPR and prints result.
-l, --load <FILE>
Reads and evaluates FILE.
-q, --quiet
Silences interactive output.
-s, --set <KEY> <VALUE>
Evaluates KEY, VALUE and sets as global.
-r, --repl
Launches the interactive REPL after evaluating
all the previous expresions." Exe))
(define execute-all
[] -> [success]
[Continuation | Rest] -> (do (thaw Continuation)
(execute-all Rest)))
(define eval-string
Code -> (eval (head (read-from-string Code))))
(define eval-flag-map
"-e" -> "--eval"
"-l" -> "--load"
"-q" -> "--quiet"
"-s" -> "--set"
"-r" -> "--repl"
_ -> false)
(define eval-command-h
[] Acc -> (execute-all (reverse Acc))
["--eval" Code | Rest] Acc -> (eval-command-h
Rest
[(freeze (output "~A~%" (eval-string Code))) | Acc])
["--load" File | Rest] Acc -> (eval-command-h
Rest
[(freeze (load File)) | Acc])
["--quiet" | Rest] Acc -> (eval-command-h
Rest
[(freeze (set *hush* true)) | Acc])
["--set" Key Value | Rest] Acc -> (eval-command-h
Rest
[(freeze (set (eval-string Key)
(eval-string Value)))
| Acc])
["--repl" | Args] Acc -> (do (eval-command-h [] Acc)
[launch-repl | Args])
[Short | Rest] Acc <- (let Long (eval-flag-map Short)
(if (= false Long)
(fail)
(eval-command-h [Long | Rest] Acc)))
[Unknown | _] _ -> [error (make-string "Invalid eval argument: ~A" Unknown)])
(define eval-command
Args -> (eval-command-h Args []))
(define script-command
Script Args -> (do (set *argv* [Script | Args])
(quiet-load Script)
[success]))
(define launch-shen
[Exe] -> [launch-repl]
[Exe "--help" | Args] -> [show-help (help-text Exe)]
[Exe "--version" | Args] -> [success (version-string)]
[Exe "repl" | Args] -> [launch-repl | Args]
[Exe "script" Script | Args] -> (script-command Script Args)
[Exe "eval" | Args] -> (eval-command Args)
[Exe UnknownCommandOrFlag | Args] -> [unknown-arguments Exe UnknownCommandOrFlag | Args])
(define default-handle-result
[success] -> done
[success Message] -> (output "~A~%" Message)
[error Message] -> (output "ERROR: ~A~%" Message)
[launch-repl | _] -> (shen.repl)
[show-help HelpText] -> (output "~A~%" HelpText)
[unknown-arguments Exe UnknownCommandOrFlag | Args]
-> (output "ERROR: Invalid argument: ~A~%Try `~A --help' for more information.~%"
UnknownCommandOrFlag
Exe))
(define main
Argv -> (default-handle-result (launch-shen Argv)))
)
| Shen | 4 | nondejus/shen-go | ShenOSKernel-22.2/extensions/launcher.shen | [
"BSD-3-Clause"
] |
const std = @import("std");
const expect = std.testing.expect;
const expectEqual = std.testing.expectEqual;
const Vector = std.meta.Vector;
test "@popCount vectors" {
comptime try testPopCountVectors();
try testPopCountVectors();
}
fn testPopCountVectors() !void {
{
var x: Vector(8, u32) = [1]u32{0xffffffff} ** 8;
const expected = [1]u6{32} ** 8;
const result: [8]u6 = @popCount(u32, x);
try expect(std.mem.eql(u6, &expected, &result));
}
{
var x: Vector(8, i16) = [1]i16{-1} ** 8;
const expected = [1]u5{16} ** 8;
const result: [8]u5 = @popCount(i16, x);
try expect(std.mem.eql(u5, &expected, &result));
}
}
| Zig | 4 | silversquirl/zig | test/behavior/popcount_stage1.zig | [
"MIT"
] |
module Clash (module Clash1) where
import Clash1 as Clash1
import Clash2 as Clash2
| PureScript | 0 | metaleap/purs-with-dump-coreimp | examples/docs/src/Clash.purs | [
"BSD-3-Clause"
] |
/*****************************************************************************
*
* QUERY:
* PREPARE <plan_name> [(args, ...)] AS <query>
*
*****************************************************************************/
PrepareStmt: PREPARE name prep_type_clause AS PreparableStmt
{
PGPrepareStmt *n = makeNode(PGPrepareStmt);
n->name = $2;
n->argtypes = $3;
n->query = $5;
$$ = (PGNode *) n;
}
;
prep_type_clause: '(' type_list ')' { $$ = $2; }
| /* EMPTY */ { $$ = NIL; }
;
PreparableStmt:
SelectStmt
| InsertStmt
| UpdateStmt
| DeleteStmt /* by default all are $$=$1 */
;
| Yacc | 3 | AldoMyrtaj/duckdb | third_party/libpg_query/grammar/statements/prepare.y | [
"MIT"
] |
/* Do not edit this file - Generated by Perlito5 9.0 */
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
MODULE = ReturnArrayRef PACKAGE = ReturnArrayRef
void test ()
PPCODE:
SV *something = [newSVpv("Hello", 0), newSVpv("World", 0)];
PUSHs(something);
| XS | 2 | lablua/Perlito | misc/t5-xs/ReturnArrayRef/ReturnArrayRef.xs | [
"Artistic-2.0"
] |
Module: environment-reports
Author: Andy Armstrong, Jason Trenouth
Synopsis: ReStructuredText Library report generator (use with Sphinx)
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
define class <rst-report-stream> (<report-stream>)
end class <rst-report-stream>;
define method stream-class-for-report
(_format == #"rst") => (class :: subclass(<report-stream>))
<rst-report-stream>
end method stream-class-for-report;
define method write-definition-name
(stream :: <rst-report-stream>, report :: <namespace-report>,
namespace :: <namespace-object>)
=> ()
format(stream, "%s %s\n\n",
definition-kind(namespace),
environment-object-primitive-name(report.report-project, namespace));
end method write-definition-name;
define method write-definition-name
(stream :: <rst-report-stream>, report :: <namespace-report>,
library :: <library-object>)
=> ()
let library-name = definition-name(report, library);
let title = concatenate("The ",
as-uppercase(library-name),
" library");
let decorator = make(<byte-string>, fill: '*', size: title.size);
format(stream, "%s\n%s\n%s\n\n.. current-library:: %s\n\n",
decorator,
title,
decorator,
library-name);
end method write-definition-name;
define method write-definition-name
(stream :: <rst-report-stream>, report :: <module-report>,
module :: <module-object>)
=> ()
let module-name = definition-name(report, module);
let title = concatenate("The ",
as-uppercase(module-name),
" module");
format(stream, "\n%s\n%s\n\n.. current-module:: %s\n\n",
title,
make(<byte-string>, fill: '*', size: title.size),
module-name)
end method write-definition-name;
define method write-definition-name
(stream :: <rst-report-stream>, report :: <module-report>,
definition :: <definition-object>)
=> ()
let project = report.report-project;
let title = definition-name(report, definition);
let type = definition-kind(definition);
let rst-directive
= select (type by \=)
"Generic" => "generic-function";
otherwise => as-lowercase(type);
end;
format(stream, "\n.. %s:: %s\n", rst-directive, title);
write-definition-adjectives(stream, report, definition);
end method write-definition-name;
define method write-definition-adjectives
(stream :: <rst-report-stream>, report :: <module-report>,
definition :: <class-object>)
=> ()
do(method (mod) format(stream, " :%s:\n", as-lowercase(mod)) end,
split(class-modifiers(report.report-project, definition), " ",
remove-if-empty?: #t));
next-method();
end method write-definition-adjectives;
define method write-definition-adjectives
(stream :: <rst-report-stream>, report :: <module-report>,
definition :: <generic-function-object>)
=> ()
do(method (mod) format(stream, " :%s:\n", as-lowercase(mod)) end,
split(generic-function-modifiers(report.report-project, definition), " ",
remove-if-empty?: #t));
next-method();
end method write-definition-adjectives;
define method write-definition-adjectives
(stream :: <rst-report-stream>, report :: <module-report>,
definition :: <thread-variable-object>)
=> ()
format(stream, " :thread:\n");
next-method();
end method write-definition-adjectives;
define method write-definition-adjectives
(stream :: <rst-report-stream>, report :: <module-report>,
definition :: <definition-object>)
=> ()
end method write-definition-adjectives;
define method write-superclasses-header
(stream :: <rst-report-stream>, report :: <module-report>,
class :: <class-object>)
=> ()
format(stream, "\n :superclasses: ");
end method write-superclasses-header;
define method write-superclass
(stream :: <rst-report-stream>, report :: <module-report>,
superclass :: <definition-object>,
#key last? :: <boolean> = #f, first? :: <boolean> = #f)
=> ()
format(stream, "%s%s",
if (~first?) ", " else "" end,
rst-xref-definition-name(report, superclass))
end method write-superclass;
define method write-superclasses-footer
(stream :: <rst-report-stream>, report :: <module-report>,
superclass :: <class-object>)
=> ()
new-line(stream)
end method write-superclasses-footer;
define method write-init-keywords-header
(stream :: <rst-report-stream>, report :: <module-report>,
class :: <class-object>)
=> ()
new-line(stream)
end method write-init-keywords-header;
define method write-init-keyword
(stream :: <rst-report-stream>, report :: <module-report>,
keyword :: <symbol>, type :: false-or(<environment-object>),
required? :: <boolean>)
=> ()
format(stream, " :keyword %s%s: An instance of %s.\n",
if (required?) "required " else "" end if,
as(<string>, keyword),
if (type)
rst-xref-definition-name(report, type)
else
":drm:`<object>`"
end if)
end method write-init-keyword;
define method write-function-signature-name
(stream :: <rst-report-stream>, report :: <module-report>,
function :: <function-object>)
=> ()
format(stream, "\n :signature: %s",
definition-name(report, function));
end method write-function-signature-name;
define method write-function-arguments
(stream :: <rst-report-stream>, report :: <module-report>,
function :: <function-object>)
=> ()
let project = report.report-project;
let module = report.report-namespace;
let (required, rest, key, all-keys?, next, required-values, rest-value)
= function-parameters(project, function);
local method do-parameter
(parameter :: <parameter>, kind :: <argument-kind>) => ()
write-function-parameter(stream, report, parameter, kind: kind)
end method do-parameter;
local method do-parameters
(parameters :: <parameters>, kind :: <argument-kind>) => ()
do(rcurry(do-parameter, kind), parameters)
end method do-parameters;
write-function-parameters-header(stream, report, function);
do-parameters(required, #"input");
rest & do-parameter(rest, #"input-rest");
if (key & size(key) > 0)
do-parameters(key, #"input-keyword")
end;
write-function-parameters-footer(stream, report, function);
end method write-function-arguments;
define method write-function-values
(stream :: <rst-report-stream>, report :: <module-report>,
function :: <function-object>)
=> ()
let project = report.report-project;
let module = report.report-namespace;
let (required, rest, key, all-keys?, next, required-values, rest-value)
= function-parameters(project, function);
local method do-parameter
(parameter :: <parameter>, kind :: <argument-kind>) => ();
write-function-parameter(stream, report, parameter, kind: kind);
end method do-parameter;
local method do-parameters
(parameters :: <parameters>, kind :: <argument-kind>) => ()
do(rcurry(do-parameter, kind), parameters)
end method do-parameters;
write-function-parameters-header(stream, report, function, kind: #"output");
do-parameters(required-values, #"output");
rest-value & do-parameter(rest-value, #"output-rest");
write-function-parameters-footer(stream, report, function, kind: #"output");
end method write-function-values;
define method write-function-parameters-header
(stream :: <rst-report-stream>, report :: <module-report>,
function :: <function-object>, #key kind :: <argument-kind> = #"input")
=> ()
when (kind = #"input")
new-line(stream)
end
end method write-function-parameters-header;
define method write-function-parameter
(stream :: <rst-report-stream>, report :: <module-report>,
parameter :: <parameter>, #key kind :: <argument-kind> = #"input")
=> ()
let project = report.report-project;
let module = report.report-namespace;
let type = parameter.parameter-type;
local method kind-to-rst-field(kind :: <argument-kind>) => (field)
select (kind)
#"input" => "parameter";
#"input-rest" => "parameter #rest";
#"input-keyword" => "parameter #key";
#"output" => "value";
#"output-rest" => "value #rest";
end
end method kind-to-rst-field;
format(stream, " :%s %s: An instance of %s.",
kind-to-rst-field(kind),
if (instance?(parameter, <optional-parameter>))
parameter.parameter-keyword
end
| parameter.parameter-name,
rst-xref-definition-name(report, type));
new-line(stream);
end method write-function-parameter;
define method write-definition-footer
(stream :: <rst-report-stream>, report :: <namespace-report>,
definition :: <generic-function-object>)
=> ()
next-method();
write-generic-function-methods(stream, report, definition);
end method write-definition-footer;
define method write-generic-function-method
(stream :: <rst-report-stream>, report :: <module-report>,
gf :: <generic-function-object>, m :: <method-object>)
=> ()
let project = report.report-project;
format(stream, "\n.. method:: %s\n", definition-name(report, gf));
let (required, _) = function-parameters(project, m);
for (parameter :: <parameter> in required,
separator = " :specializer: " then ", ")
write(stream, separator);
write(stream, definition-name(report, parameter.parameter-type));
end for;
new-line(stream);
end method write-generic-function-method;
define function rst-xref-definition-name
(report :: <module-report>, definition :: <environment-object>)
=> (xref :: <string>)
let project = report.report-project;
let namespace = report.report-namespace;
let name = environment-object-name(project, definition, namespace);
if (name)
// This is defined in the same module in the same library and is
// a named Dylan type.
let role = definition-rst-role(definition);
let display-name = environment-object-primitive-name(project, name);
format-to-string(":%s:`%s`", role, display-name)
else
let lib = environment-object-library(project, definition);
let display-name
= environment-object-display-name(project, definition,
namespace, qualify-names?: #f);
if (lib & environment-object-primitive-name(project, lib) = "dylan")
// This is something from the dylan library, so let's assume it
// can be a DRM link. This should probably change for checking
// that the module is also "dylan".
format-to-string(":drm:`%s`", display-name)
elseif (lib & lib == report.report-parent.report-namespace)
// This is something from the same library, so it should be in
// the same documentation set, so let's link it.
let role = definition-rst-role(definition);
format-to-string(":%s:`%s`", role, display-name)
else
// This is from a different library or is something like a
// one-of() or false-or() value.
format-to-string("``%s``", display-name)
end if
end if
end function rst-xref-definition-name;
define method definition-rst-role (object :: <constant-object>)
=> (rst-role :: <string>)
"const"
end method definition-rst-role;
define method definition-rst-role (object :: <variable-object>)
=> (rst-role :: <string>)
"var"
end method definition-rst-role;
define method definition-rst-role (object :: <macro-object>)
=> (rst-role :: <string>)
"macro"
end method definition-rst-role;
define method definition-rst-role (object :: <function-object>)
=> (rst-role :: <string>)
"func"
end method definition-rst-role;
define method definition-rst-role (object :: <generic-function-object>)
=> (rst-role :: <string>)
"gf"
end method definition-rst-role;
define method definition-rst-role (object :: <class-object>)
=> (rst-role :: <string>)
"class"
end method definition-rst-role;
define method definition-rst-role (object :: <library-object>)
=> (rst-role :: <string>)
"lib"
end method definition-rst-role;
define method definition-rst-role (object :: <module-object>)
=> (rst-role :: <string>)
"mod"
end method definition-rst-role;
| Dylan | 4 | kryptine/opendylan | sources/environment/reports/library-report-rst.dylan | [
"BSD-2-Clause"
] |
import {Injectable} from '@angular/core';
class MyAlternateService {}
function alternateFactory() {
return new MyAlternateService();
}
@Injectable({providedIn: 'root', useFactory: alternateFactory})
export class MyService {
}
| TypeScript | 4 | John-Cassidy/angular | packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_di/di/usefactory_without_deps.ts | [
"MIT"
] |
{ buildPythonPackage
, fetchPypi
, fetchurl
, pythonOlder
, lib
, nixosTests
# pythonPackages
, tqdm
, dnspython
, expiringdict
, urllib3
, requests
, publicsuffix2
, xmltodict
, geoip2
, imapclient
, dateparser
, elasticsearch-dsl
, kafka-python
, mailsuite
, lxml
, boto3
}:
let
dashboard = fetchurl {
url = "https://raw.githubusercontent.com/domainaware/parsedmarc/77331b55c54cb3269205295bd57d0ab680638964/grafana/Grafana-DMARC_Reports.json";
sha256 = "0wbihyqbb4ndjg79qs8088zgrcg88km8khjhv2474y7nzjzkf43i";
};
in
buildPythonPackage rec {
pname = "parsedmarc";
version = "7.0.1";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "1mi4hx410y7ikpfy1582lm252si0c3yryj0idqgqbx417fm21jjc";
};
propagatedBuildInputs = [
tqdm
dnspython
expiringdict
urllib3
requests
publicsuffix2
xmltodict
geoip2
imapclient
dateparser
elasticsearch-dsl
kafka-python
mailsuite
lxml
boto3
];
pythonImportsCheck = [ "parsedmarc" ];
passthru = {
inherit dashboard;
tests = nixosTests.parsedmarc;
};
meta = {
description = "Python module and CLI utility for parsing DMARC reports";
homepage = "https://domainaware.github.io/parsedmarc/";
maintainers = with lib.maintainers; [ talyz ];
license = lib.licenses.asl20;
};
}
| Nix | 4 | siddhantk232/nixpkgs | pkgs/development/python-modules/parsedmarc/default.nix | [
"MIT"
] |
--- ps/base.ps.org 2007-02-28 11:43:50.000000000 +0000
+++ ps/base.ps 2007-02-28 11:44:05.000000000 +0000
@@ -158,48 +158,46 @@
% reencode the font
% <encoding-vector> <fontdict> -> <newfontdict>
-/reencode { %def
- dup length 5 add dict begin
- { %forall
- 1 index /FID ne
- { def }{ pop pop } ifelse
- } forall
- /Encoding exch def
-
- % Use the font's bounding box to determine the ascent, descent,
- % and overall height; don't forget that these values have to be
- % transformed using the font's matrix.
- % We use `load' because sometimes BBox is executable, sometimes not.
- % Since we need 4 numbers an not an array avoid BBox from being executed
- /FontBBox load aload pop
- FontMatrix transform /Ascent exch def pop
- FontMatrix transform /Descent exch def pop
- /FontHeight Ascent Descent sub def
-
- % Define these in case they're not in the FontInfo (also, here
- % they're easier to get to.
- /UnderlinePosition 1 def
- /UnderlineThickness 1 def
-
- % Get the underline position and thickness if they're defined.
- currentdict /FontInfo known {
- FontInfo
-
- dup /UnderlinePosition known {
- dup /UnderlinePosition get
- 0 exch FontMatrix transform exch pop
- /UnderlinePosition exch def
- } if
-
- dup /UnderlineThickness known {
- /UnderlineThickness get
- 0 exch FontMatrix transform exch pop
- /UnderlineThickness exch def
- } if
-
- } if
- currentdict
- end
+/reencode
+{
+ dup length 5 add dict begin
+ { % <vector> <key> <val>
+ 1 index /FID ne
+ { def }{ pop pop } ifelse
+ } forall
+ /Encoding exch def % -
+
+ % Use the font's bounding box to determine the ascent, descent,
+ % and overall height; don't forget that these values have to be
+ % transformed using the font's matrix. We use `load' because sometimes
+ % BBox is executable, sometimes not. Since we need 4 numbers an not
+ % an array avoid BBox from being executed
+ /FontBBox load aload pop
+ FontMatrix transform /Ascent exch def pop
+ FontMatrix transform /Descent exch def pop
+ /FontHeight Ascent Descent sub def
+
+ % Get the underline position and thickness if they're defined.
+ % Use 1 if they are not defined.
+ currentdict /FontInfo 2 copy known
+ { get
+ /UnderlinePosition 2 copy % <FontInfo> /UP <FontInfo> /UP
+ 2 copy known
+ { get }{ pop pop 1} ifelse
+ 0 exch FontMatrix transform exch pop
+ def % <FontInfo>
+
+ /UnderlineThickness 2 copy % <FontInfo> /UT <FontInfo> /UT
+ 2 copy known
+ { get }{ pop pop 1} ifelse
+ 0 exch FontMatrix transform exch pop
+ def % <FontInfo>
+ pop % -
+ }{ pop pop
+ } ifelse
+
+ currentdict
+ end
} bind def
% Function print line number (<string> # -)
| PostScript | 4 | davidlrichmond/macports-ports | print/a2ps/files/patch-ps-base.ps | [
"BSD-3-Clause"
] |
"""
Template for AdjustedArray windowed iterators.
This file is intended to be used by inserting it via a Cython include into a
file that's defined a type symbol named `databuffer` that can be used like a
2-D numpy array.
See Also
--------
zipline.lib._floatwindow
zipline.lib._intwindow
zipline.lib._datewindow
"""
from numpy cimport ndarray
from numpy import asanyarray, dtype, issubdtype
class Exhausted(Exception):
pass
cdef class AdjustedArrayWindow:
"""
An iterator representing a moving view over an AdjustedArray.
Concrete subtypes should subclass this and provide a `data` attribute for
specific types.
This object stores a copy of the data from the AdjustedArray over which
it's iterating. At each step in the iteration, it mutates its copy to
allow us to show different data when looking back over the array.
The arrays yielded by this iterator are always views over the underlying
data.
The `rounding_places` attribute is an integer used to specify the number of
decimal places to which the data should be rounded, given that the data is
of dtype float. If `rounding_places` is None, no rounding occurs.
"""
cdef:
# ctype must be defined by the file into which this is being copied.
readonly databuffer data
readonly dict view_kwargs
readonly Py_ssize_t window_length
Py_ssize_t anchor, max_anchor, next_adj
Py_ssize_t perspective_offset
object rounding_places
dict adjustments
list adjustment_indices
ndarray output
def __cinit__(self,
databuffer data not None,
dict view_kwargs not None,
dict adjustments not None,
Py_ssize_t offset,
Py_ssize_t window_length,
Py_ssize_t perspective_offset,
object rounding_places):
self.data = data
self.view_kwargs = view_kwargs
self.adjustments = adjustments
self.adjustment_indices = sorted(adjustments, reverse=True)
self.window_length = window_length
self.anchor = window_length + offset - 1
if perspective_offset > 1:
# Limit perspective_offset to 1.
# To support an offset greater than 1, work must be done to
# ensure that adjustments are retrieved for the datetimes between
# the end of the window and the vantage point defined by the
# perspective offset.
raise Exception("perspective_offset should not exceed 1, value "
"is perspective_offset={0}".format(
perspective_offset))
self.perspective_offset = perspective_offset
self.rounding_places = rounding_places
self.max_anchor = data.shape[0]
self.next_adj = self.pop_next_adj()
self.output = None
cdef pop_next_adj(self):
"""
Pop the index of the next adjustment to apply from self.adjustment_indices.
"""
if len(self.adjustment_indices) > 0:
return self.adjustment_indices.pop()
else:
return self.max_anchor + self.perspective_offset
def __iter__(self):
return self
def __next__(self):
try:
self._tick_forward(1)
except Exhausted:
raise StopIteration()
self._update_output()
return self.output
def seek(self, Py_ssize_t target_anchor):
cdef:
Py_ssize_t anchor = self.anchor
if target_anchor < anchor:
raise Exception('Can not access data after window has passed.')
if target_anchor == anchor:
return self.output
self._tick_forward(target_anchor - anchor)
self._update_output()
return self.output
cdef inline _tick_forward(self, int N):
cdef:
object adjustment
Py_ssize_t anchor = self.anchor
Py_ssize_t target = anchor + N
if target > self.max_anchor:
raise Exhausted()
# Apply any adjustments that occured before our current anchor.
# Equivalently, apply any adjustments known **on or before** the date
# for which we're calculating a window.
while self.next_adj < target + self.perspective_offset:
for adjustment in self.adjustments[self.next_adj]:
adjustment.mutate(self.data)
self.next_adj = self.pop_next_adj()
self.anchor = target
cdef inline _update_output(self):
cdef:
ndarray new_out
Py_ssize_t anchor = self.anchor
dict view_kwargs = self.view_kwargs
new_out = asanyarray(self.data[anchor - self.window_length:anchor])
if view_kwargs:
new_out = new_out.view(**view_kwargs)
if self.rounding_places is not None and \
issubdtype(new_out.dtype, dtype('float64')):
new_out = new_out.round(self.rounding_places)
new_out.setflags(write=False)
self.output = new_out
def __repr__(self):
return "<%s: window_length=%d, anchor=%d, max_anchor=%d, dtype=%r>" % (
type(self).__name__,
self.window_length,
self.anchor,
self.max_anchor,
self.view_kwargs.get('dtype'),
)
| Cython | 5 | leonarduschen/zipline | zipline/lib/_windowtemplate.pxi | [
"Apache-2.0"
] |
require "./basic_block"
struct LLVM::BasicBlockCollection
include Enumerable(LLVM::BasicBlock)
def initialize(@function : Function)
end
def append(name = "")
context = LibLLVM.get_module_context(LibLLVM.get_global_parent(@function))
BasicBlock.new LibLLVM.append_basic_block_in_context(context, @function, name)
end
def append(name = "")
context = LibLLVM.get_module_context(LibLLVM.get_global_parent(@function))
block = append name
# builder = Builder.new(LibLLVM.create_builder_in_context(context), LLVM::Context.new(context, dispose_on_finalize: false))
builder = Builder.new(LibLLVM.create_builder_in_context(context))
builder.position_at_end block
yield builder
block
end
def each : Nil
bb = LibLLVM.get_first_basic_block(@function)
while bb
yield LLVM::BasicBlock.new bb
bb = LibLLVM.get_next_basic_block(bb)
end
end
def []?(name : String)
find(&.name.==(name))
end
def [](name : String)
self[name]? || raise IndexError.new
end
def last?
block = nil
each do |current_block|
block = current_block
end
block
end
end
| Crystal | 3 | mgomes/crystal | src/llvm/basic_block_collection.cr | [
"Apache-2.0"
] |
NB. Restricted Boltzmann Machine Implementation
NB. Restricted Boltzmann Machines can be used for pattern recognition,
NB. similar to Hopfield Networks (see hopfield.ijs) and for
NB. classification problems. The RBM network is generated with two
NB. layers - the visible layer, and the hidden layer.
NB. The Energy Function of an RBM is given by:
NB. E(v,h) = -b'.v - c'.h - v'.W.h
Note 'References'
[1] A Practical Guide to Training Restricted Boltzmann Machines, G. Hinton
https://www.cs.toronto.edu/~hinton/absps/guideTR.pdf
[2] Deep Learning, Ian Goodfellow, Yoshua Bengio, Aaron Courville
link: http://www.deeplearningbook.org/
)
require jpath '~Projects/jlearn/utils/utils.ijs'
require jpath '~Projects/jlearn/linear/logisticregression.ijs'
coclass 'BoltzmannMachine'
dot=: +/ . *
make2d=: ]`,:@.(1&=@:#@:$)
create=: destroy=: codestroy
coclass 'RBM'
coinsert 'BoltzmannMachine'
NB. Instantiates the Restricted Boltzmann Machine implementation.
NB. Hidden units are assumed to be binary units (0 or 1)
NB. Params
NB. 0: visible node size
NB. 1: hidden node size
NB. 2: learning rate
NB. 3: batch size
NB. 4: Maximum number of iterations for fitting training data.
create=: 3 : 0
'vs hs lr bs maxIter'=: y
NB. Intialize weights from Normal N(0,0.1) distribution.
weights=: (vs # hs) bmt_jLearnUtil_"0 _ [ 0 0.1
biasV=: hs # 0
biasH=: vs # 0
)
transform=: 3 : 0"1
hp=. %>:^- (,biasV) + y dot weights
)
NB. Similar to a prediction, will reconstruct the best fitting
NB. memory sample for the given data.
reconstruct=: 3 : 0
compVisible (?@:($&0)@:$ < ]) compHidden y
)
NB. Computes the hidden node values.
compHidden=: 3 : 0
%>:^- biasV +"_ 1 y dot weights
)
NB. Computes the visible node values.
compVisible=: 3 : 0
vn=. %>:^- biasH +"_ 1 |: weights dot |: y
vn=. ((?@:($&0)@:$) < ] ) vn
)
fit=: 3 : 0
assert. vs = 1{$ y
trainData=. y
nSamples=: {. $ trainData
biasV=: hs # 0
biasH=: vs # 0
nBatches=. >. nSamples % bs
hSamples=: (bs, hs) $ 0
iter=. 0
while. iter < maxIter do.
iter=. iter+1
index=. bs ?# trainData
data=. index { trainData
fitBatch data
end.
)
NB. Fits a single batch of samples using
NB. C_D algorithm.
NB. Parameters:
NB. y: Sample batch
NB. returns:
NB. None
fitBatch2=: 3 : 0
i=: y
pha=: y dot weights
php=: %>:^- biasV +"_ 1 pha
phs=: ((?@:($&0)@:$) < ] ) php
pa=: (|: i) dot php
nva=: phs dot |: weights
nvp=: %>:^- biasH +"_ 1 nva
nha=: nvp dot weights
nhp =: %>:^- nha
na=: (|: nvp) dot nhp
weights =: weights + lr * (pa - na) % bs
''
)
fitBatch=: 3 : 0
i=: y
hp=: compHidden i
vn=: compVisible hSamples
hn=: compHidden vn
upd=: (|: i) dot hp
NB. update value is model minus data
upd=: upd - |:(|: hn) dot vn
NB. update weights
weights=: weights + lr * upd
NB. update biases
biasV=: biasV +"_ 1 lr * +/(hp - hn)
biasH=: biasH +"_ 1 lr * +/(i - vn)
hn=: ((?@:($&0)@:$) < ] ) hn
error=: *: i - vn
hSamples=: <. hn
)
NB. Calculates the free energy of a visible vector.
NB. See [1] Section 16.1
NB.
calculateFreeEnergy=: 3 : 0"1
i=. make2d y
,(-(|:i) dot~ biasH) -^.+/ 1+^, (i dot weights) + biasV
)
gibbs=: 3 : 0
h=. ((?0)&<)"0 compHidden make2d y
v=. compVisible h
)
destroy=: codestroy
NB. Restricted Boltzmann Machine Classifier. Inherits from the
NB. RBM class.
coclass 'RBMClassifier'
coinsert 'RBM'
create=: 3 : 0
(create_RBM_ f.) }:y
classCount=:>{:y
NB.logReg=: (hs;classCount;500;'gd';'softmax';0.001;50; 'l2') conew 'LRC'
logReg=: (hs;classCount;5;'gd';'softmax';0.01;10; 'l2') conew 'LRC'
)
fitClassify=: 4 : 0
fit y
Xp=. transform y
smoutput $ x
smoutput $ Xp
smoutput '-'
x fit__logReg Xp
''
)
predict=: 3 : 0"1
predict__logReg transform y
)
destroy=: codestroy
Note 'Example'
rbm=: (5 32 0.12 1 3500) conew 'RBM'
NB. 6 samples
A=: 6 5 $ 0 1 0 1 1 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 1 1 1 1 0 0
fit__rbm A
compVisible__rbm (?@:($&0)@:$ < ]) compHidden__rbm 1 5 $ 1 0 1 0 1
)
rbm=: (6 22 0.12 1 3500) conew 'RBM'
compVisible__rbm@:(?@:($&0)@:$ < ])@:compHidden__rbm@:(1 6&$@:,)"1 A
compVisible__rbm (?@:($&0)@:$ < ]) compHidden__rbm 1 6 $ 1 0 0 0 0 0
rbm=: (64;100;0.01;25;5500;10) conew 'RBMClassifier'
Y fitClassify__rbm X
+/ W-:"1 1 (=>./)"1 predict__rbm Z | J | 5 | jonghough/jlearn | energy/rbm.ijs | [
"MIT"
] |
\require "[email protected]"
| LilyPond | 0 | HolgerPeters/lyp | spec/user_files/not_found.ly | [
"MIT"
] |
#%RAML 0.8
title: Machines API
baseUri: http://example.api.com/{version}
version: v1
schemas:
- type1: !include schemas/type1.json
- type2: !include schemas/type2.json
/machines:
get:
description: Gets a list of existing machines
responses:
200:
body:
application/json:
schema: type2
| RAML | 3 | plroebuck/abao | test/fixtures/machines-ref_other_schemas.raml | [
"MIT"
] |
# this is ignored by Clippy, but allowed for other tools like clippy-service
[third-party]
clippy-feature = "nightly"
| TOML | 0 | Eric-Arellano/rust | src/tools/clippy/tests/ui/crashes/third-party/clippy.toml | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
#[no_mangle]
pub fn cold_function(c: u8) {
println!("cold {}", c);
}
#[no_mangle]
pub fn hot_function(c: u8) {
std::env::set_var(format!("var{}", c), format!("hot {}", c));
}
fn main() {
let arg = std::env::args().skip(1).next().unwrap();
for i in 0 .. 1000_000 {
let some_value = arg.as_bytes()[i % arg.len()];
if some_value == b'!' {
// This branch is never taken at runtime
cold_function(some_value);
} else {
hot_function(some_value);
}
}
}
| Rust | 3 | Eric-Arellano/rust | src/test/run-make-fulldeps/pgo-use/main.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
// MODULE: m1
// FILE: k1.kt
package k
private class KPrivate
internal class KInternal
public class KPublic
class A {
protected class KProtected
}
// FILE: k2.kt
package k2
import k.<!INVISIBLE_REFERENCE!>KPrivate<!>
import k.KInternal
import k.KPublic
import k.A.KProtected
// MODULE: m2(m1)
// FILE: k3.kt
package k3
import k.<!INVISIBLE_REFERENCE!>KPrivate<!>
import k.<!INVISIBLE_REFERENCE!>KInternal<!>
import k.KPublic
import k.A.KProtected | Kotlin | 4 | qussarah/declare | compiler/testData/diagnostics/tests/imports/CheckVisibility.kt | [
"Apache-2.0"
] |
package test
abstract class A {
inner class Inner(val x: String)
}
abstract class B : A()
| Kotlin | 3 | Mu-L/kotlin | jps-plugin/testData/incremental/pureKotlin/innerClassesFromSupertypes/a.kt | [
"ECL-2.0",
"Apache-2.0"
] |
---
layout: post
title: Measures and Case Splitting
date: 2018-02-23
comments: true
author: Niki Vazou
published: true
tags: measures, flags
demo: MeasuresAndCaseSplitting.hs
---
Liquid Haskell has a flag called `--no-case-expand`
which can make verification of your code much faster,
especially when your code is using ADTs with many alternatives.
This flag says relax precision to get fast verification,
thus may lead to rejecting safe code.
In this post, I explain how `--no-case-expand`
works using a trivial example!
(Click here to [demo][demo])
<!-- more -->
<div class="hidden">
\begin{code}
module MeasuresAndCaseSplitting where
\end{code}
</div>
Measures
---------
Let's define a simple data type with three alternatives
\begin{code}
data ABC = A | B | C
\end{code}
and a measure that turns `ABC` into an integer
\begin{code}
{-@ measure toInt @-}
toInt :: ABC -> Int
toInt A = 1
toInt B = 2
toInt C = 3
\end{code}
Though obvious to us, Liquid Haskell will fail to check
that `toInt` of any `ABC` argument
gives back a natural number.
Or, the following call leads to a refinement type error.
\begin{code}
{-@ unsafe :: x:ABC -> {o:() | 0 <= toInt x } @-}
unsafe :: ABC -> ()
unsafe x = ()
\end{code}
Why?
By turning `toInt` into a measure, Liquid Haskell
gives precise information to each data constructor of `ABC`.
Thus it knows that `toInt` or `A`, `B`, and `C`
is respectively `1`, `2`, and `3`, by *automatically*
generating the following types:
\begin{spec}
A :: {v:ABC | toInt v == 1 }
B :: {v:ABC | toInt v == 2 }
C :: {v:ABC | toInt v == 3 }
\end{spec}
Thus, to get the `toInt` information one need to
explicitly perform case analysis on an `ABC` argument.
The following code is safe
\begin{code}
{-@ safe :: x:ABC -> {o:() | 0 <= toInt x } @-}
safe :: ABC -> ()
safe A = ()
safe B = ()
safe C = ()
\end{code}
Liquid Haskell type check the above code because
in the first case the body is checked under the assumption
that the argument, call it `x`, is an `A`.
Under this assumption, `toInt x` is indeed non negative.
Yet, this is the case for the rest two alternatives,
where `x` is either `B` or `C`.
So, `0 <= toInt x` holds for all the alternatives,
because case analysis on `x` automatically reasons about the
value of the measure `toInt`.
Now, what if I match the argument `x` only with `A`
and provide a default body for the rest?
\begin{code}
{-@ safeBut :: x:ABC -> {o:() | 0 <= toInt x } @-}
safeBut :: ABC -> ()
safeBut A = ()
safeBut _ = ()
\end{code}
Liquid Haskell knows that if the argument `x` is actually an `A`,
then `toInt x` is not negative, but does not know the value of `toInt`
for the default case.
But, *by default* Liquid Haskell will do the the case expansion
of the default case for you and rewrite your code to match `_`
with all the possible cases.
Thus, Liquid Haskell will internally rewrite `safeBut` as
\begin{code}
{-@ safeButLH :: x:ABC -> {o:() | 0 <= toInt x } @-}
safeButLH :: ABC -> ()
safeButLH A = ()
safeButLH B = ()
safeButLH C = ()
\end{code}
With this rewrite Liquid Haskell gets precision!
Thus, it has all the information it needs to prove `safeBut` as safe.
Yet, it repeats the code of the default case,
thus verification slows down.
In this example, we only have three case alternatives,
so we only repeat the code two times with a minor slow down.
In cases with many more alternatives repeating the code
of the default case can kill the verification time.
For that reason, Liquid Haskell comes with the `no-case-expand`
flag that deactivates this expansion of the default cases.
With the `no-case-expand` flag on, the `safeBut` code will not type check
and to fix it the user needs to perform the case expansion manually.
In short, the `no-case-expand` increases verification speed
but reduces precision. Then it is up to the user
to manually expand the default cases, as required,
to restore all the precision required for the code to type check.
[demo]: http://goto.ucsd.edu:8090/index.html#?demo=MeasuresAndCaseSplitting.hs
| Literate Haskell | 5 | curiousleo/liquidhaskell | docs/blog/2018-02-23-measures-and-case-splitting.lhs | [
"MIT",
"BSD-3-Clause"
] |
# Interface features should not be unique
template features/interface/src_route/config;
| Pan | 0 | ned21/aquilon | tests/broker/data/utsandbox/aquilon/features/interface/src_route/config.pan | [
"Apache-2.0"
] |
<table width="3D"600"" border="3D"0"" align="3D"center"" cellpadding="3D"0"" cellsp="acing=3D"0"" bgcolor="3D"#ffffff""><tbody><tr><td colspan="3D"3""><table border="=3D"0"" cellpadding="3D"0"" cellspacing="3D"0"" width="3D"100%""></table></td></tr><tr><td valign="3D"top"" width="3D"1""><img src="3D"http://gs.place.edu/file=" s="" gs="" place-gs-lockup.gif"=""></td></tr></tbody>
<tbody>
<tr>
<td width="3D"583"" align="3D"left""> </td>
</tr>
<tr></tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:15pt" 15px;font-fami="ly:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:le=" ft"="">Dear FOOBAR,</td>
</tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:5pt" 15px;font-famil="y:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:lef=" t"="">It is my sincere pleasure to inform you that you have been selected for =
membership in the Honor Society of the School of General Studies. The Socie=
ty was created in 1997 to celebrate the academic achievement of exceptional=
GS scholars. Only juniors or seniors with a grade point average of 3.8 or =
above who have completed at least 30 points at place are eligible for me=
mbership. The chief aim of the Honor Society is to cultivate interaction am=
ong students committed to intellectual discovery and the faculty who enjoy =
teaching them. </td>
</tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:5pt" 15px;font-famil="y:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:lef=" t"="">Please join us for the Induction Ceremony, with a reception to follow.<!--=
td-->
</td></tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:5pt" 15px;font-famil="y:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:lef=" t"=""><blockquote>
<p><strong>Induction Ceremony <br>
Honor Society</strong><br>
<br>
Reception to follow.</p>
</blockquote></td>
</tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:5pt" 15px;font-famil="y:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:lef=" t"="">The <a href="3D"http://place.us6.list-manage.com/track/click?u=3D257ce=" e2ddd47afbb8be32c6ce&id="3D639cf43a42&e=3D223ebffa5a"" style="3D"color=" :#5d82de"="" target="3D"_blank"">favor of a reply</a> is requested by Friday, J=
anuary 29 at 5 p.m. You are invited to bring one guest; business attire is =
requested.</td>
</tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:5pt" 15px;font-famil="y:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:lef=" t"="">I look forward to celebrating with you soon.</td>
</tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:5pt" 15px;font-famil="y:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:lef=" t"=""><p>Best wishes,<br>
<img src="3D"http://gs.place.edu/files/gs/BAR_signature.jpg"" alt="=3D"Dean" foo="" j.="" bar"="" width="3D"148"" height="3D"44"" border="3D"0"" style="3D"pa=" dding-top:15px;padding-left:0px"="" title="3D"place" university="" school="" of="" gen="eral" studies"=""><br>
FOO J. BAR<br>
Dean <br>
University<br>
<br>
<br>
N.B. A printed letter concerning your selection has been mailed to =
your local address.</p></td>
</tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:0pt" 15px;font-famil="y:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:lef=" t"=""> </td>
</tr>
<tr>
<td colspan="3D"2"" valign="3D"top"" style="3D"padding:0pt" 15px;font-famil="y:Arial,Helvetica,sans-serif;font-size:12px;color:rgb(0,0,0);text-align:lef=" t"=""></td>
</tr>
</tbody>
<tbody>
<tr>
<td valign="3D"top"" width="3D"598""><table border="3D"0"" cellpadding="3D"0=" "="" cellspacing="3D"0"" width="3D"594""></table></td><td align="3D"left"" valign="3D=" "top"="" width="3D"1""><img src="3D"http://www.place.edu/cu/gs/images/yrp_spac=" er.jpg"=""></td>
</tr>
</tbody>
</table>
<center>
<br>
<br>
<br>
<br>
<br>
<br>
<table border="3D"0"" cellpadding="3D"0"" cellspacing="3D"0"" wid="th=3D"100%"" style="3D"background-color:#ffffff;border-top:1px" solid="" #e5e5e5"="">
<tbody><tr>
<td align="3D"center"" valign="3D"top"" style="3D"paddin=" g-top:20px;padding-bottom:20px"="">
<table border="3D"0"" cellpadding="3D"0"" cellspaci="ng=3D"0"">
<tbody><tr>
<td align="3D"center"" valign="3D"top"" sty="le=3D"color:#606060;font-family:Helvetica,Arial,sans-serif;font-size:11px;l=" ine-height:150%;padding-right:20px;padding-bottom:5px;padding-left:20px;tex="t-align:center"">
This email was sent to <a href="3D"m=" ailto:[email protected]"="" style="3D"color:#404040!important"" target="3D"_b=" lank"="">[email protected]</a>
<br>
<a href="3D"http://place.us6.list=" -manage1.com="" about?u="xxxxxxxxxxxxxxxxxxxxxxxxxxx&id=xxxxxxxxxxxx&e=" =3d223ebffa5a&c="3Df2c0d84500"" style="3D"color:#404040!important"" target="=3D"_blank""><em>why did I get this?</em></a> <a href="=3D"http://place.us6.list-manage1.com/unsubscribe?u=xxxxxxxxxxxxxxxxxxxx=" e32c6ce&id="3Dcebd346d3d&e=3D223ebffa5a&c=3Df2c0d84500"" style="3D=" "color:#404040!important"="" target="3D"_blank"">unsubscribe from this list</a>&=
nbsp; <a href="3D"http://place.us6.list-manage2.com/prof=" ile?u="3D257cee2ddd47afbb8be32c6ce&id=3Dcebd346d3d&e=3D223ebffa5a"" s="tyle=3D"color:#404040!important"" target="3D"_blank"">update subscription pref=
erences</a>
<br>
place
<br>
<br>
=20
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</center>
| HTML | 0 | cnheider/nylas-mail | packages/client-app/spec/fixtures/emails/email_17_stripped.html | [
"MIT"
] |
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY lumify "http://lumify.io#" >
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://lumify.io/minimal#"
xml:base="http://lumify.io/minimal"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:lumify="http://lumify.io#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about="http://lumify.io/minimal">
<owl:imports rdf:resource="http://lumify.io"/>
</owl:Ontology>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://lumify.io/minimal#entityHasImageRaw -->
<owl:ObjectProperty rdf:about="http://lumify.io/minimal#entityHasImageRaw">
<rdfs:label xml:lang="en">Has Image</rdfs:label>
<lumify:intent>entityHasImage</lumify:intent>
<rdfs:range rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="&owl;Thing"/>
</owl:ObjectProperty>
<!-- http://lumify.io/minimal#rawContainsImageOfEntity -->
<owl:ObjectProperty rdf:about="http://lumify.io/minimal#rawContainsImageOfEntity">
<rdfs:label xml:lang="en">Contains Image of</rdfs:label>
<lumify:intent>artifactContainsImage</lumify:intent>
<lumify:intent>artifactContainsImageOfEntity</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#raw"/>
<rdfs:range rdf:resource="&owl;Thing"/>
</owl:ObjectProperty>
<!-- http://lumify.io/minimal#rawHasEntity -->
<owl:ObjectProperty rdf:about="http://lumify.io/minimal#rawHasEntity">
<rdfs:label xml:lang="en">Has Entity</rdfs:label>
<lumify:intent>artifactHasEntity</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#raw"/>
<rdfs:range rdf:resource="&owl;Thing"/>
</owl:ObjectProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Data properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://lumify.io/media#clockwiseRotation -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#clockwiseRotation">
<rdfs:label xml:lang="en">Clockwise Rotation</rdfs:label>
<lumify:intent>media.clockwiseRotation</lumify:intent>
<lumify:userVisible>false</lumify:userVisible>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:range rdf:resource="&xsd;integer"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#dateTaken -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#dateTaken">
<rdfs:label xml:lang="en">Date Taken</rdfs:label>
<lumify:intent>media.dateTaken</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#video"/>
<rdfs:range rdf:resource="&xsd;dateTime"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#deviceMake -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#deviceMake">
<rdfs:label xml:lang="en">Device Make</rdfs:label>
<lumify:intent>media.deviceMake</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#video"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#deviceModel -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#deviceModel">
<rdfs:label xml:lang="en">Device Model</rdfs:label>
<lumify:intent>media.deviceModel</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#video"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#fileSize -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#fileSize">
<rdfs:label xml:lang="en">File Size</rdfs:label>
<lumify:intent>media.fileSize</lumify:intent>
<lumify:displayType xml:lang="en">byte</lumify:displayType>
<rdfs:domain rdf:resource="http://lumify.io/minimal#audio"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#video"/>
<rdfs:range rdf:resource="&xsd;integer"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#height -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#height">
<rdfs:label xml:lang="en">Height</rdfs:label>
<lumify:intent>media.height</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#video"/>
<rdfs:range rdf:resource="&xsd;integer"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#imageHeading -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#imageHeading">
<rdfs:label xml:lang="en">Image Heading</rdfs:label>
<lumify:displayType xml:lang="en">heading</lumify:displayType>
<lumify:intent>media.imageHeading</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:range rdf:resource="&xsd;double"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#metadata -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#metadata">
<rdfs:label xml:lang="en">Metadata</rdfs:label>
<lumify:intent>media.metadata</lumify:intent>
<lumify:userVisible>false</lumify:userVisible>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#video"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#width -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#width">
<rdfs:label xml:lang="en">Width</rdfs:label>
<lumify:intent>media.width</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#video"/>
<rdfs:range rdf:resource="&xsd;integer"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/media#yAxisFlipped -->
<owl:DatatypeProperty rdf:about="http://lumify.io/media#yAxisFlipped">
<rdfs:label xml:lang="en">Y Axis Flipped</rdfs:label>
<lumify:intent>media.yAxisFlipped</lumify:intent>
<lumify:userVisible>false</lumify:userVisible>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:range rdf:resource="&xsd;boolean"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/minimal#duration -->
<owl:DatatypeProperty rdf:about="http://lumify.io/minimal#duration">
<rdfs:label xml:lang="en">Duration</rdfs:label>
<lumify:intent>media.duration</lumify:intent>
<lumify:intent>audioDuration</lumify:intent>
<lumify:intent>videoDuration</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#audio"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#video"/>
<rdfs:range rdf:resource="&xsd;double"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/minimal#geolocation -->
<owl:DatatypeProperty rdf:about="http://lumify.io/minimal#geolocation">
<rdfs:label xml:lang="en">Geolocation</rdfs:label>
<lumify:intent>geoLocation</lumify:intent>
<lumify:intent>media.geoLocation</lumify:intent>
<rdfs:range rdf:resource="&lumify;geolocation"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#image"/>
<rdfs:domain rdf:resource="http://lumify.io/minimal#location"/>
</owl:DatatypeProperty>
<!-- http://lumify.io/minimal#sentiment -->
<owl:DatatypeProperty rdf:about="http://lumify.io/minimal#sentiment">
<rdfs:label xml:lang="en">Sentiment</rdfs:label>
<lumify:intent>sentiment</lumify:intent>
<rdfs:domain rdf:resource="http://lumify.io/minimal#document"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://lumify.io/minimal#audio -->
<owl:Class rdf:about="http://lumify.io/minimal#audio">
<rdfs:label xml:lang="en">Audio</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#raw"/>
<lumify:intent>audio</lumify:intent>
<lumify:displayType xml:lang="en">audio</lumify:displayType>
<lumify:color xml:lang="en">rgb(149, 138, 218)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#city -->
<owl:Class rdf:about="http://lumify.io/minimal#city">
<rdfs:label xml:lang="en">City</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#location"/>
<lumify:intent>city</lumify:intent>
<lumify:glyphIconFileName xml:lang="en">city.png</lumify:glyphIconFileName>
<lumify:color xml:lang="en">rgb(191, 13, 191)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#contactInformation -->
<owl:Class rdf:about="http://lumify.io/minimal#contactInformation">
<rdfs:label xml:lang="en">Contact Information</rdfs:label>
<lumify:glyphIconFileName xml:lang="en">contactInformation.png</lumify:glyphIconFileName>
<lumify:color xml:lang="en">rgb(225, 128, 0)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#country -->
<owl:Class rdf:about="http://lumify.io/minimal#country">
<rdfs:label xml:lang="en">Country</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#location"/>
<lumify:intent>country</lumify:intent>
<lumify:glyphIconFileName xml:lang="en">country.png</lumify:glyphIconFileName>
<lumify:color xml:lang="en">rgb(112, 0, 112)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#document -->
<owl:Class rdf:about="http://lumify.io/minimal#document">
<rdfs:label xml:lang="en">Document</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#raw"/>
<lumify:intent>document</lumify:intent>
<lumify:displayType xml:lang="en">document</lumify:displayType>
<lumify:subtitleFormula xml:lang="en">prop('http://lumify.io#author') || '' </lumify:subtitleFormula>
<lumify:color xml:lang="en">rgb(28, 137, 28)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#emailAddress -->
<owl:Class rdf:about="http://lumify.io/minimal#emailAddress">
<rdfs:label xml:lang="en">Email Address</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#contactInformation"/>
<lumify:intent>email</lumify:intent>
<lumify:glyphIconFileName xml:lang="en">emailAddress.png</lumify:glyphIconFileName>
<lumify:color xml:lang="en">rgb(203, 130, 4)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#image -->
<owl:Class rdf:about="http://lumify.io/minimal#image">
<rdfs:label xml:lang="en">Image</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#raw"/>
<lumify:intent>entityImage</lumify:intent>
<lumify:intent>image</lumify:intent>
<lumify:displayType xml:lang="en">image</lumify:displayType>
<lumify:color xml:lang="en">rgb(176, 87, 53)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#location -->
<owl:Class rdf:about="http://lumify.io/minimal#location">
<rdfs:label xml:lang="en">Location</rdfs:label>
<lumify:intent>location</lumify:intent>
<lumify:glyphIconFileName xml:lang="en">location.png</lumify:glyphIconFileName>
<lumify:color xml:lang="en">rgb(160, 7, 206)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#organization -->
<owl:Class rdf:about="http://lumify.io/minimal#organization">
<rdfs:label xml:lang="en">Organization</rdfs:label>
<lumify:glyphIconFileName xml:lang="en">organization.png</lumify:glyphIconFileName>
<lumify:intent>organization</lumify:intent>
<lumify:subtitleFormula xml:lang="en">prop('http://lumify.io/minimal#abbreviation') ||
'' </lumify:subtitleFormula>
<lumify:timeFormula xml:lang="en">prop('http://lumify.io/minimal#formationDate') ||
'' </lumify:timeFormula>
<lumify:color xml:lang="en">rgb(137, 39, 26)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#person -->
<owl:Class rdf:about="http://lumify.io/minimal#person">
<rdfs:label xml:lang="en">Person</rdfs:label>
<lumify:intent>face</lumify:intent>
<lumify:intent>person</lumify:intent>
<lumify:glyphIconFileName xml:lang="en">person.png</lumify:glyphIconFileName>
<lumify:color xml:lang="en">rgb(28, 137, 28)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#phoneNumber -->
<owl:Class rdf:about="http://lumify.io/minimal#phoneNumber">
<rdfs:label xml:lang="en">Phone Number</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#contactInformation"/>
<lumify:intent>phoneNumber</lumify:intent>
<lumify:glyphIconFileName xml:lang="en">phoneNumber.png</lumify:glyphIconFileName>
<lumify:color xml:lang="en">rgb(225, 225, 24)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#raw -->
<owl:Class rdf:about="http://lumify.io/minimal#raw">
<rdfs:label xml:lang="en">Raw</rdfs:label>
<lumify:glyphIconFileName xml:lang="en">raw.png</lumify:glyphIconFileName>
<lumify:color xml:lang="en">rgb(28, 137, 28)</lumify:color>
</owl:Class>
<!-- http://lumify.io/minimal#state -->
<owl:Class rdf:about="http://lumify.io/minimal#state">
<rdfs:label xml:lang="en">State</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#location"/>
<lumify:color xml:lang="en">rgb(153, 0, 153)</lumify:color>
<lumify:intent>state</lumify:intent>
<lumify:glyphIconFileName xml:lang="en">state.png</lumify:glyphIconFileName>
</owl:Class>
<!-- http://lumify.io/minimal#video -->
<owl:Class rdf:about="http://lumify.io/minimal#video">
<rdfs:label xml:lang="en">Video</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#raw"/>
<lumify:intent>video</lumify:intent>
<lumify:color xml:lang="en">rgb(149, 138, 218)</lumify:color>
<lumify:displayType xml:lang="en">video</lumify:displayType>
</owl:Class>
<!-- http://lumify.io/minimal#zipCode -->
<owl:Class rdf:about="http://lumify.io/minimal#zipCode">
<rdfs:label xml:lang="en">Zip Code</rdfs:label>
<rdfs:subClassOf rdf:resource="http://lumify.io/minimal#location"/>
<lumify:glyphIconFileName xml:lang="en">zipCode.png</lumify:glyphIconFileName>
<lumify:intent>zipCode</lumify:intent>
<lumify:color xml:lang="en">rgb(219, 63, 219)</lumify:color>
</owl:Class>
</rdf:RDF>
<!-- Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net -->
| Web Ontology Language | 4 | wulinyun/lumify | examples/ontology-minimal/minimal.owl | [
"Apache-2.0"
] |
<VirtualHost *:80>
ServerName unhealthyauthor
ServerAlias ${AUTHOR_DEFAULT_HOSTNAME}
DocumentRoot /mnt/var/www/default
<Directory />
Options FollowSymLinks
AllowOverride None
# Insert filter
SetOutputFilter DEFLATE
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Directory>
<Directory "/mnt/var/www/default">
AllowOverride None
Require all granted
</Directory>
<IfModule mod_headers.c>
Header always add X-Dispatcher ${DISP_ID}
Header always add X-Vhost "unhealthy-author"
</IfModule>
<IfModule mod_rewrite.c>
ReWriteEngine on
RewriteCond %{REQUEST_URI} !^/error.html$
RewriteRule ^/* /error.html [R=301,L,NC]
</IfModule>
</VirtualHost> | ApacheConf | 4 | ChristoVP/my-test-project | dispatcher/src/conf.d/available_vhosts/000_unhealthy_author.vhost | [
"Apache-2.0"
] |
( function () {
async function OimoPhysics() {
const frameRate = 60;
const world = new OIMO.World( 2, new OIMO.Vec3( 0, - 9.8, 0 ) ); //
function getShape( geometry ) {
const parameters = geometry.parameters; // TODO change type to is*
if ( geometry.type === 'BoxGeometry' ) {
const sx = parameters.width !== undefined ? parameters.width / 2 : 0.5;
const sy = parameters.height !== undefined ? parameters.height / 2 : 0.5;
const sz = parameters.depth !== undefined ? parameters.depth / 2 : 0.5;
return new OIMO.OBoxGeometry( new OIMO.Vec3( sx, sy, sz ) );
} else if ( geometry.type === 'SphereGeometry' || geometry.type === 'IcosahedronGeometry' ) {
const radius = parameters.radius !== undefined ? parameters.radius : 1;
return new OIMO.OSphereGeometry( radius );
}
return null;
}
const meshes = [];
const meshMap = new WeakMap();
function addMesh( mesh, mass = 0 ) {
const shape = getShape( mesh.geometry );
if ( shape !== null ) {
if ( mesh.isInstancedMesh ) {
handleInstancedMesh( mesh, mass, shape );
} else if ( mesh.isMesh ) {
handleMesh( mesh, mass, shape );
}
}
}
function handleMesh( mesh, mass, shape ) {
const shapeConfig = new OIMO.ShapeConfig();
shapeConfig.geometry = shape;
const bodyConfig = new OIMO.RigidBodyConfig();
bodyConfig.type = mass === 0 ? OIMO.RigidBodyType.STATIC : OIMO.RigidBodyType.DYNAMIC;
bodyConfig.position = new OIMO.Vec3( mesh.position.x, mesh.position.y, mesh.position.z );
const body = new OIMO.RigidBody( bodyConfig );
body.addShape( new OIMO.Shape( shapeConfig ) );
world.addRigidBody( body );
if ( mass > 0 ) {
meshes.push( mesh );
meshMap.set( mesh, body );
}
}
function handleInstancedMesh( mesh, mass, shape ) {
const array = mesh.instanceMatrix.array;
const bodies = [];
for ( let i = 0; i < mesh.count; i ++ ) {
const index = i * 16;
const shapeConfig = new OIMO.ShapeConfig();
shapeConfig.geometry = shape;
const bodyConfig = new OIMO.RigidBodyConfig();
bodyConfig.type = mass === 0 ? OIMO.RigidBodyType.STATIC : OIMO.RigidBodyType.DYNAMIC;
bodyConfig.position = new OIMO.Vec3( array[ index + 12 ], array[ index + 13 ], array[ index + 14 ] );
const body = new OIMO.RigidBody( bodyConfig );
body.addShape( new OIMO.Shape( shapeConfig ) );
world.addRigidBody( body );
bodies.push( body );
}
if ( mass > 0 ) {
meshes.push( mesh );
meshMap.set( mesh, bodies );
}
} //
function setMeshPosition( mesh, position, index = 0 ) {
if ( mesh.isInstancedMesh ) {
const bodies = meshMap.get( mesh );
const body = bodies[ index ];
body.setPosition( new OIMO.Vec3( position.x, position.y, position.z ) );
} else if ( mesh.isMesh ) {
const body = meshMap.get( mesh );
body.setPosition( new OIMO.Vec3( position.x, position.y, position.z ) );
}
} //
let lastTime = 0;
function step() {
const time = performance.now();
if ( lastTime > 0 ) {
// console.time( 'world.step' );
world.step( 1 / frameRate ); // console.timeEnd( 'world.step' );
}
lastTime = time; //
for ( let i = 0, l = meshes.length; i < l; i ++ ) {
const mesh = meshes[ i ];
if ( mesh.isInstancedMesh ) {
const array = mesh.instanceMatrix.array;
const bodies = meshMap.get( mesh );
for ( let j = 0; j < bodies.length; j ++ ) {
const body = bodies[ j ];
compose( body.getPosition(), body.getOrientation(), array, j * 16 );
}
mesh.instanceMatrix.needsUpdate = true;
} else if ( mesh.isMesh ) {
const body = meshMap.get( mesh );
mesh.position.copy( body.getPosition() );
mesh.quaternion.copy( body.getOrientation() );
}
}
} // animate
setInterval( step, 1000 / frameRate );
return {
addMesh: addMesh,
setMeshPosition: setMeshPosition // addCompoundMesh
};
}
function compose( position, quaternion, array, index ) {
const x = quaternion.x,
y = quaternion.y,
z = quaternion.z,
w = quaternion.w;
const x2 = x + x,
y2 = y + y,
z2 = z + z;
const xx = x * x2,
xy = x * y2,
xz = x * z2;
const yy = y * y2,
yz = y * z2,
zz = z * z2;
const wx = w * x2,
wy = w * y2,
wz = w * z2;
array[ index + 0 ] = 1 - ( yy + zz );
array[ index + 1 ] = xy + wz;
array[ index + 2 ] = xz - wy;
array[ index + 3 ] = 0;
array[ index + 4 ] = xy - wz;
array[ index + 5 ] = 1 - ( xx + zz );
array[ index + 6 ] = yz + wx;
array[ index + 7 ] = 0;
array[ index + 8 ] = xz + wy;
array[ index + 9 ] = yz - wx;
array[ index + 10 ] = 1 - ( xx + yy );
array[ index + 11 ] = 0;
array[ index + 12 ] = position.x;
array[ index + 13 ] = position.y;
array[ index + 14 ] = position.z;
array[ index + 15 ] = 1;
}
THREE.OimoPhysics = OimoPhysics;
} )();
| JavaScript | 5 | brunnacroches/portifolio-brunna | node_modules/three/examples/js/physics/OimoPhysics.js | [
"Unlicense"
] |
$$ MODE TUSCRIPT
LOOP n=0,999999999
n=n+1
ENDLOOP
| Turing | 1 | LaudateCorpus1/RosettaCodeData | Task/Integer-sequence/TUSCRIPT/integer-sequence.tu | [
"Info-ZIP"
] |
/*
BLAKE2 reference source code package - optimized C implementations
Written in 2012 by Samuel Neves <[email protected]>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with
this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
#include <stdio.h>
#if defined(WIN32)
#include <windows.h>
#endif
#include "blake2.h"
#if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64)
#define HAVE_X86
#endif
typedef enum
{
NONE = 0,
#if defined(HAVE_X86)
SSE2 = 1,
SSSE3 = 2,
SSE41 = 3,
AVX = 4,
XOP = 5,
/* AVX2 = 6, */
#endif
} cpu_feature_t;
static const char feature_names[][8] =
{
"none",
#if defined(HAVE_X86)
"sse2",
"ssse3",
"sse41",
"avx",
"xop",
/* "avx2" */
#endif
};
#if defined(HAVE_X86)
#if defined(__GNUC__)
static inline void cpuid( uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx )
{
__asm__ __volatile__(
#if defined(__i386__) /* This is needed for -fPIC to work on i386 */
"movl %%ebx, %%esi\n\t"
#endif
"cpuid\n\t"
#if defined(__i386__)
"xchgl %%ebx, %%esi\n\t"
: "=a"( *eax ), "=S"( *ebx ), "=c"( *ecx ), "=d"( *edx ) : "a"( *eax ) );
#else
: "=a"( *eax ), "=b"( *ebx ), "=c"( *ecx ), "=d"( *edx ) : "a"( *eax ) );
#endif
}
static inline uint64_t xgetbv(uint32_t xcr)
{
uint32_t a, d;
__asm__ __volatile__(
"xgetbv"
: "=a"(a),"=d"(d)
: "c"(xcr)
);
return ((uint64_t)d << 32) | a;
}
#elif defined(_MSC_VER)
#include <intrin.h>
static inline void cpuid( uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx )
{
int regs[4];
__cpuid( regs, *eax );
*eax = regs[0];
*ebx = regs[1];
*ecx = regs[2];
*edx = regs[3];
}
#else
#error "Don't know how to call cpuid on this compiler!"
#endif
#endif /* HAVE_X86 */
static inline cpu_feature_t get_cpu_features( void )
{
#if defined(HAVE_X86)
static volatile int initialized = 0;
static cpu_feature_t feature = NONE; // Safe default
uint32_t eax, ecx, edx, ebx;
if( initialized )
return feature;
eax = 1;
cpuid( &eax, &ebx, &ecx, &edx );
if( 1 & ( edx >> 26 ) )
feature = SSE2;
if( 1 & ( ecx >> 9 ) )
feature = SSSE3;
if( 1 & ( ecx >> 19 ) )
feature = SSE41;
#if defined(WIN32) /* Work around the fact that Windows <7 does NOT support AVX... */
if( IsProcessorFeaturePresent(17) ) /* Some environments don't know about PF_XSAVE_ENABLED */
#endif
{
/* check for AVX and OSXSAVE bits */
if( 1 & ( ecx >> 28 ) & (ecx >> 27) ) {
#if !defined(WIN32) /* Already checked for this in WIN32 */
if( (xgetbv(0) & 6) == 6 ) /* XCR0 */
#endif
feature = AVX;
}
eax = 0x80000001;
cpuid( &eax, &ebx, &ecx, &edx );
if( 1 & ( ecx >> 11 ) )
feature = XOP;
}
/* For future architectures */
/*
eax = 7; ecx = 0;
cpuid(&eax, &ebx, &ecx, &edx);
if(1&(ebx >> 5))
feature = AVX2;
*/
/* fprintf( stderr, "Using %s engine\n", feature_names[feature] ); */
initialized = 1;
return feature;
#else
return NONE;
#endif
}
#if defined(__cplusplus)
extern "C" {
#endif
int blake2b_init_ref( blake2b_state *S, size_t outlen );
int blake2b_init_key_ref( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
int blake2b_init_param_ref( blake2b_state *S, const blake2b_param *P );
int blake2b_update_ref( blake2b_state *S, const uint8_t *in, size_t inlen );
int blake2b_final_ref( blake2b_state *S, uint8_t *out, size_t outlen );
int blake2b_ref( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
#if defined(HAVE_X86)
int blake2b_init_sse2( blake2b_state *S, size_t outlen );
int blake2b_init_key_sse2( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
int blake2b_init_param_sse2( blake2b_state *S, const blake2b_param *P );
int blake2b_update_sse2( blake2b_state *S, const uint8_t *in, size_t inlen );
int blake2b_final_sse2( blake2b_state *S, uint8_t *out, size_t outlen );
int blake2b_sse2( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2b_init_ssse3( blake2b_state *S, size_t outlen );
int blake2b_init_key_ssse3( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
int blake2b_init_param_ssse3( blake2b_state *S, const blake2b_param *P );
int blake2b_update_ssse3( blake2b_state *S, const uint8_t *in, size_t inlen );
int blake2b_final_ssse3( blake2b_state *S, uint8_t *out, size_t outlen );
int blake2b_ssse3( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2b_init_sse41( blake2b_state *S, size_t outlen );
int blake2b_init_key_sse41( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
int blake2b_init_param_sse41( blake2b_state *S, const blake2b_param *P );
int blake2b_update_sse41( blake2b_state *S, const uint8_t *in, size_t inlen );
int blake2b_final_sse41( blake2b_state *S, uint8_t *out, size_t outlen );
int blake2b_sse41( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2b_init_avx( blake2b_state *S, size_t outlen );
int blake2b_init_key_avx( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
int blake2b_init_param_avx( blake2b_state *S, const blake2b_param *P );
int blake2b_update_avx( blake2b_state *S, const uint8_t *in, size_t inlen );
int blake2b_final_avx( blake2b_state *S, uint8_t *out, size_t outlen );
int blake2b_avx( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2b_init_xop( blake2b_state *S, size_t outlen );
int blake2b_init_key_xop( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
int blake2b_init_param_xop( blake2b_state *S, const blake2b_param *P );
int blake2b_update_xop( blake2b_state *S, const uint8_t *in, size_t inlen );
int blake2b_final_xop( blake2b_state *S, uint8_t *out, size_t outlen );
int blake2b_xop( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
#endif /* HAVE_X86 */
int blake2s_init_ref( blake2s_state *S, size_t outlen );
int blake2s_init_key_ref( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
int blake2s_init_param_ref( blake2s_state *S, const blake2s_param *P );
int blake2s_update_ref( blake2s_state *S, const uint8_t *in, size_t inlen );
int blake2s_final_ref( blake2s_state *S, uint8_t *out, size_t outlen );
int blake2s_ref( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
#if defined(HAVE_X86)
int blake2s_init_sse2( blake2s_state *S, size_t outlen );
int blake2s_init_key_sse2( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
int blake2s_init_param_sse2( blake2s_state *S, const blake2s_param *P );
int blake2s_update_sse2( blake2s_state *S, const uint8_t *in, size_t inlen );
int blake2s_final_sse2( blake2s_state *S, uint8_t *out, size_t outlen );
int blake2s_sse2( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2s_init_ssse3( blake2s_state *S, size_t outlen );
int blake2s_init_key_ssse3( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
int blake2s_init_param_ssse3( blake2s_state *S, const blake2s_param *P );
int blake2s_update_ssse3( blake2s_state *S, const uint8_t *in, size_t inlen );
int blake2s_final_ssse3( blake2s_state *S, uint8_t *out, size_t outlen );
int blake2s_ssse3( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2s_init_sse41( blake2s_state *S, size_t outlen );
int blake2s_init_key_sse41( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
int blake2s_init_param_sse41( blake2s_state *S, const blake2s_param *P );
int blake2s_update_sse41( blake2s_state *S, const uint8_t *in, size_t inlen );
int blake2s_final_sse41( blake2s_state *S, uint8_t *out, size_t outlen );
int blake2s_sse41( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2s_init_avx( blake2s_state *S, size_t outlen );
int blake2s_init_key_avx( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
int blake2s_init_param_avx( blake2s_state *S, const blake2s_param *P );
int blake2s_update_avx( blake2s_state *S, const uint8_t *in, size_t inlen );
int blake2s_final_avx( blake2s_state *S, uint8_t *out, size_t outlen );
int blake2s_avx( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2s_init_xop( blake2s_state *S, size_t outlen );
int blake2s_init_key_xop( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
int blake2s_init_param_xop( blake2s_state *S, const blake2s_param *P );
int blake2s_update_xop( blake2s_state *S, const uint8_t *in, size_t inlen );
int blake2s_final_xop( blake2s_state *S, uint8_t *out, size_t outlen );
int blake2s_xop( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
#endif /* HAVE_X86 */
#if defined(__cplusplus)
}
#endif
typedef int ( *blake2b_init_fn )( blake2b_state *, size_t );
typedef int ( *blake2b_init_key_fn )( blake2b_state *, size_t, const void *, size_t );
typedef int ( *blake2b_init_param_fn )( blake2b_state *, const blake2b_param * );
typedef int ( *blake2b_update_fn )( blake2b_state *, const uint8_t *, size_t );
typedef int ( *blake2b_final_fn )( blake2b_state *, uint8_t *, size_t );
typedef int ( *blake2b_fn )( uint8_t *, const void *, const void *, size_t, size_t, size_t );
typedef int ( *blake2s_init_fn )( blake2s_state *, size_t );
typedef int ( *blake2s_init_key_fn )( blake2s_state *, size_t, const void *, size_t );
typedef int ( *blake2s_init_param_fn )( blake2s_state *, const blake2s_param * );
typedef int ( *blake2s_update_fn )( blake2s_state *, const uint8_t *, size_t );
typedef int ( *blake2s_final_fn )( blake2s_state *, uint8_t *, size_t );
typedef int ( *blake2s_fn )( uint8_t *, const void *, const void *, size_t, size_t, size_t );
static const blake2b_init_fn blake2b_init_table[] =
{
blake2b_init_ref,
#if defined(HAVE_X86)
blake2b_init_sse2,
blake2b_init_ssse3,
blake2b_init_sse41,
blake2b_init_avx,
blake2b_init_xop
#endif
};
static const blake2b_init_key_fn blake2b_init_key_table[] =
{
blake2b_init_key_ref,
#if defined(HAVE_X86)
blake2b_init_key_sse2,
blake2b_init_key_ssse3,
blake2b_init_key_sse41,
blake2b_init_key_avx,
blake2b_init_key_xop
#endif
};
static const blake2b_init_param_fn blake2b_init_param_table[] =
{
blake2b_init_param_ref,
#if defined(HAVE_X86)
blake2b_init_param_sse2,
blake2b_init_param_ssse3,
blake2b_init_param_sse41,
blake2b_init_param_avx,
blake2b_init_param_xop
#endif
};
static const blake2b_update_fn blake2b_update_table[] =
{
blake2b_update_ref,
#if defined(HAVE_X86)
blake2b_update_sse2,
blake2b_update_ssse3,
blake2b_update_sse41,
blake2b_update_avx,
blake2b_update_xop
#endif
};
static const blake2b_final_fn blake2b_final_table[] =
{
blake2b_final_ref,
#if defined(HAVE_X86)
blake2b_final_sse2,
blake2b_final_ssse3,
blake2b_final_sse41,
blake2b_final_avx,
blake2b_final_xop
#endif
};
static const blake2b_fn blake2b_table[] =
{
blake2b_ref,
#if defined(HAVE_X86)
blake2b_sse2,
blake2b_ssse3,
blake2b_sse41,
blake2b_avx,
blake2b_xop
#endif
};
static const blake2s_init_fn blake2s_init_table[] =
{
blake2s_init_ref,
#if defined(HAVE_X86)
blake2s_init_sse2,
blake2s_init_ssse3,
blake2s_init_sse41,
blake2s_init_avx,
blake2s_init_xop
#endif
};
static const blake2s_init_key_fn blake2s_init_key_table[] =
{
blake2s_init_key_ref,
#if defined(HAVE_X86)
blake2s_init_key_sse2,
blake2s_init_key_ssse3,
blake2s_init_key_sse41,
blake2s_init_key_avx,
blake2s_init_key_xop
#endif
};
static const blake2s_init_param_fn blake2s_init_param_table[] =
{
blake2s_init_param_ref,
#if defined(HAVE_X86)
blake2s_init_param_sse2,
blake2s_init_param_ssse3,
blake2s_init_param_sse41,
blake2s_init_param_avx,
blake2s_init_param_xop
#endif
};
static const blake2s_update_fn blake2s_update_table[] =
{
blake2s_update_ref,
#if defined(HAVE_X86)
blake2s_update_sse2,
blake2s_update_ssse3,
blake2s_update_sse41,
blake2s_update_avx,
blake2s_update_xop
#endif
};
static const blake2s_final_fn blake2s_final_table[] =
{
blake2s_final_ref,
#if defined(HAVE_X86)
blake2s_final_sse2,
blake2s_final_ssse3,
blake2s_final_sse41,
blake2s_final_avx,
blake2s_final_xop
#endif
};
static const blake2s_fn blake2s_table[] =
{
blake2s_ref,
#if defined(HAVE_X86)
blake2s_sse2,
blake2s_ssse3,
blake2s_sse41,
blake2s_avx,
blake2s_xop
#endif
};
#if defined(__cplusplus)
extern "C" {
#endif
int blake2b_init_dispatch( blake2b_state *S, size_t outlen );
int blake2b_init_key_dispatch( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
int blake2b_init_param_dispatch( blake2b_state *S, const blake2b_param *P );
int blake2b_update_dispatch( blake2b_state *S, const uint8_t *in, size_t inlen );
int blake2b_final_dispatch( blake2b_state *S, uint8_t *out, size_t outlen );
int blake2b_dispatch( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
int blake2s_init_dispatch( blake2s_state *S, size_t outlen );
int blake2s_init_key_dispatch( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
int blake2s_init_param_dispatch( blake2s_state *S, const blake2s_param *P );
int blake2s_update_dispatch( blake2s_state *S, const uint8_t *in, size_t inlen );
int blake2s_final_dispatch( blake2s_state *S, uint8_t *out, size_t outlen );
int blake2s_dispatch( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
#if defined(__cplusplus)
}
#endif
static blake2b_init_fn blake2b_init_ptr = blake2b_init_dispatch;
static blake2b_init_key_fn blake2b_init_key_ptr = blake2b_init_key_dispatch;
static blake2b_init_param_fn blake2b_init_param_ptr = blake2b_init_param_dispatch;
static blake2b_update_fn blake2b_update_ptr = blake2b_update_dispatch;
static blake2b_final_fn blake2b_final_ptr = blake2b_final_dispatch;
static blake2b_fn blake2b_ptr = blake2b_dispatch;
static blake2s_init_fn blake2s_init_ptr = blake2s_init_dispatch;
static blake2s_init_key_fn blake2s_init_key_ptr = blake2s_init_key_dispatch;
static blake2s_init_param_fn blake2s_init_param_ptr = blake2s_init_param_dispatch;
static blake2s_update_fn blake2s_update_ptr = blake2s_update_dispatch;
static blake2s_final_fn blake2s_final_ptr = blake2s_final_dispatch;
static blake2s_fn blake2s_ptr = blake2s_dispatch;
int blake2b_init_dispatch( blake2b_state *S, size_t outlen )
{
blake2b_init_ptr = blake2b_init_table[get_cpu_features()];
return blake2b_init_ptr( S, outlen );
}
int blake2b_init_key_dispatch( blake2b_state *S, size_t outlen, const void *key, size_t keylen )
{
blake2b_init_key_ptr = blake2b_init_key_table[get_cpu_features()];
return blake2b_init_key_ptr( S, outlen, key, keylen );
}
int blake2b_init_param_dispatch( blake2b_state *S, const blake2b_param *P )
{
blake2b_init_param_ptr = blake2b_init_param_table[get_cpu_features()];
return blake2b_init_param_ptr( S, P );
}
int blake2b_update_dispatch( blake2b_state *S, const uint8_t *in, size_t inlen )
{
blake2b_update_ptr = blake2b_update_table[get_cpu_features()];
return blake2b_update_ptr( S, in, inlen );
}
int blake2b_final_dispatch( blake2b_state *S, uint8_t *out, size_t outlen )
{
blake2b_final_ptr = blake2b_final_table[get_cpu_features()];
return blake2b_final_ptr( S, out, outlen );
}
int blake2b_dispatch( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
{
blake2b_ptr = blake2b_table[get_cpu_features()];
return blake2b_ptr( out, in, key, outlen, inlen, keylen );
}
BLAKE2_API int blake2b_init( blake2b_state *S, size_t outlen )
{
return blake2b_init_ptr( S, outlen );
}
BLAKE2_API int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen )
{
return blake2b_init_key_ptr( S, outlen, key, keylen );
}
BLAKE2_API int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
{
return blake2b_init_param_ptr( S, P );
}
BLAKE2_API int blake2b_update( blake2b_state *S, const uint8_t *in, size_t inlen )
{
return blake2b_update_ptr( S, in, inlen );
}
BLAKE2_API int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen )
{
return blake2b_final_ptr( S, out, outlen );
}
BLAKE2_API int blake2b( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
{
return blake2b_ptr( out, in, key, outlen, inlen, keylen );
}
int blake2s_init_dispatch( blake2s_state *S, size_t outlen )
{
blake2s_init_ptr = blake2s_init_table[get_cpu_features()];
return blake2s_init_ptr( S, outlen );
}
int blake2s_init_key_dispatch( blake2s_state *S, size_t outlen, const void *key, size_t keylen )
{
blake2s_init_key_ptr = blake2s_init_key_table[get_cpu_features()];
return blake2s_init_key_ptr( S, outlen, key, keylen );
}
int blake2s_init_param_dispatch( blake2s_state *S, const blake2s_param *P )
{
blake2s_init_param_ptr = blake2s_init_param_table[get_cpu_features()];
return blake2s_init_param_ptr( S, P );
}
int blake2s_update_dispatch( blake2s_state *S, const uint8_t *in, size_t inlen )
{
blake2s_update_ptr = blake2s_update_table[get_cpu_features()];
return blake2s_update_ptr( S, in, inlen );
}
int blake2s_final_dispatch( blake2s_state *S, uint8_t *out, size_t outlen )
{
blake2s_final_ptr = blake2s_final_table[get_cpu_features()];
return blake2s_final_ptr( S, out, outlen );
}
int blake2s_dispatch( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
{
blake2s_ptr = blake2s_table[get_cpu_features()];
return blake2s_ptr( out, in, key, outlen, inlen, keylen );
}
BLAKE2_API int blake2s_init( blake2s_state *S, size_t outlen )
{
return blake2s_init_ptr( S, outlen );
}
BLAKE2_API int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen )
{
return blake2s_init_key_ptr( S, outlen, key, keylen );
}
BLAKE2_API int blake2s_init_param( blake2s_state *S, const blake2s_param *P )
{
return blake2s_init_param_ptr( S, P );
}
BLAKE2_API int blake2s_update( blake2s_state *S, const uint8_t *in, size_t inlen )
{
return blake2s_update_ptr( S, in, inlen );
}
BLAKE2_API int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen )
{
return blake2s_final_ptr( S, out, outlen );
}
BLAKE2_API int blake2s( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
{
return blake2s_ptr( out, in, key, outlen, inlen, keylen );
}
| C | 4 | shawwn/cpython | Modules/_blake2/impl/blake2-dispatch.c | [
"0BSD"
] |
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.js.sourceMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.Reader;
import java.util.function.Supplier;
public interface SourceMapMappingConsumer {
void newLine();
void addMapping(
@NotNull String source, @Nullable Object sourceIdentity, @NotNull Supplier<Reader> sourceSupplier,
int sourceLine, int sourceColumn
);
void addEmptyMapping();
}
| Java | 4 | Mu-L/kotlin | js/js.sourcemap/src/org/jetbrains/kotlin/js/sourceMap/SourceMapMappingConsumer.java | [
"ECL-2.0",
"Apache-2.0"
] |
@app
mockapp
@events
ping
@http
get /foo
| Arc | 2 | defionscode/sandbox | test/mock/no-index-pass/.arc | [
"Apache-2.0"
] |
#%RAML 1.0 Trait
displayName: Paged
description: |
Apply pagination to the API endpoint. Use page token to pass a cursor to the external app to simplify pagination.
queryParameters:
nextPageToken?:
type: string
description: |
List response may contain this parameter pointing to the next results page. All other query parameteres must be the same as for a previous request or the page token will be revalidated.
The nextPageToken will honor `limit` parameter but will discard `start` parameter. So use `start` with `nextPageToken` is redundant.
default: none
limit?:
type: number
default: 50
description: |
Limit the number of items in the response.
start?:
type: number
default: 0
description: |
Omnit N first results from the list and return rest of the results respecting `limit` value.
Use of this property with `nextPageToken` is redundant.
| RAML | 4 | Acidburn0zzz/ChromeRestClient | Server API/traits/paged.raml | [
"Apache-2.0"
] |
#![crate_type = foo!()] //~ ERROR malformed `crate_type` attribute
macro_rules! foo {
() => {"rlib"};
}
fn main() {}
| Rust | 3 | ohno418/rust | src/test/ui/invalid/invalid-crate-type-macro.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
/*
graphviz dot file that renders the Thrift Decoder state machine.
Rendered via: dot -Tsvg -o thrift_state_machine.svg thrift_state_machine.dot
*/
digraph {
{
rank = same;
Start;
MessageBegin;
MessageEnd;
Done;
};
{
rank = same;
StructBegin;
StructEnd;
};
{
rank = same;
FieldBegin;
FieldEnd;
};
{
rank = same;
Value;
};
{
rank = same;
ListBegin;
ListEnd;
MapBegin;
MapEnd;
SetBegin;
SetEnd;
StructValueBegin;
StructValueEnd;
};
{
rank = same;
StructValueFieldBegin;
StructValueFieldEnd;
};
Start -> MessageBegin;
MessageBegin -> StructBegin;
StructBegin -> FieldBegin;
FieldBegin -> Value;
FieldBegin -> StructEnd;
Value -> FieldEnd;
FieldEnd -> FieldBegin;
StructEnd -> MessageEnd;
MessageEnd -> Done;
ListValue [label="Value"];
Value -> ListBegin;
ListBegin -> ListValue;
ListValue -> ListValue [label="size"];
ListValue -> ListEnd;
ListEnd -> Value;
MapKeyValue [label="Key (Value)"];
MapValueValue [label="Value"];
Value -> MapBegin;
MapBegin -> MapKeyValue;
MapKeyValue:sw -> MapValueValue:nw;
MapKeyValue -> MapEnd;
MapValueValue:ne -> MapKeyValue:se [label="size"];
MapEnd -> Value;
SetValue [label="Value"];
Value -> SetBegin;
SetBegin -> SetValue;
SetValue -> SetValue [label="size"];
SetValue -> SetEnd;
SetEnd -> Value;
StructValueBegin [label="StructBegin"];
StructValueEnd [label="StructEnd"];
StructValueFieldBegin [label="FieldBegin"];
StructValueFieldEnd [label="FieldEnd"];
StructValueValue [label="Value"];
Value -> StructValueBegin;
StructValueBegin -> StructValueFieldBegin;
StructValueFieldBegin -> StructValueValue;
StructValueFieldBegin -> StructValueEnd;
StructValueValue -> StructValueFieldEnd;
StructValueFieldEnd -> StructValueFieldBegin;
StructValueEnd -> Value;
graph [label="Thrift Decoder State Machine.\n\nStates appear in multiple locations to simplify the graph of transitions."];
Start [style=filled, fillcolor="#cccccc"];
Done [style=filled, fillcolor="#cccccc"];
/* force ordering within ranks */
MessageBegin -> MessageEnd [style=invis];
StructBegin -> StructEnd [style=invis];
FieldBegin -> FieldEnd [style=invis];
ListBegin -> ListEnd -> MapBegin -> MapEnd -> SetBegin -> SetEnd -> StructValueBegin ->
StructValueEnd [style=invis];
StructValueFieldBegin -> StructValueFieldEnd [style=invis];
}
| Graphviz (DOT) | 5 | dcillera/envoy | source/extensions/filters/network/thrift_proxy/docs/thrift_state_machine.dot | [
"Apache-2.0"
] |
<!DOCTYPE html>
<html>
<head>
<script src="../module-test-files/Car.js"></script>
<script src="../module-test-files/shirt.js"></script>
<script src="../file1.js"></script>
<script src="../file3.js"></script>
<!-- leave follow empty line for later file including -->
<script>
var txt="";
fun測试();
frenchçProp();
nonAsciiTest(); // in quick editor, test jump, function type, code hint list
myTest();
callOtherMethods();
</script>
<script>
function myTest(){
monthName = "test";
simple1();
}
function simple1(){
}
</script>
</head>
<body>
<input type="button" value="View message" onclick="message()">
</body>
</html> | HTML | 1 | ravitejavalluri/brackets | src/extensions/default/JavaScriptCodeHints/unittest-files/basic-test-files/test.html | [
"MIT"
] |
- view: _opportunity
sql_table_name: salesforce._opportunity
fields:
# dimensions #
- dimension: id
primary_key: true
type: string
sql: ${TABLE}.id
- dimension: account_id
type: string
hidden: true
sql: ${TABLE}.account_id
- dimension: amount
type: number
sql: ${TABLE}.amount
- dimension: campaign_id
type: string
hidden: true
sql: ${TABLE}.campaign_id
- dimension_group: close
type: time
timeframes: [date, week, month]
convert_tz: false
sql: ${TABLE}.close_date
- dimension: created_by_id
type: string
hidden: true
sql: ${TABLE}.created_by_id
- dimension_group: created
type: time
timeframes: [date, week, month]
sql: ${TABLE}.created_date
- dimension: description
type: string
sql: ${TABLE}.description
- dimension: fiscal
type: string
sql: ${TABLE}.fiscal
- dimension: fiscal_quarter
type: number
sql: ${TABLE}.fiscal_quarter
- dimension: fiscal_year
type: number
sql: ${TABLE}.fiscal_year
- dimension: forecast_category
type: string
sql: ${TABLE}.forecast_category
- dimension: forecast_category_name
type: string
sql: ${TABLE}.forecast_category_name
- dimension: has_opportunity_line_item
type: yesno
sql: ${TABLE}.has_opportunity_line_item
- dimension: is_closed
type: yesno
sql: ${TABLE}.is_closed
- dimension: is_deleted
type: yesno
sql: ${TABLE}.is_deleted
- dimension: is_won
type: yesno
sql: ${TABLE}.is_won
- dimension_group: last_activity
type: time
timeframes: [date, week, month]
convert_tz: false
sql: ${TABLE}.last_activity_date
- dimension: last_modified_by_id
type: string
hidden: true
sql: ${TABLE}.last_modified_by_id
- dimension_group: last_modified
type: time
timeframes: [date, week, month]
sql: ${TABLE}.last_modified_date
- dimension_group: last_referenced
type: time
timeframes: [date, week, month]
sql: ${TABLE}.last_referenced_date
- dimension_group: last_viewed
type: time
timeframes: [date, week, month]
sql: ${TABLE}.last_viewed_date
- dimension: lead_source
type: string
sql: ${TABLE}.lead_source
- dimension: name
type: string
sql: ${TABLE}.name
- dimension: owner_id
type: string
hidden: true
sql: ${TABLE}.owner_id
- dimension: pricebook_2_id
type: string
hidden: true
sql: ${TABLE}.pricebook_2_id
- dimension: probability
type: number
sql: ${TABLE}.probability
- dimension: stage_name
type: string
sql: ${TABLE}.stage_name
- dimension: synced_quote_id
type: string
hidden: true
sql: ${TABLE}.synced_quote_id
- dimension_group: system_modstamp
type: time
timeframes: [date, week, month]
sql: ${TABLE}.system_modstamp
- dimension: type
type: string
sql: ${TABLE}.type
# measures #
- measure: count
type: count
drill_fields: [id, name, stage_name, forecast_category_name] | LookML | 4 | rsharma03/blocks_salesforce | submodules/opportunity_snapshot/_opportunity.view.lookml | [
"MIT"
] |
output "worker_ips" {
value = join(",", aws_instance.worker.*.public_ip)
}
| HCL | 2 | ursinnDev/rancher_rancher | tests/validation/tests/v3_api/resource/terraform/rke2/worker/outputs.tf | [
"Apache-2.0"
] |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/CrossChainEnabled.sol)
pragma solidity ^0.8.4;
import "./errors.sol";
/**
* @dev Provides information for building cross-chain aware contracts. This
* abstract contract provides accessors and modifiers to control the execution
* flow when receiving cross-chain messages.
*
* Actual implementations of cross-chain aware contracts, which are based on
* this abstraction, will have to inherit from a bridge-specific
* specialization. Such specializations are provided under
* `crosschain/<chain>/CrossChainEnabled<chain>.sol`.
*
* _Available since v4.6._
*/
abstract contract CrossChainEnabled {
/**
* @dev Throws if the current function call is not the result of a
* cross-chain execution.
*/
modifier onlyCrossChain() {
if (!_isCrossChain()) revert NotCrossChainCall();
_;
}
/**
* @dev Throws if the current function call is not the result of a
* cross-chain execution initiated by `account`.
*/
modifier onlyCrossChainSender(address expected) {
address actual = _crossChainSender();
if (expected != actual) revert InvalidCrossChainSender(actual, expected);
_;
}
/**
* @dev Returns whether the current function call is the result of a
* cross-chain message.
*/
function _isCrossChain() internal view virtual returns (bool);
/**
* @dev Returns the address of the sender of the cross-chain message that
* triggered the current function call.
*
* IMPORTANT: Should revert with `NotCrossChainCall` if the current function
* call is not the result of a cross-chain message.
*/
function _crossChainSender() internal view virtual returns (address);
}
| Solidity | 5 | ScopeLift/openzeppelin-contracts | contracts/crosschain/CrossChainEnabled.sol | [
"MIT"
] |
#include "caffe2/operators/mod_op.h"
#include "caffe2/core/context_gpu.h"
namespace caffe2 {
namespace {
template <typename T>
__global__ void ModOpSimpleKernel(const int N, const int64_t divisor_,
const T* data_ptr, T* output_ptr) {
CUDA_1D_KERNEL_LOOP(i, N) {
output_ptr[i] = data_ptr[i] % divisor_;
}
}
template <typename T>
__global__ void ModOpKernel(const int N, const int64_t divisor_,
const T* data_ptr, T* output_ptr) {
CUDA_1D_KERNEL_LOOP(i, N) {
output_ptr[i] = data_ptr[i] % divisor_;
if (output_ptr[i] && ((output_ptr[i] > 0) != (divisor_ > 0))) {
output_ptr[i] += divisor_;
}
}
}
} // namespace
template <>
template <typename T>
bool ModOp<CUDAContext>::DoRunWithType() {
auto& data = Input(DATA);
auto N = data.numel();
const auto* data_ptr = data.template data<T>();
auto* output = Output(0, data.sizes(), at::dtype<T>());
auto* output_ptr = output->template mutable_data<T>();
if (sign_follow_divisor_) {
ModOpKernel<<<
CAFFE_GET_BLOCKS(N),
CAFFE_CUDA_NUM_THREADS,
0,
context_.cuda_stream()>>>(
N, divisor_, data_ptr, output_ptr);
C10_CUDA_KERNEL_LAUNCH_CHECK();
} else {
ModOpSimpleKernel<<<
CAFFE_GET_BLOCKS(N),
CAFFE_CUDA_NUM_THREADS,
0,
context_.cuda_stream()>>>(
N, divisor_, data_ptr, output_ptr);
C10_CUDA_KERNEL_LAUNCH_CHECK();
}
return true;
}
REGISTER_CUDA_OPERATOR(Mod, ModOp<CUDAContext>);
} // namespace caffe2
| Cuda | 4 | Hacky-DH/pytorch | caffe2/operators/mod_op.cu | [
"Intel"
] |
^FX module: HelloWorld
^FX date: 2014/12/26
^FX descr: Simple hello world program in Extended ZPL
^FO20,10
^ADN90,50,N
^FDHello World!
^FS | Zimpl | 3 | haskellcamargo/ExtendedZPL | zpl/output.zpl | [
"MIT"
] |
-- A library that can be used in custom lua scripts for benchmarking
local _M = {}
local json = require "cjson"
local os = require "os"
-- Use `null` to represent any NaN or Inf:
json.encode_invalid_numbers("null")
function _M.init(args)
local query = args[1]
return json.encode({query=query}), args[2], args[3], args[4]
end
function _M.request(wrk, req_body, auth_header_key, auth_header_value)
wrk.method = "POST"
wrk.headers["Content-Type"] = "application/json"
if auth_header_key ~= nil and auth_header_value ~= nil then
wrk.headers[auth_header_key] = auth_header_value
end
wrk.body = req_body
return wrk.format()
end
local function get_stat_summary(stat)
local dist = {}
for _, p in pairs({ 95, 98, 99 }) do
dist[tostring(p)] = stat:percentile(p)
end
return {
min=stat.min,
max=stat.max,
stdev=stat.stdev,
mean=stat.mean,
dist=dist
}
end
local function getTime()
return os.date("%c %Z")
end
function _M.done(summary, latency, requests, results_dir)
local summary_file = io.open(results_dir .. '/summary.json','w')
local summary_output = json.encode({
time=getTime(),
latency=get_stat_summary(latency),
summary=summary,
requests=get_stat_summary(requests)
})
io.stderr:write(summary_output)
summary_file:write(summary_output .. '\n')
summary_file:close()
latencies_file = io.open(results_dir .. '/latencies','w')
for i = 1, summary.requests do
if (latency[i] ~= 0)
then
latencies_file:write(latency[i] .. '\n')
end
end
latencies_file:close()
end
return _M
| Lua | 5 | gh-oss-contributor/graphql-engine-1 | server/bench-wrk/wrk-websocket-server/bench_scripts/bench-lib-wrk2.lua | [
"Apache-2.0",
"MIT"
] |
exec("swigtest.start", -1);
nums = new_Nums();
// In overloading in Scilab, double has priority over all other numeric types
checkequal(Nums_over(nums, 0), "double", "Nums_over(nums, 0)");
// Just checkequal if the following are accepted without exceptions being thrown
Nums_doublebounce(nums, %inf);
Nums_doublebounce(nums, -%inf);
Nums_doublebounce(nums, %nan);
delete_Nums(nums);
exec("swigtest.quit", -1);
| Scilab | 4 | kyletanyag/LL-Smartcard | cacreader/swig-4.0.2/Examples/test-suite/scilab/overload_numeric_runme.sci | [
"BSD-3-Clause"
] |
// run
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Check closure in const declaration group can be compiled
// and set correct value
package main
import "unsafe"
const (
x = unsafe.Sizeof(func() {})
y
)
func main() {
const (
z = unsafe.Sizeof(func() {})
t
)
// x and y must be equal
println(x == y)
// size must be greater than zero
println(y > 0)
// Same logic as x, y above
println(z == t)
println(t > 0)
}
| Go | 3 | SSSDNSY/go | test/fixedbugs/issue30709.go | [
"BSD-3-Clause"
] |
REVERSE
;Take in a string and reverse it using the built in function $REVERSE
NEW S
READ:30 "Enter a string: ",S
WRITE !,$REVERSE(S)
QUIT
| M | 4 | LaudateCorpus1/RosettaCodeData | Task/Reverse-a-string/MUMPS/reverse-a-string.mumps | [
"Info-ZIP"
] |
#include "metrics/stats_reporter.h"
#include "util/streaming_logging.h"
namespace ray {
namespace streaming {
std::shared_ptr<ray::stats::Metric> StatsReporter::GetMetricByName(
const std::string &metric_name) {
std::unique_lock<std::mutex> lock(metric_mutex_);
auto metric = metric_map_.find(metric_name);
if (metric != metric_map_.end()) {
return metric->second;
}
return nullptr;
}
void StatsReporter::MetricRegister(const std::string &metric_name,
std::shared_ptr<ray::stats::Metric> metric) {
std::unique_lock<std::mutex> lock(metric_mutex_);
metric_map_[metric_name] = metric;
}
void StatsReporter::UnregisterAllMetrics() {
std::unique_lock<std::mutex> lock(metric_mutex_);
metric_map_.clear();
}
bool StatsReporter::Start(const StreamingMetricsConfig &conf) {
global_tags_ = conf.GetMetricsGlobalTags();
service_name_ = conf.GetMetricsServiceName();
STREAMING_LOG(INFO) << "Start stats reporter, service name " << service_name_
<< ", global tags size : " << global_tags_.size()
<< ", stats disabled : "
<< stats::StatsConfig::instance().IsStatsDisabled();
for (auto &tag : global_tags_) {
global_tag_key_list_.push_back(stats::TagKeyType::Register(tag.first));
}
return true;
}
bool StatsReporter::Start(const std::string &json_string) { return true; }
StatsReporter::~StatsReporter() {
STREAMING_LOG(WARNING) << "stats client shutdown";
Shutdown();
};
void StatsReporter::Shutdown() { UnregisterAllMetrics(); }
void StatsReporter::UpdateCounter(const std::string &domain,
const std::string &group_name,
const std::string &short_name, double value) {
const std::string merged_metric_name =
METRIC_GROUP_JOIN(domain, group_name, short_name);
}
void StatsReporter::UpdateCounter(
const std::string &metric_name,
const std::unordered_map<std::string, std::string> &tags, double value) {
STREAMING_LOG(DEBUG) << "Report counter metric " << metric_name << " , value " << value;
}
void StatsReporter::UpdateGauge(const std::string &domain, const std::string &group_name,
const std::string &short_name, double value,
bool is_reset) {
const std::string merged_metric_name =
service_name_ + "." + METRIC_GROUP_JOIN(domain, group_name, short_name);
STREAMING_LOG(DEBUG) << "Report gauge metric " << merged_metric_name << " , value "
<< value;
auto metric = GetMetricByName(merged_metric_name);
if (nullptr == metric) {
metric = std::shared_ptr<ray::stats::Metric>(
new ray::stats::Gauge(merged_metric_name, "", "", global_tag_key_list_));
MetricRegister(merged_metric_name, metric);
}
metric->Record(value, global_tags_);
}
void StatsReporter::UpdateGauge(const std::string &metric_name,
const std::unordered_map<std::string, std::string> &tags,
double value, bool is_reset) {
const std::string merged_metric_name = service_name_ + "." + metric_name;
STREAMING_LOG(DEBUG) << "Report gauge metric " << merged_metric_name << " , value "
<< value;
// Get metric from registered map, create a new one item if no such metric can be found
// in map.
auto metric = GetMetricByName(metric_name);
if (nullptr == metric) {
// Register tag key for all tags.
std::vector<stats::TagKeyType> tag_key_list(global_tag_key_list_.begin(),
global_tag_key_list_.end());
for (auto &tag : tags) {
tag_key_list.push_back(stats::TagKeyType::Register(tag.first));
}
metric = std::shared_ptr<ray::stats::Metric>(
new ray::stats::Gauge(merged_metric_name, "", "", tag_key_list));
MetricRegister(merged_metric_name, metric);
}
auto merged_tags = MergeGlobalTags(tags);
metric->Record(value, merged_tags);
}
void StatsReporter::UpdateHistogram(const std::string &domain,
const std::string &group_name,
const std::string &short_name, double value,
double min_value, double max_value) {}
void StatsReporter::UpdateHistogram(
const std::string &metric_name,
const std::unordered_map<std::string, std::string> &tags, double value,
double min_value, double max_value) {}
void StatsReporter::UpdateQPS(const std::string &metric_name,
const std::unordered_map<std::string, std::string> &tags,
double value) {}
} // namespace streaming
} // namespace ray
| C++ | 4 | linyiyue/ray | streaming/src/metrics/stats_reporter.cc | [
"Apache-2.0"
] |
multi sub next(\x --> Nil) { THROW(nqp::const::CONTROL_NEXT, x) }
multi sub last(\x --> Nil) { THROW(nqp::const::CONTROL_LAST, x) }
# vim: expandtab shiftwidth=4
| Perl6 | 3 | raydiak/rakudo | src/core.e/control.pm6 | [
"Artistic-2.0"
] |
function handler () {
echo "Custom Runtime Lambda handler executing." 1>&2;
EVENT_DATA=$1
echo "$EVENT_DATA" 1>&2;
RESPONSE="Echoing request: '$EVENT_DATA'"
echo $RESPONSE
}
| Shell | 4 | matt-mercer/localstack | tests/integration/awslambda/functions/custom-runtime/function.sh | [
"Apache-2.0"
] |
' Module trans.astranslator
'
' Placed into the public domain 24/02/2011.
' No warranty implied; use at your own risk.
Import trans
Class AsTranslator Extends CTranslator
Method TransType$( ty:Type )
If VoidType( ty ) Return "void"
If BoolType( ty ) Return "Boolean"
If IntType( ty ) Return "int"
If FloatType( ty ) Return "Number"
If StringType( ty ) Return "String"
If ArrayType( ty ) Return "Array"
If ObjectType( ty ) Return ObjectType( ty ).classDecl.munged
InternalErr
End
Method TransValue$( ty:Type,value$ )
If value
If IntType( ty ) And value.StartsWith( "$" ) Return "0x"+value[1..]
If BoolType( ty ) Return "true"
If NumericType( ty ) Return value
If StringType( ty ) Return Enquote( value )
Else
If BoolType( ty ) Return "false"
If NumericType( ty ) Return "0"
If StringType( ty ) Return "~q~q"
If ArrayType( ty ) Return "[]"
If ObjectType( ty ) Return "null"
Endif
InternalErr
End
Method TransValDecl$( decl:ValDecl )
Return decl.munged+":"+TransType( decl.type )
End
Method TransArgs$( args:Expr[] )
Local t$
For Local arg:=Eachin args
If t t+=","
t+=arg.Trans()
Next
Return Bra(t)
End
'***** Utility *****
Method TransLocalDecl$( munged$,init:Expr )
Return "var "+munged+":"+TransType( init.exprType )+"="+init.Trans()
End
Method EmitEnter( func:FuncDecl )
Emit "pushErr();"
End
Method EmitSetErr( info$ )
Emit "_errInfo=~q"+info.Replace( "\","/" )+"~q;"
End
Method EmitLeave()
Emit "popErr();"
End
'***** Declarations *****
Method TransStatic$( decl:Decl )
If decl.IsExtern() And ModuleDecl( decl.scope )
Return decl.munged
Else If _env And decl.scope And decl.scope=_env.ClassScope
Return decl.munged
Else If ClassDecl( decl.scope )
Return decl.scope.munged+"."+decl.munged
Else If ModuleDecl( decl.scope )
Return decl.munged
Endif
InternalErr
End
Method TransGlobal$( decl:GlobalDecl )
Return TransStatic( decl )
End
Method TransField$( decl:FieldDecl,lhs:Expr )
' Local t_lhs$="this"
If lhs
Local t_lhs$=TransSubExpr( lhs )
If ENV_CONFIG="debug" t_lhs="dbg_object"+Bra(t_lhs)
Return t_lhs+"."+decl.munged
Endif
Return decl.munged
' Return t_lhs+"."+decl.munged
End
Method TransFunc$( decl:FuncDecl,args:Expr[],lhs:Expr )
If decl.IsMethod()
Local t_lhs$="this"
If lhs
t_lhs=TransSubExpr( lhs )
' If ENV_CONFIG="debug" t_lhs="dbg_object"+Bra(t_lhs)
Endif
Return t_lhs+"."+decl.munged+TransArgs( args )
Endif
Return TransStatic( decl )+TransArgs( args )
End
Method TransSuperFunc$( decl:FuncDecl,args:Expr[] )
Return "super."+decl.munged+TransArgs( args )
End
'***** Expressions *****
Method TransConstExpr$( expr:ConstExpr )
Return TransValue( expr.exprType,expr.value )
End
Method TransNewObjectExpr$( expr:NewObjectExpr )
Local t$="(new "+expr.classDecl.munged+")"
If expr.ctor t+="."+expr.ctor.munged+TransArgs( expr.args )
Return t
End
Method TransNewArrayExpr$( expr:NewArrayExpr )
Local texpr$=expr.expr.Trans()
Local ty:=expr.ty
If BoolType( ty ) Return "new_bool_array("+texpr+")"
If NumericType( ty ) Return "new_number_array("+texpr+")"
If StringType( ty ) Return "new_string_array("+texpr+")"
If ObjectType( ty ) Return "new_object_array("+texpr+")"
If ArrayType( ty ) Return "new_array_array("+texpr+")"
InternalErr
End
Method TransSelfExpr$( expr:SelfExpr )
Return "this"
End
Method TransCastExpr$( expr:CastExpr )
Local dst:=expr.exprType
Local src:=expr.expr.exprType
Local texpr$=Bra( expr.expr.Trans() )
If BoolType( dst )
If BoolType( src ) Return texpr
If IntType( src ) Return Bra( texpr+"!=0" )
If FloatType( src ) Return Bra( texpr+"!=0.0" )
If StringType( src ) Return Bra( texpr+".length!=0" )
If ArrayType( src ) Return Bra( texpr+".length!=0" )
If ObjectType( src ) Return Bra( texpr+"!=null" )
Else If IntType( dst )
If BoolType( src ) Return Bra( texpr+"?1:0" )
If IntType( src ) Return texpr
If FloatType( src ) Return Bra( texpr+"|0" )
If StringType( src ) Return "parseInt"+Bra( texpr+",10" )
Else If FloatType( dst )
If NumericType( src ) Return texpr
If StringType( src ) Return "parseFloat"+texpr
Else If StringType( dst )
If NumericType( src ) Return "String"+texpr
If StringType( src ) Return texpr
Else If ObjectType( dst ) And ObjectType( src )
If src.GetClass().ExtendsClass( dst.GetClass() )
'upcast
Return texpr
Else
'downcast
Return Bra( texpr + " as "+TransType( dst ) )
Endif
Endif
Err "AS translator can't convert "+src.ToString()+" to "+dst.ToString()
End
Method TransUnaryExpr$( expr:UnaryExpr )
Local pri=ExprPri( expr )
Local t_expr$=TransSubExpr( expr.expr,pri )
Return TransUnaryOp( expr.op )+t_expr
End
Method TransBinaryExpr$( expr:BinaryExpr )
Local pri=ExprPri( expr )
Local t_lhs$=TransSubExpr( expr.lhs,pri )
Local t_rhs$=TransSubExpr( expr.rhs,pri-1 )
Local t_expr$=t_lhs+TransBinaryOp( expr.op,t_rhs )+t_rhs
If expr.op="/" And IntType( expr.exprType ) t_expr=Bra( Bra(t_expr)+"|0" )
Return t_expr
End
Method TransIndexExpr$( expr:IndexExpr )
Local t_expr:=TransSubExpr( expr.expr )
If StringType( expr.expr.exprType )
Local t_index:=expr.index.Trans()
If ENV_CONFIG="debug" Return "dbg_charCodeAt("+t_expr+","+t_index+")"
Return t_expr+".charCodeAt("+t_index+")"
Else If ENV_CONFIG="debug"
Local t_index:=expr.index.Trans()
Return "dbg_array("+t_expr+","+t_index+")[dbg_index]"
Else
Local t_index:=expr.index.Trans()
Return t_expr+"["+t_index+"]"
Endif
End
Method TransSliceExpr$( expr:SliceExpr )
Local t_expr$=TransSubExpr( expr.expr )
Local t_args$="0"
If expr.from t_args=expr.from.Trans()
If expr.term t_args+=","+expr.term.Trans()
Return t_expr+".slice("+t_args+")"
End
Method TransArrayExpr$( expr:ArrayExpr )
Local t$
For Local elem:=Eachin expr.exprs
If t t+=","
t+=elem.Trans()
Next
Return "["+t+"]"
End
Method TransIntrinsicExpr$( decl:Decl,expr:Expr,args:Expr[] )
Local texpr$,arg0$,arg1$,arg2$
If expr texpr=TransSubExpr( expr )
If args.Length>0 And args[0] arg0=args[0].Trans()
If args.Length>1 And args[1] arg1=args[1].Trans()
If args.Length>2 And args[2] arg2=args[2].Trans()
Local id$=decl.munged[1..]
Select id
'global functions
Case "print" Return "print"+Bra( arg0 )
Case "error" Return "error"+Bra( arg0 )
Case "debuglog" Return "debugLog"+Bra( arg0 )
Case "debugstop" Return "debugStop()"
'string/array methods
Case "length" Return texpr+".length"
'array methods
Case "resize"
Local ty:=ArrayType( expr.exprType ).elemType
If BoolType( ty ) Return "resize_bool_array"+Bra( texpr+","+arg0 )
If NumericType( ty ) Return "resize_number_array"+Bra( texpr+","+arg0 )
If StringType( ty ) Return "resize_string_array"+Bra( texpr+","+arg0 )
If ArrayType( ty ) Return "resize_array_array"+Bra( texpr+","+arg0 )
If ObjectType( ty ) Return "resize_object_array"+Bra( texpr+","+arg0 )
InternalErr
'string methods
Case "compare" Return "string_compare"+Bra( texpr+","+arg0 )
Case "find" Return texpr+".indexOf"+Bra( arg0+","+arg1 )
Case "findlast" Return texpr+".lastIndexOf"+Bra( arg0 )
Case "findlast2" Return texpr+".lastIndexOf"+Bra( arg0+","+arg1 )
Case "trim" Return "string_trim"+Bra( texpr )
Case "join" Return arg0+".join"+Bra( texpr )
Case "split" Return texpr+".split"+Bra( arg0 )
Case "replace" Return "string_replace"+Bra(texpr+","+arg0+","+arg1)
Case "tolower" Return texpr+".toLowerCase()"
Case "toupper" Return texpr+".toUpperCase()"
Case "contains" Return Bra( texpr+".indexOf"+Bra( arg0 )+"!=-1" )
Case "startswith" Return "string_startswith"+Bra( texpr+","+arg0 )
Case "endswith" Return "string_endswith"+Bra( texpr+","+arg0 )
Case "tochars" Return "string_tochars"+Bra( texpr )
'string functions
Case "fromchar" Return "String.fromCharCode"+Bra( arg0 )
Case "fromchars" Return "string_fromchars"+Bra( arg0 )
'trig functions - degrees
Case "sin","cos","tan" Return "Math."+id+Bra( Bra( arg0 )+"*D2R" )
Case "asin","acos","atan" Return Bra( "Math."+id+Bra( arg0 )+"*R2D" )
Case "atan2" Return Bra( "Math."+id+Bra( arg0+","+arg1 )+"*R2D" )
'trig functions - radians
Case "sinr","cosr","tanr" Return "Math."+id[..-1]+Bra( arg0 )
Case "asinr","acosr","atanr" Return "Math."+id[..-1]+Bra( arg0 )
Case "atan2r" Return "Math."+id[..-1]+Bra( arg0+","+arg1 )
'misc math functions
Case "sqrt","floor","ceil","log","exp" Return "Math."+id+Bra( arg0 )
Case "pow" Return "Math."+id+Bra( arg0+","+arg1 )
End Select
InternalErr
End
'***** Statements *****
Method TransTryStmt$( stmt:TryStmt )
Emit "try{"
Local unr:=EmitBlock( stmt.block )
For Local c:=Eachin stmt.catches
MungDecl c.init
Emit "}catch("+c.init.munged+":"+TransType( c.init.type )+"){"
Local unr:=EmitBlock( c.block )
Next
Emit "}"
End
'***** Declarations *****
Method EmitFuncDecl( decl:FuncDecl )
BeginLocalScope
Local args$
For Local arg:=Eachin decl.argDecls
MungDecl arg
If args args+=","
args+=TransValDecl( arg )
Next
Local t$="function "+decl.munged+Bra( args )+":"+TransType( decl.retType )
Local cdecl:=decl.ClassScope()
If cdecl And cdecl.IsInterface()
Emit t+";"
Else
Local q$="internal "
If cdecl
q="public "
If decl.IsStatic() q+="static "
If decl.overrides q+="override "
Endif
Emit q+t+"{"
If decl.IsAbstract()
If VoidType( decl.retType )
Emit "return;"
Else
Emit "return "+TransValue( decl.retType,"" )+";"
Endif
Else
EmitBlock decl
Endif
Emit "}"
Endif
EndLocalScope
End
Method EmitClassDecl( classDecl:ClassDecl )
Local classid$=classDecl.munged
Local superid$=classDecl.superClass.munged
If classDecl.IsInterface()
Local bases$
For Local iface:=Eachin classDecl.implments
If bases bases+="," Else bases=" extends "
bases+=iface.munged
Next
Emit "interface "+classid+bases+"{"
For Local decl:=Eachin classDecl.Semanted
Local fdecl:=FuncDecl( decl )
If Not fdecl Continue
EmitFuncDecl fdecl
Next
Emit "}"
Return
Endif
Local bases$
For Local iface:=Eachin classDecl.implments
If bases bases+="," Else bases=" implements "
bases+=iface.munged
Next
Emit "class "+classid+" extends "+superid+bases+"{"
'members...
For Local decl:=Eachin classDecl.Semanted
Local tdecl:=FieldDecl( decl )
If tdecl
Emit "internal var "+TransValDecl( tdecl )+"="+tdecl.init.Trans()+";"
Continue
Endif
Local gdecl:=GlobalDecl( decl )
If gdecl
Emit "internal static var "+TransValDecl( gdecl )+";"
Continue
Endif
Local fdecl:=FuncDecl( decl )
If fdecl
EmitFuncDecl fdecl
Continue
Endif
Next
Emit "}"
End
Method TransApp$( app:AppDecl )
app.mainFunc.munged="bbMain"
For Local decl:=Eachin app.imported.Values()
MungDecl decl
Next
For Local decl:=Eachin app.Semanted
MungDecl decl
Local cdecl:=ClassDecl( decl )
If Not cdecl Continue
For Local decl:=Eachin cdecl.Semanted
If FuncDecl( decl ) And FuncDecl( decl ).IsCtor()
decl.ident=cdecl.ident+"_"+decl.ident
Endif
MungDecl decl
Next
Next
'decls
'
For Local decl:=Eachin app.Semanted
Local gdecl:=GlobalDecl( decl )
If gdecl
Emit "var "+TransValDecl( gdecl )+";"
Continue
Endif
Local fdecl:=FuncDecl( decl )
If fdecl
EmitFuncDecl fdecl
Continue
Endif
Local cdecl:=ClassDecl( decl )
If cdecl
EmitClassDecl cdecl
Continue
Endif
Next
BeginLocalScope
Emit "function bbInit():void{"
For Local decl:=Eachin app.semantedGlobals
Emit TransGlobal( decl )+"="+decl.init.Trans()+";"
Next
Emit "}"
EndLocalScope
Return JoinLines()
End
End
| Monkey | 5 | Regal-Internet-Brothers/webcc-monkey | webcc.data/modules/trans/astranslator.monkey | [
"Zlib"
] |
{
"@context": {
"@version": 1.1,
"@protected": true,
"protected1": "ex:protected1",
"protected2": {
"@id": "ex:protected2",
"@context": null
}
},
"protected1": "p === ex:protected1",
"protected2": {
"@context": {
"protected1": "ex:protected3"
},
"protected1": "p === ex:protected3"
}
}
| JSONLD | 2 | fsteeg/json-ld-api | tests/expand/pr14-in.jsonld | [
"W3C"
] |
.class public Ltrycatch/TestTryWithEmptyCatchTriple;
.super Ljava/lang/Object;
.field static field:[I
.method static test()V
.registers 3
const/4 v0, 0x1
:try_start_1
sget-object v1, Ltrycatch/TestTryWithEmptyCatchTriple;->field:[I
const/4 v2, 0x0
aput v0, v1, v2
:try_end_1
.catch Ljava/lang/Error; {:try_start_1 .. :try_end_1} :catch_1
:catch_1
sget-object v1, Ltrycatch/TestTryWithEmptyCatchTriple;->field:[I
array-length v1, v1
new-array v1, v1, [I
sput-object v1, Ltrycatch/TestTryWithEmptyCatchTriple;->field:[I
:try_start_2
sget-object v1, Ltrycatch/TestTryWithEmptyCatchTriple;->field:[I
const/4 v2, 0x0
aput v0, v1, v2
:try_end_2
.catch Ljava/lang/Error; {:try_start_2 .. :try_end_2} :catch_2
:catch_2
:try_start_3
sget-object v0, Ltrycatch/TestTryWithEmptyCatchTriple;->field:[I
const/4 v1, 0x0
const/4 v2, 0x2
aput v2, v0, v1
:try_end_3
.catch Ljava/lang/Error; {:try_start_3 .. :try_end_3} :catch_3
:catch_3
return-void
.end method
| Smali | 3 | Dev-kishan1999/jadx | jadx-core/src/test/smali/trycatch/TestTryWithEmptyCatchTriple.smali | [
"Apache-2.0"
] |
cylinder(h = 10, r=20, $fs=6); | OpenSCAD | 1 | heristhesiya/OpenJSCAD.org | packages/io/scad-deserializer/tests/primitive_solids/cylinderEx4.scad | [
"MIT"
] |
:- object('04-apt').
:- uses(user,[is_list/1]).
:- uses(marelle,[bash/1,install_apt/1,join/2]).
:- use_module(apply,[maplist/2]).
:- private([apt_updated/0]).
:- discontiguous met/2.
:- discontiguous meet/2.
% before the directive:
% :- multifile installs_with_apt/1
% add the directive:
:- public installs_with_apt/1.
% before the directive:
% :- multifile installs_with_apt/2
% add the directive:
:- public installs_with_apt/2.
% before the directive:
% :- multifile installs_with_apt/3
% add the directive:
:- public installs_with_apt/3.
:- include('04-apt.pl').
:- end_object.
| Logtalk | 3 | PaulBrownMagic/logtalk3 | tools/wrapper/marelle/04-apt.lgt | [
"Apache-2.0"
] |
USING: llvm.ffi ;
IN: llvm
: initialize ( -- )
LLVMGetGlobalPassRegistry LLVMInitializeCore ;
! https://github.com/fsprojects/llvm-fs/blob/master/src/LLVM/Target.fs
: initialize-native-target ( -- )
LLVMInitializeX86TargetInfo
LLVMInitializeX86Target
LLVMInitializeX86TargetMC ;
: initialize-native-asm-printer ( -- )
LLVMInitializeX86AsmPrinter ;
| Factor | 4 | alex-ilin/factor | extra/llvm/llvm.factor | [
"BSD-2-Clause"
] |
#pragma once
#if _DEBUG && _WIN64
void init_global_error_handlers();
#endif
| C | 3 | tameemzabalawi/PowerToys | src/runner/unhandled_exception_handler.h | [
"MIT"
] |
#N canvas 680 39 575 871 12;
#X declare -stdpath ./;
#X floatatom 310 374 0 0 100 0 - - - 0;
#X obj 88 553 +~;
#X text 55 88 If you're writing to and reading from a delay line \,
you have to get the write sorted before the read or else you'll never
get less than a block's delay. This patch compares a "wrong" flanger
with a "right" one:;
#X obj 123 679 *~;
#X obj 123 615 -~;
#N canvas 352 175 330 235 delay-writer 0;
#X obj 96 85 inlet~;
#X obj 96 158 outlet~;
#X obj 116 122 delwrite~ G05-d2 1000;
#X connect 0 0 1 0;
#X connect 0 0 2 0;
#X restore 123 451 pd delay-writer;
#N canvas 392 176 280 330 delay-reader 0;
#X obj 97 77 inlet~;
#X obj 97 227 outlet~;
#X obj 115 123 inlet~;
#X obj 97 197 +~;
#X obj 115 158 delread4~ G05-d2;
#X connect 0 0 3 0;
#X connect 2 0 4 0;
#X connect 3 0 1 0;
#X connect 4 0 3 1;
#X restore 123 484 pd delay-reader;
#X obj 88 679 +~;
#X obj 310 401 / 44.1;
#X obj 88 723 output~;
#X obj 141 652 tgl 18 0 empty empty empty 0 -6 0 8 #fcfcfc #000000
#000000 0 1;
#X text 249 742 updated for Pd version 0.37-1;
#X obj 310 427 pack 0 30;
#N canvas 0 0 450 300 pulse 0;
#X obj 64 197 outlet~;
#X obj 63 93 phasor~ 50;
#X obj 63 119 *~ 100;
#X obj 63 144 clip~ 0.75 1.25;
#X obj 64 170 cos~;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X restore 87 366 pd pulse;
#X obj 128 416 delwrite~ G05-d1 1000;
#X obj 310 500 vd~ G05-d1;
#X obj 310 453 line~;
#X text 57 155 To get them to go off in the correct order \, put the
delread~ and vd~ objects in subpatches. The audio connections between
the subpatches force the "reader" to be sorted after the "writer".
DSP sorting in Pd follows the hierarchy of subpatches.;
#X text 56 234 To hear the difference scroll the delay time between
0 and 100 samples. The patch at left doesn't let you get below 64 samples
\, but the patch at right can go all the way down to one sample.;
#X text 58 300 You can use the same strategy to avoid picking up unwanted
64-sample delays in send~/receive~ and throw~/catch~ pairs.;
#X text 350 374 <= delay in samples;
#X text 165 650 <= off to hear left-hand side \; on to hear right hand
side.;
#X obj 386 18 declare -stdpath ./;
#X text 64 56 ORDER OF EXECUTION OF DELWRITE~ AND DELREAD~/DELREAD4~
;
#X connect 0 0 8 0;
#X connect 1 0 4 1;
#X connect 1 0 7 0;
#X connect 3 0 7 1;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 4 0;
#X connect 7 0 9 0;
#X connect 7 0 9 1;
#X connect 8 0 12 0;
#X connect 10 0 3 1;
#X connect 12 0 16 0;
#X connect 13 0 1 0;
#X connect 13 0 5 0;
#X connect 13 0 14 0;
#X connect 15 0 1 1;
#X connect 16 0 6 1;
#X connect 16 0 15 0;
| Pure Data | 5 | myQwil/pure-data | doc/3.audio.examples/G05.execution.order.pd | [
"TCL"
] |
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common"
exclude-result-prefixes="exslt">
<xsl:variable name="x">
<y/>
</xsl:variable>
<xsl:template match="doc">
<html>
<body>
<script>if (window.testRunner) testRunner.dumpAsText();</script>
<p>Test that exslt:node-set() function is supported.</p>
<xsl:apply-templates select="exslt:node-set($x)/*"/>
</body>
</html>
</xsl:template>
<xsl:template match="y">
<p>SUCCESS</p>
</xsl:template>
</xsl:stylesheet>
| XSLT | 3 | zealoussnow/chromium | third_party/blink/web_tests/fast/xsl/exslt-node-set.xsl | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] |
$TTL 300
1 IN PTR foo.example.com.
2 IN PTR bar.example.com.
3 IN PTR baz.example.com.
4 IN PTR silly.example.com.
5 IN PTR willy.example.com.
6 IN PTR billy.example.com.
7 IN PTR my.example.com.
8 IN PTR fair.example.com.
9 IN PTR lady.example.com.
| DNS Zone | 1 | IT-Sumpfling/dnscontrol | pkg/js/parse_tests/032-reverseip/3.2.1.in-addr.arpa.zone | [
"MIT"
] |
path = require 'path'
_ = require 'underscore'
_str = require 'underscore.string'
{convertStackTrace} = require 'coffeestack'
React = require 'react'
ReactDOM = require 'react-dom'
marked = require 'marked'
sourceMaps = {}
formatStackTrace = (spec, message='', stackTrace, indent="") ->
return stackTrace unless stackTrace
jasminePattern = /^\s*at\s+.*\(?.*[/\\]jasmine(-[^/\\]*)?\.js:\d+:\d+\)?\s*$/
firstJasmineLinePattern = /^\s*at [/\\].*[/\\]jasmine(-[^/\\]*)?\.js:\d+:\d+\)?\s*$/
convertedLines = []
for line in stackTrace.split('\n')
convertedLines.push(line) unless jasminePattern.test(line)
break if firstJasmineLinePattern.test(line)
stackTrace = convertStackTrace(convertedLines.join('\n'), sourceMaps)
lines = stackTrace.split('\n')
# Remove first line of stack when it is the same as the error message
errorMatch = lines[0]?.match(/^Error: (.*)/)
lines.shift() if message.trim() is errorMatch?[1]?.trim()
for line, index in lines
# Remove prefix of lines matching: at [object Object].<anonymous> (path:1:2)
prefixMatch = line.match(/at \[object Object\]\.<anonymous> \(([^)]+)\)/)
line = "at #{prefixMatch[1]}" if prefixMatch
# Relativize locations to spec directory
lines[index] = line.replace("at #{spec.specDirectory}#{path.sep}", 'at ')
lines = lines.map (line) -> indent + line.trim()
lines.join('\n')
indentationString: (suite, plus=0) ->
rootSuite = suite
indentLevel = 0 + plus
while rootSuite.parentSuite
rootSuite = rootSuite.parentSuite
indentLevel += 1
return [0...indentLevel].map(-> " ").join("")
suiteString: (spec) ->
descriptions = [spec.suite.description]
rootSuite = spec.suite
while rootSuite.parentSuite
indent = indentationString(rootSuite)
descriptions.unshift(indent + rootSuite.description)
rootSuite = rootSuite.parentSuite
descriptions.join("\n")
class N1GuiReporter extends React.Component
constructor: (@props) ->
render: ->
<div className="spec-reporter">
<div className="padded pull-right">
<button className="btn reload-button" onClick={@onReloadSpecs}>Reload Specs</button>
</div>
<div className="symbol-area">
<div className="symbol-header">Core</div>
<div className="symbol-summary list-unstyled">{@_renderSpecsOfType('core')}</div>
</div>
<div className="symbol-area">
<div className="symbol-header">Bundled</div>
<div className="symbol-summary list-unstyled">{@_renderSpecsOfType('bundled')}</div>
</div>
<div className="symbol-area">
<div className="symbol-header">User</div>
<div className="symbol-summary list-unstyled">{@_renderSpecsOfType('user')}</div>
</div>
{@_renderStatus()}
<div className="results">
{@_renderFailures()}
</div>
<div className="plain-text-output">
{@props.plainTextOutput}
</div>
</div>
_renderSpecsOfType: (type) =>
items = []
@props.specs.forEach (spec, idx) =>
return unless spec.specType is type
statusClass = "pending"
title = undefined
results = spec.results()
if results
if results.skipped
statusClass = "skipped"
else if results.failedCount > 0
statusClass = "failed"
title = spec.getFullName()
else if spec.endedAt
statusClass = "passed"
items.push <li key={idx} title={title} className="spec-summary #{statusClass}"/>
items
_renderFailures: =>
# We have an array of specs with `suite` and potentially N `parentSuite` from there.
# Create a tree instead.
topLevelSuites = []
failedSpecs = @props.specs.filter (spec) ->
spec.endedAt and spec.results().failedCount > 0
for spec in failedSpecs
suite = spec.suite
suite = suite.parentSuite while suite.parentSuite
if topLevelSuites.indexOf(suite) is -1
topLevelSuites.push(suite)
topLevelSuites.map (suite, idx) =>
<SuiteResultView suite={suite} key={idx} allSpecs={failedSpecs} />
_renderStatus: =>
failedCount = 0
skippedCount = 0
completeCount = 0
for spec in @props.specs
results = spec.results()
continue unless spec.endedAt
failedCount += 1 if results.failedCount > 0
skippedCount += 1 if results.skipped
completeCount += 1 if results.passedCount > 0 and results.failedCount is 0
if failedCount is 1
message = "#{failedCount} failure"
else
message = "#{failedCount} failures"
if skippedCount
specCount = "#{completeCount - skippedCount}/#{@props.specs.length - skippedCount} (#{skippedCount} skipped)"
else
specCount = "#{completeCount}/#{@props.specs.length}"
<div className="status alert alert-info">
<div className="time"></div>
<div className="spec-count">{specCount}</div>
<div className="message">{message}</div>
</div>
onReloadSpecs: =>
require('electron').remote.getCurrentWindow().reload()
class SuiteResultView extends React.Component
@propTypes: ->
suite: React.PropTypes.object
allSpecs: React.PropTypes.array
render: ->
items = []
subsuites = []
@props.allSpecs.forEach (spec) =>
if spec.suite is @props.suite
items.push(spec)
else
suite = spec.suite
while suite.parentSuite
if suite.parentSuite is @props.suite
subsuites.push(suite)
return
suite = suite.parentSuite
items = items.map (spec, idx) =>
<SpecResultView key={idx} spec={spec} />
subsuites = subsuites.map (suite, idx) =>
<SuiteResultView key={idx} suite={suite} allSpecs={@props.allSpecs} />
<div className="suite">
<div className="description">{@props.suite.description}</div>
<div className="results">
{items}
{subsuites}
</div>
</div>
class SpecResultView extends React.Component
@propTypes: ->
spec: React.PropTypes.object
render: ->
description = @props.spec.description
resultItems = @props.spec.results().getItems()
description = "it #{description}" if description.indexOf('it ') isnt 0
failures = []
for result, idx in resultItems
continue if result.passed()
stackTrace = formatStackTrace(@props.spec, result.message, result.trace.stack)
failures.push(
<div key={idx}>
<div className="result-message fail">{result.message}</div>
<div className="stack-trace padded">{stackTrace}</div>
</div>
)
<div className="spec">
<div className="description">{description}</div>
<div className="spec-failures">{failures}</div>
</div>
el = document.createElement('div')
document.body.appendChild(el)
startedAt = null
specs = []
plainTextOutput = ""
update = =>
component = <N1GuiReporter
startedAt={startedAt}
specs={specs}
/>
ReactDOM.render(component, el)
module.exports =
reportRunnerStarting: (runner) ->
specs = runner.specs()
startedAt = Date.now()
update()
reportRunnerResults: (runner) ->
update()
reportSuiteResults: (suite) ->
reportSpecResults: (spec) ->
spec.endedAt = Date.now()
update()
reportPlainTextSpecResult: (spec) ->
str = ""
if spec.results().failedCount > 0
str += suiteString(spec) + "\n"
indent = indentationString(spec.suite, 1)
stackIndent = indentationString(spec.suite, 2)
description = spec.description
description = "it #{description}" if description.indexOf('it ') isnt 0
str += indent + description + "\n"
for result in spec.results().getItems()
continue if result.passed()
str += indent + result.message + "\n"
stackTrace = formatStackTrace(spec, result.message, result.trace.stack, stackIndent)
str += stackTrace + "\n"
str += "\n\n"
plainTextOutput = plainTextOutput + str
update()
reportSpecStarting: (spec) ->
update()
| CoffeeScript | 5 | cnheider/nylas-mail | packages/client-app/spec/n1-spec-runner/n1-gui-reporter.cjsx | [
"MIT"
] |
using Uno;
using Uno.UX;
using Fuse;
public class UXClassTest
{
public UXClassTest()
{
var mc = new MyClass();
debug_log("String: " + mc.MyString);
debug_log("Int: " + mc.MyInt);
}
}
| Uno | 2 | mortend/fuse-studio | Source/Simulator/Tests/UXFeaturesTestApp/UXClass/UXClass.uno | [
"MIT"
] |
ARCHIVE_READ_NEW(3) manual page
== NAME ==
'''archive_read_new'''
- functions for reading streaming archives
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
== SYNOPSIS ==
'''<nowiki>#include <archive.h></nowiki>'''
<br>
''struct archive *''
<br>
'''archive_read_new'''(''void'');
== DESCRIPTION ==
Allocates and initializes a
'''struct archive'''
object suitable for reading from an archive.
NULL
is returned on error.
A complete description of the
'''struct archive'''
object can be found in the overview manual page for
[[ManPageibarchive3]].
== SEE ALSO ==
[[ManPageBsdtar1]],
[[ManPagerchiveeadata3]],
[[ManPagerchiveeadilter3]],
[[ManPagerchiveeadormat3]],
[[ManPagerchiveeadetptions3]],
[[ManPagerchivetil3]],
[[ManPageibarchive3]],
[[ManPageTar5]]
| MediaWiki | 2 | probonopd/imagewriter | dependencies/libarchive-3.4.2/doc/wiki/ManPageArchiveReadNew3.wiki | [
"Apache-2.0"
] |
public final class MyException /* MyException*/ extends java.lang.Exception {
public MyException();// .ctor()
}
public final class C /* C*/ {
@kotlin.jvm.Throws(exceptionClasses = {Exception::class})
public C() throws java.lang.Exception;// .ctor()
@kotlin.jvm.Throws(exceptionClasses = {Exception::class})
public C(int) throws java.lang.Exception;// .ctor(int)
@kotlin.jvm.Throws(exceptionClasses = {java.io.IOException::class, MyException::class})
@org.jetbrains.annotations.NotNull()
public final java.lang.String readFile(@org.jetbrains.annotations.NotNull() java.lang.String) throws java.io.IOException, MyException;// readFile(java.lang.String)
@kotlin.jvm.Throws(exceptionClasses = {kotlin.Throwable::class})
public final void baz() throws java.lang.Throwable;// baz()
} | Java | 4 | Mu-L/kotlin | compiler/testData/asJava/ultraLightClasses/throwsAnnotation.java | [
"ECL-2.0",
"Apache-2.0"
] |
*** Settings ***
Documentation This resource provides any keywords related to the Harbor private registry appliance
*** Variables ***
${retag_btn} //clr-dg-action-bar//button[contains(.,'Retag')]
${copy_project_name_xpath} //*[@id='project-name']
${copy_repo_name_xpath} //*[@id='repo-name']
${tag_name_xpath} //*[@id='tag-name']
${confirm_btn} //button[contains(.,'CONFIRM')]
${target_image_name} target-alpine
${image_tag} 3.2.10-alpine
${tag_value_xpath} //clr-dg-row[contains(.,'${image_tag}')]
${modal-dialog} div.modal-dialog
| RobotFramework | 3 | yxxhero/harbor | tests/resources/Harbor-Pages/Project-Copy-Elements.robot | [
"Apache-2.0"
] |
( Generated from test_example_listedit_in.muv by the MUV compiler. )
( https://github.com/revarbat/muv )
lvar argparse::current_mode
lvar argparse::modes_list
lvar argparse::flags_map
lvar argparse::posargs_map
lvar argparse::remainder_map
: argparse::init[ -- ret ]
"" argparse::current_mode !
{ }list argparse::modes_list !
{ }dict argparse::flags_map !
{ }dict argparse::posargs_map !
{ "" "remainder" }dict argparse::remainder_map !
0
;
: argparse::parse_posargs[ _mode _posargs -- ret ]
var _tok
begin
{ _posargs @ "^([a-z0-9_]*)([^a-z0-9_])(.*)$" 1 regexp }list 0 []
_tok !
_tok @ if
argparse::posargs_map @ _mode @ [] not if
{ }list dup
argparse::posargs_map @ _mode @ ->[] argparse::posargs_map ! pop
then
argparse::posargs_map @ _mode @ over over []
{ _tok @ 1 [] tolower _tok @ 2 [] }list swap []<- rot rot ->[] argparse::posargs_map !
_tok @ 3 [] _posargs !
else
_posargs @ tolower dup
argparse::remainder_map @ _mode @ ->[] argparse::remainder_map ! pop
break
then
repeat
0
;
: argparse::set_mode[ _name -- ret ]
_name @ tolower _name !
_name @ argparse::current_mode !
0
;
: argparse::add_mode[ _name _flags _posargs -- ret ]
var _flag
_name @ tolower _name !
argparse::modes_list @ _name @ swap []<- argparse::modes_list !
{ }list dup
argparse::flags_map @ _name @ ->[] argparse::flags_map ! pop
{ }list dup
argparse::posargs_map @ _name @ ->[] argparse::posargs_map ! pop
_flags @ foreach
_flag ! pop
argparse::flags_map @ _name @ [] not if
{ }list dup
argparse::flags_map @ _name @ ->[] argparse::flags_map ! pop
then
argparse::flags_map @ _name @ over over [] _flag @ tolower
swap []<- rot rot ->[] argparse::flags_map !
repeat
_name @ _posargs @ argparse::parse_posargs pop
0
;
: argparse::add_flag[ _name -- ret ]
var _mode
_name @ tolower _name !
argparse::modes_list @ foreach
_mode ! pop
_mode @ tolower _mode !
argparse::modes_list @ _mode @ array_findval not if
_mode @ _name @
"ArgParse: Option '%s' declared as part of non-existent mode '%s'!"
fmtstring abort
then
argparse::flags_map @ _mode @ [] not if
{ }list dup
argparse::flags_map @ _mode @ ->[] argparse::flags_map ! pop
then
argparse::flags_map @ _mode @ over over [] _name @ swap []<-
rot rot ->[] argparse::flags_map !
repeat
0
;
: argparse::add_posargs[ _posargs -- ret ]
var _mode
argparse::modes_list @ foreach
_mode ! pop
_mode @ tolower _mode !
argparse::modes_list @ _mode @ array_findval not if
_mode @ _mode @
"ArgParse: Option '%s' declared as part of non-existent mode '%s'!"
fmtstring abort
then
_mode @ _posargs @ argparse::parse_posargs pop
repeat
0
;
: argparse::show_usage[ -- ret ]
var _cmd var _mode var _flags var _flag var _posargs
var _posarg var _line
trig name ";" split pop strip _cmd !
"Usage:" me @ swap notify
argparse::modes_list @ foreach
_mode ! pop
{ }list argparse::flags_map @ _mode @ [] foreach
_flag ! pop
{ "[#" _flag @ "]" }list array_interpret swap []<-
repeat _flags !
{ }list argparse::posargs_map @ _mode @ [] foreach
_posarg ! pop
{ _posarg @ 0 [] toupper _posarg @ 1 [] }list array_interpret
swap []<-
repeat _posargs !
argparse::remainder_map @ _mode @ [] toupper
_posargs @ "" array_join _flags @ if " " else "" then
_flags @ " " array_join _mode @ _mode @ if "#" else "" then
_cmd @ "%s %s%s %s%s%s%s" fmtstring _line !
_line @ me @ swap notify
repeat
0
;
: argparse::parse[ _line -- ret ]
var _parts var _mode var _flag var _opts var _mode_given
var _opt var _lc_opt var _found var _posarg
{ }dict _opts !
0 _mode_given !
begin
_line @ "#" stringpfx
while
{ { _line @ 1 strcut }list 1 [] " " split }list _parts !
_parts @ 0 [] _opt !
_opt @ tolower _lc_opt !
0 _found !
argparse::modes_list @ foreach
_mode ! pop
_mode @ _lc_opt @ stringcmp not if
_mode @ argparse::current_mode !
_found ++
break
then
repeat
_found @ if
_mode_given ++
_parts @ 1 [] _line !
continue
then
argparse::flags_map @ argparse::current_mode @ [] foreach
_flag ! pop
_flag @ _lc_opt @ stringcmp not if
_opt @ dup _opts @ _flag @ ->[] _opts ! pop
_found ++
break
then
repeat
_found @ if
_parts @ 1 [] _line !
continue
then
argparse::modes_list @ foreach
_mode ! pop
_mode @ _lc_opt @ stringpfx if
_mode @ argparse::current_mode !
_found ++
then
repeat
argparse::flags_map @ argparse::current_mode @ [] foreach
_flag ! pop
_flag @ _lc_opt @ stringpfx if
_opt @ dup _opts @ _flag @ ->[] _opts ! pop
_found ++
then
repeat
_found @ 1 = if
_parts @ 1 [] _line !
continue
else
_found @ 1 > if
_opt @ "Option #%s is ambiguous." fmtstring me @ swap notify
else
_opt @ "Option #%s not recognized." fmtstring
me @ swap notify
then
then
argparse::show_usage pop
{ }list exit
repeat
_mode_given @ 1 > if
"Cannot mix modes." me @ swap notify
argparse::show_usage pop
{ }list exit
then
argparse::posargs_map @ argparse::current_mode @ [] foreach
_posarg ! pop
{ _line @ _posarg @ 1 [] split }list _parts !
_parts @ 0 [] dup _opts @ _posarg @ 0 [] ->[] _opts ! pop
_parts @ 1 [] _line !
repeat
_line @ dup
_opts @ argparse::remainder_map @ argparse::current_mode @ [] ->[] _opts ! pop
argparse::current_mode @ dup _opts @ "mode" ->[] _opts ! pop
_opts @
;
: _verify[ _override _msg -- ret ]
_override @ if 1 exit then
{ "Are you sure you want to " _msg @ "?" }list
array_interpret me @ swap notify
{ read 1 strcut }list 0 [] "y" stringcmp not if 1 exit then
"Cancelled." me @ swap notify
0
;
: _handle_mode_list[ _obj _prop -- ret ]
var _lines var _i var _line
_obj @ _prop @ array_get_proplist _lines !
_lines @ foreach
_line ! _i !
_line @ _i @ ++ "%3i: %s" fmtstring me @ swap notify
repeat
"Done." me @ swap notify
0
;
: _handle_mode_append[ _obj _prop _val _force -- ret ]
var _lines
_val @ not if
argparse::show_usage pop
0 exit
then
_force @ "append a line to the list" _verify if
_obj @ _prop @ array_get_proplist _lines !
_lines @ _val @ swap []<- _lines !
_obj @ _prop @ _lines @ array_put_proplist
"Line appended." me @ swap notify
_obj @ _prop @ _handle_mode_list pop
then
0
;
: _handle_mode_delete[ _obj _prop _pos _force -- ret ]
var _lines
_pos @ atoi _pos !
_pos @ not if
argparse::show_usage pop
0 exit
then
_force @ "delete a line from the list" _verify if
_obj @ _prop @ array_get_proplist _lines !
_lines @ _pos @ -- array_delitem _lines !
_obj @ _prop @ _lines @ array_put_proplist
"Line deleted." me @ swap notify
_obj @ _prop @ _handle_mode_list pop
then
0
;
: _handle_mode_insert[ _obj _prop _pos _val _force -- ret ]
var _lines
_pos @ atoi _pos !
_pos @ not dup not if pop _val @ not then if
argparse::show_usage pop
0 exit
then
_force @ "insert a line into the list" _verify if
_obj @ _prop @ array_get_proplist _lines !
_val @ _lines @ _pos @ -- array_insertitem _lines !
_obj @ _prop @ _lines @ array_put_proplist
"Line inserted." me @ swap notify
_obj @ _prop @ _handle_mode_list pop
then
0
;
: _handle_mode_replace[ _obj _prop _pos _val _force -- ret ]
var _lines
_pos @ atoi _pos !
_pos @ not dup not if pop _val @ not then if
argparse::show_usage pop
0 exit
then
_force @ "replace a line in the list" _verify if
_obj @ _prop @ array_get_proplist _lines !
_lines @ _pos @ -- array_delitem _lines !
_val @ _lines @ _pos @ -- array_insertitem _lines !
_obj @ _prop @ _lines @ array_put_proplist
"Line inserted." me @ swap notify
_obj @ _prop @ _handle_mode_list pop
then
0
;
: _main[ _arg -- ret ]
var _opts var _obj
argparse::init pop
"list" argparse::set_mode pop
"list" { }list "obj=prop" argparse::add_mode pop
"append" { "force" }list "obj=prop:val" argparse::add_mode pop
"delete" { "force" }list "obj=prop:pos" argparse::add_mode pop
"insert" { "force" }list "obj=prop:pos:val"
argparse::add_mode pop
"replace" { "force" }list "obj=prop:pos:val"
argparse::add_mode pop
"verbose" argparse::add_flag pop
_arg @ argparse::parse _opts !
_opts @ not if 0 exit then
_opts @ "obj" [] not
dup not if pop _opts @ "prop" [] not then if
argparse::show_usage pop
0 exit
then
_opts @ "obj" [] match
dup #-1 dbcmp if me @ "I don't see that here!" notify then
dup #-2 dbcmp if me @ "I don't know which one you mean!" notify then
dup #-3 dbcmp if pop me @ getlink then
dup ok? if
me @ over controls not if
pop #-1 me @ "Permission denied." notify
then
then _obj !
_obj @ 0 < if 0 exit then
_opts @ "verbose" [] if
{ "Mode = " _opts @ "mode" [] }list array_interpret
me @ swap notify
then
0 begin pop (switch)
_opts @ "mode" []
dup "list" strcmp not if
_obj @ _opts @ "prop" [] _handle_mode_list pop break
then
dup "append" strcmp not if
_obj @ _opts @ "prop" [] _opts @ "val" [] _opts @ "force" []
_handle_mode_append pop break
then
dup "delete" strcmp not if
_obj @ _opts @ "prop" [] _opts @ "pos" [] _opts @ "force" []
_handle_mode_delete pop break
then
dup "insert" strcmp not if
_obj @ _opts @ "prop" [] _opts @ "pos" [] _opts @ "val" []
_opts @ "force" [] _handle_mode_insert pop break
then
dup "replace" strcmp not if
_obj @ _opts @ "prop" [] _opts @ "pos" [] _opts @ "val" []
_opts @ "force" [] _handle_mode_replace pop break
then
break
repeat pop
0
;
: __start
"me" match me ! me @ location loc ! trig trigger !
"" argparse::current_mode !
{ }list argparse::modes_list !
{ }dict argparse::flags_map !
{ }dict argparse::posargs_map !
{ "" "remainder" }dict argparse::remainder_map !
_main
;
| MUF | 5 | revarbat/muv | tests/test_example_listedit_cmp.muf | [
"BSD-2-Clause"
] |
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/npm-debug.log*
/yarn-error.log
/yarn.lock
/package-lock.json
# production
/dist
# misc
.DS_Store
# umi
/src/.umi
/src/.umi-production
/src/.umi-test
/.env.local
| Smarty | 4 | Dolov/umi | packages/create-umi-app/templates/AppGenerator/.gitignore.tpl | [
"MIT"
] |
# Parameters
param N := read "network.csv" as "1n" use 1 comment "#";
set Ns := {0..N-1};
set N0 := {1..N-1};
param L := read "network.csv" as "2n" use 1 comment "#";
set Ls := {1..L};
param piTp := read "network.csv" as "3n" use 1 comment "#";
param piTd := read "network.csv" as "4n" use 1 comment "#";
param fromBus[Ls] := read "network.csv" as "<1n> 2n" skip 1 use L comment "#";
param toBus[Ls] := read "network.csv" as "<1n> 3n" skip 1 use L comment "#";
param C[Ls] := read "network.csv" as "<1n> 6n" skip 1 use L comment "#";
param T := read "baselines-full.dat" as "2n" use 1 comment "#";
set Ts := {1..T};
param dt := read "baselines-full.dat" as "4n" use 1 comment "#";
param EPS := read "baselines-full.dat" as "5n" use 1 comment "#";
param p[Ns*Ts] := read "baselines-full.dat" as "<1n,2n> 3n" skip 1 use (N*T) comment "#";
# Variables
var f[<line,t> in Ls*Ts] >= -C[line]-EPS <= C[line]+EPS ;
var r0[Ts] >= -infinity;
var fr[Ls*Ts] >= -infinity;
var r0r[Ts] >= -infinity;
var flowViolation[Ls*Ts] >= 0;
var z[Ns*Ts] binary;
var trippingCost[Ns*Ts] >= 0;
# Objective
minimize Costs:
sum <n,t> in Ns*Ts : trippingCost[n,t] + sum <line,t> in Ls*Ts : EPS*flowViolation[line,t];
# Constraints
subto TrippingCostProductionDefinition:
forall <n,t> in Ns*Ts :
trippingCost[n,t]>=z[n,t]*piTp*dt*p[n,t];
subto TrippingCostConsumptionDefinition:
forall <n,t> in Ns*Ts :
trippingCost[n,t]>=z[n,t]*piTd*dt*(-p[n,t]);
subto ObservedProductionNode:
forall <n,t> in Ns*Ts :
p[n,t]
+ if (n == 0) then r0r[t] else 0*r0r[t] end
== sum <line> in Ls : if (fromBus[line] == n) then fr[line,t] else 0*fr[line,t] end
- sum <line> in Ls : if (toBus[line] == n) then fr[line,t] else 0*fr[line,t] end;
subto RealProductionNode:
forall <n,t> in Ns*Ts :
(1-z[n,t])*p[n,t]
+ if (n == 0) then r0[t] else 0*r0[t] end
== sum <line> in Ls : if (fromBus[line] == n) then f[line,t] else 0*f[line,t] end
- sum <line> in Ls : if (toBus[line] == n) then f[line,t] else 0*f[line,t] end;
subto FlowViolationUp:
forall <line,t> in Ls*Ts:
fr[line,t] <= C[line] + flowViolation[line,t];
subto FlowViolationDown:
forall <line,t> in Ls*Ts:
fr[line,t] >= -C[line] - flowViolation[line,t];
| Zimpl | 5 | sebMathieu/dsima | simulator/models/DSO-operation.zpl | [
"BSD-3-Clause"
] |
CREATE KEYSPACE mykeyspace WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 1};
USE mykeyspace;
CREATE TABLE mykeyspace.users
(
id uuid PRIMARY KEY,
ip_numbers frozen<set<inet>>,
addresses frozen<map<text, tuple<text>>>,
emails frozen<list<varchar>>,
);
INSERT INTO mykeyspace.users (id, ip_numbers)
VALUES (6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47,
{ '10.10.11.1', '10.10.10.1', '10.10.12.1'});
UPDATE mykeyspace.users
SET ip_numbers = ip_numbers + {'10.10.14.1'}
WHERE id = 6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47;
UPDATE mykeyspace.users
SET ip_numbers = {'11.10.11.1', '11.10.10.1', '11.10.12.1'}
WHERE id = 6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47;
SELECT ip_numbers
FROM mykeyspace.users;
CREATE TABLE mykeyspace.users_score
(
id uuid PRIMARY KEY,
score set<frozen<set<int>>>
);
CREATE TYPE mykeyspace.address (
city text,
street text,
streetNo int,
zipcode text
);
CREATE TABLE mykeyspace.building
(
id uuid PRIMARY KEY,
address frozen<address>
);
INSERT INTO mykeyspace.building (id, address)
VALUES (6ab09bec-e68e-48d9-a5f8-97e6fb4c9b48,
{city: 'City', street: 'Street', streetNo: 2,zipcode: '02-212'});
UPDATE mykeyspace.building
SET address.city = 'City2'
WHERE id = 6ab09bec-e68e-48d9-a5f8-97e6fb4c9b48;
UPDATE mykeyspace.building
SET address = {city : 'City2', street : 'Street2'}
WHERE id = 6ab09bec-e68e-48d9-a5f8-97e6fb4c9b48; | SQL | 4 | DBatOWL/tutorials | persistence-modules/java-cassandra/src/main/resources/frozen-keyword.cql | [
"MIT"
] |
module snabb-config-leader-v1 {
namespace snabb:config-leader;
prefix config-leader;
import ietf-alarms { prefix al; }
organization "Igalia, S.L.";
contact "Andy Wingo <[email protected]>";
description
"RPC interface for ConfigLeader Snabb app.";
revision 2017-09-28 {
description "Add default display schema for describe.";
}
revision 2016-12-20 {
description "Add basic error reporting.";
}
revision 2016-11-12 {
description
"Initial revision.";
}
grouping error-reporting {
leaf status { type uint8; default 0; }
leaf error { type string; }
}
rpc describe {
output {
leaf native-schema { type string; mandatory true; }
leaf default-schema { type string; mandatory true; }
leaf-list alternate-schema { type string; }
list capability {
key module;
leaf module { type string; }
leaf-list feature { type string; }
}
}
}
rpc get-schema {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
}
output {
uses error-reporting;
leaf source { type string; }
}
}
rpc get-config {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf path { type string; default "/"; }
leaf print-default { type boolean; }
leaf format { type string; }
}
output {
uses error-reporting;
leaf config { type string; }
}
}
rpc set-config {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf path { type string; default "/"; }
leaf config { type string; mandatory true; }
}
output {
uses error-reporting;
}
}
rpc add-config {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf path { type string; mandatory true; }
leaf config { type string; mandatory true; }
}
output {
uses error-reporting;
}
}
rpc remove-config {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf path { type string; mandatory true; }
}
output {
uses error-reporting;
}
}
rpc get-state {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf path { type string; default "/"; }
leaf print-default { type boolean; }
leaf format { type string; }
}
output {
uses error-reporting;
leaf state { type string; }
}
}
rpc get-alarms-state {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf path { type string; default "/"; }
leaf print-default { type boolean; }
leaf format { type string; }
}
output {
uses error-reporting;
leaf state { type string; }
}
}
rpc attach-listener {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
}
output {
uses error-reporting;
}
}
rpc attach-notification-listener {
output {
uses error-reporting;
}
}
rpc set-alarm-operator-state {
description
"This is a means for the operator to indicate
the level of human intervention on an alarm.";
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf print-default { type boolean; }
leaf format { type string; }
leaf resource { type string; mandatory true; }
leaf alarm-type-id { type string; mandatory true; }
leaf alarm-type-qualifier { type string; mandatory true; }
leaf state { type al:operator-state; mandatory true; }
leaf text { type string; description "Additional optional textual information."; }
}
output {
uses error-reporting;
leaf success { type boolean; description "True if operation succeeded."; }
}
}
grouping filter-input {
description
"Grouping to specify a filter construct on alarm information.";
leaf alarm-status {
type string;
mandatory true;
description
"The clearance status of the alarm.";
}
leaf older-than {
type string;
description "Matches the 'last-status-change' leaf in the alarm.";
}
leaf severity {
type string;
description "Filter based on severity.";
}
leaf operator-state-filter {
type string;
description "Filter based on operator state.";
}
}
rpc purge-alarms {
description
"This operation requests the server to delete entries from the
alarm list according to the supplied criteria. Typically it
can be used to delete alarms that are in closed operator state
and older than a specified time. The number of purged alarms
is returned as an output parameter";
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf print-default { type boolean; }
leaf format { type string; }
uses filter-input;
}
output {
uses error-reporting;
leaf purged-alarms {
type uint32;
description "Number of purged alarms.";
}
}
}
rpc compress-alarms {
description
"This operation requests the server to compress entries in the
alarm list by removing all but the latest state change for all
alarms. Conditions in the input are logically ANDed. If no
input condition is given, all alarms are compressed.";
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf print-default { type boolean; }
leaf format { type string; }
leaf resource {
type string;
description
"Compress the alarms with this resource.";
}
leaf alarm-type-id {
type string;
description
"Compress alarms with this alarm-type-id.";
}
leaf alarm-type-qualifier {
type string;
description
"Compress the alarms with this alarm-type-qualifier.";
}
}
output {
leaf compressed-alarms {
type uint32;
description
"Number of compressed alarm entries.";
}
}
}
}
| YANG | 5 | peahonen/snabb | src/lib/yang/snabb-config-leader-v1.yang | [
"Apache-2.0"
] |
---
title: "Men's and Women's Tennis"
author: "Thomas Mock"
date: "4/6/2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(tidyverse)
library(rvest)
library(lubridate)
library(janitor)
```
### Get Women's Slams Records
I couldn't find a great source of historical dates for the grand slam winner's dates but they are consistently within a few days of each other based off my cursory examination. I fully ackowledge that the dates used for the tournament date are only estimations.
```{r}
raw_slams <- read_html("https://en.wikipedia.org/wiki/List_of_Grand_Slam_women%27s_singles_champions") %>%
html_table(fill = TRUE) %>%
.[[3]] %>%
janitor::clean_names()
clean_slams <- raw_slams %>%
filter(year >= 1968) %>%
gather(key = "grand_slam", "winner", australian_open:us_open) %>%
separate(col = winner, sep = "\\(", into = c("winner", "win_count")) %>%
separate(col = win_count, sep = "/", into = c("rolling_win_count", "total_win_count")) %>%
mutate(winner = str_trim(winner),
rolling_win_count = as.integer(rolling_win_count),
total_win_count = as.integer(str_extract(total_win_count, "[:digit:]+"))) %>%
rename(name = winner) %>%
mutate(name = str_trim(str_remove(name, "‡")),
name = str_trim(str_remove(name, "Open era tennis begins|Tournament date changed"))) %>%
filter(str_length(name) > 4) %>%
mutate(name = case_when(str_detect(name, "Goolagong") ~ "Evonne Goolagong Cawley",
TRUE ~ name)) %>%
mutate(tournament_date = case_when(grand_slam == "australian_open" ~ paste0(year, "-01-10"),
grand_slam == "french_open" ~ paste0(year, "-06-09"),
grand_slam == "us_open" ~ paste0(year, "-09-09"),
grand_slam == "wimbledon" ~ paste0(year, "-07-14"),
TRUE ~ NA_character_),
tournament_date = lubridate::ymd(tournament_date),
gender = "Female") %>%
group_by(name) %>%
arrange(tournament_date) %>%
mutate(rolling_win_count = row_number()) %>%
ungroup()
```
### Get Mens Slams Records
```{r}
raw_slams_men <- read_html("https://en.wikipedia.org/wiki/List_of_Grand_Slam_men%27s_singles_champions") %>%
html_nodes(xpath = '//*[@id="mw-content-text"]/div/table[1]') %>%
html_table(fill = TRUE) %>% .[[1]] %>% janitor::clean_names()
clean_slams_men <- raw_slams_men %>%
filter(year >= 1968) %>%
gather(key = "grand_slam", "winner", australian_open:us_open) %>%
separate(col = winner, sep = "\\(", into = c("winner", "win_count")) %>%
separate(col = win_count, sep = "/", into = c("rolling_win_count", "total_win_count")) %>%
separate(col = winner, into = c("country", "winner"), sep = ":", fill = "left") %>%
mutate(winner = str_trim(winner),
rolling_win_count = as.integer(rolling_win_count),
total_win_count = as.integer(str_extract(total_win_count, "[:digit:]+"))) %>%
rename(name = winner) %>%
mutate(name = str_trim(str_remove_all(name, "‡|†")),
name = str_trim(str_remove(name, "Amateur era tennis ends|Open era tennis begins|Tournament date changed"))) %>%
filter(str_length(name) > 4) %>%
mutate(tournament_date = case_when(grand_slam == "australian_open" ~ paste0(year, "-01-10"),
grand_slam == "french_open" ~ paste0(year, "-06-09"),
grand_slam == "us_open" ~ paste0(year, "-09-09"),
grand_slam == "wimbledon" ~ paste0(year, "-07-14"),
TRUE ~ NA_character_),
tournament_date = lubridate::ymd(tournament_date),
gender = "Male") %>%
select(-country) %>%
group_by(name) %>%
arrange(tournament_date) %>%
mutate(rolling_win_count = row_number()) %>%
ungroup()
```
### Get the Dates of Birth for women
This got the majority of women but I had to manually add birthdates for Ann and Chris.
```{r}
clean_dob <- read_html("https://en.wikipedia.org/wiki/List_of_Grand_Slam_singles_champions_in_Open_Era_with_age_of_first_title") %>%
html_table(fill = TRUE) %>%
.[[2]] %>%
janitor::clean_names() %>%
select(name, "grand_slam" = tournament, date_of_birth, date_of_first_title) %>%
mutate(name = str_trim(str_remove(name, "\\*")),
grand_slam = str_trim(str_remove(grand_slam, "[:digit:]+")),
date_of_birth = lubridate::dmy(date_of_birth),
date_of_first_title = lubridate::dmy(date_of_first_title),
age = date_of_first_title - date_of_birth) %>%
mutate(name = case_when(str_detect(name, "Goolagong") ~ "Evonne Goolagong Cawley",
str_detect(name, "Reid") ~ "Kerry Melville Reid",
str_detect(name, "Vicario") ~ "Arantxa Sánchez Vicario",
TRUE ~ name)) %>%
bind_rows(tibble(name = c("Ann Haydon-Jones","Chris O'Neil"),
date_of_birth = c(lubridate::dmy("7 October 1938"), lubridate::dmy("19 March 1956"))))
dob_df <- clean_dob %>%
select(date_of_birth, name)
```
### Combine to get approx age at each tourney
```{r}
age_slams <- left_join(clean_slams, dob_df, by = c("name")) %>%
mutate(age = tournament_date - date_of_birth) %>%
group_by(name, age) %>%
summarize(counts = n()) %>%
group_by(name) %>%
mutate(total_wins = cumsum(counts)) %>%
arrange(desc(total_wins))
```
### MEN
```{r}
clean_dob_men <- read_html("https://en.wikipedia.org/wiki/List_of_Grand_Slam_singles_champions_in_Open_Era_with_age_of_first_title") %>%
html_table(fill = TRUE) %>%
.[[1]] %>%
janitor::clean_names() %>%
select(name, "grand_slam" = tournament, date_of_birth, date_of_first_title) %>%
mutate(name = str_trim(str_remove(name, "\\*")),
grand_slam = str_trim(str_remove(grand_slam, "[:digit:]+")),
date_of_birth = lubridate::dmy(date_of_birth),
date_of_first_title = lubridate::dmy(date_of_first_title),
age = date_of_first_title - date_of_birth) %>%
bind_rows(tibble(name = "William Bowrey",
date_of_birth = lubridate::dmy("25 December 1943")))
dob_df_men <- clean_dob_men %>%
select(date_of_birth, name)
```
### Combine
```{r}
age_slams_men <- left_join(clean_slams_men, dob_df_men, by = c("name")) %>%
mutate(age = tournament_date - date_of_birth) %>%
group_by(name, age) %>%
summarize(counts = n()) %>%
group_by(name) %>%
mutate(total_wins = cumsum(counts)) %>%
arrange(desc(total_wins))
age_slams_men %>%
ggplot(aes(x = age, y = total_wins, group = name)) +
geom_point() +
geom_step()
```
### Total Combine
```{r}
grand_slams <- bind_rows(clean_slams, clean_slams_men) %>%
select(-total_win_count)
```
```{r}
player_dob <- bind_rows(clean_dob, clean_dob_men)
```
```{r}
age_slams_comb <- left_join(grand_slams, player_dob, by = c("name")) %>%
mutate(age = tournament_date - date_of_birth) %>%
group_by(name, age, gender) %>%
summarize(counts = n()) %>%
group_by(name) %>%
mutate(total_wins = cumsum(counts)) %>%
arrange(desc(total_wins))
# test plot
age_slams_comb %>%
ggplot(aes(x = age, y = total_wins, group = name)) +
geom_point() +
geom_step() +
facet_wrap(~gender)
```
```{r}
write_csv(grand_slams, "grand_slams.csv")
write_csv(player_dob, "player_dob.csv")
```
### Tennis Timeline Performance
I thought this was interesting data that could lead to some unique plots.
```{r}
yr_1968_1970 <- read_html("https://en.wikipedia.org/wiki/Tennis_performance_timeline_comparison_(women)_(1884%E2%80%931977)") %>%
html_table(fill = TRUE) %>%
.[[12]]
clean_1968_1970 <- yr_1968_1970 %>%
set_names(nm = paste0(names(yr_1968_1970), "_", yr_1968_1970[1,])) %>%
filter(Player_Player != "Player") %>%
gather(key = year_tourn, value = outcome, `1964_AUS`:`1970_USA`) %>%
separate(col = year_tourn, into = c("year", "tournament"), sep = "_") %>%
rename(player = Player_Player) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1968)
yr_1971_1977 <- read_html("https://en.wikipedia.org/wiki/Tennis_performance_timeline_comparison_(women)_(1884%E2%80%931977)") %>%
html_table(fill = TRUE) %>%
.[[13]]
clean_1971_1977 <- yr_1971_1977 %>%
set_names(nm = paste0(names(yr_1971_1977), "_", yr_1971_1977[1,])) %>%
filter(Player_Player != "Player") %>%
gather(key = year_tourn, value = outcome, `1971_AUS`:`1977_AUSD`) %>%
separate(col = year_tourn, into = c("year", "tournament"), sep = "_") %>%
rename(player = Player_Player) %>%
mutate(year = as.integer(year))
names(yr_1968_1970) %>% unique() %>% .[. != "Player"] %>% as.integer()
```
I re-factored into a function but there were some gotchas in the data that limited where I could apply the function. Given I will never use it again I will somewhat break DRY principles for my own sake.
```{r}
get_timeline <- function(table_num){
Sys.sleep(5)
url <- "https://en.wikipedia.org/wiki/Tennis_performance_timeline_comparison_(women)"
df <- read_html(url) %>% html_table(fill = TRUE) %>% .[[table_num]]
year_range <- names(df) %>%
unique() %>%
.[. != "Player"] %>%
as.integer()
year_min <- min(year_range)
year_max <- max(year_range)
tourn_list <- df %>% janitor::clean_names() %>% slice(1) %>% unlist(., use.names = FALSE) %>% .[!is.na(.)]
first_tourn <- tourn_list[2]
last_tourn <- tourn_list[length(tourn_list)]
df %>%
set_names(nm = paste0(df[1,], "_", names(df))) %>%
filter(Player_Player != "Player") %>%
gather(key = year_tourn, value = outcome,
paste(first_tourn, year_min, sep = "_"):paste(last_tourn, year_max, sep = "_")) %>%
separate(col = year_tourn, into = c("tournament", "year"), sep = "_") %>%
rename(player = Player_Player) %>%
mutate(year = as.integer(year))
}
```
# Collect women's timeline
```{r}
clean_1978_2012 <- 5:9 %>%
map(get_timeline) %>%
bind_rows()
```
```{r}
df_2013_2019 <- read_html("https://en.wikipedia.org/wiki/Tennis_performance_timeline_comparison_(women)") %>%
html_table(fill = TRUE) %>%
.[[10]]
clean_2013_2019 <- df_2013_2019 %>%
set_names(nm = paste0(df_2013_2019[1,], "_", names(df_2013_2019))) %>%
filter(Player_Player != "Player") %>%
select(-31) %>%
gather(key = year_tourn, value = outcome,
paste("AUS", "2013", sep = "_"):paste("AUS", "2019", sep = "_")) %>%
separate(col = year_tourn, into = c("tournament", "year"), sep = "_") %>%
rename(player = Player_Player) %>%
mutate(year = as.integer(year)) %>%
select(-contains("2019"))
```
```{r}
final_timeline <- bind_rows(list(clean_1968_1970, clean_1971_1977, clean_1978_2012, clean_2013_2019)) %>%
mutate(outcome = case_when(outcome == "W" ~ "Won",
outcome == "F" ~ "Finalist",
outcome == "SF" ~ "Semi-finalist",
outcome == "QF" ~ "Quarterfinalist",
outcome == "4R" ~ "4th Round",
outcome == "3R" ~ "3rd Round",
outcome == "2R" ~ "2nd Round",
outcome == "1R" ~ "1st Round",
outcome == "RR" ~ "Round-robin stage",
outcome == "Q2" ~ "Qualification Stage 2",
outcome == "Q1" ~ "Qualification Stage 1",
outcome == "A" ~ "Absent",
str_detect(outcome, "Retired") ~ "Retired",
outcome == "-" ~ NA_character_,
outcome == "LQ" ~ "Lost Qualifier",
TRUE ~ NA_character_),
tournament = case_when(str_detect(tournament, "AUS") ~ "Australian Open",
str_detect(tournament, "USA") ~ "US Open",
str_detect(tournament, "FRA") ~ "French Open",
str_detect(tournament, "WIM") ~ "Wimbledon",
TRUE ~ NA_character_)) %>%
filter(!is.na(tournament)) %>%
mutate(gender = "Female")
```
```{r}
final_timeline %>% group_by(tournament) %>% count(sort = TRUE)
```
### MENS Timeline
The function works a bit nicer here and I have further re-factored it.
```{r}
get_timeline_men <- function(table_num){
Sys.sleep(5)
url <- "https://en.wikipedia.org/wiki/Tennis_performance_timeline_comparison_(men)"
df <- read_html(url) %>% html_table(fill = TRUE) %>% .[[table_num]]
year_range <- names(df) %>%
unique() %>%
.[. != "Player"] %>%
na.omit() %>%
as.integer()
year_min <- min(year_range)
year_max <- max(year_range)
tourn_list <- df %>% janitor::clean_names() %>% slice(1) %>% unlist(., use.names = FALSE) %>% .[!is.na(.)]
first_tourn <- tourn_list[2]
last_tourn <- tourn_list[length(tourn_list)]
df %>%
set_names(nm = paste0(df[1,], "_", names(df))) %>%
janitor::clean_names("all_caps") %>%
select(-matches("NA")) %>%
select(player = PLAYER_PLAYER, matches("AUS|FRA|WIM|USA")) %>%
select(-matches("NA|`NA`")) %>%
filter(player != "Player") %>%
gather(key = year_tourn, value = outcome,
paste(first_tourn, year_min, sep = "_"):paste(last_tourn, year_max, sep = "_")) %>%
separate(col = year_tourn, into = c("tournament", "year"), sep = "_") %>%
mutate(year = as.integer(year))
}
```
```{r}
men_2013_2019 <- read_html("https://en.wikipedia.org/wiki/Tennis_performance_timeline_comparison_(men)") %>%
html_table(fill = TRUE) %>%
.[[8]]
clean_2013_2019 <- df_2013_2019 %>%
set_names(nm = paste0(df_2013_2019[1,], "_", names(df_2013_2019))) %>%
filter(Player_Player != "Player") %>%
select(-31) %>%
gather(key = year_tourn, value = outcome,
paste("AUS", "2013", sep = "_"):paste("AUS", "2019", sep = "_")) %>%
separate(col = year_tourn, into = c("tournament", "year"), sep = "_") %>%
rename(player = Player_Player) %>%
mutate(year = as.integer(year)) %>%
select(-contains("2019"))
```
```{r}
clean_men_1967_2019 <- 3:10 %>%
map(get_timeline_men) %>%
bind_rows() %>%
filter(year > 1967)
final_timeline_men <- clean_men_1967_2019 %>%
mutate(outcome = case_when(outcome == "W" ~ "Won",
outcome == "F" ~ "Finalist",
outcome == "SF" ~ "Semi-finalist",
outcome == "QF" ~ "Quarterfinalist",
outcome == "4R" ~ "4th Round",
outcome == "3R" ~ "3rd Round",
outcome == "2R" ~ "2nd Round",
outcome == "1R" ~ "1st Round",
outcome == "RR" ~ "Round-robin stage",
outcome == "Q2" ~ "Qualification Stage 2",
outcome == "Q1" ~ "Qualification Stage 1",
outcome == "A" ~ "Absent",
str_detect(outcome, "Retired") ~ "Retired",
outcome == "-" ~ NA_character_,
outcome == "LQ" ~ "Lost Qualifier",
TRUE ~ NA_character_),
tournament = case_when(str_detect(tournament, "AUS") ~ "Australian Open",
str_detect(tournament, "USA") ~ "US Open",
str_detect(tournament, "FRA") ~ "French Open",
str_detect(tournament, "WIM") ~ "Wimbledon",
TRUE ~ NA_character_)) %>%
filter(!is.na(tournament)) %>%
mutate(gender = "Male")
```
```{r}
both_timeline <- bind_rows(final_timeline, final_timeline_men) %>%
filter(str_length(player) > 4) %>%
filter(year <= 2019)
anti_timeline <- both_timeline %>%
filter(year == 2019 & tournament != "Australian Open")
combined_timeline <- anti_join(both_timeline, anti_timeline)
```
```{r}
write_csv(combined_timeline, "grand_slam_timeline.csv")
```
| RMarkdown | 5 | StephRoark/tidytuesday-1 | data/2019/2019-04-09/tennis_pros.rmd | [
"CC0-1.0"
] |
import haxe.macro.Compiler;
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Expr.Field;
class Main {
static function main() OldClass.define();
}
#if !macro
@:build(OldClass.build())
#end
@:native("NewClass")
class OldClass {
#if !macro
public function new() {};
#end
macro public static function define():Expr return macro new OldClass();
macro static function build():Array<Field>
{
var defined = false;
Context.onAfterTyping(_ -> {
if (defined) return;
Context.defineType(
macro class NewClass {
public function new() {}
}
);
Compiler.exclude('OldClass');
defined = true;
});
return null;
}
} | Haxe | 3 | Alan-love/haxe | tests/misc/java/projects/Issue10280/Main.hx | [
"MIT"
] |
/**
Copyright 2015 Acacia Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.acacia.log;
import x10.compiler.Native;
public class Logger {
public static def trace(val message:String){
call_trace(message);
}
public static def debug(val message:String){
call_debug(message);
}
public static def info(val message:String){
call_info(message);
}
public static def warn(val message:String){
call_warn(message);
}
public static def error(val message:String){
call_error(message);
}
public static def fatal(val message:String){
call_fatal(message);
}
@Native("java", "org.acacia.log.java.Logger_Java.trace(#1)")
static native def call_trace(String):void;
@Native("java", "org.acacia.log.java.Logger_Java.debug(#1)")
static native def call_debug(String):void;
@Native("java", "org.acacia.log.java.Logger_Java.info(#1)")
static native def call_info(String):void;
@Native("java", "org.acacia.log.java.Logger_Java.warn(#1)")
static native def call_warn(String):void;
@Native("java", "org.acacia.log.java.Logger_Java.error(#1)")
static native def call_error(String):void;
@Native("java", "org.acacia.log.java.Logger_Java.fatal(#1)")
static native def call_fatal(String):void;
} | X10 | 4 | mdherath/Acacia | src/org/acacia/log/Logger.x10 | [
"Apache-2.0"
] |
name = "LibSSH2_jll"
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
version = "1.9.1+2"
[deps]
MbedTLS_jll = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
[compat]
julia = "1.6"
[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[targets]
test = ["Test"]
| TOML | 3 | jonas-schulze/julia | stdlib/LibSSH2_jll/Project.toml | [
"MIT"
] |
hello-world = (name = "World") ->
console.log "Hello, ${name}!"
# usage:
# with parameter
hello-world "Dude" # => "Hello, Dude!"
# parameterless call with default
hello-world! # => "Hello, World!" | LiveScript | 4 | kennethsequeira/Hello-world | LiveScript/hello-world.ls | [
"MIT"
] |
DROP TRIGGER event_trigger_table_name_update_trigger ON hdb_catalog.hdb_table;
DROP FUNCTION hdb_catalog.event_trigger_table_name_update();
ALTER TABLE hdb_catalog.event_triggers
ADD CONSTRAINT event_triggers_schema_name_table_name_fkey
FOREIGN KEY (schema_name, table_name)
REFERENCES hdb_catalog.hdb_table(table_schema, table_name)
ON UPDATE CASCADE;
| SQL | 3 | gh-oss-contributor/graphql-engine-1 | server/src-rsr/migrations/40_to_39.sql | [
"Apache-2.0",
"MIT"
] |
#---------------------------------------------------------------------------
#
# zz40-xc-ovr.m4
#
# Copyright (c) 2013 - 2018 Daniel Stenberg <[email protected]>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
#---------------------------------------------------------------------------
dnl The funny name of this file is intentional in order to make it
dnl sort alphabetically after any libtool, autoconf or automake
dnl provided .m4 macro file that might get copied into this same
dnl subdirectory. This allows that macro (re)definitions from this
dnl file may override those provided in other files.
dnl Version macros
dnl -------------------------------------------------
dnl Public macros.
m4_define([XC_CONFIGURE_PREAMBLE_VER_MAJOR],[1])dnl
m4_define([XC_CONFIGURE_PREAMBLE_VER_MINOR],[0])dnl
dnl _XC_CFG_PRE_PREAMBLE
dnl -------------------------------------------------
dnl Private macro.
AC_DEFUN([_XC_CFG_PRE_PREAMBLE],
[
## -------------------------------- ##
@%:@@%:@ [XC_CONFIGURE_PREAMBLE] ver: []dnl
XC_CONFIGURE_PREAMBLE_VER_MAJOR.[]dnl
XC_CONFIGURE_PREAMBLE_VER_MINOR ##
## -------------------------------- ##
xc_configure_preamble_ver_major='XC_CONFIGURE_PREAMBLE_VER_MAJOR'
xc_configure_preamble_ver_minor='XC_CONFIGURE_PREAMBLE_VER_MINOR'
#
# Set IFS to space, tab and newline.
#
xc_space=' '
xc_tab=' '
xc_newline='
'
IFS="$xc_space$xc_tab$xc_newline"
#
# Set internationalization behavior variables.
#
LANG='C'
LC_ALL='C'
LANGUAGE='C'
export LANG
export LC_ALL
export LANGUAGE
#
# Some useful variables.
#
xc_msg_warn='configure: WARNING:'
xc_msg_abrt='Can not continue.'
xc_msg_err='configure: error:'
])
dnl _XC_CFG_PRE_BASIC_CHK_CMD_ECHO
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'echo' command
dnl is available, otherwise aborts execution.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO],
[dnl
AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl
#
# Verify that 'echo' command is available, otherwise abort.
#
xc_tst_str='unknown'
(`echo "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success'
case "x$xc_tst_str" in @%:@ ((
xsuccess)
:
;;
*)
# Try built-in echo, and fail.
echo "$xc_msg_err 'echo' command not found. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_BASIC_CHK_CMD_TEST
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'test' command
dnl is available, otherwise aborts execution.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_TEST],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
#
# Verify that 'test' command is available, otherwise abort.
#
xc_tst_str='unknown'
(`test -n "$xc_tst_str" >/dev/null 2>&1`) && xc_tst_str='success'
case "x$xc_tst_str" in @%:@ ((
xsuccess)
:
;;
*)
echo "$xc_msg_err 'test' command not found. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_BASIC_CHK_VAR_PATH
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'PATH' variable
dnl is set, otherwise aborts execution.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_VAR_PATH],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
#
# Verify that 'PATH' variable is set, otherwise abort.
#
xc_tst_str='unknown'
(`test -n "$PATH" >/dev/null 2>&1`) && xc_tst_str='success'
case "x$xc_tst_str" in @%:@ ((
xsuccess)
:
;;
*)
echo "$xc_msg_err 'PATH' variable not set. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_BASIC_CHK_CMD_EXPR
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'expr' command
dnl is available, otherwise aborts execution.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
#
# Verify that 'expr' command is available, otherwise abort.
#
xc_tst_str='unknown'
xc_tst_str=`expr "$xc_tst_str" : '.*' 2>/dev/null`
case "x$xc_tst_str" in @%:@ ((
x7)
:
;;
*)
echo "$xc_msg_err 'expr' command not found. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_SED
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'sed' utility
dnl is found within 'PATH', otherwise aborts execution.
dnl
dnl This 'sed' is required in order to allow configure
dnl script bootstrapping itself. No fancy testing for a
dnl proper 'sed' this early, that should be done later.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_SED],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
#
# Verify that 'sed' utility is found within 'PATH', otherwise abort.
#
xc_tst_str='unknown'
xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
| sed -e 's:unknown:success:' 2>/dev/null`
case "x$xc_tst_str" in @%:@ ((
xsuccess)
:
;;
*)
echo "$xc_msg_err 'sed' utility not found in 'PATH'. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_GREP
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'grep' utility
dnl is found within 'PATH', otherwise aborts execution.
dnl
dnl This 'grep' is required in order to allow configure
dnl script bootstrapping itself. No fancy testing for a
dnl proper 'grep' this early, that should be done later.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
#
# Verify that 'grep' utility is found within 'PATH', otherwise abort.
#
xc_tst_str='unknown'
(`echo "$xc_tst_str" 2>/dev/null \
| grep 'unknown' >/dev/null 2>&1`) && xc_tst_str='success'
case "x$xc_tst_str" in @%:@ ((
xsuccess)
:
;;
*)
echo "$xc_msg_err 'grep' utility not found in 'PATH'. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_TR
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'tr' utility
dnl is found within 'PATH', otherwise aborts execution.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_TR],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
#
# Verify that 'tr' utility is found within 'PATH', otherwise abort.
#
xc_tst_str="${xc_tab}98s7u6c5c4e3s2s10"
xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
| tr -d "0123456789$xc_tab" 2>/dev/null`
case "x$xc_tst_str" in @%:@ ((
xsuccess)
:
;;
*)
echo "$xc_msg_err 'tr' utility not found in 'PATH'. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_WC
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'wc' utility
dnl is found within 'PATH', otherwise aborts execution.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_WC],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
#
# Verify that 'wc' utility is found within 'PATH', otherwise abort.
#
xc_tst_str='unknown unknown unknown unknown'
xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
| wc -w 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null`
case "x$xc_tst_str" in @%:@ ((
x4)
:
;;
*)
echo "$xc_msg_err 'wc' utility not found in 'PATH'. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_BASIC_CHK_UTIL_CAT
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that verifies that 'cat' utility
dnl is found within 'PATH', otherwise aborts execution.
AC_DEFUN([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
#
# Verify that 'cat' utility is found within 'PATH', otherwise abort.
#
xc_tst_str='unknown'
xc_tst_str=`cat <<_EOT 2>/dev/null \
| wc -l 2>/dev/null | tr -d "$xc_space$xc_tab" 2>/dev/null
unknown
unknown
unknown
_EOT`
case "x$xc_tst_str" in @%:@ ((
x3)
:
;;
*)
echo "$xc_msg_err 'cat' utility not found in 'PATH'. $xc_msg_abrt" >&2
exit 1
;;
esac
])
dnl _XC_CFG_PRE_CHECK_PATH_SEPARATOR
dnl -------------------------------------------------
dnl Private macro.
dnl
dnl Emits shell code that computes the path separator
dnl and stores the result in 'PATH_SEPARATOR', unless
dnl the user has already set it with a non-empty value.
dnl
dnl This path separator is the symbol used to separate
dnl or diferentiate paths inside the 'PATH' environment
dnl variable.
dnl
dnl Non-empty user provided 'PATH_SEPARATOR' always
dnl overrides the auto-detected one.
AC_DEFUN([_XC_CFG_PRE_CHECK_PATH_SEPARATOR],
[dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
#
# Auto-detect and set 'PATH_SEPARATOR', unless it is already non-empty set.
#
# Directory count in 'PATH' when using a colon separator.
xc_tst_dirs_col='x'
xc_tst_prev_IFS=$IFS; IFS=':'
for xc_tst_dir in $PATH; do
IFS=$xc_tst_prev_IFS
xc_tst_dirs_col="x$xc_tst_dirs_col"
done
IFS=$xc_tst_prev_IFS
xc_tst_dirs_col=`expr "$xc_tst_dirs_col" : '.*'`
# Directory count in 'PATH' when using a semicolon separator.
xc_tst_dirs_sem='x'
xc_tst_prev_IFS=$IFS; IFS=';'
for xc_tst_dir in $PATH; do
IFS=$xc_tst_prev_IFS
xc_tst_dirs_sem="x$xc_tst_dirs_sem"
done
IFS=$xc_tst_prev_IFS
xc_tst_dirs_sem=`expr "$xc_tst_dirs_sem" : '.*'`
if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then
# When both counting methods give the same result we do not want to
# chose one over the other, and consider auto-detection not possible.
if test -z "$PATH_SEPARATOR"; then
# User should provide the correct 'PATH_SEPARATOR' definition.
# Until then, guess that it is colon!
echo "$xc_msg_warn path separator not determined, guessing colon" >&2
PATH_SEPARATOR=':'
fi
else
# Separator with the greater directory count is the auto-detected one.
if test $xc_tst_dirs_sem -gt $xc_tst_dirs_col; then
xc_tst_auto_separator=';'
else
xc_tst_auto_separator=':'
fi
if test -z "$PATH_SEPARATOR"; then
# Simply use the auto-detected one when not already set.
PATH_SEPARATOR=$xc_tst_auto_separator
elif test "x$PATH_SEPARATOR" != "x$xc_tst_auto_separator"; then
echo "$xc_msg_warn 'PATH_SEPARATOR' does not match auto-detected one." >&2
fi
fi
xc_PATH_SEPARATOR=$PATH_SEPARATOR
AC_SUBST([PATH_SEPARATOR])dnl
])
dnl _XC_CFG_PRE_POSTLUDE
dnl -------------------------------------------------
dnl Private macro.
AC_DEFUN([_XC_CFG_PRE_POSTLUDE],
[dnl
AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl
AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl
dnl
xc_configure_preamble_result='yes'
])
dnl XC_CONFIGURE_PREAMBLE
dnl -------------------------------------------------
dnl Public macro.
dnl
dnl This macro emits shell code which does some
dnl very basic checks related with the availability
dnl of some commands and utilities needed to allow
dnl configure script bootstrapping itself when using
dnl these to figure out other settings. Also emits
dnl code that performs PATH_SEPARATOR auto-detection
dnl and sets its value unless it is already set with
dnl a non-empty value.
dnl
dnl These basic checks are intended to be placed and
dnl executed as early as possible in the resulting
dnl configure script, and as such these must be pure
dnl and portable shell code.
dnl
dnl This macro may be used directly, or indirectly
dnl when using other macros that AC_REQUIRE it such
dnl as XC_CHECK_PATH_SEPARATOR.
dnl
dnl Currently the mechanism used to ensure that this
dnl macro expands early enough in generated configure
dnl script is making it override autoconf and libtool
dnl PATH_SEPARATOR check.
AC_DEFUN([XC_CONFIGURE_PREAMBLE],
[dnl
AC_PREREQ([2.50])dnl
dnl
AC_BEFORE([$0],[_XC_CFG_PRE_PREAMBLE])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl
AC_BEFORE([$0],[_XC_CFG_PRE_POSTLUDE])dnl
dnl
AC_BEFORE([$0],[AC_CHECK_TOOL])dnl
AC_BEFORE([$0],[AC_CHECK_PROG])dnl
AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl
AC_BEFORE([$0],[AC_CHECK_PROGS])dnl
dnl
AC_BEFORE([$0],[AC_PATH_TOOL])dnl
AC_BEFORE([$0],[AC_PATH_PROG])dnl
AC_BEFORE([$0],[AC_PATH_PROGS])dnl
dnl
AC_BEFORE([$0],[AC_PROG_SED])dnl
AC_BEFORE([$0],[AC_PROG_GREP])dnl
AC_BEFORE([$0],[AC_PROG_LN_S])dnl
AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl
AC_BEFORE([$0],[AC_PROG_INSTALL])dnl
AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl
AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl
dnl
AC_BEFORE([$0],[LT_INIT])dnl
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl
dnl
AC_REQUIRE([_XC_CFG_PRE_PREAMBLE])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_ECHO])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_TEST])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_VAR_PATH])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_CMD_EXPR])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_SED])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_GREP])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_TR])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_WC])dnl
AC_REQUIRE([_XC_CFG_PRE_BASIC_CHK_UTIL_CAT])dnl
AC_REQUIRE([_XC_CFG_PRE_CHECK_PATH_SEPARATOR])dnl
AC_REQUIRE([_XC_CFG_PRE_POSTLUDE])dnl
dnl
m4_pattern_forbid([^_*XC])dnl
m4_define([$0],[])dnl
])
dnl Override autoconf and libtool PATH_SEPARATOR check
dnl -------------------------------------------------
dnl Macros overriding.
dnl
dnl This is done to ensure that the same check is
dnl used across different autoconf versions and to
dnl allow expansion of XC_CONFIGURE_PREAMBLE macro
dnl early enough in the generated configure script.
dnl
dnl Override when using autoconf 2.53 and newer.
dnl
m4_ifdef([_AS_PATH_SEPARATOR_PREPARE],
[dnl
m4_undefine([_AS_PATH_SEPARATOR_PREPARE])dnl
m4_defun([_AS_PATH_SEPARATOR_PREPARE],
[dnl
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl
m4_define([$0],[])dnl
])dnl
])
dnl
dnl Override when using autoconf 2.50 to 2.52
dnl
m4_ifdef([_AC_INIT_PREPARE_FS_SEPARATORS],
[dnl
m4_undefine([_AC_INIT_PREPARE_FS_SEPARATORS])dnl
m4_defun([_AC_INIT_PREPARE_FS_SEPARATORS],
[dnl
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl
ac_path_separator=$PATH_SEPARATOR
m4_define([$0],[])dnl
])dnl
])
dnl
dnl Override when using libtool 1.4.2
dnl
m4_ifdef([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
[dnl
m4_undefine([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
m4_defun([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
[dnl
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl
lt_cv_sys_path_separator=$PATH_SEPARATOR
m4_define([$0],[])dnl
])dnl
])
dnl XC_CHECK_PATH_SEPARATOR
dnl -------------------------------------------------
dnl Public macro.
dnl
dnl Usage of this macro ensures that generated configure
dnl script uses the same PATH_SEPARATOR check irrespective
dnl of autoconf or libtool version being used to generate
dnl configure script.
dnl
dnl Emits shell code that computes the path separator
dnl and stores the result in 'PATH_SEPARATOR', unless
dnl the user has already set it with a non-empty value.
dnl
dnl This path separator is the symbol used to separate
dnl or diferentiate paths inside the 'PATH' environment
dnl variable.
dnl
dnl Non-empty user provided 'PATH_SEPARATOR' always
dnl overrides the auto-detected one.
dnl
dnl Strictly speaking the check is done in two steps. The
dnl first, which does the actual check, takes place in
dnl XC_CONFIGURE_PREAMBLE macro and happens very early in
dnl generated configure script. The second one shows and
dnl logs the result of the check into config.log at a later
dnl configure stage. Placement of this second stage in
dnl generated configure script will be done where first
dnl direct or indirect usage of this macro happens.
AC_DEFUN([XC_CHECK_PATH_SEPARATOR],
[dnl
AC_PREREQ([2.50])dnl
dnl
AC_BEFORE([$0],[AC_CHECK_TOOL])dnl
AC_BEFORE([$0],[AC_CHECK_PROG])dnl
AC_BEFORE([$0],[AC_CHECK_TOOLS])dnl
AC_BEFORE([$0],[AC_CHECK_PROGS])dnl
dnl
AC_BEFORE([$0],[AC_PATH_TOOL])dnl
AC_BEFORE([$0],[AC_PATH_PROG])dnl
AC_BEFORE([$0],[AC_PATH_PROGS])dnl
dnl
AC_BEFORE([$0],[AC_PROG_SED])dnl
AC_BEFORE([$0],[AC_PROG_GREP])dnl
AC_BEFORE([$0],[AC_PROG_LN_S])dnl
AC_BEFORE([$0],[AC_PROG_MKDIR_P])dnl
AC_BEFORE([$0],[AC_PROG_INSTALL])dnl
AC_BEFORE([$0],[AC_PROG_MAKE_SET])dnl
AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl
dnl
AC_BEFORE([$0],[LT_INIT])dnl
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
AC_BEFORE([$0],[AC_LIBTOOL_WIN32_DLL])dnl
dnl
AC_REQUIRE([XC_CONFIGURE_PREAMBLE])dnl
dnl
#
# Check that 'XC_CONFIGURE_PREAMBLE' has already run.
#
if test -z "$xc_configure_preamble_result"; then
AC_MSG_ERROR([xc_configure_preamble_result not set (internal problem)])
fi
#
# Check that 'PATH_SEPARATOR' has already been set.
#
if test -z "$xc_PATH_SEPARATOR"; then
AC_MSG_ERROR([xc_PATH_SEPARATOR not set (internal problem)])
fi
if test -z "$PATH_SEPARATOR"; then
AC_MSG_ERROR([PATH_SEPARATOR not set (internal or config.site problem)])
fi
AC_MSG_CHECKING([for path separator])
AC_MSG_RESULT([$PATH_SEPARATOR])
if test "x$PATH_SEPARATOR" != "x$xc_PATH_SEPARATOR"; then
AC_MSG_CHECKING([for initial path separator])
AC_MSG_RESULT([$xc_PATH_SEPARATOR])
AC_MSG_ERROR([path separator mismatch (internal or config.site problem)])
fi
dnl
m4_pattern_forbid([^_*XC])dnl
m4_define([$0],[])dnl
])
| M4 | 5 | jjatria/curl | m4/zz40-xc-ovr.m4 | [
"curl"
] |
<!DOCTYPE html>
<head>
<meta charset=UTF-8/>
<title>CacheCloud审核邮件</title>
</head>
<body>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<p>
<table style="width:100%; font-size:12px;" width="100%" cellpadding="0" cellspacing="0">
<colgroup>
<col style="width: 5px;">
</colgroup>
<tr>
<td style="width:5px;"></td>
<td style="color:#3f3f3f; font-weight: bold;font-size:12px; font-family: '宋体'; padding: 5px 0 15px 0">
${appAudit.userName!},您好,欢迎使用CacheCloud平台,您的申请处理进度如下:
</td>
</tr>
<tr>
<td></td>
<td style="padding-top:20px; padding-left:27px;">
<ul>
<li><span style="font-weight: bold; padding-top:20px; color:#3f3f3f;">申请处理信息:</span></li>
</ul>
<table style="table-layout:fixed;width: 872px;border-collapse: collapse;word-break: break-all;word-wrap:break-word;border-top: 1px dotted #676767;text-align: center;color: #000; font-family:'宋体'; font-size:12px; margin-top:10px; margin-left: 24px">
<tr>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
申请类型:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appAudit.typeDesc!}
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; text-align: left;height:33px; width: 50px;">
申请描述:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appAudit.info!}
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; text-align: left;height:33px; width: 50px;">
申请时间:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appAudit.createTimeFormat!}
</td>
</tr>
<tr>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
处理状态:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px; color: red;">
${appAudit.statusDesc!}
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
处理描述:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px; color: red;">
${appAudit.refuseReason!}
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
处理时间:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appAudit.modifyTime?string("yyyy-MM-dd HH:mm:ss")!}
</td>
</tr>
</table>
<br/>
<ul>
<li><span style="font-weight: bold; padding-top:20px; color:#3f3f3f;">应用详细信息:</span></li>
</ul>
<table style="table-layout:fixed;width: 872px;border-collapse: collapse;word-break: break-all;word-wrap:break-word;border-top: 1px dotted #676767;text-align: center;color: #000; font-family:'宋体'; font-size:12px; margin-top:10px; margin-left: 24px">
<tr>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
应用名称:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appDesc.name!}
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
应用类型:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appDesc.typeDesc!}
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
应用状态:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px; color: red;">
${appDesc.statusDesc!}
</td>
</tr>
<tr>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
是否测试:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
<#if appDesc.isTest == 1>
是
<#else>
否
</#if>
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
是否持久化:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
<#if appDesc.needPersistence == 1>
是
<#else>
否
</#if>
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
是否有后端数据源:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
<#if appDesc.hasBackStore == 1>
是
<#else>
否
</#if>
</td>
</tr>
<tr>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
应用描述:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appDesc.intro!}
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
应用负责人:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appDesc.officer!}
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767;text-align: left; height:33px; width: 50px;">
应用申请时间:
</td>
<td style="border-right: 1px dotted #676767; border-bottom: 1px dotted #676767; height:33px; width: 140px;">
${appDesc.createTime?string("yyyy-MM-dd HH:mm:ss")!}
</td>
</tr>
</table>
</td>
</tr>
</table>
</p>
</body>
</html> | FreeMarker | 3 | JokerQueue/cachecloud | cachecloud-web/src/main/resources/templates/appAudit.ftl | [
"Apache-2.0"
] |
BaxisJ | PureBasic | 1 | pchandrasekaran1595/onnx | onnx/backend/test/data/node/test_cumsum_2d_axis_1/test_data_set_0/input_1.pb | [
"Apache-2.0"
] |
#define UPSAMPLE_FORMAT uint4
#define UPSAMPLE_DISABLE_FILTERING
#include "upsample_bilateral_float4CS.hlsl"
| HLSL | 0 | rohankumardubey/WickedEngine | WickedEngine/shaders/upsample_bilateral_uint4CS.hlsl | [
"MIT"
] |
size: 2048px 1024px;
dpi: 240;
font: "Latin Modern Roman";
limit-x: -4 4;
limit-y: -2 2;
axes {
}
vectors {
size: 1pt;
data-x: csv("test/testdata/vectorfield.csv" x);
data-y: csv("test/testdata/vectorfield.csv" y);
data-dx: csv("test/testdata/vectorfield.csv" dx);
data-dy: csv("test/testdata/vectorfield.csv" dy);
}
| CLIPS | 3 | asmuth-archive/travistest | test/examples/charts_scientific_vectorfield.clp | [
"Apache-2.0"
] |
set title 'Checksum performance (lower is better)'
set ylabel 'Time in ms'
set xlabel 'Batch'
set grid # Show the grid
set term png
set output 'iteration_4.png'
plot \
'iteration_1.csv' title "iteration_1", 'iteration_2.csv' title "iteration_2", 'iteration_4.csv' title "iteration_4", 100 title 'Napkin math lower bound iteration_4.' lw 3 lc 'red' | Gnuplot | 4 | epk/napkin-math | newsletter/14-syncing/iteration_4.gnuplot | [
"MIT"
] |
concrete RelativeSpa of Relative = CatSpa ** RelativeRomance with
(ResRomance = ResSpa) ;
| Grammatical Framework | 0 | daherb/gf-rgl | src/spanish/RelativeSpa.gf | [
"BSD-3-Clause"
] |
#![allow(unused_assignments)]
// expect-exit-status-1
struct Firework {
strength: i32,
}
impl Drop for Firework {
fn drop(&mut self) {
println!("BOOM times {}!!!", self.strength);
}
}
fn main() -> Result<(),u8> {
let _firecracker = Firework { strength: 1 };
let _tnt = Firework { strength: 100 };
if true {
println!("Exiting with error...");
return Err(1);
}
let _ = Firework { strength: 1000 };
Ok(())
}
// Expected program output:
// Exiting with error...
// BOOM times 100!!!
// BOOM times 1!!!
// Error: 1
| Rust | 5 | Eric-Arellano/rust | src/test/run-make-fulldeps/coverage/drop_trait.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
<?php
echo "The content (Test #15)";
| HTML+PHP | 0 | tidytrax/cphalcon | tests/_data/fixtures/views/activerender/index.phtml | [
"BSD-3-Clause"
] |
// Copyright (c) 2013-2022 Bluespec, Inc. All Rights Reserved.
package Cur_Cycle;
// ================================================================
// A convenience function to return the current cycle number during BSV simulations
ActionValue #(Bit #(32)) cur_cycle = actionvalue
Bit #(32) t <- $stime;
return t / 10;
endactionvalue;
// ================================================================
// fa_debug_show_location
// Shows module hierarchy and current cycle
// Note: each invocation looks like this:
// fa_debug_show_location; if (verbosity != 0) $display ("<invocation location>");
// Why not define the function as:
// function Action fa_debug_show_location (Integer verbosity, String location_s);
// and just print the location as part of this function?
// This is a workaround, because there's some bug in Verilog codegen
// and/or Verilator, where that version core dumps.
function Action fa_debug_show_location (Integer verbosity);
action
if (verbosity != 0) begin
$display (" %m");
$write (" %0d: ", cur_cycle);
end
endaction
endfunction
// ================================================================
endpackage
| Bluespec | 4 | darius-bluespec/Flute | src_Core/BSV_Additional_Libs/Cur_Cycle.bsv | [
"Apache-2.0"
] |
# This script uses the Sysmon Network Connections to create a list of Connection IDs and their associated process details.
# Version 1.0 (November 2018)
#
# Authors: Jeff Atkinson ([email protected])
#
# Copyright (c) 2017, salesforce.com, inc.
# All rights reserved.
# Licensed under the BSD 3-Clause license.
# For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
module Sysmon;
type ProcDetails: record {
computerName: string &log &optional;
processId: string &log &optional;
procImage: string &log &optional;
};
global tableNetConns: table[conn_id] of ProcDetails &redef;
event sysmon_networkConnection(computerName: string, processId: string, proto: string, srcip: string, srcprt: string, dstip: string, dstprt: string, procImage: string)
{
#print "Network Connection";
local orig_h = to_addr(srcip);
local orig_p = to_port(string_cat(srcprt,"/",proto));
local resp_h = to_addr(dstip);
local resp_p = to_port(string_cat(dstprt,"/",proto));
local myConn: conn_id &redef;
local r: ProcDetails;
r$computerName = computerName;
r$processId = processId;
r$procImage = procImage;
myConn$orig_h = orig_h;
myConn$orig_p = orig_p;
myConn$resp_h = resp_h;
myConn$resp_p = resp_p;
#print fmt("Adding %s", cat(myConn));
tableNetConns[myConn] = r;
}
event bro_done() {
#print tableNetConns;
}
| Bro | 4 | Mantix4/bro-sysmon | bro/fingerprint_mapping/trackNetConns.bro | [
"BSD-3-Clause"
] |
*-------------------------------------------------------------------------------
* GHG module
* - CH4 FFI + CH4 waste + CH4 open fires
* - N2O FFI + N2O waste + N2O open fires
*-------------------------------------------------------------------------------
$ifthen %phase%=='conf'
* Define the oghg baseline data source
$setglobal ghgbaseline ssp2
$if %baseline%=='ssp1' $setglobal ghgbaseline %baseline%
$if %baseline%=='ssp3' $setglobal ghgbaseline %baseline%
$if %baseline%=='ssp4' $setglobal ghgbaseline ssp1
$if %baseline%=='ssp5' $setglobal ghgbaseline ssp3
*-------------------------------------------------------------------------------
$elseif %phase%=='sets'
set e /ch4, n2o, # Total
ch4_ffi, n2o_ffi, # Fossil fuel and Industry processes and Extraction
ch4_wst, n2o_wst, # Waste
ch4_ofr, n2o_ofr # Open Fires
/;
set map_e(e,ee) 'Relationships between Sectoral Emissions' /
ch4.(ch4_ffi,ch4_wst)
n2o.(n2o_ffi,n2o_wst)
kghg.(co2,ch4,n2o)
/;
set ghg(e) 'Green-House Gases' /
ch4, n2o
/;
set enrg(e) 'emissions from the energy sector' /
ch4_ffi
n2o_ffi
/;
set waste(e) 'waste emissions' /
ch4_wst, n2o_wst
/;
set efire(e) 'Open fires emissions' /
ch4_ofr, n2o_ofr
/;
*-------------------------------------------------------------------------------
$elseif %phase%=='include_data'
$gdxin '%datapath%data_validation'
parameter q_emi_valid_ghg;
parameter q_emi_valid_ghg_primap;
$loaddc q_emi_valid_ghg=q_emi_valid_ceds q_emi_valid_ghg_primap=q_emi_valid_primap
$gdxin
q_emi_valid_ghg('n2o_wst',t,n) = q_emi_valid_ghg_primap('n2o_wst',t,n);
q_emi_valid_ghg('n2o_ffi',t,n) = q_emi_valid_ghg_primap('n2o_ffi',t,n);
$gdxin '%datapath%data_mod_ghg'
parameter emi_ghg_hist(e,t,n) 'Historical emissions EDGAR v4.2 (2005,2010) [GtCe]';
$loaddc emi_ghg_hist
parameter ghg_baseline(e,t,n);
* Waste emissions baseline
parameter waste_emi_alpha(waste,n) 'region-dependen alpha coefficient to project waste emissions';
parameter waste_emi_beta(waste) 'beta coefficient to project waste emissions';
waste_emi_beta('ch4_wst') = 0.1022529;
waste_emi_beta('n2o_wst') = 0.08610055;
* compute alpha to match 2010 regional emissions
waste_emi_alpha(waste,n) = log(smax(tt$(tperiod(tt) eq 3), q_emi_valid_ghg(waste,tt,n)) /
smax(tt$(tperiod(tt) eq 3), l(tt,n))) -
waste_emi_beta(waste) * log(smax(tt$(tperiod(tt) eq 3), ykali(tt,n)) /
smax(tt$(tperiod(tt) eq 3), l(tt,n)));
ghg_baseline(waste,t,n)$(year(t) le 2015) = q_emi_valid_ghg(waste,t,n);
ghg_baseline(waste,t,n)$(year(t)>2015) = l(t,n) * exp( waste_emi_alpha(waste,n) +
waste_emi_beta(waste) * log(ykali(t,n)/l(t,n))
);
* FFI emission factors
parameter emi_fac(e,j) 'Technology specific emission factors [Tg/PJ]';
$loaddc emi_fac
parameters emi_ffac0(e,f,n), emi_ffac(e,f,t,n) 'Fuel-region specific emission factors [Tg/PJ]';
$loaddc emi_ffac0
scalar emi_ch4_tp 'annual rate of decreasing emission leakage [%]' /1/;
*-------------------------------------------------------------------------------
$elseif %phase%=='compute_data'
emi_ffac('ch4_ffi',f,t,n) = emi_ffac0('ch4_ffi',f,n);
emi_ffac('ch4_ffi',f,t,n)$(year(t)>2005) = emi_ffac0('ch4_ffi',f,n) * power(1 - (emi_ch4_tp/100),year(t)-2005);
*-------------------------------------------------------------------------------
$elseif %phase%=='vars'
Q_EMI.lo(waste,t,n) = 0;
Q_EMI.lo(enrg,t,n) = 0;
* Historical data emission PRIMAP [GtCe/year]
Q_EMI.fx(waste,t,n)$(year(t) le 2015) = q_emi_valid_ghg(waste,t,n);
Q_EMI.fx(enrg,t,n)$(year(t) le 2015) = q_emi_valid_ghg(enrg,t,n);
* Historical data emission EDGAR v4.2 [GtCe/year]
Q_EMI.fx(efire,t,n)$(year(t) le 2010) = emi_ghg_hist(efire,t,n);
Q_EMI.fx(efire,t,n)$(year(t) > 2010) = smax(tt$(tperiod(tt) eq 2),emi_ghg_hist(efire,tt,n));
* Ensure baseline emissions are equal to exogenous assumptions
BAU_Q_EMI.fx(waste,t,n) = ghg_baseline(waste,t,n);
*-------------------------------------------------------------------------------
$elseif %phase%=='eql'
eqq_emi_waste_%clt%
eqq_emi_n2o_ffi_%clt%
eqq_emi_ch4_ffi_%clt%
*-------------------------------------------------------------------------------
$elseif %phase%=='eqs'
* CH4, N2O waste emissions
eqq_emi_waste_%clt%(waste,t,n)$(mapn_th('%clt%') and (year(t)>2015))..
Q_EMI(waste,t,n) =e= ghg_baseline(waste,t,n) - Q_EMI_ABAT(waste,t,n);
* n2o FFI
eqq_emi_n2o_ffi_%clt%(t,n)$(mapn_th('%clt%') and (year(t)>2015))..
Q_EMI('n2o_ffi',t,n) =e= ( emi_fac('n2o_ffi','elpc') * sumjchild(Q_IN('coal',jfed,t,n),jfed,'elpc') +
emi_fac('n2o_ffi','elpb') * sumjchild(Q_IN('wbio',jfed,t,n),jfed,'elpb') +
emi_fac('n2o_ffi','elcigcc') * Q_IN('coal','elcigcc',t,n) +
emi_fac('n2o_ffi','elpc_ccs') * Q_IN('coal','elpc_ccs',t,n) +
emi_fac('n2o_ffi','elpc_oxy') * Q_IN('coal','elpc_oxy',t,n) +
emi_fac('n2o_ffi','elbigcc') * Q_IN('wbio','elbigcc',t,n) +
emi_fac('n2o_ffi','eloil') * sum(jfed$(csi('oil',jfed,t,n) and xiny(jfed,jel)), Q_IN('oil',jfed,t,n)) +
emi_fac('n2o_ffi','elgas') * sum(jfed$(csi('gas',jfed,t,n) and xiny(jfed,jel)), Q_IN('gas',jfed,t,n)) +
emi_fac('n2o_ffi','nelgas') * Q_IN('gas','nelgas',t,n) +
emi_fac('n2o_ffi','nelcoal') * Q_IN('coal','nelcoaltr',t,n) +
emi_fac('n2o_ffi','neloil') * Q_IN('oil','neloil',t,n) +
emi_fac('n2o_ffi','trad_cars') * sum(transp_qact('oil',jfed),Q_IN('oil',jfed,t,n)) +
emi_fac('n2o_ffi','hybrid') * sum(transp_qact(fuel,jfed)$(sameas(fuel,'trbiofuel') or sameas(fuel,'advbiofuel')),Q_IN(fuel,jfed,t,n)) +
emi_fac('n2o_ffi','neltrbiofuel') * Q_IN('trbiofuel','neltrbiofuel',t,n) +
emi_fac('n2o_ffi','neltrbiomass') * Q_IN('trbiomass','neltrbiomass',t,n)
) * smax(tt$(year(tt) eq 2015), q_emi_valid_ghg('n2o_ffi',tt,n) /
(emi_fac('n2o_ffi','elpc') * sumjchild(Q_IN.l('coal',jfed,tt,n),jfed,'elpc') +
emi_fac('n2o_ffi','elpb') * sumjchild(Q_IN.l('wbio',jfed,tt,n),jfed,'elpb') +
emi_fac('n2o_ffi','elcigcc') * Q_IN.l('coal','elcigcc',tt,n) +
emi_fac('n2o_ffi','elpc_ccs') * Q_IN.l('coal','elpc_ccs',tt,n) +
emi_fac('n2o_ffi','elpc_oxy') * Q_IN.l('coal','elpc_oxy',tt,n) +
emi_fac('n2o_ffi','elbigcc') * Q_IN.l('wbio','elbigcc',tt,n) +
emi_fac('n2o_ffi','eloil') * sum(jfed$(csi('oil',jfed,tt,n) and xiny(jfed,jel)), Q_IN.l('oil',jfed,tt,n)) +
emi_fac('n2o_ffi','elgas') * sum(jfed$(csi('gas',jfed,tt,n) and xiny(jfed,jel)), Q_IN.l('gas',jfed,tt,n)) +
emi_fac('n2o_ffi','nelgas') * Q_IN.l('gas','nelgas',tt,n) +
emi_fac('n2o_ffi','nelcoal') * Q_IN.l('coal','nelcoaltr',tt,n) +
emi_fac('n2o_ffi','neloil') * Q_IN.l('oil','neloil',tt,n) +
emi_fac('n2o_ffi','trad_cars') * sum(transp_qact('oil',jfed),Q_IN.l('oil',jfed,tt,n)) +
emi_fac('n2o_ffi','hybrid') * sum(transp_qact(fuel,jfed)$(sameas(fuel,'trbiofuel') or sameas(fuel,'advbiofuel')),Q_IN.l(fuel,jfed,tt,n)) +
emi_fac('n2o_ffi','neltrbiofuel') * Q_IN.l('trbiofuel','neltrbiofuel',tt,n) +
emi_fac('n2o_ffi','neltrbiomass') * Q_IN.l('trbiomass','neltrbiomass',tt,n))) - Q_EMI_ABAT('n2o_ffi',t,n);
* ch4 FFI
eqq_emi_ch4_ffi_%clt%(t,n)$(mapn_th('%clt%') and (year(t)>2015))..
Q_EMI('ch4_ffi',t,n) =e= div0(( emi_ffac('ch4_ffi','oil',t,n) * Q_FUEL('oil',t,n) +
$if set nogastrade emi_ffac('ch4_ffi','gas',t,n) * Q_FUEL('gas',t,n) +
$if set nocoaltrade emi_ffac('ch4_ffi','coal',t,n) * Q_FUEL('coal',t,n)
$if not set nogastrade emi_ffac('ch4_ffi','gas',t,n) * Q_OUT('gas',t,n) +
$if not set nocoaltrade emi_ffac('ch4_ffi','coal',t,n) * Q_OUT('coal',t,n)
) * smax(tt$(year(tt) eq 2015), q_emi_valid_ghg('ch4_ffi',tt,n)) ,
smax(tt$(year(tt) eq 2015),
emi_ffac('ch4_ffi','oil',tt,n) * Q_FUEL.l('oil',tt,n) +
$if set nogastrade emi_ffac('ch4_ffi','gas',tt,n) * Q_FUEL.l('gas',tt,n) +
$if set nocoaltrade emi_ffac('ch4_ffi','coal',tt,n) * Q_FUEL.l('coal',tt,n)
$if not set nogastrade emi_ffac('ch4_ffi','gas',tt,n) * Q_OUT.l('gas',tt,n) +
$if not set nocoaltrade emi_ffac('ch4_ffi','coal',tt,n) * Q_OUT.l('coal',tt,n)
)) - Q_EMI_ABAT('ch4_ffi',t,n);
*-------------------------------------------------------------------------------
$elseif %phase%=='gdx_items'
waste_emi_alpha
waste_emi_beta
emi_fac
emi_ffac
$endif
| GAMS | 3 | witch-team/witchmodel | modules/mod_ghg.gms | [
"Apache-2.0"
] |
;-----------------------------------------------------------------------------------
;
; The usual norm is:
; Don't change anything in this file. It's the heart of the system.
; But if you change something, be careful...
;
; Write your scripts in the scripts.nls file (open it from "Included Files" chooser
;
; Please, read the Info Tab for instructions...
;
;-----------------------------------------------------------------------------------
extensions [ nw ]
__includes [ "scripts.nls" ]
breed [nodes node]
nodes-own [
degree
betweenness
eigenvector
closeness
clustering
page-rank
community
phi
visits
rank
new-rank
infected
typ
]
globals [
diameter
]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Main procedures
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to startup
clear
ask patch 8 0 [
set plabel-color black
set plabel "PLEASE, READ INFO TAB FOR INSTRUCTIONS"]
wait 2
clear
end
to clear
clear-turtles
clear-links
clear-patches
clear-all-plots
set-default-shape nodes "circle"
ask patches [set pcolor white]
end
; Auxiliary reports to split a string using a substring
to-report split-aux [s s1]
ifelse member? s1 s
[ let p position s1 s
report (list (substring s 0 p) (substring s (p + (length s1)) (length s)))
]
[ report (list s "")
]
end
to-report split [s s1]
ifelse member? s1 s
[
let sp split-aux s s1
report (fput (first sp) (split (last sp) s1))
]
[ report (list s) ]
end
to-report join [s c]
report reduce [[s1 s2] -> (word s1 c s2)] s
end
to-report replace [s c1 c2]
report join (split s c1) c2
end
to-report store [val l]
report lput val l
end
to inspect-node
if mouse-down? [
ask nodes [stop-inspecting self]
let selected min-one-of nodes [distancexy mouse-xcor mouse-ycor]
if selected != nobody [
ask selected [
if distancexy mouse-xcor mouse-ycor < 1 [inspect self]
]
]
wait .2
]
end
to plotTable [Lx Ly]
set-current-plot "General"
clear-plot
set-plot-x-range (precision (min Lx) 2) (precision (max Lx) 2)
set-plot-y-range (precision (min Ly) 2) (precision (max Ly) 2)
(foreach Lx Ly
[ [x y] ->
plotxy x y
])
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Generators / Utilities
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to ER-RN [N p]
create-nodes N [
setxy random-xcor random-ycor
set color red
]
ask nodes [
ask other nodes with [who < [who] of myself] [
if random-float 1 < p [
create-link-with myself
]
]
]
post-process
end
to WS [N k p]
create-nodes N [
set color red
]
layout-circle sort nodes max-pycor * 0.9
let lis (n-values (K / 2) [ [i] -> i + 1 ])
ask nodes [
let w who
foreach lis [ [i] -> create-link-with (node ((w + i) mod N)) ]
]
rewire p
post-process
end
to rewire [p]
ask links [
let rewired? false
if (random-float 1) < p
[
;; "a" remains the same
let node1 end1
;; if "a" is not connected to everybody
if [ count link-neighbors ] of node1 < (count nodes - 1)
[
;; find a node distinct from node1 and not already a neighbor of node1
let node2 one-of nodes with [ (self != node1) and (not link-neighbor? node1) ]
;; wire the new edge
ask node1 [ create-link-with node2 [ set rewired? true ] ]
]
]
;; remove the old edge
if (rewired?)
[
die
]
]
end
to BA-PA [N m0 m]
create-nodes m0 [
set color red
]
ask nodes [
create-links-with other nodes
]
repeat (N - m0) [
create-nodes 1 [
set color blue
let new-partners turtle-set map [find-partner] (n-values m [ [i] -> i ])
create-links-with new-partners
]
]
post-process
end
;; This code is the heart of the "preferential attachment" mechanism, and acts like
;; a lottery where each node gets a ticket for every connection it already has.
;; While the basic idea is the same as in the Lottery Example (in the Code Examples
;; section of the Models Library), things are made simpler here by the fact that we
;; can just use the links as if they were the "tickets": we first pick a random link,
;; and than we pick one of the two ends of that link.
to-report find-partner
report [one-of both-ends] of one-of links
end
to KE [N m0 mu]
create-nodes m0 [
set color red
]
ask nodes [
create-links-with other nodes
]
let active nodes with [self = self]
let no-active no-turtles
repeat (N - m0) [
create-nodes 1 [
set color blue
foreach shuffle (sort active) [ [ac] ->
ifelse (random-float 1 < mu or count no-active = 0)
[
create-link-with ac
]
[
let cut? false
while [not cut?] [
let nodej one-of no-active
let kj [count my-links] of nodej
let S sum [count my-links] of no-active
if (kj / S) > random-float 1 [
create-link-with nodej
set cut? true
]
]
]
]
set active (turtle-set active self)
let cut? false
while [not cut?] [
let nodej one-of active
let kj [count my-links] of nodej
let S sum [1 / (count my-links)] of active
let P (1 / (kj * S))
if P > random-float 1 [
set no-active (turtle-set no-active nodej)
set active active with [self != nodej]
set cut? true
]
]
]
]
post-process
end
to Geom [N r]
create-nodes N [
setxy random-xcor random-ycor
set color blue
]
ask nodes [
create-links-with other nodes in-radius r
]
post-process
end
to SCM [N g]
create-nodes N [
setxy random-xcor random-ycor
set color blue
]
let num-links (g * N) / 2
while [count links < num-links ]
[
ask one-of nodes
[
let choice (min-one-of (other nodes with [not link-neighbor? myself])
[distance myself])
if choice != nobody [ create-link-with choice ]
]
]
post-process
end
to Grid [N M torus?]
nw:generate-lattice-2d nodes links N M torus?
ask nodes [set color blue]
post-process
end
to BiP [nb-nodes nb-links]
create-nodes nb-nodes [
set typ one-of [0 1]
]
let P0 nodes with [typ = 0]
let P1 nodes with [typ = 1]
repeat nb-links [
ask one-of P0 [
create-link-with one-of P1
]
]
post-process
end
to Edge-Copying [Iter pncd k beta pecd]
repeat Iter [
; Creation / Deletion of nodes
ifelse random-float 1 > pncd
[
ask one-of nodes [die]
]
[
create-nodes 1 [
setxy random-xcor random-ycor
set color blue
]
]
; Edge Creation
let v one-of nodes
ifelse random-float 1 < beta
[
;crea
ask v [
let other-k-nodes (other nodes) with [not link-neighbor? v]
if count other-k-nodes >= k
[
set other-k-nodes n-of k other-k-nodes
]
create-links-with other-k-nodes
]
]
[
; copia
let n k
while [n > 0] [
let u one-of other nodes
let other-nodes (([link-neighbors] of u) with [self != v])
if count other-nodes > k [
set other-nodes n-of k other-nodes
]
ask v [
create-links-with other-nodes
]
set n n - (count other-nodes)
]
]
; Creation / Deletion of edges
ifelse random-float 1 < pecd [
ask one-of nodes with [count my-links < (count nodes - 1)][
let othernode one-of other nodes with [not link-neighbor? myself]
create-link-with othernode
]
]
[
ask one-of links [die]
]
]
post-process
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Centrality Measures
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Takes a centrality measure as a reporter task, runs it for all nodes
;; and set labels, sizes and colors of turtles to illustrate result
to compute-centralities
nw:set-context nodes links
ask nodes [
set degree (count my-links)
set betweenness nw:betweenness-centrality
set eigenvector nw:eigenvector-centrality
set closeness nw:closeness-centrality
set clustering nw:clustering-coefficient
set page-rank nw:page-rank
]
update-plots
end
to plot-degree
Let Dk [degree] of nodes
let M max Dk
set-current-plot "Degree Distribution"
set-plot-x-range 0 (M + 1)
set-plot-y-range 0 1
histogram Dk
end
to plot-page-rank
Let Dk [page-rank] of nodes
let M max Dk
set-current-plot "PageRank Distribution"
set-plot-x-range 0 (M + M / 100)
set-plot-y-range 0 1
set-histogram-num-bars 100
histogram Dk
end
to plot-betweenness
Let Dk [nw:betweenness-centrality] of nodes
let M max Dk
set-current-plot "Betweenness Distribution"
set-plot-x-range 0 (ceiling M)
set-plot-y-range 0 1
set-histogram-num-bars 100
histogram Dk
end
to plot-eigenvector
Let Dk [nw:eigenvector-centrality] of nodes
let M max Dk
set-current-plot "Eigenvector Distribution"
set-plot-x-range 0 (ceiling M)
set-plot-y-range 0 1
set-histogram-num-bars 100
histogram Dk
end
to plot-closeness
Let Dk [nw:closeness-centrality] of nodes
let M max Dk
set-current-plot "Closeness Distribution"
set-plot-x-range 0 (ceiling M)
set-plot-y-range 0 1
set-histogram-num-bars 100
histogram Dk
end
to plot-clustering
Let Dk [nw:clustering-coefficient] of nodes
let M max Dk
set-current-plot "Clustering Distribution"
set-plot-x-range 0 (ceiling M)
set-plot-y-range 0 1
set-histogram-num-bars 100
histogram Dk
end
to plots
clear-all-plots
compute-centralities
carefully [plot-page-rank][]
carefully [plot-degree][]
carefully [plot-betweenness][]
carefully [plot-eigenvector][]
carefully [plot-closeness][]
carefully [plot-clustering][]
carefully [set diameter compute-diameter 1000][]
end
;; We want the size of the turtles to reflect their centrality, but different measures
;; give different ranges of size, so we normalize the sizes according to the formula
;; below. We then use the normalized sizes to pick an appropriate color.
to normalize-sizes-and-colors [c]
if count nodes > 0 [
let sizes sort [ size ] of nodes ;; initial sizes in increasing order
let delta last sizes - first sizes ;; difference between biggest and smallest
ifelse delta = 0 [ ;; if they are all the same size
ask nodes [ set size 1 ]
]
[ ;; remap the size to a range between 0.5 and 2.5
ask nodes [ set size ((size - first sizes) / delta) * 1.5 + 0.4 ]
]
ask nodes [ set color lput 200 extract-rgb scale-color c size 3.8 0] ; using a higher range max not to get too white...
]
end
; The diameter is cpmputed from a random search on distances between nodes
to-report compute-diameter [n]
let s 0
repeat n [
ask one-of nodes [
set s max (list s (nw:distance-to one-of other nodes))
]
]
report s
end
;to compute-phi
; ask nodes [
; set phi sum [exp -1 * ((nw:distance-to myself) ^ 2 / 100)] of nodes
; ]
;end
to-report Average-Path-Length
report nw:mean-path-length
end
to-report Average-Clustering
report mean [clustering] of nodes
end
to-report Average-Betweenness
report mean [betweenness] of nodes
end
to-report Average-Closeness
report mean [closeness] of nodes
end
to-report Average-PageRank
report mean [page-rank] of nodes
end
to-report Average-Eigenvector
report mean [eigenvector] of nodes
end
to-report Average-Degree
report mean [count my-links] of nodes
end
to-report Number-Nodes
report count nodes
end
to-report Number-Links
report count Links
end
to-report Density
report 2 * (count links) / ( (count nodes) * (-1 + count nodes))
end
to-report All-Measures
report (list Number-Nodes
Number-Links
Density
Average-Degree
Average-Path-Length
Diameter
Average-Clustering
Average-Betweenness
Average-Eigenvector
Average-Closeness
Average-PageRank
)
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Layouts & Visuals
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to layout [tl]
if tl = "radial" and count nodes > 1 [
layout-radial nodes links ( max-one-of nodes [ count my-links ] )
]
if tl = "spring" [
repeat 1000 [spring]
]
if tl = "circle" [
layout-circle sort nodes max-pycor * 0.9
]
if tl = "bipartite" [
layout-bipartite
]
if tl = "tutte" [
layout-circle sort nodes max-pycor * 0.9
repeat 10 [
layout-tutte max-n-of (count nodes * 0.5) nodes [ count my-links ] links 12
]
]
end
to layout-bipartite
let P0 nodes with [typ = 0]
let incp0 world-width / (1 + count p0)
let P1 nodes with [typ = 1]
let incp1 world-width / (1 + count p1)
let x min-pxcor
ask P0 [
set color red
setxy x max-pycor - 1
set x x + incp0]
set x min-pxcor
ask P1 [
set color blue
setxy x min-pycor + 1
set x x + incp1]
end
to refresh
ask nodes [
set size Size-N
set label ""
; set color red
]
ask links [
set color [150 150 150 100]
]
end
to post-process
ask links [
;set color black
set color [100 100 100 100]
]
set diameter compute-diameter 1000
end
to spring
layout-spring turtles links spring-K length-K rep-K
ask nodes [
setxy (xcor * (1 - gravity / 1000)) (ycor * (1 - gravity / 1000))
]
end
to help
user-message (word "Generators (see Info Tab):" "\n"
"* ER-RN (N, p)" "\n"
"* WS (N, k, p)" "\n"
"* BA-PA (N, m0, m)" "\n"
"* KE (N, m0, mu)" "\n"
"* Geom (N, r)" "\n"
"* SCM (N, g)" "\n"
"* Grid (N,M,t?)" "\n"
"* BiP (N, M)" "\n"
"* Edge-Copying (N, pn, k, b, pe)" "\n"
"-----------------------------" "\n"
"Utilities:" "\n"
"* Compute-centralities" "\n"
"* Communities" "\n"
"* PRank (Iter)" "\n"
"* Rewire (p)" "\n"
"* Spread (Ni, ps, pr, pin, Iter)" "\n"
"* DiscCA (Iter, pIn, p0_ac, p1_ac)" "\n"
"* ContCA (Iter, pIn, p)" "\n"
"* Layout (type)" "\n"
"* Print (measure)" "\n"
"-----------------------------" "\n"
"Global Measures:" "\n"
" Number-Nodes, Number-Links, Density, Average-Degree," "\n"
" Average-Path-Length, Diameter, Average-Clustering," "\n"
" Average-Betweenness, Average-Eigenvector," "\n"
" Average-Closeness, Average-PageRank" "\n"
"-----------------------------" "\n"
"Layouts:" "\n"
" circle, radial, tutte, spring, bipartite" "\n"
"-----------------------------" "\n"
"* Save, Load" "\n"
"* Export (view)" "\n"
"-----------------------------" "\n"
"Views:" "\n"
" Degree, Clustering, Betweenness, Eigenvector, Closeness, PageRank" "\n"
)
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Saving and loading of network files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to save
nw:set-context nodes links
carefully [
nw:save-graphml user-new-file
][]
end
to load
nw:set-context nodes links
nw:load-graphml user-file
end
to export [view]
let file (word view "-" (replace date-and-time ":" "_") ".csv")
set view (word view " Distribution")
export-plot view file
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Page Rank
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to PRank [n]
let damping-factor 0.85
;ask links [ set color gray set thickness 0 ]
ask nodes [
set rank 1 / count nodes
set new-rank 0 ]
repeat N [
ask nodes
[
ifelse any? link-neighbors
[
let rank-increment rank / count link-neighbors
ask link-neighbors [
set new-rank new-rank + rank-increment
]
]
[
let rank-increment rank / count nodes
ask nodes [
set new-rank new-rank + rank-increment
]
]
]
ask nodes
[
;; set current rank to the new-rank and take the damping-factor into account
set rank (1 - damping-factor) / count nodes + damping-factor * new-rank
]
]
let total-rank sum [rank] of nodes
let max-rank max [rank] of nodes
ask nodes [
set size 0.2 + 2 * (rank / max-rank)
]
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Spread
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to spread [N-mi ps pr pin Iter]
let t 0
set-current-plot "General"
clear-plot
foreach [["Green" green] ["Red" red] ["Blue" blue]] [ [c] ->
create-temporary-plot-pen first c
set-current-plot-pen first c
set-plot-pen-color last c
set-plot-pen-mode 0
]
ask nodes [
set infected 0
set color green
]
ask n-of N-mi nodes [
set infected 1
set color red
]
repeat Iter [
ask nodes with [infected = 1]
[ ask link-neighbors with [infected = 0]
[ if random-float 1 < ps
[ set infected 1
set color red
] ] ]
ask nodes with [infected = 1]
[ if random-float 1 < pr
[ set color green
set infected 0
if random-float 1 < pin
[ set color blue
set infected 2
]
] ]
set t t + 1
set-current-plot-pen "Green"
plotxy t count nodes with [infected = 0]
set-current-plot-pen "Red"
plotxy t count nodes with [infected = 1]
set-current-plot-pen "Blue"
plotxy t count nodes with [infected = 2]
display
wait 2 / Iter
]
end
to-report spread-summary
let s count nodes with [infected = 0]
let i count nodes with [infected = 1]
let r count nodes with [infected = 2]
report (list s i r)
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Cellular Automata
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Uses Typ = [current-state new-state] to store the state of the node
; Discrete value states
; Iter - Number of iterations
; pI - Initial Probability of activation
; p0_ac - ratio of activated neighbors to activate if the node is 0
; p1_ac - ratio of activated neighbors to activate if the node is 1
to DiscCA [Iter pIn p0_ac p1_ac]
set-current-plot "General"
clear-plot
set-plot-y-range 0 1
let t 0
ask nodes [
ifelse random-float 1 < pIn
[ set typ [1]]
[ set typ [0]]
set color ifelse-value (current_state = 0) [red][blue]
]
repeat Iter [
no-display
ask nodes [
let s current_state
let pn 0
if any? link-neighbors [
set pn count (link-neighbors with [current_state = 1]) / count link-neighbors
]
ifelse s = 0
[
ifelse pn >= p0_ac
[ new-state 1 ]
[ new-state 0 ]
]
[
ifelse pn >= p1_ac
[ new-state 1 ]
[ new-state 0 ]
]
]
ask nodes [
set-state
set color ifelse-value (current_state = 0) [red][blue]
]
plotxy t count (nodes with [current_state = 1]) / count nodes
set t t + 1
display
;wait .01
]
end
; Continuous value states
; Iter - Number of iterations
; pI - Initial Probability of activation
; p - ratio of memory in the new state
to ContCA [Iter pIn p]
set-current-plot "General"
clear-plot
set-plot-y-range 0 1
let t 0
ask nodes [
set typ (list random-float pIn)
set color scale-color blue current_state 0 1
]
repeat Iter [
no-display
ask nodes [
let s current_state
let pn sum ([current_state] of link-neighbors) / count link-neighbors
new-state (p * current_state + (1 - p) * pn)
]
ask nodes [
set-state
set color scale-color blue current_state 0 1
]
plotxy t sum ([current_state] of nodes) / count nodes
set t t + 1
display
;wait .01
]
end
; Get the current state of the node
to-report current_state
report first typ
end
; Set the new state of the node to s
to new-state [s]
set typ (lput s typ)
end
; Move the new state to the current state
to set-state
set typ (list (last typ))
end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Communities Detection
to communities
carefully [
let com nw:louvain-communities
let n-com length com
(foreach com (range 1 (n-com + 1) 1)[
[comm c] ->
ask comm [
set community c
set color (item (c mod 13) base-colors)
]
])
ask patches [set pcolor 3 + [color] of min-one-of nodes [distance myself]]
]
[]
end
@#$#@#$#@
GRAPHICS-WINDOW
10
10
606
385
-1
-1
11.1
1
12
1
1
1
0
0
0
1
-26
26
-16
16
0
0
0
ticks
30.0
PLOT
610
10
810
130
Degree Distribution
Degree
Nb Nodes
0.0
100.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 1 -7500403 true "" "histogram [count my-links] of nodes"
CHOOSER
10
390
102
435
Tlayout
Tlayout
"circle" "radial" "tutte" "bipartite" "spring"
0
SLIDER
104
390
196
423
spring-K
spring-K
0
1
0.45
.01
1
NIL
HORIZONTAL
SLIDER
199
390
291
423
length-K
length-K
0
5
2.4
.01
1
NIL
HORIZONTAL
SLIDER
294
390
386
423
rep-K
rep-K
0
2
0.015
.001
1
NIL
HORIZONTAL
SLIDER
105
425
197
458
size-N
size-N
0
2
0.9
.1
1
NIL
HORIZONTAL
BUTTON
485
390
540
423
O-O
layout Tlayout
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
545
390
600
423
Spring
spring
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
200
425
255
458
NIL
refresh
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
PLOT
610
130
810
250
Betweenness Distribution
Betweenness
Nb Nodes
0.0
1.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 1 -8630108 true "" "histogram [betweenness] of nodes"
PLOT
810
10
1010
130
Eigenvector Distribution
Eigenvector
Nb Nodes
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 1 -2674135 true "" ""
PLOT
810
130
1010
250
Closeness Distribution
Closeness
Nb Nodes
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 1 -6459832 true "" ""
PLOT
610
250
810
370
Clustering Distribution
Clustering
Nb nodes
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 1 -10899396 true "" ""
BUTTON
810
370
1010
403
_Λ_Λ_Λ_
Plots
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
335
460
490
493
Clear
clear
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
MONITOR
10
460
92
505
Avg Pth Lgth
Average-Path-Length
3
1
11
MONITOR
755
300
805
345
Avg
Average-Clustering
3
1
11
MONITOR
755
60
805
105
Avg
Average-Degree
3
1
11
BUTTON
750
25
805
58
.o0O
ask nodes [set size (count my-links)]\nnormalize-sizes-and-colors 5
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
955
25
1010
58
.o0O
ask nodes [set size eigenvector]\nnormalize-sizes-and-colors 15
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
750
145
805
178
.o0O
ask nodes [set size betweenness]\nnormalize-sizes-and-colors violet
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
955
145
1010
178
.o0O
ask nodes [set size closeness]\nnormalize-sizes-and-colors 35
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
750
265
805
298
.o0O
ask nodes [set size clustering]\nnormalize-sizes-and-colors 55
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
PLOT
810
250
1010
370
PageRank Distribution
Page-Ranking
Nb Nodes
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 1 -13345367 true "" ""
BUTTON
955
265
1010
298
.o0O
ask nodes [set size page-rank]\nnormalize-sizes-and-colors blue
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
MONITOR
160
460
220
505
Nb Nodes
Number-Nodes
0
1
11
MONITOR
225
460
275
505
Nb Links
Number-Links
0
1
11
MONITOR
280
460
330
505
Density
Density
3
1
11
PLOT
610
405
1010
525
General
NIL
NIL
0.0
10.0
0.0
10.0
true
false
"" ""
PENS
"default" 1.0 0 -16777216 true "" ""
MONITOR
95
460
155
505
Diameter
diameter
0
1
11
BUTTON
550
10
605
45
Help
help
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
SLIDER
390
390
482
423
gravity
gravity
0
10
0.18
.01
1
NIL
HORIZONTAL
BUTTON
610
370
810
403
NIL
Communities
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
335
425
410
458
Load
Load
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
BUTTON
415
425
490
458
Save
save
NIL
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
MONITOR
755
180
805
225
Avg
Average-Betweenness
2
1
11
MONITOR
960
60
1010
105
Avg
Average-eigenvector
2
1
11
MONITOR
960
180
1010
225
Avg
Average-closeness
3
1
11
MONITOR
960
300
1010
345
Avg
Average-pagerank
3
1
11
BUTTON
495
425
597
458
Inspect Node
inspect-node
T
1
T
OBSERVER
NIL
NIL
NIL
NIL
1
@#$#@#$#@
# Complex Networks Toolbox
1. Introduction
1. The Interface
1. Scripts
1. Generators
* Erdős-Rényi Random Network
* Watts & Strogatz Small Worlds Networks
* Barabasi & Albert Preferential Attachtment
* Klemm and Eguílez Small-World-Scale-Free Network
* Geometric Network
* Spatially Clustered Network
* Grid
* Bipartite
* Edge Copying Dynamics
1. Global Measures
1. Utilities
* Layouts
* Compute Centralities
* Communities
1. Dynamics
* Page Rank
* Spread of infection/message
* Cellular Automata
1. Input/Output
* Save / Load GraphML
* Export Distributions
## Introduction
This NetLogo model is a toy tool to launch experiments for __Complex Networks__.
It provides some basic commands to generate and analyze small networks by using the most common and famous algorithms (random graphs, scale free networks, small world, etc). Also, it provides some methods to test dynamics on networks (spread processes, page rank, cellular automata,...).
All the funtionalities have been designed to be used as extended NetLogo commands. In this way, it is possible to create small scripts to automate the generating and analyzing process in an easier way. Of course, they can be used in more complex and longer NetLogo procedures, but the main aim in their design is to be used by users with no previous experience on this language (although, if you know how to program in NetLogo, you can probably obtain stronger results).
You can find the las version of the tool in [this Github poject](https://github.com/fsancho/Complex-Network-Analysis).
![Github](http://www.cs.us.es/~fsancho/images/2017-01/github.png)
In the next sections you can find some details about how to use it.
## The Interface
Although the real power of the system is obtained via scripting, and it is its main goal, the interface has been designed to allow some interactions and facilitate to handle the creation and analysis of the networks. Indeed, before launching a batch of experiments is a good rule to test some behaviours by using the interface and trying to obtain a partial view and understanding of the networks to be analyzed... in this way, you will spend less time in experiments that will not work as you expect.
![Interface](http://www.cs.us.es/~fsancho/images/2017-01/interface.png)
The interface has 3 main areas:
1. __Network Representation__: In the left side. It has a panel where the network is represented and it allows one only interaction, to inspect node information (when the button Inspect Node is pressed). Under this panel some widgets to manage the visualization properties are located: selected layout and parameters for it.
1. __Measures Panel__: In the right side. It contains a collection of plots where the several centralities are shown and some monitors with global information about the current network. The measures that are computed for every node are:
* Degree
* Clustering
* Betweenness
* Eigenvector
* Closeness
* Page-Rank
## Scripts
Use `scripts.nls` to write your customized scripts. In order to acces this file, you must go to Code Tab and then choose ´scripts.nls´ from Included Files chooser. You can add as many aditional files as you want if you need some order in your experiments and analysis (load them with the `__includes` command from main file).
![Scripts](http://www.cs.us.es/~fsancho/images/2017-01/scripts.jpg)
Remember that a script is only a NetLogo procedure, hence it must have the following structure:
to script-name
...
Commands
...
end
After defining your scripts, you can run them directly from the Command Center.
In tho document you can find specific network commands that can be used to write scripts for creating and analyzing networks. In fact, this scripts can be written using any NetLogo command, but in this library you can find some shortcuts to make easier the process.
Some of the useful NetLogo commands you will probably need are:
* `let v val` : Create a new variable `v` and sets its value to `val`.
* `set v val` : Change the value fo the variable `v` to `val`.
* `[ ]` : Empty list, to store values in a repetition
* `range x0 xf incx` : Returns a ordered list of numbers from `x0` to `xf` with `incx` increments.
* `foreach [x1....xn] [ [x] -> P1...Pk ]` : for each `x` in `[x0 ... xn]` it executes the comands `P1` to `Pk`.
* `repeat N [P1...Pk]` : Repeat the block of commands `P1` to `Pk`, `N` times.
* `store val L` : Store value `val` in list `L`.
* `mean L` : Returns the mean value of list `L`.
* `sum / max / min L` : Returns the sum/max/min of values of list `L`.
* `print v` : Print value of `v` in the Output.
* `plotTable [x1...xn] [y1...yn]` : Plot the points `(x1,y1)...(xn,yn)`.
You can combine both to move some parameter in the creation/analysis of the networks. In the next example we study how the diameter of a Scale Free Network (built with Barabasi-Albert algorithm) changes in function of the size of the network:
foreach (range 10 1000 10)
[ [N] ->
clear
BA-PA N 2 1
print diameter
]
For example, the next script will perform a experiment moving a parameter from 0 to 0.01 with increments of 0.001, and for every value of this parameter it will prepare 10 networks to compute their diameter.
to script5
clear
foreach (range 0 .01 .001)
[ [p] ->
print p
repeat 10
[
clear
BA-PA 300 2 1
ER-RN 0 p
print diameter
]
]
end
From the Output we can copy/export the printed values and then analyze them in any other analysis software (R, Python, NetLogo, Excel, etc.)
## Generators
The current generators of networks (following several algorithms to get different structures) are:
### Erdős-Rényi Random Network:
In fact this is the Gilbert variant of the model introduced by Erdős and Rényi. Each edge has a fixed probability of being present (p) or absent (1-p), independently of the other edges.
N - Number of nodes,
p - link probability of wiring
ER-RN N p
![Erdos-Renyi](http://www.cs.us.es/~fsancho/images/2017-01/er-rn.jpg)
### Watts & Strogatz Small Worlds Networks:
The Watts–Strogatz model is a random graph generation model that produces graphs with small-world properties, including short average path lengths and high clustering. It was proposed by Duncan J. Watts and Steven Strogatz in their joint 1998 Nature paper.
Given the desired number of nodes N, the mean degree K (assumed to be an even integer), and a probability p, satisfying N >> K >> ln(N) >> 1, the model constructs an undirected graph with N nodes and NK/2 edges in the following way:
1. Construct a regular ring lattice, a graph with N nodes each connected to K neighbors, K/2 on each side.
2. Take every edge and rewire it with probability p. Rewiring is done by replacing (u,v) with (u,w) where w is chosen with uniform probability from all possible values that avoid self-loops (not u) and link duplication (there is no edge (u,w) at this point in the algorithm).
N - Number of nodes,
k - initial degree (even),
p - rewiring probability
WS N k p
![WS](http://www.cs.us.es/~fsancho/images/2017-01/ws_1.png)
### Barabasi & Albert Preferential Attachtment:
The Barabási–Albert (BA) model is an algorithm for generating random scale-free networks using a preferential attachment mechanism. Scale-free networks are widely observed in natural and human-made systems, including the Internet, the world wide web, citation networks, and some social networks. The algorithm is named for its inventors Albert-László Barabási and Réka Albert.
The network begins with an initial connected network of m_0 nodes.
New nodes are added to the network one at a time. Each new node is connected to m <= m_0 existing nodes with a probability that is proportional to the number of links that the existing nodes already have. Formally, the probability p_i that the new node is connected to node i is
k_i
p_i = ----------
sum_j(k_j)
where k_i is the degree of node i and the sum is made over all pre-existing nodes j (i.e. the denominator results in twice the current number of edges in the network). Heavily linked nodes ("hubs") tend to quickly accumulate even more links, while nodes with only a few links are unlikely to be chosen as the destination for a new link. The new nodes have a "preference" to attach themselves to the already heavily linked nodes.
N - Number of nodes,
m0 - Initial complete graph,
m - Number of links in new nodes
BA-PA N m0 m
![BA](http://www.cs.us.es/~fsancho/images/2017-01/ba-pa.png)
### Klemm and Eguílez Small-World-Scale-Free Network:
The algorithm of Klemm and Eguílez manages to combine all three properties of many “real world” irregular networks – it has a high clustering coefficient, a short average path length (comparable with that of the Watts and Strogatz small-world network), and a scale-free degree distribution. Indeed, average path length and clustering coefficient can be tuned through a “randomization” parameter, mu, in a similar manner to the parameter p in the Watts and Strogatz model.
It begins with the creation of a fully connected network of size m0. The remaining N−m0 nodes in the network are introduced sequentially along with edges to/from m0 existing nodes. The algorithm is very similar to the Barabási and Albert algorithm, but a list of m0 “active nodes” is maintained. This list is biased toward containing nodes with higher degrees.
The parameter μ is the probability with which new edges are connected to non-active nodes. When new nodes are added to the network, each new edge is connected from the new node to either a node in the list of active nodes or with probability μ, to a randomly selected “non-active” node. The new node is added to the list of active nodes, and one node is then randomly chosen, with probability proportional to its degree, for removal from the list, i.e., deactivation. This choice is biased toward nodes with a lower degree, so that the nodes with the highest degree are less likely to be chosen for removal.
N - Number of nodes,
m0 - Initial complete graph,
μ - Probability of connect with low degree nodes
KE N m0 μ
![KE](http://www.cs.us.es/~fsancho/images/2017-01/ke.png)
### Geometric Network:
It is a simple algorithm to be used in metric spaces. It generates N nodes that are randomly located in 2D, and after that two every nodes u,v are linked if d(u,v) < r (a prefixed radius).
N - Number of nodes,
r - Maximum radius of connection
Geom N r
![GN](http://www.cs.us.es/~fsancho/images/2017-01/geom.png)
### Spatially Clustered Network:
This algorithm is similar to the geometric one, but we can prefix the desired mean degree of the network, g. It starts by creating N randomly located nodes, and then create the number of links needed to reach the desired mean degree. This link creation is random in the nodes, but choosing the shortest links to be created from them.
N - Number of nodes,
g - Average node degree
SCM N g
![SCM](http://www.cs.us.es/~fsancho/images/2017-01/scm.png)
### Grid (2D-lattice):
A Grid of N x M nodes is created. It can be chosen to connect edges of the grid as a torus (to obtain a regular grid).
M - Number of horizontal nodes
N - Number of vertical nodes
t? - torus?
Grid N M t?
![Grid](http://www.cs.us.es/~fsancho/images/2017-01/grid.png)
### Bipartite:
Creates a Bipartite Graph with N nodes (randomly typed to P0 P1 families) and M random links between nodes of different families.
N - Number of nodes
M - Number of links
BiP N M
![Bip](http://www.cs.us.es/~fsancho/images/2017-01/bip.png)
### Edge Copying Dynamics
The model introduced by Kleinberg et al consists of a itearion of three steps:
1. __Node creation and deletion__: In each iteration, nodes may be independently created and deleted under some probability distribution. All edges incident on the deleted nodes are also removed. pncd - creation, (1 - pncd) deletion.
1. __Edge creation__: In each iteration, we choose some node v and some number of edges k to add to node v. With probability β, these k edges are linked to nodes chosen uniformly and independently at random. With probability 1 − β, edges are copied from another node: we choose a node u at random, choose k of its edges (u, w), and create edges (v, w). If the chosen node u does not have enough edges, all its edges are copied and the remaining edges are copied from another randomly chosen node.
1. __Edge deletion__: Random edges can be picked and deleted according to some probability distribution.
Iter - Number of Iterations
pncd - probability of creation/deletion random nodes
k - edges to add to the new node
beta - probability of new node to uniform connet/copy links
pecd - probability of creation/deletion random edges
Edge-Copying Iter pncd k beta pecd
![Edge-Copying](http://www.cs.us.es/~fsancho/images/2017-01/edgecopy.png)
## Global Measures
The global measures we can take from any network are:
Number-Nodes
Number-Links
Density
Average-Degree
Average-Path-Length
Diameter
Average-Clustering
Average-Betweenness,
Average-Eigenvector,
Average-Closeness,
Average-Page-Rank
All
Some of them need to compute centralities before they can be used. If you choose _All_, ypu obtain a list with all the measures of the network.
You can print any of them in the Output Window:
Print measure
## Utilities
### Layouts
The system allows the following layouts:
circle
radial (centered in a max degree node)
tutte
spring (1000 iterations)
bipartite
To use it from a script:
layout type-string
For example:
layout "circle"
![Layout](http://www.cs.us.es/~fsancho/images/2017-01/layouts.png)
### Compute Centralities
Current Centralities of every node:
Degree,
Betweenness,
Eigenvector,
Closeness,
Clustering,
Page-Rank
The way to compute all of them is by executing:
compute-cantralities
![Centralities](http://www.cs.us.es/~fsancho/images/2017-01/medidas.png)
### Communities
Computes the communities of the current network using the Louvain method (maximizing the
modularity measure of the network).
![Communities](http://www.cs.us.es/~fsancho/images/2017-01/communities.png)
## Dynamics
### Page Rank
Applies the Page Rank diffusion algorithm to the current Network a number of prefixed iterations.
Iter - Number of iterations
PRank Iter
![PR](http://www.cs.us.es/~fsancho/images/2017-01/prank.png)
### Rewire
Rewires all the links of the current Network with a probability p. For every link, one of the nodes is fixed, while the other is rewired.
p - probability of rewire every link
Rewire p
![Rewire](http://www.cs.us.es/~fsancho/images/2017-01/rewire.png)
### Spread of infection/message
Applies a spread/infection algorithm on the current network a number of iterations. It starts with a initial number of infected/informed nodes and in every step:
1. The infected/informed nodes can spread the infection/message to its neighbors with probability ps (independently for every neighbor).
1. Every infected/informed node can recover/forgot with a probability of pr.
1. Every recovered node can become inmunity with a probability of pin. In this case, he will never again get infected / receive the message, and it can't spread it.
N-mi - Number of initial infected nodes
ps - Probability of spread of infection/message
pr - Probability od recovery / forgotten
pin - Probability of inmunity after recovering
Iter - Number of iterations
Spread N-mi ps pr pin Iter
![Spread](http://www.cs.us.es/~fsancho/images/2017-01/spread.png)
### Cellular Automata
#### Discrete Totalistic Cellular Automata
The nodes have 2 possible values: on/off. In every step, every node changes its state according to the ratio of activated states.
Iter - Number of iterations
pIn - Initial Probability of activation
p0_ac - ratio of activated neighbors to activate if the node is 0
p1_ac - ratio of activated neighbors to activate if the node is 1
DiscCA Iter pIn p0_ac p1_ac
#### Continuous Totalistic Cellular Automata
The nodes have a continuous possitive value for state: [0,..]. In every step, every node changes its state according to the states of the neighbors:
s'(u) = p * s(u) + (1 - p) * avg {s(v): v neighbor of u}
Iter - Number of iterations
pIn - Initial Probability of activation
p - ratio of memory in the new state
ContCA Iter pIn p
![CellularAutomata](http://www.cs.us.es/~fsancho/images/2017-01/contca.png)
## Input/Output
### Save GraphML / Load GraphML
Opens a Dialog windows asking for a file-name to save/load current network.
Save
Load
![GrpahML](https://upload.wikimedia.org/wikipedia/commons/thumb/9/92/CPT_Hardware-InputOutput.svg/500px-CPT_Hardware-InputOutput.svg.png)
### Export Distributions
You can export the several distributions of the measures for a single network:
export view
Where view can be any of the following:
Degree
Clustering
Betweenness
Eigenvector
Closeness
PageRank
The program will automatically name the file with the distribution name and the date and time of exporting.
![Export](http://www.cs.us.es/~fsancho/images/2017-01/export.png)
@#$#@#$#@
default
true
0
Polygon -7500403 true true 150 5 40 250 150 205 260 250
airplane
true
0
Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15
arrow
true
0
Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150
box
false
0
Polygon -7500403 true true 150 285 285 225 285 75 150 135
Polygon -7500403 true true 150 135 15 75 150 15 285 75
Polygon -7500403 true true 15 75 15 225 150 285 150 135
Line -16777216 false 150 285 150 135
Line -16777216 false 150 135 15 75
Line -16777216 false 150 135 285 75
bug
true
0
Circle -7500403 true true 96 182 108
Circle -7500403 true true 110 127 80
Circle -7500403 true true 110 75 80
Line -7500403 true 150 100 80 30
Line -7500403 true 150 100 220 30
butterfly
true
0
Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240
Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240
Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163
Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165
Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225
Circle -16777216 true false 135 90 30
Line -16777216 false 150 105 195 60
Line -16777216 false 150 105 105 60
car
false
0
Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180
Circle -16777216 true false 180 180 90
Circle -16777216 true false 30 180 90
Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89
Circle -7500403 true true 47 195 58
Circle -7500403 true true 195 195 58
circle
false
0
Circle -7500403 true true 15 15 270
Circle -16777216 false false 13 13 272
circle 2
false
0
Circle -7500403 true true 0 0 300
Circle -16777216 true false 30 30 240
circle1
false
0
Circle -7500403 true true 15 15 270
cow
false
0
Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167
Polygon -7500403 true true 73 210 86 251 62 249 48 208
Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123
cylinder
false
0
Circle -7500403 true true 0 0 300
dot
false
0
Circle -7500403 true true 90 90 120
face happy
false
0
Circle -7500403 true true 8 8 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240
face neutral
false
0
Circle -7500403 true true 8 7 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Rectangle -16777216 true false 60 195 240 225
face sad
false
0
Circle -7500403 true true 8 8 285
Circle -16777216 true false 60 75 60
Circle -16777216 true false 180 75 60
Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183
fish
false
0
Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166
Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165
Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60
Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166
Circle -16777216 true false 215 106 30
flag
false
0
Rectangle -7500403 true true 60 15 75 300
Polygon -7500403 true true 90 150 270 90 90 30
Line -7500403 true 75 135 90 135
Line -7500403 true 75 45 90 45
flower
false
0
Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135
Circle -7500403 true true 85 132 38
Circle -7500403 true true 130 147 38
Circle -7500403 true true 192 85 38
Circle -7500403 true true 85 40 38
Circle -7500403 true true 177 40 38
Circle -7500403 true true 177 132 38
Circle -7500403 true true 70 85 38
Circle -7500403 true true 130 25 38
Circle -7500403 true true 96 51 108
Circle -16777216 true false 113 68 74
Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218
Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240
house
false
0
Rectangle -7500403 true true 45 120 255 285
Rectangle -16777216 true false 120 210 180 285
Polygon -7500403 true true 15 120 150 15 285 120
Line -16777216 false 30 120 270 120
leaf
false
0
Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195
Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195
line
true
0
Line -7500403 true 150 0 150 300
line half
true
0
Line -7500403 true 150 0 150 150
pentagon
false
0
Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120
person
false
0
Circle -7500403 true true 110 5 80
Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90
Rectangle -7500403 true true 127 79 172 94
Polygon -7500403 true true 195 90 240 150 225 180 165 105
Polygon -7500403 true true 105 90 60 150 75 180 135 105
plant
false
0
Rectangle -7500403 true true 135 90 165 300
Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285
Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285
Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210
Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135
Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135
Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60
Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90
sheep
false
15
Circle -1 true true 203 65 88
Circle -1 true true 70 65 162
Circle -1 true true 150 105 120
Polygon -7500403 true false 218 120 240 165 255 165 278 120
Circle -7500403 true false 214 72 67
Rectangle -1 true true 164 223 179 298
Polygon -1 true true 45 285 30 285 30 240 15 195 45 210
Circle -1 true true 3 83 150
Rectangle -1 true true 65 221 80 296
Polygon -1 true true 195 285 210 285 210 240 240 210 195 210
Polygon -7500403 true false 276 85 285 105 302 99 294 83
Polygon -7500403 true false 219 85 210 105 193 99 201 83
square
false
0
Rectangle -7500403 true true 30 30 270 270
square 2
false
0
Rectangle -7500403 true true 30 30 270 270
Rectangle -16777216 true false 60 60 240 240
star
false
0
Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108
target
false
0
Circle -7500403 true true 0 0 300
Circle -16777216 true false 30 30 240
Circle -7500403 true true 60 60 180
Circle -16777216 true false 90 90 120
Circle -7500403 true true 120 120 60
tree
false
0
Circle -7500403 true true 118 3 94
Rectangle -6459832 true false 120 195 180 300
Circle -7500403 true true 65 21 108
Circle -7500403 true true 116 41 127
Circle -7500403 true true 45 90 120
Circle -7500403 true true 104 74 152
triangle
false
0
Polygon -7500403 true true 150 30 15 255 285 255
triangle 2
false
0
Polygon -7500403 true true 150 30 15 255 285 255
Polygon -16777216 true false 151 99 225 223 75 224
truck
false
0
Rectangle -7500403 true true 4 45 195 187
Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194
Rectangle -1 true false 195 60 195 105
Polygon -16777216 true false 238 112 252 141 219 141 218 112
Circle -16777216 true false 234 174 42
Rectangle -7500403 true true 181 185 214 194
Circle -16777216 true false 144 174 42
Circle -16777216 true false 24 174 42
Circle -7500403 false true 24 174 42
Circle -7500403 false true 144 174 42
Circle -7500403 false true 234 174 42
turtle
true
0
Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210
Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105
Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105
Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87
Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210
Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99
wheel
false
0
Circle -7500403 true true 3 3 294
Circle -16777216 true false 30 30 240
Line -7500403 true 150 285 150 15
Line -7500403 true 15 150 285 150
Circle -7500403 true true 120 120 60
Line -7500403 true 216 40 79 269
Line -7500403 true 40 84 269 221
Line -7500403 true 40 216 269 79
Line -7500403 true 84 40 221 269
wolf
false
0
Polygon -16777216 true false 253 133 245 131 245 133
Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105
Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113
x
false
0
Polygon -7500403 true true 270 75 225 30 30 225 75 270
Polygon -7500403 true true 30 75 75 30 270 225 225 270
@#$#@#$#@
NetLogo 6.1.0
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@
default
0.0
-0.2 0 0.0 1.0
0.0 1 1.0 0.0
0.2 0 0.0 1.0
link direction
true
0
Line -7500403 true 150 150 90 180
Line -7500403 true 150 150 210 180
curve
1.0
-0.2 0 0.0 1.0
0.0 1 1.0 0.0
0.2 0 0.0 1.0
link direction
true
0
Line -7500403 true 150 150 90 180
Line -7500403 true 150 150 210 180
@#$#@#$#@
1
@#$#@#$#@
| NetLogo | 5 | ajnavarro/language-dataset | data/github.com/fsancho/Complex-Networks-Toolbox/01101be05580d57d04c2e720dc1837cf0fa743dd/Complex Networks Model 6.0.nlogo | [
"MIT"
] |
name: haskell-platform
version: {{hpVersion}}
homepage: http://haskell.org/platform
license: BSD3
license-file: LICENSE
author: [email protected]
maintainer: [email protected]
category: System
synopsis: The Haskell Platform
description:
The Haskell Platform (HP) is the blessed set of libraries and tools on
which to build further Haskell libraries and applications. It is
intended to provide a comprehensive, stable, and quality tested base for
Haskell projects to work from.
.
This version specifies the following additional developer tools be
installed, for a system to be in full compliance:
.
* cabal-install
* alex
* happy
* haddock
cabal-version: >= 1.8
build-type: Custom
tested-with: GHC =={{ghcVersion}}
flag include-ghc-depends
description: Include all the GHC provided packages in the dependencies
default: False
library
if flag(include-ghc-depends)
build-depends:
ghc =={{ghcVersion}},
-- Core libraries: provided by every ghc installation
-- We don't include "non-API" packages here.
{{#ghcLibs}}
{{name}} =={{version}}{{^last}},{{/last}}
{{/ghcLibs}}
if !os(windows)
build-depends:
{{#nonWindowsLibs}}
{{name}} =={{version}}{{^last}},{{/last}}
{{/nonWindowsLibs}}
else
build-depends:
{{#onlyWindowsLibs}}
{{name}} =={{version}}{{^last}},{{/last}}
{{/onlyWindowsLibs}}
build-depends:
-- Libraries in addition to what GHC provides:
-- Note: newer versions of cgi need monad-catchio.
{{#platformLibs}}
{{name}} =={{version}}{{^last}},{{/last}}
{{/platformLibs}}
-- Libraries that are needed to support the above,
-- though are not officially part of the platform
-- FIXME: should have some separate designation?
-- Depending on programs does not work, they are not registered
-- We list them to help distro packaging.
build-tools:
{{#tools}}
{{name}} =={{version}}{{^last}},{{/last}}
{{/tools}}
| mupad | 4 | bgamari/haskell-platform | hptool/templates/haskell-platform.cabal.mu | [
"BSD-3-Clause"
] |
import { UIRow, UIText, UISpan, UIBreak } from './libs/ui.js';
function SidebarGeometryBufferGeometry( editor ) {
var strings = editor.strings;
var signals = editor.signals;
var container = new UIRow();
function update( object ) {
if ( object === null ) return; // objectSelected.dispatch( null )
if ( object === undefined ) return;
var geometry = object.geometry;
if ( geometry && geometry.isBufferGeometry ) {
container.clear();
container.setDisplay( 'block' );
var text = new UIText( strings.getKey( 'sidebar/geometry/buffer_geometry/attributes' ) ).setWidth( '90px' );
container.add( text );
var container2 = new UISpan().setDisplay( 'inline-block' ).setVerticalAlign( 'middle' ).setWidth( '160px' );
container.add( container2 );
var index = geometry.index;
if ( index !== null ) {
container2.add( new UIText( strings.getKey( 'sidebar/geometry/buffer_geometry/index' ) ).setWidth( '80px' ) );
container2.add( new UIText( ( index.count ).format() ).setFontSize( '12px' ) );
container2.add( new UIBreak() );
}
var attributes = geometry.attributes;
for ( var name in attributes ) {
var attribute = attributes[ name ];
container2.add( new UIText( name ).setWidth( '80px' ) );
container2.add( new UIText( ( attribute.count ).format() + ' (' + attribute.itemSize + ')' ).setFontSize( '12px' ) );
container2.add( new UIBreak() );
}
} else {
container.setDisplay( 'none' );
}
}
signals.objectSelected.add( update );
signals.geometryChanged.add( update );
return container;
}
export { SidebarGeometryBufferGeometry };
| JavaScript | 4 | yangmengwei925/3d | editor/js/Sidebar.Geometry.BufferGeometry.js | [
"MIT"
] |