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
|
---|---|---|---|---|---|
// 功能:SPI写控制器
package SPIWriter; // 包名 SPIWriter ,必须与文件名相同
import StmtFSM::*;
interface SPIWriter;
method Action write(Bit#(8) data);
method Bit#(3) spi;
endinterface
(* synthesize, always_ready="spi" *)
module mkSPIWriter (SPIWriter); // BSV SPI 发送(可综合), 模块名称为 mkSPIWriter
Reg#(bit) ss <- mkReg(1'b1);
Reg#(bit) sck <- mkReg(1'b1);
Reg#(bit) mosi <- mkReg(1'b1);
Reg#(Bit#(8)) wdata <- mkReg(8'h0);
Reg#(int) cnt <- mkReg(7); // cnt 的复位值为 7
FSM spiFsm <- mkFSM ( // mkFSM 是一个状态机自动生成器,能根据顺序模型生成状态机 spiFsm
seq // seq...endseq 描述一个顺序模型,其中的每个语句占用1个时钟周期
ss <= 1'b0; // ss 拉低
while (cnt>=0) seq // while 循环,cnt 从 7 递减到 0,共8次
action // action...endaction 内的语句在同一周期内执行,即原子操作。
sck <= 1'b0; // sck 拉低
mosi <= wdata[cnt]; // mosi 依次产生串行 bit
endaction
action // action...endaction 内的语句在同一周期内执行,即原子操作。
sck <= 1'b1; // sck 拉高
cnt <= cnt - 1; // cnt 每次循环都递减
endaction
endseq
mosi <= 1'b1; // mosi 拉高
ss <= 1'b1; // ss 拉高,发送结束
cnt <= 7; // cnt 置为 7,保证下次 while 循环仍然正常循环 8 次
endseq ); // 顺序模型结束
method Action write(Bit#(8) data); // 当外部需要发送 SPI 时,调用此 method。参数 data 是待发送的字节
wdata <= data;
spiFsm.start(); // 试图启动状态机 spiFsm
endmethod
method Bit#(3) spi = {ss,sck,mosi}; // 该 method 用于将 SPI 信号引出到模块外部
endmodule
endpackage
| Bluespec | 5 | Xiefengshang/BSV_Tutorial_cn | src/3.SPIWriter/SPIWriter.bsv | [
"MIT"
] |
"""The tests for the hassio component."""
from http import HTTPStatus
from unittest.mock import MagicMock, patch
from aiohttp.hdrs import X_FORWARDED_FOR, X_FORWARDED_HOST, X_FORWARDED_PROTO
import pytest
@pytest.mark.parametrize(
"build_type",
[
("a3_vl", "test/beer/ping?index=1"),
("core", "index.html"),
("local", "panel/config"),
("jk_921", "editor.php?idx=3&ping=5"),
("fsadjf10312", ""),
],
)
async def test_ingress_request_get(hassio_client, build_type, aioclient_mock):
"""Test no auth needed for ."""
aioclient_mock.get(
f"http://127.0.0.1/ingress/{build_type[0]}/{build_type[1]}",
text="test",
)
resp = await hassio_client.get(
f"/api/hassio_ingress/{build_type[0]}/{build_type[1]}",
headers={"X-Test-Header": "beer"},
)
# Check we got right response
assert resp.status == HTTPStatus.OK
body = await resp.text()
assert body == "test"
# Check we forwarded command
assert len(aioclient_mock.mock_calls) == 1
assert aioclient_mock.mock_calls[-1][3]["X-Hassio-Key"] == "123456"
assert (
aioclient_mock.mock_calls[-1][3]["X-Ingress-Path"]
== f"/api/hassio_ingress/{build_type[0]}"
)
assert aioclient_mock.mock_calls[-1][3]["X-Test-Header"] == "beer"
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_FOR]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_HOST]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_PROTO]
@pytest.mark.parametrize(
"build_type",
[
("a3_vl", "test/beer/ping?index=1"),
("core", "index.html"),
("local", "panel/config"),
("jk_921", "editor.php?idx=3&ping=5"),
("fsadjf10312", ""),
],
)
async def test_ingress_request_post(hassio_client, build_type, aioclient_mock):
"""Test no auth needed for ."""
aioclient_mock.post(
f"http://127.0.0.1/ingress/{build_type[0]}/{build_type[1]}",
text="test",
)
resp = await hassio_client.post(
f"/api/hassio_ingress/{build_type[0]}/{build_type[1]}",
headers={"X-Test-Header": "beer"},
)
# Check we got right response
assert resp.status == HTTPStatus.OK
body = await resp.text()
assert body == "test"
# Check we forwarded command
assert len(aioclient_mock.mock_calls) == 1
assert aioclient_mock.mock_calls[-1][3]["X-Hassio-Key"] == "123456"
assert (
aioclient_mock.mock_calls[-1][3]["X-Ingress-Path"]
== f"/api/hassio_ingress/{build_type[0]}"
)
assert aioclient_mock.mock_calls[-1][3]["X-Test-Header"] == "beer"
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_FOR]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_HOST]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_PROTO]
@pytest.mark.parametrize(
"build_type",
[
("a3_vl", "test/beer/ping?index=1"),
("core", "index.html"),
("local", "panel/config"),
("jk_921", "editor.php?idx=3&ping=5"),
("fsadjf10312", ""),
],
)
async def test_ingress_request_put(hassio_client, build_type, aioclient_mock):
"""Test no auth needed for ."""
aioclient_mock.put(
f"http://127.0.0.1/ingress/{build_type[0]}/{build_type[1]}",
text="test",
)
resp = await hassio_client.put(
f"/api/hassio_ingress/{build_type[0]}/{build_type[1]}",
headers={"X-Test-Header": "beer"},
)
# Check we got right response
assert resp.status == HTTPStatus.OK
body = await resp.text()
assert body == "test"
# Check we forwarded command
assert len(aioclient_mock.mock_calls) == 1
assert aioclient_mock.mock_calls[-1][3]["X-Hassio-Key"] == "123456"
assert (
aioclient_mock.mock_calls[-1][3]["X-Ingress-Path"]
== f"/api/hassio_ingress/{build_type[0]}"
)
assert aioclient_mock.mock_calls[-1][3]["X-Test-Header"] == "beer"
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_FOR]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_HOST]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_PROTO]
@pytest.mark.parametrize(
"build_type",
[
("a3_vl", "test/beer/ping?index=1"),
("core", "index.html"),
("local", "panel/config"),
("jk_921", "editor.php?idx=3&ping=5"),
("fsadjf10312", ""),
],
)
async def test_ingress_request_delete(hassio_client, build_type, aioclient_mock):
"""Test no auth needed for ."""
aioclient_mock.delete(
f"http://127.0.0.1/ingress/{build_type[0]}/{build_type[1]}",
text="test",
)
resp = await hassio_client.delete(
f"/api/hassio_ingress/{build_type[0]}/{build_type[1]}",
headers={"X-Test-Header": "beer"},
)
# Check we got right response
assert resp.status == HTTPStatus.OK
body = await resp.text()
assert body == "test"
# Check we forwarded command
assert len(aioclient_mock.mock_calls) == 1
assert aioclient_mock.mock_calls[-1][3]["X-Hassio-Key"] == "123456"
assert (
aioclient_mock.mock_calls[-1][3]["X-Ingress-Path"]
== f"/api/hassio_ingress/{build_type[0]}"
)
assert aioclient_mock.mock_calls[-1][3]["X-Test-Header"] == "beer"
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_FOR]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_HOST]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_PROTO]
@pytest.mark.parametrize(
"build_type",
[
("a3_vl", "test/beer/ping?index=1"),
("core", "index.html"),
("local", "panel/config"),
("jk_921", "editor.php?idx=3&ping=5"),
("fsadjf10312", ""),
],
)
async def test_ingress_request_patch(hassio_client, build_type, aioclient_mock):
"""Test no auth needed for ."""
aioclient_mock.patch(
f"http://127.0.0.1/ingress/{build_type[0]}/{build_type[1]}",
text="test",
)
resp = await hassio_client.patch(
f"/api/hassio_ingress/{build_type[0]}/{build_type[1]}",
headers={"X-Test-Header": "beer"},
)
# Check we got right response
assert resp.status == HTTPStatus.OK
body = await resp.text()
assert body == "test"
# Check we forwarded command
assert len(aioclient_mock.mock_calls) == 1
assert aioclient_mock.mock_calls[-1][3]["X-Hassio-Key"] == "123456"
assert (
aioclient_mock.mock_calls[-1][3]["X-Ingress-Path"]
== f"/api/hassio_ingress/{build_type[0]}"
)
assert aioclient_mock.mock_calls[-1][3]["X-Test-Header"] == "beer"
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_FOR]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_HOST]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_PROTO]
@pytest.mark.parametrize(
"build_type",
[
("a3_vl", "test/beer/ping?index=1"),
("core", "index.html"),
("local", "panel/config"),
("jk_921", "editor.php?idx=3&ping=5"),
("fsadjf10312", ""),
],
)
async def test_ingress_request_options(hassio_client, build_type, aioclient_mock):
"""Test no auth needed for ."""
aioclient_mock.options(
f"http://127.0.0.1/ingress/{build_type[0]}/{build_type[1]}",
text="test",
)
resp = await hassio_client.options(
f"/api/hassio_ingress/{build_type[0]}/{build_type[1]}",
headers={"X-Test-Header": "beer"},
)
# Check we got right response
assert resp.status == HTTPStatus.OK
body = await resp.text()
assert body == "test"
# Check we forwarded command
assert len(aioclient_mock.mock_calls) == 1
assert aioclient_mock.mock_calls[-1][3]["X-Hassio-Key"] == "123456"
assert (
aioclient_mock.mock_calls[-1][3]["X-Ingress-Path"]
== f"/api/hassio_ingress/{build_type[0]}"
)
assert aioclient_mock.mock_calls[-1][3]["X-Test-Header"] == "beer"
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_FOR]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_HOST]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_PROTO]
@pytest.mark.parametrize(
"build_type",
[
("a3_vl", "test/beer/ws"),
("core", "ws.php"),
("local", "panel/config/stream"),
("jk_921", "hulk"),
("demo", "ws/connection?id=9&token=SJAKWS283"),
],
)
async def test_ingress_websocket(hassio_client, build_type, aioclient_mock):
"""Test no auth needed for ."""
aioclient_mock.get(f"http://127.0.0.1/ingress/{build_type[0]}/{build_type[1]}")
# Ignore error because we can setup a full IO infrastructure
await hassio_client.ws_connect(
f"/api/hassio_ingress/{build_type[0]}/{build_type[1]}",
headers={"X-Test-Header": "beer"},
)
# Check we forwarded command
assert len(aioclient_mock.mock_calls) == 1
assert aioclient_mock.mock_calls[-1][3]["X-Hassio-Key"] == "123456"
assert (
aioclient_mock.mock_calls[-1][3]["X-Ingress-Path"]
== f"/api/hassio_ingress/{build_type[0]}"
)
assert aioclient_mock.mock_calls[-1][3]["X-Test-Header"] == "beer"
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_FOR]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_HOST]
assert aioclient_mock.mock_calls[-1][3][X_FORWARDED_PROTO]
async def test_ingress_missing_peername(hassio_client, aioclient_mock, caplog):
"""Test hadnling of missing peername."""
aioclient_mock.get(
"http://127.0.0.1/ingress/lorem/ipsum",
text="test",
)
def get_extra_info(_):
return None
with patch(
"aiohttp.web_request.BaseRequest.transport",
return_value=MagicMock(),
) as transport_mock:
transport_mock.get_extra_info = get_extra_info
resp = await hassio_client.get(
"/api/hassio_ingress/lorem/ipsum",
headers={"X-Test-Header": "beer"},
)
assert "Can't set forward_for header, missing peername" in caplog.text
# Check we got right response
assert resp.status == HTTPStatus.BAD_REQUEST
| Python | 5 | MrDelik/core | tests/components/hassio/test_ingress.py | [
"Apache-2.0"
] |
// Package bitwise provides functions for performing bitwise operations on integers.
//
// All integers are 64 bit integers.
//
// Functions prefixed with s operate on signed integers (int).
// Functions prefixed with u operate on unsigned integers (uint).
//
// introduced: 0.138.0
// tags: bitwise
//
package bitwise
// uand performs the bitwise operation, `a AND b`, with unsigned integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Right hand operand.
//
// ## Examples
// ### Perform a bitwise AND operation
// ```no_run
// import "experimental/bitwise"
//
// bitwise.uand(a: uint(v: 1234), b: uint(v: 4567))
//
// // Returns 210 (uint)
// ```
//
// ### Perform a bitwise AND operation on a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.uint()
// > |> map(fn: (r) => ({ r with _value: bitwise.uand(a: r._value, b: uint(v: 3))}))
// ```
//
builtin uand : (a: uint, b: uint) => uint
// uor performs the bitwise operation, `a OR b`, with unsigned integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Right hand operand.
//
// ## Examples
// ### Perform a bitwise OR operation
// ```no_run
// import "experimental/bitwise"
//
// bitwise.uor(a: uint(v: 1234), b: uint(v: 4567))
//
// // Returns 5591 (uint)
// ```
//
// ### Perform a bitwise OR operation on a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.uint()
// > |> map(fn: (r) => ({ r with _value: bitwise.uor(a: r._value, b: uint(v: 3))}))
// ```
//
builtin uor : (a: uint, b: uint) => uint
// unot inverts every bit in `a`, an unsigned integer.
//
// ## Parameters
// - a: Unsigned integer to invert.
//
// ## Examples
// ### Invert bits in an unsigned integer
// ```no_run
// import "experimental/bitwise"
//
// bitwise.unot(a: uint(v: 1234))
//
// // Returns 18446744073709550381 (uint)
// ```
//
// ### Invert bits in unsigned integers in a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.uint()
// > |> map(fn: (r) => ({ r with _value: bitwise.unot(a: r._value)}))
// ```
//
builtin unot : (a: uint) => uint
// uxor performs the bitwise operation, `a XOR b`, with unsigned integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Right hand operand.
//
// ## Examples
// ### Perform a bitwise XOR operation
// ```no_run
// import "experimental/bitwise"
//
// bitwise.uxor(a: uint(v: 1234), b: uint(v: 4567))
//
// // Returns 5381 (uint)
// ```
//
// ### Perform a bitwise XOR operation on a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.uint()
// > |> map(fn: (r) => ({ r with _value: bitwise.uxor(a: r._value, b: uint(v: 3))}))
// ```
//
builtin uxor : (a: uint, b: uint) => uint
// uclear performs the bitwise operation `a AND NOT b`, with unsigned integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Bits to clear.
//
// ## Examples
// ### Perform a bitwise AND NOT operation
// ```no_run
// import "experimental/bitwise"
//
// bitwise.uclear(a: uint(v: 1234), b: uint(v: 4567))
//
// // Returns 1024 (uint)
// ```
//
// ### Perform a bitwise AND NOT operation on a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.uint()
// > |> map(fn: (r) => ({ r with _value: bitwise.uclear(a: r._value, b: uint(v: 3))}))
// ```
//
builtin uclear : (a: uint, b: uint) => uint
// ulshift shifts the bits in `a` left by `b` bits.
// Both `a` and `b` are unsigned integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Number of bits to shift.
//
// ## Examples
// ### Shift bits left in an unsigned integer
// ```no_run
// import "experimental/bitwise"
//
// bitwise.ulshift(a: uint(v: 1234), b: uint(v: 2))
//
// // Returns 4936 (uint)
// ```
//
// ### Shift bits left in unsigned integers in a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.uint()
// > |> map(fn: (r) => ({ r with _value: bitwise.ulshift(a: r._value, b: uint(v: 3))}))
// ```
//
builtin ulshift : (a: uint, b: uint) => uint
// urshift shifts the bits in `a` right by `b` bits.
// Both `a` and `b` are unsigned integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Number of bits to shift.
//
// ## Examples
// ### Shift bits right in an unsigned integer
// ```no_run
// import "experimental/bitwise"
//
// bitwise.urshift(a: uint(v: 1234), b: uint(v: 2))
//
// // Returns 308 (uint)
// ```
//
// ### Shift bits right in unsigned integers in a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.uint()
// > |> map(fn: (r) => ({ r with _value: bitwise.urshift(a: r._value, b: uint(v: 3))}))
// ```
//
builtin urshift : (a: uint, b: uint) => uint
// sand performs the bitwise operation, `a AND b`, with integers.
//
// ## Parameters
// - a: Left hand operand
// - b: Right hand operand
//
// ## Examples
// ### Perform a bitwise AND operation
// ```no_run
// import "experimental/bitwise"
//
// bitwise.sand(a: 1234, b: 4567)
//
// // Returns 210
// ```
//
// ### Perform a bitwise AND operation on a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.int()
// > |> map(fn: (r) => ({ r with _value: bitwise.sand(a: r._value, b: 3)}))
// ```
//
builtin sand : (a: int, b: int) => int
// sor performs the bitwise operation, `a OR b`, with integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Right hand operand.
//
// ## Examples
// ### Perform a bitwise OR operation
// ```no_run
// import "experimental/bitwise"
//
// bitwise.sor(a: 1234, b: 4567)
//
// // Returns 5591
// ```
//
// ### Perform a bitwise OR operation on a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.int()
// > |> map(fn: (r) => ({ r with _value: bitwise.sor(a: r._value, b: 3)}))
// ```
//
builtin sor : (a: int, b: int) => int
// snot inverts every bit in `a`, an integer.
//
// ## Parameters
// - a: Integer to invert.
//
// ## Examples
// ### Invert bits in an integer
// ```no_run
// import "experimental/bitwise"
//
// bitwise.snot(a: 1234)
//
// // Returns -1235
// ```
//
// ### Invert bits in integers in a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.int()
// > |> map(fn: (r) => ({ r with _value: bitwise.snot(a: r._value)}))
// ```
//
builtin snot : (a: int) => int
// sxor performs the bitwise operation, `a XOR b`, with integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Right hand operand.
//
// ## Examples
// ### Perform a bitwise XOR operation
// ```no_run
// import "experimental/bitwise"
//
// bitwise.sxor(a: 1234, b: 4567)
//
// // Returns 5381
// ```
//
// ### Perform a bitwise XOR operation on a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.int()
// > |> map(fn: (r) => ({ r with _value: bitwise.sxor(a: r._value, b: 3)}))
// ```
//
builtin sxor : (a: int, b: int) => int
// sclear performs the bitwise operation `a AND NOT b`.
// Both `a` and `b` are integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Bits to clear.
//
// ## Examples
// ### Perform a bitwise AND NOT operation
// ```no_run
// import "experimental/bitwise"
//
// bitwise.sclear(a: 1234, b: 4567)
//
// // Returns 1024
// ```
//
// ### Perform a bitwise AND NOT operation on a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.int()
// > |> map(fn: (r) => ({ r with _value: bitwise.sclear(a: r._value, b: 3)}))
// ```
//
builtin sclear : (a: int, b: int) => int
// slshift shifts the bits in `a` left by `b` bits.
// Both `a` and `b` are integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Number of bits to shift.
//
// ## Examples
// ### Shift bits left in an integer
// ```no_run
// import "experimental/bitwise"
//
// bitwise.slshift(a: 1234, b: 2)
//
// // Returns 4936
// ```
//
// ### Shift bits left in integers in a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.int()
// > |> map(fn: (r) => ({ r with _value: bitwise.slshift(a: r._value, b: 3)}))
// ```
//
builtin slshift : (a: int, b: int) => int
// srshift shifts the bits in `a` right by `b` bits.
// Both `a` and `b` are integers.
//
// ## Parameters
// - a: Left hand operand.
// - b: Number of bits to shift.
//
// ## Examples
// ### Shift bits right in an integer
// ```no_run
// import "experimental/bitwise"
//
// bitwise.srshift(a: 1234, b: 2)
//
// // Returns 308
// ```
//
// ### Shift bits right in integers in a stream of tables
// ```
// import "experimental/bitwise"
// import "sampledata"
//
// < sampledata.int()
// > |> map(fn: (r) => ({ r with _value: bitwise.srshift(a: r._value, b: 3)}))
// ```
//
builtin srshift : (a: int, b: int) => int
| FLUX | 5 | geropl/flux | stdlib/experimental/bitwise/bitwise.flux | [
"MIT"
] |
10 5
0 1 4 2 1 4 3 [0] [0] [0] [0]
1 1 2 6 11 [-3] [10]
2 1 2 6 9 [-1] [20]
3 1 1 5 [1]
4 1 2 5 7 [6] [9]
5 1 1 10 [4]
6 1 2 1 10 [-5] [0]
7 1 3 9 8 4 [1] [0] [-9]
8 1 2 5 6 [12] [-2]
9 1 1 11 [7]
10 1 1 11 [5]
11 1 0
0 1 0 0 0 0 0
1 1 -1 -1 -1 0 0
2 1 -1 0 0 1 0
3 1 0 2 1 2 0
4 1 0 0 2 -1 0
5 1 -1 0 -1 0 -2
6 1 -2 0 2 -1 -1
7 1 0 0 -1 1 -2
8 1 -2 1 1 0 0
9 1 2 0 -1 2 -2
10 1 0 1 2 -2 1
11 1 0 0 0 0 0
-6 1 2 1 -7
-1 3 4 4 -1 | Eagle | 0 | klorel/or-tools | examples/data/rcpsp/single_mode_consumer_producer/ubo10_cum_2/psp10_43.sch | [
"Apache-2.0"
] |
{
"title": "\u0e41\u0e08\u0e49\u0e07"
} | JSON | 0 | domwillcode/home-assistant | homeassistant/components/notify/translations/th.json | [
"Apache-2.0"
] |
vector rotationCenter;
default
{
state_entry()
{
llSay( 0, "Hello, Avatar!");
vector startPoint = llGetPos();
rotationCenter = startPoint + < 3, 3, 3 >;
// distance to the point of rotation should probably be a
// function of the max dimension of the object.
}
touch_start(integer total_number)
{
llSay( 0, "Touched." );
// Define a "rotation" of 10 degrees around the z-axis.
rotation Z_15 = llEuler2Rot( < 0, 0, 15 * DEG_TO_RAD > );
integer i;
for( i = 1; i < 100; i++ ) // limit simulation time in case of
{ // unexpected behavior.
vector currentPosition = llGetPos();
vector currentOffset = currentPosition - rotationCenter;
// rotate the offset vector in the X-Y plane around the
// distant point of rotation.
vector rotatedOffset = currentOffset * Z_15;
vector newPosition = rotationCenter + rotatedOffset;
llSetPos( newPosition );
}
llSay( 0, "Orbiting stopped" );
}
}
| LSL | 4 | MandarinkaTasty/OpenSim | bin/assets/ScriptsAssetSet/KanEd-Test07.lsl | [
"BSD-3-Clause"
] |
(ns hacker-scripts.kumar
(:import
(java.util Properties)
(javax.mail Session Authenticator PasswordAuthentication Message$RecipientType Transport Folder Flags Flags$Flag)
(javax.mail.internet MimeMessage InternetAddress)
(javax.mail.search FlagTerm FromTerm AndTerm OrTerm SubjectTerm BodyTerm SearchTerm)))
(def host "smtp.gmail.com")
(def my-email "[email protected]")
(def my-password "my-gmail-password")
(def kumar-email "[email protected]")
(def seen-flag (Flags. (Flags$Flag/SEEN)))
(def unread-term (FlagTerm. seen-flag false))
(defn get-session []
(let [authenticator (proxy [Authenticator] []
(getPasswordAuthentication []
(PasswordAuthentication. my-email my-password)))
props (Properties.)]
(.put props "mail.smtp.host" "smtp.gmail.com")
(.put props "mail.smtp.port" "587")
(.put props "mail.smtp.auth" "true")
(.put props "mail.smtp.starttls.enable" "true")
(.. Session (getInstance props authenticator))))
(defn get-inbox [session]
(let [store (.getStore session "imaps")
inbox (do
(.connect store host my-email my-password)
(.getFolder store "inbox"))]
(.open inbox Folder/READ_WRITE)
inbox))
(defn get-no-worries-message [session]
(let [message (MimeMessage. session)]
(.setFrom message (InternetAddress. my-email))
(.addRecipient message Message$RecipientType/TO (InternetAddress. kumar-email))
(.setSubject message "Database fixes")
(.setText message "No worries mate, be careful next time")
message))
(defn search-term [pattern]
(OrTerm. (into-array SearchTerm [(SubjectTerm. pattern) (BodyTerm. pattern)])))
(defn any-of-search-term [& patterns]
(OrTerm. (into-array (map search-term patterns))))
(defn from-term [addr]
(FromTerm. (InternetAddress. addr)))
(defn get-unread-sos-from-kumar [inbox]
(let [flag (AndTerm. (into-array SearchTerm [unread-term
(from-term kumar-email)
(any-of-search-term "help" "sorry" "trouble")]))]
(.search inbox flag)))
(defn mark-as-read [inbox messages]
(.setFlags inbox messages seen-flag true))
(defn kumar-asshole []
(let [session (get-session)
inbox (get-inbox session)
unread-sos-from-kumar (get-unread-sos-from-kumar inbox)]
(when (seq unread-sos-from-kumar)
(mark-as-read inbox unread-sos-from-kumar)
(Transport/send (get-no-worries-message session)))))
| Clojure | 4 | johndemlon/hacker-scripts | clojure/kumar.clj | [
"WTFPL"
] |
SpanishDefaultBehavior = Reflector other:mimic(DefaultBehavior)
SpanishDefaultBehavior Origen = Origin
SpanishDefaultBehavior celda = cell(:cell)
SpanishDefaultBehavior imitación = cell(:mimic)
SpanishDefaultBehavior imita! = cell(:mimic!)
SpanishDefaultBehavior método = cell(:method)
SpanishDefaultBehavior función = cell(:fn)
SpanishDefaultBehavior haciendo = cell(:do)
SpanishDefaultBehavior con = cell(:with)
SpanishDefaultBehavior mi = method(self)
SpanishDefaultBehavior si = cell(:if) ; conjuction, interrogative
SpanishDefaultBehavior sí = cell(:true) ; with accent its an adverb, affirmative
SpanishDefaultBehavior no = cell(:false)
SpanishDefaultBehavior imprime = Origin cell(:print)
SpanishDefaultBehavior imprimeLinea = Origin cell(:println)
DefaultBehavior mimic!(SpanishDefaultBehavior)
| Ioke | 3 | olabini/ioke | examples/multilang/spanish/spanish.ik | [
"ICU",
"MIT"
] |
discard """
output: '''[1 2 3 ]
[1 2 3 ]
[1 2 3 ]'''
"""
# bug #297
import json, tables, algorithm
proc outp(a: openarray[int]) =
stdout.write "["
for i in a: stdout.write($i & " ")
stdout.write "]\n"
proc works() =
var f = @[3, 2, 1]
sort(f, system.cmp[int])
outp(f)
proc weird(json_params: Table) =
var f = @[3, 2, 1]
# The following line doesn't compile: type mismatch. Why?
sort(f, system.cmp[int])
outp(f)
var t = @[3, 2, 1]
sort(t, system.cmp[int])
outp(t)
works()
weird(initTable[string, JsonNode]())
| Nimrod | 4 | JohnAD/Nim | tests/typerel/texplicitcmp.nim | [
"MIT"
] |
#if defined(_WIN32)
# include <windows.h>
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef USE_PPPORT_H
# include "ppport.h"
#endif
#ifndef HAVE_SYSLOG
#define HAVE_SYSLOG 1
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
# undef HAVE_SYSLOG
# include "fallback/syslog.h"
#else
# if defined(I_SYSLOG) || PATCHLEVEL < 6
# include <syslog.h>
# endif
#endif
static SV *ident_svptr;
#include "const-c.inc"
MODULE = Sys::Syslog PACKAGE = Sys::Syslog
INCLUDE: const-xs.inc
int
LOG_FAC(p)
INPUT:
int p
CODE:
#ifdef LOG_FAC
RETVAL = LOG_FAC(p);
#else
croak("Your vendor has not defined the Sys::Syslog macro LOG_FAC");
RETVAL = -1;
#endif
OUTPUT:
RETVAL
int
LOG_PRI(p)
INPUT:
int p
CODE:
#ifdef LOG_PRI
RETVAL = LOG_PRI(p);
#else
croak("Your vendor has not defined the Sys::Syslog macro LOG_PRI");
RETVAL = -1;
#endif
OUTPUT:
RETVAL
int
LOG_MAKEPRI(fac,pri)
INPUT:
int fac
int pri
CODE:
#ifdef LOG_MAKEPRI
RETVAL = LOG_MAKEPRI(fac,pri);
#else
croak("Your vendor has not defined the Sys::Syslog macro LOG_MAKEPRI");
RETVAL = -1;
#endif
OUTPUT:
RETVAL
int
LOG_MASK(pri)
INPUT:
int pri
CODE:
#ifdef LOG_MASK
RETVAL = LOG_MASK(pri);
#else
croak("Your vendor has not defined the Sys::Syslog macro LOG_MASK");
RETVAL = -1;
#endif
OUTPUT:
RETVAL
int
LOG_UPTO(pri)
INPUT:
int pri
CODE:
#ifdef LOG_UPTO
RETVAL = LOG_UPTO(pri);
#else
croak("Your vendor has not defined the Sys::Syslog macro LOG_UPTO");
RETVAL = -1;
#endif
OUTPUT:
RETVAL
#ifdef HAVE_SYSLOG
void
openlog_xs(ident, option, facility)
INPUT:
SV* ident
int option
int facility
PREINIT:
STRLEN len;
char* ident_pv;
CODE:
ident_svptr = newSVsv(ident);
ident_pv = SvPV(ident_svptr, len);
openlog(ident_pv, option, facility);
void
syslog_xs(priority, message)
INPUT:
int priority
const char * message
CODE:
syslog(priority, "%s", message);
int
setlogmask_xs(mask)
INPUT:
int mask
CODE:
RETVAL = setlogmask(mask);
OUTPUT:
RETVAL
void
closelog_xs()
CODE:
closelog();
if (SvREFCNT(ident_svptr))
SvREFCNT_dec(ident_svptr);
#else /* HAVE_SYSLOG */
void
openlog_xs(ident, option, facility)
INPUT:
SV* ident
int option
int facility
CODE:
void
syslog_xs(priority, message)
INPUT:
int priority
const char * message
CODE:
int
setlogmask_xs(mask)
INPUT:
int mask
CODE:
void
closelog_xs()
CODE:
#endif /* HAVE_SYSLOG */
| XS | 4 | vlinhd11/vlinhd11-android-scripting | perl/src/ext/Sys-Syslog/Syslog.xs | [
"Apache-2.0"
] |
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
<h2>
<a href="<%= rel_prefix %>/index.html" rel="home">Home</a>
</h2>
<div id="table-of-contents-navigation">
<a href="<%= rel_prefix %>/table_of_contents.html#pages">Pages</a>
<a href="<%= rel_prefix %>/table_of_contents.html#classes">Classes</a>
<a href="<%= rel_prefix %>/table_of_contents.html#methods">Methods</a>
</div>
</div>
| RHTML | 4 | Bhuvanesh1208/ruby2.6.1 | lib/ruby/2.6.0/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml | [
"Ruby"
] |
- dashboard: us_state_dashboard
title: US State Dashboard
layout: newspaper
elements:
- title: Workplace Time vs. Baseline
name: Workplace Time vs Baseline
model: mobility
explore: mobility
type: looker_map
fields: [mobility.workplaces_dynamic, mobility.sub_region_1]
filters:
mobility.geography_level: '1'
mobility.country_region: United States
sorts: [mobility.sub_region_1]
limit: 500
column_limit: 50
map_plot_mode: points
heatmap_gridlines: true
heatmap_gridlines_empty: false
heatmap_opacity: 0.7
show_region_field: true
draw_map_labels_above_data: true
map_tile_provider: light
map_position: custom
map_scale_indicator: 'off'
map_pannable: true
map_zoomable: true
map_marker_type: circle
map_marker_icon_name: default
map_marker_radius_mode: proportional_value
map_marker_units: meters
map_marker_proportional_scale_type: linear
map_marker_color_mode: fixed
show_view_names: false
show_legend: true
quantize_map_value_colors: false
reverse_map_value_colors: true
map_latitude: 52.04869010664421
map_longitude: -102.74414062500001
map_zoom: 3
map_value_colors: ["#f1eef6", "#045a8d"]
defaults_version: 1
series_types: {}
listen:
Moving Avg or Daily: mobility.daily_or_avg
row: 5
col: 0
width: 11
height: 9
- title: Residential Time vs. Baseline
name: Residential Time vs Baseline
model: mobility
explore: mobility
type: looker_map
fields: [mobility.sub_region_1, mobility.residential_dynamic]
filters:
mobility.country_region_code: US
mobility.geography_level: '1'
sorts: [mobility.residential_dynamic desc]
limit: 500
column_limit: 50
map_plot_mode: points
heatmap_gridlines: true
heatmap_gridlines_empty: false
heatmap_opacity: 0.7
show_region_field: true
draw_map_labels_above_data: true
map_tile_provider: light
map_position: custom
map_scale_indicator: 'off'
map_pannable: true
map_zoomable: true
map_marker_type: circle
map_marker_icon_name: default
map_marker_radius_mode: proportional_value
map_marker_units: meters
map_marker_proportional_scale_type: linear
map_marker_color_mode: fixed
show_view_names: false
show_legend: true
quantize_map_value_colors: false
reverse_map_value_colors: false
map_latitude: 53.0143701518044
map_longitude: -100.30586242675783
map_zoom: 3
map_value_colors: ["#feedde", "#a63603"]
defaults_version: 1
series_types: {}
listen:
Moving Avg or Daily: mobility.daily_or_avg
row: 5
col: 11
width: 13
height: 9
- title: Grocery and Pharmacy
name: Grocery and Pharmacy
model: mobility
explore: mobility
type: looker_line
fields: [mobility.sub_region_1, mobility.mobility_date, mobility.grocery_and_pharmacy_dynamic]
pivots: [mobility.sub_region_1]
fill_fields: [mobility.mobility_date]
filters:
mobility.geography_level: '1'
mobility.country_region: United States
sorts: [mobility.mobility_date desc, mobility.sub_region_1]
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: false
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
show_null_points: true
interpolation: linear
color_application:
collection_id: 1297ec12-86a5-4ae0-9dfc-82de70b3806a
palette_id: 93f8aeb4-3f4a-4cd7-8fee-88c3417516a1
options:
steps: 5
y_axes: [{label: '', orientation: left, series: [{axisId: mobility_dev.grocery_and_pharmacy_7_day_moving_avg,
id: mobility_dev.grocery_and_pharmacy_7_day_moving_avg, name: Grocery
and Pharmacy (7-Day Moving Avg)}], showLabels: false, showValues: true,
maxValue: 0.5, minValue: -0.75, unpinAxis: false, tickDensity: default, tickDensityCustom: 5,
type: linear}]
series_types: {}
reference_lines: [{reference_type: line, range_start: max, range_end: min, margin_top: deviation,
margin_value: mean, margin_bottom: deviation, label_position: center, color: "#000000",
label: Baseline, line_value: '0'}]
trend_lines: []
map_plot_mode: points
heatmap_gridlines: true
heatmap_gridlines_empty: false
heatmap_opacity: 0.7
show_region_field: true
draw_map_labels_above_data: true
map_tile_provider: light
map_position: fit_data
map_latitude: 42.18350433370498
map_longitude: -76.17293357849123
map_zoom: 6
map_scale_indicator: 'off'
map_pannable: true
map_zoomable: true
map_marker_type: circle
map_marker_icon_name: default
map_marker_radius_mode: proportional_value
map_marker_units: meters
map_marker_proportional_scale_type: linear
map_marker_color_mode: fixed
show_legend: true
map_value_colors: ["#feedde", "#a63603"]
quantize_map_value_colors: false
reverse_map_value_colors: false
defaults_version: 1
listen:
2 - State, Province, or Similar: mobility.sub_region_1
Moving Avg or Daily: mobility.daily_or_avg
row: 14
col: 0
width: 8
height: 7
- title: Parks
name: Parks
model: mobility
explore: mobility
type: looker_line
fields: [mobility.sub_region_1, mobility.mobility_date, mobility.parks_dynamic]
pivots: [mobility.sub_region_1]
fill_fields: [mobility.mobility_date]
filters:
mobility.country_region_code: US
mobility.geography_level: '1'
sorts: [mobility.mobility_date desc, mobility.sub_region_1]
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: false
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
show_null_points: true
interpolation: linear
color_application:
collection_id: 1297ec12-86a5-4ae0-9dfc-82de70b3806a
palette_id: 93f8aeb4-3f4a-4cd7-8fee-88c3417516a1
options:
steps: 5
y_axes: [{label: '', orientation: left, series: [{axisId: mobility_dev.parks_7_day_moving_avg,
id: mobility_dev.parks_7_day_moving_avg, name: Parks (7-Day Moving Avg)}],
showLabels: false, showValues: true, maxValue: 0.5, minValue: -0.75, unpinAxis: false,
tickDensity: default, tickDensityCustom: 5, type: linear}]
series_types: {}
series_colors:
mobility_dev.parks_7_day_moving_avg: "#10C871"
reference_lines: [{reference_type: line, range_start: max, range_end: min, margin_top: deviation,
margin_value: mean, margin_bottom: deviation, label_position: center, color: "#000000",
line_value: '0', label: Baseline}]
map_plot_mode: points
heatmap_gridlines: true
heatmap_gridlines_empty: false
heatmap_opacity: 0.7
show_region_field: true
draw_map_labels_above_data: true
map_tile_provider: light
map_position: fit_data
map_latitude: 42.18350433370498
map_longitude: -76.17293357849123
map_zoom: 6
map_scale_indicator: 'off'
map_pannable: true
map_zoomable: true
map_marker_type: circle
map_marker_icon_name: default
map_marker_radius_mode: proportional_value
map_marker_units: meters
map_marker_proportional_scale_type: linear
map_marker_color_mode: fixed
show_legend: true
map_value_colors: ["#feedde", "#a63603"]
quantize_map_value_colors: false
reverse_map_value_colors: false
defaults_version: 1
listen:
2 - State, Province, or Similar: mobility.sub_region_1
Moving Avg or Daily: mobility.daily_or_avg
row: 14
col: 8
width: 8
height: 7
- title: Residential
name: Residential
model: mobility
explore: mobility
type: looker_line
fields: [mobility.sub_region_1, mobility.mobility_date, mobility.residential_dynamic]
pivots: [mobility.sub_region_1]
fill_fields: [mobility.mobility_date]
filters:
mobility.geography_level: '1'
mobility.country_region_code: US
sorts: [mobility.mobility_date desc, mobility.sub_region_1]
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: false
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
show_null_points: true
interpolation: linear
color_application:
collection_id: 1297ec12-86a5-4ae0-9dfc-82de70b3806a
palette_id: 93f8aeb4-3f4a-4cd7-8fee-88c3417516a1
options:
steps: 5
y_axes: [{label: '', orientation: left, series: [{axisId: mobility_dev.residential_7_cay_moving_avg,
id: mobility_dev.residential_7_cay_moving_avg, name: Residential (7-Day
Moving Avg)}], showLabels: false, showValues: true, maxValue: 0.5, minValue: -0.75,
unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}]
series_types: {}
series_colors:
mobility_dev.parks_7_day_moving_avg: "#7CC8FA"
mobility_dev.residential_7_cay_moving_avg: "#FD9577"
reference_lines: [{reference_type: line, range_start: max, range_end: min, margin_top: deviation,
margin_value: mean, margin_bottom: deviation, label_position: center, color: "#000000",
line_value: '0', label: Baseline}]
map_plot_mode: points
heatmap_gridlines: true
heatmap_gridlines_empty: false
heatmap_opacity: 0.7
show_region_field: true
draw_map_labels_above_data: true
map_tile_provider: light
map_position: fit_data
map_latitude: 42.18350433370498
map_longitude: -76.17293357849123
map_zoom: 6
map_scale_indicator: 'off'
map_pannable: true
map_zoomable: true
map_marker_type: circle
map_marker_icon_name: default
map_marker_radius_mode: proportional_value
map_marker_units: meters
map_marker_proportional_scale_type: linear
map_marker_color_mode: fixed
show_legend: true
map_value_colors: ["#feedde", "#a63603"]
quantize_map_value_colors: false
reverse_map_value_colors: false
defaults_version: 1
listen:
2 - State, Province, or Similar: mobility.sub_region_1
Moving Avg or Daily: mobility.daily_or_avg
row: 21
col: 16
width: 8
height: 7
- title: Retail and Recreation
name: Retail and Recreation
model: mobility
explore: mobility
type: looker_line
fields: [mobility.retail_and_recreation_dynamic, mobility.sub_region_1, mobility.mobility_date]
pivots: [mobility.sub_region_1]
fill_fields: [mobility.mobility_date]
filters:
mobility.geography_level: '1'
sorts: [mobility.mobility_date desc, mobility.sub_region_1]
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: false
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
show_null_points: false
interpolation: linear
color_application:
collection_id: 1297ec12-86a5-4ae0-9dfc-82de70b3806a
palette_id: 93f8aeb4-3f4a-4cd7-8fee-88c3417516a1
options:
steps: 5
y_axes: [{label: '', orientation: left, series: [{axisId: mobility.retail_and_recreation_dynamic,
id: Aargau - mobility.retail_and_recreation_dynamic, name: Aargau}, {
axisId: mobility.retail_and_recreation_dynamic, id: Aberdeen City - mobility.retail_and_recreation_dynamic,
name: Aberdeen City}, {axisId: mobility.retail_and_recreation_dynamic,
id: Aberdeenshire - mobility.retail_and_recreation_dynamic, name: Aberdeenshire},
{axisId: mobility.retail_and_recreation_dynamic, id: Abia - mobility.retail_and_recreation_dynamic,
name: Abia}, {axisId: mobility.retail_and_recreation_dynamic, id: Abidjan
Autonomous District - mobility.retail_and_recreation_dynamic, name: Abidjan
Autonomous District}, {axisId: mobility.retail_and_recreation_dynamic,
id: Abruzzo - mobility.retail_and_recreation_dynamic, name: Abruzzo},
{axisId: mobility.retail_and_recreation_dynamic, id: Abu Dhabi - mobility.retail_and_recreation_dynamic,
name: Abu Dhabi}, {axisId: mobility.retail_and_recreation_dynamic, id: Aceh
- mobility.retail_and_recreation_dynamic, name: Aceh}, {axisId: mobility.retail_and_recreation_dynamic,
id: Ad Dakhiliyah Governorate - mobility.retail_and_recreation_dynamic,
name: Ad Dakhiliyah Governorate}, {axisId: mobility.retail_and_recreation_dynamic,
id: Ad Dhahirah Governorate - mobility.retail_and_recreation_dynamic,
name: Ad Dhahirah Governorate}, {axisId: mobility.retail_and_recreation_dynamic,
id: Adamawa - mobility.retail_and_recreation_dynamic, name: Adamawa},
{axisId: mobility.retail_and_recreation_dynamic, id: Adana - mobility.retail_and_recreation_dynamic,
name: Adana}, {axisId: mobility.retail_and_recreation_dynamic, id: Adıyaman
- mobility.retail_and_recreation_dynamic, name: Adıyaman}, {axisId: mobility.retail_and_recreation_dynamic,
id: Adjuntas - mobility.retail_and_recreation_dynamic, name: Adjuntas},
{axisId: mobility.retail_and_recreation_dynamic, id: Administrative unit
Maribor - mobility.retail_and_recreation_dynamic, name: Administrative
unit Maribor}, {axisId: mobility.retail_and_recreation_dynamic, id: Afyonkarahisar
- mobility.retail_and_recreation_dynamic, name: Afyonkarahisar}, {axisId: mobility.retail_and_recreation_dynamic,
id: Agadez Region - mobility.retail_and_recreation_dynamic, name: Agadez
Region}, {axisId: mobility.retail_and_recreation_dynamic, id: Agder
- mobility.retail_and_recreation_dynamic, name: Agder}, {axisId: mobility.retail_and_recreation_dynamic,
id: Aguada - mobility.retail_and_recreation_dynamic, name: Aguada}, {
axisId: mobility.retail_and_recreation_dynamic, id: Aguadilla - mobility.retail_and_recreation_dynamic,
name: Aguadilla}, {axisId: mobility.retail_and_recreation_dynamic, id: Aguas
Buenas - mobility.retail_and_recreation_dynamic, name: Aguas Buenas},
{axisId: mobility.retail_and_recreation_dynamic, id: Aguascalientes - mobility.retail_and_recreation_dynamic,
name: Aguascalientes}, {axisId: mobility.retail_and_recreation_dynamic,
id: Ahuachapán Department - mobility.retail_and_recreation_dynamic, name: Ahuachapán
Department}, {axisId: mobility.retail_and_recreation_dynamic, id: Aibonito
- mobility.retail_and_recreation_dynamic, name: Aibonito}, {axisId: mobility.retail_and_recreation_dynamic,
id: Aichi - mobility.retail_and_recreation_dynamic, name: Aichi}, {axisId: mobility.retail_and_recreation_dynamic,
id: Aizkraukle Municipality - mobility.retail_and_recreation_dynamic,
name: Aizkraukle Municipality}, {axisId: mobility.retail_and_recreation_dynamic,
id: Ajdovščina - mobility.retail_and_recreation_dynamic, name: Ajdovščina},
{axisId: mobility.retail_and_recreation_dynamic, id: Ajloun Governorate
- mobility.retail_and_recreation_dynamic, name: Ajloun Governorate},
{axisId: mobility.retail_and_recreation_dynamic, id: Ajman - mobility.retail_and_recreation_dynamic,
name: Ajman}, {axisId: mobility.retail_and_recreation_dynamic, id: Akita
- mobility.retail_and_recreation_dynamic, name: Akita}, {axisId: mobility.retail_and_recreation_dynamic,
id: Akkar Governorate - mobility.retail_and_recreation_dynamic, name: Akkar
Governorate}, {axisId: mobility.retail_and_recreation_dynamic, id: Aksaray
- mobility.retail_and_recreation_dynamic, name: Aksaray}, {axisId: mobility.retail_and_recreation_dynamic,
id: Akwa Ibom - mobility.retail_and_recreation_dynamic, name: Akwa Ibom},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Ahmadi Governorate
- mobility.retail_and_recreation_dynamic, name: Al Ahmadi Governorate},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Asimah Governate
- mobility.retail_and_recreation_dynamic, name: Al Asimah Governate},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Bahah Province -
mobility.retail_and_recreation_dynamic, name: Al Bahah Province}, {
axisId: mobility.retail_and_recreation_dynamic, id: Al Batinah North Governorate
- mobility.retail_and_recreation_dynamic, name: Al Batinah North Governorate},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Batinah South Governorate
- mobility.retail_and_recreation_dynamic, name: Al Batinah South Governorate},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Buraymi Governorate
- mobility.retail_and_recreation_dynamic, name: Al Buraymi Governorate},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Farwaniyah Governorate
- mobility.retail_and_recreation_dynamic, name: Al Farwaniyah Governorate},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Jahra Governorate
- mobility.retail_and_recreation_dynamic, name: Al Jahra Governorate},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Jowf - mobility.retail_and_recreation_dynamic,
name: Al Jowf}, {axisId: mobility.retail_and_recreation_dynamic, id: Al
Madinah Province - mobility.retail_and_recreation_dynamic, name: Al
Madinah Province}, {axisId: mobility.retail_and_recreation_dynamic,
id: Al Qalyubia Governorate - mobility.retail_and_recreation_dynamic,
name: Al Qalyubia Governorate}, {axisId: mobility.retail_and_recreation_dynamic,
id: Al Qassim - mobility.retail_and_recreation_dynamic, name: Al Qassim},
{axisId: mobility.retail_and_recreation_dynamic, id: Al Wahat District -
mobility.retail_and_recreation_dynamic, name: Al Wahat District}, {
axisId: mobility.retail_and_recreation_dynamic, id: Al Wusta Governorate
- mobility.retail_and_recreation_dynamic, name: Al Wusta Governorate},
{axisId: mobility.retail_and_recreation_dynamic, id: Alabama - mobility.retail_and_recreation_dynamic,
name: Alabama}, {axisId: mobility.retail_and_recreation_dynamic, id: Alaska
- mobility.retail_and_recreation_dynamic, name: Alaska}, {axisId: mobility.retail_and_recreation_dynamic,
id: Alba County - mobility.retail_and_recreation_dynamic, name: Alba County}],
showLabels: false, showValues: true, maxValue: 0.5, minValue: -0.75, unpinAxis: false,
tickDensity: default, tickDensityCustom: 5, type: linear}]
series_types: {}
series_colors:
mobility_dev.parks_7_day_moving_avg: "#7CC8FA"
mobility_dev.residential_7_cay_moving_avg: "#f56776"
reference_lines: [{reference_type: line, range_start: max, range_end: min, margin_top: deviation,
margin_value: mean, margin_bottom: deviation, label_position: center, color: "#000000",
line_value: '0', label: Baseline}]
discontinuous_nulls: true
map_plot_mode: points
heatmap_gridlines: true
heatmap_gridlines_empty: false
heatmap_opacity: 0.7
show_region_field: true
draw_map_labels_above_data: true
map_tile_provider: light
map_position: fit_data
map_latitude: 42.18350433370498
map_longitude: -76.17293357849123
map_zoom: 6
map_scale_indicator: 'off'
map_pannable: true
map_zoomable: true
map_marker_type: circle
map_marker_icon_name: default
map_marker_radius_mode: proportional_value
map_marker_units: meters
map_marker_proportional_scale_type: linear
map_marker_color_mode: fixed
show_legend: true
map_value_colors: ["#feedde", "#a63603"]
quantize_map_value_colors: false
reverse_map_value_colors: false
defaults_version: 1
listen:
2 - State, Province, or Similar: mobility.sub_region_1
Moving Avg or Daily: mobility.daily_or_avg
row: 14
col: 16
width: 8
height: 7
- title: Transit Stations
name: Transit Stations
model: mobility
explore: mobility
type: looker_line
fields: [mobility.sub_region_1, mobility.mobility_date, mobility.transit_stations_dynamic]
pivots: [mobility.sub_region_1]
fill_fields: [mobility.mobility_date]
filters:
mobility.geography_level: '1'
sorts: [mobility.mobility_date desc, mobility.sub_region_1]
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: false
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
show_null_points: true
interpolation: linear
color_application:
collection_id: 1297ec12-86a5-4ae0-9dfc-82de70b3806a
palette_id: 93f8aeb4-3f4a-4cd7-8fee-88c3417516a1
options:
steps: 5
y_axes: [{label: '', orientation: left, series: [{axisId: mobility_dev.transit_stations_7_day_moving_avg,
id: mobility_dev.transit_stations_7_day_moving_avg, name: Transit Stations
(7-Day Moving Avg)}], showLabels: false, showValues: true, maxValue: 0.5,
minValue: -0.75, unpinAxis: false, tickDensity: default, tickDensityCustom: 5,
type: linear}]
series_types: {}
series_colors:
mobility_dev.parks_7_day_moving_avg: "#7CC8FA"
mobility_dev.residential_7_cay_moving_avg: "#f56776"
mobility_dev.transit_stations_7_day_moving_avg: "#9E7FD0"
reference_lines: [{reference_type: line, range_start: max, range_end: min, margin_top: deviation,
margin_value: mean, margin_bottom: deviation, label_position: center, color: "#000000",
line_value: '0', label: Baseline}]
map_plot_mode: points
heatmap_gridlines: true
heatmap_gridlines_empty: false
heatmap_opacity: 0.7
show_region_field: true
draw_map_labels_above_data: true
map_tile_provider: light
map_position: fit_data
map_latitude: 42.18350433370498
map_longitude: -76.17293357849123
map_zoom: 6
map_scale_indicator: 'off'
map_pannable: true
map_zoomable: true
map_marker_type: circle
map_marker_icon_name: default
map_marker_radius_mode: proportional_value
map_marker_units: meters
map_marker_proportional_scale_type: linear
map_marker_color_mode: fixed
show_legend: true
map_value_colors: ["#feedde", "#a63603"]
quantize_map_value_colors: false
reverse_map_value_colors: false
defaults_version: 1
listen:
2 - State, Province, or Similar: mobility.sub_region_1
Moving Avg or Daily: mobility.daily_or_avg
row: 21
col: 8
width: 8
height: 7
- title: Workplaces
name: Workplaces
model: mobility
explore: mobility
type: looker_line
fields: [mobility.workplaces_dynamic, mobility.mobility_date, mobility.sub_region_1]
pivots: [mobility.sub_region_1]
fill_fields: [mobility.mobility_date]
filters:
mobility.geography_level: '1'
mobility.country_region_code: US
sorts: [mobility.mobility_date desc, mobility.sub_region_1]
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: false
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
show_null_points: true
interpolation: linear
color_application:
collection_id: 1297ec12-86a5-4ae0-9dfc-82de70b3806a
palette_id: 93f8aeb4-3f4a-4cd7-8fee-88c3417516a1
options:
steps: 5
y_axes: [{label: '', orientation: left, series: [{axisId: mobility_dev.workplaces_7_day_moving_avg,
id: mobility_dev.workplaces_7_day_moving_avg, name: Workplaces (7-Day
Moving Avg)}], showLabels: false, showValues: true, maxValue: 0.5, minValue: -0.75,
unpinAxis: false, tickDensity: default, tickDensityCustom: 5, type: linear}]
series_types: {}
series_colors:
mobility_dev.parks_7_day_moving_avg: "#7CC8FA"
mobility_dev.residential_7_cay_moving_avg: "#f56776"
mobility_dev.transit_stations_7_day_moving_avg: "#9E7FD0"
mobility_dev.workplaces_7_day_moving_avg: "#7CC8FA"
reference_lines: [{reference_type: line, range_start: max, range_end: min, margin_top: deviation,
margin_value: mean, margin_bottom: deviation, label_position: center, color: "#000000",
line_value: '0', label: Baseline}]
map_plot_mode: points
heatmap_gridlines: true
heatmap_gridlines_empty: false
heatmap_opacity: 0.7
show_region_field: true
draw_map_labels_above_data: true
map_tile_provider: light
map_position: fit_data
map_latitude: 42.18350433370498
map_longitude: -76.17293357849123
map_zoom: 6
map_scale_indicator: 'off'
map_pannable: true
map_zoomable: true
map_marker_type: circle
map_marker_icon_name: default
map_marker_radius_mode: proportional_value
map_marker_units: meters
map_marker_proportional_scale_type: linear
map_marker_color_mode: fixed
show_legend: true
map_value_colors: ["#feedde", "#a63603"]
quantize_map_value_colors: false
reverse_map_value_colors: false
defaults_version: 1
listen:
2 - State, Province, or Similar: mobility.sub_region_1
Moving Avg or Daily: mobility.daily_or_avg
row: 21
col: 0
width: 8
height: 7
- name: COVID-19 Community Mobility Reports
type: text
title_text: COVID-19 Community Mobility Reports
subtitle_text: by Google
body_text: |-
These reports compare communities' mobility (as measured via anonymized cell phone location data) visiting different types of locations. Data is compared to baseline values computed as the median in the 5‑week period Jan 3 – Feb 6, 2020 by day of the week.
Data is updated regularly, but not daily. For more information, we strongly encourage you to read [the full documentation](https://www.google.com/covid19/mobility/).
row: 0
col: 0
width: 24
height: 5
filters:
- name: 2 - State, Province, or Similar
title: 2 - State, Province, or Similar
type: field_filter
default_value: New York,Texas,California
allow_multiple_values: true
required: false
model: mobility
explore: mobility
listens_to_filters: []
field: mobility.sub_region_1
- name: Moving Avg or Daily
title: Moving Avg or Daily
type: field_filter
default_value: mov^_avg
allow_multiple_values: true
required: false
model: mobility
explore: mobility
listens_to_filters: []
field: mobility.daily_or_avg | LookML | 4 | isabella232/data-block-community-mobility | dashboards/us_state_mobility.dashboard.lookml | [
"MIT"
] |
-- REGISTER 's3://solr-scale-tk/pig/hadoop-lws-job-1.2.0-SNAPSHOT-rc2-0.jar';
-- REGISTER 's3://solr-scale-tk/pig/hadoop-lws-job-2.0.1-0-0-hadoop2.jar';
REGISTER '$JOB_JAR';
set solr.zkhost '$zkHost';
set solr.collection '$collection';
set lww.buffer.docs.size $batch;
set lww.commit.on.close true;
SET mapred.map.tasks.speculative.execution false;
SET mapred.reduce.tasks.speculative.execution false;
SET mapred.child.java.opts -Xmx1g;
SET mapred.task.timeout 12000000;
SET mapred.max.tracker.failures 20;
SET mapred.map.max.attempts 20;
-- s3://solr-scale-tk/pig/s3_to_solr.pig
-- s3://solr-scale-tk/pig/output/syn130m/
-- s3://solr-scale-tk/pig/output/syn_sample_10m
-- s3://thelabdude/syn_sample_10m
-- s3://solr-scale-tk/pig/output/foo/
-- -p JOB_JAR=s3://sstk-dev/lucidworks-pig-functions-2.2.1.jar -p RED=6 -p collection=perf1 -p batch=500 -p zkHost=ec2-52-91-12-62.compute-1.amazonaws.com:2181/perf1
data = load '$INPUT' using PigStorage() as (id: chararray,
integer1_i: int,
integer2_i: int,
long1_l: long,
long2_l: long,
float1_f: float,
float2_f: float,
double1_d: double,
double2_d: double,
timestamp1_tdt: chararray,
timestamp2_tdt: chararray,
string1_s: chararray,
string2_s: chararray,
string3_s: chararray,
boolean1_b: chararray,
boolean2_b: chararray,
text1_en: chararray,
text2_en: chararray,
text3_en: chararray,
random_bucket: float);
to_sort = foreach data generate CONCAT(id,(chararray)RANDOM()) as id,
'integer1_i', integer1_i,
'integer2_i', integer2_i,
'long1_l', long1_l,
'long2_l', long2_l,
'float1_f', float1_f,
'float2_f', float2_f,
'double1_d', double1_d,
'double2_d', double2_d,
'timestamp1_tdt', timestamp1_tdt,
'timestamp2_tdt', timestamp2_tdt,
'string1_s', string1_s,
'string2_s', string2_s,
'boolean1_b', boolean1_b,
'text1_en', text1_en,
'text3_en', text3_en;
-- to_solr = order to_sort by id ASC parallel $RED;
-- store to_solr into 's3://solr-scale-tk/pig/output/foo' using com.lucidworks.hadoop.pig.SolrStoreFunc();
store to_sort into 's3://solr-scale-tk/pig/output/foo' using com.lucidworks.hadoop.pig.SolrStoreFunc();
| PigLatin | 3 | lucidworks/solr-scale-tk | src/main/pig/s3_to_solr.pig | [
"Apache-2.0"
] |
--TEST--
Flexible heredoc syntax complex test 2: interpolated nested heredocs
with the same delimiter name
--FILE--
<?php
$a = 'b';
${"b\nb\n d"} = 'b';
var_dump(<<<DOC1
a
${<<<DOC1
b
${<<<DOC1
a
DOC1}
d
DOC1
}
c
DOC1);
?>
--EXPECT--
string(5) "a
b
c"
| PHP | 2 | thiagooak/php-src | Zend/tests/flexible-heredoc-complex-test2.phpt | [
"PHP-3.01"
] |
mod super_sekrit {
pub enum sooper_sekrit {
quux, baz
}
}
| Rust | 3 | Eric-Arellano/rust | src/test/ui/reachable/auxiliary/unreachable_variant.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,8B3708EAD53963D4
uyLo4sFmSo7+K1uVgSENI+85JsG5o1JmovvxD/ucUl9CDhDj4KgFzs95r7gjjlhS
kA/hIY8Ec9i6T3zMXpAswWI5Mv2LE+UdYR5h60dYtIinLC7KF0QIztSecNWy20Bi
/NkobZhN7VZUuCEoSRWj4Ia3EuATF8Y9ZRGFPNsqMbSAhsGZ1P5xbDMEpE+5PbJP
LvdF9yWDT77rHeI4CKV4aP/yxtm1heEhKw5o6hdpPBQajPpjSQbh7/V6Qd0QsKcV
n27kPnSabsTbbc2IR40il4mZfHvXAlp4KoHL3RUgaons7q0hAUpUi+vJXbEukGGt
3dlyWwKwEFS7xBQ1pQvzcePI4/fRQxhZNxeFZW6n12Y3X61vg1IsG7usPhRe3iDP
3g1MXQMAhxaECnDN9b006IeoYdaktd4wrs/fn8x6Yz4=
-----END RSA PRIVATE KEY-----
| Org | 0 | cjerdonek/urllib3 | dummyserver/certs/server.key.org | [
"MIT"
] |
<!DOCTYPE html>
<html lang="en" data-layout-decorate="~{layouts/default-layout-no-menu}">
<head id="head">
<title data-th-text="#{label_login}">Login- Spring Roo application</title>
</head>
<body id="body">
<header role="banner">
<!-- Content replaced by layout of the page displayed -->
</header>
<!-- CONTAINER -->
<div class="container bg-container">
<!-- CONTENT -->
<!--
Only the inner content of the following tag "section" is included
within the template, in the section "content"
-->
<section data-layout-fragment="content">
<div class="container-fluid content">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title" data-th-text="#{label_login}">Login</h1>
</div>
<div class="panel-body">
<form class="form-horizontal" data-th-action="@{/login}" method="post">
<fieldset>
<legend class="sr-only" data-th-text="#{help_login}">Enter your login and password</legend>
<!-- Alerts messages -->
<div class="alert alert-info" role="alert" data-th-if="${@environment.getProperty('springlets.security.auth.in-memory.enabled')}" data-th-with="username=${@environment.getProperty('springlets.security.auth.in-memory.user.name')},
userpasw=${@environment.getProperty('springlets.security.auth.in-memory.user.password')},
adminname=${@environment.getProperty('springlets.security.auth.in-memory.admin.name')},
adminpasw=${@environment.getProperty('springlets.security.auth.in-memory.admin.password')}">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
<span data-th-text="#{info_security_login}">You tried to access a
restricted area of our application. By default, you can log in with:</span>
<blockquote>
<span data-th-if="${username}" data-th-text="|${username} / ${userpasw}|">"user/password"</span>
<span data-th-if="${adminname}" data-th-text="|${adminname} / ${adminpasw}|">"admin/password"</span>
</blockquote>
</div>
<div data-th-if="${param.error}" class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only" data-th-text="|#{label_error}:|">Error:</span>
<span data-th-text="#{error_login}">Invalid user and password</span>
</div>
<div data-th-if="${param.logout}" class="alert alert-success" role="alert">
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
<span data-th-text="#{info_closed_session}">Log out correctly</span>
</div>
<div data-th-if="${param.expired}" class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only" data-th-text="|#{label_error}:|">Error:</span>
<span data-th-text="#{error_expired_session}">Your session has been expired</span>
</div>
<div class="form-group has-error has-feedback" data-z="z" id="username" data-th-classappend="${param.error}? 'has-error has-feedback'" data-th-class="form-group">
<label for="username" class="col-md-3 control-label" data-th-text="#{label_login_username}">Username</label>
<div class="col-md-6">
<input id="username" name="username" type="text" class="form-control" placeholder="Username" data-th-placeholder="#{label_login_username}" data-toggle="tooltip" aria-describedby="usernameStatus" />
<span data-th-classappend="${param.error}? 'glyphicon glyphicon-remove form-control-feedback'" class="glyphicon glyphicon-remove form-control-feedback" data-th-if="${param.error}" aria-hidden="true"></span>
</div>
</div>
<div class="form-group has-error has-feedback" data-z="z" id="password" data-th-classappend="${param.error}? 'has-error has-feedback'" data-th-class="form-group">
<label for="password" class="col-md-3 control-label" data-th-text="#{label_login_password}">Password</label>
<div class="col-md-6">
<input id="password" name="password" type="password" class="form-control" placeholder="Password" data-th-placeholder="#{label_login_password}" data-toggle="tooltip" aria-describedby="passwordStatus" />
<span data-th-classappend="${param.error}? 'glyphicon glyphicon-remove form-control-feedback'" class="glyphicon glyphicon-remove form-control-feedback" data-th-if="${param.error}" aria-hidden="true"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-9 col-md-offset-3">
<button type="submit" class="btn btn-primary" data-th-text="#{label_submit}">Accept</button>
<button type="reset" class="btn btn-default" data-th-text="#{label_reset}">Cancel</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</section>
<!-- /CONTENT -->
</div>
<!-- /CONTAINER -->
<footer class="container">
<!-- Content replaced by layout of the page displayed -->
</footer>
<!-- JavaScript
================================================== -->
<!-- Placed at the end of the document so that the pages load faster -->
<!-- JavaScript loaded by layout of the page displayed -->
<!--
Only the inner content of the following tag "javascript" is included
within the template, in the div "javascript"
-->
<div data-layout-fragment="javascript">
</div>
</body>
</html>
| HTML | 4 | zeesh49/tutorials | spring-roo/src/main/resources/templates/login.html | [
"MIT"
] |
'' MonitorVars, program to show variables on video screen, leaving main program free to run fast
'' three per line, seperated with commas by groups of three
' Eric Ratliff, 2008_3_x to 2008_4_2
' Eric Ratliff, 2008.6.7 eliminating flicker by using modified version of TV_Termainal
OBJ
Num : "Numbers" ' string manipulations
TV : "TV_terminalHoming" ' video display
VAR
long IncTime_C
byte RunningCogID ' ID of started cog, -1 code shows failure to start
long Stack[100] ' space for new cog, no idea how much to allocate
byte EverRun ' flag to show object has been used at least once
byte VarIndex ' offset of long variable we are currently painting
PUB Start(pMem,Quantity): NewCogID '' start a monitor cog
Stop ' stop any cog that may already be running
' start a mew cog and retain it's ID or failure code
RunningCogID := cognew(Run(pMem,Quantity),@Stack)
NewCogID := RunningCogID ' report the results to calling object
PUB Stop '' to stop any possible running monitor cog
if EverRun
if RunningCogID => 0 ' is there a cog already running?
cogstop(RunningCogID) ' place running cog in dormant state
RunningCogID := -1 ' place code like that returned when a cog fails to start
EverRun := TRUE
PRI Run(pMemBegin,QtyToShow) ' routine that formats and outputs the numbers to the screen until stopped externally
Num.Init ' start the string manupulation object
TV.Start(12) ' start TV video object with specified base pin. Pin 12 is the base pin in the dev board
'IncTime_C := 500000
IncTime_C := clkfreq/20
' three times 14 just happens to be number of characters on a line, no LF needed, no counting of variables on line needed
repeat
VarIndex := 0
TV.home ' return to top left
repeat
TV.Str(Num.ToStr(LONG[pMemBegin + VarIndex << 2], Num#DSDEC14)) ' show result of the arithmatic, delimited decimal, groups 1000's with commas
VarIndex++
while VarIndex < QtyToShow
waitcnt(IncTime_C + cnt) 'wait a little while before next update
| Propeller Spin | 4 | deets/propeller | libraries/community/p1/All/IR2101PWM/IR2101d_demo-bst-archive-091016-073833/MonVarsNF.spin | [
"MIT"
] |
#pragma TextEncoding="UTF-8"
#pragma rtGlobals=3
#pragma ModuleName = SIDAMLineSpectra
#include "SIDAM_Color"
#include "SIDAM_Line"
#include "SIDAM_Range"
#include "SIDAM_Utilities_Bias"
#include "SIDAM_Utilities_Control"
#include "SIDAM_Utilities_Image"
#include "SIDAM_Utilities_misc"
#include "SIDAM_Utilities_Panel"
#include "SIDAM_Utilities_WaveDf"
#ifndef SIDAMshowProc
#pragma hide = 1
#endif
Static StrConstant SUFFIX_X = "X"
Static StrConstant SUFFIX_Y = "Y"
Static StrConstant PNL_W = "LineSpectra"
Static StrConstant PNL_X = "LineSpectraX"
Static StrConstant PNL_Y = "LineSpectraY"
Static StrConstant PNL_C = "LineSpectraC"
Static StrConstant PNL_B1 = "LineSpectra_b"
Static StrConstant PNL_B2 = "LineSpectra_x"
Static StrConstant PNL_T = "LineSpectraT"
Static StrConstant KEY = "SIDAMLineSpectra"
//@
// Get spectra along a trajectory line.
//
// ## Parameters
// w : wave
// The 3D input wave.
// p1, q1 : variable
// The position of the starting point (pixel).
// p2, q2 : variable
// The position of the ending point (pixel).
// mode : int {0 -- 2}, default 0
// How to get spectra.
// * 0: Take spectra from all the pixels on the trajectory line
// * 1: Take a value at a pixel in either x or y direction
// (depending on the angle of the trajectory line) and
// interpolate in the other direction.
// * 2: Use ``ImageLineProfile`` of Igor Pro.
// output : int {0 or !0}, default 0
// Set !0 to save waves of positions.
// basename : string, default ""
// Name of the line profile wave and basename of additional waves
// (when the output != 0). If this is specified, output waves are
// save in the data folder where the input wave is.
//
// ## Returns
// wave
// Spectra along the trajectory line.
//@
Function/WAVE SIDAMLineSpectra(Wave/Z w, Variable p1, Variable q1,
Variable p2, Variable q2, [int mode, int output, String basename])
STRUCT paramStruct s
Wave/Z s.w = w
s.p1 = p1
s.q1 = q1
s.p2 = p2
s.q2 = q2
s.mode = ParamIsDefault(mode) ? 0 : mode
s.output = ParamIsDefault(output) ? 0 : output
s.basename = SelectString(ParamIsDefault(basename), basename, "")
s.dfr = GetWavesDataFolderDFR(s.w)
if (validate(s))
print s.errMsg
return $""
endif
return getLineSpectra(s)
End
Static Function validate(STRUCT paramStruct &s)
s.errMsg = PRESTR_CAUTION + "SIDAMLineSpectra gave error: "
if (!WaveExists(s.w))
s.errMsg += "wave not found."
return 1
elseif (WaveDims(s.w) != 3)
s.errMsg += "the dimension of input wave must be 3."
return 1
endif
if (numtype(s.p1) || numtype(s.q1) || numtype(s.p2) || numtype(s.q2))
s.errMsg += "coordinate must be a normal number."
return 1
endif
if (s.mode > 2)
s.errMsg += "the mode must be 0, 1, or 2."
return 1
endif
if (s.output > 1)
s.errMsg += "The output must be 0 or 1."
return 1
endif
return 0
End
Static Structure paramStruct
Wave w
String errMsg
double p1
double q1
double p2
double q2
String basename
uchar mode
uchar output
DFREF dfr
STRUCT WaveParam waves
EndStructure
Static Structure WaveParam
Wave resw
Wave pw
Wave qw
Wave xw
Wave yw
endStructure
Static Function menuDo()
pnl(WinName(0,1))
End
Static Function/WAVE getLineSpectra(STRUCT paramStruct &s)
int i
String noteStr
Make/N=(DimSize(s.w,2),0)/FREE resw
Wave s.waves.resw = resw
Make/N=0/FREE pw, qw, xw, yw
Wave s.waves.pw = pw, s.waves.qw = qw
Wave s.waves.xw = xw, s.waves.yw = yw
switch (s.mode)
case 0:
getLineSpectraMode0(s)
break
case 1:
getLineSpectraMode1(s)
break
case 2:
getLineSpectraMode2(s)
break
default:
endswitch
SetScale/P x DimOffset(s.w,2), DimDelta(s.w,2), WaveUnits(s.w,2), s.waves.resw
SetScale/I y 0, sqrt(((s.p2-s.p1)*DimDelta(s.w,0))^2+((s.q2-s.q1)*DimDelta(s.w,1))^2), WaveUnits(s.w,0), s.waves.resw
SetScale d 0, 0, StringByKey("DUNITS", WaveInfo(s.w,0)), s.waves.resw
Sprintf noteStr, "src@%s;start@p=%.2f,q=%.2f;end@p=%.2f,q=%.2f;"\
, GetWavesDataFolder(s.w,2), s.p1, s.q1, s.p2, s.q2
Note s.waves.resw, noteStr
if (strlen(s.basename))
DFREF dfrSav = GetDataFolderDFR()
SetDataFolder s.dfr // current data folder
Duplicate/O s.waves.resw $s.basename/WAVE=rtnw
if (SIDAMisUnevenlySpacedBias(s.w))
Duplicate/O SIDAMGetBias(s.w,1) $(s.basename+"_b")
Duplicate/O SIDAMGetBias(s.w,2) $(s.basename+"_x")
endif
if (s.output)
Duplicate/O xw $(s.basename+SUFFIX_X)
Duplicate/O yw $(s.basename+SUFFIX_Y)
endif
SetDataFolder dfrSav
return rtnw
else
return s.waves.resw
endif
End
//------------------------------------------------------------------------------
// Take spectra from all the pixels on the trajectory line
//------------------------------------------------------------------------------
Static Function getLineSpectraMode0(STRUCT paramStruct &s)
if (s.p1 == s.p2 && s.q1 == s.q2)
Redimension/N=1 s.waves.pw, s.waves.qw
s.waves.pw = s.p1
s.waves.qw = s.q1
else
// Change the sign so that the sort used later can be always done
// in ascending order
int revp = (s.p1 > s.p2), revq = (s.q1 > s.q2)
s.p1 *= revp ? -1 : 1
s.p2 *= revp ? -1 : 1
s.q1 *= revq ? -1 : 1
s.q2 *= revq ? -1 : 1
Redimension/N=(abs(s.p2-s.p1)+1,abs(s.q2-s.q1)+1) s.waves.pw, s.waves.qw
Make/N=(abs(s.p2-s.p1)+1,abs(s.q2-s.q1)+1)/FREE xyw
Make/N=(abs(s.p2-s.p1)+1,abs(s.q2-s.q1)+1)/B/U/FREE inoutw
Setscale/P x min(s.p1,s.p2), 1, "", s.waves.pw, s.waves.qw, xyw, inoutw
Setscale/P y min(s.q1,s.q2), 1, "", s.waves.pw, s.waves.qw, xyw, inoutw
Variable d = 1 / ((s.p2-s.p1)^2 + (s.q2-s.q1)^2)
xyw = ((x-s.p1)*(s.p2-s.p1)+(y-s.q1)*(s.q2-s.q1)) * d
s.waves.pw = s.p1 + xyw*(s.p2-s.p1)
s.waves.qw = s.q1 + xyw*(s.q2-s.q1)
inoutw = abs(x-s.waves.pw) < 0.5 && abs(y-s.waves.qw) < 0.5
s.waves.pw = x
s.waves.qw = y
Redimension/N=(numpnts(inoutw)) s.waves.pw, s.waves.qw, inoutw
// Delete points non on the trajectory lines
Sort/R inoutw, s.waves.pw, s.waves.qw
Deletepoints sum(inoutw), numpnts(inoutw)-sum(inoutw), s.waves.pw, s.waves.qw
// Sort
SortColumns keyWaves={s.waves.pw, s.waves.qw}, sortWaves={s.waves.pw, s.waves.qw}
// Revert the sign if necessary
s.waves.pw *= revp ? -1 : 1
s.waves.qw *= revq ? -1 : 1
s.p1 *= revp ? -1 : 1
s.p2 *= revp ? -1 : 1
s.q1 *= revq ? -1 : 1
s.q2 *= revq ? -1 : 1
endif
// spectra
if (WaveType(s.w) & 0x01) // complex
Redimension/N=(-1,numpnts(s.waves.pw))/C s.waves.resw
Wave/C resw = s.waves.resw
resw = s.w[s.waves.pw[q]][s.waves.qw[q]][p]
else
Redimension/N=(-1,numpnts(s.waves.pw)) s.waves.resw
s.waves.resw = s.w[s.waves.pw[q]][s.waves.qw[q]][p]
endif
// positions
Redimension/N=(numpnts(s.waves.pw)) s.waves.xw, s.waves.yw
s.waves.xw = DimOffset(s.w,0)+DimDelta(s.w,0)*s.waves.pw
s.waves.yw = DimOffset(s.w,1)+DimDelta(s.w,1)*s.waves.qw
End
//------------------------------------------------------------------------------
// Pick up a value in either x or y direction (depending on the angle of
// the trajectory line) and interpolate in the other direction.
//------------------------------------------------------------------------------
Static Function getLineSpectraMode1(STRUCT paramStruct &s)
int n = max(abs(s.p2-s.p1),abs(s.q2-s.q1))+1
int isComplex = WaveType(s.w) & 0x01
Redimension/N=(n) s.waves.pw, s.waves.qw
s.waves.pw = s.p1 + (s.p2-s.p1)/(n-1)*p
s.waves.qw = s.q1 + (s.q2-s.q1)/(n-1)*p
Wave pw = s.waves.pw, qw = s.waves.qw // shorthand
if (isComplex)
Redimension/N=(-1,n)/C s.waves.resw
Wave/C resw = s.waves.resw
else
Redimension/N=(-1,n) s.waves.resw
endif
// spectra
if (abs(s.p2-s.p1) > abs(s.q2-s.q1))
if (isComplex)
resw = cmplx(floor(qw[q])==ceil(qw[q]),0) ? \
s.w[pw[q]][qw[q]][p] : \
s.w[pw[q]][floor(qw[q])][p]*cmplx(ceil(qw[q])-qw[q],0) \
+ s.w[pw[q]][ceil(qw[q])][p]*cmplx(qw[q]-floor(qw[q]),0)
else
s.waves.resw = floor(qw[q]) == ceil(qw[q]) ? \
s.w[pw[q]][qw[q]][p] : \
s.w[pw[q]][floor(qw[q])][p]*(ceil(qw[q])-qw[q]) \
+ s.w[pw[q]][ceil(qw[q])][p]*(qw[q]-floor(qw[q]))
endif
elseif (abs(s.p2-s.p1) < abs(s.q2-s.q1))
if (isComplex)
resw = cmplx(floor(pw[q])==ceil(pw[q]),0) ? \
s.w[pw[q]][qw[q]][p] : \
s.w[floor(pw[q])][qw[q]][p]*cmplx(ceil(pw[q])-pw[q],0) \
+ s.w[ceil(pw[q])][qw[q]][p]*cmplx(pw[q]-floor(pw[q]),0)
else
s.waves.resw = floor(pw[q]) == ceil(pw[q]) ? \
s.w[pw[q]][qw[q]][p] : \
s.w[floor(pw[q])][qw[q]][p]*(ceil(pw[q])-pw[q]) \
+ s.w[ceil(pw[q])][qw[q]][p]*(pw[q]-floor(pw[q]))
endif
elseif (n > 1)
if (isComplex)
resw = s.w[pw[q]][qw[q]][p]
else
s.waves.resw = s.w[pw[q]][qw[q]][p]
endif
endif
// positions
Redimension/N=(numpnts(s.waves.pw)) s.waves.xw, s.waves.yw
s.waves.xw = DimOffset(s.w,0)+DimDelta(s.w,0)*s.waves.pw
s.waves.yw = DimOffset(s.w,1)+DimDelta(s.w,1)*s.waves.qw
End
//------------------------------------------------------------------------------
// Use ImageLineProfile
//------------------------------------------------------------------------------
Static Function getLineSpectraMode2(STRUCT paramStruct &s)
DFREF dfrSav = GetDataFolderDFR()
SetDataFolder NewFreeDataFolder()
Make/N=2 pw = {s.p1, s.p2}, qw = {s.q1, s.q2}
// spectra
if (WaveType(s.w) & 0x01) // complex
MatrixOP/FREE realw = real(s.w)
MatrixOP/FREE imagw = imag(s.w)
// real
SetDataFolder NewFreeDataFolder()
ImageLineProfile/P=-2 xWave=pw, yWave=qw, srcWave=realw
Wave rw = M_ImageLineProfile
MatrixTranspose rw
// imaginary
SetDataFolder NewFreeDataFolder()
ImageLineProfile/P=-2 xWave=pw, yWave=qw, srcWave=imagw
Wave iw = M_ImageLineProfile
MatrixTranspose iw
// combine them in complex
Redimension/N=(DimSize(rw,0),DimSize(rw,1))/C s.waves.resw
Wave/C resw = s.waves.resw
resw = cmplx(rw,iw)
else
Duplicate s.w tw
SetScale/P x 0, 1, "", tw
SetScale/P y 0, 1, "", tw
ImageLineProfile/P=-2 xWave=pw, yWave=qw, srcWave=tw
Wave prow = M_ImageLineProfile
MatrixTranspose prow
Redimension/N=(DimSize(prow,0),DimSize(prow,1)) s.waves.resw
s.waves.resw = prow
endif
// positions
Wave xw = W_LineProfileX, yw = W_LineProfileY
Redimension/N=(numpnts(xw)) s.waves.pw, s.waves.qw, s.waves.xw, s.waves.yw
s.waves.pw = xw
s.waves.qw = yw
s.waves.xw = DimOffset(s.w,0)+DimDelta(s.w,0)*xw
s.waves.yw = DimOffset(s.w,1)+DimDelta(s.w,1)*yw
SetDataFolder dfrSav
End
//******************************************************************************
// Show the main panel
//******************************************************************************
Static Function pnl(String LVName)
if (SIDAMWindowExists(GetUserData(LVName,"",KEY)))
DoWindow/F $GetUserData(LVName,"",KEY)
return 0
endif
Wave w = SIDAMImageWaveRef(LVName)
int i
Display/K=1/W=(0,0,315*72/screenresolution,340*72/screenresolution) as NameOfWave(w)
String pnlName = S_name
AutoPositionWindow/E/M=0/R=$LVName $pnlName
DFREF dfrSav = GetDataFolderDFR()
String dfTmp = SIDAMNewDF(pnlName,"LineSpectra")
SetDataFolder $dfTmp
Make/N=(1,1)/O $PNL_W
Make/N=1/O $PNL_X, $PNL_Y, $PNL_B1, $PNL_B2
Make/N=(1,3)/O $PNL_C
Make/T/N=2/O $PNL_T = {"1","2"}
SetWindow $pnlName hook(self)=SIDAMLine#pnlHook, userData(parent)=LVName
SetWindow $pnlName userData(src)=GetWavesDataFolder(w,2)
SetWindow $pnlName userData(grid)="1"
SetWindow $pnlName userData(dim)="1"
SetWindow $pnlName userData(highlight)="0"
SetWindow $pnlName userData(mode)="0"
SetWindow $pnlName userData(key)=KEY
SetWindow $pnlName userData(dfTmp)=dfTmp
SIDAMLine#pnlCtrls(pnlName)
ModifyControlList "p1V;q1V;p2V;q2V;distanceV;angleV" proc=SIDAMLineSpectra#pnlSetVar, win=$pnlName
ModifyControlList ControlNameList(pnlName,";","*") focusRing=0, win=$pnlName
// Get line profiles for the default values
pnlUpdateLineSpectra(pnlName)
pnlUpdateTextmarker(pnlName)
// For the waterfall plot
if (SIDAMisUnevenlySpacedBias(w))
Newwaterfall/FG=(FL,KMFT,FR,FB)/HOST=$pnlName/N=line $PNL_W vs {$PNL_B1,*}
else
Newwaterfall/FG=(FL,KMFT,FR,FB)/HOST=$pnlName/N=line $PNL_W
endif
pnlModifyGraph(pnlName+"#line")
// For the image plot
Display/FG=(FL,KMFT,FR,FB)/HOST=$pnlName/N=image/HIDE=1
if (SIDAMisUnevenlySpacedBias(w))
AppendImage/W=$pnlName#image $PNL_W vs {$PNL_B2, *}
else
AppendImage/W=$pnlName#image $PNL_W
endif
pnlModifyGraph(pnlName+"#image")
SetActiveSubWindow $pnlName
pnlSetParent(LVName,pnlName)
SetDataFolder dfrSav
End
// Make 'prtName' a parent window of 'chdName'
Static Function pnlSetParent(String prtName, String chdName)
String dfTmp = GetUserData(chdName,"","dfTmp")
SetWindow $prtName hook($KEY)=SIDAMLineSpectra#pnlHookParent
SetWindow $prtName userData($KEY)=AddListItem(chdName+"="+dfTmp, GetUserData(prtName,"",KEY))
SetWindow $chdName userData(parent)=prtName
String trcName = PNL_Y+prtName
AppendToGraph/W=$prtName $(dfTmp+PNL_Y)/TN=$trcName vs $(dfTmp+PNL_X)
ModifyGraph/W=$prtName mode($trcName)=4,msize($trcName)=5
ModifyGraph/W=$prtName textMarker($trcName)={$(dfTmp+PNL_T),"default",0,0,1,0,0}
End
// Remove 'prtName' from the list of parent windows of 'chdName'
Static Function pnlResetParent(String prtName, String chdName)
String newList = RemoveByKey(chdName, GetUserData(prtName, "", KEY), "=")
SetWindow $prtName userData($KEY)=newList
if (!ItemsInList(newList))
SetWindow $prtName hook($KEY)=$""
endif
if (SIDAMWindowExists(chdName))
SetWindow $chdName userData(parent)=""
endif
RemoveFromGraph/Z/W=$prtName $(PNL_Y+prtName)
End
Static Function pnlModifyGraph(String pnlName)
ModifyGraph/W=$pnlName margin(top)=8,margin(right)=8,margin(bottom)=36,margin(left)=44
ModifyGraph/W=$pnlName tick=0,btlen=5,mirror=0,lblMargin=2, gfSize=10
ModifyGraph/W=$pnlName rgb=(SIDAM_WINDOW_LINE_R, SIDAM_WINDOW_LINE_G, SIDAM_WINDOW_LINE_B)
Label/W=$pnlName bottom "\\u"
Label/W=$pnlName left "\\u"
if (!CmpStr(StringFromList(1,pnlName,"#"),"line"))
ModifyWaterfall/W=$pnlName angle=90,axlen=0.5,hidden=0
ModifyGraph/W=$pnlName noLabel(right)=2,axThick(right)=0
ModifyGraph/W=$pnlName mode=0,useNegRGB=1,usePlusRGB=1
GetWindow $pnlName, gbRGB
ModifyGraph/W=$pnlName negRGB=(V_Red,V_Green,V_Blue),plusRGB=(V_Red,V_Green,V_Blue)
endif
End
// Get line spectra
Static Function pnlUpdateLineSpectra(String pnlName)
STRUCT paramStruct s
Wave s.w = $GetUserData(pnlName,"","src")
ControlInfo/W=$pnlName p1V ; s.p1 = V_Value
ControlInfo/W=$pnlName q1V ; s.q1 = V_Value
ControlInfo/W=$pnlName p2V ; s.p2 = V_Value
ControlInfo/W=$pnlName q2V ; s.q2 = V_Value
s.output = 1
s.basename = PNL_W
s.mode = str2num(GetUserData(pnlName,"","mode"))
s.dfr = $GetUserData(pnlName,"","dfTmp")
getLineSpectra(s)
if (SIDAMisUnevenlySpacedBias(s.w))
DFREF dfrSav = GetDataFolderDFR()
SetDataFolder s.dfr
Duplicate/O SIDAMGetBias(s.w,1) $PNL_B1
SetDataFolder dfrSav
endif
End
// Update the text marker
// This is called from SIDAMLine#pnlCheck()
Static Function pnlUpdateTextmarker(String pnlName)
DFREF dfrTmp = $GetUserData(pnlName,"","dfTmp")
Wave/T/SDFR=dfrTmp tw = $PNL_T
tw[inf] = ""
Redimension/N=(DimSize(dfrTmp:$PNL_W,1)) tw
// Use !F_flag to put 1 when this is called for the first time
ControlInfo/W=$pnlName p1C; tw[0] = SelectString(V_Value|!V_Flag,"","1")
ControlInfo/W=$pnlName p2C; tw[inf] = SelectString(V_Value|!V_Flag,"","2")
End
// Change the color of trace at the cursor
Static Function pnlUpdateColor(String grfName)
String pnlList = GetUserData(grfName,"",KEY), pnlName
DFREF dfrTmp
int i, n, p0, p1
for (i = 0, n = ItemsInList(pnlList); i < n; i++)
pnlName = StringFromList(0,StringFromList(i,pnlList),"=")
if (CmpStr(GetUserData(pnlName,"","highlight"),"1"))
continue
endif
Wave/SDFR=$GetUserData(pnlName,"","dfTmp") w = $PNL_W, clrw = $PNL_C
Redimension/N=(numpnts(w),3) clrw
clrw[][0] = SIDAM_WINDOW_LINE_R
clrw[][1] = SIDAM_WINDOW_LINE_G
clrw[][2] = SIDAM_WINDOW_LINE_B
p0 = pcsr(A,grfName)*DimSize(w,0)
p1 = (pcsr(A,grfName)+1)*DimSize(w,0)-1
clrw[p0,p1][0] = SIDAM_WINDOW_LINE2_R
clrw[p0,p1][1] = SIDAM_WINDOW_LINE2_G
clrw[p0,p1][2] = SIDAM_WINDOW_LINE2_B
endfor
End
//******************************************************************************
// Hook functions
//******************************************************************************
// Hook function for the main panel
Static Function pnlHookArrows(String pnlName)
pnlUpdateLineSpectra(pnlName)
pnlUpdateTextmarker(pnlName)
pnlUpdateColor(GetUserData(pnlName,"","parent"))
End
// Hook function for the parent window
Static Function pnlHookParent(STRUCT WMWinHookStruct &s)
String pnlList, pnlName
int i, n
if (SIDAMLine#pnlHookParentCheckChild(s.winName,KEY,pnlResetParent))
return 0
endif
switch (s.eventCode)
case 2: // kill
pnlList = GetUserData(s.winName,"",KEY)
for (i = 0, n = ItemsInList(pnlList); i < n; i++)
KillWindow/Z $StringFromList(0,StringFromList(i,pnlList),"=")
endfor
return 0
case 3: // mousedown
case 4: // mousemoved
pnlList = GetUserData(s.winName,"",KEY)
for (i = 0, n = ItemsInList(pnlList); i < n; i++)
pnlName = StringFromList(0,StringFromList(i,pnlList),"=")
SIDAMLine#pnlHookParentMouse(s, pnlName)
pnlUpdateLineSpectra(pnlName)
pnlUpdateTextmarker(pnlName)
DoUpdate/W=$pnlName
endfor
pnlUpdateColor(s.winName)
DoUpdate/W=$s.winName
return 0
case 7: // cursor moved
// If a change occurred for the cursor A
if (!CmpStr(s.cursorName, "A"))
pnlUpdateColor(s.winName)
endif
return 0
case 13: // renamed
SIDAMLine#pnlHookParentRename(s,KEY)
return 0
default:
return 0
endswitch
End
//******************************************************************************
// Controls for the main panel
//******************************************************************************
// SetVariable
Static Function pnlSetVar(STRUCT WMSetVariableAction &s)
// Handle either enter key or end edit
if (s.eventCode != 2 && s.eventCode != 8)
return 1
endif
// Change values of the controls
SIDAMLine#pnlSetVarUpdateValues(s)
// Update the line spectra
pnlUpdateLineSpectra(s.win)
pnlUpdateTextmarker(s.win)
pnlUpdateColor(GetUserData(s.win,"","parent"))
End
//******************************************************************************
// Menu for right-clike
//******************************************************************************
Menu "SIDAMLineSpectraMenu", dynamic, contextualmenu
SubMenu "Positions"
SIDAMLine#menu(0), SIDAMLineSpectra#panelMenuDo(0)
End
SubMenu "Dimension"
SIDAMLine#menu(1), SIDAMLineSpectra#panelMenuDo(1)
End
SubMenu "Complex"
SIDAMLine#menu(2), SIDAMLineSpectra#panelMenuDo(2)
End
SubMenu "Sampling mode"
SIDAMLineSpectra#panelMenu(), SIDAMLineSpectra#panelMenuDo(5)
End
SubMenu "Target window"
SIDAMLine#menuTarget(), SIDAMLineSpectra#panelMenuDo(6)
End
SubMenu "Style"
SIDAMLine#menu(3), SIDAMLineSpectra#panelMenuDo(3)
SIDAMLine#menu(4), SIDAMLineSpectra#panelMenuDo(4)
End
"Save...", SIDAMLineSpectra#outputPnl(WinName(0,1))
"-"
SIDAMLine#menu(7),/Q, SIDAMRange(grfName=WinName(0,1)+"#image")
SIDAMLine#menu(8),/Q, SIDAMColor(grfName=WinName(0,1)+"#image")
End
Static Function/S panelMenu()
// Do nothing unless called from pnlHook() in SIDAM_Line.ipf
String calling = "pnlHook,SIDAM_Line.ipf"
if (strsearch(GetRTStackInfo(3),calling,0))
return ""
endif
String pnlName = WinName(0,1)
int mode = str2num(GetUserData(pnlName,"","mode"))
return SIDAMAddCheckmark(mode, "Raw data;Interpolate;ImageLineProfile")
End
Static Function panelMenuDo(int kind)
String pnlName = WinName(0,1)
String grfName = GetUserData(pnlName,"","parent")
int grid = str2num(GetUserData(pnlName,"","grid"))
switch (kind)
case 0: // positions
// Change values of p1V etc.
SIDAMLine#menuPositions(pnlName)
// Update the line spectra
pnlUpdateLineSpectra(pnlName)
pnlUpdateTextmarker(pnlName)
pnlUpdateColor(grfName)
break
case 1: // dim
int dim = str2num(GetUserData(pnlName,"","dim"))
GetLastUserMenuInfo
if (V_value != dim)
SIDAMLine#pnlChangeDim(pnlName, V_value)
endif
break
case 2: // complex
SIDAMLine#menuComplex(pnlName)
break
case 3: // Free
// Change values of p1V etc.
SIDAMLine#menuFree(pnlName)
// Update the line spectra
pnlUpdateLineSpectra(pnlName)
pnlUpdateTextmarker(pnlName)
pnlUpdateColor(grfName)
break
case 4: // Highlight
int highlight = str2num(GetUserData(pnlName,"","highlight"))
SetWindow $pnlname userData(highlight)=num2istr(!highlight)
String trcName = PNL_Y+GetUserData(pnlName,"","parent")
if (highlight)
// on -> off
if(!CmpStr(StringByKey("TNAME",CsrInfo(A,grfName)),trcName))
Cursor/K/W=$grfName A
endif
ModifyGraph/W=$(pnlName+"#line") zColor=0
else
// off -> on
String cmd
Sprintf cmd, "Cursor/C=%s/S=1/W=%s A %s 0", StringByKey("rgb(x)",TraceInfo(grfName,trcName,0),"="), grfName, trcName
Execute cmd
Wave/SDFR=$GetUserData(pnlName,"","dfTmp") clrw = $PNL_C
ModifyGraph/W=$(pnlName+"#line") zColor={clrw,*,*,directRGB,0}
endif
pnlUpdateColor(grfName)
break
case 5: // sampling mode
int mode = str2num(GetUserData(pnlName,"","mode"))
GetLastUserMenuInfo
if (V_value-1 != mode)
// Change the mode
SetWindow $pnlName userData(mode)=num2istr(V_value-1)
// Update the line spectra
pnlUpdateLineSpectra(pnlName)
pnlUpdateTextmarker(pnlName)
pnlUpdateColor(grfName)
endif
break
case 6: // target window
GetLastUserMenuInfo
pnlResetParent(grfName,pnlName)
pnlSetParent(StringFromList(V_value-1,GetUserData(pnlName,"","target")), pnlName)
break
endswitch
End
//******************************************************************************
// Sub panel to save a wave
//******************************************************************************
Static Function outputPnl(String profileGrfName)
if (SIDAMWindowExists(profileGrfName+"#Save"))
return 0
endif
NewPanel/HOST=$profileGrfName/EXT=2/W=(0,0,315,125)/N=Save
String pnlName = profileGrfName + "#Save"
DFREF dfrSav = GetDataFolderDFR()
Wave srcw = $GetUserData(profileGrfName,"","src")
SetDataFolder GetWavesDataFolderDFR(srcw)
SetVariable basenameV title="basename:", pos={10,10}, win=$pnlName
SetVariable basenameV size={290,15}, bodyWidth=230, frame=1, win=$pnlName
SetVariable basenameV value=_STR:UniqueName("wave",1,0), win=$pnlName
SetVariable basenameV proc=SIDAMLineSpectra#outputPnlSetVar, win=$pnlName
SetDataFolder dfrSav
CheckBox positionC title="save waves of sampling points", pos={10,40}, size={88,14}, value=0, win=$pnlName
Button doB title="Do It", pos={10,95}, win=$pnlName
Button closeB title="Close", pos={235,95}, win=$pnlName
ModifyControlList "doB;closeB" size={70,20}, proc=SIDAMLineSpectra#outputPnlButton, win=$pnlName
ModifyControlList ControlNameList(pnlName,";","*") focusRing=0, win=$pnlName
End
//******************************************************************************
// Controls for the sub panel
//******************************************************************************
// Button
Static Function outputPnlButton(STRUCT WMButtonAction &s)
if (s.eventCode != 1)
return 0
endif
strswitch (s.ctrlName)
case "doB":
outputPnlDo(s.win)
//*** FALLTHROUGH ***
case "closeB":
KillWindow $s.win
break
default:
endswitch
return 0
End
// SetVariable
Static Function outputPnlSetVar(STRUCT WMSetVariableAction &s)
if (s.eventCode == 2 || s.eventCode == 8)
int chklen = SIDAMValidateSetVariableString(s.win,s.ctrlName,0,maxlength=MAX_OBJ_NAME-3)
Button doB disable=chklen*2, win=$s.win
endif
End
Static Function outputPnlDo(String pnlName)
STRUCT paramStruct s
String parent = StringFromList(0,pnlName,"#")
Wave s.w = $GetUserData(parent,"","src")
Wave cvw = SIDAMGetCtrlValues(parent,"p1V;q1V;p2V;q2V")
s.p1 = cvw[%p1V]
s.q1 = cvw[%q1V]
s.p2 = cvw[%p2V]
s.q2 = cvw[%q2V]
ControlInfo/W=$pnlName basenameV
s.basename = S_Value
s.mode = str2num(GetUserData(parent,"","mode"))
ControlInfo/W=$pnlName positionC
s.output = V_value
echo(s)
SIDAMLineSpectra(s.w, s.p1, s.q1, s.p2, s.q2, basename=s.basename,\
mode=s.mode, output=s.output)
End
Static Function echo(STRUCT paramStruct &s)
String paramStr = GetWavesDataFolder(s.w,2) + ","
paramStr += num2str(s.p1) + "," + num2str(s.q1) + ","
paramStr += num2str(s.p2) + "," + num2str(s.q2)
paramStr += SelectString(strlen(s.basename),"",",basename=\""+s.basename+"\"")
paramStr += SelectString(s.mode, "",",mode="+num2str(s.mode))
paramStr += SelectString(s.output, "",",output="+num2str(s.output))
printf "%sSIDAMLineSpectra(%s)\r", PRESTR_CMD, paramStr
End
| IGOR Pro | 5 | yuksk/SIDAM | src/SIDAM/func/SIDAM_LineSpectra.ipf | [
"MIT"
] |
DESCRPTION = "ansi2html - Convert text with ANSI color codes to HTML or to LaTeX"
HOMEPAGE = "https://github.com/ralphbean/ansi2html"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3000208d539ec061b899bce1d9ce9404"
LICENSE = "GPLv3"
PYPI_PACKAGE = "ansi2html"
SRC_URI[sha256sum] = "0f124ea7efcf3f24f1f9398e527e688c9ae6eab26b0b84e1299ef7f94d92c596"
inherit pypi setuptools3
DEPENDS += "${PYTHON_PN}-setuptools-scm-native ${PYTHON_PN}-toml-native"
RDEPENDS:${PN} = "${PYTHON_PN}-six"
| BitBake | 2 | shipinglinux/meta-openembedded | meta-python/recipes-devtools/python/python3-ansi2html_1.6.0.bb | [
"MIT"
] |
/*
** Case Study Financial Econometrics 4.3
**
** Purpose:
** Estimate all t-GAS model parameters
**
** Date:
** 10/01/2015
**
** Author:
** Tamer Dilaver, Koen de Man & Sina Zolnoor
**
** Supervisor:
** L.F. Hoogerheide & S.J. Koopman
**
*/
#include <oxstd.h>
#include <oxdraw.h>
#include <oxprob.h>
#include <maximize.h>
#import <modelbase>
#import <simula>
#include <oxfloat.h>
static decl iB; //Repeats
static decl iSIZE; //Size of time series
static decl iSTEPS; //#Steps to divide the size
static decl iSIMS; //# of Zt ~ N(0,1)
static decl dALPHA;
static decl dBETA;
static decl dOMEGA;
static decl vSTD_NORM; // Zt ~ N(0,1)
static decl s_vY; //Simulated returns
static decl s_vDate;
static decl dALPHA_START;
static decl dBETA_START;
static decl dOMEGA_START;
static decl dLAMBDA_START;
static decl dRATIO;
/*
** Function: Transform (start)parameters
**
** Input: vTheta [parametervalues]
**
** Output: vThetaStar
*/
fTransform(const avThetaStar, const vTheta){
avThetaStar[0]= vTheta;
avThetaStar[0][0] = log(vTheta[0]);
avThetaStar[0][1] = log(vTheta[1])-log(1-vTheta[1]);
avThetaStar[0][2] = log(vTheta[2]);
avThetaStar[0][3] = log(vTheta[3]-4)-log(100-vTheta[3]);
return 1;
}
/*
** Function: Extract the parameters from vTheta
**
** Input: adAlpha, adBeta, aOmega, adGamma, adLambda, vTheta
**
** Output: 1
*/
fGetPars(const adAlpha, const adBeta, const adOmega, const adLambda, const vTheta){
adAlpha[0] = exp(vTheta[0]);
adBeta[0] = exp(vTheta[1])/(1+exp(vTheta[1]));
adOmega[0] = exp(vTheta[2]);
adLambda[0] = 4+(100-4)*exp(vTheta[3])/(1+exp(vTheta[3]));
return 1;
}
/*
** Function: Calculates average value loglikelihood for t-GAS given parameter values
**
** Input: vTheta [parameter values], adFunc [adress function value], avScore [the score], amHessian [hessian matrix]
**
** Output: 1
**
*/
fLogLike_GAS(const vTheta, const adFunc, const avScore, const amHessian){
decl dAlpha, dBeta, dOmega, dLambda;
fGetPars( &dAlpha, &dBeta, &dOmega, &dLambda, vTheta);
decl dS2 = dOmega/(1-dBeta); //initial condition by definition
decl vLogEta = zeros(sizerc(s_vY), 1);
//Please make these more efficient!!! delete the log()
for(decl i = 0; i < sizerc(s_vY); ++i){
//likelihood contribution
vLogEta[i] = -1/2*log(M_PI)-1/2*log(dLambda-2) -1/2*log(dS2) -log(gammafact(dLambda/2))+log(gammafact((dLambda+1)/2)) -(dLambda+1)/2*log(1+ s_vY[i]^2 / ((dLambda-2)*dS2));
//GAS recursion
dS2 = dOmega + dAlpha*(dLambda+3)/dLambda*((dLambda+1)/(dLambda-2)*(1+sqr( s_vY[i])/((dLambda-2)* dS2))^(-1)*sqr( s_vY[i]) - dS2) + dBeta*dS2;
}
adFunc[0] = sumc(vLogEta)/sizerc(s_vY); //Average
return 1;
}
/*
** Function: Transform parameters back
**
** Input: vThetaStar
**
** Output: vTheta [parametervalues]
*/
fTransformBack(const avTheta, const vThetaStar){
avTheta[0]= vThetaStar;
avTheta[0][0] = exp(vThetaStar[0]);
avTheta[0][1] = exp(vThetaStar[1])/(1+exp(vThetaStar[1]));
avTheta[0][2] = exp(vThetaStar[2]);
avTheta[0][3] = 4+(100-4)*exp(vThetaStar[3])/(1+exp(vThetaStar[3]));
//actually need to restrict dLambda_hat between (2,100)
//otherwise there will be no convergence for small samples that occur Gaussian
return 1;
}
/*
** Function: calculate standard errors
**
** Input: vThetaStar
**
** Output: vStdErrors
*/
fSigmaStdError(const vThetaStar){
decl iN, mHessian, mHess, mJacobian, vStdErrors, vP;
iN = sizerc(s_vY);
Num2Derivative(fLogLike_GAS, vThetaStar, &mHessian);
NumJacobian(fTransformBack, vThetaStar, &mJacobian); //numerical Jacobian
mHessian = mJacobian*invert(-iN*mHessian)*mJacobian';
vStdErrors = sqrt(diagonal(mHessian)');
return vStdErrors;
}
/*
** Function: calculate variance of model
**
** Input: vTheta
**
** Output: vH [vector with variances]
*/
fVariance(const vTheta){
decl dAlpha, dBeta, dOmega, dLambda, vH;
fGetPars(&dAlpha, &dBeta, &dOmega, &dLambda, vTheta);
vH = zeros(sizerc(s_vY),1);
vH[0]= dOmega/(1-dBeta);
for(decl i = 1; i < sizerc(s_vY); i++){ //mixed
vH[i] = dOmega + dAlpha*(dLambda+3)/dLambda*((dLambda+1)/(dLambda-2)*(1+sqr(s_vY[i-1])/((dLambda-2)*vH[i-1]))^(-1)*sqr(s_vY[i-1]) - vH[i-1]) + dBeta*vH[i-1];
}
return vH;
}
/*
** Function: Estimate t-GAS parameters
**
** Input: vReturns, adAlpha_hat, adBeta_hat, adOmega_hat, adGamma_hat, adLambda_hat, avVariance
**
** Output: vTheta [estimated parametervalues]
*/
fEstimate_t_GAS(const vReturns, const adAlpha_hat, const adBeta_hat, const adOmega_hat, const adLambda_hat, const avVariance){
//initialise parametervalues
decl vTheta = zeros(4,1);
vTheta[0] = dALPHA_START;
vTheta[1] = dBETA_START;
vTheta[2] = dOMEGA_START;
vTheta[3] = dLAMBDA_START;
decl vThetaStart = vTheta;
//globalize returns and vectorize true pars
s_vY = vReturns;
//transform parameters
decl vThetaStar;
fTransform(&vThetaStar, vTheta);
//Maximize the LL
decl dFunc;
decl iA;
iA=MaxBFGS(fLogLike_GAS, &vThetaStar, &dFunc, 0, TRUE);
//Transform thetasStar back
fTransformBack(&vTheta, vThetaStar);
//return alpha, beta, omega and lambda
adAlpha_hat[0] = vTheta[0];
adBeta_hat[0] = vTheta[1];
adOmega_hat[0] = vTheta[2];
adLambda_hat[0] = vTheta[3];
decl vSigmaStdError = fSigmaStdError(vThetaStar);
decl vVariance = fVariance(vThetaStar);
avVariance[0] = vVariance;
print("\n",MaxConvergenceMsg(iA));
println("\nFunctiewaarde likelihood eindwaardes:", dFunc);
print("\nOptimale parameters met standaarderrors \n",
"%r", { "alpha", "beta", "omega", "lambda"},
"%c", {"thetaStart","theta","std.error"}, vThetaStart~vTheta~vSigmaStdError);
return 1;
}
/*
** Function: Determine Forecast
**
** Input: vTheta
**
** Output: vH [vector of forecasts]
*/
fForecast(const vTheta){
decl dAlpha, dBeta, dOmega, dLambda, vH;
fGetPars(&dAlpha, &dBeta, &dOmega, &dLambda, vTheta);
vH = zeros((sizerc(s_vY)+1),1);
vH[0]= dOmega/(1-dBeta);
for(decl i = 1; i < sizerc(s_vY)+1; i++){
vH[i] = dOmega + dAlpha*(dLambda+3)/dLambda*((dLambda+1)/(dLambda-2)*(1+sqr(s_vY[i-1])/((dLambda-2)*vH[i-1]))^(-1)*sqr(s_vY[i-1]) - vH[i-1]) + dBeta*vH[i-1];
}
return vH[sizerc(s_vY)];
}
/*
** Function: Compute MAE
**
** Input: adMAE_OC [adress of MAE], vReturns_1 [return series], vBenchmark [Benchmark], dC [ratio]
**
** Output: 1
*/
fMAE(const adMAE_OC, const vReturns_1, const vBenchmark, const dC){
decl iWindow = 250;
decl iT = sizerc(vReturns_1);
// decl vTemp_returns = vReturns_1;
decl vH_forecast = zeros(iWindow, 1);
decl vSqrd_error = zeros(iWindow, 1);
dALPHA_START = 0.1;
dBETA_START = 0.95;
dOMEGA_START = 0.001;
dLAMBDA_START = 10;
for(decl j = 0; j<iWindow; j++){
s_vY = vReturns_1[j:(iT - iWindow +j)];
//initialise parametervalues
decl vTheta = zeros(4,1);
vTheta[0] = dALPHA_START;
vTheta[1] = dBETA_START;
vTheta[2] = dOMEGA_START;
vTheta[3] = dLAMBDA_START;
//transform parameters
decl vThetaStar;
fTransform(&vThetaStar, vTheta);
//Maximize the LL
decl dFunc;
decl iA;
iA=MaxBFGS(fLogLike_GAS, &vThetaStar, &dFunc, 0, TRUE);
//Transform thetasStar back
fTransformBack(&vTheta, vThetaStar);
dALPHA_START = vTheta[0];
dBETA_START = vTheta[1];
dOMEGA_START = vTheta[2];
dLAMBDA_START = vTheta[3];
vH_forecast[j] = fForecast(vThetaStar);
vSqrd_error[j] = fabs(dC*vH_forecast[j] - dRATIO*vBenchmark[(iT - iWindow +j)]);
}
savemat("vAE_CC_RK_GAS_t.xls", vSqrd_error);
adMAE_OC[0] = meanc(vSqrd_error);
return 1;
}
/*
** Function: Compute MSE
**
** Input: adMSE_OC [adress of MAE], vReturns_1 [return series], vBenchmark [Benchmark], dC [ratio]
**
** Output: 1
*/
fMSE(const adMSE_OC, const vReturns_1, const vBenchmark, const dC){
decl iWindow = 250;
decl iT = sizerc(vReturns_1);
// decl vTemp_returns = vReturns_1;
decl vH_forecast = zeros(iWindow, 1);
decl vSqrd_error = zeros(iWindow, 1);
dALPHA_START = 0.1;
dBETA_START = 0.85;
dOMEGA_START = 0.01;
dLAMBDA_START = 10;
for(decl j = 0; j<iWindow; j++){
s_vY = vReturns_1[j:(iT - iWindow +j)];
//initialise parametervalues
decl vTheta = zeros(4,1);
vTheta[0] = dALPHA_START;
vTheta[1] = dBETA_START;
vTheta[2] = dOMEGA_START;
vTheta[3] = dLAMBDA_START;
//transform parameters
decl vThetaStar;
fTransform(&vThetaStar, vTheta);
//Maximize the LL
decl dFunc;
decl iA;
iA=MaxBFGS(fLogLike_GAS, &vThetaStar, &dFunc, 0, TRUE);
//Transform thetasStar back
fTransformBack(&vTheta, vThetaStar);
dALPHA_START = vTheta[0];
dBETA_START = vTheta[1];
dOMEGA_START = vTheta[2];
vTheta[3] = dLAMBDA_START;
vH_forecast[j] = fForecast(vThetaStar);
vSqrd_error[j] = (dC*vH_forecast[j] - dRATIO*vBenchmark[(iT - iWindow +j)])^2;
}
adMSE_OC[0] = meanc(vSqrd_error);
return 1;
}
/*
** MAIN PROGRAM
**
** Estimate t-GAS parameters
**
** Output: Figures
*/
main(){
//laad SBUX returns
decl mData_1 = loadmat("ReturnsOpenToClose.csv");
decl mData_2 = loadmat("ReturnsCloseToClose.csv");
decl vReturns_1 = 100*mData_1[:][1];
decl vReturns_2 = 100*mData_2[:][1];
dRATIO = (varc(vReturns_1) +varc(vReturns_2))/varc(vReturns_1);
decl vRV = loadmat("RV.csv");
decl vBV = loadmat("BV.csv");
decl vRK = loadmat("RK.csv");
//laad Dates SBUX returns
decl vTemp_Date = mData_2[][0];
decl vYear = floor(vTemp_Date/10000);
decl vMonth = floor((vTemp_Date-floor(vTemp_Date/10000)*10000)/100);
decl vDay = vTemp_Date-floor(vTemp_Date/100)*100;
s_vDate = dayofcalendar(vYear, vMonth, vDay);
dALPHA_START = 0.1;
dBETA_START = 0.99;
dOMEGA_START = 0.001;
dLAMBDA_START = 10;
decl dAlpha_hat, dBeta_hat, dOmega_hat, dLambda_hat;
decl vVariance_1, vVariance_2;
print("\nO-C");
fEstimate_t_GAS(vReturns_1, &dAlpha_hat, &dBeta_hat, &dOmega_hat, &dLambda_hat, &vVariance_1);
print("\nC-C");
fEstimate_t_GAS(vReturns_2, &dAlpha_hat, &dBeta_hat, &dOmega_hat, &dLambda_hat, &vVariance_2);
//graphs
SetDrawWindow("CS_EMP_2_t-GAS(1,1)");
DrawTMatrix(0, (vReturns_1~sqrt(vVariance_1))', {"Open-to-close"}, s_vDate');
DrawTMatrix(1, (vReturns_2~sqrt(vVariance_2))', {"Close-to-close"}, s_vDate');
ShowDrawWindow();
//forecasts MAE and MSE
decl vBenchmark = vRK;
decl dMAE_OC;
fMAE(&dMAE_OC, vReturns_1, vBenchmark, dRATIO);
print("\n dMAE_OC = ",dMAE_OC);
decl dMAE_CC;
fMAE(&dMAE_CC, vReturns_2, vBenchmark, 1);
print("\n dMAE_CC = ",dMAE_CC);
decl dMSE_OC;
fMSE(&dMSE_OC, vReturns_1, vBenchmark, dRATIO);
print("\n dMSE_OC = ",dMSE_OC);
decl dMSE_CC;
fMSE(&dMSE_CC, vReturns_2, vBenchmark, 1);
print("\n dMSE_CC = ",dMSE_CC);
} | Ox | 5 | tamerdilaver/Group4_Code_Data | CS_EMP_2_t-GAS.ox | [
"MIT"
] |
unit HtmlHelpFunc;
{
Inno Setup
Copyright (C) 1997-2006 Jordan Russell
Portions by Martijn Laan
For conditions of distribution and use, see LICENSE.TXT.
Functions for HTML Help
$jrsoftware: issrc/Projects/HtmlHelpFunc.pas,v 1.6 2009/03/23 23:16:44 mlaan Exp $
}
interface
{$I VERSION.INC}
uses
Windows;
const
HH_DISPLAY_TOPIC = $0000;
HH_KEYWORD_LOOKUP = $000D;
type
THtmlHelp = function(hwndCaller: HWND; pszFile: PChar; uCommand: UINT; dwData: DWORD): HWND; stdcall;
PHH_AKLink = ^THH_AKLink;
THH_AKLINK = record
cbStruct: Integer;
fReserved: Bool;
pszKeywords: PChar;
pszUrl: PChar;
pszMsgText: PChar;
pszMsgTitle: PChar;
pszWindow: PChar;
fIndexOnFail: Bool;
end;
var
HtmlHelp: THtmlHelp;
procedure InitHtmlHelpLibrary;
procedure FreeHtmlHelpLibrary;
implementation
uses
Messages, SysUtils, CmnFunc2, PathFunc;
var
HHCtrl: THandle;
procedure InitHtmlHelpLibrary;
begin
if HHCtrl = 0 then begin
HHCtrl := LoadLibrary(PChar(AddBackslash(GetSystemDir) + 'hhctrl.ocx'));
if HHCtrl <> 0 then
HtmlHelp := GetProcAddress(HHCtrl, {$IFDEF UNICODE}'HtmlHelpW'{$ELSE}'HtmlHelpA'{$ENDIF})
else
HtmlHelp := nil;
end;
end;
procedure FreeHtmlHelpLibrary;
begin
if HHCtrl <> 0 then begin
HtmlHelp := nil;
FreeLibrary(HHCtrl);
HHCtrl := 0;
end;
end;
function CloseHtmlHelpWindowsEnumProc(Wnd: HWND; lParam: LPARAM): BOOL; stdcall;
var
PID: DWORD;
ClassName: array[0..31] of Char;
MsgResult: DWORD_PTR;
begin
if (GetWindowThreadProcessId(Wnd, @PID) <> 0) and
(PID = GetCurrentProcessId) then begin
if (GetClassName(Wnd, ClassName, SizeOf(ClassName) div SizeOf(ClassName[0])) > 0) and
(StrIComp(ClassName, 'HH Parent') = 0) then begin
{ Consider only enabled windows. If an HTML Help window is disabled
because it's waiting on a modal dialog (e.g. Properties) then it's
probably not safe to close it. }
if IsWindowEnabled(Wnd) then
SendMessageTimeout(Wnd, WM_CLOSE, 0, 0, SMTO_BLOCK, 7500, @MsgResult);
end;
end;
Result := True;
end;
procedure CloseHtmlHelpWindows;
begin
{ Note: We don't call HtmlHelp(HH_CLOSE_ALL) here because its operation is
asynchronous. (See: http://helpware.net/FAR/far_faq.htm#HH_CLOSE_ALL)
If HHCTRL.OCX is unloaded too quickly after HH_CLOSE_ALL, a crash can
occur. Even if HHCTRL.OCX isn't explicitly unloaded, it still *might* be
possible for the main thread to exit while the HH thread is still in the
process of closing the window and cleaning up the temporary file.
Therefore, we use a different approach: we find the window(s) and send a
WM_CLOSE message synchronously. }
if Assigned(HtmlHelp) then
EnumWindows(@CloseHtmlHelpWindowsEnumProc, 0);
end;
initialization
finalization
{ Must explicitly close any open HTML Help window before terminating,
otherwise it leaves behind a temporary file. (Most apps don't bother
doing this, including IE and Outlook Express.) }
CloseHtmlHelpWindows;
end.
| Pascal | 4 | Patriccollu/issrc | Projects/HtmlHelpFunc.pas | [
"FSFAP"
] |
<faces-config>
<faces-config-extension>
<namespace-uri>http://www.openntf.org/xsp/xpt</namespace-uri>
<default-prefix>xpt</default-prefix>
</faces-config-extension>
<complex-type>
<description>RSS Feed as Datasource</description>
<display-name>RSS Feed Datasource</display-name>
<complex-class>org.openntf.xpt.rss.datasource.RSSDataSource</complex-class>
<complex-id>org.openntf.xpt.rss.datasource.RSSDataSource</complex-id>
<property>
<description>URL of the RSS Feed</description>
<display-name>feedURL</display-name>
<property-name>feedURL</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<category>RSS</category>
<allow-run-time-binding>true</allow-run-time-binding>
<required>true</required>
</property-extension>
</property>
<group-type-ref>com.ibm.xsp.model.group.DataSource</group-type-ref>
<complex-extension>
<tag-name>rssFeed</tag-name>
<base-complex-id>dataInterface</base-complex-id>
</complex-extension>
</complex-type>
<component>
<description>Calling a RSS Feed asynchronous and Displays the entries</description>
<display-name>RSSList</display-name>
<component-type>org.openntf.xpt.rss.component.uisrsslist</component-type>
<component-class>org.openntf.xpt.rss.component.UIRSSList</component-class>
<group-type-ref>com.ibm.xsp.group.core.prop.style</group-type-ref>
<group-type-ref>com.ibm.xsp.group.core.prop.styleClass</group-type-ref>
<property>
<description>URL of the RSSFeed</description>
<display-name>FeedURL</display-name>
<property-name>feedURL</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>HTML Template for each entry. If empty, a default will be used</description>
<display-name>HtmlTemplate</display-name>
<property-name>htmlTemplate</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Use description instead of content for the feedentry description</description>
<display-name>UseDescription</display-name>
<property-name>useDescription</property-name>
<property-class>java.lang.Boolean</property-class>
<property-extension>
<designer-extension>
<category>basics</category>
</designer-extension>
</property-extension>
</property>
<property>
<description>Style of the container</description>
<display-name>style</display-name>
<property-name>style</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>Class of the container</description>
<display-name>class</display-name>
<property-name>styleClass</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>
</designer-extension>
</property-extension>
</property>
<component-extension>
<component-family>org.openntf.xpt.rss.component.uisrsslist</component-family>
<renderer-type>org.openntf.xpt.rss.component.uisrsslist</renderer-type>
<tag-name>rsslist</tag-name>
<designer-extension>
<in-palette>true</in-palette>
<category>XPages Toolkit</category>
<render-markup><?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:image url="/icons/ui_rsslist.png" id="uirsslist"></xp:image>
</xp:view>
</render-markup>
</designer-extension>
</component-extension>
</component>
</faces-config>
| XPages | 4 | OpenNTF/XPagesToolk | org.openntf.xpt.rss/src/org/openntf/xpt/rss/config/xpt-rss-datasource.xsp-config | [
"Apache-2.0"
] |
/*
* Program type: Embedded Static SQL
*
* Description:
* This program executes a stored procedure and selects from
* a stored procedure. First, a list of projects an employee
* is involved in is printed. Then the employee is added to
* another project. The new list of projects is printed again.
* The contents of this file are subject to the Interbase Public
* License Version 1.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.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#include "example.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
EXEC SQL INCLUDE SQLCA;
void select_projects (short emp_no);
void get_params (short *emp_no, char* proj_id);
void pr_error (long status);
void add_emp_proj (short emp_no,char * proj_id);
int main (void)
{
BASED_ON employee.emp_no emp_no;
BASED_ON project.proj_id proj_id;
/*
* Add employee with id 8 to project 'MAPDB'.
*/
get_params(&emp_no, proj_id);
/*
* Display employee's current projects.
*/
printf("\nCurrent projects for employee id: %d\n\n", emp_no);
select_projects(emp_no);
/*
* Insert a new employee project row.
*/
printf("\nAdd employee id: %d to project: %s\n", emp_no, proj_id);
add_emp_proj(emp_no, proj_id);
/*
* Display employee's new current projects.
*/
printf("\nCurrent projects for employee id: %d\n\n", emp_no);
select_projects(emp_no);
}
/*
* Select from a stored procedure.
* Procedure 'get_emp_proj' gets employee's projects.
*/
void select_projects(BASED_ON employee.emp_no emp_no)
{
BASED_ON project.proj_id proj_id;
EXEC SQL
WHENEVER SQLERROR GO TO SelError;
/* Declare a cursor on the stored procedure. */
EXEC SQL
DECLARE projects CURSOR FOR
SELECT proj_id FROM get_emp_proj (:emp_no)
ORDER BY proj_id;
EXEC SQL
OPEN projects;
/* Print employee projects. */
while (SQLCODE == 0)
{
EXEC SQL
FETCH projects INTO :proj_id;
if (SQLCODE == 100)
break;
printf("\t%s\n", proj_id);
}
EXEC SQL
CLOSE projects;
EXEC SQL
COMMIT RETAIN;
SelError:
if (SQLCODE)
pr_error((long)gds__status);
}
/*
* Execute a stored procedure.
* Procedure 'add_emp_proj' adds an employee to a project.
*/
void add_emp_proj(BASED_ON employee.emp_no emp_no, BASED_ON project.proj_id proj_id)
{
EXEC SQL
WHENEVER SQLERROR GO TO AddError;
EXEC SQL
EXECUTE PROCEDURE add_emp_proj :emp_no, :proj_id;
EXEC SQL
COMMIT;
AddError:
if (SQLCODE)
pr_error((long)gds__status);
}
/*
* Set-up procedure parameters and clean-up old data.
*/
void get_params(BASED_ON employee.emp_no *emp_no, BASED_ON project.proj_id proj_id)
{
*emp_no = 8;
strcpy(proj_id, "MAPDB");
EXEC SQL
WHENEVER SQLERROR GO TO CleanupError;
/* Cleanup: delete row from the previous run. */
EXEC SQL
DELETE FROM employee_project
WHERE emp_no = 8 AND proj_id = "MAPDB";
CleanupError:
return;
}
/*
* Print an error message.
*/
void pr_error(long status)
{
isc_print_sqlerror(SQLCODE, gds__status);
}
| Eiffel | 5 | jiemurat/delphimvcframework | unittests/general/Several/bin/firebird/examples/stat/stat9.e | [
"Apache-2.0"
] |
set title "Utilisation of Old space"
plot for [i in "OU OC"] datafile using 1:i title columnheader(i) with lines
| Gnuplot | 3 | rmartinc/keycloak | testsuite/performance/tests/src/main/gnuplot/jstat/gc-o.gp | [
"Apache-2.0"
] |
<div class="faq-element">
<h3 class="faq-title">{{ f-title }}</h3>
<div class="faq-copy">{{ f-copy }}</div>
</div> | Liquid | 3 | noahcb/lit | website/src/_includes/partials/faq-element.liquid | [
"Apache-2.0"
] |
DROP TABLE IF EXISTS src;
DROP TABLE IF EXISTS src1;
DROP TABLE IF EXISTS src_json;
DROP TABLE IF EXISTS src_sequencefile;
DROP TABLE IF EXISTS src_thrift;
DROP TABLE IF EXISTS srcbucket;
DROP TABLE IF EXISTS srcbucket2;
DROP TABLE IF EXISTS srcpart;
DROP TABLE IF EXISTS primitives;
| SQL | 2 | OlegPt/spark | sql/hive/src/test/resources/data/scripts/q_test_cleanup.sql | [
"Apache-2.0"
] |
camera {
location <0, 4, -6>
look_at <0, 0, 1>
}
// Light source on the left side of the scene
light_source {
<-6, 6, 1>
color rgb <1, 1, 1>
fade_distance 6
fade_power 2
area_light <3, 0, 0>, <0, 3, 0>, 12, 12
circular
orient
}
// Light source from the camera
light_source {
<0, 4, -7>
color rgb <0.6, 0.6, 0.6>
fade_distance 12
fade_power 2
area_light <3, 0, 0>, <0, 3, 0>, 12, 12
circular
orient
}
// Little end of egg
#declare egg_little_end =
intersection {
sphere {
<0, 0, 0>, 1
scale <1, 1.6, 1>
}
box {
<-1, 0, -1>, <1, 1.6, 1>
}
}
// Big end of egg
#declare egg_big_end =
intersection {
sphere {
<0, 0, 0>, 1
}
box {
<-1, -1, -1>, <1, 0, 1>
}
}
// Complete egg
#declare egg =
union {
object {
egg_little_end
}
object {
egg_big_end
}
pigment {
color rgb <1, 1, 1>
}
finish {
specular 0.1
roughness 0.1
}
}
// Vertical egg on floor
#declare vertical_egg =
object {
egg
translate <0, 1, 0>
}
// Horizontal egg on floor
#declare horizontal_egg =
object {
egg
rotate <0, 0, -90>
translate <0, 1, 0>
}
#declare tile_normal =
normal {
gradient x, 2
slope_map {
[0.0000 <0, 1>]
[0.0005 <0.1, 0>]
[0.9995 <0.1, 0>]
[1.0000 <0, -1>]
}
}
// Tiled floor
#declare tile_plane =
plane {
y, 0
pigment {
checker
pigment {
granite
color_map {
[0 color rgb <1.0, 0.9, 0.8>]
[1 color rgb <0.9, 0.8, 0.7>]
}
}
pigment {
bozo
color_map {
[0 color rgb <0.9, 0.8, 0.7>]
[1 color rgb <0.8, 0.7, 0.6>]
}
}
}
normal {
average normal_map {
[1 tile_normal]
[1 tile_normal rotate <0, 90, 0>]
}
}
finish {
specular 0.9
roughness 0.1
reflection 0.2
}
scale 5
}
// Floor
object {
tile_plane
}
// Front egg
object {
horizontal_egg
translate <-1, 0, 0>
}
// Front vertical egg
object {
vertical_egg
translate <1.6, 0, 0>
}
// Left egg
object {
horizontal_egg
rotate <0, 20, 0>
translate <-4.5, 0, 4>
}
// Left vertical egg
object {
vertical_egg
translate <-4, 0, 5>
}
// Back egg
object {
horizontal_egg
translate <0, 0, 6>
}
// Right egg
object {
horizontal_egg
translate <2, 0, 8>
}
| POV-Ray SDL | 3 | spcask/pov-ray-tracing | src/scene19.pov | [
"MIT"
] |
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode=" " horiz-adv-x="512" d="" />
<glyph unicode="" glyph-name="error" d="M949.76 149.333v0 0l-374.187 660.907c-9.93 26.213-34.828 44.511-64 44.511s-54.070-18.297-63.844-44.042l-0.156-0.469-373.333-660.907c-6.431-10.419-10.242-23.048-10.242-36.568 0-0.194 0.001-0.388 0.002-0.582v0.030c0.78-18.935 8.791-35.859 21.324-48.205l0.009-0.009c12.521-12.639 29.879-20.468 49.064-20.48h756.482c18.721 0.373 35.56 8.133 47.781 20.474l0.006 0.006c12.409 12.869 20.054 30.405 20.054 49.727 0 0.068 0 0.136 0 0.204v-0.010c0.005 0.306 0.008 0.668 0.008 1.030 0 12.63-3.326 24.483-9.15 34.732l0.182-0.348zM480.427 593.067h64v-259.413h-64zM512 172.373c-0.127-0.001-0.277-0.002-0.427-0.002-26.863 0-48.64 21.777-48.64 48.64s21.777 48.64 48.64 48.64c26.862 0 48.639-21.776 48.64-48.638v0c0.001-0.127 0.002-0.277 0.002-0.427 0-26.627-21.586-48.213-48.213-48.213-0.001 0-0.001 0-0.002 0v0z" />
<glyph unicode="" glyph-name="attention" d="M942.080 490.667l-387.413 387.413c-11.036 10.661-26.084 17.231-42.667 17.231s-31.631-6.57-42.684-17.248l0.018 0.017-387.413-387.413c-10.661-11.036-17.231-26.084-17.231-42.667s6.57-31.631 17.248-42.684l-0.017 0.018 387.413-387.413c11.036-10.661 26.084-17.231 42.667-17.231s31.631 6.57 42.684 17.248l-0.018-0.017 387.413 387.413c10.661 11.036 17.231 26.084 17.231 42.667s-6.57 31.631-17.248 42.684l0.017-0.018zM512 192c-35.346 0-64 28.654-64 64s28.654 64 64 64c35.346 0 64-28.654 64-64v0c0-35.346-28.654-64-64-64v0zM544 384h-64l-32 320h128z" />
<glyph unicode="" glyph-name="collapse" d="M492.373 718.933l-81.493 49.067-190.72-317.013c-4.222-6.944-6.721-15.34-6.721-24.32s2.499-17.376 6.84-24.531l-0.119 0.211 190.72-317.013 81.493 49.067-175.787 292.267zM746.667 718.933l-81.92 49.067-190.293-317.013c-4.402-6.895-7.017-15.302-7.017-24.32s2.615-17.425 7.127-24.504l-0.11 0.184 190.293-317.013 81.92 49.067-175.787 292.267z" />
<glyph unicode="" glyph-name="cancel" d="M512 853.333c-224.491-2.868-405.371-185.522-405.371-410.422 0-1.961 0.014-3.919 0.041-5.874l-0.003 0.295c-0.024-1.659-0.038-3.617-0.038-5.578 0-224.9 180.88-407.553 405.1-410.419l0.271-0.003c224.491 2.868 405.371 185.522 405.371 410.422 0 1.961-0.014 3.919-0.041 5.874l0.003-0.295c0.024 1.659 0.038 3.617 0.038 5.578 0 224.9-180.88 407.553-405.1 410.419l-0.271 0.003zM512 85.333c-189.334 3.818-341.355 158.203-341.355 348.093 0 1.374 0.008 2.745 0.024 4.115l-0.002-0.209c-0.014 1.161-0.022 2.533-0.022 3.907 0 189.891 152.021 344.275 340.999 348.088l0.356 0.006c189.334-3.818 341.355-158.203 341.355-348.093 0-1.374-0.008-2.745-0.024-4.115l0.002 0.209c0.014-1.161 0.022-2.533 0.022-3.907 0-189.891-152.021-344.275-340.999-348.088l-0.356-0.006zM656.213 619.947l-144.213-137.387-144.213 137.387-47.787-45.227 144.213-137.387-144.213-137.387 47.787-45.227 144.213 137.387 144.213-137.387 47.787 45.227-144.64 137.387 144.64 137.387-47.787 45.227z" />
<glyph unicode="" glyph-name="expand" d="M512 298.667l192 256h-384l192-256z" />
<glyph unicode="" glyph-name="notebooks" d="M320.427 896c-70.692 0-128-57.308-128-128v0-672c0-53.019 42.981-96 96-96v0h544v64h-544c-17.673 0-32 14.327-32 32s14.327 32 32 32v0h544v768zM768 192h-512v576c0 0 0 0.001 0 0.001 0 35.346 28.654 64 64 64 0.15 0 0.3-0.001 0.45-0.002h447.55zM320.427 642.56v-128h384v192h-384zM384.427 642.56h256v-64h-256.427z" />
<glyph unicode="" glyph-name="plus" d="M832 495.787h-271.787v272.213h-96v-272.213h-272.213v-96h272.213v-271.787h96v271.787h271.787v96z" />
<glyph unicode="" glyph-name="update" d="M896 576l-128-192h90.88c-33.282-159.369-172.609-277.367-339.495-277.367-1.697 0-3.39 0.012-5.081 0.037l0.256-0.003c-80.581 0.131-154.81 27.22-214.176 72.727l0.843-0.621-45.227-46.080c70.066-56.099 159.999-90.027 257.857-90.027 0.247 0 0.494 0 0.741 0.001h-0.039c1.555-0.021 3.392-0.033 5.231-0.033 202.029 0 369.86 146.419 403.167 338.929l0.349 2.438h100.693zM159.147 448c0 0.136 0 0.296 0 0.457 0 197.703 158.943 358.282 356.017 360.927l0.25 0.003c0.014 0 0.031 0 0.047 0 97.827 0 186.231-40.347 249.478-105.309l0.075-0.077 45.653 45.653c-74.965 76.931-179.5 124.736-295.201 125.013h-0.052c-233.058-3.367-420.693-193.084-420.693-426.625 0-0.015 0-0.029 0-0.044v0.002h-94.72l128-192 128 192z" />
<glyph unicode="" glyph-name="tags" d="M896 768h-64v64c0 35.346-28.654 64-64 64v0h-256c-17.667-0.016-33.655-7.188-45.226-18.773l-384.001-384.001c-11.669-11.531-18.895-27.535-18.895-45.227s7.227-33.696 18.889-45.221l384.006-384.006c11.579-11.565 27.568-18.717 45.227-18.717s33.648 7.152 45.227 18.718l383.999 383.999c11.586 11.572 18.757 27.56 18.773 45.224v256.003c0 35.346-28.654 64-64 64v0zM128 448l384 384h256v-256l-384-384zM896 448l-384-384-82.773 82.773 384 384c11.586 11.572 18.757 27.56 18.773 45.224v128.003h64zM640 768c-35.346 0-64-28.654-64-64s28.654-64 64-64c35.346 0 64 28.654 64 64v0c0 35.346-28.654 64-64 64v0z" />
<glyph unicode="" glyph-name="search" d="M917.333 98.56l-222.293 221.44c40.74 52.69 65.302 119.689 65.302 192.426 0 174.61-141.55 316.16-316.16 316.16s-316.16-141.55-316.16-316.16c0-174.61 141.55-316.16 316.16-316.16 0.292 0 0.584 0 0.876 0.001h-0.045c74.116 0.383 142.086 26.382 195.584 69.587l-0.597-0.467 222.72-222.72zM207.36 514.987c0 0.127 0 0.276 0 0.426 0 131.488 106.592 238.080 238.080 238.080s238.080-106.592 238.080-238.080c0-131.488-106.592-238.080-238.080-238.080-0.15 0-0.3 0-0.45 0h0.023c-131.304 0.243-237.653 106.742-237.653 238.080 0 0 0 0 0 0v0z" />
<glyph unicode="" glyph-name="notes" d="M960 770.133h-192v128c-1.184 34.416-29.368 61.867-63.964 61.867-0.012 0-0.025 0-0.037 0h-639.998c-0.011 0-0.023 0-0.036 0-34.596 0-62.781-27.45-63.961-61.759l-0.003-0.108v-640c-0.023-0.636-0.036-1.383-0.036-2.133 0-35.346 28.654-64 64-64 0.013 0 0.025 0 0.038 0h127.998v-192c0-35.346 28.654-64 64-64v0h704c35.346 0 64 28.654 64 64v0 704c0 35.346-28.654 64-64 64v0zM64 896h640v-640h-640zM960 0h-704v192h448c35.346 0 64 28.654 64 64v0 448h192zM128 706.133h512v-64h-512v64zM128 514.56h320v-64h-320v64z" />
<glyph unicode="" glyph-name="sync" d="M512 853.333c-0.372 0.001-0.813 0.002-1.253 0.002-100.776 0-192.953-36.816-263.816-97.732l0.536 0.45 42.667-52.053c59.39 49.89 136.682 80.198 221.053 80.198 175.504 0 320.378-131.145 341.97-300.782l0.178-1.709h-102.4l136.533-204.373 136.533 204.373h-102.4c-20.69 209.397-195.9 371.627-409.001 371.627-0.211 0-0.421 0-0.631 0h0.032zM136.533 618.667l-136.533-204.373h102.4c20.405-209.431 195.557-371.784 408.628-371.784 101.519 0 194.429 36.856 266.082 97.917l-0.576-0.479-42.667 52.053c-59.39-49.89-136.682-80.198-221.053-80.198-175.504 0-320.378 131.145-341.97 300.782l-0.178 1.709h102.4z" />
<glyph unicode="" glyph-name="general" d="M545.707 277.333c-43.070-1.026-79.361-28.943-92.799-67.56l-0.214-0.707h-346.027v-68.267h346.027c13.041-39.66 49.742-67.788 93.013-67.788s79.972 28.128 92.816 67.098l0.197 0.69h278.613v68.267h-277.333c-13.8 39.717-50.707 67.803-94.238 68.266h-0.055zM545.707 140.8c-0.001 0-0.002 0-0.003 0-18.616 0-33.707 15.091-33.707 33.707 0 0.15 0.001 0.3 0.003 0.449v-0.023 4.267c1.251 18.181 15.573 32.65 33.575 34.125l0.131 0.009c18.838-0.617 33.875-16.037 33.875-34.969 0-1.208-0.061-2.402-0.181-3.579l0.012 0.148c-1.064-18.261-15.49-32.835-33.591-34.127l-0.116-0.007zM410.453 550.4c-42.942-1.081-79.090-28.999-92.375-67.562l-0.211-0.705h-211.2v-68.267h213.333c13.497-39.268 49.645-67.186 92.46-68.264l0.127-0.003c43.114 0.895 79.467 28.869 92.802 67.562l0.211 0.705h413.867v68.267h-416c-13.546 39.398-49.899 67.372-92.908 68.265l-0.105 0.002zM410.453 413.867c-0.001 0-0.002 0-0.003 0-18.616 0-33.707 15.091-33.707 33.707 0 0.15 0.001 0.3 0.003 0.449v-0.023 4.267c1.251 18.181 15.573 32.65 33.575 34.125l0.131 0.009c19.221-1.8 34.147-17.853 34.147-37.392 0-0.354-0.005-0.707-0.015-1.059l0.001 0.052c-1.276-18.315-15.818-32.857-34.018-34.127l-0.115-0.006zM777.813 755.2c-15.994 38.443-52.098 65.535-94.827 68.25l-0.32 0.016c-43.070-1.026-79.361-28.943-92.799-67.56l-0.214-0.707h-482.987v-68.267h481.28c13.041-39.66 49.742-67.788 93.013-67.788s79.972 28.128 92.816 67.098l0.197 0.69h143.36v68.267zM682.667 686.933c-0.13-0.002-0.284-0.003-0.438-0.003-18.38 0-33.28 14.9-33.28 33.28 0 0.301 0.004 0.601 0.012 0.9l-0.001-0.044v4.267c1.064 18.261 15.49 32.835 33.591 34.127l0.116 0.007c18.838-0.617 33.875-16.037 33.875-34.969 0-1.208-0.061-2.402-0.181-3.579l0.012 0.148c-1.251-18.181-15.573-32.65-33.575-34.125l-0.131-0.009z" />
<glyph unicode="" glyph-name="note" d="M785.067 823.467h-546.133c-56.265-0.712-101.688-46.135-102.399-102.332l-0.001-0.068v-546.133c0.712-56.265 46.135-101.688 102.332-102.399l0.068-0.001h426.667c9.575 0.958 18.273 4.007 25.862 8.683l-0.262-0.15 187.733 187.733c5.432 5.6 8.781 13.247 8.781 21.677 0 1.383-0.090 2.745-0.265 4.080l0.017-0.157v426.667c-0.712 56.265-46.135 101.688-102.332 102.399l-0.068 0.001zM819.2 311.467h-170.667v-170.667h-409.6c-18.315 1.276-32.857 15.818-34.127 34.018l-0.006 0.115v546.133c1.276 18.315 15.818 32.857 34.018 34.127l0.115 0.006h546.133c18.315-1.276 32.857-15.818 34.127-34.018l0.006-0.115zM580.267 584.533h-273.067v-68.267h409.6v68.267h-136.533zM648.533 448h-341.333v-68.267h341.333z" />
<glyph unicode="" glyph-name="note-history" d="M742.4 789.333l38.4 51.2-166.4 4.267 46.933-157.867 38.4 46.933c84.382-55.852 142.177-146.055 153.466-250.209l0.134-1.525h-34.133v-68.267h34.133c-17.537-162.117-145.083-289.663-305.67-307.065l-1.53-0.135v34.133h-68.267v-34.133c-162.117 17.537-289.663 145.083-307.065 305.67l-0.135 1.53h34.133v68.267h-34.133c17.922 173.251 163.129 307.204 339.623 307.204 0.601 0 1.202-0.002 1.803-0.005h-0.092v68.267c-226.216 0-409.6-183.384-409.6-409.6s183.384-409.6 409.6-409.6c226.216 0 409.6 183.384 409.6 409.6v0c-1.314 140.66-71.248 264.713-177.895 340.454l-1.305 0.88zM477.867 465.067l-149.333-110.933 42.667-55.467 162.133 123.733c4.267 4.267 8.533 8.533 8.533 12.8s4.267 8.533 4.267 17.067v234.667h-68.267z" />
<glyph unicode="" glyph-name="application" d="M512 896c-19.087 0-34.56-15.473-34.56-34.56v0-5.973c0-0.053 0-0.116 0-0.179 0-16.588-11.833-30.412-27.518-33.493l-0.216-0.035-23.467-4.267c-2.13-0.479-4.576-0.753-7.086-0.753-14.123 0-26.218 8.686-31.233 21.008l-0.081 0.225-3.84 5.12c-5.336 12.668-17.648 21.399-32 21.399-19.123 0-34.626-15.502-34.626-34.626 0-4.772 0.965-9.318 2.711-13.454l-0.085 0.227 2.56-5.12c1.941-4.127 3.074-8.963 3.074-14.064 0-12.009-6.28-22.551-15.735-28.521l-0.139-0.082-19.627-13.227c-5.26-3.643-11.776-5.819-18.801-5.819-9.357 0-17.812 3.862-23.859 10.078l-0.007 0.008-4.267 3.84c-5.299 3.472-11.79 5.538-18.764 5.538-19.087 0-34.56-15.473-34.56-34.56 0-6.974 2.066-13.466 5.619-18.896l-0.081 0.132 3.84-4.267c6.224-6.054 10.086-14.509 10.086-23.866 0-7.025-2.176-13.541-5.892-18.911l0.072 0.111c-4.267-6.4-8.96-12.8-13.227-19.627-6.052-9.594-16.594-15.874-28.603-15.874-5.101 0-9.937 1.133-14.27 3.161l0.207-0.087h-5.12c-6.020 5.22-13.932 8.402-22.586 8.402-19.087 0-34.56-15.473-34.56-34.56 0-18.026 13.801-32.829 31.413-34.419l0.134-0.010 5.12-2.133c12.547-5.096 21.233-17.191 21.233-31.314 0-2.51-0.274-4.956-0.795-7.31l0.042 0.224c0-7.68-2.987-15.36-4.267-23.467-3.116-15.901-16.94-27.734-33.528-27.734-0.063 0-0.126 0-0.188 0.001h-5.963c-19.087 0-34.56-15.473-34.56-34.56s15.473-34.56 34.56-34.56h5.973c0.053 0 0.116 0 0.179 0 16.588 0 30.412-11.833 33.493-27.518l0.035-0.216c0-8.107 2.56-15.787 4.267-23.467 0.479-2.13 0.753-4.576 0.753-7.086 0-14.123-8.686-26.218-21.008-31.233l-0.225-0.081-5.12-5.547c-12.668-5.336-21.399-17.648-21.399-32 0-19.123 15.502-34.626 34.626-34.626 4.772 0 9.318 0.965 13.454 2.711l-0.227-0.085 5.12 2.56c4.009 1.734 8.677 2.743 13.58 2.743 12.074 0 22.72-6.116 29.008-15.419l0.079-0.124c3.84-6.827 8.533-13.227 12.8-20.053 3.672-5.318 5.866-11.903 5.866-19 0-9.225-3.706-17.584-9.709-23.67l0.004 0.004-4.267-3.84c-5.89-6.186-9.513-14.576-9.513-23.813 0-19.087 15.473-34.56 34.56-34.56 9.131 0 17.434 3.541 23.613 9.324l-0.019-0.018 4.267 4.267c6.108 6.152 14.57 9.96 23.921 9.96 6.989 0 13.481-2.127 18.864-5.769l-0.119 0.076 19.627-13.227c9.594-6.052 15.874-16.594 15.874-28.603 0-5.101-1.133-9.937-3.161-14.27l0.087 0.207v-5.547c-0.023-0.468-0.036-1.017-0.036-1.569 0-19.087 15.473-34.56 34.56-34.56 10.155 0 19.287 4.38 25.61 11.353l0.026 0.029 2.133 5.547c5.242 12.528 17.4 21.169 31.576 21.169 2.416 0 4.773-0.251 7.047-0.728l-0.222 0.039 23.467-4.267c15.901-3.116 27.734-16.94 27.734-33.528 0-0.063 0-0.126-0.001-0.188v0.010-5.973c0-19.087 15.473-34.56 34.56-34.56s34.56 15.473 34.56 34.56v5.973c0 0.053 0 0.116 0 0.179 0 16.588 11.833 30.412 27.518 33.493l0.216 0.035 23.467 4.267c2.13 0.479 4.576 0.753 7.086 0.753 14.123 0 26.218-8.686 31.233-21.008l0.081-0.225 2.133-5.12c5.336-12.668 17.648-21.399 32-21.399 19.123 0 34.626 15.502 34.626 34.626 0 4.772-0.965 9.318-2.711 13.454l0.085-0.227-2.56 5.12c-1.734 4.009-2.743 8.677-2.743 13.58 0 12.074 6.116 22.72 15.419 29.008l0.124 0.079c6.827 3.84 13.227 8.533 20.053 12.8 5.318 3.672 11.903 5.866 19 5.866 9.225 0 17.584-3.706 23.67-9.709l-0.004 0.004 3.84-4.267c6.186-5.89 14.576-9.513 23.813-9.513 19.087 0 34.56 15.473 34.56 34.56 0 9.131-3.541 17.434-9.324 23.613l0.018-0.019-4.267 4.267c-6.152 6.108-9.96 14.57-9.96 23.921 0 6.989 2.127 13.481 5.769 18.864l-0.076-0.119c4.267 6.4 8.96 12.8 13.227 19.627 6.052 9.594 16.594 15.874 28.603 15.874 5.101 0 9.937-1.133 14.27-3.161l-0.207 0.087 5.547-2.133c2.826-0.833 6.072-1.312 9.431-1.312 19.087 0 34.56 15.473 34.56 34.56 0 12.128-6.247 22.796-15.698 28.964l-0.133 0.081-5.547 2.133c-12.528 5.242-21.169 17.4-21.169 31.576 0 2.416 0.251 4.773 0.728 7.047l-0.039-0.222c0 7.68 2.987 15.787 4.267 23.467 3.116 15.901 16.94 27.734 33.528 27.734 0.063 0 0.126 0 0.188-0.001h5.963c19.087 0 34.56 15.473 34.56 34.56s-15.473 34.56-34.56 34.56h-5.973c-0.053 0-0.116 0-0.179 0-16.588 0-30.412 11.833-33.493 27.518l-0.035 0.216c0 8.107-2.56 15.787-4.267 23.467-0.479 2.13-0.753 4.576-0.753 7.086 0 14.123 8.686 26.218 21.008 31.233l0.225 0.081 5.12 5.547c12.668 5.336 21.399 17.648 21.399 32 0 19.123-15.502 34.626-34.626 34.626-4.772 0-9.318-0.965-13.454-2.711l0.227 0.085-5.12-2.56c-4.009-1.734-8.677-2.743-13.58-2.743-12.074 0-22.72 6.116-29.008 15.419l-0.079 0.124c-3.84 6.827-8.533 13.227-12.8 20.053-3.672 5.318-5.866 11.903-5.866 19 0 9.225 3.706 17.584 9.709 23.67l-0.004-0.004 4.267 3.84c6.756 6.324 10.967 15.297 10.967 25.254 0 19.087-15.473 34.56-34.56 34.56-9.85 0-18.738-4.121-25.033-10.733l-0.013-0.014-4.267-4.267c-6.054-6.224-14.509-10.086-23.866-10.086-7.025 0-13.541 2.176-18.911 5.892l0.111-0.072-19.627 13.227c-9.594 6.052-15.874 16.594-15.874 28.603 0 5.101 1.133 9.937 3.161 14.27l-0.087-0.207 2.133 5.12c4.080 5.603 6.528 12.623 6.528 20.214 0 19.087-15.473 34.56-34.56 34.56-17.489 0-31.943-12.99-34.241-29.848l-0.020-0.179-2.133-5.12c-5.096-12.547-17.191-21.233-31.314-21.233-2.51 0-4.956 0.274-7.31 0.795l0.224-0.042-23.467 4.267c-15.901 3.116-27.734 16.94-27.734 33.528 0 0.063 0 0.126 0.001 0.188v-0.010 5.973c0 0.013 0 0.027 0 0.042 0 19.087-15.473 34.56-34.56 34.56-0.6 0-1.197-0.015-1.79-0.046l0.083 0.003zM512 725.333c139.986-0.175 255.547-104.517 273.343-239.667l0.151-1.4h-213.333c-6.347 10.36-14.814 18.827-24.849 24.988l-0.325 0.185c-9.978 5.579-21.829 9.012-34.448 9.384l-0.112 0.003-107.52 185.173c30.474 12.439 65.834 19.658 102.881 19.658 1.481 0 2.959-0.012 4.435-0.035l-0.223 0.003zM345.6 667.307l106.667-184.747c-5.579-9.978-9.012-21.829-9.384-34.448l-0.003-0.112c0.303-12.588 3.747-24.309 9.575-34.49l-0.188 0.357-106.667-185.173c-66.643 50.682-109.229 130.021-109.229 219.307s42.586 168.625 108.554 218.814l0.675 0.492zM571.733 411.307h213.333c-18.907-135.491-133.898-238.684-273.041-238.933h-0.026c-1.253-0.020-2.731-0.032-4.212-0.032-37.047 0-72.407 7.22-104.751 20.328l1.87-0.67 107.093 186.88c25.376 0.14 47.519 13.85 59.556 34.236l0.177 0.324z" />
<glyph unicode="" glyph-name="encryption" d="M630.187 853.333c-0.237 0.001-0.518 0.001-0.799 0.001-158.115 0-286.293-128.178-286.293-286.293 0-36.178 6.71-70.788 18.954-102.654l-0.662 1.96-256-256v-170.667h170.667v104.107h100.693v101.547h101.547l52.053 52.053c30.908-12.4 66.739-19.593 104.25-19.593 158.587 0 287.147 128.56 287.147 287.147s-128.56 287.147-287.147 287.147c-1.551 0-3.099-0.012-4.644-0.037l0.233 0.003zM697.6 718.080c47.128 0 85.333-38.205 85.333-85.333s-38.205-85.333-85.333-85.333c-47.128 0-85.333 38.205-85.333 85.333v0c0 47.128 38.205 85.333 85.333 85.333v0z" />
<glyph unicode="" glyph-name="plugins" d="M512 857.6c0 0-0.001 0-0.001 0-56.404 0-102.157-45.603-102.399-101.95v-0.023c2.013-30.391 13.094-57.858 30.532-80.103l-0.239 0.316c3.108-4.764 4.956-10.595 4.956-16.858 0-17.202-13.945-31.147-31.147-31.147-1.296 0-2.573 0.079-3.827 0.233l0.15-0.015c-77.653 9.387-156.587 24.32-156.587 24.32v0c-2.173 0.197-4.7 0.309-7.253 0.309s-5.080-0.112-7.577-0.332l0.323 0.023c-18.829-0.083-35.857-7.729-48.215-20.055l0.001 0.001c-12.013-11.914-19.592-28.283-20.052-46.42l-0.002-0.086v-163.84c0.251-21.723 17.919-39.236 39.678-39.236 7.743 0 14.968 2.218 21.074 6.053l-0.165-0.097c21.476 16.868 48.898 27.052 78.699 27.052 2.334 0 4.653-0.062 6.956-0.186l-0.321 0.014c53.997-2.69 96.758-47.124 96.758-101.547 0-56.148-45.517-101.665-101.665-101.665-1.726 0-3.442 0.043-5.146 0.128l0.24-0.010c-28.63 1.429-54.666 11.467-75.858 27.553l0.338-0.246c-5.943 3.741-13.17 5.96-20.916 5.96-21.61 0-39.185-17.275-39.67-38.769l-0.001-0.045v-81.493c0-52.48 30.72-82.773 68.267-82.773h546.133c0 0 0.001 0 0.001 0 37.553 0 68.023 30.321 68.265 67.817v475.33c0 0.018 0 0.039 0 0.060 0 18.825-7.667 35.858-20.049 48.149l-0.004 0.004c-12.357 12.324-29.384 19.97-48.197 20.053h-14.523s-78.933-14.933-156.587-24.32c-1.104-0.139-2.381-0.218-3.676-0.218-17.202 0-31.147 13.945-31.147 31.147 0 6.263 1.849 12.094 5.030 16.978l-0.073-0.12c18.657 23.151 29.948 52.921 29.948 85.328 0 1.652-0.029 3.298-0.088 4.936l0.007-0.237c-4.793 43.464-35.95 78.506-76.938 89.018l-0.716 0.156c-4.963 0.698-10.696 1.097-16.523 1.097-2.743 0-5.466-0.088-8.165-0.262l0.368 0.019z" />
<glyph unicode="" glyph-name="web-clipper" d="M64.853 442.453c1.868 23.717 19.51 42.814 42.354 46.887l0.312 0.046 336.64 42.667-2.987 34.56v18.773l-265.813 51.2c-24.766 3.655-43.559 24.762-43.559 50.258 0 3.351 0.325 6.626 0.944 9.796l-0.052-0.321c4.068 24.799 25.342 43.489 50.981 43.489 3.244 0 6.419-0.299 9.497-0.872l-0.319 0.049 354.56-69.12h58.88l-75.947-87.893c-13.548-15.556-21.808-36.027-21.808-58.428 0-26.66 11.699-50.587 30.243-66.928l0.098-0.085c16.259-14.678 37.907-23.659 61.653-23.659s45.395 8.981 61.734 23.731l-0.081-0.072 85.333 80.213c3.144 3.097 5.091 7.401 5.091 12.16s-1.948 9.063-5.089 12.158l-0.002 0.002c-3.143 3.042-7.433 4.918-12.16 4.918s-9.017-1.875-12.165-4.922l0.005 0.005-85.333-79.787c-10.143-9.102-23.622-14.667-38.4-14.667s-28.257 5.566-38.454 14.715l0.054-0.047c-11.549 10.214-18.793 25.067-18.793 41.613 0 13.992 5.181 26.773 13.728 36.531l-0.055-0.064 104.96 122.027 21.76 22.613c22.126 21.964 52.608 35.539 86.259 35.539 25.069 0 48.379-7.533 67.789-20.46l-0.449 0.281 46.933-31.147c46.421-30.896 76.637-82.942 76.8-142.055v-251.758c-0.484-75.509-61.807-136.534-137.384-136.534-0.151 0-0.302 0-0.453 0.001h-155.71c10.138 13.862 16.221 31.247 16.221 50.053 0 0.403-0.003 0.806-0.008 1.208l0.001-0.061c-0.107 27.889-13.577 52.61-34.335 68.106l-0.225 0.16c20.82 15.733 34.135 40.446 34.135 68.268 0 46.979-37.963 85.091-84.885 85.332h-141.25l-333.227-42.667c-2.114-0.309-4.555-0.486-7.036-0.486-25.436 0-46.539 18.548-50.524 42.856l-0.040 0.296c-0.388 2.236-0.61 4.81-0.61 7.436 0 1.438 0.066 2.86 0.196 4.264l-0.013-0.18zM408.747 345.6c0.242 28.329 23.262 51.2 51.625 51.2 0.001 0 0.001 0 0.002 0h136.96c28.277 0 51.2-22.923 51.2-51.2s-22.923-51.2-51.2-51.2h-136.96c0 0-0.001 0-0.002 0-28.363 0-51.383 22.871-51.625 51.177v0.023zM443.307 209.067c0.242 28.329 23.262 51.2 51.625 51.2 0.001 0 0.001 0 0.002 0h102.4c28.277 0 51.2-22.923 51.2-51.2s-22.923-51.2-51.2-51.2h-102.4c0 0-0.001 0-0.002 0-28.363 0-51.383 22.871-51.625 51.177v0.023z" />
<glyph unicode="" glyph-name="appearance" d="M290.987 896c-9.525-0.016-18.133-3.931-24.315-10.235l-192.432-192.432c-6.288-6.195-10.183-14.802-10.183-24.32s3.895-18.125 10.179-24.316l199.684-199.684 48.64 48.64-175.36 175.36 143.787 143.787 42.667-42.667-42.667-42.667 50.347-52.48 42.667 42.667 37.12-37.12-71.253-70.4 42.667-42.667 120.747 120.32-197.973 197.973c-6.187 6.309-14.795 10.224-24.317 10.24h-0.003zM816.213 861.44c-18.821-0.132-35.833-7.767-48.218-20.058l-49.062-48.636 137.813-137.813 48.64 49.067c12.471 12.438 20.186 29.638 20.186 48.64s-7.716 36.202-20.185 48.638l-0.002 0.002-40.533 42.667c-12.276 10.884-28.525 17.532-46.326 17.532-0.814 0-1.624-0.014-2.431-0.041l0.117 0.003zM649.813 723.627l-474.453-474.453 42.667-25.173 17.493-51.627 51.627-17.493 25.173-42.667 475.307 473.6zM750.080 450.987l-120.32-120.747 42.667-42.667 72.107 71.68 37.12-37.12-42.667-42.667 48.64-48.64 44.8 42.667 42.667-42.667-143.787-143.787-175.36 175.36-48.64-48.64 199.68-199.68c6.195-6.288 14.802-10.183 24.32-10.183s18.125 3.895 24.316 10.179l192.431 192.431c6.288 6.195 10.183 14.802 10.183 24.32s-3.895 18.125-10.179 24.316l-0.004 0.004-153.173 150.187zM128 141.653l-29.44-83.2c-0.195-1.026-0.306-2.207-0.306-3.413s0.111-2.387 0.324-3.532l-0.018 0.119c0.232-9.331 7.736-16.835 17.045-17.066h6.422l85.333 29.867z" />
<glyph unicode="" glyph-name="code" d="M434.773 64l58.453 5.547c35.361 65.828 66.743 142.554 90.037 222.722l2.123 8.531-93.013-9.387c-14.561-86.991-34.574-163.501-60.604-237.168l3.004 9.755zM532.48 624.64c-0.166 0.002-0.362 0.003-0.559 0.003-30.869 0-55.893-25.024-55.893-55.893 0-1.352 0.048-2.693 0.142-4.021l-0.010 0.178c-0.136-1.473-0.213-3.185-0.213-4.916 0-31.34 25.406-56.747 56.747-56.747s56.747 25.406 56.747 56.747c0 1.731-0.077 3.443-0.229 5.134l0.016-0.218c0.129 1.416 0.203 3.063 0.203 4.726 0 30.398-24.642 55.040-55.040 55.040-0.672 0-1.341-0.012-2.006-0.036l0.096 0.003zM190.293 707.413c0.743-28.46 3.507-55.685 8.162-82.259l-0.482 3.325c4.217-23.539 6.983-51.065 7.667-79.107l0.013-0.679c0-33.28-9.387-70.4-77.653-70.4v-48.213c68.267 0 77.653-42.667 77.653-70.4-0.747-27.85-3.51-54.477-8.158-80.45l0.478 3.224c-4.192-22.894-6.956-49.672-7.666-76.962l-0.014-0.692c0-96 59.733-130.56 139.093-130.56h20.48v52.48h-17.493c-53.76 0-76.373 29.44-76.373 82.773 0.636 24.415 3.247 47.784 7.686 70.499l-0.433-2.659c4.083 21.534 6.555 46.438 6.825 71.871l0.002 0.236c0.77 4.454 1.21 9.583 1.21 14.816 0 42.986-29.704 79.033-69.706 88.737l-0.624 0.128c40.531 9.715 70.19 45.641 70.19 88.494 0 4.909-0.389 9.726-1.138 14.424l0.068-0.518c-0.293 25.835-2.765 50.886-7.239 75.237l0.412-2.703c-4.183 20.81-6.803 44.938-7.248 69.596l-0.005 0.377c0 51.2 19.2 81.493 75.947 81.493h17.92v52.48h-20.48c-81.493 0-139.093-37.12-139.093-124.587zM896 430.080v48.213c-68.267 0-77.653 37.12-77.653 70.4 0.697 28.722 3.463 56.248 8.161 83.109l-0.481-3.322c4.173 23.249 6.937 50.473 7.665 78.205l0.015 0.728c0 85.333-58.453 124.587-139.947 124.587h-19.2v-52.48h17.067c55.467 0 75.947-30.293 75.947-81.493-0.933-24.605-3.38-47.828-7.272-70.557l0.445 3.144c-4.289-21.478-7.056-46.471-7.67-71.997l-0.010-0.536c-0.55-3.79-0.863-8.166-0.863-12.615 0-43.106 29.458-79.331 69.341-89.644l0.643-0.141c-40.585-10.412-70.1-46.666-70.1-89.815 0-4.742 0.356-9.4 1.044-13.95l-0.064 0.512c0.548-26.006 3.319-51.004 8.132-75.266l-0.452 2.733c3.447-19.828 5.894-43.35 6.797-67.267l0.030-1c0-53.333-23.040-81.92-76.8-82.773h-16.213v-52.48h20.053c78.507 0 139.093 34.56 139.093 130.56-0.724 27.981-3.488 54.759-8.158 80.877l0.478-3.223c-4.17 22.749-6.933 49.376-7.665 76.51l-0.015 0.717c0 27.307 9.387 68.267 77.653 68.267z" />
<glyph unicode="" glyph-name="asterisks" d="M917.333 457.813l-13.227 46.080-85.76-33.28 2.987 105.387h-44.373l2.56-104.107-87.467 34.133-13.227-45.653 87.467-27.307-58.027-83.2 35.84-27.733 52.053 84.907 53.76-87.040 35.84 28.587-57.173 81.92 88.747 27.307zM331.947 503.893l-86.187-33.28 2.987 105.387h-43.947l2.56-104.107-87.467 34.133-13.227-45.653 87.467-27.307-58.453-83.2 36.267-27.733 52.053 84.907 53.76-87.040 35.84 28.587-57.173 81.92 88.747 27.307-13.227 46.080zM617.813 503.893l-85.76-33.28 2.987 105.387h-44.373l2.56-104.107-87.040 34.133-13.227-45.653 87.040-27.307-58.027-83.2 36.267-27.733 52.053 84.907 53.76-87.040 35.84 28.587-57.6 81.92 88.747 27.307-13.227 46.080z" />
<glyph unicode="" glyph-name="bold" d="M832 285.44c0.001 0.23 0.002 0.501 0.002 0.773 0 84.44-55.37 155.947-131.783 180.194l-1.339 0.367-24.747 9.387 23.040 12.8c51.178 27.492 85.386 80.648 85.386 141.794 0 1.451-0.019 2.897-0.058 4.338l0.004-0.213c0 102.827-85.333 174.507-203.093 174.507h-344.747v-721.493h370.347c131.413 0 226.987 85.333 226.987 197.547zM378.453 693.76h178.773c45.243 0 81.92-36.677 81.92-81.92s-36.677-81.92-81.92-81.92v0h-178.773zM378.453 203.52v210.347h202.667c2.004 0.136 4.344 0.213 6.702 0.213 58.203 0 105.387-47.183 105.387-105.387s-47.183-105.387-105.387-105.387c-2.358 0-4.698 0.077-7.017 0.23l0.315-0.017z" />
<glyph unicode="" glyph-name="bulleted-list" d="M427.947 774.4h468.053v-93.013h-468.053v93.013zM427.947 494.933h468.053v-93.013h-468.053v93.013zM427.947 215.467h468.053v-93.013h-468.053v93.013zM241.067 238.933c-38.645 0-69.973-31.328-69.973-69.973s31.328-69.973 69.973-69.973c38.645 0 69.973 31.328 69.973 69.973v0c0 38.645-31.328 69.973-69.973 69.973v0zM241.067 149.333c-9.661 0-17.493 7.832-17.493 17.493v0c0 9.661 7.832 17.493 17.493 17.493v0c9.661 0 17.493-7.832 17.493-17.493v0c-0.232-9.566-7.927-17.261-17.471-17.493h-0.022zM241.067 518.4c-38.645-0.001-69.972-31.329-69.972-69.973s31.328-69.973 69.973-69.973c38.495 0 69.73 31.085 69.972 69.524v0.023c-0.24 38.548-31.425 69.733-69.95 69.973h-0.023zM241.067 797.44c-38.645 0-69.973-31.328-69.973-69.973s31.328-69.973 69.973-69.973c38.645 0 69.973 31.328 69.973 69.973v0c0 38.645-31.328 69.973-69.973 69.973v0z" />
<glyph unicode="" glyph-name="embed-code" d="M386.987 64h83.2l166.827 768h-83.2l-166.827-768zM302.080 665.173l-185.173-192c-6.313-6.58-10.2-15.529-10.2-25.387s3.887-18.807 10.212-25.399l-0.012 0.013 185.173-192 49.067 50.773-160.427 166.827 160.427 166.4zM907.093 473.173l-185.173 192-49.067-50.773 160.853-166.4-160.853-166.827 49.067-50.773 185.173 192c6.313 6.58 10.2 15.529 10.2 25.387s-3.887 18.807-10.212 25.399l0.012-0.013z" />
<glyph unicode="" glyph-name="back" d="M618.24 85.333l-325.973 329.387c-8.347 8.594-13.494 20.336-13.494 33.28s5.146 24.686 13.505 33.292l-0.011-0.012 325.973 329.387 64.427-66.56-291.413-296.107 291.413-296.107z" />
<glyph unicode="" glyph-name="forward" d="M405.333 85.333l-64 66.56 290.987 296.107-290.987 296.107 64 66.56 325.547-329.387c8.549-8.502 13.84-20.273 13.84-33.28s-5.291-24.778-13.838-33.278l-0.002-0.002z" />
<glyph unicode="" glyph-name="h1" d="M425.813 476.16h-207.36v279.040h-69.12v-628.053h69.12v279.040h207.36v-279.040h69.12v628.053h-69.12v-279.040zM770.987 197.547v571.307l-183.467-61.867 21.76-66.133 92.587 31.147v-474.453h-103.68v-69.547h276.48v69.547h-103.68z" />
<glyph unicode="" glyph-name="h2" d="M434.347 480.427h-213.333v282.027h-70.827v-634.453h70.827v282.027h213.333v-282.027h70.827v634.453h-70.827v-282.027zM669.867 199.253c67.84 79.36 213.333 264.533 213.333 386.987s-77.227 176.213-153.6 176.213-154.027-54.613-154.027-175.787h70.827c0 66.987 30.293 104.96 85.333 104.96s82.773-39.253 82.773-105.387c0-104.533-164.267-306.347-227.413-375.040l-9.387-10.24v-72.107h318.293v70.4z" />
<glyph unicode="" glyph-name="h3" d="M430.080 478.293h-210.773v280.32h-69.973v-630.613h69.973v280.32h210.773v-280.32h69.973v630.613h-69.973v-280.32zM774.827 481.28c58.969 23.632 99.858 80.307 99.858 146.532 0 0.835-0.006 1.668-0.019 2.5l0.002-0.126c0 183.893-304.213 183.893-304.213 0h69.547c1.884 39.263 34.174 70.382 73.734 70.382 2.733 0 5.432-0.149 8.088-0.438l-0.329 0.029c0.626 0.015 1.364 0.023 2.104 0.023 21.39 0 41.132-7.059 57.023-18.974l-0.247 0.177c14.142-11.512 23.102-28.92 23.102-48.42 0-0.978-0.023-1.95-0.067-2.917l0.005 0.137c0-103.253-145.92-105.387-151.893-105.387l-4.267-69.547c6.4 0 156.16-20.907 156.16-151.040 0-66.133-30.293-105.387-81.92-105.387s-81.493 35.84-81.493 104.533h-69.547c0-120.747 76.373-174.507 151.893-174.507s152.32 54.187 152.32 175.36c0.009 0.718 0.014 1.565 0.014 2.414 0 74.018-39.68 138.768-98.928 174.14l-0.927 0.513z" />
<glyph unicode="" glyph-name="heading" d="M678.4 808.96v-314.027h-332.8v314.027h-110.933v-721.493h110.933v314.453h332.8v-314.453h110.933v721.493h-110.933z" />
<glyph unicode="" glyph-name="info" d="M478.293 517.973h69.973v-279.467h-69.973v279.467zM512 657.493c-25.685 0-46.507-20.822-46.507-46.507s20.822-46.507 46.507-46.507c25.685 0 46.507 20.822 46.507 46.507v0c0 25.685-20.822 46.507-46.507 46.507v0zM512 64c-212.077 0-384 171.923-384 384s171.923 384 384 384c212.077 0 384-171.923 384-384v0c0-212.077-171.923-384-384-384v0zM512 762.027c-172.881-0.727-312.747-141.042-312.747-314.024 0-173.432 140.595-314.027 314.027-314.027s314.025 140.593 314.027 314.024v0c-0.242 173.485-140.935 314.028-314.453 314.028-0.3 0-0.6 0-0.9-0.001h0.046z" />
<glyph unicode="" glyph-name="italic" d="M736.427 738.987l10.24 69.547h-343.040l-9.813-69.547h124.16l-83.627-581.973h-125.44l-10.24-69.547h340.48l10.24 69.547h-120.32l84.053 581.973h123.307z" />
<glyph unicode="" glyph-name="layout" d="M768 808.533h-512c-57.452-0.482-103.867-47.047-104.107-104.51v-512.023c0.236-57.574 46.603-104.24 104.038-104.959l0.068-0.001h512c0.127-0.001 0.277-0.001 0.427-0.001 57.968 0 104.96 46.992 104.96 104.96 0 0 0 0.001 0 0.001v0 512c0 0.001 0 0.002 0 0.003 0 57.732-46.801 104.533-104.533 104.533-0.3 0-0.6-0.001-0.899-0.004h0.046zM221.867 192v489.387h256v-524.373h-221.867c-18.952 0.477-34.133 15.954-34.133 34.976 0 0.004 0 0.007 0 0.011v-0.001zM768 157.013h-220.587v524.373h256v-489.387c0-19.323-15.664-34.987-34.987-34.987v0z" />
<glyph unicode="" glyph-name="line" d="M192 482.987h640v-69.973h-640v69.973z" />
<glyph unicode="" glyph-name="link" d="M345.6 315.307c0-0.035 0-0.077 0-0.119 0-18.616 15.091-33.707 33.707-33.707 9.337 0 17.788 3.797 23.892 9.931l265.388 265.388c6.135 6.106 9.932 14.556 9.932 23.893s-3.797 17.788-9.93 23.892l-0.001 0.001c-6.189 5.981-14.596 9.702-23.872 9.813h-0.022c-9.313-0.016-17.749-3.759-23.898-9.817l-265.383-265.383c-6.065-6.094-9.814-14.497-9.814-23.775 0-0.042 0-0.083 0-0.125v0.006zM481.707 306.347c-4-15.99-12.062-29.728-23.029-40.522l-0.011-0.011-85.333-87.467c-16.257-16.088-38.625-26.027-63.315-26.027-0.091 0-0.181 0-0.272 0h0.014c-50.33 0.241-91.066 40.977-91.307 91.284v0.023c-0.004 0.306-0.006 0.668-0.006 1.031 0 24.582 9.947 46.841 26.035 62.971l-0.002-0.002 87.467 85.333c10.696 10.916 24.279 18.964 39.514 22.91l0.593 0.13 64 64c-12.663 3.523-27.203 5.547-42.216 5.547-0.158 0-0.316 0-0.475-0.001h0.024c-0.321 0.002-0.701 0.004-1.081 0.004-42.101 0-80.201-17.128-107.712-44.797l-0.007-0.007-87.467-85.333c-29.387-28.098-47.686-67.582-47.787-111.341v-0.019c0.914-87.432 72.003-157.958 159.565-157.958 42.923 0 81.887 16.947 110.568 44.515l-0.053-0.050 85.333 87.467c27.824 27.929 45.026 66.457 45.026 109.002 0 15.438-2.265 30.346-6.48 44.411l0.281-1.093zM827.733 763.733c-28.609 28.433-68.039 46.007-111.573 46.007s-82.964-17.574-111.581-46.015l0.008 0.008-85.333-87.467c-27.935-28.012-45.208-66.669-45.208-109.361 0-15.149 2.175-29.79 6.229-43.627l-0.275 1.095 64 64c4.076 15.828 12.124 29.411 23.026 40.093l0.014 0.014 85.333 87.467c15.201 11.726 34.519 18.795 55.488 18.795 50.427 0 91.307-40.879 91.307-91.307 0-20.969-7.068-40.287-18.953-55.701l0.158 0.213-87.467-85.333c-10.718-11.111-24.494-19.204-39.972-22.926l-0.562-0.114-64-63.573c12.972-3.934 27.881-6.199 43.318-6.199 42.545 0 81.073 17.202 109.007 45.030l-0.005-0.005 87.467 85.333c28.433 28.609 46.007 68.039 46.007 111.573 0 43.746-17.746 83.348-46.432 111.999l-0.002 0.002z" />
<glyph unicode="" glyph-name="more" d="M597.333 170.667c0 47.128-38.205 85.333-85.333 85.333s-85.333-38.205-85.333-85.333c0-47.128 38.205-85.333 85.333-85.333v0c47.128 0 85.333 38.205 85.333 85.333v0zM597.333 448c0 47.128-38.205 85.333-85.333 85.333s-85.333-38.205-85.333-85.333c0-47.128 38.205-85.333 85.333-85.333v0c47.128 0 85.333 38.205 85.333 85.333v0zM597.333 725.333c0 47.128-38.205 85.333-85.333 85.333s-85.333-38.205-85.333-85.333c0-47.128 38.205-85.333 85.333-85.333v0c47.128 0 85.333 38.205 85.333 85.333v0z" />
<glyph unicode="" glyph-name="numbered-list" d="M216.747 629.333h46.080v181.333h-5.973l-84.907-28.587v-39.68l44.8 15.36v-128.427zM256 418.133l18.773 16.213c4.41 4.189 8.462 8.647 12.172 13.386l0.202 0.268c4.539 5.277 8.4 11.325 11.333 17.879l0.187 0.468c2.143 5.31 3.394 11.466 3.413 17.912v0.008c0 0.020 0 0.043 0 0.067 0 7.863-1.729 15.322-4.828 22.018l0.135-0.325c-3.468 6.962-8.213 12.799-13.979 17.415l-0.101 0.078c-6.763 4.789-14.822 8.235-23.54 9.762l-0.353 0.051c-9.333 2.745-20.056 4.324-31.147 4.324s-21.814-1.579-31.954-4.525l0.808 0.201c-9.778-3.257-18.265-7.748-25.839-13.397l0.239 0.17c-6.594-5.232-12.022-11.613-16.050-18.879l-0.163-0.321c-3.76-6.777-5.973-14.861-5.973-23.463 0-0.001 0-0.003 0-0.004v0-5.12h52.053v5.12c-0.037 0.477-0.059 1.034-0.059 1.595 0 6.051 2.47 11.525 6.457 15.469l0.002 0.002c4.9 3.777 11.125 6.053 17.883 6.053 0.764 0 1.521-0.029 2.27-0.086l-0.1 0.006c1.411 0.226 3.037 0.356 4.693 0.356s3.283-0.129 4.869-0.378l-0.176 0.023c2.503-0.811 4.647-2.13 6.403-3.843l-0.003 0.003c2.060-1.231 3.586-3.173 4.25-5.48l0.016-0.066c0.346-1.215 0.544-2.611 0.544-4.053s-0.199-2.838-0.57-4.161l0.026 0.108c0.172-0.898 0.27-1.931 0.27-2.987s-0.098-2.089-0.286-3.090l0.016 0.103c-0.981-2.957-2.435-5.512-4.295-7.714l0.028 0.034-8.107-9.813-12.8-11.52-69.12-61.013v-29.44h154.453v36.267h-82.773zM298.667 165.973c-3.59 3.91-7.656 7.297-12.128 10.097l-0.245 0.143-5.12 2.56h3.413c4.429 3.683 8.128 8.061 10.97 12.995l0.123 0.231c2.708 3.313 5.003 7.114 6.715 11.218l0.112 0.302c0.309 1.86 0.485 4.003 0.485 6.187s-0.176 4.327-0.516 6.415l0.031-0.229c0.008 0.314 0.013 0.684 0.013 1.055 0 6.424-1.42 12.517-3.963 17.981l0.11-0.263c-4.263 6.796-9.844 12.377-16.425 16.514l-0.215 0.126c-7.405 5.47-16.092 9.724-25.486 12.25l-0.54 0.124c-8.912 2.033-19.147 3.198-29.653 3.198s-20.741-1.165-30.581-3.373l0.928 0.175c-9.078-2.512-17.019-6.010-24.303-10.473l0.41 0.233c-6.775-3.973-12.355-9.281-16.525-15.601l-0.115-0.185c-3.68-6.1-5.889-13.45-5.973-21.31v-5.144h54.613v5.12c-0.294 0.827-0.463 1.78-0.463 2.773s0.17 1.947 0.482 2.833l-0.018-0.060c1.098 1.879 2.527 3.444 4.222 4.663l0.044 0.030c2.209 1.233 4.766 2.257 7.459 2.939l0.221 0.047c3.142 0.716 6.75 1.126 10.453 1.126s7.312-0.41 10.781-1.188l-0.327 0.062c2.764-0.763 5.18-1.933 7.324-3.461l-0.070 0.048c1.714-1.301 3.036-3.035 3.813-5.041l0.027-0.079c0.214-1.026 0.336-2.205 0.336-3.413s-0.122-2.387-0.356-3.526l0.019 0.113c0.014-0.252 0.023-0.546 0.023-0.843 0-5.005-2.33-9.467-5.964-12.359l-0.032-0.025c-5.025-3.28-11.178-5.231-17.786-5.231-0.948 0-1.887 0.040-2.815 0.119l0.121-0.008h-14.933v-35.413h17.92c5.12 0 29.867 0 29.867-20.053 0-5.973-2.56-18.347-26.88-18.347-0.784-0.093-1.692-0.146-2.612-0.146-12.411 0-22.572 9.635-23.411 21.833l-0.004 0.073h-52.907v-5.12c-0.004-0.218-0.006-0.475-0.006-0.733 0-8.608 2.549-16.62 6.933-23.323l-0.1 0.163c4.985-6.692 11.082-12.245 18.066-16.482l0.281-0.158c7.124-3.941 15.375-7.167 24.069-9.25l0.677-0.137c8.045-1.903 17.281-2.995 26.772-2.995 0.488 0 0.975 0.003 1.462 0.009l-0.074-0.001c11.043 0.011 21.79 1.254 32.119 3.599l-0.972-0.186c9.68 2.186 18.234 5.72 25.974 10.453l-0.374-0.213c7.078 4.412 12.928 10.127 17.363 16.857l0.13 0.21c4.024 6.391 6.411 14.164 6.411 22.494 0 0.342-0.004 0.683-0.012 1.023l0.001-0.050c0.002 0.133 0.003 0.29 0.003 0.447 0 4.906-0.941 9.591-2.652 13.887l0.089-0.254c-1.572 4.61-3.898 8.585-6.863 11.989l0.036-0.043zM421.547 765.44h453.12v-90.88h-453.12v90.88zM421.547 493.227h453.12v-90.88h-453.12v90.88zM421.547 221.44h453.12v-90.88h-453.12v90.88z" />
<glyph unicode="" glyph-name="quote" d="M213.333 410.027h162.987c-1.426-50.021-42.317-90.028-92.551-90.028-0.162 0-0.325 0-0.487 0.001h0.025v-91.307c0.514-0.005 1.122-0.008 1.731-0.008 100.75 0 182.62 80.834 184.294 181.184l0.002 0.157v251.307h-256zM554.667 661.333v-251.307h162.987c-1.426-50.021-42.317-90.028-92.551-90.028-0.162 0-0.325 0-0.487 0.001h0.025v-91.307c0.514-0.005 1.122-0.008 1.731-0.008 100.75 0 182.62 80.834 184.294 181.184l0.002 0.157v251.307z" />
<glyph unicode="" glyph-name="alarm" d="M778.667 469.333c0 177.92-87.467 256-162.56 287.573v13.653c0 57.497-46.61 104.107-104.107 104.107s-104.107-46.61-104.107-104.107v0-13.653c-75.093-32.853-162.56-109.653-162.56-287.573 0-186.027-78.080-249.6-78.507-250.027-8.846-6.342-14.541-16.592-14.541-28.171 0-19.087 15.473-34.56 34.56-34.56 0.312 0 0.623 0.004 0.933 0.012l-0.046-0.001h177.92c16.582-66.515 75.8-115.018 146.347-115.018s129.765 48.503 146.127 113.98l0.219 1.038h177.92c0.036 0 0.079 0 0.122 0 15.116 0 27.966 9.705 32.658 23.224l0.073 0.243c1.142 3.328 1.801 7.162 1.801 11.149 0 11.17-5.172 21.133-13.252 27.624l-0.069 0.054s-78.933 64.427-78.933 250.453zM512 805.12c16.193-0.201 29.689-11.509 33.234-26.646l0.046-0.234c-9.59 1.85-21.024 3.221-32.664 3.815l-0.616 0.025c-12.255-0.619-23.689-1.99-34.867-4.088l1.587 0.248c3.591 15.371 17.087 26.679 33.258 26.88h0.022zM512 110.507c-0.030 0-0.066 0-0.101 0-31.979 0-59.61 18.614-72.649 45.599l-0.21 0.482h145.92c-13.249-27.466-40.88-46.080-72.859-46.080-0.036 0-0.071 0-0.107 0h0.005zM258.987 226.133c35.432 64.914 56.268 142.188 56.268 224.328 0 6.637-0.136 13.242-0.405 19.813l0.031-0.941c0 234.667 176.213 242.773 197.12 243.2s197.12-8.96 197.12-243.2c-0.239-5.63-0.375-12.235-0.375-18.872 0-82.14 20.836-159.414 57.511-226.824l-1.243 2.496zM848.213 533.333l69.12 7.68c-11.235 134.019-91.096 247.111-203.956 304.932l-2.124 0.988-28.587-61.867c93.24-49.059 157.544-142.068 165.488-250.727l0.059-1.006zM341.333 785.067l-28.587 63.573c-114.984-58.809-194.845-171.901-205.987-304.543l-0.093-1.377 69.12-9.387c8.003 109.665 72.307 202.674 163.864 250.925l1.683 0.808z" />
<glyph unicode="" glyph-name="share" d="M804.267 169.387c0-19.323-15.664-34.987-34.987-34.987v0h-513.28c-0.127-0.002-0.277-0.003-0.427-0.003-19.323 0-34.987 15.664-34.987 34.987 0 0.001 0 0.002 0 0.003v0 514.56c0 0.001 0 0.002 0 0.003 0 19.323 15.664 34.987 34.987 34.987 0.15 0 0.3-0.001 0.449-0.003h162.537v70.4h-162.56c-0.254 0.002-0.554 0.003-0.854 0.003-58.29 0-105.572-47.133-105.812-105.367v-514.583c0.241-58.257 47.522-105.39 105.812-105.39 0.3 0 0.6 0.001 0.9 0.004h511.954c58.106 0.241 105.145 47.281 105.387 105.364v163.863h-69.12zM558.933 789.333v-69.973h195.84l-314.453-314.88 49.493-49.493 314.453 314.453v-195.84h70.4v315.733h-315.733z" />
<glyph unicode="" glyph-name="table" d="M768 789.333h-512c-0.254 0.002-0.554 0.003-0.854 0.003-58.29 0-105.572-47.133-105.812-105.367v-514.583c0.241-58.257 47.522-105.39 105.812-105.39 0.3 0 0.6 0.001 0.9 0.004h511.954c58.106 0.241 105.145 47.281 105.387 105.364v514.583c-0.241 58.106-47.281 105.145-105.364 105.387h-0.023zM802.987 438.613h-256v222.72h256zM475.733 438.613h-256v222.72h256zM256 133.973c-0.001 0-0.002 0-0.003 0-19.323 0-34.987 15.664-34.987 34.987 0 0.15 0.001 0.3 0.003 0.449v-0.023 198.827h256v-234.24zM770.56 133.973h-223.573v234.24h256v-198.827c0.002-0.127 0.003-0.277 0.003-0.427 0-19.323-15.664-34.987-34.987-34.987-0.001 0-0.002 0-0.003 0v0z" />
<glyph unicode="" glyph-name="to-do-list" d="M478.72 739.84h417.28v-92.587h-417.28v92.587zM478.72 462.080h417.28v-92.587h-417.28v92.587zM478.72 184.32h417.28v-92.587h-417.28v92.587zM410.453 761.6l-49.067 49.067-114.347-114.347-68.267 68.267-49.067-49.493 117.333-116.907 163.413 163.413zM247.040 418.56l-68.267 68.267-49.067-49.067 117.333-117.333 163.413 163.413-49.067 49.067-114.347-114.347zM247.040 140.8l-68.267 68.267-49.067-49.067 117.333-117.333 163.413 163.413-49.067 49.067-114.347-114.347z" />
<glyph unicode="" glyph-name="add-date" d="M550.4 549.547h-69.973v-139.52h-139.52v-69.547h139.52v-139.947h69.973v139.947h139.52v69.547h-139.52v139.52zM768 774.4h-35.413v57.6h-69.547v-57.6h-302.507v57.6h-69.973v-57.6h-34.56c-0.255 0.002-0.556 0.004-0.857 0.004-56.962 0-103.195-45.936-103.676-102.785v-504.366c0.483-57.129 46.906-103.254 104.103-103.254 0.151 0 0.302 0 0.454 0.001h511.977c0.128-0.001 0.279-0.001 0.43-0.001 57.197 0 103.62 46.126 104.103 103.209v504.366c-0.481 56.894-46.714 102.83-103.677 102.83-0.301 0-0.602-0.001-0.903-0.004h0.046zM768 134.4h-512c-0.001 0-0.002 0-0.003 0-19.173 0-34.743 15.422-34.984 34.537v479.596h581.973v-480c-0.241-19.138-15.811-34.56-34.984-34.56-0.001 0-0.002 0-0.003 0v0z" />
<glyph unicode="" glyph-name="attachment" d="M820.48 769.707c-27.405 24.997-64.023 40.307-104.216 40.307-47.678 0-90.324-21.543-118.735-55.427l-0.196-0.24-269.227-317.867c-16.858-19.904-27.108-45.872-27.108-74.235 0-33.567 14.357-63.781 37.265-84.837l0.083-0.075c18.671-17.104 43.654-27.584 71.085-27.584 32.612 0 61.765 14.813 81.096 38.078l0.139 0.172 222.293 263.253-48.213 42.667-221.867-263.253c-7.885-9.798-19.875-16.014-33.318-16.014-11.405 0-21.765 4.475-29.419 11.764l0.018-0.017c-9.311 8.672-15.116 21.002-15.116 34.688 0 11.498 4.097 22.039 10.912 30.243l-0.063-0.078 267.947 317.867c17.261 20.688 43.052 33.757 71.895 33.757 24.276 0 46.39-9.258 63.004-24.435l-0.072 0.065c19.938-18.661 32.363-45.139 32.363-74.518 0-24.781-8.839-47.497-23.537-65.168l0.134 0.166-318.293-375.893c-26.404-31.634-65.848-51.616-109.96-51.616-37.269 0-71.207 14.264-96.651 37.63l0.104-0.094c-30.511 28.506-49.528 68.982-49.528 113.901 0 37.919 13.552 72.673 36.077 99.682l-0.202-0.249 267.947 318.72 4.267 4.693-47.787 42.667-272.213-320.427c-32.402-38.476-52.091-88.588-52.091-143.298 0-64.722 27.554-123.008 71.572-163.768l0.146-0.133c35.963-33.874 84.38-54.878 137.697-55.466l0.117-0.001h14.507c58.091 4.22 108.944 32.078 143.51 73.895l0.277 0.345 318.293 377.173c24.403 28.93 39.234 66.627 39.234 107.788 0 4.11-0.148 8.185-0.439 12.22l0.031-0.541c-2.402 44.983-22.601 84.824-53.622 112.943l-0.138 0.123z" />
</font></defs></svg> | SVG | 3 | asahiocean/joplin | packages/app-desktop/style/icons/fonts/icomoon.svg | [
"MIT"
] |
live 1.3185761870649397 0.0 0.0 0.0 0.0 0.0 0.0 0.056334474615027837 0.0 1.3185761870649397 0.33774693405321343 0.0 0.0 0.11460338273900378 2.4171884757330493 0.0 0.0 0.0 0.0 0.0 0.0 0.0
ill 0.0 2.5713391555603078 0.0 0.0 0.67421917067442649 0.0 0.0 0.0 0.0 0.0 0.8973627219886362 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
take 0.0 0.0 2.283657083108527 2.0605135317943173 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
attempt 0.0 0.0 1.5905099025485816 1.3673663512343719 0.0 0.0 0.0 0.0 2.283657083108527 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.976804263668472 0.0
recover 0.0 0.0 0.0 0.0 1.3673663512343719 0.0 0.0 0.39280671123624095 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
witness 0.0 0.0 0.0 0.0 0.0 3.2644863361202532 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.5713391555603078 0.0 0.0 0.0 0.0 0.0
fall 0.82213930075104857 0.0 0.0 0.0 1.3229145886635381 1.2276044088592131 0.0 0.0 0.0 0.0 0.0 0.82213930075104857 0.0 1.4099259656531677 0.0 0.0 1.2276044088592131 0.0 0.82213930075104857 0.0 0.0 0.0
die 0.0 0.0 0.62542900650499433 0.0 0.0 0.0 1.3185761870649397 0.3440165470668089 0.0 0.0 1.0308941146131587 0.0 0.0 0.40228545519078468 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
death 0.0 1.185044794440417 0.0 0.67421917067442649 0.0 0.0 0.0 0.0 0.0 0.0 0.8973627219886362 0.0 1.5905099025485816 0.0 0.0 0.0 0.0 2.283657083108527 0.0 2.283657083108527 0.0 0.0
drop_off 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.16966315992203113 0.0 2.3481956042460981 0.0 1.6550484236861527 0.0 0.0 0.0 0.0 0.0 0.0 1.6550484236861527 0.0 0.0 0.0
describe 0.0 0.0 0.0 1.6550484236861527 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.9576335166801981
slip 1.3926841592186616 0.0 0.0 0.0 0.18871135489272575 0.0 0.0 0.82358962732869523 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
en_route 0.0 0.0 0.0 0.0 0.96190124312620739 0.0 0.0 0.0 0.0 0.0 1.185044794440417 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
kill 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.68048878368802179 0.0 0.0 0.49189761388047171 0.0 0.0 0.96190124312620739 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
inexperienced 0.0 2.3481956042460981 0.0 0.0 0.4510756193602169 0.0 0.0 0.0 0.0 0.0 0.67421917067442649 0.0 2.7536607123542622 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Dies 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 5.0562458053483077 0.0 0.0 0.0 0.0 0.0 0.0
rescue 0.0 0.0 1.8781919750003624 1.6550484236861527 0.0 0.0 0.0 0.0 2.5713391555603078 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
experience" 0.0 0.0 0.0 2.0605135317943173 0.0 0.0 0.0 0.39280671123624095 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
walk 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.68048878368802179 0.0 0.0 0.0 2.1658740474521432 0.0 0.0 0.0 0.0 0.0 0.0 2.1658740474521432 0.0 0.0 0.0
think 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0859538917961862 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
it 0.0 0.0 0.0 0.0 2.0605135317943173 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
dead 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0859538917961862 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
climb 0.0 0.0 0.0 0.0 0.0 0.0 4.3630986247883632 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
spend 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.6699514442284173 0.0 0.0 0.0 0.0 0.0
| DM | 0 | tommasoc80/EventStoryLine | ppmi_events_ecb+_test/23/same_sentence_ppmi.dm | [
"CC-BY-3.0"
] |
/*
Copyright © 2011-2013 MLstate
This file is part of Opa.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
type GenChannel.how_send('message, 'serialized) =
{ serialize : 'message -> 'serialized; message : 'message } /
/** Basic send */
{ serialize : 'message -> 'serialized; message : 'message;
herror : -> void; hsuccess : -> void}
/** Send with an error handler and success handler */
#<Ifstatic:OPA_CHANNEL>
/**
* {3 Generic channels}
*/
@private type Actor.t('ctx, 'msg) = external
@private type GenChannel.local('ctx, 'msg, 'ser) =
{local : Actor.t('ctx, 'msg) more:option(black) unserialize:'ser -> option('msg) id:string}
/**
* A generic type of channel.
*/
@abstract type GenChannel.t('ctx, 'msg, 'ser, 'cid) =
GenChannel.local('ctx, 'msg, 'ser)
/ {entity : 'cid}
/**
* Type used for identify a channel
*/
type GenChannel.identity('cid) =
{entity_id : 'cid}
/ {local_id : string}
/**
* A type module used for communicates between several ['entity] of the defined
* network.
*/
type GenChannel.NETWORK('cid, 'entity, 'serialized) = {{
/**
* Should be allows to send a serialized message to a channel identified by
* cid owned by entity.
*/
send : 'entity, 'cid, 'serialized -> void
/**
* Should be allows to send a serialized message with a report.
*/
try_send : 'entity, 'cid, 'serialized -> bool
default_entity : option('entity)
hash_cid : 'cid -> string
equals_cid : 'cid, 'cid -> bool
}}
/**
* A Generic module which defines a channel networks
*/
GenChannel(N:GenChannel.NETWORK('cid, 'entity, 'ser)) = {{
/**
* {3 Private Utils}
*/
/**
* Generate a local identifier.
*/
@private genid = String.fresh(0)
@private error(msg) =
Log.error("CHANNEL", msg)
@private debug(msg) =
Log.debug("CHANNEL", msg)
@private
how_to_report(how:GenChannel.how_send) =
match how with
| ~{herror hsuccess ...} -> {
error = (msg -> do error(msg) Scheduler.push(herror))
success = -> Scheduler.push(hsuccess)
should = true
}
| _ -> {~error success=-> void should=false}
@private
how_to_message(how:GenChannel.how_send) =
match how with
| {~message serialize=_} -> message
| {~message ...} -> message
@private
how_to_serialized(how:GenChannel.how_send) =
match how with
| {~message ~serialize}
| {~message ~serialize ...} -> serialize(message)
@private entity_infos : Hashtbl.t('cid, {owner : 'entity cb : -> void}) =
Hashtbl.make(N.hash_cid, N.equals_cid, 1024)
@private local_infos : Hashtbl.t(string, {id : string cb : -> void}) =
Hashtbl.create(1024)
@private local_channels : Hashtbl.t(string, GenChannel.local) =
Hashtbl.create(1024)
make(
state:'state,
handler:Session.handler('state, 'msg),
unserialize:'ser -> option('msg),
selector:Session.context_selector,
more:option('a)
) : GenChannel.t('ctx, 'msg, 'ser, 'cid) =
llmake(state, _, handler, ctx, more, concurrent) =
id = genid()
ondelete = some(-> remove({local_id = id}))
local = @may_cps(%%BslActor.make%%)(state, handler, ondelete, ctx, concurrent)
more=Option.map(Magic.black, more)
~{local more unserialize id}
Session_private.make_make(state, unserialize, handler, more, selector, llmake)
@private post(ctx:option('ctx), msg:'msg, actor : Actor.t('ctx, 'msg)) =
%%BslActor.post%%(ctx, msg, actor)
send_to_entity(cid, msg, report) =
match
match @atomic(Hashtbl.try_find(entity_infos, cid)) with
| {none} -> N.default_entity
| {some = x} -> some(x.owner)
with
| {none} ->
report.error("Entity channel({cid}) not found: Can't send the message")
| {some = entity} ->
if report.should then
if N.try_send(entity, cid, msg) then report.success()
else report.error("Entity channel({cid}) can't be reached")
else N.send(entity, cid, msg)
/**
* Send a message along a channel
*/
send(ctx:option('ctx),
channel:GenChannel.t('ctx, 'msg, 'ser, 'cid),
how:GenChannel.how_send('msg, 'ser)) =
report = how_to_report(how)
match channel with
| ~{local ...} ->
do post(ctx, how_to_message(how), local)
report.success()
| {entity = cid} -> send_to_entity(cid, how_to_serialized(how), report)
/**
* Forward a message along a channel
*/
forward(ctx : option('ctx),
channel : GenChannel.t('ctx, 'msg, 'ser, 'cid),
msg:'ser,
how:GenChannel.how_send('msg, 'ser)) =
match channel with
| ~{local unserialize id ...} ->
match unserialize(msg) with
| {none} -> error("Error on message unserialization for the local channel({id})")
| {some = msg} -> post(ctx, msg, local)
end
| {entity = cid} -> send_to_entity(cid, msg, how_to_report(how))
remove(ident : GenChannel.identity('cid)) =
match @atomic(
match ident with
| {local_id = id} ->
match Hashtbl.try_find(local_infos, id) with
| {none} -> {}
| {some = {~cb ...}} ->
do Hashtbl.remove(local_infos, id)
~{cb}
end
| {entity_id = cid} ->
match Hashtbl.try_find(entity_infos, cid)
| {none} -> {}
| {some = ~{cb ...}} ->
do Hashtbl.remove(entity_infos, cid)
~{cb}
end
end
) with
| {} -> void
| ~{cb} -> Scheduler.push(cb)
register(cid : 'cid, entity : 'entity) =
@atomic(Hashtbl.add(entity_infos, cid, {owner = entity cb = -> void}))
remove_entity(entity:'entity) =
#<Ifstatic:MLSTATE_SESSION_DEBUG>
do debug("Entity({entity}) removed")
#<End>
// TODO : Reverse index?
LowLevelArray.iter(
{key=cid ~value} -> if entity == value.owner then remove({entity_id = cid})
, Hashtbl.bindings(entity_infos))
find(ident : GenChannel.identity('cid)) : option(channel('a)) =
match ident with
| {local_id = id} ->
match Hashtbl.try_find(local_channels, id) with
| {none} as x ->
do error("Local channel({id}) not found") x
| x -> x <: option(GenChannel.t)
end
| {entity_id = id} ->
match Hashtbl.try_find(entity_infos, id) with
| {none} ->
do error("Entity channel({id}) not found")
{none}
| _ -> {some = {entity = id}}
owner(c:GenChannel.t('ctx, 'msg, 'ser, 'cid)):option('entity) =
match c with
| {entity = id} -> Option.map(_.owner, Hashtbl.try_find(entity_infos, id))
| {local=_ ...} -> none
@private
instantiate(c, id) =
x = Random.string(20) ^ id
#<Ifstatic:MLSTATE_SESSION_DEBUG>
do jlog("Instantiate channel("^id^") as "^x^"")
#<End>
do Hashtbl.add(local_channels, x, c)
x
identify(c:GenChannel.t):GenChannel.identity =
match c with
| {local=_ ~id ...} as c ->
@atomic(
instantiate() = instantiate(c, id)
match Hashtbl.try_find(local_infos, id) with
| {some = ~{id cb}} ->
id =
if id == "" then
x = instantiate()
do Hashtbl.replace(local_infos, id, {id = x ~cb})
x
else id
{local_id = id}
| {none} ->
x = instantiate()
do Hashtbl.add(local_infos, id, {id = x; cb = -> void})
{local_id = x}
)
| {entity = cid} -> {entity_id = cid}
on_remove(channel:GenChannel.t, cb: -> void) =
match channel with
| {local=_ ~id ...} ->
@atomic(
match Hashtbl.try_find(local_infos, id) with
| {some = {cb=cbs ...} as e} ->
Hashtbl.replace(local_infos, id, {e with cb = -> do Scheduler.push(cb) cbs() })
| {none} ->
Hashtbl.add(local_infos, id, {id="" ~cb})
)
| {entity = cid} ->
match @atomic(
match Hashtbl.try_find(entity_infos, cid) with
| {some = {cb=cbs ...} as e} ->
do Hashtbl.replace(entity_infos, cid, {e with cb = -> do Scheduler.push(cb) cbs() })
{}
| {none} -> ~{cb}
) with
| {} -> void
| ~{cb} -> Scheduler.push(cb)
}}
/**
* {3 Opa Network}
*/
type OpaNetwork.cid = {other : string} / {client : string} / {remote /*TODO*/}
type OpaNetwork.entity =
{server}
/ {client : ThreadContext.client}
/ {remote peer /*TODO*/}
/ {remote client /*TODO*/}
type OpaNetwork.msg = RPC.Json.json
/**
* {3 Opa Channel}
*/
@private type Channel.t('msg) = GenChannel.t(ThreadContext.t, 'msg, RPC.Json.json, OpaNetwork.cid)
@private type Channel.identity = GenChannel.identity(OpaNetwork.cid)
@private type Channel.how_send('msg) = GenChannel.how_send('msg, RPC.Json.json)
@abstract type channel('msg) = Channel.t('msg)
@private @publish __send_(client, msg) =
PingRegister.send(client, msg)
@private __unpublish_ = void //TODO OpaRPC_Server.Dispatcher.unpublish(@rpckey(__send_))
@both_implem
Channel = {{
@private error(msg) =
Log.error("OPACHANNEL", msg)
@private lfield = @sliced_expr({client="cl_id" server="srv_id"})
@private ofield = @sliced_expr({client="srv_id" server="cl_id"})
OpaNetwork : GenChannel.NETWORK(OpaNetwork.cid, OpaNetwork.entity, OpaNetwork.msg) = {{
@private
error(msg) = Log.error("OpaNetwork", msg)
@private
serialize_cid : OpaNetwork.cid -> RPC.Json.json=
| ~{other} -> {Record = [(ofield, {String = other})]}
| ~{client} -> {Record = [(lfield, {String = client})]}
| {remote} -> {String = "TODO/REMOTE"}
send(entity:OpaNetwork.entity, cid:OpaNetwork.cid, message:OpaNetwork.msg) =
@sliced_expr({
client =
to = serialize_cid(cid)
msg = {Record = [("to", to), ("message", message:RPC.Json.json)]}
PingClient.async_request("/chan/send", Json.to_string(msg))
server =
match entity with
| {server} -> error("Send to the server entity should not happens")
| ~{client} ->
match cid with
| {remote} -> error("Can't send a message to a remote session to a client")
| {other=_} ->
msg = {Record = [
("type", {String = "chan"}),
("id", serialize_cid(cid)),
("msg", message),
]}
_ = __send_(client, msg)
void
| _ -> error("Send to {cid} is not yet implemented")
end
| _ -> error("Send to {entity} is not yet implemented")
})
try_send(e:OpaNetwork.entity, c:OpaNetwork.cid, m:OpaNetwork.msg) =
// TODO
do send(e, c, m)
true
default_entity = @sliced_expr({client = some({server}) server=none})
hash_cid = OpaValue.to_string : OpaNetwork.cid -> string
equals_cid = `==` : OpaNetwork.cid, OpaNetwork.cid -> bool
}}
@private OpaChannel = GenChannel(OpaNetwork)
client_remove(client, cid) =
cid = {entity_id = {other = cid}}
match OpaChannel.find(cid) with
| {none} -> error("Client({client}) try to remove non-existing channel({cid})")
| {some = chan} ->
match OpaChannel.owner(chan) with
| {some = {client = cli}} ->
if client == cli then OpaChannel.remove(cid)
else error("Client({client}) try to remove channel({cid}) that not owned")
| _ -> error("Client({client}) try to remove client channel({cid})")
find : _ -> option(channel) = OpaChannel.find
make : _, _, _, _, _ -> channel = OpaChannel.make
register = OpaChannel.register
identify = OpaChannel.identify
remove_entity : OpaNetwork.entity -> void = OpaChannel.remove_entity
send(chan : channel('msg), how : Session.how_send('msg)) =
OpaChannel.send(ThreadContext.get_opt({current}), chan, how)
forward = OpaChannel.forward
serialize(channel, _o):RPC.Json.json =
match OpaChannel.identify(channel) with
| {local_id=id} ->
do @sliced_expr({server=void client=PingClient.register_actor(id)})
{Record = [(lfield, {String=id})]}
| {entity_id={other=id}} -> {Record = [(ofield, {String=id})]}
| {entity_id=~{client}} -> {Record = [(lfield, {String=client})]}
| _ -> @fail
unserialize(json:RPC.Json.json):option(channel) =
match json with
| {Record = [(jfield, {String = id})]} ->
if jfield == lfield then
@sliced_expr({
server = OpaChannel.find({local_id = id})
client =
lid = {local_id = id}
match find(lid) with
| {none} ->
cid = {client = id}
do Channel.register({client = id},
{client = ThreadContext.Client.fake})
{some = {entity = cid}}
| channel -> channel
})
else if jfield == ofield then
do @sliced_expr({
client=OpaChannel.register({other = id}, {server})
server=void
})
OpaChannel.find({entity_id = {other = id}})
else do error("Bad JSON fields : {jfield}") {none}
| _ ->
do error("Bad formatted JSON : {json}")
{none}
owner = OpaChannel.owner : channel -> option(OpaNetwork.entity)
is_client(entity:OpaNetwork.entity) = match entity with
| {client=_ ...} -> true
| _ -> false
is_local(c:channel) =
match c with
| {local=_ ...} -> true
| _ -> false
get_more(c:channel) =
match c with
| ~{more ...} -> Option.map(Magic.id, more)
| _ -> none
ordering(c0:channel('msg), c1:channel('msg)) =
match (c0, c1) with
| ({entity={other=id0}}, {entity={other=id1}})
| ({local=_ id=id0 ...}, {local=_ id=id1 ...} ) -> String.ordering(id0, id1)
| ({entity = {remote}}, {entity = {remote}}) -> {eq}
| ({local=_ ...}, {entity=_}) -> {gt}
| ({entity=_}, {local=_ ...}) -> {lt}
| ({entity=e1}, {entity=e2}) -> Order.ordering(e1, e2, Order.default)
order = @nonexpansive(Order.make(ordering))
on_remove(channel:channel, cb) = OpaChannel.on_remove(channel, cb)
}}
ChannelServer = {{
get_id(channel, _client_opt) =
match Channel.identify(channel) with
| ~{local_id} -> some(local_id)
| _ -> none
}}
@private
_registered_event = ClientEvent.register_event({none},
{disconnect},
(client -> Channel.remove_entity(~{client}))
)
#<Else>
@abstract type channel('msg) = Session.private.channel('msg)
@abstract type OpaNetwork.entity = external
Channel = {{
ordering(a:channel, b:channel) = Order.of_int(%%Session.compare_channels%%(a, b))
order = @nonexpansive(Order.make(ordering)) : order(channel('message), Channel.order)
/**
* Low level make channel
*
* Considering an original [state] a function for [unserialize]
* remote message. An [handler] who treat received message with
* the current state. You also can attach any [more] information
* on the created session. [selector] is used for determine in
* which context the [handler] is execute :
* - { maker } -> [handler] is executed with the context of the
* session's creator.
* - { sender } -> [handler] is executed with the context of the
* session's caller.
*
* Note : This features (selector) work only if the session is
* created on the server. Use selector [{maker}] by default unless
* if you are aware what you do.
*/
make(
state : 'st,
handler : Session.handler('state, 'message),
unserialize : RPC.Json.json -> option('msg),
selector : Session.context_selector,
more : option('more)
) : channel =
make = @may_cps(%%Session.llmake%%)(_, _, _, {none}, _, _, _)
Session_private.make_make(state, unserialize, handler, more, selector, make)
send : channel('a), Session.how_send('a) -> void = Session_private.llsend
/**
* {2 Utilities}
*/
/**
* Returns entity which own the given channel
*/
owner(chan : channel) =
bsl = %%Session.owner%%
bsl(chan)
/**
* Return true if the given entity is a client
*/
is_client(entity) =
bsl = %%Session.is_client%%
bsl(entity)
/**
* Returns true if the channel is not owned by this server.
* Beware, this returns false in case of non RemoteClient.
*/
is_remote(chan : channel) =
bsl = %%Session.is_remote%%
bsl(chan)
/**
* Returns true only if the channel is owned by this server.
* Returns false in case of Client.
**/
is_local = %%Session.is_local%% : channel -> bool
/**
* [on_remove_server] For internal use.
*/
@private @server on_remove_server(chan:channel('msg), f:-> void): void =
bp = @may_cps(%%Session.on_remove%%)
: Session.private.native('a, _), (-> void) -> void
bp(chan, f)
/**
* [on_remove_both] For internal use.
*/
@private on_remove_both(chan:channel('msg), f:-> void): void =
bp = @may_cps(%%Session.on_remove%%)
: Session.private.native('a, _), (-> void) -> void
bp(chan, f)
/**
* [on_remove channel f] Execute f when the [channel] is removed
* of this server (no effect on the client).
*/
on_remove(chan:channel('msg), f:-> void): void =
if is_local(chan)
then on_remove_both(chan, f)
else on_remove_server(chan, f)
/**
* {2 Utilities}
*/
/**
* Serialize / Unserialize channel functions
*/
serialize(x:channel('msg), options:OpaSerialize.options) : RPC.Json.json =
x = match options.to_session with
| {none} ->
aux = @may_cps(%%Session.export%%)
ctx = match ThreadContext.get({current}).key with
| {server = _} | {nothing} ->
// This case is on toplelvel javascript serialization.
// Use a client identity which can't be collected.
ThreadContext.Client.fake
| ~{client} -> client
aux(x, ctx)
| {some = entity} ->
aux = @may_cps(%%Session.serialize_for_entity%%)
aux(x, entity)
Option.get_msg(-> "[Session.serialize] Json object malformed",
Json.from_ll_json(x))
unserialize(x : RPC.Json.json) : option(channel('msg)) =
aux = @may_cps(%%Session.unserialize%%)
: option(ThreadContext.t), RPC.Json.private.native -> option(Session.private.native('msg, _))
match aux(ThreadContext.get_opt({current}), Json.to_ll_json(x)) with
| {none} -> do Log.error("[Session][unserialize]","fail") {none}
| {some = r}-> {some = r}
get_more = %% Session.get_more%% : channel -> 'a
}}
ChannelServer = {{
get_id : channel, _ -> option(string) = %%Session.get_server_id%%
}}
#<End>
@comparator(channel('a))
_compare_channel(a:channel('msg), b:channel('msg)) : Order.comparison =
Channel.ordering(a, b) <: Order.comparison
| Opa | 5 | Machiaweliczny/oppailang | lib/stdlib/core/rpc/core/channel.opa | [
"MIT"
] |
(ns hu.lib.maths
(:require [hu.lib.type :refer [array?]]))
(defcurry ^array cross
"Crosses two vectors"
[x y]
(when (array? x)
(if (? (.-length x) 3)
[(- (* (aget x 1) (aget y 2)) (* (aget x 2) (aget y 1)))
(- (* (aget x 2) (aget y 0)) (* (aget x 0) (aget y 2)))
(- (* (aget x 0) (aget y 1)) (* (aget x 1) (aget y 0)))])))
| wisp | 4 | h2non/hu | src/maths.wisp | [
"MIT"
] |
export default 'foobar'
| JavaScript | 0 | blomqma/next.js | test/integration/next-dynamic/apples/index.js | [
"MIT"
] |
#version 300 es
#define SHADER_NAME Tiling-Sprite-100
precision lowp float;
in vec2 vTextureCoord;
out vec4 fragmentColor;
uniform sampler2D uSampler;
uniform vec4 uColor;
uniform mat3 uMapCoord;
uniform vec4 uClampFrame;
uniform vec2 uClampOffset;
void main(void)
{
vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
coord = (uMapCoord * vec3(coord, 1.0)).xy;
vec2 unclamped = coord;
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
fragmentColor = texSample * uColor;
}
| GLSL | 4 | fanlistener/pixijs | packages/sprite-tiling/src/sprite-tiling.frag | [
"MIT"
] |
/* Copyright (c) 2017-2019 Netronome Systems, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <single_ctx_test.uc>
#include "pkt_ipv6_ipv6_lso_vxlan_tcp_x80.uc"
#include <config.h>
#include <global.uc>
#include <pv.uc>
#include <stdmac.uc>
#define PV_TEST_SIZE_LW (PV_SIZE_LW/2)
.sig s
.reg addrlo
.reg addrhi
.reg value
.reg expected[24]
.reg volatile write $out_nfd_desc[NFD_IN_META_SIZE_LW]
.xfer_order $out_nfd_desc
.reg volatile read $in_nfd_desc[NFD_IN_META_SIZE_LW]
.xfer_order $in_nfd_desc
.reg read $pkt_rd[24]
.xfer_order $pkt_rd
#define_eval _PV_OUTER_L3_OFFSET (14)
#define_eval _PV_OUTER_L4_OFFSET (14 + 40)
#define_eval _PV_INNER_L3_OFFSET (14 + 40 + 8 + 8 + 14)
#define_eval _PV_INNER_L4_OFFSET (14 + 40 + 8 + 8 + 14 + 40)
move(addrlo, 0x2000)
alu[$out_nfd_desc[0], --, B, 0]
alu[$out_nfd_desc[1], --, B, 0]
move(value, 0x06020001) // TX_LSO = ENCAP = 1, lso seq cnt = 2, mss = 1
alu[$out_nfd_desc[2], --, B, value]
alu[$out_nfd_desc[3], --, B, 0]
// write out nfd descriptor
mem[write32, $out_nfd_desc[0], 0, <<8, addrlo, NFD_IN_META_SIZE_LW], ctx_swap[s]
// read in nfd descriptor
mem[read32, $in_nfd_desc[0], 0, <<8, addrlo, NFD_IN_META_SIZE_LW], ctx_swap[s]
// pv_init_nfd() does this
pv_seek(pkt_vec, ETH_MAC_SIZE, PV_SEEK_INIT)
move(pkt_vec[3], PROTO_IPV6_UDP_VXLAN_IPV6_TCP)
move(pkt_vec[5], ((_PV_OUTER_L3_OFFSET << 24) | (_PV_OUTER_L4_OFFSET << 16) | \
(_PV_INNER_L3_OFFSET << 8) | (_PV_INNER_L4_OFFSET << 0)))
__pv_lso_fixup(pkt_vec, $in_nfd_desc, lso_done#, error#)
error#:
test_fail()
lso_done#:
// Check PV
aggregate_zero(expected, PV_SIZE_LW)
move(expected[0], 0xb4)
move(expected[1], 0x13000000)
move(expected[2], 0x80)
move(expected[3], PROTO_IPV6_UDP_VXLAN_IPV6_TCP)
move(expected[4], 0x0)
move(expected[5], ((_PV_OUTER_L3_OFFSET << 24) | (_PV_OUTER_L4_OFFSET << 16) | \
(_PV_INNER_L3_OFFSET << 8) | (_PV_INNER_L4_OFFSET << 0)))
#define_eval _PV_CHK_LOOP 0
#while (_PV_CHK_LOOP < PV_TEST_SIZE_LW)
#define_eval _PKT_VEC 'pkt_vec[/**/_PV_CHK_LOOP/**/]'
move(value, _PKT_VEC)
#define_eval _PV_INIT_EXPECT 'expected[/**/_PV_CHK_LOOP/**/]'
test_assert_equal(value, _PV_INIT_EXPECT)
#define_eval _PV_CHK_LOOP (_PV_CHK_LOOP + 1)
#endloop
// Check Outer Ethernet hdr and first 2 bytes of Outer IPv6 hdr
move(expected[0], 0x00154d0a)
move(expected[1], 0x0d1a6805)
move(expected[2], 0xca306ab8)
move(expected[3], 0x86dd6aaa)
move(addrlo, 0x80)
move(addrhi, ((0x13000000 << 3) & 0xffffffff))
mem[read32, $pkt_rd[0], addrhi, <<8, addrlo, 4], ctx_swap[s]
#define_eval _PV_CHK_LOOP 0
#while (_PV_CHK_LOOP <= 3)
#define_eval _PKT_VEC '$pkt_rd[/**/_PV_CHK_LOOP/**/]'
move(value, _PKT_VEC)
#define_eval _PKT_EXPECT 'expected[/**/_PV_CHK_LOOP/**/]'
test_assert_equal(value, _PKT_EXPECT)
#define_eval _PV_CHK_LOOP (_PV_CHK_LOOP + 1)
#endloop
// Check Outer IPv6 hdr, Outer UDP hdr, VXLAN hdr
move(expected[0], 0x6aaaaaaa)
move(expected[1], 0x007e11ff) // Total Length = PV Packet Length(0xb4) - (14 + 40)
move(expected[2], 0xfe800000)
move(expected[3], 0x00000000)
move(expected[4], 0x02000bff)
move(expected[5], 0xfe000300)
move(expected[6], 0x35555555)
move(expected[7], 0x66666666)
move(expected[8], 0x77777777)
move(expected[9], 0x88888888)
move(expected[10], 0xd87e12b5) // Outer UDP hdr starts here
move(expected[11], 0x007e0000) // Length = PV Packet Length(0xb4) - (14 + 40)
move(expected[12], 0x08000000) // VXLAN hdr starts here
move(expected[13], 0xffffff00)
alu[addrlo, addrlo, +, ((2*8)-2)]
// nfp6000 indirect format requires 1 less
alu[value, --, B, 13, <<8]
alu[--, value, OR, 1, <<7]
mem[read32, $pkt_rd[0], addrhi, <<8, addrlo, max_14], ctx_swap[s], indirect_ref
#define_eval _PV_CHK_LOOP 0
#while (_PV_CHK_LOOP <= 13)
#define_eval _PKT_VEC '$pkt_rd[/**/_PV_CHK_LOOP/**/]'
move(value, _PKT_VEC)
#define_eval _PKT_EXPECT 'expected[/**/_PV_CHK_LOOP/**/]'
test_assert_equal(value, _PKT_EXPECT)
#define_eval _PV_CHK_LOOP (_PV_CHK_LOOP + 1)
#endloop
// Check Inner Ethernet hdr and first 2 bytes of Inner IPv6 hdr
move(expected[0], 0x404d8e6f)
move(expected[1], 0x97ad001e)
move(expected[2], 0x101f0001)
move(expected[3], 0x86dd6555)
alu[addrlo, addrlo, +, (40+8+8)]
mem[read32, $pkt_rd[0], addrhi, <<8, addrlo, 4], ctx_swap[s]
#define_eval _PV_CHK_LOOP 0
#while (_PV_CHK_LOOP <= 3)
#define_eval _PKT_VEC '$pkt_rd[/**/_PV_CHK_LOOP/**/]'
move(value, _PKT_VEC)
#define_eval _PKT_EXPECT 'expected[/**/_PV_CHK_LOOP/**/]'
test_assert_equal(value, _PKT_EXPECT)
#define_eval _PV_CHK_LOOP (_PV_CHK_LOOP + 1)
#endloop
// Check Inner IPv6 hdr, Inner TCP hdr, Payload
move(expected[0], 0x65555555)
move(expected[1], 0x003806ff) // Total Length = PV Packet Length(0xb4) - (14+40+8+8+14+40)
move(expected[2], 0xfe800000)
move(expected[3], 0x00000000)
move(expected[4], 0x02000bff)
move(expected[5], 0xfe000300)
move(expected[6], 0x35555555)
move(expected[7], 0x66666666)
move(expected[8], 0x77777777)
move(expected[9], 0x88888888)
move(expected[10], 0xcb580050) // TCP hdr starts here
move(expected[11], 0xea8d9a11) // Seq num = 0xea8d9a11 (TCP_SEQ += (mss * (lso_seq - 1)))
move(expected[12], 0xffffffff)
move(expected[13], 0x51f2ffff) // LSO_END = 0, so clear FIN, RST, PSH
move(expected[14], 0xffffffff)
move(expected[15], 0x97ae878f)
move(expected[16], 0x08377a4d)
move(expected[17], 0x85a1fec4)
move(expected[18], 0x97a27c00)
move(expected[19], 0x784648ea)
move(expected[20], 0x31ab0538)
move(expected[21], 0xac9ca16e)
move(expected[22], 0x8a809e58)
move(expected[23], 0xa6ffc15f)
alu[addrlo, addrlo, +, 14]
// nfp6000 indirect format requires 1 less
alu[value, --, B, 23, <<8]
alu[--, value, OR, 1, <<7]
mem[read32, $pkt_rd[0], addrhi, <<8, addrlo, max_24], ctx_swap[s], indirect_ref
#define_eval _PV_CHK_LOOP 0
#while (_PV_CHK_LOOP <= 23)
#define_eval _PKT_VEC '$pkt_rd[/**/_PV_CHK_LOOP/**/]'
move(value, _PKT_VEC)
#define_eval _PKT_EXPECT 'expected[/**/_PV_CHK_LOOP/**/]'
test_assert_equal(value, _PKT_EXPECT)
#define_eval _PV_CHK_LOOP (_PV_CHK_LOOP + 1)
#endloop
test_pass()
PV_SEEK_SUBROUTINE#:
pv_seek_subroutine(pkt_vec)
| UnrealScript | 3 | pcasconnetronome/nic-firmware | test/datapath/pv_lso_fixup_ipv6_ipv6_vxlan_test.uc | [
"BSD-2-Clause"
] |
grammar Query;
AND : 'and';
OR : 'or';
// comparison operators
EQ : '=';
CONTAINS : '~';
GT : '>';
GTE : '>=';
LT : '<';
LTE : '<=';
WS : [ \t\r\n]+ -> skip;
INT : '-'? [0-9]+ ;
FLOAT : '-'? [0-9]+'.'[0-9]+;
STRING : '"' .*? '"';
UNIT_SIZE : 'kb' | 'mb' | 'gb';
UNIT_SPEED : 'kbps' | 'mbps' | 'gbps';
ID : [a-zA-Z]+;
filter
: expression
;
expression
: expression AND expression #AndExpression
| expression OR expression #OrExpression
| predicate #PredicateExpression
;
reference: ID;
predicate
: reference oper value #OperatorPredicate
;
oper
: EQ
| CONTAINS
| GT
| GTE
| LT
| LTE
;
value
: INT WS? UNIT_SIZE?
| INT WS? UNIT_SPEED?
| FLOAT WS? UNIT_SIZE?
| FLOAT WS? UNIT_SPEED?
| STRING
;
| ANTLR | 4 | theRealBaccata/picotorrent | src/pql/Query.g4 | [
"MIT"
] |
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2021 Intel Corporation
#include "gstreamer_pipeline_facade.hpp"
#include "gstreamerpipeline_priv.hpp"
#include <opencv2/gapi/streaming/gstreamer/gstreamerpipeline.hpp>
#ifdef HAVE_GSTREAMER
#include <gst/app/gstappsink.h>
#endif // HAVE_GSTREAMER
namespace cv {
namespace gapi {
namespace wip {
namespace gst {
#ifdef HAVE_GSTREAMER
GStreamerPipeline::Priv::Priv(const std::string& pipelineDesc):
m_pipeline(std::make_shared<GStreamerPipelineFacade>(pipelineDesc))
{
std::vector<GstElement*> appsinks =
m_pipeline->getElementsByFactoryName("appsink");
for (std::size_t i = 0ul; i < appsinks.size(); ++i)
{
auto* appsink = appsinks[i];
GAPI_Assert(appsink != nullptr);
GStreamerPtr<gchar> name(gst_element_get_name(appsink));
auto result = m_appsinkNamesToUse.insert({ name.get(), true /* free */ });
GAPI_Assert(std::get<1>(result) && "Each appsink name must be unique!");
}
}
IStreamSource::Ptr GStreamerPipeline::Priv::getStreamingSource(
const std::string& appsinkName, const GStreamerSource::OutputType outputType)
{
auto appsinkNameIt = m_appsinkNamesToUse.find(appsinkName);
if (appsinkNameIt == m_appsinkNamesToUse.end())
{
cv::util::throw_error(std::logic_error(std::string("There is no appsink element in the "
"pipeline with the name '") + appsinkName + "'."));
}
if (!appsinkNameIt->second)
{
cv::util::throw_error(std::logic_error(std::string("appsink element with the name '") +
appsinkName + "' has been already used to create a GStreamerSource!"));
}
m_appsinkNamesToUse[appsinkName] = false /* not free */;
IStreamSource::Ptr src;
try {
src = cv::gapi::wip::make_src<cv::gapi::wip::GStreamerSource>(m_pipeline, appsinkName,
outputType);
}
catch(...) {
m_appsinkNamesToUse[appsinkName] = true; /* free */
cv::util::throw_error(std::runtime_error(std::string("Error during creation of ") +
"GStreamerSource on top of '" + appsinkName + "' appsink element!"));
}
return src;
}
GStreamerPipeline::Priv::~Priv() { }
#else // HAVE_GSTREAMER
GStreamerPipeline::Priv::Priv(const std::string&)
{
GAPI_Assert(false && "Built without GStreamer support!");
}
IStreamSource::Ptr GStreamerPipeline::Priv::getStreamingSource(const std::string&,
const GStreamerSource::OutputType)
{
// No need an assert here. The assert raise C4702 warning. Constructor have already got assert.
return nullptr;
}
GStreamerPipeline::Priv::~Priv()
{
// No need an assert here. The assert raise C4722 warning. Constructor have already got assert.
}
#endif // HAVE_GSTREAMER
GStreamerPipeline::GStreamerPipeline(const std::string& pipelineDesc):
m_priv(new Priv(pipelineDesc)) { }
IStreamSource::Ptr GStreamerPipeline::getStreamingSource(
const std::string& appsinkName, const GStreamerSource::OutputType outputType)
{
return m_priv->getStreamingSource(appsinkName, outputType);
}
GStreamerPipeline::~GStreamerPipeline()
{ }
GStreamerPipeline::GStreamerPipeline(std::unique_ptr<Priv> priv):
m_priv(std::move(priv))
{ }
} // namespace gst
} // namespace wip
} // namespace gapi
} // namespace cv
| C++ | 4 | pazamelin/openvino | thirdparty/fluid/modules/gapi/src/streaming/gstreamer/gstreamerpipeline.cpp | [
"Apache-2.0"
] |
a ← ⍳ 4
b ← a / a ⍝ --> 1 2 2 3 3 3 4 4 4 4
+/ b ⍝ --> 30
| APL | 3 | melsman/apltail | tests/replicate.apl | [
"MIT"
] |
use BlockDist;
var Space = {1..10};
var BlockSpace = Space dmapped Block(boundingBox=Space);
var BA: [BlockSpace] int;
for ba in BA do ba = here.id;
writeln("Locales running for iterations");
writeln(BA);
| Chapel | 3 | jhh67/chapel | test/users/ferguson/distributed_for.chpl | [
"ECL-2.0",
"Apache-2.0"
] |
:mod:`plistlib` --- Generate and parse Apple ``.plist`` files
=============================================================
.. module:: plistlib
:synopsis: Generate and parse Apple plist files.
.. moduleauthor:: Jack Jansen
.. sectionauthor:: Georg Brandl <[email protected]>
.. (harvested from docstrings in the original file)
**Source code:** :source:`Lib/plistlib.py`
.. index::
pair: plist; file
single: property list
--------------
This module provides an interface for reading and writing the "property list"
files used by Apple, primarily on macOS and iOS. This module supports both binary
and XML plist files.
The property list (``.plist``) file format is a simple serialization supporting
basic object types, like dictionaries, lists, numbers and strings. Usually the
top level object is a dictionary.
To write out and to parse a plist file, use the :func:`dump` and
:func:`load` functions.
To work with plist data in bytes objects, use :func:`dumps`
and :func:`loads`.
Values can be strings, integers, floats, booleans, tuples, lists, dictionaries
(but only with string keys), :class:`bytes`, :class:`bytearray`
or :class:`datetime.datetime` objects.
.. versionchanged:: 3.4
New API, old API deprecated. Support for binary format plists added.
.. versionchanged:: 3.8
Support added for reading and writing :class:`UID` tokens in binary plists as used
by NSKeyedArchiver and NSKeyedUnarchiver.
.. versionchanged:: 3.9
Old API removed.
.. seealso::
`PList manual page <https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/PropertyLists/>`_
Apple's documentation of the file format.
This module defines the following functions:
.. function:: load(fp, *, fmt=None, dict_type=dict)
Read a plist file. *fp* should be a readable and binary file object.
Return the unpacked root object (which usually is a
dictionary).
The *fmt* is the format of the file and the following values are valid:
* :data:`None`: Autodetect the file format
* :data:`FMT_XML`: XML file format
* :data:`FMT_BINARY`: Binary plist format
The *dict_type* is the type used for dictionaries that are read from the
plist file.
XML data for the :data:`FMT_XML` format is parsed using the Expat parser
from :mod:`xml.parsers.expat` -- see its documentation for possible
exceptions on ill-formed XML. Unknown elements will simply be ignored
by the plist parser.
The parser for the binary format raises :exc:`InvalidFileException`
when the file cannot be parsed.
.. versionadded:: 3.4
.. function:: loads(data, *, fmt=None, dict_type=dict)
Load a plist from a bytes object. See :func:`load` for an explanation of
the keyword arguments.
.. versionadded:: 3.4
.. function:: dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False)
Write *value* to a plist file. *Fp* should be a writable, binary
file object.
The *fmt* argument specifies the format of the plist file and can be
one of the following values:
* :data:`FMT_XML`: XML formatted plist file
* :data:`FMT_BINARY`: Binary formatted plist file
When *sort_keys* is true (the default) the keys for dictionaries will be
written to the plist in sorted order, otherwise they will be written in
the iteration order of the dictionary.
When *skipkeys* is false (the default) the function raises :exc:`TypeError`
when a key of a dictionary is not a string, otherwise such keys are skipped.
A :exc:`TypeError` will be raised if the object is of an unsupported type or
a container that contains objects of unsupported types.
An :exc:`OverflowError` will be raised for integer values that cannot
be represented in (binary) plist files.
.. versionadded:: 3.4
.. function:: dumps(value, *, fmt=FMT_XML, sort_keys=True, skipkeys=False)
Return *value* as a plist-formatted bytes object. See
the documentation for :func:`dump` for an explanation of the keyword
arguments of this function.
.. versionadded:: 3.4
The following classes are available:
.. class:: UID(data)
Wraps an :class:`int`. This is used when reading or writing NSKeyedArchiver
encoded data, which contains UID (see PList manual).
It has one attribute, :attr:`data`, which can be used to retrieve the int value
of the UID. :attr:`data` must be in the range ``0 <= data < 2**64``.
.. versionadded:: 3.8
The following constants are available:
.. data:: FMT_XML
The XML format for plist files.
.. versionadded:: 3.4
.. data:: FMT_BINARY
The binary format for plist files
.. versionadded:: 3.4
Examples
--------
Generating a plist::
pl = dict(
aString = "Doodah",
aList = ["A", "B", 12, 32.1, [1, 2, 3]],
aFloat = 0.1,
anInt = 728,
aDict = dict(
anotherString = "<hello & hi there!>",
aThirdString = "M\xe4ssig, Ma\xdf",
aTrueValue = True,
aFalseValue = False,
),
someData = b"<binary gunk>",
someMoreData = b"<lots of binary gunk>" * 10,
aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
)
with open(fileName, 'wb') as fp:
dump(pl, fp)
Parsing a plist::
with open(fileName, 'rb') as fp:
pl = load(fp)
print(pl["aKey"])
| reStructuredText | 5 | oleksandr-pavlyk/cpython | Doc/library/plistlib.rst | [
"0BSD"
] |
'seq' '60 62 64 67' gen_vals
1 metro 0 'seq' tseq mtof 0.1 sine
| SourcePawn | 2 | aleatoricforest/Sporth | examples/tseq.sp | [
"MIT"
] |
size: 3600px 1920px;
dpi: 400;
legend {
border: none;
margin: 0;
item {
label: "北京市 (Beijing)";
color: #06c;
}
item {
label: "תל אביב (Tel Aviv)";
color: #c06;
}
item {
label: "القاهرة (Cairo)";
color: #c06;
}
item {
label: "Москва";
color: #60c;
}
item {
label: "東京都 (Tokyo)";
color: #6c0;
}
item {
label: "서울 (Seoul)";
}
}
| CLIPS | 2 | asmuth-archive/travistest | test/examples/charts_custom_text_i18n.clp | [
"Apache-2.0"
] |
stocks
load aa
fa
fmp
profile -h
quote -h
enterprise -h
dcf -h
income -h
balance -h
cash -h
metrics -h
ratios -h
growth -h
profile
quote
enterprise
dcf
income
balance
cash
metrics
ratios
growth
..
load aapl
fmp
profile
quote
enterprise
dcf
income
balance
cash
metrics
ratios
growth
exit | Gosu | 2 | minhhoang1023/GamestonkTerminal | scripts/test_stocks_fa_fmp.gst | [
"MIT"
] |
cluster1:10:5001
cluster2:1:5002
| Octave | 0 | ADanayi/openCOT | Controller/init/init_clusters.oct | [
"MIT"
] |
.class public stack_var8
.super java/lang/Object
.field private n I
.method public <init>()V
.limit stack 5
aload_0
invokenonvirtual java/lang/Object/<init>()V
aload_0
iconst_0
putfield stack_var8/n I
return
.end method
.method public f()I
.limit stack 8
.limit locals 5
aload_0
getfield stack_var8/n I
aload_0
iconst_1
putfield stack_var8/n I
ireturn
.end method
| Jasmin | 4 | mauguignard/cbmc | jbmc/regression/jbmc/stack_var8/stack_var8.j | [
"BSD-4-Clause"
] |
"""The microsoft_face_identify component."""
| Python | 0 | domwillcode/home-assistant | homeassistant/components/microsoft_face_identify/__init__.py | [
"Apache-2.0"
] |
"This module has a docstring.
It covers multiple lines, too!
"
(setv a 1)
| Hy | 1 | josephwillard/hy | tests/resources/importer/docstring.hy | [
"MIT"
] |
(assert (=
(sha256 (bytes "abc"))
[ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad])
)
(assert (=
(sha256 (bytes "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"))
[248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1])
)
(assert (=
(sha256 (* (bytes "a") 1000000))
[cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0])
)
(assert (=
(sha256 (bytes "The quick brown fox jumps over the lazy dog"))
[d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592])
)
(assert (=
(sha256 (bytes "The quick brown fox jumps over the lazy cog"))
[e4c4d8f3bf76b692de791a173e05321150f7a345b46484fe427f6acc7ecc81be])
)
(assert (=
(sha256 [])
[e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855])
)
(assert (=
(hmac-sha256 (* [0b] 20) (bytes "Hi There"))
[b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7])
)
(assert (=
(hmac-sha256 (bytes "Jefe") (bytes "what do ya want for nothing?"))
[5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843])
)
(assert (=
(hmac-sha256 (* [aa] 20) (* [dd] 50))
[773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe])
)
(assert (=
(hmac-sha256 [0102030405060708090a0b0c0d0e0f10111213141516171819] (* [cd] 50))
[82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b])
)
(assert (=
(hmac-sha256 (* [aa] 131) (bytes "Test Using Larger Than Block-Size Key - Hash Key First"))
[60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54])
)
(assert (=
(hmac-sha256 (* [aa] 131) (bytes "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm."))
[9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2])
)
(puts success)
| Slash | 5 | Leo-Neat/h2o | deps/picotls/deps/cifra/shitlisp/test-sha256.sl | [
"MIT"
] |
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Algernon
GenericName=Web Server
Comment=QUIC Web Server with Lua, Markdown and Pongo2 support
Exec=algernon -m
Icon=markdown
Terminal=false
StartupNotify=false
Categories=Application;
MimeType=text/markdown;
NoDisplay=true
| desktop | 2 | HarshCasper/algernon | desktop/algernon_md.desktop | [
"MIT"
] |
; CLW file contains information for the MFC ClassWizard
[General Info]
Version=1
LastClass=CMineWnd
LastTemplate=CDialog
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "mine.h"
LastPage=0
ClassCount=5
Class1=CDlgCustom
Class2=CDlgHero
Class3=CDlgNewRecord
Class4=CMineApp
Class5=CMineWnd
ResourceCount=4
Resource1=IDR_MENU
Resource2=IDD_DLG_HERO
Resource3=IDD_DLG_NEWRECORD
Resource4=IDD_DLG_CUSTOM
[CLS:CDlgCustom]
Type=0
BaseClass=CDialog
HeaderFile=DlgCustom.h
ImplementationFile=DlgCustom.cpp
Filter=D
LastObject=IDCANCEL
[CLS:CDlgHero]
Type=0
BaseClass=CDialog
HeaderFile=DlgHero.h
ImplementationFile=DlgHero.cpp
LastObject=CDlgHero
[CLS:CDlgNewRecord]
Type=0
BaseClass=CDialog
HeaderFile=DlgNewRecord.h
ImplementationFile=DlgNewRecord.cpp
LastObject=CDlgNewRecord
[CLS:CMineApp]
Type=0
BaseClass=CWinApp
HeaderFile=Mine.h
ImplementationFile=Mine.cpp
LastObject=CMineApp
[CLS:CMineWnd]
Type=0
BaseClass=CWnd
HeaderFile=MineWnd.h
ImplementationFile=MineWnd.cpp
LastObject=CMineWnd
Filter=W
[DLG:IDD_DLG_CUSTOM]
Type=1
Class=CDlgCustom
ControlCount=8
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_STATIC,static,1342308865
Control4=IDC_STATIC,static,1342308865
Control5=IDC_STATIC,static,1342308865
Control6=IDC_HEIGHT,edit,1350631552
Control7=IDC_WIDTH,edit,1350631552
Control8=IDC_NUMBER,edit,1350631552
[DLG:IDD_DLG_HERO]
Type=1
Class=CDlgHero
ControlCount=11
Control1=IDOK,button,1342242817
Control2=IDC_RESET,button,1342242816
Control3=IDC_STATIC,static,1342308353
Control4=IDC_B_R,static,1342308353
Control5=IDC_STATIC,static,1342308353
Control6=IDC_I_R,static,1342308353
Control7=IDC_STATIC,static,1342308353
Control8=IDC_E_R,static,1342308353
Control9=IDC_B_H,static,1342308353
Control10=IDC_I_H,static,1342308353
Control11=IDC_E_H,static,1342308353
[DLG:IDD_DLG_NEWRECORD]
Type=1
Class=CDlgNewRecord
ControlCount=3
Control1=IDC_EDIT_NAME,edit,1350631552
Control2=IDOK,button,1342242817
Control3=IDC_DESCRIBE,static,1342308353
[MNU:IDR_MENU]
Type=1
Class=?
Command1=IDM_START
Command2=IDM_PRIMARY
Command3=IDM_SECOND
Command4=IDM_ADVANCE
Command5=IDM_CUSTOM
Command6=IDM_MARK
Command7=IDM_COLOR
Command8=IDM_SOUND
Command9=IDM_HERO
Command10=IDM_EXIT
Command11=IDM_HELP_USE
Command12=IDM_ABOUT
CommandCount=12
| Clarion | 3 | gxw1/review_the_national_post-graduate_entrance_examination | books_and_notes/professional_courses/computer_organization_and_architecture/sources/lab/Skyblue_Mine/Mine.clw | [
"MIT"
] |
--TEST--
Test fscanf() function: usage variations - objects
--FILE--
<?php
/* Test fscanf() to scan a file to read objects */
$file_path = __DIR__;
echo "*** Test fscanf(): to read objects from a file ***\n";
// declare a class
class foo
{
public $var1 = 1;
public $var2 = 2;
function __toString() {
return "Object";
}
}
// create an object
$obj = new foo(); //creating new object
// create a file
$filename = "$file_path/fscanf_variation54.tmp";
$file_handle = fopen($filename, "w");
if($file_handle == false)
exit("Error:failed to open file $filename");
//writing object to the file
fwrite($file_handle, $obj);
//closing the file
fclose($file_handle);
// various formats
$formats = array( "%d", "%f", "%e", "%u", " %s", "%x", "%o");
$counter = 1;
// opening file for read
$file_handle = fopen($filename, "r");
if($file_handle == false) {
exit("Error:failed to open file $filename");
}
echo "\n-- iteration $counter --\n";
foreach($formats as $format) {
var_dump( fscanf($file_handle,$format) );
rewind($file_handle);
}
fclose($file_handle);
echo "\n*** Done ***";
?>
--CLEAN--
<?php
$file_path = __DIR__;
$filename = "$file_path/fscanf_variation54.tmp";
unlink($filename);
?>
--EXPECT--
*** Test fscanf(): to read objects from a file ***
-- iteration 1 --
array(1) {
[0]=>
NULL
}
array(1) {
[0]=>
NULL
}
array(1) {
[0]=>
NULL
}
array(1) {
[0]=>
NULL
}
array(1) {
[0]=>
string(6) "Object"
}
array(1) {
[0]=>
NULL
}
array(1) {
[0]=>
NULL
}
*** Done ***
| PHP | 5 | NathanFreeman/php-src | ext/standard/tests/file/fscanf_variation54.phpt | [
"PHP-3.01"
] |
;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
;;;; Code from Paradigms of AI Programming
;;;; Copyright (c) 1991 Peter Norvig
;;;; File waltz.lisp: Line-labeling using Waltz filtering.
(defstruct diagram "A diagram is a list of vertexes." vertexes)
(defstruct (vertex (:print-function print-vertex))
(name nil :type atom)
(type 'L :type (member L Y W T))
(neighbors nil :type list) ; of vertex
(labelings nil :type list)) ; of lists of (member + - L R)))))
(defun ambiguous-vertex-p (vertex)
"A vertex is ambiguous if it has more than one labeling."
(> (number-of-labelings vertex) 1))
(defun number-of-labelings (vertex)
(length (vertex-labelings vertex)))
(defun impossible-vertex-p (vertex)
"A vertex is impossible if it has no labeling."
(null (vertex-labelings vertex)))
(defun impossible-diagram-p (diagram)
"An impossible diagram is one with an impossible vertex."
(some #'impossible-vertex-p (diagram-vertexes diagram)))
(defun possible-labelings (vertex-type)
"The list of possible labelings for a given vertex type."
;; In these labelings, R means an arrow pointing away from
;; the vertex, L means an arrow pointing towards it.
(case vertex-type
((L) '((R L) (L R) (+ R) (L +) (- L) (R -)))
((Y) '((+ + +) (- - -) (L R -) (- L R) (R - L)))
((T) '((R L +) (R L -) (R L L) (R L R)))
((W) '((L R +) (- - +) (+ + -)))))
(defun print-labelings (diagram)
"Label the diagram by propagating constraints and then
searching for solutions if necessary. Print results."
(show-diagram diagram "~&The initial diagram is:")
(every #'propagate-constraints (diagram-vertexes diagram))
(show-diagram diagram
"~2&After constraint propagation the diagram is:")
(let* ((solutions (if (impossible-diagram-p diagram)
nil
(search-solutions diagram)))
(n (length solutions)))
(unless (= n 1)
(format t "~2&There are ~r solution~:p:" n)
(mapc #'show-diagram solutions)))
(values))
(defun propagate-constraints (vertex)
"Reduce the labelings on vertex by considering neighbors.
If we can reduce, propagate the constraints to each neighbor."
;; Return nil only when the constraints lead to an impossibility
(let ((old-num (number-of-labelings vertex)))
(setf (vertex-labelings vertex) (consistent-labelings vertex))
(unless (impossible-vertex-p vertex)
(when (< (number-of-labelings vertex) old-num)
(every #'propagate-constraints (vertex-neighbors vertex)))
t)))
(defun consistent-labelings (vertex)
"Return the set of labelings that are consistent with neighbors."
(let ((neighbor-labels
(mapcar #'(lambda (neighbor) (labels-for neighbor vertex))
(vertex-neighbors vertex))))
;; Eliminate labelings that don't have all lines consistent
;; with the corresponding line's label from the neighbor.
;; Account for the L-R mismatch with reverse-label.
(find-all-if
#'(lambda (labeling)
(every #'member (mapcar #'reverse-label labeling)
neighbor-labels))
(vertex-labelings vertex))))
(defun search-solutions (diagram)
"Try all labelings for one ambiguous vertex, and propagate."
;; If there is no ambiguous vertex, return the diagram.
;; If there is one, make copies of the diagram trying each of
;; the possible labelings. Propagate constraints and append
;; all the solutions together.
(let ((v (find-if #'ambiguous-vertex-p
(diagram-vertexes diagram))))
(if (null v)
(list diagram)
(mapcan
#'(lambda (v-labeling)
(let* ((diagram2 (make-copy-diagram diagram))
(v2 (find-vertex (vertex-name v) diagram2)))
(setf (vertex-labelings v2) (list v-labeling))
(if (propagate-constraints v2)
(search-solutions diagram2)
nil)))
(vertex-labelings v)))))
(defun labels-for (vertex from)
"Return all the labels for the line going to vertex."
(let ((pos (position from (vertex-neighbors vertex))))
(mapcar #'(lambda (labeling) (nth pos labeling))
(vertex-labelings vertex))))
(defun reverse-label (label)
"Account for the fact that one vertex's right is another's left."
(case label (L 'R) (R 'L) (otherwise label)))
(defun find-vertex (name diagram)
"Find the vertex in the given diagram with the given name."
(find name (diagram-vertexes diagram) :key #'vertex-name))
(defun print-vertex (vertex stream depth)
"Print a vertex in the short form."
(declare (ignore depth))
(format stream "~a/~d" (vertex-name vertex)
(number-of-labelings vertex))
vertex)
(defun show-vertex (vertex &optional (stream t))
"Print a vertex in a long form, on a new line."
(format stream "~& ~a ~d:" vertex (vertex-type vertex))
(mapc #'(lambda (neighbor labels)
(format stream " ~a~a=[~{~a~}]" (vertex-name vertex)
(vertex-name neighbor) labels))
(vertex-neighbors vertex)
(matrix-transpose (vertex-labelings vertex)))
(values))
(defun show-diagram (diagram &optional (title "~2&Diagram:")
(stream t))
"Print a diagram in a long form. Include a title."
(format stream title)
(mapc #'show-vertex (diagram-vertexes diagram))
(let ((n (reduce #'* (mapcar #'number-of-labelings
(diagram-vertexes diagram)))))
(when (> n 1)
(format stream "~&For ~:d interpretation~:p." n))
(values)))
(defun matrix-transpose (matrix)
"Turn a matrix on its side."
(if matrix (apply #'mapcar #'list matrix)))
(let ((diagrams (make-hash-table)))
(defun diagram (name)
"Get a fresh copy of the diagram with this name."
(make-copy-diagram (gethash name diagrams)))
(defun put-diagram (name diagram)
"Store a diagram under a name."
(setf (gethash name diagrams) diagram)
name))
(defun construct-diagram (vertex-descriptors)
"Build a new diagram from a set of vertex descriptor."
(let ((diagram (make-diagram)))
;; Put in the vertexes
(setf (diagram-vertexes diagram)
(mapcar #'construct-vertex vertex-descriptors))
;; Put in the neighbors for each vertex
(dolist (v-d vertex-descriptors)
(setf (vertex-neighbors (find-vertex (first v-d) diagram))
(mapcar #'(lambda (neighbor)
(find-vertex neighbor diagram))
(v-d-neighbors v-d))))
diagram))
(defun construct-vertex (vertex-descriptor)
"Build the vertex corresponding to the descriptor."
;; Descriptors are like: (x L y z)
(make-vertex
:name (first vertex-descriptor)
:type (second vertex-descriptor)
:labelings (possible-labelings (second vertex-descriptor))))
(defun v-d-neighbors (vertex-descriptor)
"The neighboring vertex names in a vertex descriptor."
(rest (rest vertex-descriptor)))
(defun make-copy-diagram (diagram)
"Make a copy of a diagram, preserving connectivity."
(let* ((new (make-diagram
:vertexes (mapcar #'copy-vertex
(diagram-vertexes diagram)))))
;; Put in the neighbors for each vertex
(dolist (v (diagram-vertexes new))
(setf (vertex-neighbors v)
(mapcar #'(lambda (neighbor)
(find-vertex (vertex-name neighbor) new))
(vertex-neighbors v))))
new))
(defun ground (diagram vertex-a vertex-b)
"Attach the line between the two vertexes to the ground.
That is, label the line with a -"
(let* ((A (find-vertex vertex-a diagram))
(B (find-vertex vertex-b diagram))
(i (position B (vertex-neighbors A))))
(assert (not (null i)))
(setf (vertex-labelings A)
(find-all-if #'(lambda (l) (eq (nth i l) '-))
(vertex-labelings A)))
diagram))
(defun find-labelings (diagram)
"Return a list of all consistent labelings of the diagram."
(every #'propagate-constraints (diagram-vertexes diagram))
(search-solutions diagram))
(defmacro defdiagram (name &rest vertex-descriptors)
"Define a diagram. A copy can be gotten by (diagram name)."
`(put-diagram ',name (construct-diagram
(check-diagram ',vertex-descriptors))))
(defun check-diagram (vertex-descriptors)
"Check if the diagram description appears consistent."
(let ((errors 0))
(dolist (v-d vertex-descriptors)
;; v-d is like: (a Y b c d)
(let ((A (first v-d))
(v-type (second v-d)))
;; Check that the number of neighbors is right for
;; the vertex type (and that the vertex type is legal)
(when (/= (length (v-d-neighbors v-d))
(case v-type ((W Y T) 3) ((L) 2) (t -1)))
(warn "Illegal type/neighbor combo: ~a" v-d)
(incf errors))
;; Check that each neighbor B is connected to
;; this vertex, A, exactly once
(dolist (B (v-d-neighbors v-d))
(when (/= 1 (count-if
#'(lambda (v-d2)
(and (eql (first v-d2) B)
(member A (v-d-neighbors v-d2))))
vertex-descriptors))
(warn "Inconsistent vertex: ~a-~a" A B)
(incf errors)))))
(when (> errors 0)
(error "Inconsistent diagram. ~d total error~:p."
errors)))
vertex-descriptors)
| Common Lisp | 5 | sethaldini/paip-lisp | lisp/waltz.lisp | [
"MIT"
] |
scriptname _Seed_AlcoholSystem extends Quest
import Utility
import CampUtil
GlobalVariable property _Seed_Setting_VitalitySystemEnabled auto
GlobalVariable property _Seed_AlcoholSystemEnabled auto
GlobalVariable property _Seed_AttributeDrunk auto
GlobalVariable property _Seed_Setting_VampireBehavior auto
GlobalVariable property _Seed_Setting_DrunkNotifications auto
GlobalVariable property _Seed_Setting_DrunkVFX auto
GlobalVariable property GameHour auto
Spell property _Seed_DrunkSpell1 auto ; Relaxed
Spell property _Seed_DrunkSpell2 auto ; Tipsy
Spell property _Seed_DrunkSpell3 auto ; Drunk
Spell property _Seed_DrunkSpell4 auto ; Very Drunk (flag Disease)
Spell property _Seed_DrunkSpellHungOver auto ; Hung Over (after having passed out) (flag Disease)
Keyword property LocTypeInn auto
Message property _Seed_DrunkLevel1Msg auto
Message property _Seed_DrunkLevel2Msg auto
Message property _Seed_DrunkLevel3Msg auto
Message property _Seed_DrunkLevel4Msg auto
Message property _Seed_DrunkLevel5Msg auto
Message property _Seed_DrunkLevel6Msg auto
Location property KynesgroveBraidwoodInnLocation auto
Location property WindhelmCandlehearthHallLocation auto
Location property WindhelmNewGnisisCornerclubLocation auto
Location property FalkreathDeadMansDrinkLocation auto
Location property DragonBridgeFourShieldsTavernLocation auto
Location property SolitudeWinkingSkeeverLocation auto
Location property MorthalMoorsideInnLocation auto
Location property NightgateInnLocation auto
Location property DawnstarWindpeakInnLocation auto
Location property MarkarthSilverBloodInnLocation auto
Location property OldHroldanInnLocation auto
Location property RiftenBeeandBarbLocation auto
Location property IvarsteadVilemyrInnLocation auto
Location property RoriksteadFrostfruitInnLocation auto
Location property RiverwoodSleepingGiantInnLocation auto
Location property WhiterunBanneredMareLocation auto
Location property WhiterunDrunkenHuntsmanLocation auto
Location property WinterholdTheFrozenHearthLocation auto
Actor property PlayerRef auto
float property MAX_DRUNK = 120.0 autoReadOnly
float property MIN_DRUNK = 0.0 autoReadOnly
int DRINKTYPE_ALE = 1
int DRINKTYPE_WINE = 2
int DRINKTYPE_LIQUOR = 3
float ALE_AMOUNT = 12.0
float WINE_AMOUNT = 32.0
float LIQUOR_AMOUNT = 52.0
float AMOUNT_VARIANCE = 10.0
float SOBER_RATE = 10.0
float property update_interval = 0.5 auto hidden
float property last_update_time auto hidden
float last_drunk = 0.0
float last_hungover_time
function AlcoholConsumed(int drinktype)
if _Seed_Setting_VampireBehavior.GetValueInt() == 2 && IsPlayerUndead()
return
endif
float variance = (RandomFloat(0.0, AMOUNT_VARIANCE) - (AMOUNT_VARIANCE / 2)) ; +/- half of Variance (random)
if drinktype == DRINKTYPE_ALE
IncreaseDrunk(ALE_AMOUNT + variance)
elseif drinktype == DRINKTYPE_WINE
IncreaseDrunk(WINE_AMOUNT + variance)
elseif drinktype == DRINKTYPE_LIQUOR
IncreaseDrunk(LIQUOR_AMOUNT + variance)
endif
if _Seed_AttributeDrunk.GetValue() > 20.0
RegisterForSingleUpdateGameTime(0.5)
endif
endFunction
Event OnUpdateGameTime()
float this_time = GetCurrentGameTime() * 24.0
int cycles = Math.Floor((this_time - last_update_time) * 2)
float drunk_decrease = (SOBER_RATE * cycles)
DecreaseDrunk(drunk_decrease)
last_update_time = this_time
if _Seed_Setting_VitalitySystemEnabled.GetValueInt() == 2 && _Seed_AttributeDrunk.GetValue() > 0.0
RegisterForSingleUpdateGameTime(update_interval)
endif
EndEvent
function IncreaseDrunk(float amount)
float current_drunk = _Seed_AttributeDrunk.GetValue()
if current_drunk + amount >= MAX_DRUNK
_Seed_AttributeDrunk.SetValue(MAX_DRUNK)
else
_Seed_AttributeDrunk.SetValue(current_drunk + amount)
endif
ApplyDrunkEffects()
endFunction
function DecreaseDrunk(float amount)
float current_drunk = _Seed_AttributeDrunk.GetValue()
if current_drunk - amount <= MIN_DRUNK
_Seed_AttributeDrunk.SetValue(MIN_DRUNK)
else
_Seed_AttributeDrunk.SetValue(current_drunk - amount)
endif
ApplyDrunkEffects()
endFunction
function ModDrunk(float amount)
float current_drunk = _Seed_AttributeDrunk.GetValue()
if current_drunk + amount >= MAX_DRUNK
_Seed_AttributeDrunk.SetValue(MAX_DRUNK)
elseif current_drunk + amount <= MIN_DRUNK
_Seed_AttributeDrunk.SetValue(MIN_DRUNK)
else
_Seed_AttributeDrunk.SetValue(current_drunk + amount)
endif
ApplyDrunkEffects()
endFunction
function ApplyDrunkEffects()
float drunk = _Seed_AttributeDrunk.GetValue()
bool increasing = false
if drunk > last_drunk
increasing = true
endif
if !(IsBetween(last_drunk, 10.0, 0.0)) && (IsBetween(drunk, 10.0, 0.0))
ApplyDrunkLevel1()
elseif !(IsBetween(last_drunk, 30.0, 10.0)) && (IsBetween(drunk, 30.0, 10.0))
ApplyDrunkLevel2(increasing)
elseif !(IsBetween(last_drunk, 50.0, 30.0)) && (IsBetween(drunk, 50.0, 30.0))
ApplyDrunkLevel3()
elseif !(IsBetween(last_drunk, 80.0, 50.0)) && (IsBetween(drunk, 80.0, 50.0))
ApplyDrunkLevel4()
elseif !(IsBetween(last_drunk, 100.0, 80.0)) && (IsBetween(drunk, 100.0, 80.0))
ApplyDrunkLevel5()
elseif !(IsBetween(last_drunk, 120.0, 100.0)) && (IsBetween(drunk, 120.0, 100.0))
ApplyDrunkLevel6()
endif
last_drunk = drunk
; For Drinking Contest quest
SendModEvent_PlayerDrinkAlcohol(_Seed_AttributeDrunk.GetValue())
endFunction
function SendModEvent_PlayerDrinkAlcohol(float afDrunkAmount)
int handle = ModEvent.Create("LastSeed_PlayerDrinkAlcohol")
if (handle)
ModEvent.PushFloat(handle, afDrunkAmount)
ModEvent.Send(handle)
endIf
EndFunction
function RemoveAllDrunkEffects()
PlayerRef.RemoveSpell(_Seed_DrunkSpell1)
PlayerRef.RemoveSpell(_Seed_DrunkSpell2)
PlayerRef.RemoveSpell(_Seed_DrunkSpell3)
PlayerRef.RemoveSpell(_Seed_DrunkSpell4)
endFunction
function ApplyDrunkLevel1()
RemoveAllDrunkEffects()
if _Seed_Setting_DrunkNotifications.GetValueInt() == 2
_Seed_DrunkLevel1Msg.Show()
endif
; clear SFX
; clear VFX
endFunction
function ApplyDrunkLevel2(bool increasing)
RemoveAllDrunkEffects()
PlayerRef.AddSpell(_Seed_DrunkSpell1, false)
if _Seed_Setting_DrunkNotifications.GetValueInt() == 2
_Seed_DrunkLevel2Msg.Show()
endif
; play drunk SFX
if _Seed_Setting_DrunkVFX.GetValueInt() == 2
; play drunk VFX
endif
endFunction
function ApplyDrunkLevel3()
RemoveAllDrunkEffects()
PlayerRef.AddSpell(_Seed_DrunkSpell2, false)
if _Seed_Setting_DrunkNotifications.GetValueInt() == 2
_Seed_DrunkLevel3Msg.Show()
endif
; play drunk SFX
if _Seed_Setting_DrunkVFX.GetValueInt() == 2
; play drunk VFX
endif
endFunction
function ApplyDrunkLevel4()
RemoveAllDrunkEffects()
PlayerRef.AddSpell(_Seed_DrunkSpell3, false)
if _Seed_Setting_DrunkNotifications.GetValueInt() == 2
_Seed_DrunkLevel4Msg.Show()
endif
; play drunk SFX
if _Seed_Setting_DrunkVFX.GetValueInt() == 2
; play drunk VFX
endif
endFunction
function ApplyDrunkLevel5()
RemoveAllDrunkEffects()
PlayerRef.AddSpell(_Seed_DrunkSpell4, false)
if _Seed_Setting_DrunkNotifications.GetValueInt() == 2
_Seed_DrunkLevel5Msg.Show()
endif
; play drunk SFX
if _Seed_Setting_DrunkVFX.GetValueInt() == 2
; play drunk VFX
endif
endFunction
function ApplyDrunkLevel6()
RemoveAllDrunkEffects()
PlayerRef.AddSpell(_Seed_DrunkSpellHungOver, false)
if _Seed_Setting_DrunkNotifications.GetValueInt() == 2
_Seed_DrunkLevel6Msg.Show()
endif
; pass out FX
GameHour.SetValue(GameHour.GetValue() + 6.0)
if PlayerRef.GetCurrentLocation().HasKeyword(LocTypeInn)
;KickPlayerOutOfInn()
endif
; After time passes...
last_hungover_time = GetCurrentGameTime()
endFunction
bool function IsBetween(float fValue, float fUpperBound, float fLowerBound)
if fValue <= fUpperBound && fValue > fLowerBound
return true
else
return false
endif
endFunction
;/
function KickPlayerOutOfInn()
;@TODO: Support Retching Netch
if loc == KynesgroveBraidwoodInnLocation
elseif loc == WindhelmCandlehearthHallLocation ; bed
elseif loc == WindhelmNewGnisisCornerclubLocation ; bed
elseif loc == FalkreathDeadMansDrinkLocation
elseif loc == DragonBridgeFourShieldsTavernLocation
elseif loc == SolitudeWinkingSkeeverLocation ; check OCS support
elseif loc == MorthalMoorsideInnLocation ; bed
elseif loc == NightgateInnLocation ; bed
elseif loc == DawnstarWindpeakInnLocation ; bed
elseif loc == MarkarthSilverBloodInnLocation ; check OCS support
elseif loc == OldHroldanInnLocation
elseif loc == RiftenBeeandBarbLocation ; check OCS support
elseif loc == IvarsteadVilemyrInnLocation
elseif loc == RoriksteadFrostfruitInnLocation
elseif loc == RiverwoodSleepingGiantInnLocation
elseif loc == WhiterunBanneredMareLocation ; check OCS support
elseif loc == WhiterunDrunkenHuntsmanLocation ; check OCS support
elseif loc == WinterholdTheFrozenHearthLocation ; bed
endif
endFunction
/; | Papyrus | 5 | chesko256/Campfire | Scripts/Source/_Seed_AlcoholSystem.psc | [
"MIT"
] |
%default total
test : (f : () -> Bool) -> f () = True
test (\x => True) = Refl
bad : False = True
bad = test (\() => False)
| Idris | 3 | ska80/idris-jvm | tests/idris2/coverage016/Issue633.idr | [
"BSD-3-Clause"
] |
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Uniforms {
half4 colorGreen;
};
struct Inputs {
};
struct Outputs {
half4 sk_FragColor [[color(0)]];
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _out;
(void)_out;
half huge = half((((((((((9.0000007644071214e+35 * 1000000000.0) * 1000000000.0) * 1000000000.0) * 1000000000.0) * 1000000000.0) * 1000000000.0) * 1000000000.0) * 1000000000.0) * 1000000000.0) * 1000000000.0);
int hugeI = int((((((((((((((((((((1073741824 * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2);
uint hugeU = ((((((((((((((((((2147483648u * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u;
short hugeS = ((((((((((((((((16384 * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2;
ushort hugeUS = (((((((((((((((32768u * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u) * 2u;
int hugeNI = int(((((((((((((((((((-2147483648 * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2);
short hugeNS = (((((((((((((((-32768 * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2) * 2;
const int4 i4 = int4(2, 2, 2, 2);
int4 hugeIvec = ((((((((((((((int4(1073741824, 1073741824, 1073741824, 1073741824) * i4) * i4) * i4) * i4) * i4) * i4) * i4) * i4) * i4) * i4) * i4) * i4) * i4) * i4) * i4;
const uint4 u4 = uint4(2u, 2u, 2u, 2u);
uint4 hugeUvec = (((((((((((((uint4(2147483648u, 2147483648u, 2147483648u, 2147483648u) * u4) * u4) * u4) * u4) * u4) * u4) * u4) * u4) * u4) * u4) * u4) * u4) * u4) * u4;
_out.sk_FragColor = ((((((((_uniforms.colorGreen * saturate(huge)) * saturate(half(hugeI))) * saturate(half(hugeU))) * saturate(half(hugeS))) * saturate(half(hugeUS))) * saturate(half(hugeNI))) * saturate(half(hugeNS))) * saturate(half4(hugeIvec))) * saturate(half4(hugeUvec));
return _out;
}
| Metal | 3 | fourgrad/skia | tests/sksl/shared/Overflow.metal | [
"BSD-3-Clause"
] |
# -*- perl -*-
use strict;
use warnings;
use tests::tests;
check_expected ([<<'EOF']);
(priority-sema) begin
(priority-sema) Thread priority 30 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 29 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 28 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 27 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 26 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 25 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 24 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 23 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 22 woke up.
(priority-sema) Back in main thread.
(priority-sema) Thread priority 21 woke up.
(priority-sema) Back in main thread.
(priority-sema) end
EOF
pass;
| ChucK | 3 | Jeffxzj/PintOS-Project1 | tests/threads/priority-sema.ck | [
"MIT"
] |
/*
* The code is adopted from original (half) c implementation:
* https://github.com/ulfjack/ryu.git with some more comments and tidying. License is
* attached below.
*
* Copyright 2018 Ulf Adams
*
* The contents of this file may be used under the terms of the Apache License,
* Version 2.0.
*
* (See accompanying file LICENSE-Apache or copy at
* http: *www.apache.org/licenses/LICENSE-2.0)
*
* Alternatively, the contents of this file may be used under the terms of
* the Boost Software License, Version 1.0.
* (See accompanying file LICENSE-Boost or copy at
* https://www.boost.org/LICENSE_1_0.txt)
*
* Unless required by applicable law or agreed to in writing, this software
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.
*/
#include <cstddef>
#include <gtest/gtest.h>
#include <limits>
#include "../../../src/common/charconv.h"
namespace xgboost {
namespace {
void TestInteger(char const* res, int64_t i) {
char result[xgboost::NumericLimits<int64_t>::kToCharsSize];
auto ret = to_chars(result, result + sizeof(result), i);
*ret.ptr = '\0';
EXPECT_STREQ(res, result);
}
static float Int32Bits2Float(uint32_t bits) {
float f;
memcpy(&f, &bits, sizeof(float));
return f;
}
void TestRyu(char const *res, float v) {
char result[xgboost::NumericLimits<float>::kToCharsSize];
auto ret = to_chars(result, result + sizeof(result), v);
*ret.ptr = '\0';
EXPECT_STREQ(res, result);
}
} // anonymous namespace
TEST(Ryu, Subnormal) {
TestRyu("0E0", 0.0f);
TestRyu("-0E0", -0.0f);
TestRyu("1E0", 1.0f);
TestRyu("-1E0", -1.0f);
TestRyu("NaN", NAN);
TestRyu("Infinity", INFINITY);
TestRyu("-Infinity", -INFINITY);
TestRyu("1E-45", std::numeric_limits<float>::denorm_min());
}
TEST(Ryu, Denormal) {
TestRyu("1E-45", std::numeric_limits<float>::denorm_min());
}
TEST(Ryu, SwitchToSubnormal) {
TestRyu("1.1754944E-38", 1.1754944E-38f);
}
TEST(Ryu, MinAndMax) {
TestRyu("3.4028235E38", Int32Bits2Float(0x7f7fffff));
TestRyu("1E-45", Int32Bits2Float(1));
}
// Check that we return the exact boundary if it is the shortest
// representation, but only if the original floating point number is even.
TEST(Ryu, BoundaryRoundEven) {
TestRyu("3.355445E7", 3.355445E7f);
TestRyu("9E9", 8.999999E9f);
TestRyu("3.436672E10", 3.4366717E10f);
}
// If the exact value is exactly halfway between two shortest representations,
// then we round to even. It seems like this only makes a difference if the
// last two digits are ...2|5 or ...7|5, and we cut off the 5.
TEST(Ryu, ExactValueRoundEven) {
TestRyu("3.0540412E5", 3.0540412E5f);
TestRyu("8.0990312E3", 8.0990312E3f);
}
TEST(Ryu, LotsOfTrailingZeros) {
// Pattern for the first test: 00111001100000000000000000000000
TestRyu("2.4414062E-4", 2.4414062E-4f);
TestRyu("2.4414062E-3", 2.4414062E-3f);
TestRyu("4.3945312E-3", 4.3945312E-3f);
TestRyu("6.3476562E-3", 6.3476562E-3f);
}
TEST(Ryu, Regression) {
TestRyu("4.7223665E21", 4.7223665E21f);
TestRyu("8.388608E6", 8388608.0f);
TestRyu("1.6777216E7", 1.6777216E7f);
TestRyu("3.3554436E7", 3.3554436E7f);
TestRyu("6.7131496E7", 6.7131496E7f);
TestRyu("1.9310392E-38", 1.9310392E-38f);
TestRyu("-2.47E-43", -2.47E-43f);
TestRyu("1.993244E-38", 1.993244E-38f);
TestRyu("4.1039004E3", 4103.9003f);
TestRyu("5.3399997E9", 5.3399997E9f);
TestRyu("6.0898E-39", 6.0898E-39f);
TestRyu("1.0310042E-3", 0.0010310042f);
TestRyu("2.882326E17", 2.8823261E17f);
TestRyu("7.038531E-26", 7.0385309E-26f);
TestRyu("9.223404E17", 9.2234038E17f);
TestRyu("6.710887E7", 6.7108872E7f);
TestRyu("1E-44", 1.0E-44f);
TestRyu("2.816025E14", 2.816025E14f);
TestRyu("9.223372E18", 9.223372E18f);
TestRyu("1.5846086E29", 1.5846085E29f);
TestRyu("1.1811161E19", 1.1811161E19f);
TestRyu("5.368709E18", 5.368709E18f);
TestRyu("4.6143166E18", 4.6143165E18f);
TestRyu("7.812537E-3", 0.007812537f);
TestRyu("1E-45", 1.4E-45f);
TestRyu("1.18697725E20", 1.18697724E20f);
TestRyu("1.00014165E-36", 1.00014165E-36f);
TestRyu("2E2", 200.0f);
TestRyu("3.3554432E7", 3.3554432E7f);
static_assert(1.1920929E-7f == std::numeric_limits<float>::epsilon(), "");
TestRyu("1.1920929E-7", std::numeric_limits<float>::epsilon());
}
TEST(Ryu, RoundTrip) {
float f = -1.1493590134238582e-40;
char result[NumericLimits<float>::kToCharsSize] { 0 };
auto ret = to_chars(result, result + sizeof(result), f);
size_t dis = std::distance(result, ret.ptr);
float back;
auto from_ret = from_chars(result, result + dis, back);
ASSERT_EQ(from_ret.ec, std::errc());
std::string str;
for (size_t i = 0; i < dis; ++i) {
str.push_back(result[i]);
}
ASSERT_EQ(f, back);
}
TEST(Ryu, LooksLikePow5) {
// These numbers have a mantissa that is the largest power of 5 that fits,
// and an exponent that causes the computation for q to result in 10, which is a corner
// case for Ryu.
TestRyu("6.7108864E17", Int32Bits2Float(0x5D1502F9));
TestRyu("1.3421773E18", Int32Bits2Float(0x5D9502F9));
TestRyu("2.6843546E18", Int32Bits2Float(0x5E1502F9));
}
TEST(Ryu, OutputLength) {
TestRyu("1E0", 1.0f); // already tested in Basic
TestRyu("1.2E0", 1.2f);
TestRyu("1.23E0", 1.23f);
TestRyu("1.234E0", 1.234f);
TestRyu("1.2345E0", 1.2345f);
TestRyu("1.23456E0", 1.23456f);
TestRyu("1.234567E0", 1.234567f);
TestRyu("1.2345678E0", 1.2345678f);
TestRyu("1.23456735E-36", 1.23456735E-36f);
}
TEST(IntegerPrinting, Basic) {
TestInteger("0", 0);
auto str = std::to_string(std::numeric_limits<int64_t>::min());
TestInteger(str.c_str(), std::numeric_limits<int64_t>::min());
str = std::to_string(std::numeric_limits<int64_t>::max());
TestInteger(str.c_str(), std::numeric_limits<int64_t>::max());
}
void TestRyuParse(float f, std::string in) {
float res;
auto ret = from_chars(in.c_str(), in.c_str() + in.size(), res);
ASSERT_EQ(ret.ec, std::errc());
ASSERT_EQ(f, res);
}
TEST(Ryu, Basic) {
TestRyuParse(0.0f, "0");
TestRyuParse(-0.0f, "-0");
TestRyuParse(1.0f, "1");
TestRyuParse(-1.0f, "-1");
TestRyuParse(123456792.0f, "123456789");
TestRyuParse(299792448.0f, "299792458");
}
TEST(Ryu, MinMax) {
TestRyuParse(1e-45f, "1e-45");
TestRyuParse(FLT_MIN, "1.1754944e-38");
TestRyuParse(FLT_MAX, "3.4028235e+38");
}
TEST(Ryu, MantissaRoundingOverflow) {
TestRyuParse(1.0f, "0.999999999");
TestRyuParse(INFINITY, "3.4028236e+38");
TestRyuParse(1.1754944e-38f, "1.17549430e-38"); // FLT_MIN
}
TEST(Ryu, TrailingZeros) {
TestRyuParse(26843550.0f, "26843549.5");
TestRyuParse(50000004.0f, "50000002.5");
TestRyuParse(99999992.0f, "99999989.5");
}
} // namespace xgboost
| C++ | 5 | bclehmann/xgboost | tests/cpp/common/test_charconv.cc | [
"Apache-2.0"
] |
//This is the solution to http://codeforces.com/contest/900/problem/C
//C. Remove Extra One
#raw "template.cpy"
#define N 100007
int main()
int n
cin n
a = 0
b = 0
int x
int blk[N]
memset(blk, 0, sizeof(blk))
t = n
while t--
cin x
if x > a
b = a
a = x
blk[a]--
else if x > b
b = x
blk[a]++
int mb = -1000
int mval = -1000
//? n
for int i = 1; i <= n; i++
//? i blk[i]
if blk[i] > mb
mb = blk[i]
mval = i
! mval | COBOL | 3 | saviour07/CPY | Examples/Contest problems/900C. Remove Extra One/c.cpy | [
"MIT"
] |
" Vim filetype plugin file
" Language: reStructuredText documentation format with R code
" Maintainer: Jakson Alves de Aquino <[email protected]>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sat Aug 15, 2020 12:02PM
" Original work by Alex Zvoleff
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal comments=fb:*,fb:-,fb:+,n:>
setlocal commentstring=#\ %s
setlocal formatoptions+=tcqln
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
setlocal iskeyword=@,48-57,_,.
function! FormatRrst()
if search('^\.\. {r', "bncW") > search('^\.\. \.\.$', "bncW")
setlocal comments=:#',:###,:##,:#
else
setlocal comments=fb:*,fb:-,fb:+,n:>
endif
return 1
endfunction
" If you do not want 'comments' dynamically defined, put in your vimrc:
" let g:rrst_dynamic_comments = 0
if !exists("g:rrst_dynamic_comments") || (exists("g:rrst_dynamic_comments") && g:rrst_dynamic_comments == 1)
setlocal formatexpr=FormatRrst()
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
\ "All Files (*.*)\t*.*\n"
endif
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
else
let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2
| VimL | 4 | uga-rosa/neovim | runtime/ftplugin/rrst.vim | [
"Vim"
] |
@baze eg: <http://example.org/> .
| Turtle | 0 | joshrose/audacity | lib-src/lv2/serd/tests/bad/bad-misspelled-base.ttl | [
"CC-BY-3.0"
] |
exec("swigtest.start", -1);
foo_ptr = Foo_ptr_getPtr();
foo = Foo_ptr___deref__(foo_ptr);
checkequal(Foo_getVal(foo), 17, "Foo_getVal(p)");
foo_ptr = Foo_ptr_getConstPtr();
foo = Foo_ptr___deref__(foo_ptr);
checkequal(Foo_getVal(foo), 17, "Foo_getVal(p)");
exec("swigtest.quit", -1);
| Scilab | 3 | kyletanyag/LL-Smartcard | cacreader/swig-4.0.2/Examples/test-suite/scilab/return_const_value_runme.sci | [
"BSD-3-Clause"
] |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "ReadableNativeMap.h"
using namespace facebook::jni;
namespace facebook {
namespace react {
void ReadableNativeMap::mapException(const std::exception &ex) {
if (dynamic_cast<const folly::TypeError *>(&ex) != nullptr) {
throwNewJavaException(
exceptions::gUnexpectedNativeTypeExceptionClass, ex.what());
}
}
void addDynamicToJArray(
local_ref<JArrayClass<jobject>> jarray,
jint index,
const folly::dynamic &dyn) {
switch (dyn.type()) {
case folly::dynamic::Type::NULLT: {
jarray->setElement(index, nullptr);
break;
}
case folly::dynamic::Type::BOOL: {
(*jarray)[index] = JBoolean::valueOf(dyn.getBool());
break;
}
case folly::dynamic::Type::INT64: {
(*jarray)[index] = JDouble::valueOf(dyn.getInt());
break;
}
case folly::dynamic::Type::DOUBLE: {
(*jarray)[index] = JDouble::valueOf(dyn.getDouble());
break;
}
case folly::dynamic::Type::STRING: {
(*jarray)[index] = make_jstring(dyn.getString());
break;
}
case folly::dynamic::Type::OBJECT: {
(*jarray)[index] = ReadableNativeMap::newObjectCxxArgs(dyn);
break;
}
case folly::dynamic::Type::ARRAY: {
(*jarray)[index] = ReadableNativeArray::newObjectCxxArgs(dyn);
break;
}
default:
jarray->setElement(index, nullptr);
break;
}
}
local_ref<JArrayClass<jstring>> ReadableNativeMap::importKeys() {
keys_ = folly::dynamic::array();
if (map_ == nullptr) {
return JArrayClass<jstring>::newArray(0);
}
auto pairs = map_.items();
jint size = map_.size();
auto jarray = JArrayClass<jstring>::newArray(size);
jint i = 0;
for (auto &pair : pairs) {
auto value = pair.first.asString();
keys_.value().push_back(value);
(*jarray)[i++] = make_jstring(value);
}
return jarray;
}
local_ref<JArrayClass<jobject>> ReadableNativeMap::importValues() {
jint size = keys_.value().size();
auto jarray = JArrayClass<jobject>::newArray(size);
for (jint ii = 0; ii < size; ii++) {
const std::string &key = keys_.value()[ii].getString();
addDynamicToJArray(jarray, ii, map_.at(key));
}
return jarray;
}
local_ref<JArrayClass<jobject>> ReadableNativeMap::importTypes() {
jint size = keys_.value().size();
auto jarray = JArrayClass<jobject>::newArray(size);
for (jint ii = 0; ii < size; ii++) {
const std::string &key = keys_.value()[ii].getString();
(*jarray)[ii] = ReadableType::getType(map_.at(key).type());
}
return jarray;
}
local_ref<ReadableNativeMap::jhybridobject>
ReadableNativeMap::createWithContents(folly::dynamic &&map) {
if (map.isNull()) {
return local_ref<jhybridobject>(nullptr);
}
if (!map.isObject()) {
throwNewJavaException(
exceptions::gUnexpectedNativeTypeExceptionClass,
"expected Map, got a %s",
map.typeName());
}
return newObjectCxxArgs(std::move(map));
}
void ReadableNativeMap::registerNatives() {
registerHybrid({
makeNativeMethod("importKeys", ReadableNativeMap::importKeys),
makeNativeMethod("importValues", ReadableNativeMap::importValues),
makeNativeMethod("importTypes", ReadableNativeMap::importTypes),
});
}
} // namespace react
} // namespace facebook
| C++ | 4 | anaskhraza/react-native | ReactAndroid/src/main/jni/react/jni/ReadableNativeMap.cpp | [
"CC-BY-4.0",
"MIT"
] |
'* Copyright (c) 2017 Roku, Inc. All rights reserved.
'
' File: SampleVideo.brs
'
'* video.manifestData field is roAssociativeArray which currently carries two elements:
'* "mpd" - roAssociativeArray of string values
'* "periods" - roArray of roAssociativeArrays of string values
'*
'* Examples of accessing manifestData:
'*
'* 1) Get a known attribute:
'* video.manifestData.mpd.minimumUpdatePeriod
'*
'* 2) Get a known attribute which has a semicolon in the name:
'* video.manifestData.mpd["xmlns:ns1"]
'*
'* 3) Get a known attribute from existing period:
'* video.manifestData.period[0].id
'*
'* 4) Get number of available periods
'* video.manifestData.periods.Count()
'*
'* 5) Iterate through all available MPD attributes
'* for each item in video.manifestData.mpd.Items()
'* print item.key, "=", item.value
'* end for
function init()
print m.top.subType() + ".init()"
video = m.top
content = createObject("RoSGNode", "ContentNode")
content.setFields({streamFormat:"dash", Live:true})
testCase = 2
if testCase = 1
content.setFields({URL: "http://vm2.dashif.org/livesim-dev/segtimeline_1/testpic_2s/Manifest.mpd" })
else if testCase = 2 '#--- SegmentTemplate with manifest updates every 30s
content.setFields({URL: "http://vm2.dashif.org/livesim/mup_30/testpic_2s/Manifest.mpd" })
end if
video.observeField("manifestData", "manifestDataChanged")
video.content = content
video.control = "play"
end function
function manifestDataChanged()
print "---"
print "video.manifestData field changed"
print "---"
video = m.top
md = video.manifestData
print "<MPD"
for each item in md.mpd.Items()
print " "; item.key; "="""; item.value; """"
end for
print ">"
for each period in md.periods
print "<Period"
for each item in period.Items()
print " "; item.key; "="""; item.value; """"
end for
print ">"
end for
end function
| Brightscript | 5 | khangh/samples | certification/manifestData-sample-master/components/SampleVideo.brs | [
"MIT"
] |
// Copyright (c) 2019 Bluespec, Inc. All Rights Reserved
package Unit_Test_Fabric;
// ================================================================
// Standalone unit tester for AXI4_Lite_Fabric.bsv
// ================================================================
// Bluespec library imports
import FIFOF :: *;
import Connectable :: *;
// ----------------
// BSV additional libs
import Cur_Cycle :: *;
// ================================================================
// Project imports
import Semi_FIFOF :: *;
import AXI4_Lite_Types :: *;
import AXI4_Lite_Fabric :: *;
// ================================================================
// Synthesized instance of Fabric
typedef 2 Num_Masters;
typedef 3 Num_Slaves;
typedef 32 Wd_Addr;
typedef 64 Wd_Data;
typedef 0 Wd_User;
typedef AXI4_Lite_Fabric_IFC #(Num_Masters,
Num_Slaves,
Wd_Addr,
Wd_Data,
Wd_User) AXI4_Lite_Fabric_IFC_Inst;
function Tuple2 #(Bool, Bit #(TLog #(Num_Slaves)))
fn_addr_to_slave_num (Bit #(Wd_Addr) addr);
if ((addr & 'h_FFFF_0000) == 0)
return tuple2 (True, 0);
else if ((addr & 'h_FFFF_0000) == 1)
return tuple2 (True, 1);
else if ((addr & 'h_FFFF_0000) == 2)
return tuple2 (True, 2);
else
return tuple2 (False, ?);
endfunction
(* synthesize *)
module mkAXI4_Lite_Fabric_Inst (AXI4_Lite_Fabric_IFC_Inst);
let m <- mkAXI4_Lite_Fabric (fn_addr_to_slave_num);
return m;
endmodule
AXI4_Lite_Master_IFC #(Wd_Addr, Wd_Data, Wd_User) dummy_AXI4_Lite_Master_ifc_inst = dummy_AXI4_Lite_Master_ifc;
AXI4_Lite_Slave_IFC #(Wd_Addr, Wd_Data, Wd_User) dummy_AXI4_Lite_Slave_ifc_inst = dummy_AXI4_Lite_Slave_ifc;
// ================================================================
(* synthesize *)
module mkUnit_Test_Fabric (Empty);
AXI4_Lite_Fabric_IFC_Inst fabric <- mkAXI4_Lite_Fabric_Inst;
AXI4_Lite_Master_Xactor_IFC #(Wd_Addr, Wd_Data, Wd_User) master <- mkAXI4_Lite_Master_Xactor;
AXI4_Lite_Slave_Xactor_IFC #(Wd_Addr, Wd_Data, Wd_User) slave0 <- mkAXI4_Lite_Slave_Xactor;
mkConnection (master.axi_side, fabric.v_from_masters [0]);
mkConnection (dummy_AXI4_Lite_Master_ifc_inst, fabric.v_from_masters [1]);
mkConnection (fabric.v_to_slaves [0], slave0.axi_side);
mkConnection (fabric.v_to_slaves [1], dummy_AXI4_Lite_Slave_ifc_inst);
mkConnection (fabric.v_to_slaves [2], dummy_AXI4_Lite_Slave_ifc_inst);
Reg #(Bit #(32)) rg_test <- mkReg (0); // Chooses which test to run
FIFOF #(Bit #(64)) f_wdata <- mkFIFOF;
Reg #(Bit #(32)) rg_idle_count <- mkReg (0);
// ================================================================
// Help function to create AXI4_Lite channel payloads
function AXI4_Lite_Wr_Addr #(Wd_Addr, Wd_User)
fv_mk_wr_addr (Bit #(Wd_Addr) addr, Bit #(Wd_User) user);
return AXI4_Lite_Wr_Addr {awaddr: addr, awprot: 0, awuser: user};
endfunction
function AXI4_Lite_Wr_Data #(Wd_Data)
fv_mk_wr_data (Bit #(Wd_Data) data);
return AXI4_Lite_Wr_Data {wdata: data, wstrb: 'hFF};
endfunction
function AXI4_Lite_Wr_Resp #(Wd_User)
fv_mk_wr_resp (AXI4_Lite_Wr_Data #(Wd_Data) wd, Bit #(Wd_User) user);
return AXI4_Lite_Wr_Resp {bresp: AXI4_LITE_OKAY, buser: user};
endfunction
function AXI4_Lite_Rd_Addr #(Wd_Addr, Wd_User)
fv_mk_rd_addr (Bit #(Wd_Addr) addr, Bit #(Wd_User) user);
return AXI4_Lite_Rd_Addr {araddr: addr, arprot: 0, aruser: user};
endfunction
function AXI4_Lite_Rd_Data #(Wd_Data, Wd_User)
fv_mk_rd_data (AXI4_Lite_Rd_Addr #(Wd_Addr, Wd_User) ar);
return AXI4_Lite_Rd_Data {rresp: AXI4_LITE_OKAY,
rdata: zeroExtend (ar.araddr + 'h10_000),
ruser: ar.aruser};
endfunction
// ================================================================
// STIMULUS
Bit #(Wd_User) user1 = ((valueOf (Wd_User) == 0) ? 0 : ?);
rule rl_step0_wra (rg_test == 0);
let wa = fv_mk_wr_addr ('h1000, user1);
master.i_wr_addr.enq (wa);
f_wdata.enq (fromInteger ('h1000));
rg_idle_count <= 0;
rg_test <= 1;
$display ("%0d: master.rl_wr_single: ", cur_cycle);
$display (" ", fshow (wa));
endrule
rule rl_step1_wra (rg_test == 1);
let wa = fv_mk_wr_addr ('h1004, user1);
master.i_wr_addr.enq (wa);
f_wdata.enq (fromInteger ('h1004));
rg_idle_count <= 0;
rg_test <= 2;
$display ("%0d: master.rl_wr_burst_addr_0: ", cur_cycle);
$display (" ", fshow (wa));
endrule
rule rl_step2_rda (rg_test == 2);
let ra = fv_mk_rd_addr ('h2000, user1);
master.i_rd_addr.enq (ra);
rg_idle_count <= 0;
rg_test <= 3;
$display ("%0d: master.rd_single: ", cur_cycle);
$display (" ", fshow (ra));
endrule
rule rl_step3_rda (rg_test == 3);
let ra = fv_mk_rd_addr ('h2004, user1);
master.i_rd_addr.enq (ra);
rg_idle_count <= 0;
rg_test <= 4;
$display ("%0d: master.rl_rd_burst_addr_0: ", cur_cycle);
$display (" ", fshow (ra));
endrule
rule rl_step4_rda (rg_test == 4);
let ra = fv_mk_rd_addr ('h0003_0000, user1);
master.i_rd_addr.enq (ra);
rg_idle_count <= 0;
rg_test <= 5;
$display ("%0d: master.rl_rd_burst_addr_0: ", cur_cycle);
$display (" ", fshow (ra));
endrule
// ================================================================
rule rl_wr_data;
let data = f_wdata.first; f_wdata.deq;
let wd = fv_mk_wr_data (data);
master.i_wr_data.enq (wd);
rg_idle_count <= 0;
$display ("%0d: master.rl_wr_data: ", cur_cycle);
$display (" ", fshow (wd));
endrule
// ================================================================
// Drain and display responses received by master
rule rl_wr_resps;
let wr_resp <- pop_o (master.o_wr_resp);
$display ("%0d: master: ", cur_cycle);
$display (" ", fshow (wr_resp));
rg_idle_count <= 0;
endrule
rule rl_rd_resps;
let rd_resp <- pop_o (master.o_rd_data);
$display ("%0d: master: ", cur_cycle);
$display (" ", fshow (rd_resp));
rg_idle_count <= 0;
endrule
// ================================================================
// Slave: return functional responses
rule rl_slave_IP_model_wr_addr;
let wa <- pop_o (slave0.o_wr_addr);
$display ("%0d: slave: ", cur_cycle);
$display (" ", fshow (wa));
endrule
rule rl_slave_IP_model_wr_data;
let wd <- pop_o (slave0.o_wr_data);
slave0.i_wr_resp.enq (fv_mk_wr_resp (wd, user1));
$display ("%0d: slave: ", cur_cycle);
$display (" ", fshow (wd));
endrule
rule rl_slave_IP_model_rd_addr;
let ra <- pop_o (slave0.o_rd_addr);
slave0.i_rd_data.enq (fv_mk_rd_data (ra));
$display ("%0d: slave: ", cur_cycle);
$display (" ", fshow (ra));
endrule
// ================================================================
rule rl_idle_quit;
if (rg_idle_count == 100) begin
$display ("%0d: UnitTest_Fabric: idle; quit", cur_cycle);
$finish (0);
end
else begin
rg_idle_count <= rg_idle_count + 1;
end
endrule
endmodule
// ================================================================
endpackage
| Bluespec | 5 | Skydive/Piccolo | src_Testbench/Fabrics/AXI4_Lite/Unit_Test/Unit_Test_Fabric.bsv | [
"Apache-2.0"
] |
#############################################################################
##
#W sml512.cw GAP library of groups Hans Ulrich Besche
## Bettina Eick, Eamonn O'Brien
##
SMALL_GROUP_LIB[ 512 ][ 101 ] := [
"%%%%%%%%(G8,->e1)<,,/D%/%%)&%%!}nD<j!}uD)F!}xD)F!}t/)F!}w/)F!}u/)F!}x/)F!}t\
M)F!}wM)F!}uM)F!}xM)F!}t)*%!}w)*%!}u)*%!}x)*%!}tG*% }wG%6Y.QAd*M:^2UEh(K8[0S\
Cf,O=b4WGj&J7Z/RBe+N<",
"%%%%%%%%(G8,->e1)<,,8b%k%%)&%%!}nHD=x!}uHD*%!}xHD)F!}t3D*%!}w3D*%!}u3D*%!}x\
3D)F!}tQD)F!}wQD)F!}uQD)F!}xQD)F!}t%/)F!}w%/)F!}u%/)F!}x%/9%!}tD/)F }wD/%6.Q\
Ad*M:^2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi",
"%%%%%%%%(G8,->e1)<,,%%%M%%)&%%!}PD.c!}uD)F!}xD)F!}t/9%!}w/9%!}u/9%!}x/9%!}t\
M)F!}wM)F!}uM)F!}xM9%!}t))F!}w))F!}u))F!}x))F!}tG)F }wG%6.QAd*M:^2UEh(K8[0SC\
f,O=b4WGj&J7Z/RBe+N<a3VFi)L9]1TDg-P>c5",
"%%%%%%%%(G8,->e1)<,,8%%M%%)&%% xPGI6Y!}uG)F!}xG)F!}t2)F!}w2)F!}u2)F!}x2)F!}\
tP)F!}wP)F!}uP)F!}xP)F!}t&9%!}w&9%!}u&9%!}x&9%!}tE9%!}wE9% }&E6.QAd*M:^2U",
"%%%%%%%%(G8,->e1)<,,/%%M%%)&%%!}uD:d!}xD9%!}t/9%!}w/9%!}u/9%!}x/9%!}tM9%!}w\
M9%!}uM9%!}xM9%!}t))F!}w))F!}u))F!}x))F!}tG)F!}wG)F }cG%6.QAd*M:^2UEh(K8[0SC\
f,O=b4WG",
"%%%%%%%%(G8,->e1)<,,8b%M%%)&%%!}uH%>D!}xH%9%!}t3%)F!}w3%)F!}u3%)F!}x3%9%!}t\
Q%9%!}wQ%9%!}uQ%9%!}xQ%9%!}t%D9%!}w%D9%!}u%D9%!}x%D76!}tDD9%!}wDD9% }uDD6.QA\
d*M:^2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L9]1",
"%%%%%%%%(G8,->e1)<,,%D%M%%)&%%!}ND=-!}xD9%!}t/76!}w/76!}u/76!}x/76!}tM9%!}w\
M9%!}uM9%!}xM76!}t)9%!}w)9%!}u)9%!}x)9%!}tG9%!}wG9%!}uG9% }fG6.QAd*M:^2UEh(K\
8[0",
"%%%%%%%%(G8,->e1)<,,8D%M%%)&%%!}xG=H!}t29%!}w29%!}u29%!}x29%!}tP9%!}wP9%!}u\
P9%!}xP9%!}t&76!}w&76!}u&76!}x&76!}tE76!}wE76!}uE76 }xE.QAd*M:^2UEh(K8[0SCf,\
O=b4WGj&J7Z/RBe+N<a3VFi)L9]1",
"%%%%%%%%(G8,->e1)<,,/D%M%%)&%%!}QD=-!}t/76!}w/76!}u/76!}x/76!}tM76!}wM76!}u\
M76!}xM76!}t)9%!}w)9%!}u)9%!}x)9%!}tG9%!}wG9%!}uG9%!}xG76 }b26.QAd*M:^2UEh(K\
8[0SCf,",
"%%%%%%%%(G8,->e1)<,,8b%k(%)&%%!}t3M<v!}w3M9%!}u3M9%!}x3M76!}tQM76!}wQM76!}u\
QM76!}xQM76!}t%)76!}w%)76!}u%)76!}x%)7L!}tD)76!}wD)76!}uD)76!}xD)76!}t/)7L )\
)/)A",
"%%%%%%%%(G8,->e1)<,,%%%/&%)&%% }w/QAd*M^2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VF\
i)L9]1TDg-P>c5XHk!}u/7L!}x/7L!}tM76!}wM76!}uM76!}xM7L!}t)76!}w)76!}u)76!}x)7\
6!}tG76!}wG76!}uG76!}xG76!}t276 }w2.QAd*M:^2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3\
VFi)",
"%%%%%%%%(G8,->e1)<,,8%%/&%)&%%!}P2<)!}u276!}x276!}tP76!}wP76!}uP76!}xP76!}t\
&7L!}w&7L!}u&7L!}x&7L!}tE7L!}wE7L!}uE7L!}xE7L!}t07L!}w07L }u0.QAd*M^2UEh(K8[\
0SCf,O=b4WGj&J7Z/RBe",
"%%%%%%%%(G8,->e1)<,,/%%/&%)&%%!}l/6,!}x/7L!}tM7L!}wM7L!}uM7L!}xM7L!}t)76!}w\
)76!}u)76!}x)76!}tG76!}wG76!}uG76!}xG7L!}t276!}w276!}u276 }f2.QAd*M^2UEh(K8[\
0SCf,O=",
"%%%%%%%%(G8,->e1)<,,8b%/&%)&%%!}x3%>&!}tQ%7L!}wQ%7L!}uQ%7L!}xQ%7L!}t%D7L!}w\
%D7L!}u%D7L!}x%D7x!}tDD7L!}wDD7L!}uDD7L!}xDD7L!}t/D7x!}w/D7x!}u/D7x!}x/D7x }\
bMD.QAd*M^2UEh(K8[0SCf,O=b4",
"%%%%%%%%(G8,->e1)<,,%D%/&%)&%%!}tM=T!}wM7L!}uM7L!}xM7x!}t)7L!}w)7L!}u)7L!}x\
)7L!}tG7L!}wG7L!}uG7L!}xG7L!}t27L!}w27L!}u27L!}x27L!}tP7L }eP.QAd*M^2UEh(K8[\
0SCf,O=",
"%%%%%%%%(G8,->e1)<,,8D%/&%)&%%!}wP>&!}uP7L!}xP7L!}t&7x!}w&7x!}u&7x!}x&7x!}t\
E7x!}wE7x!}uE7x!}xE7x!}t07x!}w07x!}u07x!}x07x!}tN7x!}wN7x }uN.QAdM^2UEh(K8[0\
SCf,O=b4WGj&J7Z/RB",
"%%%%%%%%(G8,->e1)<,,/D%/&%)&%%!}lM>-!}xM7x!}t)7L!}w)7L!}u)7L!}x)7L!}tG7L!}w\
G7L!}uG7L!}xG7x!}t27L!}w27L!}u27L!}x27x!}tP7x!}wP7x!}uP7x }xP.QAdM^2UEh(K8[0\
SCf,O=b4WGj&J7Z/RBe+N<",
"%%%%%%%%(G8,->e1)<,,8b%k&%)&%%!}oQD=x!}t%/7x!}w%/7x!}u%/7x!}x%/7q!}tD/7x!}w\
D/7x!}uD/7x!}xD/7x!}t//7q!}w//7q!}u//7q!}x//7q!}tM/7x!}wM/7x!}uM/7x!}xM/7q }\
t)/.QAdM^2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L9]1TDg-P>c5XH",
"%%%%%%%%(G8,->e1)<,,8%%M&%)&%% yz)j&J7Z }w)M^2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N\
<a3VFi)L9]1TDg-P>c5XHk!}u)7x!}x)7x!}tG7x!}wG7x!}uG7x!}xG7x!}t27x!}w27x!}u27x\
!}x27x!}tP7x!}wP7x!}uP7x!}xP7x!}t&7q!}w&7q }c&.QAdM2UEh(K8[0S",
"%%%%%%%%(G8,->e1)<,,/%%M&%)&%%!}u%:W!}x%7q!}tD7q!}wD7q!}uD7q!}xD7q!}t/7q!}w\
/7q!}u/7q!}x/7q!}tM7q!}wM7q!}uM7q!}xM7q!}t)7x!}w)7x!}u)7x }x).QAdM^2UEh(K8[0\
SCf,O=b4WGj&J7Z/RBe+N<a3VFi)",
"%%%%%%%%(G8,->e1)<,,8b%M&%)&%%!}Q*%<)!}tH%7x!}wH%7x!}uH%7x!}xH%7q!}t3%7x!}w\
3%7x!}u3%7x!}x3%7q!}tQ%7q!}wQ%7q!}uQ%7q!}xQ%7q!}t%D7q!}w%D7q!}u%D7q!}x%D7Y!}\
tDD7q }eDD.QAdM2UEh(K",
"%%%%%%%%(G8,->e1)<,,%D%M&%)&%%!}wD:*!}uD7q!}xD7q!}t/7Y!}w/7Y!}u/7Y!}x/7Y!}t\
M7q!}wM7q!}uM7q!}xM7Y!}t)7q!}w)7q!}u)7q!}x)7q!}tG7q!}wG7q }uG.QAdM2UEh(K8[0S\
Cf,O=b4WGj&J7Z/RBe+N<a3VFi)L9]1T",
"%%%%%%%%(G8,->e1)<,,8D%M&%)&%%!}NG:L!}xG7q!}t27q!}w27q!}u27q!}x27q!}tP7q!}w\
P7q!}uP7q!}xP7q!}t&7Y!}w&7Y!}u&7Y!}x&7Y!}tE7Y!}wE7Y!}uE7Y!}xE7Y }t0.QAd2UEh(\
K8[0SCf,O=b4WGj&J7Z/",
"%%%%%%%%(G8,->e1)<,,/D%M&%)&%%!}k/=.!}w/7Y!}u/7Y!}x/7Y!}tM7Y!}wM7Y!}uM7Y!}x\
M7Y!}t)7q!}w)7q!}u)7q!}x)7q!}tG7q!}wG7q!}uG7q!}xG7Y!}t27q!}w27q }c2.QAdM2UEh\
(K8",
"%%%%%%%%(G8,->e1)<,,8b%k(%<&%%!}u3P=s!}x3P7Y!}tQP7Y!}wQP7Y!}uQP7Y!}xQP7Y!}t\
%&7Y!}w%&7Y!}u%&7Y!}x%&8*!}tD&7Y!}wD&7Y!}uD&7Y!}xD&7Y!}t/&8*!}w/&8*!}u/&8*!}\
x/&8*!y%M&-b",
"%%%%%%%%(G8,->e1)<,,%%%/%%2&%%!}tM5P!}wM7Y!}uM7Y!}xM8*!}t)7Y!}w)7Y!}u)7Y!}x\
)7Y!}tG7Y!}wG7Y!}uG7Y!}xG7Y!}t27Y!}w27Y!}u27Y!}x27Y!}tP7Y!}wP7Y )&PA",
"%%%%%%%%(G8,->e1)<,,8%%/%%2&%% }uPQAd2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L\
9]1TDg-P>c5XHk!}xP7Y!}t&8*!}w&8*!}u&8*!}x&8*!}tE8*!}wE8*!}uE8*!}xE8*!}t08*!}\
w08*!}u08*!}x08*!}tN8*!}wN8*!}uN8*!}xN8* }b*.QAd2UEh(",
"%%%%%%%%(G8,->e1)<,,8b%/%%2&%%!}t*%<^!}w*%7Y!}u*%7Y!}x*%7Y!}tH%7Y!}wH%7Y!}u\
H%7Y!}xH%8*!}t3%7Y!}w3%7Y!}u3%7Y!}x3%8*!}tQ%8*!}wQ%8*!}uQ%8*!}xQ%8*!}t%D8*!}\
w%D8* }c%D.Qd2UEh(K",
"%%%%%%%%(G8,->e1)<,,%D%/%%2&%%!}u%:*!}x%=:!}tD8*!}wD8*!}uD8*!}xD8*!}t/=:!}w\
/=:!}u/=:!}x/=:!}tM8*!}wM8*!}uM8*!}xM=:!}t)8*!}w)8*!}u)8*!}x)8* }tG.Qd2UEh(K\
8[0SCf,O=b4WGj&J",
"%%%%%%%%(G8,->e1)<,,8D%/%%2&%%!}kG9P!}wG8*!}uG8*!}xG8*!}t28*!}w28*!}u28*!}x\
28*!}tP8*!}wP8*!}uP8*!}xP8*!}t&=:!}w&=:!}u&=:!}x&=:!}tE=:!}wE=: }uEQd2UEh(K8\
[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L9",
"%%%%%%%%(G8,->e1)<,,/D%/%%2&%%!}ND=a!}xD=:!}t/=:!}w/=:!}u/=:!}x/=:!}tM=:!}w\
M=:!}uM=:!}xM=:!}t)8*!}w)8*!}u)8*!}x)8*!}tG8*!}wG8*!}uG8*!}xG=:!}t28* y)2%IY\
.QAd",
"%%%%%%%%(G8,->e1)<,,8b%k%%2&%%!}w3D5P!}u3D8*!}x3D=:!}tQD=:!}wQD=:!}uQD=:!}x\
QD=:!}t%/=:!}w%/=:!}u%/=:!}x%/<{!}tD/=:!}wD/=:!}uD/=:!}xD/=:!}t//<{!}w//<{!}\
u//<{ }x//Q2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi",
"%%%%%%%%(G8,->e1)<,,%%%M%%2&%%!}Q/.c!}tM=:!}wM=:!}uM=:!}xM<{!}t)=:!}w)=:!}u\
)=:!}x)=:!}tG=:!}wG=:!}uG=:!}xG=:!}t2=:!}w2=:!}u2=:!}x2=:!}tP=:!}wP=: }cPQd2\
UEh(K8[0SC",
"%%%%%%%%(G8,->e1)<,,8%%M%%2&%%!}uP>9!}xP=:!}t&<{!}w&<{!}u&<{!}x&<{!}tE<{!}w\
E<{!}uE<{!}xE<{!}t0<{!}w0<{!}u0<{!}x0<{!}tN<{!}wN<{!}uN<{!}xN<{!}t*=: y)*IY.\
",
"%%%%%%%%(G8,->e1)<,,8b%M%%2&%%!}w*%=M!}u*%=:!}x*%=:!}tH%=:!}wH%=:!}uH%=:!}x\
H%<{!}t3%=:!}w3%=:!}u3%=:!}x3%<{!}tQ%<{!}wQ%<{!}uQ%<{!}xQ%<{!}t%D<{!}w%D<{!}\
u%D<{ }x%D2UEh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L9]",
"%%%%%%%%(G8,->e1)<,,%D%M%%2&%%!}Q%7,!}tD<{!}wD<{!}uD<{!}xD<{!}t/8X!}w/8X!}u\
/8X!}x/8X!}tM<{!}wM<{!}uM<{!}xM8X!}t)<{!}w)<{!}u)<{!}x)<{!}tG<{!}wG<{ }uGQ2U\
Eh(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L",
"%%%%%%%%(G8,->e1)<,,8D%M%%2&%%!}NG9N!}xG<{!}t2<{!}w2<{!}u2<{!}x2<{!}tP<{!}w\
P<{!}uP<{!}xP<{!}t&8X!}w&8X!}u&8X!}x&8X!}tE8X!}wE8X!}uE8X!}xE8X!}t08X }w02UE\
h(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L9]1",
"%%%%%%%%(G8,->e1)<,,/D%M%%2&%%!}P/=-!}u/8X!}x/8X!}tM8X!}wM8X!}uM8X!}xM8X!}t\
)<{!}w)<{!}u)<{!}x)<{!}tG<{!}wG<{!}uG<{!}xG8X!}t2<{!}w2<{!}u2<{!}x28X }tP2UE\
h(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L9]1TD",
"%%%%%%%%(G8,->e1)<,,8b%k(%2&%%!}MQM>+!}wQM8X!}uQM8X!}xQM8X!}t%)8X!}w%)8X!}u\
%)8X!}x%)8L!}tD)8X!}wD)8X!}uD)8X!}xD)8X!}t/)8L!}w/)8L!}u/)8L!}x/)8L!}tM)8X!}\
wM)8X!}uM)8X!}xM)8L }b))2UEh(K8[0",
"%%%%%%%%(G8,->e1)<,,8%%/&%2&%%!}t)=H!}w)8X!}u)8X!}x)8X!}tG8X!}wG8X!}uG8X!}x\
G8X!}t28X!}w28X!}u28X!}x28X!}tP8X!}wP8X!}uP8X!}xP8X!}t&8L!}w&8L!}u&8L }x&2Eh\
(K8[0SCf,O=b4WGj&J7Z/",
"%%%%%%%%(G8,->e1)<,,/%%/&%2&%%!}o%=.!}tD8L!}wD8L!}uD8L!}xD8L!}t/8L!}w/8L!}u\
/8L!}x/8L!}tM8L!}wM8L!}uM8L!}xM8L!}t)8X!}w)8X!}u)8X!}x)8X!}tG8X!}wG8X }uG2UE\
h(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L9]1TDg-P>c5",
"%%%%%%%%(G8,->e1)<,,8b%/&%2&%% x{H%UEh(8[!}xH%5P!}t3%8X!}w3%8X!}u3%8X!}x3%8\
L!}tQ%8L!}wQ%8L!}uQ%8L!}xQ%8L!}t%D8L!}w%D8L!}u%D8L!}x%D8J!}tDD8L!}wDD8L!}uDD\
8L!}xDD8L!}t/D8J!}w/D8J }u/D2E(K8[0SCf,O=b4WGj&J7Z/RBe+N",
"%%%%%%%%(G8,->e1)<,,%D%/&%2&%%!}l/:3!}x/8J!}tM8L!}wM8L!}uM8L!}xM8J!}t)8L!}w\
)8L!}u)8L!}x)8L!}tG8L!}wG8L!}uG8L!}xG8L!}t28L!}w28L!}u28L!}x28L!}tP8L!}wP8L \
}cP2Eh(K8[0SCf",
"%%%%%%%%(G8,->e1)<,,8D%/&%2&%%!}uP6Q!}xP8L!}t&8J!}w&8J!}u&8J!}x&8J!}tE8J!}w\
E8J!}uE8J!}xE8J!}t08J!}w08J!}u08J!}x08J!}tN8J!}wN8J!}uN8J!}xN8J!}t*8L!}w*8L \
}c*2Eh(K8[",
"%%%%%%%%(G8,->e1)<,,8b%k&%2&%%!}u*D8A!}x*D8L!}tHD8L!}wHD8L!}uHD8L!}xHD8J!}t\
3D8L!}w3D8L!}u3D8L!}x3D8J!}tQD8J!}wQD8J!}uQD8J!}xQD8J!}t%/8J!}w%/8J!}u%/8J!}\
x%/:[!}tD/8J!}wD/8J",
"%%%%%%%%(G8,->e1)<,,%%%M&%2&%%!}uD8J!}xD8J!}t/:[!}w/:[!}u/:[!}x/:[!}tM8J!}w\
M8J!}uM8J!}xM:[!}t)8J!}w)8J!}u)8J!}x)8J!}tG8J!}wG8J!}uG8J!}xG8J!}t28J!}w28J \
}c22E(K8",
"%%%%%%%%(G8,->e1)<,,8%%M&%2&%%!}u2=s!}x28J!}tP8J!}wP8J!}uP8J!}xP8J!}t&:[!}w\
&:[!}u&:[!}x&:[!}tE:[!}wE:[!}uE:[!}xE:[!}t0:[!}w0:[!}u0:[!}x0:[!}tN:[!}wN:[ \
}uNE(K8[0SCf,O=b4WGj&J",
"%%%%%%%%(G8,->e1)<,,8b%M&%2&%%!}lN%9P!}xN%:[!}t*%8J!}w*%8J!}u*%8J!}x*%8J!}t\
H%8J!}wH%8J!}uH%8J!}xH%:[!}t3%8J!}w3%8J!}u3%8J!}x3%:[!}tQ%:[!}wQ%:[!}uQ%:[!}\
xQ%:[!}t%D:[!}w%D:[ }u%DE(K8[0SCf,O=b4WGj&J7Z/RBe+N<a",
"%%%%%%%%(G8,->e1)<,,%D%M&%2&%%!}l%8W!}x%5P!}tD:[!}wD:[!}uD:[!}xD:[!}t/5P!}w\
/5P!}u/5P!}x/5P!}tM:[!}wM:[!}uM:[!}xM5P!}t):[!}w):[!}u):[!}x):[!}tG:[!}wG:[!\
}uG:[ }fGE(K8[0",
"%%%%%%%%(G8,->e1)<,,8D%M&%2&%%!}xG=H!}t2:[!}w2:[!}u2:[!}x2:[!}tP:[!}wP:[!}u\
P:[!}xP:[!}t&5P!}w&5P!}u&5P!}x&5P!}tE5P!}wE5P!}uE5P!}xE5P!}t05P!}w05P!}u05P \
}x0(K8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi)L9]1",
"%%%%%%%%(G8,->e1)<,,8b%k(%<-%%!}Q0Q%=-!}tNQ%5P!}wNQ%5P!}uNQ%5P!}xNQ%5P!}t*Q\
%:[!}w*Q%:[!}u*Q%:[!}x*Q%:[!}tHQ%:[!}wHQ%:[!}uHQ%:[!}xHQ%5P!}t3Q%:[!}w3Q%:[!\
}u3Q%:[!}x3Q%5P!}tQQ%5P!}wQQ%5P!}uQQ%5P!}xQQ%5P }t%%D(K8[0SCf,O=b4WGj&J7",
"%%%%%%%%(G8,->e1)<,,%%%/%%)*%%!}k%=c!}w%5P!}u%5P!}x%5N!}tD5P!}wD5P!}uD5P!}x\
D5P!}t/5N!}w/5N!}u/5N!}x/5N!}tM5P!}wM5P!}uM5P!}xM5N!}t)5P!}w)5P!}u)5P!}x)5P!\
}tG5P!}wG5G",
"%%%%%%%%(G8,->e1)<,,8%%/%%)*%%!}nG<+!}uG5P!}xG5P!}t25P!}w25P!}u25P!}x25P!}t\
P5P!}wP5P!}uP5P!}xP5P!}t&5N!}w&5N!}u&5N!}x&5N!}tE5N!}wE5N!}uE5N!}xE5N!}t05N!\
}w05N }u0(K8[0SCf,O=b4WGj&J7",
"%%%%%%%%(G8,->e1)<,,/%%/%%)*%% }l/Y.QAd*:^2UEh(K8[0SCf,O=b4WGj!}x/5N!}tM5N!\
}wM5N!}uM5N!}xM5N!}t)5P!}w)5P!}u)5P!}x)5P!}tG5P!}wG5P!}uG5P!}xG5N!}t25P!}w25\
P!}u25P!}x25N!}tP5N!}wP5N!}uP5N }xP(K8[0SCf,O=b4WGj&J7Z/R",
"%%%%%%%%(G8,->e1)<,,8b%/%%)*%% }oQ%Ad*:^2UEh(K8[0SCf,O=b4WGj!}t%D5N!}w%D5N!\
}u%D5N!}x%D5M!}tDD5N!}wDD5N!}uDD5N!}xDD5N!}t/D5M!}w/D5M!}u/D5M!}x/D5M!}tMD5N\
!}wMD5N!}uMD5N!}xMD5M!}t)D5N!}w)D5N!}u)D5N!}x)D5N }tGD(K8[0SCf,O=b4WGj&J7Z/R\
Be+<a3VFi)L9]1TDg-P",
"%%%%%%%%(G8,->e1)<,,8D%/%%)*%% }]G=b4WGj&J7Z/RBe+N<a3VFi }nG%I6Y.QAd*:^2UEh\
(K8[0SCf,O=b4WGj!}uG5N!}xG5N!}t25N!}w25N!}u25N!}x25N!}tP5N!}wP5N!}uP5N!}xP5N\
!}t&5M!}w&5M!}u&5M!}x&5M!}tE5M!}wE5M!}uE5M!}xE5M!}t05M!}w05M!}u05G",
"%%%%%%%%(G8,->e1)<,,/D%/%%)*%% }l/I6Y.QAd*:2UEh(K8[0SCf,O=b4WGj!}x/5M!}tM5M\
!}wM5M!}uM5M!}xM5M!}t)5N!}w)5N!}u)5N!}x)5N!}tG5N!}wG5N!}uG5N!}xG5M!}t25N!}w2\
5N!}u25N!}x25M!}tP5M!}wP5M!}uP5M }xP(K8[0SCf,O=b4WGj&J7Z/RBe+<3VFi)L9]1TDg-P\
>",
"%%%%%%%%(G8,->e1)<,,8b%k%%)*%%!{QQD=]!}t%/5M!}w%/5M!}u%/5M!}x%/5R!}tD/5M!}w\
D/5M!}uD/5M!}xD/5M!}t//5R!}w//5R!}u//5R!}x//5R!}tM/5M!}wM/5M!}uM/5M!}xM/5R!}\
t)/5M!}w)/5M!}u)/5M!}x)/5M!}tG/5M }wG/(K8[0SCf,O=b4WGj&J7Z/RBe+<3VFi)L9]1",
"%%%%%%%%(G8,->e1)<,,8%%M%%)*%%!}PG=-!}uG5M!}xG5M!}t25M!}w25M!}u25M!}x25M!}t\
P5M!}wP5M!}uP5M!}xP5M!}t&5R!}w&5R!}u&5R!}x&5R!}tE5R!}wE5R!}uE5R!}xE5R!}t05R!\
}w05R!}u05R }x0(K8[0SCf,O=b4WGj&J7Z/RBe<3VFi)L9]1",
"%%%%%%%%(G8,->e1)<,,8b%M%%)*%%!}Q0%=-!}tN%5R!}wN%5R!}uN%5R!}xN%5R!}t*%5M!}w\
*%5M!}u*%5M!}x*%5M!}tH%5M!}wH%5M!}uH%5M!}xH%5R!}t3%5M!}w3%5M!}u3%5M!}x3%5R!}\
tQ%5R!}wQ%5R!}uQ%5R!}xQ%5R!}t%D5R }w%D(K8[0SCf,O=b4WGj&J7Z/RBe<3VFi)L9]1",
"%%%%%%%%(G8,->e1)<,,%D%M%%)*%%!}P%=-!}u%5R!}x%5Q!}tD5R!}wD5R!}uD5R!}xD5R!}t\
/5Q!}w/5Q!}u/5Q!}x/5Q!}tM5R!}wM5R!}uM5R!}xM5Q!}t)5R!}w)5R!}u)5R!}x)5R!}tG5R!\
}wG5R!}uG5R!}xG5R!zD2,o",
"%%%%%%%%(G8,->e1)<,,8D%M%%)*%% }t2SCf,O=b4WGj&J7Z/RBe<3VFi)L9]1TDg-P>c5XHk!\
}w25R!}u25R!}x25R!}tP5R!}wP5R!}uP5R!}xP5R!}t&5Q!}w&5Q!}u&5Q!}x&5Q!}tE5Q!}wE5\
Q!}uE5Q!}xE5Q!}t05Q!}w05Q!}u05Q!}x05Q!}tN5Q!}wN5Q }uN(K8[0SCf,O=b4WGj&J7Z/RB\
e3VFi)",
"%%%%%%%%(G8,->e1)<,,8b%k(%)*%% }^NMK8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi }oNM%I6Y\
.QAd2UEh(K8[0SCf,O=b4WGj!}t*M5R!}w*M5R!}u*M5R!}x*M5R!}tHM5R!}wHM5R!}uHM5R!}x\
HM5Q!}t3M5R!}w3M5R!}u3M5R!}x3M5Q!}tQM5Q!}wQM5Q!}uQM5Q!}xQM5Q!}t%)5Q!}w%)5Q!}\
u%)5Q!}x%)5S!}tD)5Q!zGD)-b",
"%%%%%%%%(G8,->e1)<,,%%%/&%)*%% }wD,O=b4WGj&J7Z/RBe3VFi)L9]1TDg-P>c5XHk!}uD5\
Q!}xD5Q!}t/5S!}w/5S!}u/5S!}x/5S!}tM5Q!}wM5Q!}uM5Q!}xM5S!}t)5Q!}w)5Q!}u)5Q!}x\
)5Q!}tG5Q!}wG5Q!}uG5Q!}xG5Q!}t25Q!}w25Q!}u25Q!}x25Q %DPA",
"%%%%%%%%(G8,->e1)<,,8%%/&%)*%% }tPK8[0SCf,O=b4WGj&J7Z/RBe3VFi)L9]1TDg-P>c5X\
Hk!}wP5Q!}uP5Q!}xP5Q!}t&5S!}w&5S!}u&5S!}x&5S!}tE5S!}wE5S!}uE5S!}xE5S!}t05S!}\
w05S!}u05S!}x05S!}tN5S!}wN5S!}uN5S!}xN5S!}t*5Q!}w*5Q!}u*5Q!zH*,o",
"%%%%%%%%(G8,->e1)<,,8b%/&%)*%% }x*%SCf,O=b4WGj&J7Z/RBe3VFi)L9]1TDg-P>c5XHk!\
}tH%5Q!}wH%5Q!}uH%5Q!}xH%5S!}t3%5Q!}w3%5Q!}u3%5Q!}x3%5S!}tQ%5S!}wQ%5S!}uQ%5S\
!}xQ%5S!}t%D5S!}w%D5S!}u%D5S!}x%D5h!}tDD5S!}wDD5S!}uDD5S!}xDD5S!}t/D5h!}w/D5\
h!}E/D.E",
"%%%%%%%%(G8,->e1)<,,8D%/&%)*%% }u/4WGjJZ/RBe3VFi)L9]1TDg-P>c5XHk!}x/5h!}tM5\
S!}wM5S!}uM5S!}xM5h!}t)5S!}w)5S!}u)5S!}x)5S!}tG5S!}wG5S!}uG5S!}xG5S!}t25S!}w\
25S!}u25S!}x25S!}tP5S!}wP5S!}uP5S!}xP5S!}t&5h }w&(K8[0SCf,O=b4WGjJZ/RBe3VFi)\
",
"%%%%%%%%(G8,->e1)<,,/D%/&%)*%%!}P%<)!}u%5h!}x%5h!}tD5h!}wD5h!}uD5h!}xD5h!}t\
/5h!}w/5h!}u/5h!}x/5h!}tM5h!}wM5h!}uM5h!}xM5h!}t)5S!}w)5S!}u)5S!}x)5S!}tG5S!\
}wG5S!}uG5S!}xG5h!}t25S!}G2.B",
"%%%%%%%%(G8,->e1)<,,8b%k&%)*%% }w3Db4WGj&JZ/RBe3VFi)L9]1TDg-P>c5XHk!}u3D5S!\
}x3D5h!}tQD5h!}wQD5h!}uQD5h!}xQD5h!}t%/5h!}w%/5h!}u%/5h!}x%/5g!}tD/5h!}wD/5h\
!}uD/5h!}xD/5h!}t//5g!}w//5g!}u//5g!}x//5g!}tM/5h!}wM/5h!}uM/5h!}xM/5g!}t)/5\
h!zG)/-X",
"%%%%%%%%(G8,->e1)<,,8%%M&%)*%% }w)f,O=b4WGjJZ/RBe3VFi)L9]1TDg-P>c5XHk!}u)5h\
!}x)5h!}tG5h!}wG5h!}uG5h!}xG5h!}t25h!}w25h!}u25h!}x25h!}tP5h!}wP5h!}uP5h!}xP\
5h!}t&5g!}w&5g!}u&5g!}x&5g!}tE5g!}wE5g!}uE5g!}xE5g!}t05g!zG0-b",
"%%%%%%%%(G8,->e1)<,,8b%M&%)*%% }w0%,O=b4WGjJ/RBe3VFi)L9]1TDg-P>c5XHk!}u0%5g\
!}x0%5g!}tN%5g!}wN%5g!}uN%5g!}xN%5g!}t*%5h!}w*%5h!}u*%5h!}x*%5h!}tH%5h!}wH%5\
h!}uH%5h!}xH%5g!}t3%5h!}w3%5h!}u3%5h!}x3%5g!}tQ%5g!}wQ%5g!}uQ%5g!}xQ%5g!}t%D\
5g!}G%D.Z",
"%%%%%%%%(G8,->e1)<,,%D%M&%)*%% }w%GjJ/RBe3VFi)L9]1TDg-P>c5XHk!}u%5g!}x%5X!}\
tD5g!}wD5g!}uD5g!}xD5g!}t/5X!}w/5X!}u/5X!}x/5X!}tM5g!}wM5g!}uM5g!}xM5X!}t)5g\
!}w)5g!}u)5g!}x)5g!}tG5g!}wG5g!}uG5g!}xG5g!}t25g }w2(K8[0SCf,O=b4WGjJ/RBe3VF\
i)L9]1TDg-P>",
"%%%%%%%%(G8,->e1)<,,8D%M&%)*%%!{P2=]!}u25g!}x25g!}tP5g!}wP5g!}uP5g!}xP5g!}t\
&5X!}w&5X!}u&5X!}x&5X!}tE5X!}wE5X!}uE5X!}xE5X!}t05X!}w05X!}u05X!}x05X!}tN5X!\
}wN5X!}uN5X!}xN5X!}t*5g!}w*5g }u*(K8[0SCf,O=b4WGjJ/RBe3VFi)L",
"%%%%%%%%(G8,->e1)<,,8b%k(%<*%% }^*P8[0SCf,O=b4WGj&J7Z/RBe+N<a3VFi }o*PI.QAd\
2UEh(K8[0SCf,O=b4WGj!}tHP5g!}wHP5g!}uHP5g!}xHP5X!}t3P5g!}w3P5g!}u3P5g!}x3P5X\
!}tQP5X!}wQP5X!}uQP5X!}xQP5X!}t%&5X!}w%&5X!}u%&5X!}x%&5Y!}tD&5X!}wD&5X!}uD&5\
X!}xD&5X!}t/&5Y!}w/&5Y!}u/&5Y }x/&(K8[0SCf,O=b4WGj/RBe3Vi",
"%%%%%%%%(G8,->e1)<,,8%%/%%2*%%!}Q/.c!}tM5X!}wM5X!}uM5X!}xM5Y!}t)5X!}w)5X!}u\
)5X!}x)5X!}tG5X!}wG5X!}uG5X!}xG5X!}t25X!}w25X!}u25X!}x25X!}tP5X!}wP5X!}uP5X!\
}xP5X!}t&5Y!}w&5Y!}u&5Y!}x&5Y }tE(K8[0SCf,O=b4WGj/RBe3Vi)L9]1T",
"%%%%%%%%(G8,->e1)<,,/%%/%%2*%% }]DCf,O=b4WGj&J7Z/RBe+N<a3VFi }nD.QAd2Uh(K8[\
0SCf,O=b4WGj!}uD5Y!}xD5Y!}t/5Y!}w/5Y!}u/5Y!}x/5Y!}tM5Y!}wM5Y!}uM5Y!}xM5Y!}t)\
5X!}w)5X!}u)5X!}x)5X!}tG5X!}wG5X!}uG5X!}xG5Y!}t25X!}w25X!}u25X!}x25Y!}tP5Y!}\
wP5Y!zEP,o",
"%%%%%%%%(G8,->e1)<,,8b%/%%2*%% }uQ%SCf,O=b4WGj/RBe3Vi)L9]1TDg-P>c5XHk!}xQ%5\
Y!}t%D5Y!}w%D5Y!}u%D5Y!}x%D5^!}tDD5Y!}wDD5Y!}uDD5Y!}xDD5Y!}t/D5^!}w/D5^!}u/D\
5^!}x/D5^!}tMD5Y!}wMD5Y!}uMD5Y!}xMD5^!}t)D5Y!}w)D5Y!}u)D5Y!}x)D5Y!}tGD5Y!}wG\
D5Y!}uGD5Y }xGD(K8[0SCf,O=b4WGj/RBe3Vi)L9]1TDg-P>c5",
"%%%%%%%%(G8,->e1)<,,8D%/%%2*%% xQGI6Y!}t25Y!}w25Y!}u25Y!}x25Y!}tP5Y!}wP5Y!}\
uP5Y!}xP5Y!}t&5^!}w&5^!}u&5^!}x&5^!}tE5^!}wE5^!}uE5^!}xE5^!}t05^!}w05^!}u05^\
!}x05^!}tN5^!}wN5^!}uN5^!}xN5^!}t*5Y }w*(K8[0SCf,O=b4WGj/RBe3Vi)L9]1TDg-P>c5\
XH",
"%%%%%%%%(G8,->e1)<,,8b%k%%2*%% QP*DA!}u*D5Y!}x*D5Y!}tHD5Y!}wHD5Y!}uHD5Y!}xH\
D5^!}t3D5Y!}w3D5Y!}u3D5Y!}x3D5^!}tQD5^!}wQD5^!}uQD5^!}xQD5^!}t%/5^!}w%/5^!}u\
%/5^!}x%/5]!}tD/5^!}wD/5^!}uD/5^!}xD/5^!}t//5]!}w//5]!}u//5]!}x//5]!zDM/-b",
"%%%%%%%%(G8,->e1)<,,8%%M%%2*%% }tM,O=b4WGj/RBeVi)L9]1TDg-P>c5XHk!}wM5^!}uM5\
^!}xM5]!}t)5^!}w)5^!}u)5^!}x)5^!}tG5^!}wG5^!}uG5^!}xG5^!}t25^!}w25^!}u25^!}x\
25^!}tP5^!}wP5^!}uP5^!}xP5^!}t&5]!}w&5]!}u&5]!}x&5]!}tE5]!}wE5] }uE(K8[0SCf,\
O=b4WGj/RBeV)L9]1T",
"%%%%%%%%(G8,->e1)<,,8b%M%%2*%% }^E%Cf,O=b4WGj&J7Z/RBe+N<a3VFi }oE%.QAdU(K8[\
0SCf,O=b4WGj!}t0%5]!}w0%5]!}u0%5]!}x0%5]!}tN%5]!}wN%5]!}uN%5]!}xN%5]!}t*%5^!\
}w*%5^!}u*%5^!}x*%5^!}tH%5^!}wH%5^!}uH%5^!}xH%5]!}t3%5^!}w3%5^!}u3%5^!}x3%5]\
!}tQ%5]!}wQ%5]!}uQ%5]!}xQ%5]!}t%D5] }w%D(K8[0SCf,O=b4WGj/R",
"%%%%%%%%(G8,->e1)<,,%D%M%%2*%% }n%AdU(K8[0SCf,O=b4WGj!}u%5]!}x%5V!}tD5]!}wD\
5]!}uD5]!}xD5]!}t/5V!}w/5V!}u/5V!}x/5V!}tM5]!}wM5]!}uM5]!}xM5V!}t)5]!}w)5]!}\
u)5]!}x)5]!}tG5]!}wG5]!}uG5]!}xG5]!}t25]!}w25]!}u25]!}x25] }tP(K8[0SCf,O=b4W\
Gj/RBeV)L9]",
"%%%%%%%%(G8,->e1)<,,8D%M%%2*%% }]P0SCf,O=b4WGj&J7Z/RBe+N<a3VFi }nP.QAdU(K8[\
0SCf,O=b4WGj!}uP5]!}xP5]!}t&5V!}w&5V!}u&5V!}x&5V!}tE5V!}wE5V!}uE5V!}xE5V!}t0\
5V!}w05V!}u05V!}x05V!}tN5V!}wN5V!}uN5V!}xN5V!}t*5]!}w*5]!}u*5]!}x*5]!}tH5]!}\
wH5]!}uH5]!}xH5V!zD3-6",
"%%%%%%%%(G8,->e1)<,,8b%k(%2*%% }t3MCf,O=b4WGj/RBeV)L9]1TDg-P>c5XHk!}w3M5]!}\
u3M5]!}x3M5V!}tQM5V!}wQM5V!}uQM5V!}xQM5V!}t%)5V!}w%)5V!}u%)5V!}x%)5U!}tD)5V!\
}wD)5V!}uD)5V!}xD)5V!}t/)5U!}w/)5U!}u/)5U!}x/)5U!}tM)5V!}wM)5V!}uM)5V!}xM)5U\
!}t))5V!}w))5V!}u))5V!}x))5V %DG)A",
"%%%%%%%%(G8,->e1)<,,8%%/&%2*%% }tGK8[0SCf,O=b4WGj/RBe)L9]1TDg-P>c5XHk!}wG5V\
!}uG5V!}xG5V!}t25V!}w25V!}u25V!}x25V!}tP5V!}wP5V!}uP5V!}xP5V!}t&5U!}w&5U!}u&\
5U!}x&5U!}tE5U!}wE5U!}uE5U!}xE5U!}t05U!}w05U!}u05U!}x05U!}tN5U!}wN5U!}uN5U!}\
xN5U }D*%I6Y.QAd*",
"%%%%%%%%(G8,->e1)<,,8b%/&%2*%% }t*%O=b4WGj/RBe)L9]1TDg-P>c5XHk!}w*%5V!}u*%5\
V!}x*%5V!}tH%5V!}wH%5V!}uH%5V!}xH%5U!}t3%5V!}w3%5V!}u3%5V!}x3%5U!}tQ%5U!}wQ%\
5U!}uQ%5U!}xQ%5U!}t%D5U!}w%D5U!}u%D5U!}x%D5T!}tDD5U!}wDD5U!}uDD5U!}xDD5U!}t/\
D5T!}w/D5T!}u/D5T!}x/D5T }tMD(K8[0SCf,O=b4WGj/Be)L9]1",
"%%%%%%%%(G8,->e1)<,,8D%/&%2*%% }]MSCf,O=b4WGj&J7Z/RBe+N<a3VFi }nM.Ad(K8[0SC\
f,O=b4WGj!}uM5U!}xM5T!}t)5U!}w)5U!}u)5U!}x)5U!}tG5U!}wG5U!}uG5U!}xG5U!}t25U!\
}w25U!}u25U!}x25U!}tP5U!}wP5U!}uP5U!}xP5U!}t&5T!}w&5T!}u&5T!}x&5T!}tE5T!}wE5\
T!}uE5T!}xE5T!}t05T }w0(K8[0SCf,O=b4WGj/B)",
"%%%%%%%%(G8,->e1)<,,8b%k&%2*%%!}P0D<)!}u0D5T!}x0D5T!}tND5T!}wND5T!}uND5T!}x\
ND5T!}t*D5U!}w*D5U!}u*D5U!}x*D5U!}tHD5U!}wHD5U!}uHD5U!}xHD5T!}t3D5U!}w3D5U!}\
u3D5U!}x3D5T!}tQD5T!}wQD5T!}uQD5T!}xQD5T!}t%/5T!}w%/5T!}u%/5T!}x%/5f!}tD/5T!\
}wD/5T }uD/(K8[0SCf,O=b4WGj/B)L9]1T",
"%%%%%%%%(G8,->e1)<,,8%%M&%2*%% }^DCf,O=b4WGj&J7Z/RBe+N<a3VFi }oD.A(K8[0SCf,\
O=b4WGj!}t/5f!}w/5f!}u/5f!}x/5f!}tM5T!}wM5T!}uM5T!}xM5f!}t)5T!}w)5T!}u)5T!}x\
)5T!}tG5T!}wG5T!}uG5T!}xG5T!}t25T!}w25T!}u25T!}x25T!}tP5T!}wP5T!}uP5T!}xP5T!\
}t&5f!}w&5f!}u&5f!}x&5f!}DE.U",
"%%%%%%%%(G8,->e1)<,,8b%M&%2*%% }tE%WGjB)L9]1TDg-P>c5XHk!}wE%5f!}uE%5f!}xE%5\
f!}t0%5f!}w0%5f!}u0%5f!}x0%5f!}tN%5f!}wN%5f!}uN%5f!}xN%5f!}t*%5T!}w*%5T!}u*%\
5T!}x*%5T!}tH%5T!}wH%5T!}uH%5T!}xH%5f!}t3%5T!}w3%5T!}u3%5T!}x3%5f!}tQ%5f!}wQ\
%5f!}uQ%5f!}xQ%5f!}t%D5f!}w%D5f!}E%D.U",
"%%%%%%%%(G8,->e1)<,,8D%M&%2*%% }u%WGjB)L9]1TDg-P>c5XHk!}Z%/g!}tD5f!}wD5f!}u\
D5f!}xD5f!}]/0k!}^/0k!}tM5f!}wM5f!}uM5f!}ZM/g!}t)5f!}w)5f!}u)5f!}x)5f!}tG5f!\
}wG5f!}uG5f!}xG5f!}t25f!}w25f!}u25f!}x25f!}tP5f!}wP5f!}uP5f!}xP5f!}V&/]",
"%%%%%%%%(G8,->e1)<,,/D%M&%2*%%!}]%=T!}^%0k!}]D0k!}^D0k!}]/0k!}^/0k!}]M0k!}^\
M0k!}t)5f!}w)5f!}u)5f!}x)5f!}tG5f!}wG5f!}uG5f!}ZG/g!}t25f!}w25f!}u25f!}Z2/g!\
}]P0k!}^P0d",
"%%%%%%%%(G8,-4e1)<,,8b%k(%<-,%!{QQQ%=]!}t%%D0k!}w%%D1-!}u%%D0k!}x%%D0k!}tD%\
D3W!}wD%D3W!}uD%D0k!}xD%D1-!}t/%D0k!}w/%D0k!}u/%D0k!}x/%D0k!}tM%D0k!}wM%D0k!\
}uM%D0k!}xM%D0>",
"%%%%%%%%(G8,-4e1)<,,8%%/%%)&)%!}oM<j!}t)3W!}w)3W!}u)3W!}x)3W!}tG3W!}wG3W!}u\
G3W!}xG3W!}t20k!}w20k!}u20k!}x21-!}tP0k!}wP1-!}uP3W }xP%I6Y.Qd*M:^2UEh(K8[0S\
Cf,O=b4WGj&J7Z/R",
"%%%%%%%%(G8,-4e1)<,,8b%/%%)&)%!}oP>-!}t&3W }w&%I6Y.Qd*M:^2UEh(K8[0SCf,O=b4W\
Gj&J7ZRe+N<a3VFi)L9]1TDg-P>c5XHk!}u&3W!}x&3W!}tE4C!}wE4C!}uE3W }xE%I6Y.Qd*M:\
^2UEh(K8[0SCf,O=b4WGj&J7ZRe+N<a3VFi)L9]1TDg-P>c5XHk!}t03W!}w03W!}u03W!}x03W!\
}tN3W!}wN3W!}uN3W }xN%I6Y.Qd*M:^2UEh(K8[0SCf,O=b4WGj&J7Z/Re+N<a3VFi)L9]1",
"%%%%%%%%(G8,-4e1)<,,8b%k%%)&)%!}QN%=-!}t*%4C!}w*%4C!}u*%4C!}x*%4C!}tH%4C!}w\
H%4C!}uH%4C!}xH%4C!}t3%3W!}w3%3W!}u3%3W }x3%%I6Y.Qd*M:^2UEh(K8[0SCf,O=b4WGj&\
J7ZRe+N<a3VFi)L9]1TDg-P>c5XHk!}tQ%3W }wQ%%I6Y.Qd*M:^2UEh(K8[0SCf,O=b4WGj&J7Z\
Re+N<a3VFi)L9]1TDg-P>c5XHk!}uQ%4C!}xQ%4C }b%D%I6YQd*M:^2UEh(K8[0",
"%%%%%%%%(G8,-4e1)<,,8%%M%%)&)% }t%SCf,O=b4WGj&J7ZRe+N<a3VFi)L9]1TDg-P>c5XHk\
}w%%I6YQd*M:^2UEh(K8[0SCf,O=b4WGj&J7ZR+N<a3VFi)L9]1TDg-P>c5XHk!}u%4C!}x%4C!\
}tD4/!}wD4/!}uD4C }xD%I6YQd*M:^2UEh(K8[0SCf,O=b4WGj&J7ZR+N<a3VFi)L9]1TDg-P>c\
5XHk!}t/4C!}w/4C!}u/4C!}x/4C!}tM4C!}wM4C!}uM4C!}xM4C!}t)4/ }))%I6YQ*M",
"%%%%%%%%(G8,-4e1)<,,8b%M%%)&)% }w):^2UEh(K8[0SCf,O=b4WGj&J7ZR+N<a3VFi)L9]1T\
Dg-P>c5XHk!}u)4/!}x)4/!}tG4/!}wG4/!}uG4/!}xG4/!}t24C!}w24C!}u24C }x2%I6YQd*M\
:^2UEh(K8[0SCf,O=b4WGj&J7ZR+N<a3VFi)L9]1TDg-P>c5XHk!}tP4C }wP%I6YQd*M:^2UEh(\
K8[0SCf,O=b4WGj&J7ZR+N<a3VFi)L9]1TDg-P>c5XHk!}uP4/!}xP4/!}t&4/!}w&4- }&&%I6Y\
Q*M:^2UE",
"%%%%%%%%(G8,-4e1)<,,8D%M%%)&)% }u%h(K8[0SCf,O=b4WGj&J7ZR+N<a3VFi)L9]1TDg-P>\
c5XHk!}x%4/!}tD,O!}wD,O!}uD4/!}xD4-!}t/4/!}w/4/!}u/4/!}x/4/!}tM4/!}wM4/!}uM4\
/!}xM4/!}t),O!}w),O!}u),O }x)%I6Y*M:^2UEh(K8[0SCf,O=b4WGj&J7Z+N<a3",
"%%%%%%%%(G8,-4e1)<,,8b%k(%)&)%!}o*D=L!}tHD,O!}wHD,O!}uHD,O!}xHD,O!}t3D4/!}w\
3D4/!}u3D4/!}x3D4-!}tQD4/!}wQD4-!}uQD,O!}xQD,O!}t%/,O }w%/%I6Y*M:^2UEh(K8[0S\
Cf,O=b4WGj&J7Z+N<a3Fi)L9]1TDg-P>c5XHk!}u%/,O!}x%/,O!}tD/,H }eD/%I6Y*M:^2Eh(K\
8[0SCf,O=" ];
| Redcode | 1 | hulpke/smallgrp | small7/sml512.cw | [
"Artistic-2.0"
] |
%{
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <cstring>
#include <iostream>
#include "euler/parser/tree.h"
typedef struct yy_buffer_state * YY_BUFFER_STATE;
typedef size_t yy_size_t;
extern YY_BUFFER_STATE yy_scan_string(const char * str);
extern void yy_delete_buffer(YY_BUFFER_STATE buffer);
extern int yylex();
extern int yyparse();
void yyerror(const char* s);
TreeNode* t = NULL;
%}
%union {
class TreeNode* node;
}
%token<node> v e sample_node sample_edge sample_n_with_types
%token<node> select_ v_select
%token<node> out_v in_v out_e sample_neighbor sample_l_nb
%token<node> values label udf
%token<node> p num l r limit order_by desc asc as or_ and_ has has_key has_label gt ge lt le eq ne
%token end
%type<node> TRAV ROOT_NODE ROOT_EDGE
%type<node> GET_VALUE_WITH_SELECT GET_VALUE SELECT_VALUE
%type<node> SEARCH_NODE_WITH_SELECT SEARCH_NODE
%type<node> SEARCH_EDGE_WITH_SELECT SEARCH_EDGE
%type<node> API_GET_NODE API_SAMPLE_NODE API_SAMPLE_N_WITH_TYPES API_SAMPLE_LNB
%type<node> API_GET_EDGE API_SAMPLE_EDGE
%type<node> API_GET_P API_GET_NODE_T
%type<node> API_GET_NB_NODE API_GET_RNB_NODE
%type<node> API_GET_NB_EDGE API_SAMPLE_NB
%type<node> SELECT V_SELECT
%type<node> V E SAMPLE_NODE SAMPLE_N_WITH_TYPES SAMPLE_EDGE SAMPLE_NB SAMPLE_LNB VA PARAMS CONDITION
%type<node> POST_PROCESS LIMIT ORDER_BY AS DNF CONJ TERM
%type<node> HAS HAS_LABEL HAS_KEY SIMPLE_CONDITION
%%
GREMLIN: TRAV end {return 0;}
;
TRAV: ROOT_NODE {t = new TreeNode("TRAV"); t->AddChild($1); $$ = t;}
| ROOT_EDGE {t = new TreeNode("TRAV"); t->AddChild($1); $$ = t;}
| ROOT_NODE SEARCH_NODE_WITH_SELECT {t = new TreeNode("TRAV"); t->AddChildren(2, $1, $2); $$ = t;}
| ROOT_NODE SEARCH_EDGE_WITH_SELECT {t = new TreeNode("TRAV"); t->AddChildren(2, $1, $2); $$ = t;}
| ROOT_NODE GET_VALUE_WITH_SELECT {t = new TreeNode("TRAV"); t->AddChildren(2, $1, $2); $$ = t;}
| ROOT_EDGE GET_VALUE_WITH_SELECT {t = new TreeNode("TRAV"); t->AddChildren(2, $1, $2); $$ = t;}
| ROOT_NODE SEARCH_NODE_WITH_SELECT GET_VALUE_WITH_SELECT {t = new TreeNode("TRAV"); t->AddChildren(3, $1, $2, $3); $$ = t;}
| ROOT_NODE SEARCH_EDGE_WITH_SELECT GET_VALUE_WITH_SELECT {t = new TreeNode("TRAV"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
ROOT_NODE: API_GET_NODE {t = new TreeNode("ROOT_NODE"); t->AddChild($1); $$ = t;}
| API_SAMPLE_NODE {t = new TreeNode("ROOT_NODE"); t->AddChild($1); $$ = t;}
| API_SAMPLE_N_WITH_TYPES {t = new TreeNode("ROOT_NODE"); t->AddChild($1); $$ = t;}
;
ROOT_EDGE: API_GET_EDGE {t = new TreeNode("ROOT_EDGE"); t->AddChild($1); $$ = t;}
| API_SAMPLE_EDGE {t = new TreeNode("ROOT_EDGE"); t->AddChild($1); $$ = t;}
;
GET_VALUE_WITH_SELECT: GET_VALUE {t = new TreeNode("GET_VALUE_WITH_SELECT"); t->AddChild($1); $$ = t;}
| GET_VALUE SELECT_VALUE {t = new TreeNode("GET_VALUE_WITH_SELECT"); t->AddChildren(2, $1, $2); $$ = t;}
| SELECT_VALUE {t = new TreeNode("GET_VALUE_WITH_SELECT"); t->AddChild($1); $$ = t;}
;
SELECT_VALUE: V_SELECT GET_VALUE {t = new TreeNode("SELECT_VALUE"); t->AddChildren(2, $1, $2); $$ = t;}
| V_SELECT GET_VALUE SELECT_VALUE {t = new TreeNode("SELECT_VALUE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
GET_VALUE: API_GET_P {t = new TreeNode("GET_VALUE"); t->AddChild($1); $$ = t;}
| API_GET_NODE_T {t = new TreeNode("GET_VALUE"); t->AddChild($1); $$ = t;}
;
SEARCH_NODE_WITH_SELECT: SEARCH_NODE {t = new TreeNode("SEARCH_NODE_WITH_SELECT"); t->AddChild($1); $$ = t;}
| SELECT SEARCH_NODE {t = new TreeNode("SEARCH_NODE_WITH_SELECT"); t->AddChildren(2, $1, $2); $$ = t;}
| SEARCH_NODE SEARCH_NODE_WITH_SELECT {t = new TreeNode("SEARCH_NODE_WITH_SELECT"); t->AddChildren(2, $1, $2); $$ = t;}
| SELECT SEARCH_NODE SEARCH_NODE_WITH_SELECT {t = new TreeNode("SEARCH_NODE_WITH_SELECT"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
SEARCH_NODE: API_GET_NB_NODE {t = new TreeNode("SEARCH_NODE"); t->AddChild($1); $$ = t;}
| API_GET_RNB_NODE {t = new TreeNode("SEARCH_NODE"); t->AddChild($1); $$ = t;}
| API_SAMPLE_NB {t = new TreeNode("SEARCH_NODE"); t->AddChild($1); $$ = t;}
| API_SAMPLE_LNB {t = new TreeNode("SEARCH_NODE"); t->AddChild($1); $$ = t;}
;
SEARCH_EDGE_WITH_SELECT: SEARCH_EDGE {t = new TreeNode("SEARCH_EDGE_WITH_SELECT"); t->AddChild($1); $$ = t;}
| SELECT SEARCH_EDGE {t = new TreeNode("SEARCH_EDGE_WITH_SELECT"); t->AddChildren(2, $1, $2); $$ = t;}
| SEARCH_NODE SEARCH_EDGE_WITH_SELECT {t = new TreeNode("SEARCH_EDGE_WITH_SELECT"); t->AddChildren(2, $1, $2); $$ = t;}
| SELECT SEARCH_NODE SEARCH_EDGE_WITH_SELECT {t = new TreeNode("SEARCH_EDGE_WITH_SELECT"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
SEARCH_EDGE: API_GET_NB_EDGE {t = new TreeNode("SEARCH_EDGE"); t->AddChild($1); $$ = t;}
;
SELECT: select_ p {t = new TreeNode("SELECT"); t->AddChildren(2, $1, $2); $$ = t;}
;
V_SELECT: v_select p {t = new TreeNode("SELECT"); t->AddChildren(2, $1, $2); $$ = t;}
;
API_GET_NODE: V {t = new TreeNode("API_GET_NODE"); t->AddChild($1); $$ = t;}
| V AS {t = new TreeNode("API_GET_NODE"); t->AddChildren(2, $1, $2); $$ = t;}
| V CONDITION {t = new TreeNode("API_GET_NODE"); t->AddChildren(2, $1, $2); $$ = t;}
| V CONDITION AS {t = new TreeNode("API_GET_NODE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
API_SAMPLE_NODE: SAMPLE_NODE {t = new TreeNode("API_SAMPLE_NODE"); t->AddChild($1); $$ = t;}
| SAMPLE_NODE AS {t = new TreeNode("API_SAMPLE_NODE"); t->AddChildren(2, $1, $2); $$ = t;}
| SAMPLE_NODE CONDITION {t = new TreeNode("API_SAMPLE_NODE"); t->AddChildren(2, $1, $2); $$ = t;}
| SAMPLE_NODE CONDITION AS {t = new TreeNode("API_SAMPLE_NODE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
API_SAMPLE_N_WITH_TYPES: SAMPLE_N_WITH_TYPES {t = new TreeNode("API_SAMPLE_N_WITH_TYPES"); t->AddChild($1); $$ = t;}
| SAMPLE_N_WITH_TYPES AS {t = new TreeNode("API_SAMPLE_N_WITH_TYPES"); t->AddChildren(2, $1, $2); $$ = t;}
| SAMPLE_N_WITH_TYPES CONDITION {t = new TreeNode("API_SAMPLE_N_WITH_TYPES"); t->AddChildren(2, $1, $2); $$ = t;}
| SAMPLE_N_WITH_TYPES CONDITION AS {t = new TreeNode("API_SAMPLE_N_WITH_TYPES"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
API_GET_EDGE: E {t = new TreeNode("API_GET_EDGE"); t->AddChild($1); $$ = t;}
| E AS {t = new TreeNode("API_GET_EDGE"); t->AddChildren(2, $1, $2); $$ = t;}
| E CONDITION {t = new TreeNode("API_GET_EDGE"); t->AddChildren(2, $1, $2); $$ = t;}
| E CONDITION AS {t = new TreeNode("API_GET_EDGE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
API_SAMPLE_EDGE: SAMPLE_EDGE {t = new TreeNode("API_SAMPLE_EDGE"); t->AddChild($1); $$ = t;}
| SAMPLE_EDGE AS {t = new TreeNode("API_SAMPLE_EDGE"); t->AddChildren(2, $1, $2); $$ = t;}
| SAMPLE_EDGE CONDITION {t = new TreeNode("API_SAMPLE_EDGE"); t->AddChildren(2, $1, $2); $$ = t;}
| SAMPLE_EDGE CONDITION AS {t = new TreeNode("API_SAMPLE_EDGE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
API_GET_P: VA {t = new TreeNode("API_GET_P"); t->AddChild($1); $$ = t;}
| VA AS {t = new TreeNode("API_GET_P"); t->AddChildren(2, $1, $2); $$ = t;}
;
API_GET_NODE_T: label {t = new TreeNode("API_GET_NODE_T"); t->AddChild($1); $$ = t;}
| label AS {t = new TreeNode("API_GET_NODE_T"); t->AddChildren(2, $1, $2); $$ = t;}
;
API_GET_NB_NODE: out_v p {t = new TreeNode("API_GET_NB_NODE"); t->AddChildren(2, $1, $2); $$ = t;}
| out_v p AS {t = new TreeNode("API_GET_NB_NODE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
| out_v p CONDITION {t = new TreeNode("API_GET_NB_NODE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
| out_v p CONDITION AS {t = new TreeNode("API_GET_NB_NODE"); t->AddChildren(4, $1, $2, $3, $4); $$ = t;}
;
API_GET_RNB_NODE: in_v {t = new TreeNode("API_GET_RNB_NODE"); t->AddChild($1); $$ = t;}
| in_v AS {t = new TreeNode("API_GET_RNB_NODE"); t->AddChildren(2, $1, $2); $$ = t;}
| in_v CONDITION {t = new TreeNode("API_GET_RNB_NODE"); t->AddChildren(2, $1, $2); $$ = t;}
| in_v CONDITION AS {t = new TreeNode("API_GET_RNB_NODE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
API_GET_NB_EDGE: out_e p {t = new TreeNode("API_GET_NB_EDGE"); t->AddChildren(2, $1, $2); $$ = t;}
| out_e p AS {t = new TreeNode("API_GET_NB_EDGE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
| out_e p CONDITION {t = new TreeNode("API_GET_NB_EDGE"); t->AddChildren(3, $1, $2, $3); $$ = t;}
| out_e p CONDITION AS {t = new TreeNode("API_GET_NB_EDGE"); t->AddChildren(4, $1, $2, $3, $4); $$ = t;}
;
API_SAMPLE_NB: SAMPLE_NB {t = new TreeNode("API_SAMPLE_NB"); t->AddChild($1); $$ = t;}
| SAMPLE_NB AS {t = new TreeNode("API_SAMPLE_NB"); t->AddChildren(2, $1, $2); $$ = t;}
| SAMPLE_NB CONDITION {t = new TreeNode("API_SAMPLE_NB"); t->AddChildren(2, $1, $2); $$ = t;}
| SAMPLE_NB CONDITION AS {t = new TreeNode("API_SAMPLE_NB"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
API_SAMPLE_LNB: SAMPLE_LNB {t = new TreeNode("API_SAMPLE_LNB"); t->AddChild($1); $$ = t;}
| SAMPLE_LNB AS {t = new TreeNode("API_SAMPLE_LNB"); t->AddChildren(2, $1, $2); $$ = t;}
;
V: v {t = new TreeNode("V"); t->AddChild($1); $$ = t;}
| v p {t = new TreeNode("V"); t->AddChildren(2, $1, $2); $$ = t;}
;
E: e {t = new TreeNode("E"); t->AddChild($1); $$ = t;}
| e p {t = new TreeNode("E"); t->AddChildren(2, $1, $2); $$ = t;}
;
SAMPLE_NODE: sample_node PARAMS {t = new TreeNode("SAMPLE_NODE"); t->AddChildren(2, $1, $2); $$ = t;}
;
SAMPLE_N_WITH_TYPES: sample_n_with_types PARAMS {t = new TreeNode("SAMPLE_N_WITH_TYPES"); t->AddChildren(2, $1, $2); $$ = t;}
SAMPLE_EDGE: sample_edge PARAMS {t = new TreeNode("SAMPLE_EDGE"); t->AddChildren(2, $1, $2); $$ = t;}
;
SAMPLE_NB: sample_neighbor PARAMS num {t = new TreeNode("SAMPLE_NB"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
SAMPLE_LNB: sample_l_nb PARAMS num {t = new TreeNode("SAMPLE_LNB"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
VA: values PARAMS {t = new TreeNode("VA"); t->AddChildren(2, $1, $2); $$ = t;}
| values PARAMS udf PARAMS {t = new TreeNode("VA"); t->AddChildren(4, $1, $2, $3, $4); $$ = t;}
| values PARAMS udf PARAMS l PARAMS r {t = new TreeNode("VA"); t->AddChildren(7, $1, $2, $3, $4, $5, $6, $7); $$ = t;}
;
PARAMS: p {t = new TreeNode("PARAMS"); t->AddChild($1); $$ = t;}
| p PARAMS {t = new TreeNode("PARAMS"); t->AddChildren(2, $1, $2); $$ = t;}
;
CONDITION: DNF {t = new TreeNode("CONDITION"); t->AddChild($1); $$ = t;}
| POST_PROCESS {t = new TreeNode("CONDITION"); t->AddChild($1); $$ = t;}
| DNF POST_PROCESS {t = new TreeNode("CONDITION"); t->AddChildren(2, $1, $2); $$ = t;}
;
POST_PROCESS: ORDER_BY {t = new TreeNode("POST_PROCESS"); t->AddChild($1); $$ = t;}
| LIMIT {t = new TreeNode("POST_PROCESS"); t->AddChild($1); $$ = t;}
| ORDER_BY LIMIT {t = new TreeNode("POST_PROCESS"); t->AddChildren(2, $1, $2); $$ = t;}
LIMIT: limit num {t = new TreeNode("LIMIT"); t->AddChildren(2, $1, $2); $$ = t;}
;
ORDER_BY: order_by p desc {t = new TreeNode("ORDER_BY"); t->AddChildren(3, $1, $2, $3); $$ = t;}
| order_by p asc {t = new TreeNode("ORDER_BY"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
AS: as p {t = new TreeNode("AS"); t->AddChildren(2, $1, $2); $$ = t;}
;
DNF: CONJ {t = new TreeNode("DNF"); t->AddChild($1); $$ = t;}
| CONJ or_ DNF {t = new TreeNode("DNF"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
CONJ: TERM {t = new TreeNode("CONJ"); t->AddChild($1); $$ = t;}
| TERM and_ CONJ {t = new TreeNode("CONJ"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
TERM: HAS {t = new TreeNode("TERM"); t->AddChild($1); $$ = t;}
| HAS_LABEL {t = new TreeNode("TERM"); t->AddChild($1); $$ = t;}
| HAS_KEY {t = new TreeNode("TERM"); t->AddChild($1); $$ = t;}
;
HAS: has p SIMPLE_CONDITION {t = new TreeNode("HAS"); t->AddChildren(3, $1, $2, $3); $$ = t;}
;
HAS_LABEL: has_label p {t = new TreeNode("HAS_LABEL"); t->AddChildren(2, $1, $2); $$ = t;}
;
HAS_KEY: has_key p {t = new TreeNode("HAS_KEY"); t->AddChildren(2, $1, $2); $$ = t;}
;
SIMPLE_CONDITION: gt num {t = new TreeNode("SIMPLE_CONDITION"); t->AddChildren(2, $1, $2); $$ = t;}
| lt num {t = new TreeNode("SIMPLE_CONDITION"); t->AddChildren(2, $1, $2); $$ = t;}
| eq num {t = new TreeNode("SIMPLE_CONDITION"); t->AddChildren(2, $1, $2); $$ = t;}
| eq p {t = new TreeNode("SIMPLE_CONDITION"); t->AddChildren(2, $1, $2); $$ = t;}
| ge num {t = new TreeNode("SIMPLE_CONDITION"); t->AddChildren(2, $1, $2); $$ = t;}
| le num {t = new TreeNode("SIMPLE_CONDITION"); t->AddChildren(2, $1, $2); $$ = t;}
| ne num {t = new TreeNode("SIMPLE_CONDITION"); t->AddChildren(2, $1, $2); $$ = t;}
;
%%
Tree BuildGrammarTree(std::string gremlin) {
gremlin += "\n";
char* str = new char[gremlin.length() + 1];
std::strcpy(str, gremlin.c_str());
YY_BUFFER_STATE bufferState = yy_scan_string(str);
yyparse();
Tree tree(t);
yy_delete_buffer(bufferState);
delete[] str;
return tree;
}
void yyerror(const char* s) {
std::cout << "Gremlin parse error!" << std::endl;
if (t != NULL) std::cout << "after parsing: " << t->FindLeft()->GetValue() << std::endl;
exit(1);
}
| Yacc | 4 | timpcfan/euler | euler/parser/gremlin.y | [
"Apache-2.0"
] |
-- @shouldFailWith TransitiveExportError
module Test (class Foo) where
import Prelude
class Foo a where
bar :: a -> a
| PureScript | 4 | metaleap/purs-with-dump-coreimp | examples/failing/MissingClassMemberExport.purs | [
"BSD-3-Clause"
] |
:- object(t).
:- uses(assignvars, [
assignable/1, assignable/2,
op(100, xfx, '<='), ('<=')/2,
op(100, xfx, '=>'), ('=>')/2
]).
:- public(p/1).
p(Value) :-
assignable(Assignable),
Assignable <= 1,
Assignable <= 2,
Assignable <= 3,
Assignable => Value.
:- public(q/1).
q(Value) :-
assignvars::(assignable(Assignable)),
assignvars::(Assignable <= 1),
assignvars::(Assignable <= 2),
assignvars::(Assignable <= 3),
assignvars::(Assignable => Value).
:- end_object.
| Logtalk | 3 | PaulBrownMagic/logtalk3 | library/assignvars/t.lgt | [
"Apache-2.0"
] |
<?xml version='1.0' encoding='utf-8'?>
<?python
from ennepe import __url__, __version__
?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#">
<head>
<title py:content="title" />
<link rel="alternate" type="application/atom+xml" title="Atom"
href="${blogroot}/feed/atom.xml" />
</head>
<body>
<h1><a href="${blogroot}/">${blogname}</a></h1>
<div class="main" py:content="body.contents()" />
<hr />
<p>Generated by <a href="${__url__}">Ennepe ${__version__}</a>.</p>
</body>
</html>
| Genshi | 3 | decklin/ennepe | examples/simple/style/xhtml.kid | [
"0BSD"
] |
#pragma once
#include <eigen3/Eigen/Dense>
#include "coordinates.hpp"
Eigen::Quaterniond ensure_unique(Eigen::Quaterniond quat);
Eigen::Quaterniond euler2quat(Eigen::Vector3d euler);
Eigen::Vector3d quat2euler(Eigen::Quaterniond quat);
Eigen::Matrix3d quat2rot(Eigen::Quaterniond quat);
Eigen::Quaterniond rot2quat(const Eigen::Matrix3d &rot);
Eigen::Matrix3d euler2rot(Eigen::Vector3d euler);
Eigen::Vector3d rot2euler(const Eigen::Matrix3d &rot);
Eigen::Matrix3d rot_matrix(double roll, double pitch, double yaw);
Eigen::Matrix3d rot(Eigen::Vector3d axis, double angle);
Eigen::Vector3d ecef_euler_from_ned(ECEF ecef_init, Eigen::Vector3d ned_pose);
Eigen::Vector3d ned_euler_from_ecef(ECEF ecef_init, Eigen::Vector3d ecef_pose);
| C++ | 4 | wolterhv/openpilot | common/transformations/orientation.hpp | [
"MIT"
] |
// @noImplicitAny: true
function getNumber(): number {
return 1;
}
class Example {
getNumber(): number {
return 1;
}
doSomething(a = this.getNumber()): typeof a {
return a;
}
}
function weird(this: Example, a = this.getNumber()) {
return a;
}
class Weird {
doSomething(this: Example, a = this.getNumber()) {
return a;
}
}
| TypeScript | 3 | nilamjadhav/TypeScript | tests/cases/compiler/inferParameterWithMethodCallInitializer.ts | [
"Apache-2.0"
] |
import * as React from 'react';
import CircularProgress from '@mui/material/CircularProgress';
export default function CircularUnderLoad() {
return <CircularProgress disableShrink />;
}
| TypeScript | 4 | dany-freeman/material-ui | docs/data/material/components/progress/CircularUnderLoad.tsx | [
"MIT"
] |
/**
* A NIC offloading example using DPDK's Flow API.
* Three NIC rules are offloaded, each dispatching matched packets
* to one of the first 3 NIC queues. Another 2 queues are used by RSS.
*/
/**
* Deploy as follows:
* sudo ../../bin/click --dpdk -l 0-4 -w 0000:11:00.0 -v -- dpdk-flow-parser.click
*/
define(
$ifacePCI0 0000:11:00.0,
$queues 5,
$threads $queues,
$numa false,
$mode flow, // Rx mode required by the DPDK Flow Rule Manager
$verbose 99,
$rules test_dpdk_nic_rules // Better provide absolute path
);
// NIC in Flow Rule Manager's mode
fd0 :: FromDPDKDevice(
PORT $ifacePCI0, MODE $mode,
N_QUEUES $queues, NUMA $numa,
THREADOFFSET 0, MAXTHREADS $threads,
FLOW_RULES_FILE $rules,
VERBOSE $verbose, PAUSE full
);
fd0
-> classifier :: Classifier(12/0800, -)
-> Strip(14)
-> check :: CheckIPHeader(VERBOSE true)
-> IPPrint(ETHER true, LENGTH true)
-> Unstrip(14)
-> legit :: AverageCounterMP()
-> Discard;
dropped :: AverageCounterMP();
classifier[1] -> dropped;
check[1] -> dropped;
dropped -> Discard;
DriverManager(
pause,
print "",
print "[Rule 1 - Queue 0]: "$(fd0.xstats rx_q0packets)" packets - "$(fd0.xstats rx_q0bytes)" bytes",
print "[Rule 2 - Queue 1]: "$(fd0.xstats rx_q1packets)" packets - "$(fd0.xstats rx_q1bytes)" bytes",
print "[Rule 3 - Queue 2]: "$(fd0.xstats rx_q2packets)" packets - "$(fd0.xstats rx_q2bytes)" bytes",
print "[ RSS - Queue 3]: "$(fd0.xstats rx_q3packets)" packets - "$(fd0.xstats rx_q3bytes)" bytes",
print "[ RSS - Queue 4]: "$(fd0.xstats rx_q4packets)" packets - "$(fd0.xstats rx_q4bytes)" bytes",
print "",
print " IPv4: "$(legit.count),
print "Dropped: "$(dropped.count),
stop
);
| Click | 4 | BorisPis/asplos22-nicmem-fastclick | conf/flow-parser/dpdk-flow-parser.click | [
"BSD-3-Clause-Clear"
] |
REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "REBOL Internal Dialect: Rich Text"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
}
Note: "Modification requires recompiling affected source files."
]
system/dialects/text: construct [
type-spec: [string! tuple!]
bold: [logic!]
italic: [logic!]
underline: [logic!]
font: [object!]
para: [object!]
size: [integer!]
shadow: [pair! tuple! integer!]
scroll: [pair!]
drop: [integer!]
anti-alias: [logic!]
newline: []
caret: [object!]
center: []
left: []
right: []
; Aliases
b:
i:
u:
nl:
]
| Rebol | 4 | 0branch/r3 | src/mezz/dial-text.reb | [
"Apache-2.0"
] |
- description: JSON variables should not be interpreted as graphql input values
url: /v1/graphql
status: 200
response:
data:
insert_article_one:
body:
1: 2
2: 3
query:
query: |
mutation insert_article($body: jsonb) {
insert_article_one(object: {body: $body}) {
body
}
}
variables:
body:
1: 2
2: 3
- description: variables within JSON values should be properly interpolated
url: /v1/graphql
status: 200
response:
data:
insert_article_one:
body:
- header: "X-HEADER-THINGY"
query:
query: |
mutation insert_article($header: jsonb) {
insert_article_one(object: {body: [{header: $header}]}) {
body
}
}
variables:
header: "X-HEADER-THINGY"
| YAML | 3 | gh-oss-contributor/graphql-engine-1 | server/tests-py/queries/graphql_validation/json_column_value.yaml | [
"Apache-2.0",
"MIT"
] |
Rem
Ceil(x#) returns the smallest integral value not less than x
End Rem
for i#=-1 to 1 step .2
print "Ceil("+i+")="+Ceil(i)
next
| BlitzMax | 3 | jabdoa2/blitzmax | mod/brl.mod/blitz.mod/doc/ceil.bmx | [
"Zlib"
] |
package com.baeldung.config;
import org.jobrunr.jobs.mappers.JobMapper;
import org.jobrunr.storage.InMemoryStorageProvider;
import org.jobrunr.storage.StorageProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class StorageProviderConfig {
@Bean
public StorageProvider storageProvider(JobMapper jobMapper) {
InMemoryStorageProvider storageProvider = new InMemoryStorageProvider();
storageProvider.setJobMapper(jobMapper);
return storageProvider;
}
}
| Java | 4 | DBatOWL/tutorials | spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/config/StorageProviderConfig.java | [
"MIT"
] |
import time
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
driver.implicitly_wait(5)
time.sleep(1)
try:
print driver.current_url
driver.switch_to_window(driver.window_handles[-1])
driver.find_element_by_tag_name('a').click() #navigate
driver.switch_to_window(driver.window_handles[0])
driver.find_element_by_tag_name('button').click() #get target window
result = driver.find_element_by_id('result').get_attribute('innerHTML')
print result
assert('success' in result)
driver.switch_to_window(driver.window_handles[-1])
driver.find_element_by_tag_name('button').click() #click close button
driver.switch_to_window(driver.window_handles[0])
result = driver.find_element_by_id('result2').get_attribute('innerHTML')
print result
assert('success' in result)
finally:
driver.quit()
| Python | 2 | namaljayathunga/nw.js | test/remoting/wopen-obj-navigate/test.py | [
"MIT"
] |
(set-info :smt-lib-version 2.6)
(set-logic QF_IDL)
(set-info :source |The Averest Framework (http://www.averest.org)|)
(set-info :category "industrial")
(set-info :status sat)
(declare-fun cvclZero () Int)
(declare-fun F0 () Int)
(declare-fun F2 () Int)
(declare-fun F4 () Int)
(declare-fun F6 () Int)
(declare-fun F8 () Int)
(declare-fun F14 () Int)
(declare-fun F16 () Int)
(declare-fun F18 () Int)
(declare-fun F20 () Int)
(declare-fun F22 () Int)
(declare-fun F30 () Int)
(declare-fun F31 () Int)
(declare-fun F32 () Int)
(declare-fun F33 () Int)
(declare-fun F34 () Int)
(declare-fun F37 () Int)
(declare-fun F38 () Int)
(declare-fun F39 () Int)
(declare-fun F40 () Int)
(declare-fun F41 () Int)
(declare-fun F62 () Int)
(declare-fun F63 () Int)
(declare-fun F64 () Int)
(declare-fun F65 () Int)
(declare-fun F66 () Int)
(declare-fun F70 () Int)
(declare-fun F71 () Int)
(declare-fun F72 () Int)
(declare-fun F73 () Int)
(declare-fun F74 () Int)
(declare-fun F77 () Int)
(declare-fun F78 () Int)
(declare-fun F79 () Int)
(declare-fun F80 () Int)
(declare-fun F81 () Int)
(declare-fun P10 () Bool)
(declare-fun P12 () Bool)
(declare-fun P24 () Bool)
(declare-fun P26 () Bool)
(declare-fun P28 () Bool)
(declare-fun P35 () Bool)
(declare-fun P36 () Bool)
(declare-fun P42 () Bool)
(declare-fun P43 () Bool)
(declare-fun P44 () Bool)
(declare-fun P60 () Bool)
(declare-fun P61 () Bool)
(declare-fun P67 () Bool)
(declare-fun P68 () Bool)
(declare-fun P69 () Bool)
(declare-fun P75 () Bool)
(declare-fun P76 () Bool)
(declare-fun P82 () Bool)
(declare-fun P83 () Bool)
(declare-fun P84 () Bool)
(assert (let ((?v_0 (not P10)) (?v_3 (and P10 P24))) (let ((?v_8 (and ?v_0 ?v_3)) (?v_2 (and P10 P26))) (let ((?v_1 (and ?v_8 ?v_2)) (?v_10 (and P10 ?v_3))) (let ((?v_4 (and ?v_2 ?v_10)) (?v_6 (not ?v_3))) (let ((?v_13 (and ?v_0 ?v_6))) (let ((?v_5 (and ?v_2 ?v_13)) (?v_15 (and P10 ?v_6))) (let ((?v_7 (and ?v_2 ?v_15)) (?v_11 (not ?v_2))) (let ((?v_9 (and ?v_8 ?v_11)) (?v_12 (and ?v_10 ?v_11)) (?v_14 (and ?v_13 ?v_11)) (?v_16 (and ?v_15 ?v_11)) (?v_28 (and P82 P75))) (let ((?v_31 (and ?v_28 P75)) (?v_27 (and P83 P75))) (let ((?v_37 (not ?v_27))) (let ((?v_39 (and ?v_31 ?v_37)) (?v_29 (not P75)) (?v_34 (not ?v_28))) (let ((?v_40 (and ?v_34 ?v_29))) (let ((?v_33 (and ?v_27 ?v_40)) (?v_36 (and ?v_28 ?v_29))) (let ((?v_30 (and ?v_27 ?v_36)) (?v_32 (and ?v_27 ?v_31)) (?v_42 (and ?v_34 P75))) (let ((?v_35 (and ?v_27 ?v_42)) (?v_38 (and ?v_36 ?v_37)) (?v_41 (and ?v_40 ?v_37)) (?v_43 (and ?v_42 ?v_37)) (?v_44 (and P84 P75))) (let ((?v_48 (not (= ?v_44 (and ?v_27 ?v_28)))) (?v_51 (not (= ?v_27 ?v_28))) (?v_61 (not P35)) (?v_69 (and P35 P43))) (let ((?v_63 (not ?v_69)) (?v_66 (and P35 P42))) (let ((?v_64 (not ?v_66))) (let ((?v_70 (and P35 ?v_64))) (let ((?v_62 (and ?v_63 ?v_70)) (?v_72 (and ?v_61 ?v_64))) (let ((?v_65 (and ?v_63 ?v_72)) (?v_74 (and P35 ?v_66))) (let ((?v_67 (and ?v_63 ?v_74)) (?v_76 (and ?v_61 ?v_66))) (let ((?v_68 (and ?v_63 ?v_76)) (?v_71 (and ?v_69 ?v_70)) (?v_73 (and ?v_69 ?v_72)) (?v_75 (and ?v_69 ?v_74)) (?v_77 (and ?v_69 ?v_76)) (?v_84 (and P35 P44)) (?v_83 (not (= ?v_66 ?v_69)))) (let ((?v_85 (not (= (and ?v_66 ?v_69) ?v_84))) (?v_25 (= (- F2 F0) 0)) (?v_26 (= (- F22 F14) 0)) (?v_23 (= (- F4 F0) 0)) (?v_24 (= (- F22 F16) 0)) (?v_22 (= (- F6 F0) 0)) (?v_21 (= (- F22 F18) 0)) (?v_19 (= (- F8 F0) 0)) (?v_20 (= (- F22 F20) 0))) (let ((?v_18 (or (or (or (or (or (or (or (or (or (or (or (or (or (or (or (and ?v_25 (and ?v_0 ?v_1)) (and (= (- F22 F2) 0) (and P10 ?v_1))) (and (= (- F14 F0) 0) (and ?v_0 ?v_4))) (and ?v_26 (and P10 ?v_4))) (and ?v_23 (and ?v_0 ?v_5))) (and (= (- F22 F4) 0) (and P10 ?v_5))) (and (= (- F16 F0) 0) (and ?v_0 ?v_7))) (and ?v_24 (and P10 ?v_7))) (and ?v_22 (and ?v_0 ?v_9))) (and (= (- F22 F6) 0) (and P10 ?v_9))) (and (= (- F18 F0) 0) (and ?v_0 ?v_12))) (and ?v_21 (and P10 ?v_12))) (and (and ?v_0 ?v_14) ?v_19)) (and (and P10 ?v_14) (= (- F22 F8) 0))) (and (and ?v_0 ?v_16) (= (- F20 F0) 0))) (and (and P10 ?v_16) ?v_20)))) (let ((?v_17 (not (and (not (and P10 P28)) ?v_18)))) (let ((?v_60 (or (not (or (and P12 ?v_17) (and ?v_0 ?v_17))) ?v_18)) (?v_56 (= (- F72 F70) 0)) (?v_54 (= (- F71 F70) 0)) (?v_55 (= (- F81 F77) 0)) (?v_57 (= (- F81 F78) 0)) (?v_59 (= (- F73 F70) 0)) (?v_58 (= (- F81 F79) 0)) (?v_52 (= (- F74 F70) 0)) (?v_53 (= (- F81 F80) 0))) (let ((?v_46 (and (or (or (or (or (or (or (and (and ?v_39 ?v_29) (= (- F79 F70) 0)) (or (or (or (or (or (or (and ?v_56 (and ?v_33 ?v_29)) (or (or (or (and ?v_54 (and ?v_30 ?v_29)) (and (= (- F81 F71) 0) (and ?v_30 P75))) (and (and ?v_32 ?v_29) (= (- F77 F70) 0))) (and ?v_55 (and ?v_32 P75)))) (and (= (- F81 F72) 0) (and ?v_33 P75))) (and (= (- F78 F70) 0) (and ?v_35 ?v_29))) (and ?v_57 (and ?v_35 P75))) (and ?v_59 (and ?v_38 ?v_29))) (and (= (- F81 F73) 0) (and ?v_38 P75)))) (and (and ?v_39 P75) ?v_58)) (and (and ?v_41 ?v_29) ?v_52)) (and (and ?v_41 P75) (= (- F81 F74) 0))) (and (and ?v_43 ?v_29) (= (- F80 F70) 0))) (and (and ?v_43 P75) ?v_53)) (not ?v_44)))) (let ((?v_45 (and ?v_46 P76))) (let ((?v_49 (not ?v_45)) (?v_47 (and ?v_46 ?v_29))) (let ((?v_50 (not ?v_47)) (?v_92 (= (- F41 F40) 0)) (?v_93 (= (- F34 F30) 0)) (?v_91 (= (- F41 F39) 0)) (?v_90 (= (- F33 F30) 0)) (?v_88 (= (- F41 F38) 0)) (?v_89 (= (- F32 F30) 0)) (?v_86 (= (- F41 F37) 0)) (?v_87 (= (- F31 F30) 0))) (let ((?v_78 (and (or (and ?v_92 (and P35 ?v_62)) (or (and (= (- F40 F30) 0) (and ?v_61 ?v_62)) (or (and (= (- F41 F34) 0) (and P35 ?v_65)) (or (and ?v_93 (and ?v_61 ?v_65)) (or (and ?v_91 (and P35 ?v_67)) (or (and (and ?v_61 ?v_67) (= (- F39 F30) 0)) (or (and (and P35 ?v_68) (= (- F41 F33) 0)) (or (and ?v_90 (and ?v_61 ?v_68)) (or (and ?v_88 (and P35 ?v_71)) (or (and (and ?v_61 ?v_71) (= (- F38 F30) 0)) (or (and (and P35 ?v_73) (= (- F41 F32) 0)) (or (and ?v_89 (and ?v_61 ?v_73)) (or (and ?v_86 (and P35 ?v_75)) (or (and (and ?v_61 ?v_75) (= (- F37 F30) 0)) (or (and (and P35 ?v_77) (= (- F41 F31) 0)) (and ?v_87 (and ?v_61 ?v_77))))))))))))))))) (not ?v_84)))) (let ((?v_79 (and ?v_61 ?v_78)) (?v_80 (and P36 ?v_78))) (let ((?v_81 (not ?v_79)) (?v_82 (not ?v_80))) (or (not (or ?v_60 (not (and (and (and (and (and (= (- cvclZero F22) 0) (and (= (- cvclZero F20) 0) (and (= (- cvclZero F18) 0) (and (and (= (- cvclZero F14) 0) (and ?v_0 (not P12))) (= (- cvclZero F16) 0))))) (not P24)) (not P26)) (not P28)) (or (or (and ?v_0 ?v_19) (and P10 ?v_20)) (or (or (and P10 ?v_21) (and ?v_0 ?v_22)) (or (or (and ?v_0 ?v_23) (and P10 ?v_24)) (or (and ?v_0 ?v_25) (and P10 ?v_26))))))))) (and (and (and (= (or (and (or (and ?v_45 ?v_48) (and ?v_44 ?v_49)) ?v_50) (and ?v_47 ?v_48)) P69) (and (= (or (and (or (and ?v_51 ?v_45) (and ?v_27 ?v_49)) ?v_50) (and ?v_51 ?v_47)) P68) (and (= (or (and (or (and ?v_49 ?v_28) (and ?v_45 ?v_34)) ?v_50) (and ?v_47 ?v_34)) P67) (and (and (or (and (= (- F74 F65) 0) ?v_29) (and (= (- F80 F65) 0) P75)) (and (or (and (= (- F73 F64) 0) ?v_29) (and (= (- F79 F64) 0) P75)) (and (and (or (and (= (- F77 F62) 0) P75) (and (= (- F71 F62) 0) ?v_29)) (and (= (or ?v_47 ?v_45) P61) P60)) (or (and (= (- F72 F63) 0) ?v_29) (and (= (- F78 F63) 0) P75))))) (or (and (= (- F81 F66) 0) P75) (and (= (- F70 F66) 0) ?v_29)))))) (and (or (or (and ?v_52 ?v_29) (and ?v_53 P75)) (or (or (or (and ?v_54 ?v_29) (and ?v_55 P75)) (or (and ?v_56 ?v_29) (and ?v_57 P75))) (or (and ?v_58 P75) (and ?v_59 ?v_29)))) (and (not P84) (and (and (and (= (- cvclZero F81) 0) (and (= (- cvclZero F80) 0) (and (= (- cvclZero F79) 0) (and (= (- cvclZero F78) 0) (and (= (- cvclZero F77) 0) (and (not P76) ?v_29)))))) (not P82)) (not P83))))) (not (or ?v_60 (not (and (and (and (and (and (and (and (and (and (or (and P35 (= (- F37 F14) 0)) (and ?v_61 (= (- F31 F14) 0))) (and P10 (= P12 (or ?v_79 ?v_80)))) (or (and P35 (= (- F38 F16) 0)) (and ?v_61 (= (- F32 F16) 0)))) (or (and P35 (= (- F39 F18) 0)) (and ?v_61 (= (- F33 F18) 0)))) (or (and P35 (= (- F40 F20) 0)) (and ?v_61 (= (- F34 F20) 0)))) (or (and ?v_61 (= (- F30 F22) 0)) (and P35 (= (- F41 F22) 0)))) (= P24 (or (and ?v_64 ?v_79) (and ?v_81 (or (and ?v_64 ?v_80) (and ?v_66 ?v_82)))))) (= P26 (or (and ?v_79 ?v_83) (and ?v_81 (or (and ?v_69 ?v_82) (and ?v_80 ?v_83)))))) (= P28 (or (and ?v_85 ?v_79) (and (or (and ?v_84 ?v_82) (and ?v_85 ?v_80)) ?v_81)))) (and (or (or (or (or (and ?v_86 P35) (and ?v_87 ?v_61)) (or (and P35 ?v_88) (and ?v_61 ?v_89))) (or (and ?v_61 ?v_90) (and P35 ?v_91))) (or (and P35 ?v_92) (and ?v_61 ?v_93))) (and (not P44) (and (not P43) (and (not P42) (and (and (and (and (= (- cvclZero F38) 0) (and (and ?v_61 (not P36)) (= (- cvclZero F37) 0))) (= (- cvclZero F39) 0)) (= (- cvclZero F40) 0)) (= (- cvclZero F41) 0)))))))))))))))))))))))))))))))))))))))))))))))
(check-sat)
(exit)
| SMT | 3 | livinlife6751/infer | sledge/test/smt/QF_IDL/Averest/linear_search/LinearSearch_safe_blmc000.smt2 | [
"MIT"
] |
/// Error handling with the Result type.
import Prim "mo:⛔";
import P "Prelude";
import Order "Order";
module {
/// `Result<Ok, Err>` is the type used for returning and propagating errors. It
/// is a type with the variants, `#ok(Ok)`, representing success and containing
/// a value, and `#err(Err)`, representing error and containing an error value.
///
/// The simplest way of working with `Result`s is to pattern match on them:
///
/// For example, given a function `createUser(user : User) : Result<Id, String>`
/// where `String` is an error message we could use it like so:
/// ```
/// switch(createUser(myUser)) {
/// case #ok(id) Debug.print("Created new user with id: " # id)
/// case #err(msg) Debug.print("Failed to create user with the error: " # msg)
/// }
/// ```
public type Result<Ok, Err> = {
#ok : Ok;
#err : Err;
};
// Compares two Result's for equality.
public func equal<Ok, Err>(
eqOk : (Ok, Ok) -> Bool,
eqErr : (Err, Err) -> Bool,
r1 : Result<Ok, Err>,
r2 : Result<Ok, Err>
) : Bool {
switch (r1, r2) {
case (#ok(ok1), #ok(ok2)) {
eqOk(ok1, ok2)
};
case (#err(err1), #err(err2)) {
eqErr(err1, err2);
};
case _ { false };
};
};
// Compares two Results. `#ok` is larger than `#err`. This ordering is
// arbitrary, but it lets you for example use Results as keys in ordered maps.
public func compare<Ok, Err>(
compareOk : (Ok, Ok) -> Order.Order,
compareErr : (Err, Err) -> Order.Order,
r1 : Result<Ok, Err>,
r2 : Result<Ok, Err>
) : Order.Order {
switch (r1, r2) {
case (#ok(ok1), #ok(ok2)) {
compareOk(ok1, ok2)
};
case (#err(err1), #err(err2)) {
compareErr(err1, err2)
};
case (#ok(_), _) { #greater };
case (#err(_), _) { #less };
};
};
/// Allows sequencing of `Result` values and functions that return
/// `Result`'s themselves.
/// ```motoko
/// import Result "mo:base/Result";
/// type Result<T,E> = Result.Result<T, E>;
/// func largerThan10(x : Nat) : Result<Nat, Text> =
/// if (x > 10) { #ok(x) } else { #err("Not larger than 10.") };
///
/// func smallerThan20(x : Nat) : Result<Nat, Text> =
/// if (x < 20) { #ok(x) } else { #err("Not smaller than 20.") };
///
/// func between10And20(x : Nat) : Result<Nat, Text> =
/// Result.chain(largerThan10(x), smallerThan20);
///
/// assert(between10And20(15) == #ok(15));
/// assert(between10And20(9) == #err("Not larger than 10."));
/// assert(between10And20(21) == #err("Not smaller than 20."));
/// ```
public func chain<R1, R2, Error>(
x : Result<R1, Error>,
y : R1 -> Result<R2, Error>
) : Result<R2, Error> {
switch x {
case (#err(e)) { #err(e) };
case (#ok(r)) { y(r) };
}
};
/// Flattens a nested Result.
///
/// ```motoko
/// import Result "mo:base/Result";
/// assert(Result.flatten<Nat, Text>(#ok(#ok(10))) == #ok(10));
/// assert(Result.flatten<Nat, Text>(#err("Wrong")) == #err("Wrong"));
/// assert(Result.flatten<Nat, Text>(#ok(#err("Wrong"))) == #err("Wrong"));
/// ```
public func flatten<Ok, Error>(
result : Result<Result<Ok, Error>, Error>
) : Result<Ok, Error> {
switch result {
case (#ok(ok)) { ok };
case (#err(err)) { #err(err) };
}
};
/// Maps the `Ok` type/value, leaving any `Error` type/value unchanged.
public func mapOk<Ok1, Ok2, Error>(
x : Result<Ok1, Error>,
f : Ok1 -> Ok2
) : Result<Ok2, Error> {
switch x {
case (#err(e)) { #err(e) };
case (#ok(r)) { #ok(f(r)) };
}
};
/// Maps the `Err` type/value, leaving any `Ok` type/value unchanged.
public func mapErr<Ok, Error1, Error2>(
x : Result<Ok, Error1>,
f : Error1 -> Error2
) : Result<Ok, Error2> {
switch x {
case (#err(e)) { #err (f(e)) };
case (#ok(r)) { #ok(r) };
}
};
/// Create a result from an option, including an error value to handle the `null` case.
/// ```motoko
/// import Result "mo:base/Result";
/// assert(Result.fromOption(?42, "err") == #ok(42));
/// assert(Result.fromOption(null, "err") == #err("err"));
/// ```
public func fromOption<R, E>(x : ?R, err : E) : Result<R, E> {
switch x {
case (?x) { #ok(x) };
case null { #err(err) };
}
};
/// Create an option from a result, turning all #err into `null`.
/// ```motoko
/// import Result "mo:base/Result";
/// assert(Result.toOption(#ok(42)) == ?42);
/// assert(Result.toOption(#err("err")) == null);
/// ```
public func toOption<R, E>(r : Result<R, E>) : ?R {
switch r {
case (#ok(x)) { ?x };
case (#err(_)) { null };
}
};
/// Applies a function to a successful value, but discards the result. Use
/// `iterate` if you're only interested in the side effect `f` produces.
///
/// ```motoko
/// import Result "mo:base/Result";
/// var counter : Nat = 0;
/// Result.iterate<Nat, Text>(#ok(5), func (x : Nat) { counter += x });
/// assert(counter == 5);
/// Result.iterate<Nat, Text>(#err("Wrong"), func (x : Nat) { counter += x });
/// assert(counter == 5);
/// ```
public func iterate<Ok, Err>(res : Result<Ok, Err>, f : Ok -> ()) {
switch res {
case (#ok(ok)) { f(ok) };
case _ {};
}
};
// Whether this Result is an `#ok`
public func isOk(r : Result<Any, Any>) : Bool {
switch r {
case (#ok(_)) { true };
case (#err(_)) { false };
}
};
// Whether this Result is an `#err`
public func isErr(r : Result<Any, Any>) : Bool {
switch r {
case (#ok(_)) { false };
case (#err(_)) { true };
}
};
/// Asserts that its argument is an `#ok` result, traps otherwise.
public func assertOk(r : Result<Any,Any>) {
switch(r) {
case (#err(_)) { assert false };
case (#ok(_)) {};
}
};
/// Asserts that its argument is an `#err` result, traps otherwise.
public func assertErr(r : Result<Any,Any>) {
switch(r) {
case (#err(_)) {};
case (#ok(_)) assert false;
}
};
}
| Modelica | 5 | nomeata/motoko-base | src/Result.mo | [
"Apache-2.0"
] |
/*##############################################################################
HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
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.
############################################################################## */
//Check the simple varieties
GenderEnum := enum(unsigned1, Male,Female,Either,Unknown);
PersonFlags := enum(None = 0, Dead=1, Foreign=2,Terrorist=4,Wanted=Terrorist*2);
namesRecord :=
RECORD
string20 surname;
string10 forename;
GenderEnum gender;
integer2 age := 25;
END;
namesTable2 := dataset([
{'Hawthorn','Gavin',GenderEnum.Male,PersonFlags.Foreign},
{'Bin Laden','Osama',GenderEnum.Male,PersonFlags.Foreign+PersonFlags.Terrorist+PersonFlags.Wanted}
], namesRecord);
output(namesTable2);
// Nasty - an enum defined inside a module - the values for the enum need to be bound later.
myModule(unsigned4 baseError, string x) := MODULE
export ErrorCode := ENUM(ErrorBase = baseError,
ErrNoActiveTable,
ErrNoActiveSystem,
ErrFatal,
ErrLast);
export reportX := FAIL(ErrorCode.ErrNoActiveTable, 'No ActiveTable in '+x);
end;
myModule(100, 'Call1').reportX;
myModule(300, 'Call2').reportX;
//Another nasty - typedef an enum from a child module - hit problems with not binding correctly
ErrorCodes := myModule(999, 'Call3').errorCode;
output(ErrorCodes.ErrFatal);
output(myModule(1999, 'Call4').errorCode.ErrFatal);
| ECL | 3 | miguelvazq/HPCC-Platform | ecl/regress/enum.ecl | [
"Apache-2.0"
] |
.root
background: var(--color-back)
border-radius: 2em
border: 1px solid var(--color-subtle)
width: 100%
padding: 0.25em 1em
display: inline-flex
margin: var(--spacing-xs) 0
font: var(--font-size-code)/var(--line-height-code) var(--font-code)
-webkit-font-smoothing: subpixel-antialiased
-moz-osx-font-smoothing: auto
.textarea
flex: 100%
background: transparent
resize: none
font: inherit
overflow: hidden
white-space: nowrap
text-overflow: ellipsis
margin-right: 1rem
.prefix
margin-right: 0.75em
color: var(--color-subtle-dark)
| Sass | 2 | snosrap/spaCy | website/src/styles/copy.module.sass | [
"MIT"
] |
/******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#pragma once
#include "modules/canbus/proto/chassis_detail.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"
namespace apollo {
namespace canbus {
namespace lexus {
class Interiorlightsrpt416 : public ::apollo::drivers::canbus::ProtocolData<
::apollo::canbus::ChassisDetail> {
public:
static const int32_t ID;
Interiorlightsrpt416();
void Parse(const std::uint8_t* bytes, int32_t length,
ChassisDetail* chassis) const override;
private:
// config detail: {'name': 'DIM_LEVEL_IS_VALID', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 19, 'type': 'bool', 'order': 'motorola', 'physical_unit':
// ''}
bool dim_level_is_valid(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'MOOD_LIGHTS_ON_IS_VALID', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 18, 'type': 'bool', 'order': 'motorola', 'physical_unit':
// ''}
bool mood_lights_on_is_valid(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'REAR_DOME_LIGHTS_ON_IS_VALID', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 17, 'type': 'bool', 'order': 'motorola', 'physical_unit':
// ''}
bool rear_dome_lights_on_is_valid(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'FRONT_DOME_LIGHTS_ON_IS_VALID', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 16, 'type': 'bool', 'order': 'motorola', 'physical_unit':
// ''}
bool front_dome_lights_on_is_valid(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'DIM_LEVEL', 'enum': {0: 'DIM_LEVEL_DIM_LEVEL_MIN',
// 1: 'DIM_LEVEL_DIM_LEVEL_1', 2: 'DIM_LEVEL_DIM_LEVEL_2', 3:
// 'DIM_LEVEL_DIM_LEVEL_3', 4: 'DIM_LEVEL_DIM_LEVEL_4', 5:
// 'DIM_LEVEL_DIM_LEVEL_5', 6: 'DIM_LEVEL_DIM_LEVEL_6', 7:
// 'DIM_LEVEL_DIM_LEVEL_7', 8: 'DIM_LEVEL_DIM_LEVEL_8', 9:
// 'DIM_LEVEL_DIM_LEVEL_9', 10: 'DIM_LEVEL_DIM_LEVEL_10', 11:
// 'DIM_LEVEL_DIM_LEVEL_11', 12: 'DIM_LEVEL_DIM_LEVEL_MAX'}, 'precision': 1.0,
// 'len': 8, 'is_signed_var': False, 'offset': 0.0, 'physical_range':
// '[0|12]', 'bit': 15, 'type': 'enum', 'order': 'motorola', 'physical_unit':
// ''}
Interior_lights_rpt_416::Dim_levelType dim_level(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'MOOD_LIGHTS_ON', 'offset': 0.0, 'precision': 1.0,
// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 2,
// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
bool mood_lights_on(const std::uint8_t* bytes, const int32_t length) const;
// config detail: {'name': 'REAR_DOME_LIGHTS_ON', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 1, 'type': 'bool', 'order': 'motorola', 'physical_unit':
// ''}
bool rear_dome_lights_on(const std::uint8_t* bytes,
const int32_t length) const;
// config detail: {'name': 'FRONT_DOME_LIGHTS_ON', 'offset': 0.0,
// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
// '[0|1]', 'bit': 0, 'type': 'bool', 'order': 'motorola', 'physical_unit':
// ''}
bool front_dome_lights_on(const std::uint8_t* bytes,
const int32_t length) const;
};
} // namespace lexus
} // namespace canbus
} // namespace apollo
| C | 5 | seeclong/apollo | modules/canbus/vehicle/lexus/protocol/interior_lights_rpt_416.h | [
"Apache-2.0"
] |
<script>
// the actual server response does not matter
// just trying to verify the network layer does not crash
// https://github.com/cypress-io/cypress/issues/15901
fetch('http://localhost:5000/api/sample', {
method: 'POST',
body: JSON.stringify({
// does not crash
// first: 'hello'
// crash
first: '東京都新東東'
})
}).catch(r => {
console.log(r)
})
</script>
| HTML | 4 | bkucera2/cypress | packages/driver/cypress/fixtures/utf8-post.html | [
"MIT"
] |
M ← 200
N ← 300
K ← 200 300
Kr ← 300 200
⍝ b ← 1 4
⍝ 2 5
⍝ 3 6
⍝ c ← 11 24
⍝ 12 25
⍝ 13 26
⍝ d ← 35 37 39
⍝ e ← 50505
a ← K ⍴ ⍳ M × N
b ← ⍉ a
c ← b + 10 × Kr ⍴ ⍳ M
d ← +/ Kr ⍴ c
e ← +/ d | APL | 2 | mbudde/apltail | tests/cosmin.apl | [
"MIT"
] |
FORMAT: 1A
# Attributes API
This API example demonstrates how to describe body attributes of a request or response message.
In this case, the description is complementary (and duplicate!) to the provided JSON example in the body section. The [Advanced Attributes](09.%20Advanced%20Attributes.md) API example will demonstrate how to avoid duplicates and how to reuse attributes descriptions.
## API Blueprint
+ [Previous: Parameters](07.%20Parameters.md)
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/08.%20Attributes.md)
+ [Next: Advanced Attributes](09.%20Advanced%20Attributes.md)
# Group Coupons
## Coupon [/coupons/{id}]
A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer.
### Retrieve a Coupon [GET]
Retrieves the coupon with the given ID.
+ Response 200 (application/json)
+ Attributes (object)
+ id: 250FF (string)
+ created: 1415203908 (number) - Time stamp
+ percent_off: 25 (number)
A positive integer between 1 and 100 that represents the discount the coupon will apply.
+ redeem_by (number) - Date after which the coupon can no longer be redeemed
+ Body
{
"id": "250FF",
"created": 1415203908,
"percent_off": 25,
"redeem_by:" null
}
| API Blueprint | 4 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/API Blueprint/attributes.apib | [
"MIT"
] |
/* Empty CSS to avoid styles leaking from the page - https://github.com/NativeScript/NativeScript/issues/8143 */
| CSS | 0 | tralves/NativeScript | apps/ui/src/tab-view/text-transform-page.css | [
"Apache-2.0"
] |
package com.baeldung.concurrent.atomic;
import java.util.concurrent.atomic.AtomicMarkableReference;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class AtomicMarkableReferenceUnitTest {
class Employee {
private int id;
private String name;
Employee(int id, String name) {
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@Test
void givenMarkValueAsTrue_whenUsingIsMarkedMethod_thenMarkValueShouldBeTrue() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Assertions.assertTrue(employeeNode.isMarked());
}
@Test
void givenMarkValueAsFalse_whenUsingIsMarkedMethod_thenMarkValueShouldBeFalse() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, false);
Assertions.assertFalse(employeeNode.isMarked());
}
@Test
void whenUsingGetReferenceMethod_thenCurrentReferenceShouldBeReturned() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Assertions.assertEquals(employee, employeeNode.getReference());
}
@Test
void whenUsingGetMethod_thenCurrentReferenceAndMarkShouldBeReturned() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
boolean[] markHolder = new boolean[1];
Employee currentEmployee = employeeNode.get(markHolder);
Assertions.assertEquals(employee, currentEmployee);
Assertions.assertTrue(markHolder[0]);
}
@Test
void givenNewReferenceAndMark_whenUsingSetMethod_thenCurrentReferenceAndMarkShouldBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
employeeNode.set(newEmployee, false);
Assertions.assertEquals(newEmployee, employeeNode.getReference());
Assertions.assertFalse(employeeNode.isMarked());
}
@Test
void givenTheSameObjectReference_whenUsingAttemptMarkMethod_thenMarkShouldBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Assertions.assertTrue(employeeNode.attemptMark(employee, false));
Assertions.assertFalse(employeeNode.isMarked());
}
@Test
void givenDifferentObjectReference_whenUsingAttemptMarkMethod_thenMarkShouldNotBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee expectedEmployee = new Employee(123, "Mike");
Assertions.assertFalse(employeeNode.attemptMark(expectedEmployee, false));
Assertions.assertTrue(employeeNode.isMarked());
}
@Test
void givenCurrentReferenceAndCurrentMark_whenUsingCompareAndSet_thenReferenceAndMarkShouldBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
Assertions.assertTrue(employeeNode.compareAndSet(employee, newEmployee, true, false));
Assertions.assertEquals(newEmployee, employeeNode.getReference());
Assertions.assertFalse(employeeNode.isMarked());
}
@Test
void givenNotCurrentReferenceAndCurrentMark_whenUsingCompareAndSet_thenReferenceAndMarkShouldNotBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
Assertions.assertFalse(employeeNode.compareAndSet(new Employee(1234, "Steve"), newEmployee, true, false));
Assertions.assertEquals(employee, employeeNode.getReference());
Assertions.assertTrue(employeeNode.isMarked());
}
@Test
void givenCurrentReferenceAndNotCurrentMark_whenUsingCompareAndSet_thenReferenceAndMarkShouldNotBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
Assertions.assertFalse(employeeNode.compareAndSet(employee, newEmployee, false, true));
Assertions.assertEquals(employee, employeeNode.getReference());
Assertions.assertTrue(employeeNode.isMarked());
}
@Test
void givenNotCurrentReferenceAndNotCurrentMark_whenUsingCompareAndSet_thenReferenceAndMarkShouldNotBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
Assertions.assertFalse(employeeNode.compareAndSet(new Employee(1234, "Steve"), newEmployee, false, true));
Assertions.assertEquals(employee, employeeNode.getReference());
Assertions.assertTrue(employeeNode.isMarked());
}
@Test
void givenCurrentReferenceAndCurrentMark_whenUsingWeakCompareAndSet_thenReferenceAndMarkShouldBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
Assertions.assertTrue(employeeNode.weakCompareAndSet(employee, newEmployee, true, false));
Assertions.assertEquals(newEmployee, employeeNode.getReference());
Assertions.assertFalse(employeeNode.isMarked());
}
@Test
void givenNotCurrentReferenceAndCurrentMark_whenUsingWeakCompareAndSet_thenReferenceAndMarkShouldNotBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
Assertions.assertFalse(employeeNode.weakCompareAndSet(new Employee(1234, "Steve"), newEmployee, true, false));
Assertions.assertEquals(employee, employeeNode.getReference());
Assertions.assertTrue(employeeNode.isMarked());
}
@Test
void givenCurrentReferenceAndNotCurrentMark_whenUsingWeakCompareAndSet_thenReferenceAndMarkShouldNotBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
Assertions.assertFalse(employeeNode.weakCompareAndSet(employee, newEmployee, false, true));
Assertions.assertEquals(employee, employeeNode.getReference());
Assertions.assertTrue(employeeNode.isMarked());
}
@Test
void givenNotCurrentReferenceAndNotCurrentMark_whenUsingWeakCompareAndSet_thenReferenceAndMarkShouldNotBeUpdated() {
Employee employee = new Employee(123, "Mike");
AtomicMarkableReference<Employee> employeeNode = new AtomicMarkableReference<Employee>(employee, true);
Employee newEmployee = new Employee(124, "John");
Assertions.assertFalse(employeeNode.weakCompareAndSet(new Employee(1234, "Steve"), newEmployee, false, true));
Assertions.assertEquals(employee, employeeNode.getReference());
Assertions.assertTrue(employeeNode.isMarked());
}
}
| Java | 5 | DBatOWL/tutorials | core-java-modules/core-java-concurrency-basic-2/src/test/java/com/baeldung/concurrent/atomic/AtomicMarkableReferenceUnitTest.java | [
"MIT"
] |
[
{
"@id": "_:b0",
"http://example.com/datelist": [
{
"@list": [
{
"@value": "2012-04-12",
"@type": "http://www.w3.org/2001/XMLSchema#date"
}
]
}
],
"http://example.com/dateprop": [
{
"@list": [
{
"@value": "2012-04-12",
"@type": "http://www.w3.org/2001/XMLSchema#date"
}
]
}
],
"http://example.com/dateprop2": [
{
"@value": "2012-04-12",
"@type": "http://www.w3.org/2001/XMLSchema#date"
}
],
"http://example.com/dateset": [
{
"@value": "2012-04-12",
"@type": "http://www.w3.org/2001/XMLSchema#date"
}
],
"http://example.com/idlist": [
{
"@list": [
{
"@id": "http://example.org/id"
}
]
}
],
"http://example.com/idprop": [
{
"@list": [
{
"@id": "http://example.org/id"
}
]
}
],
"http://example.com/idprop2": [
{
"@id": "http://example.org/id"
}
],
"http://example.com/idset": [
{
"@id": "http://example.org/id"
}
]
}
]
| JSONLD | 3 | fsteeg/json-ld-api | tests/flatten/0023-out.jsonld | [
"W3C"
] |
// FOREIGN_ANNOTATIONS
// FILE: A.java
import javax.annotation.*;
@ParametersAreNonnullByDefault
public class A {
@Nullable public String field = null;
public String foo(String q, @Nonnull String x, @CheckForNull CharSequence y) {
return "";
}
@Nonnull
public String bar() {
return "";
}
}
| Java | 4 | AndrewReitz/kotlin | compiler/fir/resolve/testData/enhancement/jsr305/typeQualifierDefault/ParametersAreNonnullByDefault.java | [
"ECL-2.0",
"Apache-2.0"
] |
// WMISensor.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "WMIServiceJNI.h"
#include "WMIService.h"
#include "WMIUtils.h"
/*
* Class: org_jkiss_wmi_service_WMIService
* Method: connect
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT jobject JNICALL Java_org_jkiss_wmi_service_WMIService_connect(
JNIEnv* pJavaEnv,
jclass serviceClass,
jstring domain,
jstring host,
jstring user,
jstring password,
jstring locale,
jstring resource)
{
// Init COM for current thread
if (!WMIInitializeThread(pJavaEnv)) return NULL;
JNIMetaData& jniMeta = JNIMetaData::GetMetaData(pJavaEnv);
jobject newServiceObject = pJavaEnv->NewObject(jniMeta.wmiServiceClass, jniMeta.wmiServiceConstructor);
if (pJavaEnv->ExceptionCheck()) {
return NULL;
}
//pJavaEnv->SetObjectField(newServiceObject, jniMeta.wmiServiceLogField, logObject);
WMIService* pService = new WMIService(pJavaEnv, newServiceObject);
CComBSTR bstrDomain, bstrHost, bstrUser, bstrPassword, bstrLocale, bstrResource;
::GetJavaString(pJavaEnv, domain, &bstrDomain);
::GetJavaString(pJavaEnv, host, &bstrHost);
::GetJavaString(pJavaEnv, user, &bstrUser);
::GetJavaString(pJavaEnv, password, &bstrPassword);
::GetJavaString(pJavaEnv, locale, &bstrLocale);
::GetJavaString(pJavaEnv, resource, &bstrResource);
pService->Connect(pJavaEnv, bstrDomain, bstrHost, bstrUser, bstrPassword, bstrLocale, bstrResource);
if (pJavaEnv->ExceptionCheck()) {
DeleteLocalRef(pJavaEnv, newServiceObject);
return NULL;
}
return newServiceObject;
}
/*
* Class: org_jkiss_wmi_service_WMIService
* Method: disconnect
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_jkiss_wmi_service_WMIService_close
(JNIEnv * pJavaEnv, jobject object)
{
if (!WMIInitializeThread(pJavaEnv)) return;
WMIService* pService = WMIService::GetFromObject(pJavaEnv, object);
if (pService != NULL) {
pService->Release(pJavaEnv);
delete pService;
}
}
JNIEXPORT jobject JNICALL Java_org_jkiss_wmi_service_WMIService_openNamespace
(JNIEnv * pJavaEnv, jobject object, jstring nsName)
{
// Init COM for current thread
if (!WMIInitializeThread(pJavaEnv)) return NULL;
WMIService* pService = WMIService::GetFromObject(pJavaEnv, object);
if (pService == NULL) {
THROW_COMMON_EXCEPTION(L"WMI Service is not initialized");
return NULL;
}
CComBSTR bstrNS;
::GetJavaString(pJavaEnv, nsName, &bstrNS);
return pService->OpenNamespace(pJavaEnv, bstrNS, 0);
}
/*
* Class: org_jkiss_wmi_service_WMIService
* Method: executeQuery
*
JNIEXPORT jobjectArray JNICALL Java_org_jkiss_wmi_service_WMIService_executeQuery(
JNIEnv *pJavaEnv,
jobject object,
jstring query,
jboolean bSync)
{
WMIService* pService = WMIService::GetFromObject(pJavaEnv, object);
if (pService == NULL) {
THROW_COMMON_EXCEPTION(L"WMI Service is not initialized");
return NULL;
}
if (query == NULL) {
THROW_COMMON_EXCEPTION(L"NULL query specified");
return NULL;
}
CComBSTR bstrQuery;
::GetJavaString(pJavaEnv, query, &bstrQuery);
return pService->ExecuteQuery(pJavaEnv, bstrQuery, bSync == JNI_TRUE);
}*/
JNIEXPORT void JNICALL Java_org_jkiss_wmi_service_WMIService_executeQuery(
JNIEnv *pJavaEnv,
jobject object,
jstring query,
jobject sinkObject,
jlong lFlags)
{
// Init COM for current thread
if (!WMIInitializeThread(pJavaEnv)) return;
WMIService* pService = WMIService::GetFromObject(pJavaEnv, object);
if (pService == NULL) {
THROW_COMMON_EXCEPTION(L"WMI Service is not initialized");
return;
}
if (query == NULL) {
THROW_COMMON_EXCEPTION(L"NULL query specified");
return;
}
if (sinkObject == NULL) {
THROW_COMMON_EXCEPTION(L"NULL sink object specified");
return;
}
CComBSTR bstrQuery;
::GetJavaString(pJavaEnv, query, &bstrQuery);
pService->ExecuteQueryAsync(pJavaEnv, bstrQuery, sinkObject, (LONG)lFlags);
}
JNIEXPORT void JNICALL Java_org_jkiss_wmi_service_WMIService_enumClasses(
JNIEnv *pJavaEnv,
jobject object,
jstring superClass,
jobject sinkObject,
jlong lFlags)
{
// Init COM for current thread
if (!WMIInitializeThread(pJavaEnv)) return;
WMIService* pService = WMIService::GetFromObject(pJavaEnv, object);
if (pService == NULL) {
THROW_COMMON_EXCEPTION(L"WMI Service is not initialized");
return;
}
if (sinkObject == NULL) {
THROW_COMMON_EXCEPTION(L"NULL sink object specified");
return;
}
CComBSTR bstrSuperClass;
::GetJavaString(pJavaEnv, superClass, &bstrSuperClass);
pService->EnumClasses(pJavaEnv, bstrSuperClass, sinkObject, (LONG)lFlags);
}
JNIEXPORT void JNICALL Java_org_jkiss_wmi_service_WMIService_enumInstances(
JNIEnv *pJavaEnv,
jobject object,
jstring className,
jobject sinkObject,
jlong lFlags)
{
// Init COM for current thread
if (!WMIInitializeThread(pJavaEnv)) return;
WMIService* pService = WMIService::GetFromObject(pJavaEnv, object);
if (pService == NULL) {
THROW_COMMON_EXCEPTION(L"WMI Service is not initialized");
return;
}
if (sinkObject == NULL) {
THROW_COMMON_EXCEPTION(L"NULL sink object specified");
return;
}
CComBSTR bstrClassName;
::GetJavaString(pJavaEnv, className, &bstrClassName);
pService->EnumInstances(pJavaEnv, bstrClassName, sinkObject, (LONG)lFlags);
}
JNIEXPORT void JNICALL Java_org_jkiss_wmi_service_WMIService_cancelSink(
JNIEnv *pJavaEnv,
jobject object,
jobject sinkObject)
{
// Init COM for current thread
if (!WMIInitializeThread(pJavaEnv)) return;
WMIService* pService = WMIService::GetFromObject(pJavaEnv, object);
if (pService == NULL) {
THROW_COMMON_EXCEPTION(L"WMI Service is not initialized");
return;
}
if (sinkObject == NULL) {
THROW_COMMON_EXCEPTION(L"NULL sink object specified");
return;
}
pService->CancelAsyncOperation(pJavaEnv, sinkObject);
}
| C++ | 4 | SubOptimal/dbeaver | bundles/org.jkiss.wmi/src/native/WMIServiceJNI.cpp | [
"Apache-2.0"
] |
type VRMConversation implements Node, Entity @foo {
a: Int
}
| GraphQL | 2 | fuelingtheweb/prettier | tests/graphql_object_type_def/implements.graphql | [
"MIT"
] |
# frozen_string_literal: true
module ActiveRecord
class PredicateBuilder
class RangeHandler # :nodoc:
RangeWithBinds = Struct.new(:begin, :end, :exclude_end?)
def initialize(predicate_builder)
@predicate_builder = predicate_builder
end
def call(attribute, value)
begin_bind = predicate_builder.build_bind_attribute(attribute.name, value.begin)
end_bind = predicate_builder.build_bind_attribute(attribute.name, value.end)
attribute.between(RangeWithBinds.new(begin_bind, end_bind, value.exclude_end?))
end
private
attr_reader :predicate_builder
end
end
end
| Ruby | 3 | mdesantis/rails | activerecord/lib/active_record/relation/predicate_builder/range_handler.rb | [
"MIT"
] |
[{
"@id": "http://a.example.com/base",
"http://example.com/bar": [{"@value": "foo"}]
}] | JSONLD | 1 | fsteeg/json-ld-api | tests/expand/h022-out.jsonld | [
"W3C"
] |
.kg-file-card,
.kg-file-card * {
box-sizing: border-box;
}
.kg-file-card {
display: flex;
}
.kg-file-card a.kg-file-card-container {
display: flex;
align-items: stretch;
justify-content: space-between;
color: inherit;
padding: 6px;
min-height: 92px;
border: 1px solid rgb(124 139 154 / 25%);
border-radius: 3px;
transition: all ease-in-out 0.35s;
text-decoration: none;
width: 100%;
}
.kg-file-card a.kg-file-card-container:hover {
border: 1px solid rgb(124 139 154 / 35%);
}
.kg-file-card-contents {
display: flex;
flex-direction: column;
justify-content: space-between;
margin: 4px 8px;
width: 100%
}
.kg-file-card-title {
font-size: 1.15em;
font-weight: 700;
line-height: 1.3em;
}
.kg-file-card-caption {
font-size: 0.95em;
line-height: 1.3em;
opacity: 0.6;
}
.kg-file-card-title + .kg-file-card-caption {
margin-top: -3px;
}
.kg-file-card-metadata {
display: inline;
font-size: 0.825em;
line-height: 1.3em;
margin-top: 2px;
}
.kg-file-card-filename {
display: inline;
font-weight: 500;
}
.kg-file-card-filesize {
display: inline-block;
font-size: 0.925em;
opacity: 0.6;
}
.kg-file-card-filesize:before {
display: inline-block;
content: "\2022";
margin-right: 4px;
}
.kg-file-card-icon {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 80px;
min-width: 80px;
height: 100%;
}
.kg-file-card-icon:before {
position: absolute;
display: block;
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
background: currentColor;
opacity: 0.06;
transition: opacity ease-in-out 0.35s;
border-radius: 2px;
}
.kg-file-card a.kg-file-card-container:hover .kg-file-card-icon:before {
opacity: 0.08;
}
.kg-file-card-icon svg {
width: 24px;
height: 24px;
color: var(--ghost-accent-color);
}
/* Size variations */
.kg-file-card-medium a.kg-file-card-container {
min-height: 72px;
}
.kg-file-card-medium .kg-file-card-caption {
opacity: 1.0;
font-weight: 500;
}
.kg-file-card-small a.kg-file-card-container {
align-items: center;
min-height: 52px;
}
.kg-file-card-small .kg-file-card-metadata {
font-size: 1.0em;
margin-top: 0;
}
.kg-file-card-small .kg-file-card-icon svg {
width: 20px;
height: 20px;
}
.kg-file-card + .kg-file-card {
margin-top: 1em;
} | CSS | 3 | ClashgamesFR/Ghost | core/frontend/src/cards/css/file.css | [
"MIT"
] |
import { browser } from 'protractor';
import {OnPrepareConfig, runServer} from '@bazel/protractor/protractor-utils';
import * as path from 'path';
export = function(config: OnPrepareConfig) {
const isProdserver = path.basename(config.server, path.extname(config.server)) === 'prodserver';
return runServer(config.workspace, config.server, isProdserver ? '-p' : '-port', [])
.then(serverSpec => {
const serverUrl = `http://localhost:${serverSpec.port}`;
console.log(`Server has been started, starting tests against ${serverUrl}`);
browser.baseUrl = serverUrl;
});
}
| TypeScript | 4 | coreyscherbing/angular | integration/bazel/test/e2e/on-prepare.ts | [
"MIT"
] |
\initial {/}
\entry {/etc/hostname}{800}
\entry {\file {/etc/nsswitch.conf}}{762}
\initial {{\_}}
\entry {__va_copy}{90}
\entry {\code {_POSIX_OPTION_ORDER} environment variable.}{722}
\entry {\code {_POSIX_SAVED_IDS}}{772}
\initial {4}
\entry {4.\var {n} BSD Unix}{3}
\initial {A}
\entry {abort signal}{640}
\entry {aborting a program}{726}
\entry {absolute file name}{242}
\entry {absolute priority}{612}
\entry {absolute value functions}{553}
\entry {accepting connections}{444}
\entry {access permission for a file}{399}
\entry {access, testing for}{401}
\entry {accessing directories}{371}
\entry {address of socket}{419}
\entry {address space}{620, 683}
\entry {alarm signal}{642}
\entry {alarms, setting}{600}
\entry {alignment (in obstacks)}{59}
\entry {alignment (with \code {malloc})}{40}
\entry {\code {alloca} disadvantages}{63}
\entry {\code {alloca} function}{62}
\entry {allocating pseudo-terminals}{489}
\entry {allocation (obstacks)}{53}
\entry {allocation debugging}{48}
\entry {allocation hooks, for \code {malloc}}{43}
\entry {allocation of memory with \code {malloc}}{36}
\entry {allocation size of string}{80}
\entry {allocation statistics}{46}
\entry {alphabetic character}{69, 73}
\entry {alphanumeric character}{70, 72}
\entry {append-access files}{241}
\entry {argc (program argument count)}{683}
\entry {argp (program argument parser)}{692}
\entry {argp parser functions}{697}
\entry {ARGP_HELP_FMT environment variable}{715}
\entry {argument parsing with argp}{692}
\entry {argument promotion}{875}
\entry {argument vectors, null-character separated}{113}
\entry {arguments (variadic functions)}{874}
\entry {arguments, how many}{874}
\entry {arguments, to program}{683}
\entry {argv (program argument vector)}{683}
\entry {argz vectors (string vectors)}{113}
\entry {arithmetic expansion}{233}
\entry {array comparison functions}{94}
\entry {array copy functions}{83}
\entry {array search function}{209}
\entry {array sort function}{210}
\entry {ASCII character}{71}
\entry {assertions}{871}
\entry {attributes of a file}{388}
\entry {automatic freeing}{62}
\entry {automatic memory allocation}{35}
\entry {automatic storage class}{35}
\entry {automatic storage with variable size}{62}
\initial {B}
\entry {background job}{741}
\entry {background job, launching}{751}
\entry {backtrace}{845}
\entry {backtrace_fd}{845}
\entry {backtrace_symbols}{845}
\entry {base (of floating point number)}{882}
\entry {baud rate}{477}
\entry {Berkeley Unix}{3}
\entry {Bessel functions}{511}
\entry {bias (of floating point number exponent)}{882}
\entry {big-endian}{436}
\entry {binary I/O to a stream}{263}
\entry {binary search function (for arrays)}{209}
\entry {binary stream}{298}
\entry {binding a socket address}{419}
\entry {blank character}{70, 75}
\entry {block I/O to a stream}{263}
\entry {blocked signals}{636}
\entry {blocked signals, checking for}{673}
\entry {blocking signals}{668}
\entry {blocking signals, in a handler}{672}
\entry {bootstrapping, and services}{763}
\entry {break condition, detecting}{471}
\entry {break condition, generating}{485}
\entry {breaking a string into tokens}{106}
\entry {broken pipe signal}{644}
\entry {broken-down time}{575, 578}
\entry {BSD compatibility library}{757}
\entry {BSD compatibility library.}{8}
\entry {BSD Unix}{3}
\entry {buffering of streams}{303}
\entry {buffering, controlling}{305}
\entry {bugs, reporting}{1000}
\entry {bus error}{639}
\entry {butterfly}{560}
\entry {byte order conversion, for socket}{436}
\entry {byte stream}{417}
\initial {C}
\entry {C++ streams}{254}
\entry {calendar time}{571}
\entry {calendar time and broken-down time}{578}
\entry {calendar, Gregorian}{575}
\entry {calling variadic functions}{875}
\entry {canonical input processing}{466}
\entry {capacity limits, POSIX}{815}
\entry {carrier detect}{473}
\entry {case conversion of characters}{71}
\entry {catching signals}{636}
\entry {categories for locales}{164}
\entry {change working directory}{369}
\entry {changing the locale}{165}
\entry {changing the size of a block (\code {malloc})}{38}
\entry {changing the size of a block (obstacks)}{55}
\entry {channels}{330}
\entry {character case conversion}{71}
\entry {character predicates}{69}
\entry {character testing}{69}
\entry {checking for pending signals}{673}
\entry {child process}{575, 729, 730}
\entry {child process signal}{642}
\entry {chunks}{60}
\entry {classes, floating-point}{542}
\entry {classification of characters}{69}
\entry {cleaning up a stream}{330}
\entry {clearing terminal input queue}{486}
\entry {client}{442}
\entry {clock ticks}{573}
\entry {clock, high accuracy}{581}
\entry {close-on-exec (file descriptor flag)}{356}
\entry {closing a file descriptor}{319}
\entry {closing a socket}{441}
\entry {closing a stream}{249}
\entry {collating strings}{97}
\entry {combining locales}{164}
\entry {command argument syntax}{684}
\entry {command arguments, parsing}{685}
\entry {command line arguments}{683}
\entry {command substitution}{233}
\entry {communication style (of a socket)}{417}
\entry {comparing strings and arrays}{94}
\entry {Comparison Function}{209}
\entry {compiling}{993}
\entry {complex exponentiation functions}{508}
\entry {complex logarithm functions}{508}
\entry {complex numbers}{560}
\entry {complex trigonometric functions}{503}
\entry {concatenating strings}{83}
\entry {configurations, all supported}{998}
\entry {configuring}{993}
\entry {conjugate complex numbers}{561}
\entry {connecting a socket}{442}
\entry {connection}{442}
\entry {consistency checking}{871}
\entry {consistency checking, of heap}{41}
\entry {constants}{34, 501}
\entry {continue signal}{643}
\entry {control character}{70, 73}
\entry {control operations on files}{353}
\entry {controlling process}{742}
\entry {controlling terminal}{741}
\entry {controlling terminal, access to}{742}
\entry {controlling terminal, determining}{756}
\entry {controlling terminal, setting}{359}
\entry {conversion specifications (\code {printf})}{265}
\entry {conversion specifications (\code {scanf})}{288}
\entry {converting byte order}{436}
\entry {converting case of characters}{71}
\entry {converting file descriptor to stream}{329}
\entry {converting floats to integers}{555}
\entry {converting group ID to group name}{793}
\entry {converting group name to group ID}{793}
\entry {converting host address to name}{431}
\entry {converting host name to address}{431}
\entry {converting network name to network number}{462}
\entry {converting network number to network name}{462}
\entry {converting port number to service name}{435}
\entry {converting service name to port number}{435}
\entry {converting string to collation order}{98}
\entry {converting strings to numbers}{562}
\entry {converting user ID to user name}{790}
\entry {converting user name to user ID}{790}
\entry {cookie, for custom stream}{311}
\entry {copy-on-write page fault}{66}
\entry {copying strings and arrays}{83}
\entry {cpu priority}{611}
\entry {CPU time}{571, 573, 574}
\entry {create on open (file status flag)}{358}
\entry {creating a directory}{388}
\entry {creating a FIFO special file}{414}
\entry {creating a pipe}{411}
\entry {creating a pipe to a subprocess}{413}
\entry {creating a process}{730}
\entry {creating a socket}{440}
\entry {creating a socket pair}{441}
\entry {creating special files}{406}
\entry {cube root function}{507}
\entry {currency symbols}{169}
\entry {current limit}{607}
\entry {current working directory}{369}
\entry {custom streams}{311}
\entry {customizing \code {printf}}{281}
\initial {D}
\entry {data loss on sockets}{417}
\entry {databases}{761}
\entry {datagram socket}{455}
\entry {datagrams, transmitting}{455}
\entry {date}{571}
\entry {Daylight Saving Time}{579}
\entry {decimal digit character}{70}
\entry {decimal-point separator}{168}
\entry {declaration (compared to definition)}{4}
\entry {declaring variadic functions}{875}
\entry {decompose complex numbers}{561}
\entry {default action (for a signal)}{636}
\entry {default action for a signal}{647}
\entry {default argument promotions}{875}
\entry {default value, and NSS}{764}
\entry {defining new \code {printf} conversions}{281}
\entry {definition (compared to declaration)}{4}
\entry {delayed suspend character}{481}
\entry {deleting a directory}{386}
\entry {deleting a file}{385}
\entry {delivery of signals}{636}
\entry {descriptors and streams}{330}
\entry {digit character}{70, 73}
\entry {directories, accessing}{371}
\entry {directories, creating}{388}
\entry {directories, deleting}{386}
\entry {directory}{241}
\entry {directory entry}{241}
\entry {directory hierarchy}{378}
\entry {directory stream}{371}
\entry {disadvantages of \code {alloca}}{63}
\entry {DISCARD character}{482}
\entry {division by zero}{544}
\entry {DNS}{799}
\entry {DNS server unavailable}{763}
\entry {domain (of socket)}{417}
\entry {domain error}{548}
\entry {domain name}{799}
\entry {Domain Name System}{799}
\entry {dot notation, for Internet addresses}{427}
\entry {DSUSP character}{481}
\entry {duplicating file descriptors}{354}
\entry {dynamic memory allocation}{35}
\initial {E}
\entry {EBCDIC}{121}
\entry {echo of terminal input}{475}
\entry {effective group ID}{771}
\entry {effective user ID}{771}
\entry {efficiency and \code {malloc}}{40}
\entry {efficiency and obstacks}{57}
\entry {efficiency of chunks}{60}
\entry {EINTR, and restarting interrupted primitives}{664}
\entry {elapsed time}{571}
\entry {encryption}{111}
\entry {end of file, on a stream}{297}
\entry {end-of-file, on a file descriptor}{322}
\entry {environment}{718}
\entry {environment access}{719}
\entry {environment representation}{719}
\entry {environment variable}{718}
\entry {environment vectors, null-character separated}{113}
\entry {envz vectors (environment vectors)}{113}
\entry {EOF character}{479}
\entry {EOL character}{479}
\entry {EOL2 character}{479}
\entry {epoch}{576}
\entry {ERASE character}{480}
\entry {errno}{723}
\entry {error codes}{15}
\entry {error messages, in argp}{700}
\entry {error reporting}{15}
\entry {errors, mathematical}{548}
\entry {establishing a handler}{646}
\entry {ethers}{761}
\entry {EUC}{122}
\entry {EUC-JP}{149}
\entry {exception}{544, 638}
\entry {exclusive lock}{362}
\entry {\code {exec} functions}{732}
\entry {execing a program}{34}
\entry {executable}{34}
\entry {executing a file}{732}
\entry {exit status}{724}
\entry {exit status value}{724}
\entry {exiting a program}{34}
\entry {expansion of shell words}{233}
\entry {exponent (of floating point number)}{882}
\entry {exponentiation functions}{505}
\entry {extending \code {printf}}{281}
\entry {extracting file descriptor from stream}{329}
\initial {F}
\entry {\code {fcntl} function}{353}
\entry {FDL, GNU Free Documentation License}{1029}
\entry {feature test macros}{7}
\entry {field splitting}{233}
\entry {FIFO special file}{411}
\entry {file access permission}{399}
\entry {file access time}{402}
\entry {file attribute modification time}{402}
\entry {file attributes}{388}
\entry {file creation mask}{399}
\entry {file descriptor flags}{355}
\entry {file descriptor sets, for \code {select}}{337}
\entry {file descriptors, standard}{329}
\entry {file locks}{362}
\entry {file modification time}{402}
\entry {file name}{241}
\entry {file name component}{241}
\entry {file name errors}{242}
\entry {file name resolution}{242}
\entry {file name translation flags}{358}
\entry {file names, multiple}{382}
\entry {file owner}{396}
\entry {file permission bits}{397}
\entry {file pointer}{245}
\entry {file position}{240}
\entry {file positioning on a file descriptor}{326}
\entry {file positioning on a stream}{299}
\entry {file status flags}{357}
\entry {files, accessing}{34}
\entry {filtering i/o through subprocess}{413}
\entry {flag character (\code {printf})}{266}
\entry {flag character (\code {scanf})}{289}
\entry {flags for \code {sigaction}}{651}
\entry {flags, file name translation}{358}
\entry {flags, open-time action}{358}
\entry {floating point}{542}
\entry {floating point, IEEE}{886}
\entry {floating type measurements}{882}
\entry {floating-point classes}{542}
\entry {floating-point exception}{638}
\entry {flow control, terminal}{486}
\entry {flushing a stream}{304}
\entry {flushing terminal output queue}{485}
\entry {foreground job}{741}
\entry {foreground job, launching}{750}
\entry {forking a process}{730}
\entry {format string, for \code {printf}}{264}
\entry {format string, for \code {scanf}}{287}
\entry {formatted input from a stream}{287}
\entry {formatted messages}{313}
\entry {formatted output to a stream}{264}
\entry {FP arithmetic}{557}
\entry {FQDN}{799}
\entry {frame, real memory}{33}
\entry {free documentation}{1017}
\entry {freeing (obstacks)}{54}
\entry {freeing memory}{34}
\entry {freeing memory allocated with \code {malloc}}{37}
\entry {fully buffered stream}{304}
\entry {function prototypes (variadic)}{873}
\initial {G}
\entry {gamma function}{511}
\entry {gcvt_r}{569}
\entry {gencat}{188}
\entry {generation of signals}{636}
\entry {generic i/o control operations}{366}
\entry {globbing}{220}
\entry {graphic character}{70, 73}
\entry {Gregorian calendar}{575}
\entry {group}{761}
\entry {group database}{792}
\entry {group ID}{771}
\entry {group name}{771}
\entry {group owner of a file}{396}
\entry {grouping of digits}{168}
\entry {growing objects (in obstacks)}{55}
\initial {H}
\entry {handling multiple signals}{657}
\entry {hangup signal}{641}
\entry {hard limit}{607}
\entry {hard link}{382}
\entry {header files}{4}
\entry {heap consistency checking}{41}
\entry {heap, dynamic allocation from}{36}
\entry {heap, freeing memory from}{37}
\entry {hexadecimal digit character}{70, 75}
\entry {hidden bit (of floating point number mantissa)}{882}
\entry {hierarchy, directory}{378}
\entry {high-priority data}{452}
\entry {high-resolution time}{575}
\entry {holes in files}{327}
\entry {home directory}{720}
\entry {\code {HOME} environment variable}{720}
\entry {hook functions (of custom streams)}{312}
\entry {host address, Internet}{427}
\entry {host name}{799}
\entry {hostname}{799}
\entry {hosts}{761}
\entry {hosts database}{431}
\entry {how many arguments}{874}
\entry {hyperbolic functions}{509}
\initial {I}
\entry {identifying terminals}{465}
\entry {IEEE 754}{542}
\entry {IEEE floating point}{542}
\entry {IEEE floating point representation}{886}
\entry {IEEE Std 1003.1}{2}
\entry {IEEE Std 1003.2}{2}
\entry {ignore action for a signal}{647}
\entry {illegal instruction}{639}
\entry {impossible events}{871}
\entry {independent channels}{330}
\entry {inexact exception}{544}
\entry {infinity}{546}
\entry {initial signal actions}{652}
\entry {inode number}{392}
\entry {input available signal}{642}
\entry {input conversions, for \code {scanf}}{289}
\entry {input from multiple files}{337}
\entry {installation tools}{997}
\entry {installing}{996}
\entry {integer}{539}
\entry {integer division functions}{540}
\entry {integer type range}{880}
\entry {integer type width}{880}
\entry {interactive signals, from terminal}{476}
\entry {interactive stop signal}{643}
\entry {internal representation}{119}
\entry {internationalization}{163}
\entry {Internet host address}{427}
\entry {Internet namespace, for sockets}{425}
\entry {interprocess communication, with FIFO}{414}
\entry {interprocess communication, with pipes}{411}
\entry {interprocess communication, with signals}{667}
\entry {interprocess communication, with sockets}{417}
\entry {interrupt character}{481}
\entry {interrupt signal}{640}
\entry {interrupt-driven input}{365}
\entry {interrupting primitives}{664}
\entry {interval}{571}
\entry {interval timer, setting}{600}
\entry {INTR character}{481}
\entry {invalid exception}{544}
\entry {inverse complex hyperbolic functions}{510}
\entry {inverse complex trigonometric functions}{504}
\entry {inverse hyperbolic functions}{510}
\entry {inverse trigonometric functions}{504}
\entry {invocation of program}{683}
\entry {IOCTLs}{366}
\entry {ISO 10646}{119}
\entry {ISO 2022}{121}
\entry {ISO 6937}{122}
\entry {ISO C}{2}
\entry {ISO-2022-JP}{149}
\entry {ISO/IEC 9945-1}{2}
\entry {ISO/IEC 9945-2}{2}
\initial {J}
\entry {job}{741}
\entry {job control}{741}
\entry {job control functions}{756}
\entry {job control is optional}{742}
\entry {job control signals}{642}
\entry {job control, enabling}{745}
\initial {K}
\entry {Kermit the frog}{213}
\entry {kernel call}{722}
\entry {kernel header files}{1000}
\entry {KILL character}{480}
\entry {kill signal}{641}
\entry {killing a process}{665}
\entry {Korn Shell}{220}
\initial {L}
\entry {LANG environment variable}{185}
\entry {\code {LANG} environment variable}{721}
\entry {launching jobs}{747}
\entry {LC_ALL environment variable}{185}
\entry {\code {LC_ALL} environment variable}{721}
\entry {\code {LC_COLLATE} environment variable}{722}
\entry {\code {LC_CTYPE} environment variable}{722}
\entry {LC_MESSAGES environment variable}{185}
\entry {\code {LC_MESSAGES} environment variable}{722}
\entry {\code {LC_MONETARY} environment variable}{722}
\entry {\code {LC_NUMERIC} environment variable}{722}
\entry {\code {LC_TIME} environment variable}{722}
\entry {leap second}{579}
\entry {length of string}{80}
\entry {level, for socket options}{460}
\entry {LGPL, Lesser General Public License}{1019}
\entry {library}{1}
\entry {limit}{607}
\entry {limits on resource usage}{607}
\entry {limits, file name length}{828}
\entry {limits, floating types}{882}
\entry {limits, integer types}{880}
\entry {limits, link count of files}{828}
\entry {limits, number of open files}{815}
\entry {limits, number of processes}{815}
\entry {limits, number of supplementary group IDs}{816}
\entry {limits, pipe buffer size}{829}
\entry {limits, POSIX}{815}
\entry {limits, program argument size}{815}
\entry {limits, terminal input queue}{828}
\entry {limits, time zone name length}{815}
\entry {line buffered stream}{304}
\entry {line speed}{477}
\entry {lines (in a text file)}{299}
\entry {link}{241}
\entry {link, hard}{382}
\entry {link, soft}{383}
\entry {link, symbolic}{383}
\entry {linked channels}{330}
\entry {listening (sockets)}{444}
\entry {literals}{34}
\entry {little-endian}{436}
\entry {LNEXT character}{482}
\entry {load average}{623}
\entry {local namespace, for sockets}{423}
\entry {local network address number}{427}
\entry {local time}{575}
\entry {locale categories}{164}
\entry {locale, changing}{165}
\entry {locales}{163}
\entry {locking pages}{65}
\entry {logarithm functions}{505}
\entry {login name}{771}
\entry {login name, determining}{781}
\entry {\code {LOGNAME} environment variable}{721}
\entry {long jumps}{625}
\entry {long-named options}{684}
\entry {longjmp}{63}
\entry {loss of data on sockets}{417}
\entry {lost resource signal}{644}
\entry {lower-case character}{69, 74}
\initial {M}
\entry {macros}{55}
\entry {\code {main} function}{683}
\entry {malloc debugger}{48}
\entry {\code {malloc} function}{36}
\entry {mantissa (of floating point number)}{882}
\entry {matching failure, in \code {scanf}}{288}
\entry {math errors}{513}
\entry {mathematical constants}{501}
\entry {maximum}{559}
\entry {maximum field width (\code {scanf})}{289}
\entry {maximum limit}{607}
\entry {maximum possible integer}{540}
\entry {measurements of floating types}{882}
\entry {memory allocation}{33}
\entry {memory lock}{65}
\entry {memory mapped file}{34}
\entry {memory mapped I/O}{34}
\entry {memory page}{621}
\entry {merging of signals}{657}
\entry {MIN termios slot}{483}
\entry {minimum}{559}
\entry {minimum field width (\code {printf})}{266}
\entry {minimum possible integer}{540}
\entry {mixing descriptors and streams}{330}
\entry {modem disconnect}{473}
\entry {modem status lines}{473}
\entry {monetary value formatting}{168}
\entry {multi-threaded application}{250}
\entry {multibyte character}{121}
\entry {multibyte character string}{79}
\entry {multibyte string}{80}
\entry {multiple names for one file}{382}
\entry {multiplexing input}{337}
\entry {multiply-add}{559}
\initial {N}
\entry {name of running program}{27}
\entry {name of socket}{419}
\entry {Name Service Switch}{761}
\entry {name space}{5}
\entry {names of signals}{637}
\entry {namespace (of socket)}{417}
\entry {NaN}{546, 558}
\entry {netgroup}{761}
\entry {Netgroup}{796}
\entry {network byte order}{436}
\entry {network number}{427}
\entry {network protocol}{417}
\entry {networks}{761}
\entry {networks database}{462}
\entry {NIS}{799}
\entry {NIS domain name}{799, 800}
\entry {nisplus, and booting}{763}
\entry {nisplus, and completeness}{763}
\entry {NLSPATH environment variable}{184}
\entry {\code {NLSPATH} environment variable}{722}
\entry {non-blocking open}{359}
\entry {non-local exit, from signal handler}{655}
\entry {non-local exits}{625}
\entry {noncanonical input processing}{466}
\entry {normalization functions (floating-point)}{553}
\entry {normalized floating point number}{883}
\entry {not a number}{546}
\entry {NSS}{761}
\entry {\file {nsswitch.conf}}{762}
\entry {null character}{79}
\entry {null pointer constant}{878}
\entry {null wide character}{79}
\entry {number of arguments passed}{874}
\entry {number syntax, parsing}{562}
\entry {numeric value formatting}{168}
\initial {O}
\entry {obstack status}{59}
\entry {obstacks}{51}
\entry {open-time action flags}{358}
\entry {opening a file}{239}
\entry {opening a file descriptor}{319}
\entry {opening a pipe}{411}
\entry {opening a pseudo-terminal pair}{491}
\entry {opening a socket}{440}
\entry {opening a socket pair}{441}
\entry {opening a stream}{246}
\entry {Optimization}{538}
\entry {optimizing NSS}{764}
\entry {option parsing with argp}{692}
\entry {optional arguments}{872}
\entry {optional POSIX features}{816}
\entry {orientation, stream}{247, 254}
\entry {orphaned process group}{743}
\entry {out-of-band data}{452}
\entry {output conversions, for \code {printf}}{267}
\entry {output possible signal}{642}
\entry {overflow exception}{544}
\entry {owner of a file}{396}
\initial {P}
\entry {packet}{417}
\entry {page boundary}{40}
\entry {page fault}{33}
\entry {page fault, copy-on-write}{66}
\entry {page frame}{33}
\entry {page, memory}{621}
\entry {page, virtual memory}{33}
\entry {paging}{33, 65}
\entry {parameter promotion}{81}
\entry {parent directory}{242}
\entry {parent process}{729, 730}
\entry {parity checking}{470}
\entry {parsing a template string}{278}
\entry {parsing numbers (in formatted input)}{562}
\entry {parsing program arguments}{685}
\entry {parsing tokens from a string}{106}
\entry {passwd}{761}
\entry {password database}{789}
\entry {\code {PATH} environment variable}{721}
\entry {\code {pause} function}{675}
\entry {peeking at input}{262}
\entry {pending signals}{636}
\entry {pending signals, checking for}{673}
\entry {period of time}{571}
\entry {permission to access a file}{399}
\entry {persona}{771}
\entry {physical address}{620}
\entry {physical memory}{620}
\entry {pi (trigonometric constant)}{502}
\entry {pipe}{411}
\entry {pipe signal}{644}
\entry {pipe to a subprocess}{413}
\entry {port number}{434}
\entry {positioning a file descriptor}{326}
\entry {positioning a stream}{299}
\entry {positive difference}{559}
\entry {POSIX}{2}
\entry {POSIX capacity limits}{815}
\entry {POSIX optional features}{816}
\entry {POSIX.1}{2}
\entry {POSIX.2}{2}
\entry {power functions}{505}
\entry {precision (of floating point number)}{882}
\entry {precision (\code {printf})}{266}
\entry {predicates on arrays}{94}
\entry {predicates on characters}{69}
\entry {predicates on strings}{94}
\entry {preemptive scheduling}{612}
\entry {primitives, interrupting}{664}
\entry {printing character}{70, 74}
\entry {priority of a process}{611}
\entry {priority, absolute}{612}
\entry {process}{683, 729}
\entry {process completion}{734}
\entry {process group functions}{756}
\entry {process group ID}{747}
\entry {process group leader}{747}
\entry {process groups}{741}
\entry {process ID}{730}
\entry {process image}{730}
\entry {process lifetime}{730}
\entry {process priority}{611}
\entry {process signal mask}{670}
\entry {process termination}{724}
\entry {processor time}{571, 574}
\entry {profiling alarm signal}{642}
\entry {profiling timer}{601}
\entry {program}{683}
\entry {program argument syntax}{684}
\entry {program arguments}{683}
\entry {program arguments, parsing}{685}
\entry {program error signals}{637}
\entry {program name}{27}
\entry {program startup}{683}
\entry {program termination}{724}
\entry {program termination signals}{640}
\entry {programming your own streams}{311}
\entry {project complex numbers}{561}
\entry {protocol (of socket)}{417}
\entry {protocol family}{417}
\entry {protocols}{761}
\entry {protocols database}{437}
\entry {prototypes for variadic functions}{873}
\entry {pseudo-random numbers}{531}
\entry {pseudo-terminals}{488}
\entry {punctuation character}{70, 74}
\entry {pushing input back}{262}
\initial {Q}
\entry {quick sort function (for arrays)}{210}
\entry {QUIT character}{481}
\entry {quit signal}{641}
\entry {quote removal}{233}
\initial {R}
\entry {race conditions, relating to job control}{747}
\entry {race conditions, relating to signals}{656}
\entry {radix (of floating point number)}{882}
\entry {raising signals}{664}
\entry {random numbers}{531}
\entry {random-access files}{240}
\entry {range error}{548}
\entry {range of integer type}{880}
\entry {read lock}{362}
\entry {reading from a directory}{371}
\entry {reading from a file descriptor}{322}
\entry {reading from a socket}{446}
\entry {reading from a stream, by blocks}{263}
\entry {reading from a stream, by characters}{257}
\entry {reading from a stream, formatted}{287}
\entry {ready to run}{612}
\entry {real group ID}{771}
\entry {real user ID}{771}
\entry {real-time timer}{601}
\entry {realtime CPU scheduling}{612}
\entry {realtime processing}{65}
\entry {realtime scheduling}{613}
\entry {receiving datagrams}{455}
\entry {record locking}{362}
\entry {redirecting input and output}{354}
\entry {reentrant functions}{660}
\entry {reentrant NSS functions}{765}
\entry {relative file name}{242}
\entry {removal of quotes}{233}
\entry {removing a file}{385}
\entry {removing macros that shadow functions}{5}
\entry {renaming a file}{386}
\entry {reporting bugs}{1000}
\entry {reporting errors}{15}
\entry {REPRINT character}{480}
\entry {reserved names}{5}
\entry {resource limits}{607}
\entry {restarting interrupted primitives}{664}
\entry {restrictions on signal handler functions}{659}
\entry {root directory}{242}
\entry {Rot13}{111}
\entry {rpc}{761}
\entry {runnable process}{612}
\entry {running a command}{729}
\initial {S}
\entry {saved set-group-ID}{772}
\entry {saved set-user-ID}{772}
\entry {scanning the group list}{794}
\entry {scanning the user list}{791}
\entry {scatter-gather}{331}
\entry {scheduling, traditional}{617}
\entry {search function (for arrays)}{209}
\entry {search functions (for strings)}{101}
\entry {seed (for random numbers)}{531}
\entry {seeking on a file descriptor}{326}
\entry {seeking on a stream}{299}
\entry {segmentation violation}{639}
\entry {sending a datagram}{455}
\entry {sending signals}{664}
\entry {sequential-access files}{240}
\entry {server}{442}
\entry {services}{761}
\entry {services database}{435}
\entry {session}{741}
\entry {session leader}{741}
\entry {setting an alarm}{600}
\entry {\code {setuid} programs}{772}
\entry {setuid programs and file access}{401}
\entry {severity class}{314, 316}
\entry {sgettext}{202, 203}
\entry {shadow}{761}
\entry {shadowing functions with macros}{5}
\entry {shared lock}{362}
\entry {shared memory}{620}
\entry {shell}{741}
\entry {shift state}{124}
\entry {Shift_JIS}{122}
\entry {shrinking objects}{57}
\entry {shutting down a socket}{441}
\entry {\code {sigaction} flags}{651}
\entry {\code {sigaction} function}{648}
\entry {\code {SIGCHLD}, handling of}{752}
\entry {sign (of floating point number)}{882}
\entry {signal}{544, 635}
\entry {signal action}{636}
\entry {signal actions}{646}
\entry {signal flags}{651}
\entry {\code {signal} function}{646}
\entry {signal handler function}{652}
\entry {signal mask}{670}
\entry {signal messages}{645}
\entry {signal names}{637}
\entry {signal number}{637}
\entry {signal set}{669}
\entry {signals, generating}{664}
\entry {signedness}{539}
\entry {significand (of floating point number)}{882}
\entry {\code {SIGTTIN}, from background job}{742}
\entry {\code {SIGTTOU}, from background job}{743}
\entry {simple time}{575}
\entry {single-byte string}{80}
\entry {size of string}{80}
\entry {SJIS}{122}
\entry {socket}{417}
\entry {socket address (name) binding}{419}
\entry {socket domain}{417}
\entry {socket namespace}{417}
\entry {socket option level}{460}
\entry {socket options}{460}
\entry {socket pair}{441}
\entry {socket protocol}{417}
\entry {socket shutdown}{441}
\entry {socket, client actions}{442}
\entry {socket, closing}{441}
\entry {socket, connecting}{442}
\entry {socket, creating}{440}
\entry {socket, initiating a connection}{442}
\entry {sockets, accepting connections}{444}
\entry {sockets, listening}{444}
\entry {sockets, server actions}{444}
\entry {soft limit}{607}
\entry {soft link}{383}
\entry {sort function (for arrays)}{210}
\entry {sparse files}{327}
\entry {special files}{406}
\entry {special functions}{511}
\entry {specified action (for a signal)}{636}
\entry {speed of execution}{65}
\entry {square root function}{507}
\entry {stable sorting}{210}
\entry {standard dot notation, for Internet addresses}{427}
\entry {standard environment variables}{720}
\entry {standard error file descriptor}{329}
\entry {standard error stream}{246}
\entry {standard file descriptors}{329}
\entry {standard input file descriptor}{329}
\entry {standard input stream}{245}
\entry {standard output file descriptor}{329}
\entry {standard output stream}{245}
\entry {standard streams}{245}
\entry {standards}{1}
\entry {START character}{482}
\entry {startup of program}{683}
\entry {stateful}{124, 127, 132, 143, 146, 158}
\entry {static memory allocation}{35}
\entry {static storage class}{35}
\entry {STATUS character}{483}
\entry {status codes}{15}
\entry {status of a file}{388}
\entry {status of obstack}{59}
\entry {sticky bit}{398}
\entry {STOP character}{482}
\entry {stop signal}{643}
\entry {stopped job}{742}
\entry {stopped jobs, continuing}{754}
\entry {stopped jobs, detecting}{751}
\entry {storage allocation}{33}
\entry {stream (sockets)}{417}
\entry {stream orientation}{247, 254}
\entry {stream, for I/O to a string}{308}
\entry {streams and descriptors}{330}
\entry {streams, and file descriptors}{329}
\entry {streams, C++}{254}
\entry {streams, standard}{245}
\entry {string}{79}
\entry {string allocation}{80}
\entry {string collation functions}{97}
\entry {string comparison functions}{94}
\entry {string concatenation functions}{83}
\entry {string copy functions}{83}
\entry {string length}{80}
\entry {string literal}{79}
\entry {string search functions}{101}
\entry {string stream}{308}
\entry {string vectors, null-character separated}{113}
\entry {string, representation of}{79}
\entry {style of communication (of a socket)}{417}
\entry {subshell}{745}
\entry {substitution of variables and commands}{233}
\entry {successive signals}{657}
\entry {summer time}{579}
\entry {SunOS}{3}
\entry {supplementary group IDs}{771}
\entry {SUSP character}{481}
\entry {suspend character}{481}
\entry {SVID}{3}
\entry {swap space}{33}
\entry {symbolic link}{383}
\entry {symbolic link, opening}{359}
\entry {synchronizing}{340, 349}
\entry {syntax error messages, in argp}{700}
\entry {syntax, for program arguments}{684}
\entry {syntax, for reading numbers}{562}
\entry {sysconf}{621, 622}
\entry {system call}{722}
\entry {system call number}{723}
\entry {System V Unix}{3}
\initial {T}
\entry {TCP (Internet protocol)}{437}
\entry {template, for \code {printf}}{264}
\entry {template, for \code {scanf}}{287}
\entry {\code {TERM} environment variable}{721}
\entry {terminal flow control}{486}
\entry {terminal identification}{465}
\entry {terminal input queue}{466}
\entry {terminal input queue, clearing}{486}
\entry {terminal input signal}{643}
\entry {terminal line control functions}{485}
\entry {terminal line speed}{477}
\entry {terminal mode data types}{467}
\entry {terminal mode functions}{468}
\entry {terminal modes, BSD}{484}
\entry {terminal output queue}{466}
\entry {terminal output queue, flushing}{485}
\entry {terminal output signal}{644}
\entry {terminated jobs, detecting}{751}
\entry {termination signal}{640}
\entry {testing access permission}{401}
\entry {testing exit status of child process}{734}
\entry {text stream}{298}
\entry {thrashing}{621}
\entry {thread of control}{683}
\entry {threads}{250}
\entry {ticks, clock}{573}
\entry {tilde expansion}{233}
\entry {time}{571}
\entry {TIME termios slot}{483}
\entry {time zone}{597}
\entry {time zone database}{599}
\entry {time, elapsed}{571}
\entry {time, high precision}{581}
\entry {timer, profiling}{601}
\entry {timer, real-time}{601}
\entry {timer, virtual}{601}
\entry {timers, setting}{600}
\entry {timespec}{572}
\entry {timeval}{572}
\entry {timing error in signal handling}{675}
\entry {TMPDIR environment variable}{409}
\entry {tokenizing strings}{106}
\entry {tools, for installing library}{997}
\entry {transmitting datagrams}{455}
\entry {tree, directory}{378}
\entry {triangulation}{148}
\entry {trigonometric functions}{502}
\entry {type measurements, floating}{882}
\entry {type measurements, integer}{880}
\entry {type modifier character (\code {printf})}{267}
\entry {type modifier character (\code {scanf})}{289}
\entry {typeahead buffer}{466}
\entry {\code {TZ} environment variable}{721}
\initial {U}
\entry {UCS-2}{119}
\entry {UCS-4}{119}
\entry {ulps}{513}
\entry {umask}{399}
\entry {unbuffered stream}{304}
\entry {unconstrained memory allocation}{36}
\entry {undefining macros that shadow functions}{5}
\entry {underflow exception}{544}
\entry {Unicode}{119}
\entry {Unix, Berkeley}{3}
\entry {Unix, System V}{3}
\entry {unlinking a file}{385}
\entry {unordered comparison}{558}
\entry {unreading characters}{262}
\entry {upgrading from libc5}{1000}
\entry {upper-case character}{69, 75}
\entry {urgent data signal}{642}
\entry {urgent socket condition}{452}
\entry {usage limits}{607}
\entry {usage messages, in argp}{700}
\entry {user accounting database}{782}
\entry {user database}{789}
\entry {user ID}{771}
\entry {user ID, determining}{781}
\entry {user name}{771}
\entry {user signals}{645}
\entry {usual file name errors}{242}
\entry {UTF-16}{119}
\entry {UTF-7}{122}
\entry {UTF-8}{119, 122}
\initial {V}
\entry {va_copy}{90}
\entry {variable number of arguments}{872}
\entry {variable substitution}{233}
\entry {variable-sized arrays}{64}
\entry {variadic function argument access}{874}
\entry {variadic function prototypes}{873}
\entry {variadic functions}{872}
\entry {variadic functions, calling}{875}
\entry {virtual time alarm signal}{642}
\entry {virtual timer}{601}
\entry {\code {volatile} declarations}{660}
\initial {W}
\entry {waiting for a signal}{675}
\entry {waiting for completion of child process}{734}
\entry {waiting for input or output}{337}
\entry {WERASE character}{480}
\entry {whitespace character}{70, 74}
\entry {wide character}{119}
\entry {wide character string}{79, 80}
\entry {width of integer type}{880}
\entry {wildcard expansion}{233}
\entry {wint_t}{81}
\entry {word expansion}{233}
\entry {working directory}{369}
\entry {write lock}{362}
\entry {writing to a file descriptor}{324}
\entry {writing to a socket}{446}
\entry {writing to a stream, by blocks}{263}
\entry {writing to a stream, by characters}{255}
\entry {writing to a stream, formatted}{264}
\initial {Y}
\entry {YP}{799}
\entry {YP domain name}{799, 800}
\initial {Z}
\entry {zero divide}{544}
| Component Pascal | 3 | enfoTek/tomato.linksys.e2000.nvram-mod | tools-src/gnu/glibc/manual/libc.cps | [
"FSFAP"
] |
#!/usr/bin/tclsh
proc is-section line {
return [regexp {^[A-Z ]+$} $line]
}
# First argument is Manifest file, others are sections.
set sections [lassign $argv maffile]
if { $sections == "" } {
puts stderr "Usage: [file tail $argv0] <MAF file> <section name>"
exit 1
}
# NOTE: If the file doesn't exist, simply print nothing.
# If there's no manifest file under this name, it means that
# there are no files that satisfy given manifest and section.
if { [catch {set fd [open $maffile r]}] } {
exit
}
set extracted ""
set insection 0
while { [gets $fd line] >= 0 } {
set oline [string trim $line]
if { $oline == "" } {
continue
}
if { [string index $oline 0] == "#" } {
continue
}
if { !$insection } {
# An opportunity to see if this is a section name
if { ![is-section $line] } {
continue
}
# If it is, then check if this is OUR section
if { $oline in $sections } {
set insection 1
continue
}
} else {
# We are inside the interesting section, so collect filenames
# Check if this is a next section name - if it is, stop reading.
if { [is-section $line] } {
continue
}
# Otherwise read the current filename
lappend extracted $oline
}
}
puts $extracted
| Tcl | 4 | attenuation/srs | trunk/3rdparty/srt-1-fit/scripts/mafread.tcl | [
"MIT"
] |
/*
* Copyright 2014-2019 Jiří Janoušek <[email protected]>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
namespace Nuvola {
public class HeaderLabel: Gtk.Label {
public HeaderLabel(string? text) {
Object(label: text);
var text_attrs = new Pango.AttrList();
text_attrs.change(Pango.attr_weight_new(Pango.Weight.BOLD));
set_attributes(text_attrs);
margin = 10;
}
}
public class DeveloperSidebar: Gtk.ScrolledWindow {
private Drtgtk.Actions? actions_reg;
private Gtk.Grid grid;
private Gtk.Image? artwork = null;
private Gtk.VolumeButton volume_button;
private Gtk.Scale track_position_slider;
private Gtk.Label track_position_label;
private Gtk.Label? song = null;
private Gtk.Label? artist = null;
private Gtk.Label? album = null;
private Gtk.Label? state = null;
private Gtk.Entry? rating = null;
private SList<Gtk.Widget> action_widgets = null;
private HashTable<string, Gtk.RadioButton>? radios = null;
private MediaPlayerModel player;
private bool radios_frozen = false;
public DeveloperSidebar(AppRunnerController app, MediaPlayerModel player) {
vexpand = true;
actions_reg = app.actions;
this.player = player;
radios = new HashTable<string, Gtk.RadioButton>(str_hash, str_equal);
grid = new Gtk.Grid();
grid.orientation = Gtk.Orientation.VERTICAL;
grid.hexpand = grid.vexpand = true;
#if HAVE_CEF
var cef_web_view = app.web_engine.get_main_web_view() as CefGtk.WebView;
if (cef_web_view != null) {
var button = new Gtk.Button.with_label("Open Dev Tools");
button.get_style_context().add_class("suggested-action");
button.clicked.connect(() => cef_web_view.open_developer_tools());
grid.add(button);
}
#endif
artwork = new Gtk.Image();
artwork.margin_top = 10;
clear_artwork(false);
grid.add(artwork);
track_position_slider = new Gtk.Scale.with_range(
Gtk.Orientation.HORIZONTAL, 0.0, 1.0, 1.0);
track_position_slider.vexpand = true;
track_position_slider.draw_value = false;
track_position_slider.set_size_request(200, -1);
track_position_slider.value_changed.connect_after(on_time_position_changed);
track_position_label = new Gtk.Label("");
update_track_position();
volume_button = new Gtk.VolumeButton();
volume_button.use_symbolic = true;
volume_button.value = player.volume;
volume_button.value_changed.connect_after(on_volume_changed);
var box = new Gtk.Grid();
box.attach(track_position_slider, 0, 0, 2, 1);
box.attach(track_position_label, 0, 1, 1, 1);
box.attach(volume_button, 1, 1, 1, 1);
var label = new HeaderLabel("Song");
label.halign = Gtk.Align.START;
grid.attach_next_to(label, artwork, Gtk.PositionType.BOTTOM, 1, 1);
song = new Gtk.Label(player.title ?? "(null)");
song.set_line_wrap(true);
song.halign = Gtk.Align.START;
grid.attach_next_to(song, label, Gtk.PositionType.BOTTOM, 1, 1);
label = new HeaderLabel("Artist");
label.halign = Gtk.Align.START;
grid.add(label);
artist = new Gtk.Label(player.artist ?? "(null)");
artist.set_line_wrap(true);
artist.halign = Gtk.Align.START;
grid.attach_next_to(artist, label, Gtk.PositionType.BOTTOM, 1, 1);
label = new HeaderLabel("Album");
label.halign = Gtk.Align.START;
grid.add(label);
album = new Gtk.Label(player.album ?? "(null)");
album.set_line_wrap(true);
album.halign = Gtk.Align.START;
grid.attach_next_to(album, label, Gtk.PositionType.BOTTOM, 1, 1);
label = new HeaderLabel("Playback state");
label.halign = Gtk.Align.START;
grid.add(label);
state = new Gtk.Label(player.state);
state.halign = Gtk.Align.START;
grid.attach_next_to(state, label, Gtk.PositionType.BOTTOM, 1, 1);
label = new HeaderLabel("Rating");
label.halign = Gtk.Align.START;
grid.add(label);
rating = new Gtk.Entry();
rating.input_purpose = Gtk.InputPurpose.NUMBER;
rating.text = player.rating.to_string();
rating.halign = Gtk.Align.START;
rating.secondary_icon_name = "emblem-ok-symbolic";
rating.secondary_icon_activatable = true;
rating.icon_press.connect(on_rating_icon_pressed);
grid.attach_next_to(rating, label, Gtk.PositionType.BOTTOM, 1, 1);
label = new HeaderLabel("Playback Actions");
label.halign = Gtk.Align.START;
label.show();
grid.add(label);
grid.add(box);
set_actions(player.playback_actions);
add(grid);
show_all();
player.notify.connect_after(on_player_notify);
}
~DeveloperSidebar() {
player.notify.disconnect(on_player_notify);
track_position_slider.value_changed.disconnect(on_time_position_changed);
action_widgets = null;
radios = null;
}
private void clear_artwork(bool broken) {
try {
string icon_name = broken ? "dialog-error": "audio-x-generic";
Gdk.Pixbuf pixbuf = Gtk.IconTheme.get_default().load_icon(icon_name, 80, Gtk.IconLookupFlags.FORCE_SIZE);
artwork.set_from_pixbuf(pixbuf);
} catch (GLib.Error e) {
warning("Pixbuf error: %s", e.message);
artwork.clear();
}
}
private void on_player_notify(GLib.Object o, ParamSpec p) {
var player = o as MediaPlayerModel;
switch (p.name) {
case "artwork-file":
if (player.artwork_file == null) {
clear_artwork(false);
} else {
try {
var pixbuf = new Gdk.Pixbuf.from_file_at_scale(player.artwork_file, 80, 80, true);
artwork.set_from_pixbuf(pixbuf);
} catch (GLib.Error e) {
warning("Pixbuf error: %s", e.message);
clear_artwork(true);
}
}
break;
case "title":
song.label = player.title ?? "(null)";
break;
case "artist":
artist.label = player.artist ?? "(null)";
break;
case "album":
album.label = player.album ?? "(null)";
break;
case "state":
state.label = player.state ?? "(null)";
break;
case "track-length":
case "track-position":
update_track_position();
break;
case "volume":
volume_button.value = player.volume;
break;
case "rating":
rating.text = player.rating.to_string();
break;
case "playback-actions":
set_actions(player.playback_actions);
break;
default:
debug("Media player notify: %s", p.name);
break;
}
}
private void update_track_position() {
// Use actual values for the label not to hide any erroneous values.
double track_position = player.track_position / 1000000.0;
double track_length = player.track_length / 1000000.0;
track_position_label.label = "%s/%s".printf(
format_time(round_sec(track_position)),
format_time(round_sec(track_length)));
// Adjust the values to fit Gtk.Scale.
track_position = double.max(0.0, track_position);
track_length = double.max(1.0, track_length);
track_length = double.max(track_position, track_length);
assert(track_length >= track_position);
if (track_length >= track_position_slider.adjustment.upper) {
track_position_slider.adjustment.upper = track_length;
track_position_slider.adjustment.value = track_position;
} else {
track_position_slider.adjustment.value = track_position;
track_position_slider.adjustment.upper = track_length;
}
}
private string format_time(int seconds) {
int hours = seconds / 3600;
string result = (hours > 0) ? "%02d:".printf(hours) : "";
seconds = (seconds - hours * 3600);
int minutes = seconds / 60;
seconds = (seconds - minutes * 60);
return result + "%02d:%02d".printf(minutes, seconds);
}
private inline int round_sec(double sec) {
return (int) Math.round(sec);
}
private void set_actions(SList<string> playback_actions) {
lock (action_widgets) {
if (action_widgets != null) {
action_widgets.@foreach(unset_button);
}
action_widgets = null;
radios.remove_all();
radios_frozen = true;
foreach (unowned string full_name in playback_actions) {
add_action(full_name);
}
radios_frozen = false;
}
}
private void add_action(string full_name) {
Drtgtk.Action action;
Drtgtk.RadioOption option;
string detailed_name;
if (actions_reg.find_and_parse_action(full_name, out detailed_name, out action, out option)) {
string action_name;
Variant target_value;
try {
GLib.Action.parse_detailed_name(action.scope + "." + detailed_name, out action_name, out target_value);
} catch (GLib.Error e) {
critical("Failed to parse '%s': %s", action.scope + "." + detailed_name, e.message);
return;
}
if (action is Drtgtk.SimpleAction) {
var button = new Gtk.Button.with_label(action.label);
button.action_name = action_name;
button.action_target = target_value;
button.margin = 2;
button.show();
action_widgets.prepend(button);
grid.add(button);
} else if (action is Drtgtk.ToggleAction) {
var button = new Gtk.CheckButton.with_label(action.label);
button.action_name = action_name;
button.action_target = target_value;
button.margin = 2;
button.show();
action_widgets.prepend(button);
grid.add(button);
} else if (action is Drtgtk.RadioAction) {
Gtk.RadioButton? radio = radios.lookup(action.name);
var button = new Gtk.RadioButton.with_label_from_widget(radio, option.label);
if (radio == null) {
radios.insert(action.name, button);
action.notify["state"].connect_after(on_radio_action_changed);
}
button.margin = 2;
button.show();
action_widgets.prepend(button);
grid.add(button);
button.set_active(action.state.equal(target_value));
button.set_data<string>("full-name", full_name);
button.toggled.connect_after(on_radio_toggled);
}
}
}
private void on_radio_toggled(Gtk.Button button) {
if (radios_frozen) {
return;
}
var radio = button as Gtk.RadioButton;
string full_name = button.get_data<string>("full-name");
Drtgtk.Action action;
Drtgtk.RadioOption option;
string detailed_name;
if (actions_reg.find_and_parse_action(full_name, out detailed_name, out action, out option)
&& !action.state.equal(option.parameter) && radio.active) {
action.activate(option.parameter);
}
}
private void on_radio_action_changed(GLib.Object o, ParamSpec p) {
radios_frozen = true;
var action = o as Drtgtk.RadioAction;
Variant state = action.state;
Gtk.RadioButton radio = radios.lookup(action.name);
foreach (Gtk.RadioButton item in radio.get_group()) {
string full_name = item.get_data<string>("full-name");
Drtgtk.RadioOption option;
if (actions_reg.find_and_parse_action(full_name, null, null, out option)) {
if (!item.active && state.equal(option.parameter)) {
item.active = true;
}
}
}
radios_frozen = false;
}
private void unset_button(Gtk.Widget widget) {
grid.remove(widget);
var radio = widget as Gtk.RadioButton;
if (radio != null) {
radio.toggled.disconnect(on_radio_toggled);
string full_name = radio.get_data<string>("full-name");
Drtgtk.Action action;
Drtgtk.RadioOption option;
string detailed_name;
if (actions_reg.find_and_parse_action(full_name, out detailed_name, out action, out option)) {
radios.remove(action.name);
action.notify["state"].disconnect(on_radio_action_changed);
}
}
}
private void on_time_position_changed() {
Drtgtk.Action? action = actions_reg.get_action("seek");
int position = round_sec(track_position_slider.adjustment.value);
if (action != null && position != round_sec(player.track_position / 1000000.0)) {
action.activate(new Variant.double(position * 1000000.0));
}
}
private void on_volume_changed() {
if (player.volume != volume_button.value) {
Drtgtk.Action action = actions_reg.get_action("change-volume");
if (action != null) {
action.activate(new Variant.double(volume_button.value));
}
}
}
private void on_rating_icon_pressed(Gtk.Entry entry, Gtk.EntryIconPosition position, Gdk.Event event) {
if (position == Gtk.EntryIconPosition.SECONDARY) {
double rating = double.parse(entry.text);
if (rating >= 0.0 && rating <= 1.0) {
player.set_rating(rating);
}
}
}
}
} // namespace Nuvola
| Vala | 4 | xcffl/nuvolaruntime | src/nuvolakit-runner/components/developer/DeveloperSidebar.vala | [
"BSD-2-Clause"
] |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/nw/src/renderer/printing/print_web_view_helper.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/win/scoped_gdi_object.h"
#include "base/win/scoped_hdc.h"
#include "base/win/scoped_select_object.h"
#include "content/nw/src/common/print_messages.h"
#include "printing/metafile.h"
#include "printing/metafile_impl.h"
#include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h"
#include "printing/units.h"
#include "skia/ext/platform_device.h"
#include "skia/ext/refptr.h"
#include "skia/ext/vector_canvas.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
namespace printing {
using blink::WebFrame;
void PrintWebViewHelper::PrintPageInternal(
const PrintMsg_PrintPage_Params& params,
const gfx::Size& canvas_size,
WebFrame* frame) {
// Generate a memory-based metafile. It will use the current screen's DPI.
// Each metafile contains a single page.
scoped_ptr<NativeMetafile> metafile(new NativeMetafile);
metafile->Init();
DCHECK(metafile->context());
skia::InitializeDC(metafile->context());
int page_number = params.page_number;
// Calculate the dpi adjustment.
// Browser will render context using desired_dpi, so we need to calculate
// adjustment factor to play content on the printer DC later during the
// actual printing.
double actual_shrink = static_cast<float>(params.params.desired_dpi /
params.params.dpi);
gfx::Size page_size_in_dpi;
gfx::Rect content_area_in_dpi;
// Render page for printing.
RenderPage(params.params, page_number, frame, false, metafile.get(),
&actual_shrink, &page_size_in_dpi, &content_area_in_dpi);
// Close the device context to retrieve the compiled metafile.
if (!metafile->FinishDocument())
NOTREACHED();
if (!params.params.supports_alpha_blend && metafile->IsAlphaBlendUsed()) {
scoped_ptr<NativeMetafile> raster_metafile(
metafile->RasterizeAlphaBlend());
if (raster_metafile.get())
metafile.swap(raster_metafile);
}
// Get the size of the compiled metafile.
uint32 buf_size = metafile->GetDataSize();
DCHECK_GT(buf_size, 128u);
PrintHostMsg_DidPrintPage_Params page_params;
page_params.data_size = buf_size;
page_params.metafile_data_handle = NULL;
page_params.page_number = page_number;
page_params.document_cookie = params.params.document_cookie;
page_params.actual_shrink = actual_shrink;
page_params.page_size = page_size_in_dpi;
page_params.content_area = content_area_in_dpi;
if (!CopyMetafileDataToSharedMem(metafile.get(),
&(page_params.metafile_data_handle))) {
page_params.data_size = 0;
}
Send(new PrintHostMsg_DidPrintPage(routing_id(), page_params));
}
bool PrintWebViewHelper::RenderPreviewPage(
int page_number,
const PrintMsg_Print_Params& print_params) {
// Calculate the dpi adjustment.
double actual_shrink = static_cast<float>(print_params.desired_dpi /
print_params.dpi);
scoped_ptr<Metafile> draft_metafile;
Metafile* initial_render_metafile = print_preview_context_.metafile();
if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
draft_metafile.reset(new PreviewMetafile);
initial_render_metafile = draft_metafile.get();
}
base::TimeTicks begin_time = base::TimeTicks::Now();
RenderPage(print_params, page_number, (WebFrame*)print_preview_context_.prepared_frame(),
true, initial_render_metafile, &actual_shrink, NULL, NULL);
print_preview_context_.RenderedPreviewPage(
base::TimeTicks::Now() - begin_time);
if (draft_metafile.get()) {
draft_metafile->FinishDocument();
} else if (print_preview_context_.IsModifiable() &&
print_preview_context_.generate_draft_pages()) {
DCHECK(!draft_metafile.get());
draft_metafile.reset(
print_preview_context_.metafile()->GetMetafileForCurrentPage());
}
return PreviewPageRendered(page_number, draft_metafile.get());
}
void PrintWebViewHelper::RenderPage(
const PrintMsg_Print_Params& params, int page_number, WebFrame* frame,
bool is_preview, Metafile* metafile, double* actual_shrink,
gfx::Size* page_size_in_dpi, gfx::Rect* content_area_in_dpi) {
PageSizeMargins page_layout_in_points;
double css_scale_factor = 1.0f;
ComputePageLayoutInPointsForCss(frame, page_number, params,
ignore_css_margins_, &css_scale_factor,
&page_layout_in_points);
gfx::Size page_size;
gfx::Rect content_area;
GetPageSizeAndContentAreaFromPageLayout(page_layout_in_points, &page_size,
&content_area);
int dpi = static_cast<int>(params.dpi);
// Calculate the actual page size and content area in dpi.
if (page_size_in_dpi) {
*page_size_in_dpi = gfx::Size(
static_cast<int>(ConvertUnitDouble(page_size.width(), kPointsPerInch,
dpi)),
static_cast<int>(ConvertUnitDouble(page_size.height(), kPointsPerInch,
dpi)));
}
if (content_area_in_dpi) {
*content_area_in_dpi = gfx::Rect(
static_cast<int>(ConvertUnitDouble(content_area.x(), kPointsPerInch,
dpi)),
static_cast<int>(ConvertUnitDouble(content_area.y(), kPointsPerInch,
dpi)),
static_cast<int>(ConvertUnitDouble(content_area.width(), kPointsPerInch,
dpi)),
static_cast<int>(ConvertUnitDouble(content_area.height(),
kPointsPerInch, dpi)));
}
if (!is_preview) {
// Since WebKit extends the page width depending on the magical scale factor
// we make sure the canvas covers the worst case scenario (x2.0 currently).
// PrintContext will then set the correct clipping region.
page_size = gfx::Size(
static_cast<int>(page_layout_in_points.content_width *
params.max_shrink),
static_cast<int>(page_layout_in_points.content_height *
params.max_shrink));
}
float webkit_page_shrink_factor = frame->getPrintPageShrink(page_number);
float scale_factor = css_scale_factor * webkit_page_shrink_factor;
gfx::Rect canvas_area =
params.display_header_footer ? gfx::Rect(page_size) : content_area;
SkBaseDevice* device = metafile->StartPageForVectorCanvas(
page_size, canvas_area, scale_factor);
DCHECK(device);
// The printPage method may take a reference to the canvas we pass down, so it
// can't be a stack object.
skia::RefPtr<skia::VectorCanvas> canvas =
skia::AdoptRef(new skia::VectorCanvas(device));
if (is_preview) {
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
skia::SetIsDraftMode(*canvas, is_print_ready_metafile_sent_);
skia::SetIsPreviewMetafile(*canvas, is_preview);
}
if (params.display_header_footer) {
// |page_number| is 0-based, so 1 is added.
PrintHeaderAndFooter(canvas.get(), page_number + 1,
print_preview_context_.total_page_count(), scale_factor,
page_layout_in_points, *header_footer_info_, params);
}
float webkit_scale_factor = RenderPageContent(frame, page_number, canvas_area,
content_area, scale_factor,
canvas.get());
if (*actual_shrink <= 0 || webkit_scale_factor <= 0) {
NOTREACHED() << "Printing page " << page_number << " failed.";
} else {
// While rendering certain plugins (PDF) to metafile, we might need to
// set custom scale factor. Update |actual_shrink| with custom scale
// if it is set on canvas.
// TODO(gene): We should revisit this solution for the next versions.
// Consider creating metafile of the right size (or resizable)
// https://code.google.com/p/chromium/issues/detail?id=126037
if (!MetafileSkiaWrapper::GetCustomScaleOnCanvas(
*canvas, actual_shrink)) {
// Update the dpi adjustment with the "page |actual_shrink|" calculated in
// webkit.
*actual_shrink /= (webkit_scale_factor * css_scale_factor);
}
}
bool result = metafile->FinishPage();
DCHECK(result);
}
bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
Metafile* metafile, base::SharedMemoryHandle* shared_mem_handle) {
uint32 buf_size = metafile->GetDataSize();
base::SharedMemory shared_buf;
if (buf_size >= kMetafileMaxSize) {
NOTREACHED() << "Buffer too large: " << buf_size;
return false;
}
// Allocate a shared memory buffer to hold the generated metafile data.
if (!shared_buf.CreateAndMapAnonymous(buf_size)) {
NOTREACHED() << "Buffer allocation failed";
return false;
}
// Copy the bits into shared memory.
if (!metafile->GetData(shared_buf.memory(), buf_size)) {
NOTREACHED() << "GetData() failed";
shared_buf.Unmap();
return false;
}
shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), shared_mem_handle);
shared_buf.Unmap();
Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle,
shared_mem_handle));
return true;
}
} // namespace printing
| C++ | 4 | namaljayathunga/nw.js | src/renderer/printing/print_web_view_helper_win.cc | [
"MIT"
] |