text
stringlengths 2
99.7k
| meta
dict |
|---|---|
<PDU>
<str-m></str-m>
<singl><opt-z></opt-z></singl>
<pdu-2>
<ext0>0</ext0>
</pdu-2>
</PDU>
|
{
"pile_set_name": "Github"
}
|
# gogol-fonts
* [Version](#version)
* [Description](#description)
* [Contribute](#contribute)
* [Licence](#licence)
## Version
`0.5.0`
## Description
A client library for the Google Fonts Developer.
## Contribute
For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/gogol/issues).
> _Note:_ this library is an auto-generated Haskell package. Please see `gogol-gen` for more information.
## Licence
`gogol-fonts` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
|
{
"pile_set_name": "Github"
}
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Transition"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Transition/Transition.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Transition"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
|
{
"pile_set_name": "Github"
}
|
{
"images" : [
{
"idiom" : "universal",
"filename" : "Screen Shot 2019-11-28 at 4.10.28 PM.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Screen Shot 2019-11-28 at 4.10.28 PM-1.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Screen Shot 2019-11-28 at 4.10.28 PM-2.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
|
{
"pile_set_name": "Github"
}
|
---
layout: news_post
title: "开始使用 Fastly 分发源码"
author: "hsbt"
translator: "Andor Chen"
date: 2013-09-07 11:30:00 +0000
lang: zh_cn
---
ruby-lang.org 开始通过 https://cache.ruby-lang.org 分发 Ruby 的官方源码。
现在的分发速度很快,因为我们使用了“内容分发网络”(Content Delivery Network,CDN)。
我们使用的 CDN 由 [Fastly][1] 的开源计划提供。感谢 Fastly 的大力支持。
[1]: http://www.fastly.com
|
{
"pile_set_name": "Github"
}
|
{
False leak under RegisterPass
Memcheck:Leak
...
fun:_ZN83_GLOBAL_*PassRegistrar12RegisterPassERKN4llvm8PassInfoE
fun:_ZN4llvm8PassInfo12registerPassEv
}
# Python false positives according to
# http://svn.python.org/projects/python/trunk/Misc/README.valgrind
{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Addr4
obj:/usr/bin/python*
}
{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Value4
obj:/usr/bin/python*
}
{
ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
Memcheck:Cond
obj:/usr/bin/python*
}
{
We don't care if as leaks
Memcheck:Leak
obj:/usr/bin/as
}
{
We don't care if python leaks
Memcheck:Leak
fun:malloc
obj:/usr/bin/python*
}
{
We don't care about anything ld.so does.
Memcheck:Cond
obj:/lib/ld*.so
}
|
{
"pile_set_name": "Github"
}
|
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: version 0.0.1\n"
"POT-Creation-Date: 2009-02-26 19:50+0100\n"
"PO-Revision-Date: 2009-02-18 14:53+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
# #: app/helpers/translation_helper.rb:3
# msgid "%{relative_time} ago"
# msgstr "vor %{relative_time}"
#: app/views/cars/show.html.erb:5
msgid "Axis"
msgid_plural "Axis"
msgstr[0] "Achse"
msgstr[1] "Achsen"
#: app/controllers/cars_controller.rb:47
msgid "Car was successfully created."
msgstr "Auto wurde erfolgreich gespeichert"
#: app/controllers/cars_controller.rb:64
msgid "Car was successfully updated."
msgstr "Auto wurde erfolgreich aktualisiert"
#: app/views/cars/show.html.erb:1 locale/model_attributes.rb:3
msgid "Car|Model"
msgstr "Modell"
#: app/views/cars/show.html.erb:3 locale/model_attributes.rb:4
msgid "Car|Wheels count"
msgstr "Räderzahl"
msgctxt "New car"
msgid "Wheels count"
msgstr "Räderzahl!"
#: app/views/cars/show.html.erb:7
msgid "Created"
msgstr "Erstellt"
#: app/views/cars/show.html.erb:9
msgid "Month"
msgstr "Monat"
#: locale/model_attributes.rb:2
msgid "car"
msgstr "Auto"
#: locale/testlog_phrases.rb:2
msgid "this is a dynamic translation which was found thorugh gettext_test_log!"
msgstr ""
"Dies ist eine dynamische Übersetzung, die durch gettext_test_log "
"gefunden wurde!"
#: app/views/cars/nowhere_really
msgid "Car|wheel"
msgid_plural "Car|wheels"
msgstr[0] "Rad"
msgstr[1] "Räder"
msgctxt "New car"
msgid "wheel"
msgid_plural "wheels"
msgstr[0] "Rad!"
msgstr[1] "Räder!"
msgid "On %{count} wheel."
msgid_plural "On %{count} wheels."
msgstr[0] "Auf %{count} Achse."
msgstr[1] "Auf %{count} Achsen."
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<title>Page 698</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
<!--
p {margin: 0; padding: 0;} .ft00{font-size:9px;font-family:Times;color:#000000;}
.ft01{font-size:11px;font-family:Times;color:#0860a8;}
.ft02{font-size:11px;font-family:Times;color:#000000;}
.ft03{font-size:14px;font-family:Times;color:#0860a8;}
.ft04{font-size:18px;font-family:Times;color:#000000;}
.ft05{font-size:16px;font-family:Times;color:#0860a8;}
.ft06{font-size:8px;font-family:Times;color:#000000;}
.ft07{font-size:12px;font-family:Times;color:#0860a8;}
.ft08{font-size:11px;line-height:16px;font-family:Times;color:#000000;}
.ft09{font-size:11px;line-height:24px;font-family:Times;color:#000000;}
-->
</style>
</head>
<body bgcolor="#A0A0A0" vlink="blue" link="blue">
<div id="page698-div" style="position:relative;width:918px;height:1188px;">
<img width="918" height="1188" src="o_fe12b1e2a880e0ce698.png" alt="background image"/>
<p style="position:absolute;top:1103px;left:68px;white-space:nowrap" class="ft00">18-62 Vol. 3B</p>
<p style="position:absolute;top:47px;left:68px;white-space:nowrap" class="ft01">PERFORMANCE MONITORING</p>
<p style="position:absolute;top:100px;left:68px;white-space:nowrap" class="ft08">Additionally, there is also a fixed counter, counting uncore clockticks, for the<a href="o_fe12b1e2a880e0ce-698.html"> uncore domain. Table 18-39</a> summa-<br/>rizes the number MSRs for uncore PMU for each box.</p>
<p style="position:absolute;top:352px;left:68px;white-space:nowrap" class="ft03">18.9.6.1   Uncore Performance Monitoring Events</p>
<p style="position:absolute;top:380px;left:68px;white-space:nowrap" class="ft02">There are certain restrictions on the uncore performance counters in each C-Box. Specifically,</p>
<p style="position:absolute;top:402px;left:68px;white-space:nowrap" class="ft04">•</p>
<p style="position:absolute;top:403px;left:93px;white-space:nowrap" class="ft02">Occupancy events are supported only with counter 0 but not counter 1.</p>
<p style="position:absolute;top:427px;left:68px;white-space:nowrap" class="ft08">Other uncore C-Box events can be programmed with either counter 0 or 1.<br/>The C-Box uncore performance events described<a href="o_fe12b1e2a880e0ce-812.html"> in Table 19-16 can colle</a>ct performance characteristics of transac-<br/>tions initiated by processor core. In that respect, they are similar to various sub-events in the <br/>OFFCORE_RESPONSE family of performance events in the core PMU. Information such as data supplier locality <br/>(LLC HIT/MISS) and snoop responses can be collected via OFFCORE_RESPONSE and qualified on a per-thread <br/>basis. <br/>On the other hand, uncore performance event logic can not associate its counts with the same level of per-thread <br/>qualification attributes as the core PMU events can. Therefore, whenever similar event programming capabilities <br/>are available from both core PMU and uncore PMU, the recommendation is that utilizing the core PMU events may <br/>be less affected by artifacts, complex interactions and other factors.</p>
<p style="position:absolute;top:641px;left:68px;white-space:nowrap" class="ft05">18.9.7 Intel</p>
<p style="position:absolute;top:639px;left:185px;white-space:nowrap" class="ft01">®</p>
<p style="position:absolute;top:641px;left:198px;white-space:nowrap" class="ft05"> Xeon</p>
<p style="position:absolute;top:639px;left:244px;white-space:nowrap" class="ft01">®</p>
<p style="position:absolute;top:641px;left:257px;white-space:nowrap" class="ft05"> Processor E5 Family Performance Monitoring Facility</p>
<p style="position:absolute;top:671px;left:68px;white-space:nowrap" class="ft02">The Intel</p>
<p style="position:absolute;top:669px;left:128px;white-space:nowrap" class="ft06">®</p>
<p style="position:absolute;top:671px;left:139px;white-space:nowrap" class="ft02"> Xeon</p>
<p style="position:absolute;top:669px;left:177px;white-space:nowrap" class="ft06">®</p>
<p style="position:absolute;top:671px;left:187px;white-space:nowrap" class="ft02"> Processor E5 Family (and Intel</p>
<p style="position:absolute;top:669px;left:397px;white-space:nowrap" class="ft06">®</p>
<p style="position:absolute;top:671px;left:408px;white-space:nowrap" class="ft02"> Core™ i7-3930K Processor) are based on Intel microarchitec-</p>
<p style="position:absolute;top:688px;left:68px;white-space:nowrap" class="ft02">ture code name Sandy Bridge-E. While the processor cores share the same microarchitecture as those of the Intel</p>
<p style="position:absolute;top:685px;left:822px;white-space:nowrap" class="ft06">®</p>
<p style="position:absolute;top:688px;left:833px;white-space:nowrap" class="ft02"> </p>
<p style="position:absolute;top:704px;left:68px;white-space:nowrap" class="ft02">Xeon</p>
<p style="position:absolute;top:701px;left:101px;white-space:nowrap" class="ft06">®</p>
<p style="position:absolute;top:704px;left:112px;white-space:nowrap" class="ft02"> Processor E3 Family and 2nd generation Intel Core i7-2xxx, Intel Core i5-2xxx, Intel Core i3-2xxx processor </p>
<p style="position:absolute;top:721px;left:68px;white-space:nowrap" class="ft08">series, the uncore subsystems are different. An overview of the uncore performance monitoring facilities of the <br/>Intel Xeon processor E5 family (and Intel Core i7-3930K processor) is described<a href="o_fe12b1e2a880e0ce-699.html"> in Section 18.9.8</a>.<br/>Thus, the performance monitoring facilities in the processor core generally are the same as those described in <br/><a href="o_fe12b1e2a880e0ce-686.html">Section 18.9 throug</a><a href="o_fe12b1e2a880e0ce-693.html">h Section 18.9.5.</a> However, the MSR_OFFCORE_RSP_0/MSR_OFFCORE_RSP_1 Response <br/>Supplier Info fiel<a href="o_fe12b1e2a880e0ce-695.html">d shown in Table 18-37 </a>applies to Intel Core Processors with CPUID signature of <br/>DisplayFamily_DisplayModel encoding of 06_2AH; Intel Xeon processor with CPUID signature of <br/>DisplayFamily_DisplayModel encoding of 06_2DH supports an additional field for remote DRAM controller shown in <br/><a href="o_fe12b1e2a880e0ce-699.html">Table 18-40</a>. Additionally, the are some small differences in the non-architectural performance monitoring events <br/><a href="o_fe12b1e2a880e0ce-808.html">(see Table 19-14).</a></p>
<p style="position:absolute;top:158px;left:313px;white-space:nowrap" class="ft07">Table 18-39.  Uncore PMU MSR Summary</p>
<p style="position:absolute;top:199px;left:76px;white-space:nowrap" class="ft02">Box</p>
<p style="position:absolute;top:199px;left:163px;white-space:nowrap" class="ft02"># of Boxes</p>
<p style="position:absolute;top:182px;left:275px;white-space:nowrap" class="ft02">Counters per </p>
<p style="position:absolute;top:199px;left:275px;white-space:nowrap" class="ft02">Box</p>
<p style="position:absolute;top:182px;left:367px;white-space:nowrap" class="ft02">Counter </p>
<p style="position:absolute;top:199px;left:367px;white-space:nowrap" class="ft02">Width</p>
<p style="position:absolute;top:182px;left:448px;white-space:nowrap" class="ft02">General </p>
<p style="position:absolute;top:199px;left:448px;white-space:nowrap" class="ft02">Purpose</p>
<p style="position:absolute;top:182px;left:538px;white-space:nowrap" class="ft02">Global </p>
<p style="position:absolute;top:199px;left:538px;white-space:nowrap" class="ft02">Enable Comment</p>
<p style="position:absolute;top:223px;left:76px;white-space:nowrap" class="ft02">C-Box</p>
<p style="position:absolute;top:223px;left:163px;white-space:nowrap" class="ft02">SKU specific</p>
<p style="position:absolute;top:223px;left:275px;white-space:nowrap" class="ft02">2</p>
<p style="position:absolute;top:223px;left:367px;white-space:nowrap" class="ft02">44</p>
<p style="position:absolute;top:223px;left:448px;white-space:nowrap" class="ft02">Yes</p>
<p style="position:absolute;top:223px;left:538px;white-space:nowrap" class="ft02">Per-box</p>
<p style="position:absolute;top:223px;left:628px;white-space:nowrap" class="ft02">Up to 4, se<a href="o_fe12b1e2a880e0ce-1442.html">eTable 35-19 </a></p>
<p style="position:absolute;top:240px;left:628px;white-space:nowrap" class="ft02">MSR_UNC_CBO_CONFIG</p>
<p style="position:absolute;top:263px;left:76px;white-space:nowrap" class="ft02">ARB</p>
<p style="position:absolute;top:263px;left:163px;white-space:nowrap" class="ft02">1</p>
<p style="position:absolute;top:263px;left:275px;white-space:nowrap" class="ft02">2</p>
<p style="position:absolute;top:263px;left:367px;white-space:nowrap" class="ft02">44</p>
<p style="position:absolute;top:263px;left:449px;white-space:nowrap" class="ft02">Yes</p>
<p style="position:absolute;top:263px;left:538px;white-space:nowrap" class="ft02">Uncore</p>
<p style="position:absolute;top:288px;left:76px;white-space:nowrap" class="ft02">Fixed </p>
<p style="position:absolute;top:304px;left:76px;white-space:nowrap" class="ft02">Counter</p>
<p style="position:absolute;top:288px;left:163px;white-space:nowrap" class="ft02">N.A.</p>
<p style="position:absolute;top:288px;left:275px;white-space:nowrap" class="ft02">N.A.</p>
<p style="position:absolute;top:288px;left:367px;white-space:nowrap" class="ft02">48</p>
<p style="position:absolute;top:288px;left:448px;white-space:nowrap" class="ft02">No</p>
<p style="position:absolute;top:288px;left:538px;white-space:nowrap" class="ft02">Uncore</p>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
ALTER TABLE LAST_READ_POSTS
DROP FOREIGN KEY `FK_USER_READ_POSTS`,
DROP FOREIGN KEY `FK_TOPIC_READ_POSTS`;
ALTER TABLE LAST_READ_POSTS
ADD CONSTRAINT `FK_USER_READ_POSTS` FOREIGN KEY (`USER_ID`) REFERENCES `USERS` (`ID`) ON DELETE CASCADE,
ADD CONSTRAINT `FK_TOPIC_READ_POSTS` FOREIGN KEY (`TOPIC_ID`) REFERENCES `TOPIC` (`TOPIC_ID`) ON DELETE CASCADE;
|
{
"pile_set_name": "Github"
}
|
{
"dist": "dist/js/jplist.sort-bundle.min.js",
"src": [
"src/addons/sort-bundle/js/default-sort/default-sort-view.js",
"src/addons/sort-bundle/js/default-sort/default-sort-dto.js",
"src/addons/sort-bundle/js/dropdown/sort-select-view.js",
"src/addons/sort-bundle/js/dropdown/sort-dropdown-view.js",
"src/addons/sort-bundle/js/dropdown/dto/dropdown-sort-dto.js"
],
"externs": [
"build/closure/google-closure-compiler/externs/jquery-1.7.externs.js",
"build/closure/google-closure-compiler/externs/jplist.addons.externs.js"
],
"version": 10
}
|
{
"pile_set_name": "Github"
}
|
# Analytics
Parse provides a number of hooks for you to get a glimpse into the ticking heart of your app. We understand that it's important to understand what your app is doing, how frequently, and when.
While this section will cover different ways to instrument your app to best take advantage of Parse's analytics backend, developers using Parse to store and retrieve data can already take advantage of metrics on Parse.
Without having to implement any client-side logic, you can view real-time graphs and breakdowns (by device type, Parse class name, or REST verb) of your API Requests in your app's dashboard and save these graph filters to quickly access just the data you're interested in.
The current server time will be used for all analytics requests. To explicitly set the time associated with a given event, an optional `at` parameter can be provided in ISO 8601 format.
```bash
-d '{
"at": {
"__type": "Date",
"iso": "2015-03-01T15:59:11-07:00"
}
}'
```
## App-Open Analytics
Our analytics hook allows you to track your application being launched. By making a POST request to our REST API, you'll begin to collect data on when and how often your application is opened.
In the example below, the `at` parameter is optional. If omitted, the current server time will be used instead.
<div class="language-toggle">
<pre><code class="bash">
curl -X POST \
-H "X-Parse-Application-Id: <span class="custom-parse-server-appid">${APPLICATION_ID}</span>" \
-H "X-Parse-REST-API-Key: <span class="custom-parse-server-restapikey">${REST_API_KEY}</span>" \
-H "Content-Type: application/json" \
-d '{
}' \
<span class="custom-parse-server-protocol">https</span>://<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span><span class="custom-parse-server-mount">/parse/</span>events/AppOpened
</code></pre>
<pre><code class="python">
import json,httplib
connection = httplib.HTTPSConnection('<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span>', 443)
connection.connect()
connection.request('POST', '<span class="custom-parse-server-mount">/parse/</span>events/AppOpened', json.dumps({
}), {
"X-Parse-Application-Id": "<span class="custom-parse-server-appid">${APPLICATION_ID}</span>",
"X-Parse-REST-API-Key": "<span class="custom-parse-server-restapikey">${REST_API_KEY}</span>",
"Content-Type": "application/json"
})
result = json.loads(connection.getresponse().read())
print result
</code></pre>
</div>
Graphs and breakdowns of your statistics are accessible from your app's Dashboard.
## Custom Analytics
Parse Analytics also allows you to track free-form events, with a handful of string keys and values. These extra dimensions allow segmentation of your custom events via your app's Dashboard.
Say your app offers search functionality for apartment listings, and you want to track how often the feature is used, with some additional metadata.
<div class="language-toggle">
<pre><code class="bash">
curl -X POST \
-H "X-Parse-Application-Id: <span class="custom-parse-server-appid">${APPLICATION_ID}</span>" \
-H "X-Parse-REST-API-Key: <span class="custom-parse-server-restapikey">${REST_API_KEY}</span>" \
-H "Content-Type: application/json" \
-d '{
"dimensions": {
"priceRange": "1000-1500",
"source": "craigslist",
"dayType": "weekday"
}
}' \
<span class="custom-parse-server-protocol">https</span>://<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span><span class="custom-parse-server-mount">/parse/</span>events/Search
</code></pre>
<pre><code class="python">
import json,httplib
connection = httplib.HTTPSConnection('<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span>', 443)
connection.connect()
connection.request('POST', '<span class="custom-parse-server-mount">/parse/</span>events/Search', json.dumps({
"dimensions": {
"priceRange": "1000-1500",
"source": "craigslist",
"dayType": "weekday"
}
}), {
"X-Parse-Application-Id": "<span class="custom-parse-server-appid">${APPLICATION_ID}</span>",
"X-Parse-REST-API-Key": "<span class="custom-parse-server-restapikey">${REST_API_KEY}</span>",
"Content-Type": "application/json"
})
result = json.loads(connection.getresponse().read())
print result
</code></pre>
</div>
Parse Analytics can even be used as a lightweight error tracker — simply invoke the following and you'll have access to an overview of the rate and frequency of errors, broken down by error code, in your application:
<div class="language-toggle">
<pre><code class="bash">
curl -X POST \
-H "X-Parse-Application-Id: <span class="custom-parse-server-appid">${APPLICATION_ID}</span>" \
-H "X-Parse-REST-API-Key: <span class="custom-parse-server-restapikey">${REST_API_KEY}</span>" \
-H "Content-Type: application/json" \
-d '{
"dimensions": {
"code": "404"
}
}' \
<span class="custom-parse-server-protocol">https</span>://<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span><span class="custom-parse-server-mount">/parse/</span>events/Error
</code></pre>
<pre><code class="python">
import json,httplib
connection = httplib.HTTPSConnection('<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span>', 443)
connection.connect()
connection.request('POST', '<span class="custom-parse-server-mount">/parse/</span>events/Error', json.dumps({
"dimensions": {
"code": "404"
}
}), {
"X-Parse-Application-Id": "<span class="custom-parse-server-appid">${APPLICATION_ID}</span>",
"X-Parse-REST-API-Key": "<span class="custom-parse-server-restapikey">${REST_API_KEY}</span>",
"Content-Type": "application/json"
})
result = json.loads(connection.getresponse().read())
print result
</code></pre>
</div>
Note that Parse currently only stores the first eight dimension pairs per call to <code class="highlighter-rouge"><span class="custom-parse-server-mount">/parse/</span>events/<eventName></code>.
|
{
"pile_set_name": "Github"
}
|
/*
* Libata driver for the highpoint 366 and 368 UDMA66 ATA controllers.
*
* This driver is heavily based upon:
*
* linux/drivers/ide/pci/hpt366.c Version 0.36 April 25, 2003
*
* Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
* Portions Copyright (C) 2001 Sun Microsystems, Inc.
* Portions Copyright (C) 2003 Red Hat Inc
*
*
* TODO
* Look into engine reset on timeout errors. Should not be required.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <scsi/scsi_host.h>
#include <linux/libata.h>
#define DRV_NAME "pata_hpt366"
#define DRV_VERSION "0.6.11"
struct hpt_clock {
u8 xfer_mode;
u32 timing;
};
/* key for bus clock timings
* bit
* 0:3 data_high_time. Inactive time of DIOW_/DIOR_ for PIO and MW DMA.
* cycles = value + 1
* 4:7 data_low_time. Active time of DIOW_/DIOR_ for PIO and MW DMA.
* cycles = value + 1
* 8:11 cmd_high_time. Inactive time of DIOW_/DIOR_ during task file
* register access.
* 12:15 cmd_low_time. Active time of DIOW_/DIOR_ during task file
* register access.
* 16:18 udma_cycle_time. Clock cycles for UDMA xfer?
* 19:21 pre_high_time. Time to initialize 1st cycle for PIO and MW DMA xfer.
* 22:24 cmd_pre_high_time. Time to initialize 1st PIO cycle for task file
* register access.
* 28 UDMA enable.
* 29 DMA enable.
* 30 PIO_MST enable. If set, the chip is in bus master mode during
* PIO xfer.
* 31 FIFO enable.
*/
static const struct hpt_clock hpt366_40[] = {
{ XFER_UDMA_4, 0x900fd943 },
{ XFER_UDMA_3, 0x900ad943 },
{ XFER_UDMA_2, 0x900bd943 },
{ XFER_UDMA_1, 0x9008d943 },
{ XFER_UDMA_0, 0x9008d943 },
{ XFER_MW_DMA_2, 0xa008d943 },
{ XFER_MW_DMA_1, 0xa010d955 },
{ XFER_MW_DMA_0, 0xa010d9fc },
{ XFER_PIO_4, 0xc008d963 },
{ XFER_PIO_3, 0xc010d974 },
{ XFER_PIO_2, 0xc010d997 },
{ XFER_PIO_1, 0xc010d9c7 },
{ XFER_PIO_0, 0xc018d9d9 },
{ 0, 0x0120d9d9 }
};
static const struct hpt_clock hpt366_33[] = {
{ XFER_UDMA_4, 0x90c9a731 },
{ XFER_UDMA_3, 0x90cfa731 },
{ XFER_UDMA_2, 0x90caa731 },
{ XFER_UDMA_1, 0x90cba731 },
{ XFER_UDMA_0, 0x90c8a731 },
{ XFER_MW_DMA_2, 0xa0c8a731 },
{ XFER_MW_DMA_1, 0xa0c8a732 }, /* 0xa0c8a733 */
{ XFER_MW_DMA_0, 0xa0c8a797 },
{ XFER_PIO_4, 0xc0c8a731 },
{ XFER_PIO_3, 0xc0c8a742 },
{ XFER_PIO_2, 0xc0d0a753 },
{ XFER_PIO_1, 0xc0d0a7a3 }, /* 0xc0d0a793 */
{ XFER_PIO_0, 0xc0d0a7aa }, /* 0xc0d0a7a7 */
{ 0, 0x0120a7a7 }
};
static const struct hpt_clock hpt366_25[] = {
{ XFER_UDMA_4, 0x90c98521 },
{ XFER_UDMA_3, 0x90cf8521 },
{ XFER_UDMA_2, 0x90cf8521 },
{ XFER_UDMA_1, 0x90cb8521 },
{ XFER_UDMA_0, 0x90cb8521 },
{ XFER_MW_DMA_2, 0xa0ca8521 },
{ XFER_MW_DMA_1, 0xa0ca8532 },
{ XFER_MW_DMA_0, 0xa0ca8575 },
{ XFER_PIO_4, 0xc0ca8521 },
{ XFER_PIO_3, 0xc0ca8532 },
{ XFER_PIO_2, 0xc0ca8542 },
{ XFER_PIO_1, 0xc0d08572 },
{ XFER_PIO_0, 0xc0d08585 },
{ 0, 0x01208585 }
};
/**
* hpt36x_find_mode - find the hpt36x timing
* @ap: ATA port
* @speed: transfer mode
*
* Return the 32bit register programming information for this channel
* that matches the speed provided.
*/
static u32 hpt36x_find_mode(struct ata_port *ap, int speed)
{
struct hpt_clock *clocks = ap->host->private_data;
while (clocks->xfer_mode) {
if (clocks->xfer_mode == speed)
return clocks->timing;
clocks++;
}
BUG();
return 0xffffffffU; /* silence compiler warning */
}
static const char * const bad_ata33[] = {
"Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3",
"Maxtor 90845U3", "Maxtor 90650U2",
"Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5",
"Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2",
"Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6",
"Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4",
"Maxtor 90510D4",
"Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2",
"Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7",
"Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4",
"Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5",
"Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2",
NULL
};
static const char * const bad_ata66_4[] = {
"IBM-DTLA-307075",
"IBM-DTLA-307060",
"IBM-DTLA-307045",
"IBM-DTLA-307030",
"IBM-DTLA-307020",
"IBM-DTLA-307015",
"IBM-DTLA-305040",
"IBM-DTLA-305030",
"IBM-DTLA-305020",
"IC35L010AVER07-0",
"IC35L020AVER07-0",
"IC35L030AVER07-0",
"IC35L040AVER07-0",
"IC35L060AVER07-0",
"WDC AC310200R",
NULL
};
static const char * const bad_ata66_3[] = {
"WDC AC310200R",
NULL
};
static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,
const char * const list[])
{
unsigned char model_num[ATA_ID_PROD_LEN + 1];
int i = 0;
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
while (list[i] != NULL) {
if (!strcmp(list[i], model_num)) {
pr_warn("%s is not supported for %s\n",
modestr, list[i]);
return 1;
}
i++;
}
return 0;
}
/**
* hpt366_filter - mode selection filter
* @adev: ATA device
*
* Block UDMA on devices that cause trouble with this controller.
*/
static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
{
if (adev->class == ATA_DEV_ATA) {
if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
mask &= ~ATA_MASK_UDMA;
if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3))
mask &= ~(0xF8 << ATA_SHIFT_UDMA);
if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
mask &= ~(0xF0 << ATA_SHIFT_UDMA);
} else if (adev->class == ATA_DEV_ATAPI)
mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
return mask;
}
static int hpt36x_cable_detect(struct ata_port *ap)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u8 ata66;
/*
* Each channel of pata_hpt366 occupies separate PCI function
* as the primary channel and bit1 indicates the cable type.
*/
pci_read_config_byte(pdev, 0x5A, &ata66);
if (ata66 & 2)
return ATA_CBL_PATA40;
return ATA_CBL_PATA80;
}
static void hpt366_set_mode(struct ata_port *ap, struct ata_device *adev,
u8 mode)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 addr = 0x40 + 4 * adev->devno;
u32 mask, reg, t;
/* determine timing mask and find matching clock entry */
if (mode < XFER_MW_DMA_0)
mask = 0xc1f8ffff;
else if (mode < XFER_UDMA_0)
mask = 0x303800ff;
else
mask = 0x30070000;
t = hpt36x_find_mode(ap, mode);
/*
* Combine new mode bits with old config bits and disable
* on-chip PIO FIFO/buffer (and PIO MST mode as well) to avoid
* problems handling I/O errors later.
*/
pci_read_config_dword(pdev, addr, ®);
reg = ((reg & ~mask) | (t & mask)) & ~0xc0000000;
pci_write_config_dword(pdev, addr, reg);
}
/**
* hpt366_set_piomode - PIO setup
* @ap: ATA interface
* @adev: device on the interface
*
* Perform PIO mode setup.
*/
static void hpt366_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
hpt366_set_mode(ap, adev, adev->pio_mode);
}
/**
* hpt366_set_dmamode - DMA timing setup
* @ap: ATA interface
* @adev: Device being configured
*
* Set up the channel for MWDMA or UDMA modes. Much the same as with
* PIO, load the mode number and then set MWDMA or UDMA flag.
*/
static void hpt366_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
hpt366_set_mode(ap, adev, adev->dma_mode);
}
static struct scsi_host_template hpt36x_sht = {
ATA_BMDMA_SHT(DRV_NAME),
};
/*
* Configuration for HPT366/68
*/
static struct ata_port_operations hpt366_port_ops = {
.inherits = &ata_bmdma_port_ops,
.cable_detect = hpt36x_cable_detect,
.mode_filter = hpt366_filter,
.set_piomode = hpt366_set_piomode,
.set_dmamode = hpt366_set_dmamode,
};
/**
* hpt36x_init_chipset - common chip setup
* @dev: PCI device
*
* Perform the chip setup work that must be done at both init and
* resume time
*/
static void hpt36x_init_chipset(struct pci_dev *dev)
{
u8 drive_fast;
pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78);
pci_write_config_byte(dev, PCI_MIN_GNT, 0x08);
pci_write_config_byte(dev, PCI_MAX_LAT, 0x08);
pci_read_config_byte(dev, 0x51, &drive_fast);
if (drive_fast & 0x80)
pci_write_config_byte(dev, 0x51, drive_fast & ~0x80);
}
/**
* hpt36x_init_one - Initialise an HPT366/368
* @dev: PCI device
* @id: Entry in match table
*
* Initialise an HPT36x device. There are some interesting complications
* here. Firstly the chip may report 366 and be one of several variants.
* Secondly all the timings depend on the clock for the chip which we must
* detect and look up
*
* This is the known chip mappings. It may be missing a couple of later
* releases.
*
* Chip version PCI Rev Notes
* HPT366 4 (HPT366) 0 UDMA66
* HPT366 4 (HPT366) 1 UDMA66
* HPT368 4 (HPT366) 2 UDMA66
* HPT37x/30x 4 (HPT366) 3+ Other driver
*
*/
static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
static const struct ata_port_info info_hpt366 = {
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA2,
.udma_mask = ATA_UDMA4,
.port_ops = &hpt366_port_ops
};
const struct ata_port_info *ppi[] = { &info_hpt366, NULL };
void *hpriv = NULL;
u32 reg1;
int rc;
rc = pcim_enable_device(dev);
if (rc)
return rc;
/* May be a later chip in disguise. Check */
/* Newer chips are not in the HPT36x driver. Ignore them */
if (dev->revision > 2)
return -ENODEV;
hpt36x_init_chipset(dev);
pci_read_config_dword(dev, 0x40, ®1);
/* PCI clocking determines the ATA timing values to use */
/* info_hpt366 is safe against re-entry so we can scribble on it */
switch ((reg1 & 0x700) >> 8) {
case 9:
hpriv = &hpt366_40;
break;
case 5:
hpriv = &hpt366_25;
break;
default:
hpriv = &hpt366_33;
break;
}
/* Now kick off ATA set up */
return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, hpriv, 0);
}
#ifdef CONFIG_PM
static int hpt36x_reinit_one(struct pci_dev *dev)
{
struct ata_host *host = pci_get_drvdata(dev);
int rc;
rc = ata_pci_device_do_resume(dev);
if (rc)
return rc;
hpt36x_init_chipset(dev);
ata_host_resume(host);
return 0;
}
#endif
static const struct pci_device_id hpt36x[] = {
{ PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), },
{ },
};
static struct pci_driver hpt36x_pci_driver = {
.name = DRV_NAME,
.id_table = hpt36x,
.probe = hpt36x_init_one,
.remove = ata_pci_remove_one,
#ifdef CONFIG_PM
.suspend = ata_pci_device_suspend,
.resume = hpt36x_reinit_one,
#endif
};
module_pci_driver(hpt36x_pci_driver);
MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for the Highpoint HPT366/368");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, hpt36x);
MODULE_VERSION(DRV_VERSION);
|
{
"pile_set_name": "Github"
}
|
package away3d.textfield.utils;
import flash.display.Bitmap;
import flash.display.BitmapData;
import haxe.io.Bytes;
import openfl.errors.Error;
/**
* ...
* @author P.J.Shand
* @author Thomas Byrne
*/
class FontSize
{
public var family:String;
public var size:Int;
public var data:Xml;
public var texture:BitmapData;
public function FontSize(searchClass:Bool=true)
{
if (searchClass) {
var type:Class<FontSize> = Type.getClass(this);
try {
family = Reflect.getProperty(type, "FAMILY");
size = Reflect.getProperty(type, "SIZE");
var dataType:Class<Dynamic> = Reflect.getProperty(type, "DATA");
var textureType:Class<Dynamic> = Reflect.getProperty(type, "TEXTURE");
data = cast(Type.createInstance(dataType, null), Xml);
//texture = cast(Type.createInstance(textureType, null), Bitmap).bitmapData;
texture = BitmapData.fromBytes(cast(Type.createInstance(textureType, []), Bytes)); // is this correct?
}catch (e:Error) {
throw new Error("Class inheriting from FontSize ("+type+") should have PUBLIC static members FAMILY, SIZE, DATA and TEXTURE.");
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
{% extends "third_party/base.html" %}
{% block third_party_content %}
<h3>
Разрешение для приложения {{token.application_name}}
<small>
{% if token.state.is_UNPROCESSED %}запрошено <span class="pgf-format-datetime" data-timestamp="{{ token.created_at|timestamp }}"></span>{% endif %}
{% if token.state.is_ACCEPTED %}выдано <span class="pgf-format-datetime" data-timestamp="{{ token.updated_at|timestamp }}"></span>{% endif %}
</small>
</h3>
{% if token.application_info %}
<p><small>{{token.application_info}}</small></p>
{% endif %}
{% if token.application_description %}
<h4>описание</h4>
<p>{{token.application_description}}</p>
{% endif %}
{% if token.state.is_UNPROCESSED %}
<p class="alert alert-info">
<strong>Приложение запрашивает разрешение на доступ и изменение Ваших игровых данных.</strong><br/>
Приложение <strong>не получит</strong> доступ к управлению вашим аккаунтом (включая смену логина/пароля) и к магазину (трате печенек).<br/>
Приложению будет доступно получение и изменение информации непосредственно связанной с игрой (например, помощь герою).
</p>
<a href="{{url('accounts:third-party:tokens:accept', token.uid)}}"
class="pgf-forms-post-simple btn btn-success pgf-accept-button">Разрешить</a>
<a href="{{url('accounts:third-party:tokens:remove', token.uid)}}"
class="pgf-forms-post-simple btn btn-danger pgf-remove-button"
data-action-type="redirect"
data-redirect-url="{{url('accounts:third-party:tokens:')}}">Отказать</a>
{% endif %}
{% if token.state.is_ACCEPTED %}
<p class="alert alert-success">
<strong>Вы разрешили приложению получать и изменять Ваши игровые данные.</strong><br/>
Приложение <strong>не может</strong> управлять вашим аккаунтом (включая смену логина/пароля) и делать покупки в магазине.<br/>
Приложение может получать и изменять информации непосредственно связанную с игрой (например, помогать герою).<br/><br/>
<strong>Теперь Вы можете вернуться к использованию приложения.</strong>
</p>
<a href="{{url('accounts:third-party:tokens:remove', token.uid)}}"
class="pgf-forms-post-simple btn btn-danger pgf-remove-button"
data-confirmation="Вы действительно хотите отозвать выданное разрешение?"
data-action-type="redirect"
data-redirect-url="{{url('accounts:third-party:tokens:')}}">Отозвать разрешение</a>
{% endif %}
<a href="{{url('accounts:third-party:tokens:')}}">к списку разрешений</a>
{% endblock %}
|
{
"pile_set_name": "Github"
}
|
# Hadoop MapReduce InputFormat/OutputFormat for TFRecords
This directory contains a [Apache Hadoop](http://hadoop.apache.org/) MapReduce
InputFormat/OutputFormat implementation for TensorFlow's TFRecords format.
This can also be used with [Apache Spark](http://spark.apache.org/).
## Prerequisites
1. [Apache Maven](https://maven.apache.org/)
2. Tested with Hadoop 2.6.0. Patches are welcome if there are incompatibilities
with your Hadoop version.
## Breaking changes
* 08/20/2018 - Reverted artifactId back to `org.tensorflow.tensorflow-hadoop`
* 05/29/2018 - Changed the artifactId from `org.tensorflow.tensorflow-hadoop` to `org.tensorflow.hadoop`
## Build and install
1. Compile the code
```sh
mvn clean package
```
Alternatively, if you would like to build jars for a different version of TensorFlow, e.g., 1.5.0:
```sh
mvn versions:set -DnewVersion=1.5.0
mvn clean package
```
2. Optionally install (or deploy) the jars
```sh
mvn install
```
After installation (or deployment), the package can be used with the following dependency:
```xml
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-hadoop</artifactId>
<version>1.10.0</version>
</dependency>
```
## Use with MapReduce
The Hadoop MapReduce example can be found [here](src/main/java/org/tensorflow/hadoop/example/TFRecordFileMRExample.java).
## Use with Apache Spark
The [Spark-TensorFlow-Connector](../spark/spark-tensorflow-connector) uses TensorFlow Hadoop to load and save
TensorFlow's TFRecords format using Spark DataFrames.
|
{
"pile_set_name": "Github"
}
|
netcdf ref_typescope {
group: f {
types:
opaque(3) op_t1 ;
} // group f
group: g {
types:
opaque(4) op_t2 ;
variables:
/f/op_t1 v1 ;
data:
v1 = 0X000000 ;
group: h {
types:
opaque(4) op_t3 ;
variables:
op_t2 v2 ;
data:
v2 = 0X00000000 ;
} // group h
group: i {
types:
opaque(4) op_t2 ;
variables:
op_t2 v2 ;
data:
v2 = 0X00000000 ;
} // group i
} // group g
group: j {
variables:
/g/op_t2 v2 ;
data:
v2 = 0X00000000 ;
} // group j
}
|
{
"pile_set_name": "Github"
}
|
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"removeComments": false,
"preserveConstEnums": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"outDir": "lib",
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"sourceMap": true,
"baseUrl": ".",
"rootDir": ".",
"jsx": "react",
"jsxFactory": "React.createElement",
"allowJs": true,
"resolveJsonModule": true,
"typeRoots": [
"node_modules/@types",
"global.d.ts"
]
},
"exclude": [
"node_modules",
"dist"
],
"compileOnSave": false
}
|
{
"pile_set_name": "Github"
}
|
<?php
/*
+---------------------------------------------------------------------------+
| Revive Adserver |
| http://www.revive-adserver.com |
| |
| Copyright: See the COPYRIGHT.txt file. |
| License: GPLv2 or later, see the LICENSE.txt file. |
+---------------------------------------------------------------------------+
*/
require_once(MAX_PATH.'/lib/OA/Upgrade/Migration.php');
class Migration_100 extends Migration
{
function __construct()
{
//$this->__construct();
$this->aTaskList_constructive[] = 'beforeAddTable__lb_local';
$this->aTaskList_constructive[] = 'afterAddTable__lb_local';
$this->aTaskList_constructive[] = 'beforeAddField__clients__lb_reporting';
$this->aTaskList_constructive[] = 'afterAddField__clients__lb_reporting';
$this->aObjectMap['clients']['lb_reporting'] = array('fromTable'=>'clients', 'fromField'=>'lb_reporting');
}
function beforeAddTable__lb_local()
{
return $this->beforeAddTable('lb_local');
}
function afterAddTable__lb_local()
{
return $this->afterAddTable('lb_local');
}
function beforeAddField__clients__lb_reporting()
{
return $this->beforeAddField('clients', 'lb_reporting');
}
function afterAddField__clients__lb_reporting()
{
return $this->afterAddField('clients', 'lb_reporting');
}
}
?>
|
{
"pile_set_name": "Github"
}
|
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: microphone
m_Shader: {fileID: 4800000, guid: 31bfda934c27bd54a96d5f3f1ae1d398, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: 3000
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 3124af9a99de67c45b620b77de5eaa71, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _EmissionGain
second: 0.3
- first:
name: _Glossiness
second: 0.5
- first:
name: _InvFade
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 0, b: 0, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _TintColor
second: {r: 1, g: 1, b: 1, a: 0.5}
|
{
"pile_set_name": "Github"
}
|
/* @flow */
import { InputTypeComposer } from 'graphql-compose';
import { getQueryITC } from '../Query';
import { getTypeName, type CommonOpts, desc } from '../../../utils';
export function getHasChildITC<TContext>(opts: CommonOpts<TContext>): InputTypeComposer<TContext> {
const name = getTypeName('QueryHasChild', opts);
const description = desc(
`
The has_child filter accepts a query and the child type to run against,
and results in parent documents that have child docs matching the query.
[Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-child-query.html)
`
);
return opts.getOrCreateITC(name, () => ({
name,
description,
fields: {
type: 'String',
query: (): InputTypeComposer<TContext> => getQueryITC(opts),
score_mode: {
type: 'String',
description: 'Can be: `avg`, `sum`, `max`, `min`, `none`.',
},
min_children: 'Int',
max_children: 'Int',
},
}));
}
|
{
"pile_set_name": "Github"
}
|
# ******************************************************************************
# Copyright 2014-2018 Intel Corporation
#
# 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.
# ******************************************************************************
[-
our $int16;
our $prefix = 'h';
our $shareI = 64;
our $shareF = 64;
our $stepI = 32;
our $stepF = 32;
our $remapF = 1;
our $remapI = 1;
our $convert = $int16 ? 'I2F.F32.S16' : 'F2F.F32.F16';
sub convert {return $convert;}
-]
<INCLUDE file="xconv_xprop_common.sass"/>
<CONSTANT_MAPPING>
addr_zero : 4x<64*8*2 + 64*8*2 + 0>
szShareF : (64*8)
szShareI : (64*8)
addr_zero : 4x<64*8*2 + 64*8*2 + 0>
addr_mpqk : 4x<64*8*2 + 64*8*2 + 4>
addr_m : 4x<64*8*2 + 64*8*2 + 4>
addr_p : 4x<64*8*2 + 64*8*2 + 5>
addr_q : 4x<64*8*2 + 64*8*2 + 6>
addr_k : 4x<64*8*2 + 64*8*2 + 7>
addr_szLut : 4x<64*8*2 + 64*8*2 + 8>
addr_lut : 4x<64*8*2 + 64*8*2 + 10>
[+ params() +]
</CONSTANT_MAPPING>
<REGISTER_MAPPING>
3, 2,11,10,19,18,27,26 : cx<0-7>y0
7, 6,15,14,23,22,31,30 : cx<0-7>y1
1, 0, 9, 8,17,16,25,24 : cx<0-7>y2
5, 4,13,12,21,20,29,28 : cx<0-7>y3
35,34,43,42,51,50,59,58 : cx<0-7>y4
39,38,47,46,55,54,63,62 : cx<0-7>y5
33,32,41,40,49,48,57,56 : cx<0-7>y6
37,36,45,44,53,52,61,60 : cx<0-7>y7
0-63 : czero<00-63>
64-67 : mpqk<0-3>
64-67 : m, p, q
64-71 : idx_M, idx_P, idx_Q, idx_K, idx_N, tid, tidY, negOne
72-111 ~ tid1, tidX, idx_MPQk, idx_PQk, idx_Qk, idx_k, magic_PQk, magic_Qk, neg_PQk, neg_Qk, neg_k, div1, div2, div3, idx_P2, idx_Q2, q1, q2
72-111 ~ mask_shr, rst, lutStore, lutStore2, warp_count, mt, pr, qs, dep_thd_mask, dep_thd_bits, dep_thd_cnt, t, r, s, rs, x, y, z, ballot, warp_slices, partial, endCRST, str_d, str_h, str_w, rst_prime, x_prime, y_prime, z_prime
64-79 : j0Ix<0-7>, j0Fy<0-7>
80-95 : j1Ix<0-7>, j1Fy<0-7>
96-99 : trackI<0-1>, trackF<0-1>
100-103 : loadI<0-3>
100-103 : storeI<0-3>
104-107 : storeI<4-7>
108-111 : loadF<0-3>
108-111 : storeF<0-3>
104-107 : storeF<4-7>
104-107 ~ offsetF
112-113 : sliceI, sliceF
112-113 : sliceIF<0-1>
114-125 ~ writeS, offsetIn, offsetFk, posCRST, posCRSTf, channel, lutSize, lutSizeRcp, lutOffset, offsetI, offsetIc, offsetFc
126-127 ~ readFs, readIs
72-91 : cs<0-7>, c<0-3>, b<0-7>
72-83 ~ x<0-7>
92-99 : out<0-7>
100-101 : Out<0-1>
102-103 : Sum<0-1>
104-125 ~ writeCs, readCs, alpha, k, n, sum<0-3>, offset, out_offset, bsum_offset, tidOX, tidOY, preds, one
</REGISTER_MAPPING>
--:-:1:-:1 S2R tid, SR_TID.X;
--:-:2:-:1 S2R idx_MPQk, SR_CTAID.X;
--:-:3:-:1 S2R idx_K, SR_CTAID.Y;
--:-:4:-:1 S2R idx_N, SR_CTAID.Z;
<SCHEDULE_BLOCK>
01:-:-:-:1 ISETP.GE.AND P0, PT, tid, 32, PT;
[+ load_zeros() +]
[+ get_mpqk() +]
// tidX = (tid & 7) << 3
// tidY = tid >> 3
--:-:-:-:1 LOP.AND tidX, tid, 7;
--:-:-:-:1 SHL tidX, tidX, 3;
--:-:-:-:1 SHR.U32 tidY, tid, 3;
// trackF += blkF*64 + tidX
--:-:-:-:1 ISCADD offsetFk, idx_K, tidX, 6;
// trackI += blkI*64 + tidX
08:-:-:-:1 ISCADD offsetIn, idx_N, tidX, 6;
// Remap the X dim to avoid bank conflicts when storing to shared
// We can unmap this in the output
--:-:-:-:1 SHR.U32 tidX, tidX, 1;
// writeS = (64*tidY + tidX) * 4
--:-:-:-:1 ISCADD writeS, tidY, tidX, 6;
--:-:-:-:1 SHL writeS, writeS, 2;
// readFs = (((tid & -16) >> 3) | (tid & 1)) << 4;
--:-:-:-:1 LOP.AND tid1, tid, 1;
--:-:-:-:1 LOP.AND readFs, tid, -16;
--:-:-:-:1 SHR.U32 readFs, readFs, 3;
--:-:-:-:1 LOP.OR readFs, readFs, tid1;
--:-:-:-:0 SHL readFs, readFs, 4;
// readIs = ((tid >> 1) & 7) << 4 + 4x<8*64>;
--:-:-:-:1 BFE.U32 readIs, tid, 0x301; // 3 bits at position 1
--:-:-:-:1 ISCADD readIs, readIs, 4x<szShareF>, 4;
</SCHEDULE_BLOCK>
[+ load_lut() +]
--:-:1:-:1 @P1 LDG.E.CI.128 loadF0, [trackF];
--:-:5:-:1 @!P1 LDS.U.128 loadF0, [addr_zero];
--:-:2:-:1 @P1 LDG.E.128 loadI0, [trackI];
--:-:6:-:1 @!P1 LDS.U.128 loadI0, [addr_zero];
11:-:-:-:1 [+ convert() +] storeF7, loadF3.H1;
--:-:-:-:1 [+ convert() +] storeF6, loadF3.H0;
--:-:-:-:1 [+ convert() +] storeF5, loadF2.H1;
--:-:1:-:1 [+ convert() +] storeF4, loadF2.H0;
--:-:-:-:1 [+ convert() +] storeF3, loadF1.H1;
--:-:-:-:1 [+ convert() +] storeF2, loadF1.H0;
--:-:-:-:1 [+ convert() +] storeF1, loadF0.H1;
--:-:5:-:1 [+ convert() +] storeF0, loadF0.H0;
01:1:-:-:1 STS.128 [writeS + 4x<0*64 + 32>], storeF4;
10:-:-:-:1 STS.128 [writeS + 4x<0*64 + 0>], storeF0;
23:-:-:-:1 [+ convert() +] storeI7, loadI3.H1;
--:-:-:-:1 [+ convert() +] storeI6, loadI3.H0;
--:-:-:-:1 [+ convert() +] storeI5, loadI2.H1;
--:-:1:-:1 [+ convert() +] storeI4, loadI2.H0;
--:-:-:-:1 [+ convert() +] storeI3, loadI1.H1;
--:-:-:-:1 [+ convert() +] storeI2, loadI1.H0;
--:-:-:-:1 [+ convert() +] storeI1, loadI0.H1;
--:-:5:-:1 [+ convert() +] storeI0, loadI0.H0;
01:-:-:-:1 STS.128 [writeS + 4x<8*64 + 32>], storeI4;
10:1:-:-:1 STS.128 [writeS + 4x<8*64 + 0>], storeI0;
[+ loop_setup() +]
--:-:2:-:2 @P1 LDG.E.CI.128 loadF0, [trackF + 4x< 0>];
--:-:3:-:1 @P1 LDG.E.128 loadI0, [trackI + 4x< 0>];
[-
our $convert;
our %insert =
(
j0c1 => "--:-:-:-:1 ISETP.GE.AND P1, PT, posCRST, RZ, PT;\n",
j0c3 => "--:-:-:-:1 ISETP.GE.AND P0, PT, posCRST, -8, PT;\n",
j0c13 => "--:-:6:-:1 \@P1 I2F.F32.S32 posCRSTf, posCRST;\n",
j0c39 => "20:-:-:-:1 \@P1 FMUL channel, posCRSTf, lutSizeRcp;\n",
j0c44 => "--:-:-:-:1 \@P1 FFMA channel, channel, 5.9604644775390625e-08, channel;\n",
j0c46 => "--:-:6:-:1 \@P1 F2I.S32.F32.TRUNC channel, channel;\n",
j1c8 => "20:-:-:-:1 \@P1 VMAD.U16.U16 lutOffset, -channel, lutSize, posCRST;\n",
j1c13 => "--:-:-:-:1 \@P1 SHL lutOffset, lutOffset, 3;\n",
j1c17 => "--:-:6:-:1 \@P1 LDS.U.64 sliceIF, [lutOffset + addr_lut];\n",
j1c20 => "--:-:-:-:1 \@P1 XMAD offsetFc, channel, param_KRST, RZ;\n",
j1c25 => "--:-:-:-:1 \@P1 XMAD offsetIc, channel, param_DHWN, RZ;\n",
j1c31 => "--:-:-:-:1 \@P1 XMAD.PSL offsetIc, channel, param_DHWN.H1, offsetIc;\n",
j1c32 => "--:-:-:-:1 IADD posCRST, posCRST, -8;\n",
j1c18 => "02:-:-:-:1 \@P0 $convert storeF7, loadF3.H1;\n",
j1c22 => "--:-:-:-:1 \@P0 $convert storeF6, loadF3.H0;\n",
j1c26 => "--:-:-:-:1 \@P0 $convert storeF5, loadF2.H1;\n",
j1c30 => "--:-:5:-:1 \@P0 $convert storeF4, loadF2.H0;\n",
j1c33 => "--:-:-:-:1 \@P0 $convert storeF3, loadF1.H1;\n",
j1c37 => "--:-:-:-:1 \@P0 $convert storeF2, loadF1.H0;\n",
j1c41 => "--:-:-:-:1 \@P0 $convert storeF1, loadF0.H1;\n",
j1c45 => "--:-:2:-:1 \@P0 $convert storeF0, loadF0.H0;\n",
j1c47 => "10:5:-:-:1 \@P0 STS.128 [writeS + 4x<0*64 + 32>], storeF4;\n",
j1c62 => "02:2:-:-:1 \@P0 STS.128 [writeS + 4x<0*64 + 0>], storeF0;\n",
j2c19 => "30:-:-:-:1 \@P1 IADD3 offsetF, offsetFk, offsetFc, sliceF;\n",
j2c24 => "--:-:-:-:1 \@P1 LEA trackF0.CC, offsetF, param_F[0], 1;\n",
j2c26 => "--:-:-:-:1 \@P1 IADD3 offsetI, offsetIn, offsetIc, sliceI;\n",
j2c28 => "--:-:-:-:1 \@P1 LEA.HI.X trackF1, offsetF, param_F[1], RZ, 1;\n",
j2c30 => "02:-:2:-:1 \@P1 LDG.E.CI.128 loadF0, [trackF];\n",
j5c29 => "04:-:-:-:1 \@P0 $convert storeI7, loadI3.H1;\n",
j5c33 => "--:-:-:-:1 \@P0 $convert storeI6, loadI3.H0;\n",
j5c37 => "--:-:-:-:1 \@P0 $convert storeI5, loadI2.H1;\n",
j5c41 => "--:-:5:-:1 \@P0 $convert storeI4, loadI2.H0;\n",
j5c45 => "--:-:-:-:1 \@P0 $convert storeI3, loadI1.H1;\n",
j5c49 => "--:-:-:-:1 \@P0 $convert storeI2, loadI1.H0;\n",
j5c53 => "--:-:-:-:1 \@P0 $convert storeI1, loadI0.H1;\n",
j5c57 => "--:-:3:-:1 \@P0 $convert storeI0, loadI0.H0;\n",
j5c59 => "10:-:-:-:1 \@P0 STS.128 [writeS + 4x<8*64 + 32>], storeI4;\n",
j6c8 => "04:3:-:-:1 \@P0 STS.128 [writeS + 4x<8*64 + 0>], storeI0;\n",
j6c50 => "--:-:-:-:1 \@P1 LEA trackI0.CC, offsetI, param_I[0], 1;\n",
j6c55 => "--:-:-:-:1 \@P1 LEA.HI.X trackI1, offsetI, param_I[1], RZ, 1;\n",
j6c61 => "04:-:3:-:1 \@P1 LDG.E.128 loadI0, [trackI];\n",
j6c62 => "--:-:-:-:5 \@P0 BAR.SYNC 0;\n" .
"--:-:-:-:1 \@P0 LOP.XOR readIs, readIs, 4x<64*8*2>;\n" .
"--:-:-:-:1 \@P0 LOP.XOR readFs, readFs, 4x<64*8*2>;\n" .
"--:-:-:-:1 \@P0 LOP.XOR writeS, writeS, 4x<64*8*2>;\n",
j7c63 => "--:-:-:Y:5 \@P0 BRA.U LOOP;\n",
);
-]
LOOP:
[+ main_loop() +]
--:-:1:-:1 LDS.U.128 mpqk, [addr_mpqk];
--:-:2:-:1 S2R tid, SR_TID.X;
--:-:3:-:1 S2R idx_N, SR_CTAID.Z;
<SCHEDULE_BLOCK>
// tidOX = (tid & 7) << 3
// tidOY = tid >> 3
02:-:-:-:1 LOP.AND tidOX, tid, 7;
--:-:-:-:1 SHL tidOX, tidOX, 3;
--:-:-:-:1 SHR.U32 tidOY, tid, 3;
--:-:-:-:1 LOP.AND readIs, readIs, 0x7ff;
--:-:-:-:1 LOP.AND readFs, readFs, 0x7ff;
// Expand back out to undo our bank conflict avoiding stride
--:-:-:-:1 SHL readIs, readIs, 1;
// Div by 4 here collapses k stride
// writeCs = (readFs / 4) * 64 + readIs;
--:-:-:-:1 ISCADD writeCs, readFs, readIs, 4;
// readCs = 4 * (tidOX + (tidOY * 64))
--:-:-:-:1 ISCADD readCs, tidOY, tidOX, 6;
--:-:-:-:1 SHL readCs, readCs, 2;
// n = blkI*64 + tidOX;
04:-:-:-:1 ISCADD n, idx_N, tidOX, 6;
// Mul by 4 here expands k stride back out
// Mul by 2 again to undo the bank conflict avoiding stride
// k = blkF*64 + tidOY * 8
--:-:-:-:1 SHL tidOY, tidOY, 3;
01:-:-:-:1 ISCADD k, idx_K, tidOY, 6;
[+ output_setup(63, 0, 6) +]
</SCHEDULE_BLOCK>
[+ output() +]
|
{
"pile_set_name": "Github"
}
|
// Aleth: Ethereum C++ client, tools and libraries.
// Copyright 2014-2019 Aleth Authors.
// Licensed under the GNU General Public License, Version 3.
#pragma once
#include "CommonNet.h"
#include <libp2p/Capability.h>
#include <libp2p/CapabilityHost.h>
namespace dev
{
namespace eth
{
class SnapshotStorageFace;
constexpr unsigned c_WarpProtocolVersion = 1;
enum WarpSubprotocolPacketType : byte
{
WarpStatusPacket = 0x00,
GetSnapshotManifestPacket = 0x11,
SnapshotManifestPacket = 0x12,
GetSnapshotDataPacket = 0x13,
SnapshotDataPacket = 0x14,
WarpSubprotocolPacketCount
};
char const* warpPacketTypeToString(WarpSubprotocolPacketType _packetType);
struct WarpPeerStatus
{
/// Peer's protocol version.
unsigned m_protocolVersion = 0;
/// Peer's network id.
u256 m_networkId;
/// What, if anything, we last asked the other peer for.
Asking m_asking = Asking::Nothing;
/// When we asked for it. Allows a time out.
time_t m_lastAsk;
/// These are determined through either a Status message.
h256 m_latestHash; ///< Peer's latest block's hash.
u256 m_totalDifficulty; ///< Peer's latest block's total difficulty.
h256 m_genesisHash; ///< Peer's genesis hash
h256 m_snapshotHash;
u256 m_snapshotNumber;
};
class WarpPeerObserverFace
{
public:
virtual ~WarpPeerObserverFace() {}
virtual void onPeerStatus(NodeID const& _peerID) = 0;
virtual void onPeerManifest(NodeID const& _peerID, RLP const& _r) = 0;
virtual void onPeerBlockHeaders(NodeID const& _peerID, RLP const& _r) = 0;
virtual void onPeerData(NodeID const& _peerID, RLP const& _r) = 0;
virtual void onPeerDisconnect(NodeID const& _peerID, Asking _asking) = 0;
};
class WarpCapability : public p2p::CapabilityFace
{
public:
WarpCapability(std::shared_ptr<p2p::CapabilityHostFace> _host, BlockChain const& _blockChain,
u256 const& _networkId, boost::filesystem::path const& _snapshotDownloadPath,
std::shared_ptr<SnapshotStorageFace> _snapshotStorage);
std::string name() const override { return "par"; }
unsigned version() const override { return c_WarpProtocolVersion; }
p2p::CapDesc descriptor() const override { return {name(), version()}; }
unsigned messageCount() const override { return WarpSubprotocolPacketCount; }
char const* packetTypeToString(unsigned _packetType) const override
{
return warpPacketTypeToString(static_cast<WarpSubprotocolPacketType>(_packetType));
}
std::chrono::milliseconds backgroundWorkInterval() const override;
u256 networkId() const { return m_networkId; }
void onConnect(NodeID const& _peerID, u256 const& _peerCapabilityVersion) override;
bool interpretCapabilityPacket(NodeID const& _peerID, unsigned _id, RLP const&) override;
void onDisconnect(NodeID const& _peerID) override;
void doBackgroundWork() override;
p2p::CapabilityHostFace& capabilityHost() { return *m_host; }
void requestStatus(NodeID const& _peerID, unsigned _hostProtocolVersion,
u256 const& _hostNetworkId, u256 const& _chainTotalDifficulty,
h256 const& _chainCurrentHash, h256 const& _chainGenesisHash,
h256 const& _snapshotBlockHash, u256 const& _snapshotBlockNumber);
void requestBlockHeaders(NodeID const& _peerID, unsigned _startNumber, unsigned _count,
unsigned _skip, bool _reverse);
void requestManifest(NodeID const& _peerID);
bool requestData(NodeID const& _peerID, h256 const& _chunkHash);
/// Validates whether peer is able to communicate with the host, disables peer if not
bool validateStatus(NodeID const& _peerID, h256 const& _genesisHash,
std::vector<unsigned> const& _protocolVersions, u256 const& _networkId);
void disablePeer(NodeID const& _peerID, std::string const& _problem);
private:
static constexpr std::chrono::milliseconds c_backgroundWorkInterval{1000};
std::shared_ptr<WarpPeerObserverFace> createPeerObserver(
boost::filesystem::path const& _snapshotDownloadPath);
void setAsking(NodeID const& _peerID, Asking _a);
void setIdle(NodeID const& _peerID) { setAsking(_peerID, Asking::Nothing); }
std::shared_ptr<p2p::CapabilityHostFace> m_host;
BlockChain const& m_blockChain;
u256 const m_networkId;
std::shared_ptr<SnapshotStorageFace> m_snapshot;
std::shared_ptr<WarpPeerObserverFace> m_peerObserver;
std::unordered_map<NodeID, WarpPeerStatus> m_peers;
Logger m_logger{createLogger(VerbosityDebug, "warpcap")};
Logger m_loggerWarn{createLogger(VerbosityWarning, "warpcap")};
};
} // namespace eth
} // namespace dev
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7C776E80-2B19-43D3-9A0A-332CA2D8B2F9}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RP</RootNamespace>
<AssemblyName>RP</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RawPrint\RawPrint.csproj">
<Project>{54bf59a6-e98d-41ea-8020-a2f5bed4fed5}</Project>
<Name>RawPrint</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html lang="en">
<head>
<title>Check #4 - Negative</title>
<link rel="stylesheet" href="../../../libs/qunit/qunit.css" media="screen">
</head>
<body>
<p>We would like to adopt another pet and are looking for one that is similar to what's shown in the picture.</p>
<img src="rex.jpg" alt="large brown and black cat named Rex" width="150" height="105"/>
<script id="qunit-jquery" src="../../../libs/jquery/jquery.js"></script>
<script id="qunit-events" src="../../../libs/jquery.hasEventListener/jquery.hasEventListener-2.0.3.js"></script>
<script id="qunit-quail" src="../../../src/quail.js"></script>
<script id="qunit-composite" src="../../composite.js"></script>
<script id="qunit-qunit" src="../../../libs/qunit/qunit.js"></script>
<script id="qunit-script">
test('imgNonDecorativeHasAlt', function() {
quailTest.runTest( 'imgNonDecorativeHasAlt', '4-2.html');
equal(true, quailTest.confirmIsEmpty(), 'Item is empty');
});
</script>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
@import 'kouto-swiss'
div
triangle( up, 10px, red )
div
triangle( down, 20px, blue, red )
div
triangle( left, 5px, rgba( 12, 23, 45, .7 ) )
div
triangle( right, 1px, white )
div
triangle( up-left, 10px, red )
div
triangle( up-right, 10px, red )
div
triangle( down-left, 10px, red )
div
triangle( down-right, 10px, red, blue )
|
{
"pile_set_name": "Github"
}
|
using System;
namespace VVVV.Core.Viewer
{
public delegate void LabelEditEventHandler(object sender, LabelEditEventArgs args);
public class LabelEditEventArgs : EventArgs
{
public bool CancelEdit
{
get;
set;
}
public string Label
{
get;
private set;
}
public object Model
{
get;
private set;
}
public LabelEditEventArgs(object model, string label)
{
Model = model;
Label = label;
}
}
/// <summary>
/// Description of ILabelEditor.
/// </summary>
public interface ILabelEditor
{
event LabelEditEventHandler AfterLabelEdit;
event LabelEditEventHandler BeforeLabelEdit;
bool BeginEdit(object model);
}
}
|
{
"pile_set_name": "Github"
}
|
$:.push File.expand_path("../lib", __FILE__)
require File.expand_path("on_what", File.dirname(__FILE__))
require "docile/version"
Gem::Specification.new do |s|
s.name = "docile"
s.version = Docile::VERSION
s.author = "Marc Siegel"
s.email = "marc@usainnov.com"
s.homepage = "https://ms-ati.github.io/docile/"
s.summary = "Docile keeps your Ruby DSLs tame and well-behaved."
s.description = "Docile treats the methods of a given ruby object as a DSL " \
"(domain specific language) within a given block. \n\n" \
"Killer feature: you can also reference methods, instance " \
"variables, and local variables from the original (non-DSL) "\
"context within the block. \n\n" \
"Docile releases follow Semantic Versioning as defined at " \
"semver.org."
s.license = "MIT"
# Files included in the gem
s.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
s.require_paths = ["lib"]
# Specify oldest supported Ruby version
s.required_ruby_version = ">= 1.8.7"
# Run rspec tests from rake even on old Ruby versions
s.add_development_dependency "rake", "~> 10.5" if on_less_than_1_9_3? # Pin compatible rake on old rubies, see: https://github.com/travis-ci/travis.rb/issues/380
s.add_development_dependency "rake", "< 11.0" unless on_less_than_1_9_3? # See http://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11
s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "rspec-expectations", "!= 3.8.3" # Workaround for RSpec's issue, see: https://github.com/rspec/rspec-expectations/issues/1111
# Run code coverage where possible - not on Rubinius
unless on_rubinius?
# Pin versions for Travis builds on 1.9
s.add_development_dependency "json", "< 2.0" if on_less_than_2_0?
# Pin versions for Travis builds on 1.8
s.add_development_dependency "mime-types" , "~> 1.25.1" if on_1_8?
s.add_development_dependency "rest-client", "~> 1.6.8" if on_1_8?
end
# To limit needed compatibility with versions of dependencies, only configure
# yard doc generation when *not* on Travis, JRuby, Rubinius, or < 2.0
if !on_travis? && !on_jruby? && !on_rubinius? && !on_less_than_2_0?
# Github flavored markdown in YARD documentation
# http://blog.nikosd.com/2011/11/github-flavored-markdown-in-yard.html
s.add_development_dependency "yard"
s.add_development_dependency "redcarpet"
s.add_development_dependency "github-markup"
end
end
|
{
"pile_set_name": "Github"
}
|
var React = require("React");
function Child(props) {
var x = Object.assign({}, props, {
a: 1,
b: 2,
});
return (
<span>
{x.a}
{x.b}
{x.c}
</span>
);
}
function App(props) {
return (
<div>
{props.x || <Child {...props} />}
{props.y && <Child {...props} />}
</div>
);
}
App.getTrials = function(renderer, Root) {
let results = [];
renderer.update(<Root x={<span />} y={true} c={3} />);
results.push(["deals with logical expression 1", renderer.toJSON()]);
renderer.update(<Root x={false} y={true} c={4} />);
results.push(["deals with logical expression 2", renderer.toJSON()]);
renderer.update(<Root x={false} y={<div />} c={5} />);
results.push(["deals with logical expression 3", renderer.toJSON()]);
return results;
};
if (this.__optimizeReactComponentTree) {
__optimizeReactComponentTree(App);
}
module.exports = App;
|
{
"pile_set_name": "Github"
}
|
<component name="libraryTable">
<library name="Maven: org.apache.hbase:hbase-prefix-tree:1.1.5">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/hbase/hbase-prefix-tree/1.1.5/hbase-prefix-tree-1.1.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/hbase/hbase-prefix-tree/1.1.5/hbase-prefix-tree-1.1.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/hbase/hbase-prefix-tree/1.1.5/hbase-prefix-tree-1.1.5-sources.jar!/" />
</SOURCES>
</library>
</component>
|
{
"pile_set_name": "Github"
}
|
GL_REGAL_ES1_0_compatibility
https://github.com/p3/regal/tree/master/doc/extensions
GL_REGAL_ES1_0_compatibility
void glAlphaFuncx (GLenum func, GLclampx ref)
void glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
void glClearDepthx (GLclampx depth)
void glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
void glDepthRangex (GLclampx zNear, GLclampx zFar)
void glFogx (GLenum pname, GLfixed param)
void glFogxv (GLenum pname, const GLfixed* params)
void glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
void glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
void glLightModelx (GLenum pname, GLfixed param)
void glLightModelxv (GLenum pname, const GLfixed* params)
void glLightx (GLenum light, GLenum pname, GLfixed param)
void glLightxv (GLenum light, GLenum pname, const GLfixed* params)
void glLineWidthx (GLfixed width)
void glLoadMatrixx (const GLfixed* m)
void glMaterialx (GLenum face, GLenum pname, GLfixed param)
void glMaterialxv (GLenum face, GLenum pname, const GLfixed* params)
void glMultMatrixx (const GLfixed* m)
void glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
void glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz)
void glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
void glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
void glPointSizex (GLfixed size)
void glPolygonOffsetx (GLfixed factor, GLfixed units)
void glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
void glSampleCoveragex (GLclampx value, GLboolean invert)
void glScalex (GLfixed x, GLfixed y, GLfixed z)
void glTexEnvx (GLenum target, GLenum pname, GLfixed param)
void glTexEnvxv (GLenum target, GLenum pname, const GLfixed* params)
void glTexParameterx (GLenum target, GLenum pname, GLfixed param)
void glTranslatex (GLfixed x, GLfixed y, GLfixed z)
typedef int GLclampx
|
{
"pile_set_name": "Github"
}
|
# bug #2039
type
RegionTy = object
ThingyPtr = RegionTy ptr Thingy
Thingy = object
next: ThingyPtr
name: string
proc iname(t: ThingyPtr) =
var x = t
while not x.isNil:
echo x.name
x = x.next
proc go() =
var athing : ThingyPtr
iname(athing)
go()
|
{
"pile_set_name": "Github"
}
|
<?php
use Gaufrette\Adapter\Local as OriginalLocalAdapter;
class Brizy_Admin_Guafrette_LocalAdapter extends OriginalLocalAdapter{
private $create;
private $mode;
/**
* @param string $directory Directory where the filesystem is located
* @param bool $create Whether to create the directory if it does not
* exist (default FALSE)
* @param int $mode Mode for mkdir
*
* @throws RuntimeException if the specified directory does not exist and
* could not be created
*/
public function __construct($directory, $create = false, $mode = 0777)
{
$this->directory = Brizy_Admin_Guafrette_Path::normalize($directory);
if (is_link($this->directory)) {
$this->directory = realpath($this->directory);
}
$this->create = $create;
$this->mode = $mode;
}
protected function normalizePath($path)
{
$path = Brizy_Admin_Guafrette_Path::normalize($path);
if (0 !== strpos($path, $this->directory)) {
throw new \OutOfBoundsException(sprintf('The path "%s" is out of the filesystem.', $path));
}
return $path;
}
}
|
{
"pile_set_name": "Github"
}
|
// OutMemStream.cpp
#include "OutMemStream.h"
void COutMemStream::Free()
{
Blocks.Free(_memManager);
Blocks.LockMode = true;
}
void COutMemStream::Init()
{
WriteToRealStreamEvent.Reset();
_unlockEventWasSent = false;
_realStreamMode = false;
Free();
_curBlockPos = 0;
_curBlockIndex = 0;
}
void COutMemStream::DetachData(CMemLockBlocks &blocks)
{
Blocks.Detach(blocks, _memManager);
Free();
}
HRESULT COutMemStream::WriteToRealStream()
{
RINOK(Blocks.WriteToStream(_memManager->GetBlockSize(), OutSeqStream));
Blocks.Free(_memManager);
return S_OK;
}
STDMETHODIMP COutMemStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
{
if (_realStreamMode)
return OutSeqStream->Write(data, size, processedSize);
if (processedSize != 0)
*processedSize = 0;
while (size != 0)
{
if (_curBlockIndex < Blocks.Blocks.Size())
{
Byte *p = (Byte *)Blocks.Blocks[_curBlockIndex] + _curBlockPos;
size_t curSize = _memManager->GetBlockSize() - _curBlockPos;
if (size < curSize)
curSize = size;
memcpy(p, data, curSize);
if (processedSize != 0)
*processedSize += (UInt32)curSize;
data = (const void *)((const Byte *)data + curSize);
size -= (UInt32)curSize;
_curBlockPos += curSize;
UInt64 pos64 = GetPos();
if (pos64 > Blocks.TotalSize)
Blocks.TotalSize = pos64;
if (_curBlockPos == _memManager->GetBlockSize())
{
_curBlockIndex++;
_curBlockPos = 0;
}
continue;
}
HANDLE events[3] = { StopWritingEvent, WriteToRealStreamEvent, /* NoLockEvent, */ _memManager->Semaphore };
DWORD waitResult = ::WaitForMultipleObjects((Blocks.LockMode ? 3 : 2), events, FALSE, INFINITE);
switch (waitResult)
{
case (WAIT_OBJECT_0 + 0):
return StopWriteResult;
case (WAIT_OBJECT_0 + 1):
{
_realStreamMode = true;
RINOK(WriteToRealStream());
UInt32 processedSize2;
HRESULT res = OutSeqStream->Write(data, size, &processedSize2);
if (processedSize != 0)
*processedSize += processedSize2;
return res;
}
/*
case (WAIT_OBJECT_0 + 2):
{
// it has bug: no write.
if (!Blocks.SwitchToNoLockMode(_memManager))
return E_FAIL;
break;
}
*/
case (WAIT_OBJECT_0 + 2):
break;
default:
return E_FAIL;
}
Blocks.Blocks.Add(_memManager->AllocateBlock());
if (Blocks.Blocks.Back() == 0)
return E_FAIL;
}
return S_OK;
}
STDMETHODIMP COutMemStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
{
if (_realStreamMode)
{
if (!OutStream)
return E_FAIL;
return OutStream->Seek(offset, seekOrigin, newPosition);
}
if (seekOrigin == STREAM_SEEK_CUR)
{
if (offset != 0)
return E_NOTIMPL;
}
else if (seekOrigin == STREAM_SEEK_SET)
{
if (offset != 0)
return E_NOTIMPL;
_curBlockIndex = 0;
_curBlockPos = 0;
}
else
return E_NOTIMPL;
if (newPosition)
*newPosition = GetPos();
return S_OK;
}
STDMETHODIMP COutMemStream::SetSize(UInt64 newSize)
{
if (_realStreamMode)
{
if (!OutStream)
return E_FAIL;
return OutStream->SetSize(newSize);
}
Blocks.TotalSize = newSize;
return S_OK;
}
|
{
"pile_set_name": "Github"
}
|
/**
* A React component to view a PDF document
*
* @see https://react-pdf-viewer.dev
* @license https://react-pdf-viewer.dev/license
* @copyright 2019-2020 Nguyen Huu Phuoc <me@phuoc.ng>
*/
import React from 'react';
import { Icon } from '@react-pdf-viewer/core';
const RotateBackwardIcon: React.FC = () => {
return (
<Icon size={16}>
<path
d={`M3.434,10.537c0.141-0.438,0.316-0.864,0.523-1.274
M3.069,14.425C3.023,14.053,3,13.679,3,13.305 c0-0.291,0.014-0.579,0.041-0.863
M4.389,18.111c-0.341-0.539-0.623-1.112-0.843-1.711
M7.163,20.9 c-0.543-0.345-1.048-0.747-1.506-1.2
M10.98,22.248c-0.65-0.074-1.29-0.218-1.909-0.431
M10,4.25h2 c4.987,0.015,9.017,4.069,9.003,9.055c-0.013,4.581-3.456,8.426-8.008,8.945
M13.5,1.75L10,4.25l3.5,2.5`}
/>
</Icon>
);
};
export default RotateBackwardIcon;
|
{
"pile_set_name": "Github"
}
|
{
"initiator": {
"role": "guest",
"party_id": 10000
},
"job_parameters": {
"work_mode": 0
},
"role": {
"guest": [
10000
],
"host": [
10000
]
},
"role_parameters": {
"guest": {
"args": {
"data": {
"train_data": [
{
"name": "vehicle_scale_hetero_guest",
"namespace": "experiment"
}
],
"eval_data": [
{
"name": "vehicle_scale_hetero_guest",
"namespace": "experiment"
}
]
}
},
"dataio_0": {
"with_label": [
true
],
"label_name": [
"y"
],
"label_type": [
"int"
],
"output_format": [
"dense"
]
}
},
"host": {
"args": {
"data": {
"train_data": [
{
"name": "vehicle_scale_hetero_host",
"namespace": "experiment"
}
],
"eval_data": [
{
"name": "vehicle_scale_hetero_host",
"namespace": "experiment"
}
]
}
},
"dataio_0": {
"with_label": [
false
],
"output_format": [
"dense"
]
}
}
},
"algorithm_parameters": {
"secureboost_0": {
"task_type": "classification",
"learning_rate": 0.1,
"num_trees": 5,
"subsample_feature_rate": 1,
"n_iter_no_change": false,
"tol": 0.0001,
"bin_num": 50,
"objective_param": {
"objective": "cross_entropy"
},
"encrypt_param": {
"method": "paillier"
},
"predict_param": {
"with_proba": true,
"threshold": 0.5
}
},
"evaluation_0": {
"eval_type": "multi"
}
}
}
|
{
"pile_set_name": "Github"
}
|
# Fix the endian-specific bit-counting code so that it works.
# SF:1068324 "netcat_flag_count() fix"
# http://sourceforge.net/tracker/?func=detail&aid=1205729&group_id=52204&atid=466046
# SF:1205729 "doen't work on arm linux platform":
# http://sourceforge.net/tracker/?func=detail&aid=1068324&group_id=52204&atid=466046
Index: netcat-0.7.1/src/flagset.c
===================================================================
--- netcat-0.7.1.orig/src/flagset.c 2010-07-19 13:51:46.000000000 +0100
+++ netcat-0.7.1/src/flagset.c 2010-07-19 13:52:27.000000000 +0100
@@ -134,7 +134,7 @@
int netcat_flag_count(void)
{
- register char c;
+ register unsigned char c;
register int i;
int ret = 0;
@@ -154,8 +154,8 @@
Assumed that the bit number 1 is the sign, and that we will shift the
bit 1 (or the bit that takes its place later) until the the most right,
WHY it has to keep the wrong sign? */
- ret -= (c >> 7);
- c <<= 1;
+ ret += c&1;
+ c>>=1;
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<tei xmlns="http://www.tei-c.org/ns/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML">
<listBibl>
<bibl><date>January 1997</date>/Vol. <biblScope type="vol">40</biblScope>, No. <biblScope type="issue">1</biblScope> <title level="j">COMMUNICATIONS OF THE ACM</title></bibl>
</listBibl>
</tei>
|
{
"pile_set_name": "Github"
}
|
// untested sections: 1
package gexec
import (
"io"
"sync"
)
/*
PrefixedWriter wraps an io.Writer, emitting the passed in prefix at the beginning of each new line.
This can be useful when running multiple gexec.Sessions concurrently - you can prefix the log output of each
session by passing in a PrefixedWriter:
gexec.Start(cmd, NewPrefixedWriter("[my-cmd] ", GinkgoWriter), NewPrefixedWriter("[my-cmd] ", GinkgoWriter))
*/
type PrefixedWriter struct {
prefix []byte
writer io.Writer
lock *sync.Mutex
atStartOfLine bool
}
func NewPrefixedWriter(prefix string, writer io.Writer) *PrefixedWriter {
return &PrefixedWriter{
prefix: []byte(prefix),
writer: writer,
lock: &sync.Mutex{},
atStartOfLine: true,
}
}
func (w *PrefixedWriter) Write(b []byte) (int, error) {
w.lock.Lock()
defer w.lock.Unlock()
toWrite := []byte{}
for _, c := range b {
if w.atStartOfLine {
toWrite = append(toWrite, w.prefix...)
}
toWrite = append(toWrite, c)
w.atStartOfLine = c == '\n'
}
_, err := w.writer.Write(toWrite)
if err != nil {
return 0, err
}
return len(b), nil
}
|
{
"pile_set_name": "Github"
}
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __gnu_java_awt_peer_gtk_GtkCursor__
#define __gnu_java_awt_peer_gtk_GtkCursor__
#pragma interface
#include <java/awt/Cursor.h>
extern "Java"
{
namespace gnu
{
namespace java
{
namespace awt
{
namespace peer
{
namespace gtk
{
class GtkCursor;
class GtkImage;
}
}
}
}
}
namespace java
{
namespace awt
{
class Image;
class Point;
}
}
}
class gnu::java::awt::peer::gtk::GtkCursor : public ::java::awt::Cursor
{
public: // actually package-private
GtkCursor(::java::awt::Image *, ::java::awt::Point *, ::java::lang::String *);
virtual ::gnu::java::awt::peer::gtk::GtkImage * getGtkImage();
virtual ::java::awt::Point * getHotspot();
private:
::gnu::java::awt::peer::gtk::GtkImage * __attribute__((aligned(__alignof__( ::java::awt::Cursor)))) image;
::java::awt::Point * hotspot;
public:
static ::java::lang::Class class$;
};
#endif // __gnu_java_awt_peer_gtk_GtkCursor__
|
{
"pile_set_name": "Github"
}
|
<!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">
<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.10"/>
<title>Max API</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</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>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</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">
<div id="c74header">
<img src="header.png" height="100" />
</div>
</div>
<!-- end header part -->
|
{
"pile_set_name": "Github"
}
|
{
"name": "App",
"icons": [
{
"src": "/inc/images/favicon/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/inc\/images\/favicon\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/inc\/images\/favicon\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/inc\/images\/favicon\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/inc\/images\/favicon\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/inc\/images\/favicon\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
|
{
"pile_set_name": "Github"
}
|
14891d169 Merge pull request #4327 from nextcloud/phoneInfo
edc25788c Merge pull request #4334 from nextcloud/release372
d3990fa6e Release 3.7.2
56a4ac290 phone info on sent mail disable creation of old log file
de9475ed2 Show groupFolder correctly (#4300)
03dbd4922 Show groupFolder correctly
007adfae8 [tx-robot] updated from transifex
d647ccfdb daily dev 20190816
|
{
"pile_set_name": "Github"
}
|
<?php namespace pineapple;
class urlsnarf extends Module
{
public function route()
{
switch ($this->request->action) {
case 'refreshInfo':
$this->refreshInfo();
break;
case 'refreshOutput':
$this->refreshOutput();
break;
case 'refreshStatus':
$this->refreshStatus();
break;
case 'toggleurlsnarf':
$this->toggleurlsnarf();
break;
case 'handleDependencies':
$this->handleDependencies();
break;
case 'handleDependenciesStatus':
$this->handleDependenciesStatus();
break;
case 'refreshHistory':
$this->refreshHistory();
break;
case 'viewHistory':
$this->viewHistory();
break;
case 'deleteHistory':
$this->deleteHistory();
break;
case 'downloadHistory':
$this->downloadHistory();
break;
case 'toggleurlsnarfOnBoot':
$this->toggleurlsnarfOnBoot();
break;
case 'getInterfaces':
$this->getInterfaces();
break;
case 'saveAutostartSettings':
$this->saveAutostartSettings();
break;
}
}
protected function checkDep($dependencyName)
{
return ($this->checkDependency($dependencyName) && ($this->uciGet("urlsnarf.module.installed")));
}
protected function getDevice()
{
return trim(exec("cat /proc/cpuinfo | grep machine | awk -F: '{print $2}'"));
}
protected function refreshInfo()
{
$moduleInfo = @json_decode(file_get_contents("/pineapple/modules/urlsnarf/module.info"));
$this->response = array('title' => $moduleInfo->title, 'version' => $moduleInfo->version);
}
private function handleDependencies()
{
if (!$this->checkDep("urlsnarf")) {
$this->execBackground("/pineapple/modules/urlsnarf/scripts/dependencies.sh install ".$this->request->destination);
$this->response = array('success' => true);
} else {
$this->execBackground("/pineapple/modules/urlsnarf/scripts/dependencies.sh remove");
$this->response = array('success' => true);
}
}
private function handleDependenciesStatus()
{
if (!file_exists('/tmp/urlsnarf.progress')) {
$this->response = array('success' => true);
} else {
$this->response = array('success' => false);
}
}
private function toggleurlsnarfOnBoot()
{
if (exec("cat /etc/rc.local | grep urlsnarf/scripts/autostart_urlsnarf.sh") == "") {
exec("sed -i '/exit 0/d' /etc/rc.local");
exec("echo /pineapple/modules/urlsnarf/scripts/autostart_urlsnarf.sh >> /etc/rc.local");
exec("echo exit 0 >> /etc/rc.local");
} else {
exec("sed -i '/urlsnarf\/scripts\/autostart_urlsnarf.sh/d' /etc/rc.local");
}
}
private function toggleurlsnarf()
{
if (!$this->checkRunning("urlsnarf")) {
$this->uciSet("urlsnarf.run.interface", $this->request->interface);
$this->execBackground("/pineapple/modules/urlsnarf/scripts/urlsnarf.sh start");
} else {
$this->uciSet("urlsnarf.run.interface", '');
$this->execBackground("/pineapple/modules/urlsnarf/scripts/urlsnarf.sh stop");
}
}
private function getInterfaces()
{
exec("cat /proc/net/dev | tail -n +3 | cut -f1 -d: | sed 's/ //g'", $interfaceArray);
$this->response = array("interfaces" => $interfaceArray, "selected" => $this->uciGet("urlsnarf.run.interface"));
}
private function refreshStatus()
{
if (!file_exists('/tmp/urlsnarf.progress')) {
if (!$this->checkDep("urlsnarf")) {
$installed = false;
$install = "Not installed";
$installLabel = "danger";
$processing = false;
$status = "Start";
$statusLabel = "success";
$bootLabelON = "default";
$bootLabelOFF = "danger";
} else {
$installed = true;
$install = "Installed";
$installLabel = "success";
$processing = false;
if ($this->checkRunning("urlsnarf")) {
$status = "Stop";
$statusLabel = "danger";
} else {
$status = "Start";
$statusLabel = "success";
}
if (exec("cat /etc/rc.local | grep urlsnarf/scripts/autostart_urlsnarf.sh") == "") {
$bootLabelON = "default";
$bootLabelOFF = "danger";
} else {
$bootLabelON = "success";
$bootLabelOFF = "default";
}
}
} else {
$installed = false;
$install = "Installing...";
$installLabel = "warning";
$processing = true;
$status = "Not running";
$statusLabel = "danger";
$bootLabelON = "default";
$bootLabelOFF = "danger";
}
$device = $this->getDevice();
$sdAvailable = $this->isSDAvailable();
$this->response = array("device" => $device, "sdAvailable" => $sdAvailable, "status" => $status, "statusLabel" => $statusLabel, "installed" => $installed, "install" => $install, "installLabel" => $installLabel, "bootLabelON" => $bootLabelON, "bootLabelOFF" => $bootLabelOFF, "processing" => $processing);
}
private function refreshOutput()
{
if ($this->checkDep("urlsnarf")) {
if ($this->checkRunning("urlsnarf")) {
$path = "/pineapple/modules/urlsnarf/log";
$latest_ctime = 0;
$latest_filename = '';
$d = dir($path);
while (false !== ($entry = $d->read())) {
$filepath = "{$path}/{$entry}";
if (is_file($filepath) && filectime($filepath) > $latest_ctime) {
$latest_ctime = filectime($filepath);
$latest_filename = $entry;
}
}
if ($latest_filename != "") {
$log_date = gmdate("F d Y H:i:s", filemtime("/pineapple/modules/urlsnarf/log/".$latest_filename));
if ($this->request->filter != "") {
$filter = $this->request->filter;
$cmd = "cat /pineapple/modules/urlsnarf/log/".$latest_filename." | ".$filter;
} else {
$cmd = "cat /pineapple/modules/urlsnarf/log/".$latest_filename;
}
exec($cmd, $output);
if (!empty($output)) {
$this->response = implode("\n", array_reverse($output));
} else {
$this->response = "Empty log...";
}
}
} else {
$this->response = "urlsnarf is not running...";
}
} else {
$this->response = "urlsnarf is not installed...";
}
}
private function refreshHistory()
{
$this->streamFunction = function () {
$log_list = array_reverse(glob("/pineapple/modules/urlsnarf/log/*"));
echo '[';
for ($i=0;$i<count($log_list);$i++) {
$info = explode("_", basename($log_list[$i]));
$entryDate = gmdate('Y-m-d H-i-s', $info[1]);
$entryName = basename($log_list[$i]);
echo json_encode(array($entryDate, $entryName));
if ($i!=count($log_list)-1) {
echo ',';
}
}
echo ']';
};
}
private function viewHistory()
{
$log_date = gmdate("F d Y H:i:s", filemtime("/pineapple/modules/urlsnarf/log/".$this->request->file));
exec("cat /pineapple/modules/urlsnarf/log/".$this->request->file, $output);
if (!empty($output)) {
$this->response = array("output" => implode("\n", $output), "date" => $log_date);
} else {
$this->response = array("output" => "Empty log...", "date" => $log_date);
}
}
private function deleteHistory()
{
exec("rm -rf /pineapple/modules/urlsnarf/log/".$this->request->file);
}
private function downloadHistory()
{
$this->response = array("download" => $this->downloadFile("/pineapple/modules/urlsnarf/log/".$this->request->file));
}
private function saveAutostartSettings()
{
$settings = $this->request->settings;
$this->uciSet("urlsnarf.autostart.interface", $settings->interface);
}
}
|
{
"pile_set_name": "Github"
}
|
# run_args: -n
# statcheck: noninit_count('slowpath_classmethod_get') <= 10
# statcheck: noninit_count('slowpath_staticmethod_get') <= 10
# statcheck: noninit_count('slowpath_instancemethod_get') <= 10
def _f_plain(self, a, b, c, d):
print 'in f', type(self), a, b, c, d
@staticmethod
def _g(a, b, c, d):
print 'in g', a, b, c, d
@classmethod
def _h(cls, a, b, c, d):
print 'in h', cls, a, b, c, d
class C(object):
f_plain = _f_plain
g = _g
h = _h
_f = C.f_plain
C.f = _f
def run():
c = C()
c.f(1, 2, 3, 4)
c.g(1, 2, 3, 4)
c.h(1, 2, 3, 4)
f1 = c.f
f1(1,2,3,4)
g1 = c.g
g1(1,2,3,4)
h1 = c.h
h1(1,2,3,4)
_f.__get__(c, C)(1,2,3,4)
_g.__get__(c, C)(1,2,3,4)
_h.__get__(c, C)(1,2,3,4)
for i in xrange(1000):
run()
|
{
"pile_set_name": "Github"
}
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "javascript");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
MT("locals",
"[keyword function] [def foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");
MT("comma-and-binop",
"[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }");
MT("destructuring",
"([keyword function]([def a], [[[def b], [def c] ]]) {",
" [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);",
" [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];",
"})();");
MT("destructure_trailing_comma",
"[keyword let] {[def a], [def b],} [operator =] [variable foo];",
"[keyword let] [def c];"); // Parser still in good state?
MT("class_body",
"[keyword class] [def Foo] {",
" [property constructor]() {}",
" [property sayName]() {",
" [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];",
" }",
"}");
MT("class",
"[keyword class] [def Point] [keyword extends] [variable SuperThing] {",
" [property get] [property prop]() { [keyword return] [number 24]; }",
" [property constructor]([def x], [def y]) {",
" [keyword super]([string 'something']);",
" [keyword this].[property x] [operator =] [variable-2 x];",
" }",
"}");
MT("import",
"[keyword function] [def foo]() {",
" [keyword import] [def $] [keyword from] [string 'jquery'];",
" [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];",
"}");
MT("const",
"[keyword function] [def f]() {",
" [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];",
"}");
MT("for/of",
"[keyword for]([keyword let] [def of] [keyword of] [variable something]) {}");
MT("generator",
"[keyword function*] [def repeat]([def n]) {",
" [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])",
" [keyword yield] [variable-2 i];",
"}");
MT("quotedStringAddition",
"[keyword let] [def f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];");
MT("quotedFatArrow",
"[keyword let] [def f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];");
MT("fatArrow",
"[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);",
"[variable a];", // No longer in scope
"[keyword let] [def f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",
"[variable c];");
MT("spread",
"[keyword function] [def f]([def a], [meta ...][def b]) {",
" [variable something]([variable-2 a], [meta ...][variable-2 b]);",
"}");
MT("comprehension",
"[keyword function] [def f]() {",
" [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];",
" ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));",
"}");
MT("quasi",
"[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
MT("quasi_no_function",
"[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
MT("indent_statement",
"[keyword var] [def x] [operator =] [number 10]",
"[variable x] [operator +=] [variable y] [operator +]",
" [atom Infinity]",
"[keyword debugger];");
MT("indent_if",
"[keyword if] ([number 1])",
" [keyword break];",
"[keyword else] [keyword if] ([number 2])",
" [keyword continue];",
"[keyword else]",
" [number 10];",
"[keyword if] ([number 1]) {",
" [keyword break];",
"} [keyword else] [keyword if] ([number 2]) {",
" [keyword continue];",
"} [keyword else] {",
" [number 10];",
"}");
MT("indent_for",
"[keyword for] ([keyword var] [def i] [operator =] [number 0];",
" [variable i] [operator <] [number 100];",
" [variable i][operator ++])",
" [variable doSomething]([variable i]);",
"[keyword debugger];");
MT("indent_c_style",
"[keyword function] [def foo]()",
"{",
" [keyword debugger];",
"}");
MT("indent_else",
"[keyword for] (;;)",
" [keyword if] ([variable foo])",
" [keyword if] ([variable bar])",
" [number 1];",
" [keyword else]",
" [number 2];",
" [keyword else]",
" [number 3];");
MT("indent_funarg",
"[variable foo]([number 10000],",
" [keyword function]([def a]) {",
" [keyword debugger];",
"};");
MT("indent_below_if",
"[keyword for] (;;)",
" [keyword if] ([variable foo])",
" [number 1];",
"[number 2];");
MT("multilinestring",
"[keyword var] [def x] [operator =] [string 'foo\\]",
"[string bar'];");
MT("scary_regexp",
"[string-2 /foo[[/]]bar/];");
MT("indent_strange_array",
"[keyword var] [def x] [operator =] [[",
" [number 1],,",
" [number 2],",
"]];",
"[number 10];");
MT("param_default",
"[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
" [keyword return] [variable-2 x];",
"}");
MT("new_target",
"[keyword function] [def F]([def target]) {",
" [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {",
" [keyword return] [keyword new]",
" .[keyword target];",
" }",
"}");
var jsonld_mode = CodeMirror.getMode(
{indentUnit: 2},
{name: "javascript", jsonld: true}
);
function LD(name) {
test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1));
}
LD("json_ld_keywords",
'{',
' [meta "@context"]: {',
' [meta "@base"]: [string "http://example.com"],',
' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],',
' [property "likesFlavor"]: {',
' [meta "@container"]: [meta "@list"]',
' [meta "@reverse"]: [string "@beFavoriteOf"]',
' },',
' [property "nick"]: { [meta "@container"]: [meta "@set"] },',
' [property "nick"]: { [meta "@container"]: [meta "@index"] }',
' },',
' [meta "@graph"]: [[ {',
' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],',
' [property "name"]: [string "John Lennon"],',
' [property "modified"]: {',
' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],',
' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]',
' }',
' } ]]',
'}');
LD("json_ld_fake",
'{',
' [property "@fake"]: [string "@fake"],',
' [property "@contextual"]: [string "@identifier"],',
' [property "user@domain.com"]: [string "@graphical"],',
' [property "@ID"]: [string "@@ID"]',
'}');
})();
|
{
"pile_set_name": "Github"
}
|
#include <sys/cdefs.h>
#if __LP64__
# define PTR " .quad "
# define PTRSIZE "8"
# define LOGPTRSIZE "3"
#else
# define PTR " .long "
# define PTRSIZE "4"
# define LOGPTRSIZE "2"
#endif
#if __has_feature(ptrauth_calls)
# define SIGNED_METHOD_LIST_IMP "@AUTH(ia,0,addr) "
#else
# define SIGNED_METHOD_LIST_IMP
#endif
#define str(x) #x
#define str2(x) str(x)
// Swift metadata initializers. Define these in the test.
EXTERN_C Class initSuper(Class cls, void *arg);
EXTERN_C Class initSub(Class cls, void *arg);
@interface SwiftSuper : NSObject @end
@interface SwiftSub : SwiftSuper @end
__BEGIN_DECLS
// not id to avoid ARC operations because the class doesn't implement RR methods
void* nop(void* self) { return self; }
__END_DECLS
asm(
".globl _OBJC_CLASS_$_SwiftSuper \n"
".section __DATA,__objc_data \n"
".align 3 \n"
"_OBJC_CLASS_$_SwiftSuper: \n"
PTR "_OBJC_METACLASS_$_SwiftSuper \n"
PTR "_OBJC_CLASS_$_NSObject \n"
PTR "__objc_empty_cache \n"
PTR "0 \n"
PTR "L_ro + 2 \n"
// pad to OBJC_MAX_CLASS_SIZE
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
""
"_OBJC_METACLASS_$_SwiftSuper: \n"
PTR "_OBJC_METACLASS_$_NSObject \n"
PTR "_OBJC_METACLASS_$_NSObject \n"
PTR "__objc_empty_cache \n"
PTR "0 \n"
PTR "L_meta_ro \n"
// pad to OBJC_MAX_CLASS_SIZE
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
""
"L_ro: \n"
".long (1<<6)\n"
".long 0 \n"
".long "PTRSIZE" \n"
#if __LP64__
".long 0 \n"
#endif
PTR "0 \n"
PTR "L_super_name \n"
PTR "L_good_methods \n"
PTR "0 \n"
PTR "L_super_ivars \n"
PTR "0 \n"
PTR "0 \n"
PTR "_initSuper" SIGNED_METHOD_LIST_IMP "\n"
""
"L_meta_ro: \n"
".long 1 \n"
".long 40 \n"
".long 40 \n"
#if __LP64__
".long 0 \n"
#endif
PTR "0 \n"
PTR "L_super_name \n"
PTR "L_good_methods \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
".globl _OBJC_CLASS_$_SwiftSub \n"
".section __DATA,__objc_data \n"
".align 3 \n"
"_OBJC_CLASS_$_SwiftSub: \n"
PTR "_OBJC_METACLASS_$_SwiftSub \n"
PTR "_OBJC_CLASS_$_SwiftSuper \n"
PTR "__objc_empty_cache \n"
PTR "0 \n"
PTR "L_sub_ro + 2 \n"
// pad to OBJC_MAX_CLASS_SIZE
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
""
"_OBJC_METACLASS_$_SwiftSub: \n"
PTR "_OBJC_METACLASS_$_NSObject \n"
PTR "_OBJC_METACLASS_$_SwiftSuper \n"
PTR "__objc_empty_cache \n"
PTR "0 \n"
PTR "L_sub_meta_ro \n"
// pad to OBJC_MAX_CLASS_SIZE
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
""
"L_sub_ro: \n"
".long (1<<6)\n"
".long 0 \n"
".long "PTRSIZE" \n"
#if __LP64__
".long 0 \n"
#endif
PTR "0 \n"
PTR "L_sub_name \n"
PTR "L_good_methods \n"
PTR "0 \n"
PTR "L_sub_ivars \n"
PTR "0 \n"
PTR "0 \n"
PTR "_initSub" SIGNED_METHOD_LIST_IMP "\n"
""
"L_sub_meta_ro: \n"
".long 1 \n"
".long 40 \n"
".long 40 \n"
#if __LP64__
".long 0 \n"
#endif
PTR "0 \n"
PTR "L_sub_name \n"
PTR "L_good_methods \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
PTR "0 \n"
"L_good_methods: \n"
".long 3*"PTRSIZE" \n"
".long 1 \n"
PTR "L_self \n"
PTR "L_self \n"
PTR "_nop" SIGNED_METHOD_LIST_IMP "\n"
"L_super_ivars: \n"
".long 4*"PTRSIZE" \n"
".long 1 \n"
PTR "L_super_ivar_offset \n"
PTR "L_super_ivar_name \n"
PTR "L_super_ivar_type \n"
".long "LOGPTRSIZE" \n"
".long "PTRSIZE" \n"
"L_sub_ivars: \n"
".long 4*"PTRSIZE" \n"
".long 1 \n"
PTR "L_sub_ivar_offset \n"
PTR "L_sub_ivar_name \n"
PTR "L_sub_ivar_type \n"
".long "LOGPTRSIZE" \n"
".long "PTRSIZE" \n"
"L_super_ivar_offset: \n"
".long 0 \n"
"L_sub_ivar_offset: \n"
".long "PTRSIZE" \n"
".cstring \n"
"L_super_name: .ascii \"SwiftSuper\\0\" \n"
"L_sub_name: .ascii \"SwiftSub\\0\" \n"
"L_load: .ascii \"load\\0\" \n"
"L_self: .ascii \"self\\0\" \n"
"L_super_ivar_name: .ascii \"super_ivar\\0\" \n"
"L_super_ivar_type: .ascii \"c\\0\" \n"
"L_sub_ivar_name: .ascii \"sub_ivar\\0\" \n"
"L_sub_ivar_type: .ascii \"@\\0\" \n"
".section __DATA,__objc_classlist \n"
PTR "_OBJC_CLASS_$_SwiftSuper \n"
PTR "_OBJC_CLASS_$_SwiftSub \n"
".text \n"
);
void fn(void) { }
|
{
"pile_set_name": "Github"
}
|
/*!
* Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
* Dual-licensed under the BSD or MIT licenses
*/
;(function($, window, document, undefined)
{
var hasTouch = 'ontouchstart' in window;
/**
* Detect CSS pointer-events property
* events are normally disabled on the dragging element to avoid conflicts
* https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js
*/
var hasPointerEvents = (function()
{
var el = document.createElement('div'),
docEl = document.documentElement;
if (!('pointerEvents' in el.style)) {
return false;
}
el.style.pointerEvents = 'auto';
el.style.pointerEvents = 'x';
docEl.appendChild(el);
var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto';
docEl.removeChild(el);
return !!supports;
})();
var eStart = hasTouch ? 'touchstart' : 'mousedown',
eMove = hasTouch ? 'touchmove' : 'mousemove',
eEnd = hasTouch ? 'touchend' : 'mouseup';
eCancel = hasTouch ? 'touchcancel' : 'mouseup';
var defaults = {
listNodeName : 'ol',
itemNodeName : 'li',
rootClass : 'dd',
listClass : 'dd-list',
itemClass : 'dd-item',
dragClass : 'dd-dragel',
handleClass : 'dd-handle',
collapsedClass : 'dd-collapsed',
placeClass : 'dd-placeholder',
noDragClass : 'dd-nodrag',
emptyClass : 'dd-empty',
expandBtnHTML : '<button data-action="expand" type="button">Expand</button>',
collapseBtnHTML : '<button data-action="collapse" type="button">Collapse</button>',
group : 0,
maxDepth : 5,
threshold : 20
};
function Plugin(element, options)
{
this.w = $(window);
this.el = $(element);
this.options = $.extend({}, defaults, options);
this.init();
}
Plugin.prototype = {
init: function()
{
var list = this;
list.reset();
list.el.data('nestable-group', this.options.group);
list.placeEl = $('<div class="' + list.options.placeClass + '"/>');
$.each(this.el.find(list.options.itemNodeName), function(k, el) {
list.setParent($(el));
});
list.el.on('click', 'button', function(e) {
if (list.dragEl || (!hasTouch && e.button !== 0)) {
return;
}
var target = $(e.currentTarget),
action = target.data('action'),
item = target.parent(list.options.itemNodeName);
if (action === 'collapse') {
list.collapseItem(item);
}
if (action === 'expand') {
list.expandItem(item);
}
});
var onStartEvent = function(e)
{
var handle = $(e.target);
if (!handle.hasClass(list.options.handleClass)) {
if (handle.closest('.' + list.options.noDragClass).length) {
return;
}
handle = handle.closest('.' + list.options.handleClass);
}
if (!handle.length || list.dragEl || (!hasTouch && e.button !== 0) || (hasTouch && e.touches.length !== 1)) {
return;
}
e.preventDefault();
list.dragStart(hasTouch ? e.touches[0] : e);
};
var onMoveEvent = function(e)
{
if (list.dragEl) {
e.preventDefault();
list.dragMove(hasTouch ? e.touches[0] : e);
}
};
var onEndEvent = function(e)
{
if (list.dragEl) {
e.preventDefault();
list.dragStop(hasTouch ? e.touches[0] : e);
}
};
if (hasTouch) {
list.el[0].addEventListener(eStart, onStartEvent, false);
window.addEventListener(eMove, onMoveEvent, false);
window.addEventListener(eEnd, onEndEvent, false);
window.addEventListener(eCancel, onEndEvent, false);
} else {
list.el.on(eStart, onStartEvent);
list.w.on(eMove, onMoveEvent);
list.w.on(eEnd, onEndEvent);
}
},
serialize: function()
{
var data,
depth = 0,
list = this;
step = function(level, depth)
{
var array = [ ],
items = level.children(list.options.itemNodeName);
items.each(function()
{
var li = $(this),
item = $.extend({}, li.data()),
sub = li.children(list.options.listNodeName);
if (sub.length) {
item.children = step(sub, depth + 1);
}
array.push(item);
});
return array;
};
data = step(list.el.find(list.options.listNodeName).first(), depth);
return data;
},
serialise: function()
{
return this.serialize();
},
reset: function()
{
this.mouse = {
offsetX : 0,
offsetY : 0,
startX : 0,
startY : 0,
lastX : 0,
lastY : 0,
nowX : 0,
nowY : 0,
distX : 0,
distY : 0,
dirAx : 0,
dirX : 0,
dirY : 0,
lastDirX : 0,
lastDirY : 0,
distAxX : 0,
distAxY : 0
};
this.moving = false;
this.dragEl = null;
this.dragRootEl = null;
this.dragDepth = 0;
this.hasNewRoot = false;
this.pointEl = null;
},
expandItem: function(li)
{
li.removeClass(this.options.collapsedClass);
li.children('[data-action="expand"]').hide();
li.children('[data-action="collapse"]').show();
li.children(this.options.listNodeName).show();
},
collapseItem: function(li)
{
var lists = li.children(this.options.listNodeName);
if (lists.length) {
li.addClass(this.options.collapsedClass);
li.children('[data-action="collapse"]').hide();
li.children('[data-action="expand"]').show();
li.children(this.options.listNodeName).hide();
}
},
expandAll: function()
{
var list = this;
list.el.find(list.options.itemNodeName).each(function() {
list.expandItem($(this));
});
},
collapseAll: function()
{
var list = this;
list.el.find(list.options.itemNodeName).each(function() {
list.collapseItem($(this));
});
},
setParent: function(li)
{
if (li.children(this.options.listNodeName).length) {
li.prepend($(this.options.expandBtnHTML));
li.prepend($(this.options.collapseBtnHTML));
}
li.children('[data-action="expand"]').hide();
},
unsetParent: function(li)
{
li.removeClass(this.options.collapsedClass);
li.children('[data-action]').remove();
li.children(this.options.listNodeName).remove();
},
dragStart: function(e)
{
var mouse = this.mouse,
target = $(e.target),
dragItem = target.closest(this.options.itemNodeName);
this.placeEl.css('height', dragItem.height());
mouse.offsetX = e.offsetX !== undefined ? e.offsetX : e.pageX - target.offset().left;
mouse.offsetY = e.offsetY !== undefined ? e.offsetY : e.pageY - target.offset().top;
mouse.startX = mouse.lastX = e.pageX;
mouse.startY = mouse.lastY = e.pageY;
this.dragRootEl = this.el;
this.dragEl = $(document.createElement(this.options.listNodeName)).addClass(this.options.listClass + ' ' + this.options.dragClass);
this.dragEl.css('width', dragItem.width());
// fix for zepto.js
//dragItem.after(this.placeEl).detach().appendTo(this.dragEl);
dragItem.after(this.placeEl);
dragItem[0].parentNode.removeChild(dragItem[0]);
dragItem.appendTo(this.dragEl);
$(document.body).append(this.dragEl);
this.dragEl.css({
'left' : e.pageX - mouse.offsetX,
'top' : e.pageY - mouse.offsetY
});
// total depth of dragging item
var i, depth,
items = this.dragEl.find(this.options.itemNodeName);
for (i = 0; i < items.length; i++) {
depth = $(items[i]).parents(this.options.listNodeName).length;
if (depth > this.dragDepth) {
this.dragDepth = depth;
}
}
},
dragStop: function(e)
{
// fix for zepto.js
//this.placeEl.replaceWith(this.dragEl.children(this.options.itemNodeName + ':first').detach());
var el = this.dragEl.children(this.options.itemNodeName).first();
el[0].parentNode.removeChild(el[0]);
this.placeEl.replaceWith(el);
this.dragEl.remove();
this.el.trigger('change');
if (this.hasNewRoot) {
this.dragRootEl.trigger('change');
}
this.reset();
},
dragMove: function(e)
{
var list, parent, prev, next, depth,
opt = this.options,
mouse = this.mouse;
this.dragEl.css({
'left' : e.pageX - mouse.offsetX,
'top' : e.pageY - mouse.offsetY
});
// mouse position last events
mouse.lastX = mouse.nowX;
mouse.lastY = mouse.nowY;
// mouse position this events
mouse.nowX = e.pageX;
mouse.nowY = e.pageY;
// distance mouse moved between events
mouse.distX = mouse.nowX - mouse.lastX;
mouse.distY = mouse.nowY - mouse.lastY;
// direction mouse was moving
mouse.lastDirX = mouse.dirX;
mouse.lastDirY = mouse.dirY;
// direction mouse is now moving (on both axis)
mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1;
mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1;
// axis mouse is now moving on
var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0;
// do nothing on first move
if (!mouse.moving) {
mouse.dirAx = newAx;
mouse.moving = true;
return;
}
// calc distance moved on this axis (and direction)
if (mouse.dirAx !== newAx) {
mouse.distAxX = 0;
mouse.distAxY = 0;
} else {
mouse.distAxX += Math.abs(mouse.distX);
if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) {
mouse.distAxX = 0;
}
mouse.distAxY += Math.abs(mouse.distY);
if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) {
mouse.distAxY = 0;
}
}
mouse.dirAx = newAx;
/**
* move horizontal
*/
if (mouse.dirAx && mouse.distAxX >= opt.threshold) {
// reset move distance on x-axis for new phase
mouse.distAxX = 0;
prev = this.placeEl.prev(opt.itemNodeName);
// increase horizontal level if previous sibling exists and is not collapsed
if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass)) {
// cannot increase level when item above is collapsed
list = prev.find(opt.listNodeName).last();
// check if depth limit has reached
depth = this.placeEl.parents(opt.listNodeName).length;
if (depth + this.dragDepth <= opt.maxDepth) {
// create new sub-level if one doesn't exist
if (!list.length) {
list = $('<' + opt.listNodeName + '/>').addClass(opt.listClass);
list.append(this.placeEl);
prev.append(list);
this.setParent(prev);
} else {
// else append to next level up
list = prev.children(opt.listNodeName).last();
list.append(this.placeEl);
}
}
}
// decrease horizontal level
if (mouse.distX < 0) {
// we can't decrease a level if an item preceeds the current one
next = this.placeEl.next(opt.itemNodeName);
if (!next.length) {
parent = this.placeEl.parent();
this.placeEl.closest(opt.itemNodeName).after(this.placeEl);
if (!parent.children().length) {
this.unsetParent(parent.parent());
}
}
}
}
var isEmpty = false;
// find list item under cursor
if (!hasPointerEvents) {
this.dragEl[0].style.visibility = 'hidden';
}
this.pointEl = $(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop)));
if (!hasPointerEvents) {
this.dragEl[0].style.visibility = 'visible';
}
if (this.pointEl.hasClass(opt.handleClass)) {
this.pointEl = this.pointEl.parent(opt.itemNodeName);
}
if (this.pointEl.hasClass(opt.emptyClass)) {
isEmpty = true;
}
else if (!this.pointEl.length || !this.pointEl.hasClass(opt.itemClass)) {
return;
}
// find parent list of item under cursor
var pointElRoot = this.pointEl.closest('.' + opt.rootClass),
isNewRoot = this.dragRootEl.data('nestable-id') !== pointElRoot.data('nestable-id');
/**
* move vertical
*/
if (!mouse.dirAx || isNewRoot || isEmpty) {
// check if groups match if dragging over new root
if (isNewRoot && opt.group !== pointElRoot.data('nestable-group')) {
return;
}
// check depth limit
depth = this.dragDepth - 1 + this.pointEl.parents(opt.listNodeName).length;
if (depth > opt.maxDepth) {
return;
}
var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2);
parent = this.placeEl.parent();
// if empty create new list to replace empty placeholder
if (isEmpty) {
list = $(document.createElement(opt.listNodeName)).addClass(opt.listClass);
list.append(this.placeEl);
this.pointEl.replaceWith(list);
}
else if (before) {
this.pointEl.before(this.placeEl);
}
else {
this.pointEl.after(this.placeEl);
}
if (!parent.children().length) {
this.unsetParent(parent.parent());
}
if (!this.dragRootEl.find(opt.itemNodeName).length) {
this.dragRootEl.append('<div class="' + opt.emptyClass + '"/>');
}
// parent root list has changed
if (isNewRoot) {
this.dragRootEl = pointElRoot;
this.hasNewRoot = this.el[0] !== this.dragRootEl[0];
}
}
}
};
$.fn.nestable = function(params)
{
var lists = this,
retval = this;
lists.each(function()
{
var plugin = $(this).data("nestable");
if (!plugin) {
$(this).data("nestable", new Plugin(this, params));
$(this).data("nestable-id", new Date().getTime());
} else {
if (typeof params === 'string' && typeof plugin[params] === 'function') {
retval = plugin[params]();
}
}
});
return retval || lists;
};
})(window.jQuery || window.Zepto, window, document);
|
{
"pile_set_name": "Github"
}
|
package plugins;
import java.io.IOException;
import com.sun.squawk.VM;
import sics.port.PluginPPort;
import sics.port.PluginRPort;
import sics.plugin.PlugInComponent;
public class Square extends PlugInComponent {
private PluginPPort pub, sp, st, led;
private PluginRPort ab, w1, w2, adc, sub;
public Square(String[] args) {
super(args);
}
public static void main(String[] args) {
VM.println("Square.main()");
Square publish = new Square(args);
publish.run();
VM.println("Square-main done");
}
@Override
public void init() {
// Initiate PluginPPort
pub = new PluginPPort(this, "pub");
sp = new PluginPPort(this, "sp");
st = new PluginPPort(this, "st");
led = new PluginPPort(this, "led");
w1 = new PluginRPort(this, "w1");
w2 = new PluginRPort(this, "w2");
adc = new PluginRPort(this, "adc");
sub = new PluginRPort(this, "sub");
ab = new PluginRPort(this, "ab");
}
public void run() {
init();
try {
doFunction();
} catch (InterruptedException e) {
VM.println("**************** Interrupted.");
return;
}
}
public void doFunction() throws InterruptedException {
String data;
int cnt = 0;
int lcnt = 0;
VM.println("[Square is running]");
int speed;
int speed0 = 14;
int state = 1;
String val1, val2;
int val, val3, val4;
int mindist = 30000;
int startdist = -1;
int prevdist = -1;
while (true) {
if (state == 1) {
speed = speed0;
sp.write(0);
st.write(0);
Thread.sleep(500);
sp.write(speed);
st.write(100);
Thread.sleep(500);
startdist = -1;
mindist = 30000;
lcnt = 0;
Object o6 = ab.receive();
String val6 = "";
if (o6 != null) {
val6 = (String) o6;
startdist = Integer.parseInt(val6);
state = 3;
}
pub.write("Square|new state " + state);
} else if (state == 3) {
// The car moves in a circle, and we are interested in the
// part of the path that is closest to the wall.
// This is the part closer than the distance when we enter
// state 3 (origdist).
// When we enter this part, we expect the distance to sink
// until it either grows again, or becomes unknown (the latter
// seems to be the rule).
// Generally, we treat unknown distance (null returned from
// the port) as infinity, and represent it as -1.
// It may happen that it means that a point was missed,
// and then should instead be ignored, but we don't handle
// this situation.
// When sampling distance rapidly, it could happen that noise
// makes the change of distance non-monotonic. We don't handle
// that. Some kind of low-pass filter is wanted then.
int dist;
cnt += 1;
lcnt += 1;
java.util.Date date = new java.util.Date();
val1 = "" + date.getTime();
// w1 = front wheel
val3 = w1.readInt();
val4 = w2.readInt();
String closest = "";
Object o6 = ab.receive();
String val6 = "";
if (o6 != null) {
val6 = (String) o6;
dist = Integer.parseInt(val6);
} else {
dist = -1;
}
if (dist != -1 && dist < mindist) {
mindist = dist;
}
if (prevdist != -1 && prevdist < startdist && dist == -1) {
closest = "closest";
}
prevdist = dist;
data = val1 + " " + val3 + " " + val4 + " " + val6 + " state" +
state + " mindist=" + mindist + " startdist=" + startdist + " prevdist=" + prevdist + " lcnt=" + lcnt + " " + closest;
VM.println(data);
data = "Square|" + cnt + " " + data;
VM.println(data);
pub.write(data);
Thread.sleep(300);
if (val4-val3 > 12 || val4-val3 < -12 || val3 == 0) {
// not on the floor, or ESC not reacting because it wasn't
// initialized: turn off motor and restart the app
led.write("1|0");
led.write("2|0");
led.write("3|0");
sp.write(0);
st.write(0);
Thread.sleep(5000);
state = 1;
}
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
//@module: commonjs
export var x = 0;
var y = 0;
export function f1() {}
function f2() {}
export class C1 {
public p1 = 0;
public p2() {}
}
class C2{
public p1 = 0;
public p2() {}
}
export enum E1 {A=0}
var u = E1.A;
enum E2 {B=0}
var v = E2.B;
|
{
"pile_set_name": "Github"
}
|
package groupTests
import (
"github.com/jinzhu/copier"
"github.com/mongoeye/mongoeye/analysis"
"github.com/mongoeye/mongoeye/analysis/stages/03group"
"github.com/mongoeye/mongoeye/helpers"
"github.com/mongoeye/mongoeye/tests"
"gopkg.in/mgo.v2/bson"
"testing"
"time"
)
// RunTestValueHistogram tests results of ValueHistogramMaxRes option.
func RunTestValueHistogram(t *testing.T, stageFactory group.StageFactory) {
c := setup()
defer tearDown(c)
// Decimal type is new in version 3.4
decimalType := "decimal"
var decimal1 interface{} = helpers.ParseDecimal("123")
var decimal2 interface{} = helpers.ParseDecimal("456")
var decimal3 interface{} = helpers.ParseDecimal("789")
decimalHistogram := &analysis.Histogram{
Start: helpers.ParseDecimal("123"),
End: helpers.ParseDecimal("790"),
Range: 667,
Step: 1,
NumberOfSteps: 667,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 1,
},
{
Interval: 333,
Count: 1,
},
{
Interval: 666,
Count: 1,
},
},
}
if !tests.HasMongoDBDecimalSupport() {
decimalType = "string"
decimal1 = "123"
decimal2 = "456"
decimal3 = "789"
decimalHistogram = nil
}
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c1"),
"_double": 123.456,
"_string": "Šašo",
"_binData": []byte("Šašo"),
"_undefined": bson.Undefined,
"_bool": false,
"_date": helpers.ParseDate("2017-01-01T00:00:00+00:00"),
"_null": nil,
"_regex": bson.RegEx{Pattern: "a.*", Options: "i"},
"_dbPointer": bson.DBPointer{Namespace: "ns", Id: bson.ObjectIdHex("58de3f123d9654ba801bb30d")},
"_javascript": bson.JavaScript{Code: "var x = 1+1;", Scope: nil},
"_symbol": bson.Symbol("x"),
"_javascriptWithScope": bson.JavaScript{Code: "var x = 1+y;", Scope: bson.M{"y": 5}},
"_int": 123,
"_timestamp": bson.MongoTimestamp(1490959230),
"_long": int64(456),
"_decimal": decimal1,
"_minKey": bson.MinKey,
"_maxKey": bson.MaxKey,
"_object": bson.M{
"f1": 10,
"f2": "abc",
},
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
"_double": 456.789,
"_string": "abc",
"_binData": []byte("abc"),
"_undefined": bson.Undefined,
"_bool": true,
"_date": helpers.ParseDate("2017-01-03T00:00:00+00:00"),
"_null": nil,
"_regex": bson.RegEx{Pattern: "b.*", Options: "i"},
"_dbPointer": bson.DBPointer{Namespace: "ns", Id: bson.ObjectIdHex("58de3f123d9654ba801bb31d")},
"_javascript": bson.JavaScript{Code: "var x = 2+2;", Scope: nil},
"_symbol": bson.Symbol("x"),
"_javascriptWithScope": bson.JavaScript{Code: "var x = 2+y;", Scope: bson.M{"y": 5}},
"_int": 123,
"_timestamp": bson.MongoTimestamp(1490959230),
"_long": int64(456),
"_decimal": decimal2,
"_minKey": bson.MinKey,
"_maxKey": bson.MaxKey,
"_object": bson.M{
"f1": "cde",
"f2": 20,
},
"_array": []interface{}{1, 2},
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
"_double": 123.456,
"_string": "Šašo",
"_binData": []byte("abc"),
"_undefined": bson.Undefined,
"_bool": true,
"_date": helpers.ParseDate("2017-01-02T00:00:00+00:00"),
"_null": nil,
"_regex": bson.RegEx{Pattern: "c.*", Options: "i"},
"_dbPointer": bson.DBPointer{Namespace: "ns", Id: bson.ObjectIdHex("58de3f123d9654ba801bb32d")},
"_javascript": bson.JavaScript{Code: "var x = 3+3;", Scope: nil},
"_symbol": bson.Symbol("y"),
"_javascriptWithScope": bson.JavaScript{Code: "var x = 3+y;", Scope: bson.M{"y": 5}},
"_int": 456,
"_timestamp": bson.MongoTimestamp(1490959231),
"_long": int64(123),
"_decimal": decimal3,
"_minKey": bson.MinKey,
"_maxKey": bson.MaxKey,
"_array": []interface{}{3, 4},
})
options := group.Options{}
copier.Copy(&options, &testGroupOptions)
options.ValueHistogramMaxRes = 1000
expected := []interface{}{
group.Result{
Name: "_id",
Type: analysis.Type{
Name: "objectId",
Count: 3,
},
},
group.Result{
Name: "_double",
Type: analysis.Type{
Name: "double",
Count: 3,
ValueHistogram: &analysis.Histogram{
Start: 123,
End: 457.5,
Range: 334.5,
Step: 0.5,
NumberOfSteps: 669,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 2,
},
{
Interval: 667,
Count: 1,
},
},
},
},
},
group.Result{
Name: "_string",
Type: analysis.Type{
Name: "string",
Count: 3,
},
},
group.Result{
Name: "_binData",
Type: analysis.Type{
Name: "binData",
Count: 3,
},
},
group.Result{
Name: "_undefined",
Type: analysis.Type{
Name: "undefined",
Count: 3,
},
},
group.Result{
Name: "_bool",
Type: analysis.Type{
Name: "bool",
Count: 3,
},
},
group.Result{
Name: "_date",
Type: analysis.Type{
Name: "date",
Count: 3,
ValueHistogram: &analysis.Histogram{
Start: helpers.ParseDate("2017-01-01T00:00:00+00:00"),
End: helpers.ParseDate("2017-01-03T00:05:00+00:00"),
Range: 173100,
Step: 300,
NumberOfSteps: 577,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 1,
},
{
Interval: 288,
Count: 1,
},
{
Interval: 576,
Count: 1,
},
},
},
},
},
group.Result{
Name: "_null",
Type: analysis.Type{
Name: "null",
Count: 3,
},
},
group.Result{
Name: "_regex",
Type: analysis.Type{
Name: "regex",
Count: 3,
},
},
group.Result{
Name: "_dbPointer",
Type: analysis.Type{
Name: "dbPointer",
Count: 3,
},
},
group.Result{
Name: "_javascript",
Type: analysis.Type{
Name: "javascript",
Count: 3,
},
},
group.Result{
Name: "_symbol",
Type: analysis.Type{
Name: "symbol",
Count: 3,
},
},
group.Result{
Name: "_javascriptWithScope",
Type: analysis.Type{
Name: "javascriptWithScope",
Count: 3,
},
},
group.Result{
Name: "_int",
Type: analysis.Type{
Name: "int",
Count: 3,
ValueHistogram: &analysis.Histogram{
Start: 123,
End: 457,
Range: 334,
Step: 1,
NumberOfSteps: 334,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 2,
},
{
Interval: 333,
Count: 1,
},
},
},
},
},
group.Result{
Name: "_timestamp",
Type: analysis.Type{
Name: "timestamp",
Count: 3,
},
},
group.Result{
Name: "_long",
Type: analysis.Type{
Name: "long",
Count: 3,
ValueHistogram: &analysis.Histogram{
Start: int64(123),
End: int64(457),
Range: 334,
Step: 1,
NumberOfSteps: 334,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 1,
},
{
Interval: 333,
Count: 2,
},
},
},
},
},
group.Result{
Name: "_decimal",
Type: analysis.Type{
Name: decimalType,
Count: 3,
ValueHistogram: decimalHistogram,
},
},
group.Result{
Name: "_minKey",
Type: analysis.Type{
Name: "minKey",
Count: 3,
},
},
group.Result{
Name: "_maxKey",
Type: analysis.Type{
Name: "maxKey",
Count: 3,
},
},
group.Result{
Name: "_object",
Type: analysis.Type{
Name: "object",
Count: 2,
},
},
group.Result{
Name: "_object.f1",
Type: analysis.Type{
Name: "int",
Count: 1,
},
},
group.Result{
Name: "_object.f1",
Type: analysis.Type{
Name: "string",
Count: 1,
},
},
group.Result{
Name: "_object.f2",
Type: analysis.Type{
Name: "string",
Count: 1,
},
},
group.Result{
Name: "_object.f2",
Type: analysis.Type{
Name: "int",
Count: 1,
},
},
group.Result{
Name: "_array",
Type: analysis.Type{
Name: "array",
Count: 2,
},
},
group.Result{
Name: "_array.[]",
Type: analysis.Type{
Name: "int",
Count: 4,
ValueHistogram: &analysis.Histogram{
Start: 1,
End: 5,
Range: 4,
Step: 1,
NumberOfSteps: 4,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 1,
},
{
Interval: 1,
Count: 1,
},
{
Interval: 2,
Count: 1,
},
{
Interval: 3,
Count: 1,
},
},
},
},
},
}
testStage(t, c, time.UTC, stageFactory(&options), expected)
}
// RunTestValueHistogramMaxRes tests group stage with ValueHistogramMaxRes option.
func RunTestValueHistogramMaxRes(t *testing.T, stageFactory group.StageFactory) {
c := setup()
defer tearDown(c)
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
"_int": 0,
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c1"),
"_int": 1,
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
"_int": 2,
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c3"),
"_int": 3,
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c4"),
"_int": 4,
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c5"),
"_int": 5,
})
options := group.Options{}
copier.Copy(&options, &testGroupOptions)
options.ValueHistogramMaxRes = 5
expected := []interface{}{
group.Result{
Name: "_id",
Type: analysis.Type{
Name: "objectId",
Count: 6,
},
},
group.Result{
Name: "_int",
Type: analysis.Type{
Name: "int",
Count: 6,
ValueHistogram: &analysis.Histogram{
Start: 0,
End: 9,
Step: 3.0,
Range: 9.0,
NumberOfSteps: 3,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 3,
},
{
Interval: 1,
Count: 3,
},
},
},
},
},
}
stage := stageFactory(&options)
testStage(t, c, time.UTC, stage, expected)
}
// RunTestLengthHistogram tests results of LengthHistogramMaxRes option.
func RunTestLengthHistogram(t *testing.T, stageFactory group.StageFactory) {
c := setup()
defer tearDown(c)
// Decimal type is new in version 3.4
decimalType := "decimal"
var decimal1 interface{} = helpers.ParseDecimal("123")
var decimal2 interface{} = helpers.ParseDecimal("456")
var decimal3 interface{} = helpers.ParseDecimal("789")
if !tests.HasMongoDBDecimalSupport() {
decimalType = "string"
decimal1 = "123"
decimal2 = "456"
decimal3 = "789"
}
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
"_double": 123.456,
"_string": "Šašo",
"_binData": []byte("Šašo"),
"_undefined": bson.Undefined,
"_bool": true,
"_date": helpers.ParseDate("2017-01-01T00:00:00+00:00"),
"_null": nil,
"_regex": bson.RegEx{Pattern: "a.*", Options: "i"},
"_dbPointer": bson.DBPointer{Namespace: "ns", Id: bson.ObjectIdHex("58de3f123d9654ba801bb30d")},
"_javascript": bson.JavaScript{Code: "var x = 1+1;", Scope: nil},
"_symbol": bson.Symbol("x"),
"_javascriptWithScope": bson.JavaScript{Code: "var x = 1+y;", Scope: bson.M{"y": 5}},
"_int": 123,
"_timestamp": bson.MongoTimestamp(1490959230),
"_long": int64(456),
"_decimal": decimal1,
"_minKey": bson.MinKey,
"_maxKey": bson.MaxKey,
"_object": bson.M{
"f1": 10,
"f2": "abc",
},
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c1"),
"_double": 456.789,
"_string": "abc",
"_binData": []byte("abc"),
"_undefined": bson.Undefined,
"_bool": false,
"_date": helpers.ParseDate("2017-01-03T00:00:00+00:00"),
"_null": nil,
"_regex": bson.RegEx{Pattern: "b.*", Options: "i"},
"_dbPointer": bson.DBPointer{Namespace: "ns", Id: bson.ObjectIdHex("58de3f123d9654ba801bb31d")},
"_javascript": bson.JavaScript{Code: "var x = 2+2;", Scope: nil},
"_symbol": bson.Symbol("x"),
"_javascriptWithScope": bson.JavaScript{Code: "var x = 2+y;", Scope: bson.M{"y": 5}},
"_int": 123,
"_timestamp": bson.MongoTimestamp(1490959230),
"_long": int64(456),
"_decimal": decimal2,
"_minKey": bson.MinKey,
"_maxKey": bson.MaxKey,
"_object": bson.M{
"f1": "cde",
"f2": 20,
},
"_array": []interface{}{1},
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
"_double": 123.456,
"_string": "Šašo",
"_binData": []byte("abc"),
"_undefined": bson.Undefined,
"_bool": true,
"_date": helpers.ParseDate("2017-01-02T00:00:00+00:00"),
"_null": nil,
"_regex": bson.RegEx{Pattern: "c.*", Options: "i"},
"_dbPointer": bson.DBPointer{Namespace: "ns", Id: bson.ObjectIdHex("58de3f123d9654ba801bb32d")},
"_javascript": bson.JavaScript{Code: "var x = 3+3;", Scope: nil},
"_symbol": bson.Symbol("y"),
"_javascriptWithScope": bson.JavaScript{Code: "var x = 3+y;", Scope: bson.M{"y": 5}},
"_int": 456,
"_timestamp": bson.MongoTimestamp(1490959231),
"_long": int64(123),
"_decimal": decimal3,
"_minKey": bson.MinKey,
"_maxKey": bson.MaxKey,
"_array": []interface{}{3, 4, 5},
})
options := group.Options{}
copier.Copy(&options, &testGroupOptions)
options.LengthHistogramMaxRes = 100
expected := []interface{}{
group.Result{
Name: "_id",
Type: analysis.Type{
Name: "objectId",
Count: 3,
},
},
group.Result{
Name: "_double",
Type: analysis.Type{
Name: "double",
Count: 3,
},
},
group.Result{
Name: "_string",
Type: analysis.Type{
Name: "string",
Count: 3,
LengthHistogram: &analysis.Histogram{
Start: 3,
End: 5,
Range: 2,
Step: 1,
NumberOfSteps: 2,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 1,
},
{
Interval: 1,
Count: 2,
},
},
},
},
},
group.Result{
Name: "_binData",
Type: analysis.Type{
Name: "binData",
Count: 3,
},
},
group.Result{
Name: "_undefined",
Type: analysis.Type{
Name: "undefined",
Count: 3,
},
},
group.Result{
Name: "_bool",
Type: analysis.Type{
Name: "bool",
Count: 3,
},
},
group.Result{
Name: "_date",
Type: analysis.Type{
Name: "date",
Count: 3,
},
},
group.Result{
Name: "_null",
Type: analysis.Type{
Name: "null",
Count: 3,
},
},
group.Result{
Name: "_regex",
Type: analysis.Type{
Name: "regex",
Count: 3,
},
},
group.Result{
Name: "_dbPointer",
Type: analysis.Type{
Name: "dbPointer",
Count: 3,
},
},
group.Result{
Name: "_javascript",
Type: analysis.Type{
Name: "javascript",
Count: 3,
},
},
group.Result{
Name: "_symbol",
Type: analysis.Type{
Name: "symbol",
Count: 3,
},
},
group.Result{
Name: "_javascriptWithScope",
Type: analysis.Type{
Name: "javascriptWithScope",
Count: 3,
},
},
group.Result{
Name: "_int",
Type: analysis.Type{
Name: "int",
Count: 3,
},
},
group.Result{
Name: "_timestamp",
Type: analysis.Type{
Name: "timestamp",
Count: 3,
},
},
group.Result{
Name: "_long",
Type: analysis.Type{
Name: "long",
Count: 3,
},
},
group.Result{
Name: "_decimal",
Type: analysis.Type{
Name: decimalType,
Count: 3,
},
},
group.Result{
Name: "_minKey",
Type: analysis.Type{
Name: "minKey",
Count: 3,
},
},
group.Result{
Name: "_maxKey",
Type: analysis.Type{
Name: "maxKey",
Count: 3,
},
},
group.Result{
Name: "_object",
Type: analysis.Type{
Name: "object",
Count: 2,
},
},
group.Result{
Name: "_object.f1",
Type: analysis.Type{
Name: "int",
Count: 1,
},
},
group.Result{
Name: "_object.f1",
Type: analysis.Type{
Name: "string",
Count: 1,
},
},
group.Result{
Name: "_object.f2",
Type: analysis.Type{
Name: "string",
Count: 1,
},
},
group.Result{
Name: "_object.f2",
Type: analysis.Type{
Name: "int",
Count: 1,
},
},
group.Result{
Name: "_array",
Type: analysis.Type{
Name: "array",
Count: 2,
LengthHistogram: &analysis.Histogram{
Start: 1,
End: 4,
Range: 3,
Step: 1,
NumberOfSteps: 3,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 1,
},
{
Interval: 2,
Count: 1,
},
},
},
},
},
group.Result{
Name: "_array.[]",
Type: analysis.Type{
Name: "int",
Count: 4,
},
},
}
testStage(t, c, time.UTC, stageFactory(&options), expected)
}
// RunTestLengthHistogramMaxRes tests group stage with ValueHistogramMaxRes option.
func RunTestLengthHistogramMaxRes(t *testing.T, stageFactory group.StageFactory) {
c := setup()
defer tearDown(c)
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
"_str": "",
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c1"),
"_str": "1",
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
"_str": "12",
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c3"),
"_str": "123",
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c4"),
"_str": "1234",
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c5"),
"_str": "12345",
})
options := group.Options{}
copier.Copy(&options, &testGroupOptions)
options.LengthHistogramMaxRes = 5
expected := []interface{}{
group.Result{
Name: "_id",
Type: analysis.Type{
Name: "objectId",
Count: 6,
},
},
group.Result{
Name: "_str",
Type: analysis.Type{
Name: "string",
Count: 6,
LengthHistogram: &analysis.Histogram{
Start: 0,
End: 9,
Step: 3.0,
Range: 9.0,
NumberOfSteps: 3,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 3,
},
{
Interval: 1,
Count: 3,
},
},
},
},
},
}
stage := stageFactory(&options)
testStage(t, c, time.UTC, stage, expected)
}
// RunTestWeekdayHistogram tests results of StoreWeekdayHistogram option.
func RunTestWeekdayHistogram(t *testing.T, stageFactory group.StageFactory) {
c := setup()
defer tearDown(c)
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
"_date": helpers.ParseDate("2017-04-17T13:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c1"),
"_date": helpers.ParseDate("2017-04-18T13:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
"_date": helpers.ParseDate("2017-04-19T13:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c3"),
"_date": helpers.ParseDate("2017-04-20T13:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c4"),
"_date": helpers.ParseDate("2017-04-21T13:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c5"),
"_date": helpers.ParseDate("2017-04-24T13:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c6"),
"_date": helpers.ParseDate("2017-04-25T13:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c7"),
"_date": helpers.ParseDate("2017-04-26T13:30:00+00:00"),
})
options := group.Options{}
copier.Copy(&options, &testGroupOptions)
options.StoreWeekdayHistogram = true
expected := []interface{}{
group.Result{
Name: "_id",
Type: analysis.Type{
Name: "objectId",
Count: 8,
},
},
group.Result{
Name: "_date",
Type: analysis.Type{
Name: "date",
Count: 8,
WeekdayHistogram: &analysis.WeekdayHistogram{
0, // sunday
2, // monday
2, // ...
2,
1,
1,
0,
},
},
},
}
testStage(t, c, time.UTC, stageFactory(&options), expected)
}
// RunTestHourHistogram tests results of StoreHourHistogram option.
func RunTestHourHistogram(t *testing.T, stageFactory group.StageFactory) {
c := setup()
defer tearDown(c)
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
"_date": helpers.ParseDate("2017-04-17T00:00:01+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c1"),
"_date": helpers.ParseDate("2017-04-18T23:59:59+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
"_date": helpers.ParseDate("2017-04-19T02:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c3"),
"_date": helpers.ParseDate("2017-04-20T03:59:59+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c4"),
"_date": helpers.ParseDate("2017-04-21T20:35:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c5"),
"_date": helpers.ParseDate("2017-04-24T20:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c6"),
"_date": helpers.ParseDate("2017-04-25T20:30:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c7"),
"_date": helpers.ParseDate("2017-04-26T23:30:00+00:00"),
})
options := group.Options{}
copier.Copy(&options, &testGroupOptions)
options.StoreHourHistogram = true
expected := []interface{}{
group.Result{
Name: "_id",
Type: analysis.Type{
Name: "objectId",
Count: 8,
},
},
group.Result{
Name: "_date",
Type: analysis.Type{
Name: "date",
Count: 8,
HourHistogram: &analysis.HourHistogram{
1, // 00
0, // 01
1,
1,
0,
0,
0,
0,
0,
0,
0, // 10
0, // 11
0,
0,
0,
0,
0,
0,
0,
0,
3, // 20
0, // 21
0, // 22
2, // 23
},
},
},
}
testStage(t, c, time.UTC, stageFactory(&options), expected)
}
// RunTestDateStatsTimezone tests results of group stage with different timezones.
func RunTestDateStatsTimezone(t *testing.T, stageFactory group.StageFactory) {
c := setup()
defer tearDown(c)
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
"_date": helpers.ParseDate("2017-04-17T23:59:59+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c1"),
"_date": helpers.ParseDate("2017-04-19T12:00:00+00:00"),
})
c.Insert(bson.M{
"_id": bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
"_date": helpers.ParseDate("2017-04-21T00:00:01+00:00"),
})
options := group.Options{}
copier.Copy(&options, &testGroupOptions)
options.StoreMinMaxAvgValue = true
options.StoreWeekdayHistogram = true
options.StoreHourHistogram = true
options.ValueHistogramMaxRes = 100
// --------------------------------------------------------------------
// UTC timezone
expectedUTC := []interface{}{
group.Result{
Name: "_id",
Type: analysis.Type{
Name: "objectId",
Count: 3,
ValueStats: &analysis.ValueStats{
Min: bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
Max: bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
},
},
},
group.Result{
Name: "_date",
Type: analysis.Type{
Name: "date",
Count: 3,
ValueStats: &analysis.ValueStats{
Min: helpers.ParseDate("2017-04-17T23:59:59+00:00"),
Max: helpers.ParseDate("2017-04-21T00:00:01+00:00"),
},
HourHistogram: &analysis.HourHistogram{
1, // 00
0, // 01
0, // 02
0, // 03
0, // 04
0, // 05
0, // 06
0, // 07
0, // 08
0, // 09
0, // 10
0, // 11
1, // 12
0, // 13
0, // 14
0, // 15
0, // 16
0, // 17
0, // 18
0, // 19
0, // 20
0, // 21
0, // 22
1, // 23
},
WeekdayHistogram: &analysis.WeekdayHistogram{
0, // sunday
1, // monday
0,
1,
0,
1,
0,
},
ValueHistogram: &analysis.Histogram{
Start: helpers.ParseDate("2017-04-17T22:00:00+00:00"),
End: helpers.ParseDate("2017-04-21T04:00:00+00:00"),
Range: 280800,
Step: 7200,
NumberOfSteps: 39,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 1,
},
{
Interval: 19,
Count: 1,
},
{
Interval: 37,
Count: 1,
},
},
},
},
},
}
testStage(t, c, time.UTC, stageFactory(&options), expectedUTC)
// --------------------------------------------------------------------
// America/New_York timezone
locationNY, err := time.LoadLocation("America/New_York")
if err != nil {
panic(err)
}
expectedNY := []interface{}{
group.Result{
Name: "_id",
Type: analysis.Type{
Name: "objectId",
Count: 3,
ValueStats: &analysis.ValueStats{
Min: bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c0"),
Max: bson.ObjectIdHex("58e20d849d3ae7e1f8eac9c2"),
},
},
},
group.Result{
Name: "_date",
Type: analysis.Type{
Name: "date",
Count: 3,
ValueStats: &analysis.ValueStats{
Min: helpers.ParseDate("2017-04-17T19:59:59-04:00").In(locationNY),
Max: helpers.ParseDate("2017-04-20T20:00:01-04:00").In(locationNY),
},
HourHistogram: &analysis.HourHistogram{
0, // 00
0, // 01
0, // 02
0, // 03
0, // 04
0, // 05
0, // 06
0, // 07
1, // 08
0, // 09
0, // 10
0, // 11
0, // 12
0, // 13
0, // 14
0, // 15
0, // 16
0, // 17
0, // 18
1, // 19
1, // 20
0, // 21
0, // 22
0, // 23
},
WeekdayHistogram: &analysis.WeekdayHistogram{
0, // sunday
1, // monday
0,
1,
1,
0,
0,
},
ValueHistogram: &analysis.Histogram{
Start: helpers.ParseDate("2017-04-17T18:00:00-04:00").In(locationNY),
End: helpers.ParseDate("2017-04-21T00:00:00-04:00").In(locationNY),
Range: 280800,
Step: 7200,
NumberOfSteps: 39,
Intervals: analysis.Intervals{
{
Interval: 0,
Count: 1,
},
{
Interval: 19,
Count: 1,
},
{
Interval: 37,
Count: 1,
},
},
},
},
},
}
testStage(t, c, locationNY, stageFactory(&options), expectedNY)
}
|
{
"pile_set_name": "Github"
}
|
#ifndef BABYLON_INSPECTOR_COMPONENTS_ACTION_TABS_TABS_PROPERTY_GRIDS_LIGHTS_POINT_LIGHT_PROPERTY_GRID_COMPONENT_H
#define BABYLON_INSPECTOR_COMPONENTS_ACTION_TABS_TABS_PROPERTY_GRIDS_LIGHTS_POINT_LIGHT_PROPERTY_GRID_COMPONENT_H
#include <memory>
#include <babylon/babylon_api.h>
#include <babylon/inspector/components/actiontabs/lines/color3_line_component.h>
#include <babylon/inspector/components/actiontabs/lines/vector3_line_component.h>
#include <babylon/inspector/components/actiontabs/tabs/propertygrids/lights/common_light_property_grid_component.h>
#include <babylon/inspector/components/actiontabs/tabs/propertygrids/lights/common_shadow_light_property_grid_component.h>
#include <babylon/lights/point_light.h>
namespace BABYLON {
class PointLight;
using PointLightPtr = std::shared_ptr<PointLight>;
struct BABYLON_SHARED_EXPORT PointLightPropertyGridComponent {
static void render(const PointLightPtr& light)
{
CommonLightPropertyGridComponent::render(std::static_pointer_cast<Light>(light));
// --- SETUP ---
static auto setupContainerOpened = true;
ImGui::SetNextTreeNodeOpen(setupContainerOpened, ImGuiCond_Always);
if (ImGui::CollapsingHeader("SETUP")) {
Color3LineComponent::render("Diffuse", light->diffuse);
Color3LineComponent::render("Specular", light->specular);
Vector3LineComponent::render("Position", light->position);
setupContainerOpened = true;
}
else {
setupContainerOpened = false;
}
CommonShadowLightPropertyGridComponent::render(light);
}
}; // end of struct PointLightPropertyGridComponent
} // end of namespace BABYLON
#endif // end of
// BABYLON_INSPECTOR_COMPONENTS_ACTION_TABS_TABS_PROPERTY_GRIDS_LIGHTS_POINT_LIGHT_PROPERTY_GRID_COMPONENT_H
|
{
"pile_set_name": "Github"
}
|
$RXN
Marvin 081601101040
2 1
$MOL
Marvin 08161010402D
5 4 0 0 0 0 999 V2000
7.6246 -6.4477 0.0000 N 0 0 0 0 0 0 0 0 0 1 0 0
8.3391 -6.8602 0.0000 R# 0 0 0 0 0 0 0 0 0 0 0 0
9.0535 -6.4477 0.0000 C 0 0 0 0 0 0 0 0 0 2 0 0
9.7680 -6.8602 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
9.0535 -5.6227 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
2 3 1 0 0 0 0
3 4 1 0 0 0 0
3 5 2 0 0 0 0
M RGP 1 2 1
M END
$MOL
Marvin 08161010402D
5 4 0 0 0 0 999 V2000
12.0535 -6.5359 0.0000 N 0 0 0 0 0 0 0 0 0 4 0 0
12.7679 -6.9485 0.0000 R# 0 0 0 0 0 0 0 0 0 0 0 0
13.4824 -6.5359 0.0000 C 0 0 0 0 0 0 0 0 0 3 0 0
14.1969 -6.9485 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
13.4824 -5.7109 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
2 3 1 0 0 0 0
3 4 1 0 0 0 0
3 5 2 0 0 0 0
M RGP 1 2 2
M END
$MOL
Marvin 08161010402D
9 8 0 0 0 0 999 V2000
17.3421 -6.5858 0.0000 N 0 0 0 0 0 0 0 0 0 1 0 0
18.0566 -6.9983 0.0000 R# 0 0 0 0 0 0 0 0 0 0 0 0
18.7710 -6.5858 0.0000 C 0 0 0 0 0 0 0 0 0 2 0 0
19.4855 -6.9983 0.0000 N 0 0 0 0 0 0 0 0 0 4 0 0
18.7710 -5.7608 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
20.2000 -6.5858 0.0000 R# 0 0 0 0 0 0 0 0 0 0 0 0
20.9144 -6.9983 0.0000 C 0 0 0 0 0 0 0 0 0 3 0 0
21.6289 -6.5858 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
20.9144 -7.8234 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
2 3 1 0 0 0 0
3 4 1 0 0 0 0
3 5 2 0 0 0 0
4 6 1 0 0 0 0
6 7 1 0 0 0 0
7 8 1 0 0 0 0
7 9 2 0 0 0 0
M RGP 2 2 1 6 2
M END
|
{
"pile_set_name": "Github"
}
|
#ifndef _WINABLE_H
#define _WINABLE_H
#ifdef __cplusplus
extern "C" {
#endif
#if (_WIN32_WINNT < 0x0403)
#define INPUT_MOUSE 0x00000000
#define INPUT_KEYBOARD 0x00000001
#define INPUT_HARDWARE 0x00000002
#endif /* (_WIN32_WINNT < 0x04030) */
#if (WINVER < 0x0500)
#define CHILDID_SELF 0
#define OBJID_WINDOW 0x00000000
#define OBJID_SYSMENU 0xFFFFFFFF
#define OBJID_TITLEBAR 0xFFFFFFFE
#define OBJID_MENU 0xFFFFFFFD
#define OBJID_CLIENT 0xFFFFFFFC
#define OBJID_VSCROLL 0xFFFFFFFB
#define OBJID_HSCROLL 0xFFFFFFFA
#define OBJID_SIZEGRIP 0xFFFFFFF9
#define OBJID_CARET 0xFFFFFFF8
#define OBJID_CURSOR 0xFFFFFFF7
#define OBJID_ALERT 0xFFFFFFF6
#define OBJID_SOUND 0xFFFFFFF5
#define GUI_CARETBLINKING 0x00000001
#define GUI_INMOVESIZE 0x00000002
#define GUI_INMENUMODE 0x00000004
#define GUI_SYSTEMMENUMODE 0x00000008
#define GUI_POPUPMENUMODE 0x00000010
#define WINEVENT_OUTOFCONTEXT 0x0000
#define WINEVENT_SKIPOWNTHREAD 0x0001
#define WINEVENT_SKIPOWNPROCESS 0x0002
#define WINEVENT_INCONTEXT 0x0004
#endif /* (WINVER < 0x0500) */
#if (_WIN32_WINNT < 0x0403)
typedef struct tagMOUSEINPUT {
LONG dx;
LONG dy;
DWORD mouseData;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} MOUSEINPUT,*PMOUSEINPUT;
typedef struct tagKEYBDINPUT {
WORD wVk;
WORD wScan;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} KEYBDINPUT,*PKEYBDINPUT;
typedef struct tagHARDWAREINPUT {
DWORD uMsg;
WORD wParamL;
WORD wParamH;
} HARDWAREINPUT,*PHARDWAREINPUT;
typedef struct tagINPUT {
DWORD type;
_ANONYMOUS_UNION union {
MOUSEINPUT mi;
KEYBDINPUT ki;
HARDWAREINPUT hi;
} DUMMYUNIONNAME;
} INPUT,*PINPUT,*LPINPUT;
#endif /* (_WIN32_WINNT < 0x0403) */
#if (WINVER < 0x0500)
typedef VOID (CALLBACK* WINEVENTPROC)(HWINEVENTHOOK,DWORD,HWND,LONG,LONG,DWORD,DWORD);
typedef struct tagGUITHREADINFO {
DWORD cbSize;
DWORD flags;
HWND hwndActive;
HWND hwndFocus;
HWND hwndCapture;
HWND hwndMenuOwner;
HWND hwndMoveSize;
HWND hwndCaret;
RECT rcCaret;
} GUITHREADINFO,*PGUITHREADINFO,*LPGUITHREADINFO;
#endif /* (WINVER < 0x0500) */
BOOL WINAPI BlockInput(BOOL);
#if (_WIN32_WINNT < 0x0403)
UINT WINAPI SendInput(UINT,LPINPUT,int);
#endif
#if (WINVER < 0x0500)
BOOL WINAPI GetGUIThreadInfo(DWORD,LPGUITHREADINFO);
void WINAPI NotifyWinEvent(DWORD,HWND,LONG,LONG);
HWINEVENTHOOK WINAPI SetWinEventHook(UINT,UINT,HMODULE,WINEVENTPROC,DWORD,DWORD,UINT);
BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK);
#endif /* (WINVER < 0x0500) */
#ifdef __cplusplus
}
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">2083</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUILabel</string>
<string>IBUITableView</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUITableView" id="432350604">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{10, 78}, {300, 450}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:392</string>
<object class="NSColor" key="IBUIBackgroundColor" id="534611424">
<int key="NSColorSpace">2</int>
<bytes key="NSRGB">MC45ODAzOTIyMTc2IDAuOTUyOTQxMjM4OSAwLjkzNzI1NDk2NTMAA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">5</int>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIAlwaysBounceVertical">YES</bool>
<bool key="IBUIScrollEnabled">NO</bool>
<bool key="IBUIShowsHorizontalScrollIndicator">NO</bool>
<bool key="IBUIShowsVerticalScrollIndicator">NO</bool>
<int key="IBUIStyle">1</int>
<int key="IBUISeparatorStyle">2</int>
<int key="IBUISectionIndexMinimumDisplayRowCount">6</int>
<bool key="IBUIAllowsSelection">NO</bool>
<float key="IBUIRowHeight">44</float>
<float key="IBUISectionHeaderHeight">10</float>
<float key="IBUISectionFooterHeight">10</float>
</object>
<object class="IBUILabel" id="873980553">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">290</int>
<string key="NSFrame">{{0, 12}, {320, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Limit upload:</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">14</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">14</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 548}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="873980553"/>
<reference key="IBUIBackgroundColor" ref="534611424"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
<int key="IBUIBarStyle">2</int>
<bool key="IBUIPrompted">NO</bool>
</object>
<object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics">
<string key="IBUISimulatedSizeMetricsClass">IBUIScreenMetrics</string>
<object class="NSMutableDictionary" key="IBUINormalizedOrientationToSizeMap">
<bool key="EncodedWithXMLCoder">YES</bool>
<array key="dict.sortedKeys">
<integer value="1"/>
<integer value="3"/>
</array>
<array key="dict.values">
<string>{320, 568}</string>
<string>{568, 320}</string>
</array>
</object>
<string key="IBUITargetRuntime">IBCocoaTouchFramework</string>
<string key="IBUIDisplayName">Retina 4 Full Screen</string>
<int key="IBUIType">2</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">detailsPictureTable</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="432350604"/>
</object>
<int key="connectionID">18</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">labelLimitUpload</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="873980553"/>
</object>
<int key="connectionID">26</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="432350604"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">20</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="432350604"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">21</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<reference ref="432350604"/>
<reference ref="873980553"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="432350604"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="873980553"/>
<reference key="parent" ref="191373211"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">PhotoViewController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">27</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">GAITrackedViewController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/GAITrackedViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">PhotoViewController</string>
<string key="superclassName">GAITrackedViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="detailsPictureTable">UITableView</string>
<string key="labelLimitUpload">UILabel</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="detailsPictureTable">
<string key="name">detailsPictureTable</string>
<string key="candidateClassName">UITableView</string>
</object>
<object class="IBToOneOutletInfo" key="labelLimitUpload">
<string key="name">labelLimitUpload</string>
<string key="candidateClassName">UILabel</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/PhotoViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>
|
{
"pile_set_name": "Github"
}
|
import React from 'react';
import renderer from 'react-test-renderer';
import View from '../../src/components/View';
it('renders correctly', () => {
const tree = renderer.create(<View />).toJSON();
expect(tree).toMatchSnapshot();
});
|
{
"pile_set_name": "Github"
}
|
#IF(WIN32)
# SET(MEXEXT_CMD cmd /C mexext)
#ELSE(WIN32)
# SET(MEXEXT_CMD mexext)
#ENDIF(WIN32)
SET(MEX_NAME nearest_neighbors)
if(WIN32)
find_program(MEX_CMD mex.bat)
find_program(MEXEXT_CMD mexext.bat)
else()
find_program(MEX_CMD mex)
find_program(MEXEXT_CMD mexext)
endif()
find_program(OCT_CMD mkoctfile)
get_property(FLANN_LIB_LOCATION TARGET flann_s PROPERTY LOCATION)
get_filename_component(FLANN_LIB_PATH ${FLANN_LIB_LOCATION} PATH)
if(MEX_CMD AND MEXEXT_CMD)
get_filename_component(MEX_REAL_CMD ${MEX_CMD} ABSOLUTE)
get_filename_component(MEX_PATH ${MEX_REAL_CMD} PATH)
get_filename_component(MEXEXT_REAL_CMD ${MEXEXT_CMD} ABSOLUTE)
get_filename_component(MEXEXT_PATH ${MEXEXT_REAL_CMD} PATH)
if (MEX_PATH STREQUAL MEXEXT_PATH)
message(STATUS "Found MATLAB at: " ${MEX_PATH})
EXECUTE_PROCESS(COMMAND ${MEXEXT_REAL_CMD} OUTPUT_VARIABLE MEX_EXTENSION OUTPUT_STRIP_TRAILING_WHITESPACE)
SET(MEX_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MEX_NAME}.${MEX_EXTENSION})
if (WIN32)
if (MSVC_IDE)
set(MEX_BUILD_FLAGS "COMPFLAGS=\"$COMPFLAGS ${OpenMP_CXX_FLAGS}\" LINKFLAGS=\"$LINKFLAGS ${OpenMP_CXX_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}\"")
else()
set(MEX_BUILD_FLAGS "COMPFLAGS=\"$$COMPFLAGS ${OpenMP_CXX_FLAGS}\" LINKFLAGS=\"$$LINKFLAGS ${OpenMP_CXX_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}\"")
endif()
else()
set(MEX_BUILD_FLAGS "CFLAGS='$$CFLAGS ${OpenMP_CXX_FLAGS}' LDFLAGS='$$LDFLAGS ${OpenMP_CXX_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}'")
endif()
separate_arguments(MEX_BUILD_FLAGS)
ADD_CUSTOM_COMMAND(
OUTPUT ${MEX_FILE}
COMMAND ${MEX_REAL_CMD}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp -I${PROJECT_SOURCE_DIR}/src/cpp -L${FLANN_LIB_PATH} -lflann_s ${MEX_BUILD_FLAGS}
DEPENDS flann_s ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp
COMMENT "Building MEX extension ${MEX_FILE}"
)
ADD_CUSTOM_TARGET(mex_${MEX_NAME} ALL DEPENDS ${MEX_FILE})
FILE(GLOB MATLAB_SOURCES *.m)
INSTALL (
FILES ${MEX_FILE} ${MATLAB_SOURCES}
DESTINATION share/flann/matlab
)
else()
message(WARNING "The 'mex' and 'mexext' programs have been found in different locations. It's likely that one of them is not part of the MATLAB instalation. Make sure that the 'bin' directory from the MATLAB instalation is in PATH")
set(BUILD_MATLAB_BINDINGS OFF)
endif()
elseif(OCT_CMD)
SET(MEX_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MEX_NAME}.mex)
ADD_CUSTOM_COMMAND(
OUTPUT ${MEX_FILE}
COMMAND ${OCT_CMD}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp -I${PROJECT_SOURCE_DIR}/src/cpp -L${FLANN_LIB_PATH} -DFLANN_STATIC -lflann_s -lgomp --mex
DEPENDS flann_s ${CMAKE_CURRENT_SOURCE_DIR}/${MEX_NAME}.cpp
COMMENT "Building MEX extension ${MEX_FILE}"
)
ADD_CUSTOM_TARGET(mex_${MEX_NAME} ALL DEPENDS ${MEX_FILE})
FILE(GLOB MATLAB_SOURCES *.m)
INSTALL (
FILES ${MEX_FILE} ${MATLAB_SOURCES}
DESTINATION share/flann/octave
)
else()
message(WARNING "Cannot find MATLAB or Octave instalation. Make sure that the 'bin' directory from the MATLAB instalation or that mkoctfile is in PATH")
set(BUILD_MATLAB_BINDINGS OFF)
endif()
|
{
"pile_set_name": "Github"
}
|
#include <benchmark/benchmark.h>
#include <fp16.h>
#ifndef EMSCRIPTEN
#include <fp16/psimd.h>
#endif
#include <vector>
#include <random>
#include <chrono>
#include <functional>
#include <algorithm>
#if (defined(__i386__) || defined(__x86_64__)) && defined(__F16C__)
#include <immintrin.h>
#endif
#if defined(__ARM_NEON__) || defined(__aarch64__)
#include <arm_neon.h>
#endif
static void fp16_alt_from_fp32_value(benchmark::State& state) {
const uint_fast32_t seed = std::chrono::system_clock::now().time_since_epoch().count();
auto rng = std::bind(std::uniform_real_distribution<float>(-1.0f, 1.0f), std::mt19937(seed));
std::vector<float> fp32(state.range(0));
std::vector<uint16_t> fp16(state.range(0));
std::generate(fp32.begin(), fp32.end(), std::ref(rng));
while (state.KeepRunning()) {
float* input = fp32.data();
benchmark::DoNotOptimize(input);
uint16_t* output = fp16.data();
const size_t n = state.range(0);
for (size_t i = 0; i < n; i++) {
output[i] = fp16_alt_from_fp32_value(input[i]);
}
benchmark::DoNotOptimize(output);
}
state.SetItemsProcessed(int64_t(state.iterations()) * int64_t(state.range(0)));
}
BENCHMARK(fp16_alt_from_fp32_value)->RangeMultiplier(2)->Range(1<<10, 64<<20);
#if defined(__ARM_NEON_FP) && (__ARM_NEON_FP & 0x2) || defined(__aarch64__)
static void hardware_vcvt_f16_f32(benchmark::State& state) {
const uint_fast32_t seed = std::chrono::system_clock::now().time_since_epoch().count();
auto rng = std::bind(std::uniform_real_distribution<float>(-1.0f, 1.0f), std::mt19937(seed));
std::vector<float> fp32(state.range(0));
std::vector<uint16_t> fp16(state.range(0));
std::generate(fp32.begin(), fp32.end(), std::ref(rng));
while (state.KeepRunning()) {
float* input = fp32.data();
benchmark::DoNotOptimize(input);
uint16_t* output = fp16.data();
const size_t n = state.range(0);
#if defined(__aarch64__)
const unsigned int fpcr = __builtin_aarch64_get_fpcr();
/* Disable flush-to-zero (bit 24) and enable Alternative FP16 format (bit 26) */
__builtin_aarch64_set_fpcr((fpcr & 0xFEFFFFFFu) | 0x08000000u);
#else
unsigned int fpscr;
__asm__ __volatile__ ("VMRS %[fpscr], fpscr" : [fpscr] "=r" (fpscr));
/* Disable flush-to-zero (bit 24) and enable Alternative FP16 format (bit 26) */
__asm__ __volatile__ ("VMSR fpscr, %[fpscr]" :
: [fpscr] "r" ((fpscr & 0xFEFFFFFFu) | 0x08000000u));
#endif
for (size_t i = 0; i < n; i += 4) {
vst1_u16(&output[i],
(uint16x4_t) vcvt_f16_f32(
vld1q_f32(&input[i])));
}
#if defined(__aarch64__)
__builtin_aarch64_set_fpcr(fpcr);
#else
__asm__ __volatile__ ("VMSR fpscr, %[fpscr]" :: [fpscr] "r" (fpscr));
#endif
benchmark::DoNotOptimize(output);
}
state.SetItemsProcessed(int64_t(state.iterations()) * int64_t(state.range(0)));
}
BENCHMARK(hardware_vcvt_f16_f32)->RangeMultiplier(2)->Range(1<<10, 64<<20);
#endif
BENCHMARK_MAIN();
|
{
"pile_set_name": "Github"
}
|
#######################################################################################################################################
#######################################################################################################################################
## THIS SCRIPT CUSTOMIZES THE DSVM BY ADDING HADOOP AND YARN, INSTALLING R-PACKAGES, AND DOWNLOADING DATA-SETS FOR STRATA
## SAN JOSE 2017 EXERCISES.
#######################################################################################################################################
#######################################################################################################################################
#!/bin/bash
source /etc/profile.d/hadoop.sh
#PATH=paste0(Sys.getenv("PATH"),":/opt/hadoop/current/bin:/dsvm/tools/spark/current/bin")
#######################################################################################################################################
## Setup autossh for hadoop service account
#######################################################################################################################################
#cat /opt/hadoop/.ssh/id_rsa.pub >> /opt/hadoop/.ssh/authorized_keys
#chmod 0600 /opt/hadoop/.ssh/authorized_keys
#chown hadoop /opt/hadoop/.ssh/authorized_keys
echo -e 'y\n' | ssh-keygen -t rsa -P '' -f ~hadoop/.ssh/id_rsa
cat ~hadoop/.ssh/id_rsa.pub >> ~hadoop/.ssh/authorized_keys
chmod 0600 ~hadoop/.ssh/authorized_keys
chown hadoop:hadoop ~hadoop/.ssh/id_rsa
chown hadoop:hadoop ~hadoop/.ssh/id_rsa.pub
chown hadoop:hadoop ~hadoop/.ssh/authorized_keys
#######################################################################################################################################
## Start up several services, yarn, hadoop, rstudio server
#######################################################################################################################################
systemctl start hadoop-namenode hadoop-datanode hadoop-yarn rstudio-server
#######################################################################################################################################
## MRS Deploy Setup
#######################################################################################################################################
cd /home/remoteuser
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Scripts/backend_appsettings.json
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Scripts/webapi_appsettings.json
mv backend_appsettings.json /usr/lib64/microsoft-deployr/9.0.1/Microsoft.DeployR.Server.BackEnd/appsettings.json
mv webapi_appsettings.json /usr/lib64/microsoft-deployr/9.0.1/Microsoft.DeployR.Server.WebAPI/appsettings.json
cp /usr/lib64/microsoft-deployr/9.0.1/Microsoft.DeployR.Server.WebAPI/autoStartScriptsLinux/* /etc/systemd/system/.
cp /usr/lib64/microsoft-deployr/9.0.1/Microsoft.DeployR.Server.BackEnd/autoStartScriptsLinux/* /etc/systemd/system/.
systemctl enable frontend
systemctl enable rserve
systemctl enable backend
systemctl start frontend
systemctl start rserve
systemctl start backend
#######################################################################################################################################
# Copy data and code to VM
#######################################################################################################################################
# Copy Spark configuration files & shell script
cd /home/remoteuser
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Scripts/spark-defaults.conf
mv spark-defaults.conf /dsvm/tools/spark/current/conf
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Scripts/log4j.properties
mv log4j.properties /dsvm/tools/spark/current/conf
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Scripts/DSVM_Customization_Script.sh
## DOWNLOAD ALL CODE FILES
cd /home/remoteuser
mkdir Data Code
mkdir Code/MRS Code/sparklyr Code/SparkR Code/bigmemory Code/ff Code/UseCaseHTS Code/UseCaseLearningCurves
cd /home/remoteuser
cd Code/MRS
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/MRS/1-Clean-Join-Subset.r
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/MRS/2-Train-Test-Subset.r
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/MRS/3-Deploy-Score-mrsdeploy.r
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/MRS/SetComputeContext.r
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/MRS/logitModelSubset.RData
cd /home/remoteuser
cd Code/SparkR
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/SparkR/SparkR_NYCTaxi_forDSVM.Rmd
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/SparkR/SparkR_NYCTaxi_forDSVM.html
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/SparkR/Operationalization_RemoteAccessAPI_forDSVM.R
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/SparkR/SparkR_GLM_Operationalization_forDSVM.R
cd /home/remoteuser
cd Code/sparklyr
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/sparklyr/sparklyr_NYCTaxi_forDSVM.Rmd
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/sparklyr/sparklyr_NYCTaxi_forDSVM.html
cd /home/remoteuser
cd Code/bigmemory
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/bigmemory/bigmemory.R
cd /home/remoteuser
cd Code/ff
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/ff/ff.R
cd /home/remoteuser
cd Code/UseCaseHTS
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/UseCaseHTS/sample_demo.R
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/UseCaseHTS/sample_demo.Rmd
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/UseCaseHTS/aust_hierarchy.png
cd /home/remoteuser
cd Code/UseCaseLearningCurves
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/UseCaseLearningCurves/high_cardinality_learning_curves_demo.Rmd
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Code/UseCaseLearningCurves/learning_curve_lib.R
## DOWNLOAD ALL DATA FILES
# NYC Taxi data
cd /home/remoteuser
cd Data
wget http://cdspsparksamples.blob.core.windows.net/data/NYCTaxi/KDD2016/trip_fare_12.csv
wget http://cdspsparksamples.blob.core.windows.net/data/NYCTaxi/KDD2016/trip_data_12.csv
wget http://cdspsparksamples.blob.core.windows.net/data/NYCTaxi/KDD2016/JoinedParquetSampledFile.tar.gz
gunzip JoinedParquetSampledFile.tar.gz
tar -xvf JoinedParquetSampledFile.tar
mv JoinedParquetSampledFile NYCjoinedParquetSubset
rm JoinedParquetSampledFile.tar
wget http://cdspsparksamples.blob.core.windows.net/data/NYCTaxi/FareData2013DecParquet.tar
wget http://cdspsparksamples.blob.core.windows.net/data/NYCTaxi/TripData2013DecParquet.tar
tar -xvf FareData2013DecParquet.tar
tar -xvf TripData2013DecParquet.tar
rm FareData2013DecParquet.tar
rm TripData2013DecParquet.tar
# Airline data
wget http://cdspsparksamples.blob.core.windows.net/data/Airline/WeatherSubsetCsv.tar.gz
wget http://cdspsparksamples.blob.core.windows.net/data/Airline/AirlineSubsetCsv.tar.gz
gunzip WeatherSubsetCsv.tar.gz
gunzip AirlineSubsetCsv.tar.gz
tar -xvf WeatherSubsetCsv.tar
tar -xvf AirlineSubsetCsv.tar
rm WeatherSubsetCsv.tar AirlineSubsetCsv.tar
cd /home/remoteuser
cd Data
wget http://strata2017r.blob.core.windows.net/airline/airline_20MM.csv
## Copy data to HDFS
cd /home/remoteuser
cd Data
# Make hdfs directories and copy things over to HDFS
/opt/hadoop/current/bin/hadoop fs -mkdir /user/RevoShare/rserve2
/opt/hadoop/current/bin/hadoop fs -mkdir /user/RevoShare/rserve2/Predictions
/opt/hadoop/current/bin/hadoop fs -chmod -R 777 /user/RevoShare/rserve2
/opt/hadoop/current/bin/hadoop fs -mkdir /user/RevoShare/remoteuser
/opt/hadoop/current/bin/hadoop fs -mkdir /user/RevoShare/remoteuser/Data
/opt/hadoop/current/bin/hadoop fs -mkdir /user/RevoShare/remoteuser/Models
/opt/hadoop/current/bin/hadoop fs -copyFromLocal * /user/RevoShare/remoteuser/Data
#######################################################################################################################################
#######################################################################################################################################
# Install R packages
cd /home/remoteuser
wget https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/StrataSanJose2017/Scripts/InstallPackages.R
cd /usr/bin
Revo64-9.0 --vanilla --quiet < /home/remoteuser/InstallPackages.R
#######################################################################################################################################
#######################################################################################################################################
## Change ownership of some of directories
cd /home/remoteuser
chown -R remoteuser Code Data
su hadoop -c "/opt/hadoop/current/bin/hadoop fs -chown -R remoteuser /user/RevoShare/rserve2"
su hadoop -c "/opt/hadoop/current/bin/hadoop fs -chown -R remoteuser /user/RevoShare/remoteuser"
#######################################################################################################################################
#######################################################################################################################################
## END
#######################################################################################################################################
#######################################################################################################################################
|
{
"pile_set_name": "Github"
}
|
--TEST--
gethostbyname() function - basic type return error test
--CREDITS--
"Sylvain R." <sracine@phpquebec.org>
--FILE--
<?php
var_dump(is_string(gethostbyname("192.168.0.101")));
?>
--EXPECT--
bool(true)
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
</head>
<body>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/**
* Module dependencies.
*/
var utils = require('./utils');
/**
* Initialization middleware, exposing the
* request and response to eachother, as well
* as defaulting the X-Powered-By header field.
*
* @param {Function} app
* @return {Function}
* @api private
*/
exports.init = function(app){
return function expressInit(req, res, next){
if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
req.res = res;
res.req = req;
req.next = next;
req.__proto__ = app.request;
res.__proto__ = app.response;
res.locals = res.locals || utils.locals(res);
next();
}
};
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\BuildInfo\Microsoft.VisualStudio.ReleaseManagement.BuildInfo.targets" Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\BuildInfo\Microsoft.VisualStudio.ReleaseManagement.BuildInfo.targets')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{68411661-4B0C-444A-BC13-2182FBB116B9}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PartsUnlimited</RootNamespace>
<AssemblyName>PartsUnlimited</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<TargetFrameworkProfile />
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<UseGlobalApplicationHostFile />
<Use64BitIISExpress />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE;DEBUG;DEMO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.EntityFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Owin, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.SignalR.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.SignalR.Core.2.2.2\lib\net45\Microsoft.AspNet.SignalR.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.SignalR.Owin, Version=1.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.SignalR.Owin.1.2.2\lib\net45\Microsoft.AspNet.SignalR.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.SignalR.SystemWeb, Version=2.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.SignalR.SystemWeb.2.2.2\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.Cookies, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.Cookies.3.1.0\lib\net45\Microsoft.Owin.Security.Cookies.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.Facebook, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.Facebook.3.1.0\lib\net45\Microsoft.Owin.Security.Facebook.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.Google, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.Google.3.1.0\lib\net45\Microsoft.Owin.Security.Google.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.MicrosoftAccount, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.MicrosoftAccount.3.1.0\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.OAuth, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.3.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security.Twitter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.Twitter.3.1.0\lib\net45\Microsoft.Owin.Security.Twitter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity.RegistrationByConvention, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
<HintPath>..\packages\Swashbuckle.Core.5.6.0\lib\net40\Swashbuckle.Core.dll</HintPath>
</Reference>
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Runtime.Caching" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Unity.Mvc4, Version=1.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.Mvc4.1.6.0.0\lib\net45\Unity.Mvc4.dll</HintPath>
</Reference>
<Reference Include="Unity.WebApi, Version=5.2.3.0, Culture=neutral, PublicKeyToken=43da31bc42a85347, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.WebAPI.5.2.3\lib\net45\Unity.WebApi.dll</HintPath>
</Reference>
<Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
<HintPath>..\packages\WebActivatorEx.2.0\lib\net40\WebActivatorEx.dll</HintPath>
</Reference>
<Reference Include="WebGrease, Version=1.6.5135.21930, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="Areas\Admin\Views\Customer\Find.cshtml" />
<Content Include="Areas\Admin\Views\Customer\Index.cshtml" />
<Content Include="Areas\Admin\Views\Orders\Details.cshtml" />
<Content Include="Areas\Admin\Views\Orders\Index.cshtml" />
<Content Include="Areas\Admin\Views\Raincheck\Index.cshtml" />
<Content Include="Areas\Admin\Views\StoreManager\Create.cshtml" />
<Content Include="Areas\Admin\Views\StoreManager\Details.cshtml" />
<Content Include="Areas\Admin\Views\StoreManager\Edit.cshtml" />
<Content Include="Areas\Admin\Views\StoreManager\Index.cshtml" />
<Content Include="Areas\Admin\Views\StoreManager\RemoveProduct.cshtml" />
<Content Include="Areas\Admin\Views\_ViewStart.cshtml" />
<Content Include="Content\Account.css">
<DependentUpon>Account.scss</DependentUpon>
</Content>
<Content Include="Content\Account.min.css">
<DependentUpon>Account.css</DependentUpon>
</Content>
<Content Include="Content\bootstrap-theme.css" />
<Content Include="Content\bootstrap-theme.min.css" />
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
<Content Include="Content\Home.css">
<DependentUpon>Home.scss</DependentUpon>
</Content>
<Content Include="Content\Home.min.css">
<DependentUpon>Home.css</DependentUpon>
</Content>
<Content Include="Content\jquery-ui.css" />
<Content Include="Content\ShoppingCart.css">
<DependentUpon>ShoppingCart.scss</DependentUpon>
</Content>
<Content Include="Content\ShoppingCart.min.css">
<DependentUpon>ShoppingCart.css</DependentUpon>
</Content>
<Content Include="Content\Site.css">
<DependentUpon>Site.scss</DependentUpon>
</Content>
<Content Include="Content\Site.min.css">
<DependentUpon>Site.css</DependentUpon>
</Content>
<Content Include="Content\Store.css">
<DependentUpon>Store.scss</DependentUpon>
</Content>
<Content Include="Content\Store.min.css">
<DependentUpon>Store.css</DependentUpon>
</Content>
<Content Include="Content\themes\base\accordion.css" />
<Content Include="Content\themes\base\all.css" />
<Content Include="Content\themes\base\autocomplete.css" />
<Content Include="Content\themes\base\base.css" />
<Content Include="Content\themes\base\button.css" />
<Content Include="Content\themes\base\core.css" />
<Content Include="Content\themes\base\datepicker.css" />
<Content Include="Content\themes\base\dialog.css" />
<Content Include="Content\themes\base\draggable.css" />
<Content Include="Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
<Content Include="Content\themes\base\images\ui-bg_flat_75_ffffff_40x100.png" />
<Content Include="Content\themes\base\images\ui-bg_glass_55_fbf9ee_1x400.png" />
<Content Include="Content\themes\base\images\ui-bg_glass_65_ffffff_1x400.png" />
<Content Include="Content\themes\base\images\ui-bg_glass_75_dadada_1x400.png" />
<Content Include="Content\themes\base\images\ui-bg_glass_75_e6e6e6_1x400.png" />
<Content Include="Content\themes\base\images\ui-bg_glass_95_fef1ec_1x400.png" />
<Content Include="Content\themes\base\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
<Content Include="Content\themes\base\images\ui-icons_222222_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_2e83ff_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_444444_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_454545_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_555555_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_777620_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_777777_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_888888_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_cc0000_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_cd0a0a_256x240.png" />
<Content Include="Content\themes\base\images\ui-icons_ffffff_256x240.png" />
<Content Include="Content\themes\base\jquery-ui.css" />
<Content Include="Content\themes\base\jquery-ui.min.css" />
<Content Include="Content\themes\base\menu.css" />
<Content Include="Content\themes\base\progressbar.css" />
<Content Include="Content\themes\base\resizable.css" />
<Content Include="Content\themes\base\selectable.css" />
<Content Include="Content\themes\base\selectmenu.css" />
<Content Include="Content\themes\base\slider.css" />
<Content Include="Content\themes\base\sortable.css" />
<Content Include="Content\themes\base\spinner.css" />
<Content Include="Content\themes\base\tabs.css" />
<Content Include="Content\themes\base\theme.css" />
<Content Include="Content\themes\base\tooltip.css" />
<Content Include="fonts\glyphicons-halflings-regular.svg" />
<Content Include="Global.asax" />
<Content Include="Areas\Admin\Views\Web.config" />
<Content Include="Content\Account.scss" />
<Content Include="Content\Home.scss" />
<Content Include="Content\ShoppingCart.scss" />
<Content Include="Content\Site.scss" />
<Content Include="Content\Store.scss" />
<Content Include="Content\_Settings.scss" />
<Content Include="Content\Store.css.map">
<DependentUpon>Store.css</DependentUpon>
</Content>
<Content Include="Content\Site.css.map">
<DependentUpon>Site.css</DependentUpon>
</Content>
<Content Include="Content\ShoppingCart.css.map">
<DependentUpon>ShoppingCart.css</DependentUpon>
</Content>
<Content Include="Content\Home.css.map">
<DependentUpon>Home.css</DependentUpon>
</Content>
<Content Include="Content\Account.css.map">
<DependentUpon>Account.css</DependentUpon>
</Content>
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
<Content Include="fonts\glyphicons-halflings-regular.woff" />
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
<Content Include="fonts\glyphicons-halflings-regular.eot" />
<Content Include="Content\bootstrap.min.css.map" />
<Content Include="Content\bootstrap.css.map" />
<Content Include="Content\bootstrap-theme.min.css.map" />
<Content Include="Content\bootstrap-theme.css.map" />
<AdditionalFiles Include="..\..\PartsUnlimited.DepValidation\DependencyValidation1.layerdiagram">
<Link>DependencyValidation1.layerdiagram</Link>
<Visible>False</Visible>
</AdditionalFiles>
<None Include="Properties\PublishProfiles\BartPartsUnlimited - Web Deploy.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<None Include="Properties\PublishProfiles\partsunlimited-vcurrent.pubxml" />
<None Include="Properties\PublishProfiles\partsunlimitedcus07.pubxml" />
<Content Include="Images\admin_icon.png" />
<Content Include="Images\admin_mo_icon.png" />
<Content Include="Images\cart_icon.png" />
<Content Include="Images\cart_mo_icon.png" />
<Content Include="Images\community_1.png" />
<Content Include="Images\community_2.png" />
<Content Include="Images\community_3.png" />
<Content Include="Images\community_4.png" />
<Content Include="Images\deploy_button.png" />
<Content Include="Images\facebook_icon.jpg" />
<Content Include="Images\hero_image1.jpg" />
<Content Include="Images\hero_image2.jpg" />
<Content Include="Images\hero_image3.jpg" />
<Content Include="Images\home_icon.png" />
<Content Include="Images\home_mo_icon.png" />
<Content Include="Images\login_profile_icon.png" />
<Content Include="Images\login_safe_icon.png" />
<Content Include="Images\mobile_search_icon.png" />
<Content Include="Images\product_batteries_basic-battery.jpg" />
<Content Include="Images\product_batteries_jumper-leads.jpg" />
<Content Include="Images\product_batteries_premium-battery.jpg" />
<Content Include="Images\product_brakes_disc-calipers-red.jpg" />
<Content Include="Images\product_brakes_disc.jpg" />
<Content Include="Images\product_brakes_disk-pad-combo.jpg" />
<Content Include="Images\product_lighting_bugeye-headlight.jpg" />
<Content Include="Images\product_lighting_headlight.jpg" />
<Content Include="Images\product_lighting_lightbulb.jpg" />
<Content Include="Images\product_oil_filters.jpg" />
<Content Include="Images\product_oil_oil-filter-combo.jpg" />
<Content Include="Images\product_oil_premium-oil.jpg" />
<Content Include="Images\product_wheel_rim-blue.jpg" />
<Content Include="Images\product_wheel_rim-red.jpg" />
<Content Include="Images\product_wheel_rim.jpg" />
<Content Include="Images\product_wheel_tyre-rim-chrome-combo.jpg" />
<Content Include="Images\product_wheel_tyre-wheel-combo-pack.jpg" />
<Content Include="Images\product_wheel_tyre-wheel-combo.jpg" />
<Content Include="Images\profile_icon.png" />
<Content Include="Images\profile_mo_icon.png" />
<Content Include="Images\remove_icon.png" />
<Content Include="Images\search_icon.png" />
<Content Include="Images\search_mo_icon.png" />
<Content Include="Images\shopnow_button.png" />
<Content Include="Images\social_placeholder.png" />
<Content Include="Images\submenu_image1.jpg" />
<Content Include="Images\submenu_image2.jpg" />
<Content Include="Images\submenu_image3.jpg" />
<Content Include="Images\submenu_image4.jpg" />
<Content Include="Images\unlimited_logo.png" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<None Include="Scripts\jquery-3.2.1.intellisense.js" />
<Content Include="Scripts\jquery-3.2.1.js" />
<Content Include="Scripts\jquery-3.2.1.min.js" />
<Content Include="Scripts\jquery-3.2.1.slim.js" />
<Content Include="Scripts\jquery-3.2.1.slim.min.js" />
<Content Include="Scripts\jquery-ui-1.12.1.js" />
<Content Include="Scripts\jquery-ui-1.12.1.min.js" />
<Content Include="Scripts\jquery-3.2.1.slim.min.map" />
<Content Include="Scripts\jquery-3.2.1.min.map" />
<None Include="Scripts\jquery.validate-vsdoc.js" />
<Content Include="Scripts\jquery.signalR-2.2.2.js" />
<Content Include="Scripts\jquery.signalR-2.2.2.min.js" />
<Content Include="Scripts\jquery.validate.js" />
<Content Include="Scripts\jquery.validate.min.js" />
<Content Include="Scripts\jquery.validate.unobtrusive.js" />
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
<Content Include="Scripts\jquery.zoom.js" />
<Content Include="Scripts\jquery.zoom.min.js" />
<Content Include="Scripts\modernizr-2.8.3.js" />
<Content Include="Scripts\respond.js" />
<Content Include="Scripts\respond.matchmedia.addListener.js" />
<Content Include="Scripts\respond.matchmedia.addListener.min.js" />
<Content Include="Scripts\respond.min.js" />
<Content Include="Unity.Mvc4.README.txt" />
<Content Include="Views\Account\ConfirmEmail.cshtml" />
<Content Include="Views\Account\ExternalLoginConfirmation.cshtml" />
<Content Include="Views\Account\ExternalLoginFailure.cshtml" />
<Content Include="Views\Account\ForgotPassword.cshtml" />
<Content Include="Views\Account\ForgotPasswordConfirmation.cshtml" />
<Content Include="Views\Account\Login.cshtml" />
<Content Include="Views\Account\Register.cshtml" />
<Content Include="Views\Account\RegisterConfirmation.cshtml" />
<Content Include="Views\Account\ResetPassword.cshtml" />
<Content Include="Views\Account\ResetPasswordConfirmation.cshtml" />
<Content Include="Views\Account\SendCode.cshtml" />
<Content Include="Views\Account\VerifyCode.cshtml" />
<Content Include="Views\Account\_ExternalLoginsListPartial.cshtml" />
<Content Include="Views\Checkout\AddressAndPayment.cshtml" />
<Content Include="Views\Checkout\Complete.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\Manage\AddPhoneNumber.cshtml" />
<Content Include="Views\Manage\ChangePassword.cshtml" />
<Content Include="Views\Manage\Index.cshtml" />
<Content Include="Views\Manage\ManageLogins.cshtml" />
<Content Include="Views\Manage\SetPassword.cshtml" />
<Content Include="Views\Manage\VerifyPhoneNumber.cshtml" />
<Content Include="Views\Orders\Details.cshtml" />
<Content Include="Views\Orders\Index.cshtml" />
<Content Include="Views\Search\Index.cshtml" />
<Content Include="Views\Shared\_Announcement.cshtml" />
<Content Include="Views\Shared\_CartSummary.cshtml" />
<Content Include="Views\Shared\_CategoryMenu.cshtml" />
<Content Include="Views\Shared\DemoLinkDisplay.cshtml" />
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\Lockout.cshtml" />
<Content Include="Views\Shared\_AdminMenu.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="Views\Shared\_Login.cshtml" />
<Content Include="Views\Shared\_Order.cshtml" />
<Content Include="Views\Shared\_OrdersSearch.cshtml" />
<Content Include="Views\Shared\_ProductList.cshtml" />
<Content Include="Views\Shared\_Recommendations.cshtml" />
<Content Include="Views\ShoppingCart\Index.cshtml" />
<Content Include="Views\Store\Browse.cshtml" />
<Content Include="Views\Store\Details.cshtml" />
<Content Include="Views\Store\Index.cshtml" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="packages.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Views\Web.config" />
<Content Include="Views\Shared\_CommunityList.cshtml" />
<Content Include="Views\Shared\_OrderCostSummary.cshtml" />
<Content Include="Views\Home\Recomendations.cshtml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Scripts\AppInsights.js" />
<Content Include="Scripts\NewStoreArrivals.js" />
<Content Include="Scripts\Recommendations.js" />
<Content Include="Scripts\UI-Initialization.js" />
<None Include="Scripts\_references.js" />
<Content Include="Web.config" />
<Content Include="favicon.ico" />
</ItemGroup>
<ItemGroup>
<Compile Include="Api\ProductsController.cs" />
<Compile Include="Api\RaincheckController.cs" />
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\IdentityConfig.cs" />
<Compile Include="App_Start\Startup.Auth.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\SwaggerConfig.cs" />
<Compile Include="App_Start\UnityConfig.cs" />
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Areas\Admin\AdminAreaRegistration.cs" />
<Compile Include="Areas\Admin\AdminConstants.cs" />
<Compile Include="Areas\Admin\Controllers\AdminController.cs" />
<Compile Include="Areas\Admin\Controllers\CustomerController.cs" />
<Compile Include="Areas\Admin\Controllers\OrdersController.cs" />
<Compile Include="Areas\Admin\Controllers\RaincheckController.cs" />
<Compile Include="Areas\Admin\Controllers\StoreManagerController.cs" />
<Compile Include="Bootstrapper.cs" />
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\CheckoutController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ManageController.cs" />
<Compile Include="Controllers\OrdersController.cs" />
<Compile Include="Controllers\RecommendationsController.cs" />
<Compile Include="Controllers\SearchController.cs" />
<Compile Include="Controllers\ShoppingCartController.cs" />
<Compile Include="Controllers\StoreController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Hubs\AnnouncementHub.cs" />
<Compile Include="Models\CommunityPost.cs" />
<Compile Include="Models\ILineItem.cs" />
<Compile Include="Models\OrderCostSummary.cs" />
<Compile Include="Utils\DefaultShippingTaxCalculator.cs" />
<Compile Include="Utils\IShippingTaxCalculator.cs" />
<Compile Include="Utils\LayoutDataAttribute.cs" />
<Compile Include="Utils\PartsUnlimitedDbInitializer.cs" />
<Compile Include="Models\AccountViewModels.cs" />
<Compile Include="Models\ApplicationUser.cs" />
<Compile Include="Models\CartItem.cs" />
<Compile Include="Models\Category.cs" />
<Compile Include="Models\IPartsUnlimitedContext.cs" />
<Compile Include="Models\ManageViewModels.cs" />
<Compile Include="Models\Manufacturer.cs" />
<Compile Include="Models\Order.cs" />
<Compile Include="Models\OrderDetail.cs" />
<Compile Include="Models\PartsUnlimitedContext.cs" />
<Compile Include="Models\Product.cs" />
<Compile Include="Models\Raincheck.cs" />
<Compile Include="Models\ShoppingCart.cs" />
<Compile Include="Models\Store.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Recommendations\AzureMLFrequentlyBoughtTogetherRecommendationEngine.cs" />
<Compile Include="Recommendations\IRecommendationEngine.cs" />
<Compile Include="Recommendations\NaiveRecommendationEngine.cs" />
<Compile Include="ProductSearch\IProductSearch.cs" />
<Compile Include="ProductSearch\StringContainsProductSearch.cs" />
<Compile Include="Security\ConfigurationLoginProviderCredentials.cs" />
<Compile Include="Security\ConfigurationLoginProviders.cs" />
<Compile Include="Security\ILoginProviderCredentials.cs" />
<Compile Include="Security\ILoginProviders.cs" />
<Compile Include="Startup.cs" />
<Compile Include="Utils\ConfigurationHelpers.cs" />
<Compile Include="Utils\HtmlHelperExtensions.cs" />
<Compile Include="Utils\HttpClientWrapper.cs" />
<Compile Include="Utils\IHttpClient.cs" />
<Compile Include="Utils\IOrdersQuery.cs" />
<Compile Include="Utils\IRaincheckQuery.cs" />
<Compile Include="Utils\ITelemetryProvider.cs" />
<Compile Include="Utils\OrdersQuery.cs" />
<Compile Include="Utils\PartsUnlimitedTelemetryInitializer.cs" />
<Compile Include="Utils\RaincheckQuery.cs" />
<Compile Include="Utils\SignalRDependencyResolver.cs" />
<Compile Include="Utils\TelemetryProvider.cs" />
<Compile Include="ViewModels\AlbumData.cs" />
<Compile Include="ViewModels\EditProductViewModel.cs" />
<Compile Include="ViewModels\HomeViewModel.cs" />
<Compile Include="ViewModels\OrderDetailsViewModel.cs" />
<Compile Include="ViewModels\OrdersModel.cs" />
<Compile Include="ViewModels\ProductViewModel.cs" />
<Compile Include="ViewModels\ShoppingCartRemoveViewModel.cs" />
<Compile Include="ViewModels\ShoppingCartViewModel.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>52714</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:5001/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
|
{
"pile_set_name": "Github"
}
|
<?php
namespace {
const Y = 1;
}
namespace Y\X{
echo E_ALL;
echo null;
echo true;
ANOTHER_CONSTANT;
echo Y;
}
?>
|
{
"pile_set_name": "Github"
}
|
# vim:fileencoding=utf-8:ft=conf:foldmethod=marker
# !!COL!{name}! color scheme for Kitty
#: Color scheme {{{
#: The foreground and background colors
foreground !!COL!{fg_0.srgb}!
background !!COL!{bg_0.srgb}!
#: The opacity of the background. A number between 0 and 1, where 1 is
#: opaque and 0 is fully transparent. This will only work if
#: supported by the OS (for instance, when using a compositor under
#: X11). Note that it only sets the default background color's
#: opacity. This is so that things like the status bar in vim,
#: powerline prompts, etc. still look good. But it means that if you
#: use a color theme with a background color in your editor, it will
#: not be rendered as transparent. Instead you should change the
#: default background color in your kitty config and not use a
#: background color in the editor color scheme. Or use the escape
#: codes to set the terminals default colors in a shell script to
#: launch your editor. Be aware that using a value less than 1.0 is a
#: (possibly significant) performance hit. If you want to dynamically
#: change transparency of windows set dynamic_background_opacity to
#: yes (this is off by default as it has a performance cost)
background_opacity 1.0
#: Allow changing of the background_opacity dynamically, using either
#: keyboard shortcuts (increase_background_opacity and
#: decrease_background_opacity) or the remote control facility.
dynamic_background_opacity no
#: How much to dim text that has the DIM/FAINT attribute set. One
#: means no dimming and zero means fully dimmed (i.e. invisible).
dim_opacity 0.625
#: The foreground for text selected with the mouse. A value of none
#: means to leave the color unchanged.
selection_foreground none
#: The background for text selected with the mouse.
selection_background !!COL!{bg_2.srgb}!
#: Tab bar colors
active_tab_foreground !!COL!{fg_1.srgb}!
active_tab_background !!COL!{bg_2.srgb}!
inactive_tab_foreground !!COL!{dim_0.srgb}!
inactive_tab_background !!COL!{bg_0.srgb}!
tab_bar_background !!COL!{bg_0.srgb}!
#: The 16 terminal colors. There are 8 basic colors, each color has a
#: dull and bright version. You can also set the remaining colors from
#: the 256 color table as color16 to color255.
#: black
color0 !!COL!{bg_1.srgb}!
color8 !!COL!{bg_2.srgb}!
#: red
color1 !!COL!{red.srgb}!
color9 !!COL!{br_red.srgb}!
#: green
color2 !!COL!{green.srgb}!
color10 !!COL!{br_green.srgb}!
#: yellow
color3 !!COL!{yellow.srgb}!
color11 !!COL!{br_yellow.srgb}!
#: blue
color4 !!COL!{blue.srgb}!
color12 !!COL!{br_blue.srgb}!
#: magenta
color5 !!COL!{magenta.srgb}!
color13 !!COL!{br_magenta.srgb}!
#: cyan
color6 !!COL!{cyan.srgb}!
color14 !!COL!{br_cyan.srgb}!
#: white
color7 !!COL!{dim_0.srgb}!
color15 !!COL!{fg_1.srgb}!
#: }}}
|
{
"pile_set_name": "Github"
}
|
#ifndef __MJExtensionConst__H__
#define __MJExtensionConst__H__
#import <Foundation/Foundation.h>
// 过期
#define MJExtensionDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead)
// 构建错误
#define MJExtensionBuildError(clazz, msg) \
NSError *error = [NSError errorWithDomain:msg code:250 userInfo:nil]; \
[clazz setMj_error:error];
// 日志输出
#ifdef DEBUG
#define MJExtensionLog(...) NSLog(__VA_ARGS__)
#else
#define MJExtensionLog(...)
#endif
/**
* 断言
* @param condition 条件
* @param returnValue 返回值
*/
#define MJExtensionAssertError(condition, returnValue, clazz, msg) \
[clazz setMj_error:nil]; \
if ((condition) == NO) { \
MJExtensionBuildError(clazz, msg); \
return returnValue;\
}
#define MJExtensionAssert2(condition, returnValue) \
if ((condition) == NO) return returnValue;
/**
* 断言
* @param condition 条件
*/
#define MJExtensionAssert(condition) MJExtensionAssert2(condition, )
/**
* 断言
* @param param 参数
* @param returnValue 返回值
*/
#define MJExtensionAssertParamNotNil2(param, returnValue) \
MJExtensionAssert2((param) != nil, returnValue)
/**
* 断言
* @param param 参数
*/
#define MJExtensionAssertParamNotNil(param) MJExtensionAssertParamNotNil2(param, )
/**
* 打印所有的属性
*/
#define MJLogAllIvars \
-(NSString *)description \
{ \
return [self mj_keyValues].description; \
}
#define MJExtensionLogAllProperties MJLogAllIvars
/**
* 类型(属性类型)
*/
extern NSString *const MJPropertyTypeInt;
extern NSString *const MJPropertyTypeShort;
extern NSString *const MJPropertyTypeFloat;
extern NSString *const MJPropertyTypeDouble;
extern NSString *const MJPropertyTypeLong;
extern NSString *const MJPropertyTypeLongLong;
extern NSString *const MJPropertyTypeChar;
extern NSString *const MJPropertyTypeBOOL1;
extern NSString *const MJPropertyTypeBOOL2;
extern NSString *const MJPropertyTypePointer;
extern NSString *const MJPropertyTypeIvar;
extern NSString *const MJPropertyTypeMethod;
extern NSString *const MJPropertyTypeBlock;
extern NSString *const MJPropertyTypeClass;
extern NSString *const MJPropertyTypeSEL;
extern NSString *const MJPropertyTypeId;
#endif
|
{
"pile_set_name": "Github"
}
|
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html
*
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html
*
* - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* Styles used by the dialog boxes.
*/
html, body
{
background-color: transparent;
margin: 0px;
padding: 0px;
}
body
{
padding: 10px;
}
body, td, input, select, textarea
{
font-size: 11px;
font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
}
body, .BackColor
{
background-color: #f7f8fd;
}
.PopupBody
{
height: 100%;
width: 100%;
overflow: hidden;
background-color: transparent;
padding: 0px;
}
#header
{
cursor: move;
}
.PopupTitle
{
font-weight: bold;
font-size: 14pt;
color: #0e3460;
background-color: #8cb2fd;
padding: 3px 10px 3px 10px;
}
.PopupButtons
{
position: absolute;
right: 0px;
left: 0px;
bottom: 0px;
border-top: #466ca6 1px solid;
background-color: #8cb2fd;
padding: 7px 10px 7px 10px;
}
.Button
{
border: #1c3460 1px solid;
color: #000a28;
background-color: #7096d3;
}
#btnOk
{
width: 100px;
}
.DarkBackground
{
background-color: #eaf2f8;
}
.LightBackground
{
background-color: #ffffbe;
}
.PopupTitleBorder
{
border-bottom: #d5d59d 1px solid;
}
.PopupTabArea
{
color: #0e3460;
background-color: #8cb2fd;
}
.PopupTabEmptyArea
{
padding-left: 10px ;
border-bottom: #466ca6 1px solid;
}
.PopupTab, .PopupTabSelected
{
border-right: #466ca6 1px solid;
border-top: #466ca6 1px solid;
border-left: #466ca6 1px solid;
padding: 3px 5px 3px 5px;
color: #0e3460;
}
.PopupTab
{
margin-top: 1px;
border-bottom: #466ca6 1px solid;
cursor: pointer;
cursor: hand;
}
.PopupTabSelected
{
font-weight: bold;
cursor: default;
padding-top: 4px;
border-bottom: #f7f8fd 1px solid;
background-color: #f7f8fd;
}
.PopupSelectionBox
{
border: #1e90ff 1px solid !important;
background-color: #add8e6 !important;
cursor: pointer;
cursor: hand;
}
#tdBrowse
{
vertical-align: bottom;
}
/**
* Dialog frame related styles.
*/
.contents
{
position: absolute;
top: 2px;
left: 16px;
right: 16px;
bottom: 20px;
background-color: #f7f8fD;
overflow: hidden;
z-index: 1;
}
.tl, .tr, .tc, .bl, .br, .bc
{
position: absolute;
background-image: url(images/sprites.png);
background-repeat: no-repeat;
}
* html .tl, * html .tr, * html .tc, * html .bl, * html .br, * html .bc
{
background-image: url(images/sprites.gif);
}
.ml, .mr
{
position: absolute;
background-image: url(images/dialog.sides.png);
background-repeat: repeat-y;
}
* html .ml, * html .mr
{
background-image: url(images/dialog.sides.gif);
}
.rtl .ml, .rtl .mr
{
position: absolute;
background-image: url(images/dialog.sides.rtl.png);
background-repeat: repeat-y;
}
* html .rtl .ml, * html .rtl .mr
{
background-image: url(images/dialog.sides.gif);
}
.tl
{
top: 0px;
left: 0px;
width: 16px;
height: 16px;
background-position: -16px -16px;
}
.rtl .tl
{
background-position: -16px -397px;
}
.tr
{
top: 0px;
right: 0px;
width: 16px;
height: 16px;
background-position: -16px -76px;
}
.rtl .tr
{
background-position: -16px -457px;
}
.tc
{
top: 0px;
right: 16px;
left: 16px;
height: 16px;
background-position: 0px -136px;
background-repeat: repeat-x;
}
.ml
{
top: 16px;
left: 0px;
width: 16px;
bottom: 51px;
background-position: 0px 0px;
}
.mr
{
top: 16px;
right: 0px;
width: 16px;
bottom: 51px;
background-position: -16px 0px;
}
.bl
{
bottom: 0px;
left: 0px;
width: 30px;
height: 51px;
background-position: -16px -196px;
}
.rtl .bl
{
background-position: -16px -517px;
}
.br
{
bottom: 0px;
right: 0px;
width: 30px;
height: 51px;
background-position: -16px -263px;
}
.rtl .br
{
background-position: -16px -584px;
}
.bc
{
bottom: 0px;
right: 30px;
left: 30px;
height: 51px;
background-position: 0px -330px;
background-repeat: repeat-x;
}
/* For IE6. Do not change it. */
* html .blocker
{
position: absolute;
width: 100%;
height: 100%;
z-index: 12;
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0);
}
/* The layer used to cover the dialog when opening a child dialog. */
.cover
{
position: absolute;
top: 0px;
left: 14px;
right: 14px;
bottom: 18px;
z-index: 11;
}
#closeButton
{
position: absolute;
right: 0px;
top: 0px;
margin-top: 5px;
margin-right: 10px;
width: 20px;
height: 20px;
cursor: pointer;
background-image: url(images/sprites.png);
background-repeat: no-repeat;
background-position: -16px -651px;
}
* html #closeButton
{
cursor: hand;
background-image: url(images/sprites.gif);
}
.rtl #closeButton
{
right: auto;
left: 10px;
margin-right: 0px;
}
#closeButton:hover
{
background-position: -16px -687px;
}
#throbberBlock
{
z-index: 10;
}
#throbberBlock div
{
float: left;
width: 8px;
height: 9px;
margin-left: 2px;
margin-right: 2px;
font-size: 1px; /* IE6 */
}
/*
Color Gradient Generator:
http://www.herethere.net/~samson/php/color_gradient/?cbegin=0E3460&cend=8cb2fd&steps=4
*/
.throbber_1
{
background-color: #0E3460;
}
.throbber_2
{
background-color: #2D5387;
}
.throbber_3
{
background-color: #4D73AE;
}
.throbber_4
{
background-color: #6C92D5;
}
.throbber_5
{
background-color: #8CB2FD;
}
|
{
"pile_set_name": "Github"
}
|
WGL_I3D_digital_video_control
http://www.opengl.org/registry/specs/I3D/wgl_digital_video_control.txt
WGL_I3D_digital_video_control
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
BOOL wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int* piValue)
BOOL wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int* piValue)
|
{
"pile_set_name": "Github"
}
|
# Created by: Emanuel Haupt <ehaupt@FreeBSD.org>
# $FreeBSD$
PORTNAME= pipreqs
PORTVERSION= 0.4.10
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= ehaupt@FreeBSD.org
COMMENT= Generate requirements.txt file for any project based on imports
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}docopt>0:devel/py-docopt@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}yarg>0:devel/py-yarg@${PY_FLAVOR}
USES= python
USE_PYTHON= autoplist concurrent distutils
.include <bsd.port.mk>
|
{
"pile_set_name": "Github"
}
|
#region File Description
//-----------------------------------------------------------------------------
// EvolvedScreen.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion
#region Using Statements
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Diagnostics;
#endregion
namespace Spacewar
{
/// <summary>
/// SpacewarScreen is the main game screen
/// </summary>
public class EvolvedScreen : SpacewarScreen
{
private double sunScale = 1000.0;
private Asteroid[] asteroids;
private float levelTime;
private int lastLevelTime;
private bool ended;
private double endTime;
private static string[] scoreLookup = new string[] { "000", "001", "011", "111" };
private static Vector3[] asteroidStarts = new Vector3[]
{
new Vector3(390, 240, 0),
new Vector3(-390, -240, 0),
new Vector3(390, -240, 0),
new Vector3(-390, 240,0),
new Vector3(-390, 240,0),
new Vector3(390, 240,0),
new Vector3(-390, -240,0)
};
private Random random = new Random();
/// <summary>
/// Creates a new SpacewarScreen
/// </summary>
public EvolvedScreen(Game game)
: base(game)
{
backdrop = new SceneItem(game, new EvolvedBackdrop(game));
const float factor = 46;
backdrop.Center = new Vector3(.5f, .5f, 0);
backdrop.Scale = new Vector3(16f * factor, 9f * factor, 1f);
backdrop.Position = new Vector3(-.5f, -.5f, 0);
scene.Add(backdrop);
bullets = new Projectiles(game);
particles = new Particles(game);
ship1 = new Ship(game, PlayerIndex.One, SpacewarGame.Players[0].ShipClass, SpacewarGame.Players[0].Skin, new Vector3(SpacewarGame.Settings.Ships[0].StartPosition, 0.0f), bullets, particles);
ship1.Paused = true;
ship1.Radius = 15f;
if (SpacewarGame.Players[0].ShipClass == ShipClass.Pencil)
{
ship1.ExtendedExtent[0] = new Vector3(0.0f, 25.0f, 0.0f);
ship1.ExtendedExtent[1] = new Vector3(0.0f, -25.0f, 0.0f);
}
ship2 = new Ship(game, PlayerIndex.Two, SpacewarGame.Players[1].ShipClass, SpacewarGame.Players[1].Skin, new Vector3(SpacewarGame.Settings.Ships[1].StartPosition, 0.0f), bullets, particles);
ship2.Paused = true;
ship2.Radius = 15f;
if (SpacewarGame.Players[1].ShipClass == ShipClass.Pencil)
{
ship2.ExtendedExtent[0] = new Vector3(0.0f, 25f, 0.0f);
ship2.ExtendedExtent[1] = new Vector3(0.0f, -25f, 0.0f);
}
scene.Add(bullets);
asteroids = new Asteroid[SpacewarGame.GameLevel + 2];
for (int i = 0; i < SpacewarGame.GameLevel + 2; i++)
{
asteroids[i] = new Asteroid(game, random.NextDouble() > .5 ? AsteroidType.Large : AsteroidType.Small, asteroidStarts[i]);
asteroids[i].Scale = new Vector3(SpacewarGame.Settings.AsteroidScale, SpacewarGame.Settings.AsteroidScale, SpacewarGame.Settings.AsteroidScale);
asteroids[i].Paused = true;
asteroids[i].Velocity = (float)random.Next(100) * Vector3.Normalize(new Vector3((float)(random.NextDouble() - .5), (float)(random.NextDouble() - .5), 0));
scene.Add(asteroids[i]);
}
scene.Add(ship1);
scene.Add(ship2);
//Added after other objects so they draw over the top
scene.Add(particles);
//Sun last so its on top
sun = new Sun(game, new EvolvedSun(game), new Vector3(-.5f, -.5f, 0));
scene.Add(sun);
//Reset health meters.
SpacewarGame.Players[0].Health = 5;
SpacewarGame.Players[1].Health = 5;
}
/// <summary>
/// Update for SpacewarScreen uses the base Update method and adds Sun zoom animation
/// and detects the end of the level time
/// </summary>
/// <param name="time">Game time</param>
/// <param name="elapsedTime">Elapsed time since last update</param>
/// <returns>
/// The next gamestate to transition to. Default is the return value of an overlay or NONE. Override Update if you want to change this behaviour
/// </returns>
public override GameState Update(TimeSpan time, TimeSpan elapsedTime)
{
if (sunScale > 1)
{
//1st frame always has a big elapsed time so use that to set the start pos
if (sunScale > 20.0)
{
sunScale = 20.0;
}
else
{
sunScale -= elapsedTime.TotalSeconds * 15.0;
}
if (sunScale < 1)
{
sunScale = 1;
paused = false;
ship1.Paused = false;
ship2.Paused = false;
foreach (Asteroid asteroid in asteroids)
{
asteroid.Paused = false;
}
//Kick off level timer
levelTime = SpacewarGame.Settings.LevelTime;
}
//Zoom the Sun
sun.Scale = new Vector3(SpacewarGame.Settings.Size * (float)sunScale, SpacewarGame.Settings.Size * (float)sunScale, 1f);
}
base.Update(time, elapsedTime);
handleCollisions(time);
//Update screentimer
if (!paused)
{
levelTime -= (float)elapsedTime.TotalSeconds;
if ((levelTime - lastLevelTime) < 0.0f)
{
//We have ticked down
if (levelTime < 0.0f)
{
Sound.PlayCue(Sounds.CountDownExpire);
}
else if (levelTime < 6)
{
Sound.PlayCue(Sounds.CountDownWarning);
}
}
lastLevelTime = (int)levelTime;
}
//When we run out of time show the totals
if (!paused && (levelTime <= 0.0f))
{
//Stop everything while we count up the $$$
paused = true;
ended = true;
ship1.Paused = true;
ship2.Paused = true;
ship1.Silence();
ship2.Silence();
foreach (Asteroid asteroid in asteroids)
{
asteroid.Paused = true;
}
bullets.Clear(); //No more bullets
particles.Clear(); //No more particles
endTime = time.TotalSeconds + 5; //Show scores for 5 seconds
}
if (ended && time.TotalSeconds > endTime)
{
//Don't need the screen anymore, shut it down!
Shutdown();
//Update scores and round
SpacewarGame.Players[0].Cash += player1Score * 1000;
SpacewarGame.Players[1].Cash += player2Score * 1000;
if (player1Score > player2Score)
{
SpacewarGame.Players[0].Score++;
SpacewarGame.GameLevel++;
}
else if (player2Score > player1Score)
{
SpacewarGame.Players[1].Score++;
SpacewarGame.GameLevel++;
}
else
{
//nobody won - tie game
//replay that level
}
if (SpacewarGame.Players[0].Score == 3 || SpacewarGame.Players[1].Score == 3)
{
return GameState.Victory;
}
else
{
return GameState.ShipUpgrade;
}
}
else
{
return GameState.None;
}
}
/// <summary>
/// Renders the screen using the base class and adds the HUD
/// </summary>
public override void Render()
{
//Render scene stuff
base.Render();
//If this is the end of level then show the overlays
if (ended)
{
Texture2D overlayTexture = SpacewarGame.ContentManager.Load<Texture2D>(SpacewarGame.Settings.MediaPath + @"textures\In-game_score_overlay");
SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque);
SpriteBatch.Draw(overlayTexture, new Vector2(70, 200), null, Color.White);
SpriteBatch.Draw(overlayTexture, new Vector2(900, 200), null, Color.White);
SpriteBatch.End();
}
//HUD stuff
Font.Begin();
//If this is the end of level then show the scores
if (ended)
{
Font.Draw(FontStyle.WeaponLarge, 100, 240, String.Format("{0} pts x $1,000", player1Score));
Font.Draw(FontStyle.WeaponLarge, 220, 280, "=");
Font.Draw(FontStyle.WeaponLarge, 180, 320, String.Format("{0:$##,##0}", player1Score * 1000));
Font.Draw(FontStyle.WeaponLarge, 930, 240, String.Format("{0} pts x $1,000", player2Score));
Font.Draw(FontStyle.WeaponLarge, 1050, 280, "=");
Font.Draw(FontStyle.WeaponLarge, 1010, 320, String.Format("{0:$##,##0}", player2Score * 1000));
}
//Timer
Font.Draw(FontStyle.GameCountDown, 592, 40, String.Format("{0:0}:{1:00}", (int)(levelTime / 60), levelTime % 60));
//Player1/2 labels
Font.Draw(FontStyle.GamePlayerNames, 50, 40, "1");
Font.Draw(FontStyle.GamePlayerNames, 1110, 40, "2");
//Weapon icons 01234 is player1 weapons, 56789 is player2 weapons
Font.Draw(FontStyle.WeaponIcons, 50, 560, ((int)SpacewarGame.Players[0].ProjectileType));
Font.Draw(FontStyle.WeaponIcons, 1090, 560, ((int)(SpacewarGame.Players[1].ProjectileType) + 5));
//Score buttons
Font.Draw(FontStyle.ScoreButtons, 60, 70, scoreLookup[SpacewarGame.Players[0].Score]);
Font.Draw(FontStyle.ScoreButtons, 1140, 70, scoreLookup[SpacewarGame.Players[1].Score]);
//Health
//Fudge factor for BFG icon
int xOffset;
xOffset = (SpacewarGame.Players[0].ProjectileType == ProjectileType.BFG) ? 12 : 0;
Font.Draw(FontStyle.HealthBar, 130 + xOffset, 625, SpacewarGame.Players[0].Health);
xOffset = (SpacewarGame.Players[1].ProjectileType == ProjectileType.BFG) ? 16 : 0;
Font.Draw(FontStyle.HealthBar, 1170 + xOffset, 625, SpacewarGame.Players[1].Health);
//Scores
Font.Draw(FontStyle.Score, 300, 15, player1Score);
Font.Draw(FontStyle.Score, 940, 15, player2Score);
Font.End();
}
protected override void handleCollisions(TimeSpan gameTime)
{
base.handleCollisions(gameTime);
bool asteroidHitShip1 = false;
bool asteroidHitShip2 = false;
//Asteroids do 3 damage and bounce you
foreach (Asteroid asteroid in asteroids)
{
if (!asteroid.Destroyed)
{
if (asteroid.Collide(ship1) && !ship1.Uncollidable)
{
asteroidHitShip1 = true;
if (!ship1.Invulnerable)
{
float ship1Speed = ship1.Velocity.Length();
float asteroidSpeed = asteroid.Velocity.Length();
Vector3 tmp = ship1.Velocity;
Vector3 vel = asteroid.Velocity;
vel.Normalize();
ship1.Velocity = vel * ship1Speed;
tmp.Normalize();
asteroid.Velocity = tmp * asteroidSpeed;
HitPlayer1(gameTime, 1);
ship1.Invulnerable = true;
}
}
if (asteroid.Collide(ship2) && !ship2.Uncollidable)
{
asteroidHitShip2 = true;
if (!ship2.Invulnerable)
{
float ship2Speed = ship2.Velocity.Length();
float asteroidSpeed = asteroid.Velocity.Length();
Vector3 tmp = ship2.Velocity;
Vector3 vel = asteroid.Velocity;
vel.Normalize();
ship2.Velocity = vel * ship2Speed;
tmp.Normalize();
asteroid.Velocity = tmp * asteroidSpeed;
HitPlayer2(gameTime, 1);
ship2.Invulnerable = true;
}
}
foreach (Projectile bullet in bullets)
{
if (bullet.Collide(asteroid))
{
particles.AddExplosion(asteroid.Position);
asteroid.Delete = true;
asteroid.Destroyed = true;
bullet.DeleteProjectile();
Sound.PlayCue(Sounds.Explosion);
}
}
}
}
if (!asteroidHitShip1 && ship1.Invulnerable)
{
ship1.Invulnerable = false;
}
if (!asteroidHitShip2 && ship2.Invulnerable)
{
ship2.Invulnerable = false;
}
}
public override void OnCreateDevice()
{
base.OnCreateDevice();
foreach (Asteroid asteroid in asteroids)
{
asteroid.ShapeItem.OnCreateDevice();
}
foreach (Projectile bullet in bullets)
{
bullet.ShapeItem.OnCreateDevice();
}
particles.OnCreateDevice();
}
}
}
|
{
"pile_set_name": "Github"
}
|
<body>
{@hide}
</body>
|
{
"pile_set_name": "Github"
}
|
#include "UnitTest.h"
#include "Gwen/Controls/TreeControl.h"
using namespace Gwen;
using namespace Gwen::Controls;
class TreeControl2 : public GUnit
{
public:
GWEN_CONTROL_INLINE( TreeControl2, GUnit )
{
{
Gwen::Controls::TreeControl* ctrl = new Gwen::Controls::TreeControl( this );
ctrl->SetKeyboardInputEnabled(true);
ctrl->AddNode( L"Node One" );
Gwen::Controls::TreeNode* pNode = ctrl->AddNode( L"Node Two" );
pNode->AddNode( L"Node Two Inside" );
pNode->AddNode( L"Eyes" );
pNode->SetSelected(true);
pNode->AddNode( L"Brown" )->AddNode( L"Node Two Inside" )->AddNode( L"Eyes" )->AddNode( L"Brown" );
ctrl->AddNode( L"Node Three" );
ctrl->Focus();
ctrl->SetKeyboardInputEnabled(true);
ctrl->SetBounds( 30, 30, 200, 200 );
ctrl->ExpandAll();
}
{
Gwen::Controls::TreeControl* ctrl = new Gwen::Controls::TreeControl( this );
ctrl->AllowMultiSelect( true );
ctrl->AddNode( L"Node One" );
Gwen::Controls::TreeNode* pNode = ctrl->AddNode( L"Node Two" );
pNode->AddNode( L"Node Two Inside" );
pNode->AddNode( L"Eyes" );
Gwen::Controls::TreeNode* pNodeTwo = pNode->AddNode( L"Brown" )->AddNode( L"Node Two Inside" )->AddNode( L"Eyes" );
pNodeTwo->AddNode( L"Brown" );
pNodeTwo->AddNode( L"Green" );
pNodeTwo->AddNode( L"Slime" );
pNodeTwo->AddNode( L"Grass" );
pNodeTwo->AddNode( L"Pipe" );
ctrl->AddNode( L"Node Three" );
ctrl->SetBounds( 240, 30, 200, 200 );
ctrl->ExpandAll();
}
}
};
DEFINE_UNIT_TEST( TreeControl2, L"TreeControl" );
|
{
"pile_set_name": "Github"
}
|
# 2018 August 24
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#*************************************************************************
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix altertab
# If SQLITE_OMIT_ALTERTABLE is defined, omit this file.
ifcapable !altertable {
finish_test
return
}
do_execsql_test 1.0 {
CREATE TABLE t1(a, b, CHECK(t1.a != t1.b));
CREATE TABLE t2(a, b);
CREATE INDEX t2expr ON t2(a) WHERE t2.b>0;
}
do_execsql_test 1.1 {
SELECT sql FROM sqlite_master
} {
{CREATE TABLE t1(a, b, CHECK(t1.a != t1.b))}
{CREATE TABLE t2(a, b)}
{CREATE INDEX t2expr ON t2(a) WHERE t2.b>0}
}
do_execsql_test 1.2 {
ALTER TABLE t1 RENAME TO t1new;
}
do_execsql_test 1.3 {
CREATE TABLE t3(c, d);
ALTER TABLE t3 RENAME TO t3new;
DROP TABLE t3new;
}
do_execsql_test 1.4 {
SELECT sql FROM sqlite_master
} {
{CREATE TABLE "t1new"(a, b, CHECK("t1new".a != "t1new".b))}
{CREATE TABLE t2(a, b)}
{CREATE INDEX t2expr ON t2(a) WHERE t2.b>0}
}
do_execsql_test 1.3 {
ALTER TABLE t2 RENAME TO t2new;
}
do_execsql_test 1.4 {
SELECT sql FROM sqlite_master
} {
{CREATE TABLE "t1new"(a, b, CHECK("t1new".a != "t1new".b))}
{CREATE TABLE "t2new"(a, b)}
{CREATE INDEX t2expr ON "t2new"(a) WHERE "t2new".b>0}
}
#-------------------------------------------------------------------------
reset_db
ifcapable vtab {
register_echo_module db
do_execsql_test 2.0 {
CREATE TABLE abc(a, b, c);
INSERT INTO abc VALUES(1, 2, 3);
CREATE VIRTUAL TABLE eee USING echo('abc');
SELECT * FROM eee;
} {1 2 3}
do_execsql_test 2.1 {
ALTER TABLE eee RENAME TO fff;
SELECT * FROM fff;
} {1 2 3}
db close
sqlite3 db test.db
do_catchsql_test 2.2 {
ALTER TABLE fff RENAME TO ggg;
} {1 {no such module: echo}}
}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 3.0 {
CREATE TABLE txx(a, b, c);
INSERT INTO txx VALUES(1, 2, 3);
CREATE VIEW vvv AS SELECT main.txx.a, txx.b, c FROM txx;
CREATE VIEW uuu AS SELECT main.one.a, one.b, c FROM txx AS one;
CREATE VIEW temp.ttt AS SELECT main.txx.a, txx.b, one.b, main.one.a FROM txx AS one, txx;
}
do_execsql_test 3.1.1 {
SELECT * FROM vvv;
} {1 2 3}
do_execsql_test 3.1.2 {
ALTER TABLE txx RENAME TO "t xx";
SELECT * FROM vvv;
} {1 2 3}
do_execsql_test 3.1.3 {
SELECT sql FROM sqlite_master WHERE name='vvv';
} {{CREATE VIEW vvv AS SELECT main."t xx".a, "t xx".b, c FROM "t xx"}}
do_execsql_test 3.2.1 {
SELECT * FROM uuu;
} {1 2 3}
do_execsql_test 3.2.2 {
SELECT sql FROM sqlite_master WHERE name='uuu';;
} {{CREATE VIEW uuu AS SELECT main.one.a, one.b, c FROM "t xx" AS one}}
do_execsql_test 3.3.1 {
SELECT * FROM ttt;
} {1 2 2 1}
do_execsql_test 3.3.2 {
SELECT sql FROM sqlite_temp_master WHERE name='ttt';
} {{CREATE VIEW ttt AS SELECT main."t xx".a, "t xx".b, one.b, main.one.a FROM "t xx" AS one, "t xx"}}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 4.0 {
CREATE table t1(x, y);
CREATE table t2(a, b);
CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
SELECT t1.x, * FROM t1, t2;
INSERT INTO t2 VALUES(new.x, new.y);
END;
}
do_execsql_test 4.1 {
INSERT INTO t1 VALUES(1, 1);
ALTER TABLE t1 RENAME TO t11;
INSERT INTO t11 VALUES(2, 2);
ALTER TABLE t2 RENAME TO t22;
INSERT INTO t11 VALUES(3, 3);
}
proc squish {a} {
string trim [regsub -all {[[:space:]][[:space:]]*} $a { }]
}
db func squish squish
do_test 4.2 {
execsql { SELECT squish(sql) FROM sqlite_master WHERE name = 'tr1' }
} [list [squish {
CREATE TRIGGER tr1 AFTER INSERT ON "t11" BEGIN
SELECT "t11".x, * FROM "t11", "t22";
INSERT INTO "t22" VALUES(new.x, new.y);
END
}]]
#-------------------------------------------------------------------------
reset_db
do_execsql_test 5.0 {
CREATE TABLE t9(a, b, c);
CREATE TABLE t10(a, b, c);
CREATE TEMP TABLE t9(a, b, c);
CREATE TRIGGER temp.t9t AFTER INSERT ON temp.t9 BEGIN
INSERT INTO t10 VALUES(new.a, new.b, new.c);
END;
INSERT INTO temp.t9 VALUES(1, 2, 3);
SELECT * FROM t10;
} {1 2 3}
do_execsql_test 5.1 {
ALTER TABLE temp.t9 RENAME TO 't1234567890'
}
do_execsql_test 5.2 {
CREATE TABLE t1(a, b);
CREATE TABLE t2(a, b);
INSERT INTO t1 VALUES(1, 2);
INSERT INTO t2 VALUES(3, 4);
CREATE VIEW v AS SELECT one.a, one.b, t2.a, t2.b FROM t1 AS one, t2;
SELECT * FROM v;
} {1 2 3 4}
do_catchsql_test 5.3 {
ALTER TABLE t2 RENAME TO one;
} {1 {error in view v after rename: ambiguous column name: one.a}}
do_execsql_test 5.4 {
SELECT * FROM v
} {1 2 3 4}
do_execsql_test 5.5 {
DROP VIEW v;
CREATE VIEW temp.vv AS SELECT one.a, one.b, t2.a, t2.b FROM t1 AS one, t2;
SELECT * FROM vv;
} {1 2 3 4}
do_catchsql_test 5.6 {
ALTER TABLE t2 RENAME TO one;
} {1 {error in view vv after rename: ambiguous column name: one.a}}
#-------------------------------------------------------------------------
ifcapable vtab {
register_tcl_module db
proc tcl_command {method args} {
switch -- $method {
xConnect {
return "CREATE TABLE t1(a, b, c)"
}
}
return {}
}
do_execsql_test 6.0 {
CREATE VIRTUAL TABLE x1 USING tcl(tcl_command);
}
do_execsql_test 6.1 {
ALTER TABLE x1 RENAME TO x2;
SELECT sql FROM sqlite_master WHERE name = 'x2'
} {{CREATE VIRTUAL TABLE "x2" USING tcl(tcl_command)}}
do_execsql_test 7.1 {
CREATE TABLE ddd(db, sql, zOld, zNew, bTemp);
INSERT INTO ddd VALUES(
'main', 'CREATE TABLE x1(i INTEGER, t TEXT)', 'ddd', NULL, 0
), (
'main', 'CREATE TABLE x1(i INTEGER, t TEXT)', NULL, 'eee', 0
), (
'main', NULL, 'ddd', 'eee', 0
);
} {}
sqlite3_test_control SQLITE_TESTCTRL_INTERNAL_FUNCTIONS db
do_execsql_test 7.2 {
SELECT
sqlite_rename_table(db, 0, 0, sql, zOld, zNew, bTemp)
FROM ddd;
} {{} {} {}}
sqlite3_test_control SQLITE_TESTCTRL_INTERNAL_FUNCTIONS db
}
#-------------------------------------------------------------------------
#
reset_db
forcedelete test.db2
do_execsql_test 8.1 {
ATTACH 'test.db2' AS aux;
PRAGMA foreign_keys = on;
CREATE TABLE aux.p1(a INTEGER PRIMARY KEY, b);
CREATE TABLE aux.c1(x INTEGER PRIMARY KEY, y REFERENCES p1(a));
INSERT INTO aux.p1 VALUES(1, 1);
INSERT INTO aux.p1 VALUES(2, 2);
INSERT INTO aux.c1 VALUES(NULL, 2);
CREATE TABLE aux.c2(x INTEGER PRIMARY KEY, y REFERENCES c1(a));
}
do_execsql_test 8.2 {
ALTER TABLE aux.p1 RENAME TO ppp;
}
do_execsql_test 8.2 {
INSERT INTO aux.c1 VALUES(NULL, 1);
SELECT sql FROM aux.sqlite_master WHERE name = 'c1';
} {{CREATE TABLE c1(x INTEGER PRIMARY KEY, y REFERENCES "ppp"(a))}}
reset_db
do_execsql_test 9.0 {
CREATE TABLE t1(a, b, c);
CREATE VIEW v1 AS SELECT * FROM t2;
}
do_catchsql_test 9.1 {
ALTER TABLE t1 RENAME TO t3;
} {1 {error in view v1: no such table: main.t2}}
do_execsql_test 9.2 {
DROP VIEW v1;
CREATE TRIGGER tr AFTER INSERT ON t1 BEGIN
INSERT INTO t2 VALUES(new.a);
END;
}
do_catchsql_test 9.3 {
ALTER TABLE t1 RENAME TO t3;
} {1 {error in trigger tr: no such table: main.t2}}
forcedelete test.db2
do_execsql_test 9.4 {
DROP TRIGGER tr;
ATTACH 'test.db2' AS aux;
CREATE TRIGGER tr AFTER INSERT ON t1 WHEN new.a IS NULL BEGIN SELECT 1, 2, 3; END;
CREATE TABLE aux.t1(x);
CREATE TEMP TRIGGER tr AFTER INSERT ON aux.t1 BEGIN SELECT 1, 2, 3; END;
}
do_execsql_test 9.5 {
ALTER TABLE main.t1 RENAME TO t3;
}
do_execsql_test 9.6 {
SELECT sql FROM sqlite_temp_master;
SELECT sql FROM sqlite_master WHERE type='trigger';
} {
{CREATE TRIGGER tr AFTER INSERT ON aux.t1 BEGIN SELECT 1, 2, 3; END}
{CREATE TRIGGER tr AFTER INSERT ON "t3" WHEN new.a IS NULL BEGIN SELECT 1, 2, 3; END}
}
#-------------------------------------------------------------------------
reset_db
ifcapable fts5 {
do_execsql_test 10.0 {
CREATE VIRTUAL TABLE fff USING fts5(x, y, z);
}
do_execsql_test 10.1 {
BEGIN;
INSERT INTO fff VALUES('a', 'b', 'c');
ALTER TABLE fff RENAME TO ggg;
COMMIT;
}
do_execsql_test 10.2 {
SELECT * FROM ggg;
} {a b c}
}
#-------------------------------------------------------------------------
reset_db
forcedelete test.db2
db func trigger trigger
set ::trigger [list]
proc trigger {args} {
lappend ::trigger $args
}
do_execsql_test 11.0 {
ATTACH 'test.db2' AS aux;
CREATE TABLE aux.t1(a, b, c);
CREATE TABLE main.t1(a, b, c);
CREATE TEMP TRIGGER tr AFTER INSERT ON aux.t1 BEGIN
SELECT trigger(new.a, new.b, new.c);
END;
}
do_execsql_test 11.1 {
INSERT INTO main.t1 VALUES(1, 2, 3);
INSERT INTO aux.t1 VALUES(4, 5, 6);
}
do_test 11.2 { set ::trigger } {{4 5 6}}
do_execsql_test 11.3 {
SELECT name, tbl_name FROM sqlite_temp_master;
} {tr t1}
do_execsql_test 11.4 {
ALTER TABLE main.t1 RENAME TO t2;
SELECT name, tbl_name FROM sqlite_temp_master;
} {tr t1}
do_execsql_test 11.5 {
ALTER TABLE aux.t1 RENAME TO t2;
SELECT name, tbl_name FROM sqlite_temp_master;
} {tr t2}
do_execsql_test 11.6 {
INSERT INTO aux.t2 VALUES(7, 8, 9);
}
do_test 11.7 { set ::trigger } {{4 5 6} {7 8 9}}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 12.0 {
CREATE TABLE t1(a);
CREATE TABLE t2(w);
CREATE TRIGGER temp.r1 AFTER INSERT ON main.t2 BEGIN
INSERT INTO t1(a) VALUES(new.w);
END;
CREATE TEMP TABLE t2(x);
}
do_execsql_test 12.1 {
ALTER TABLE main.t2 RENAME TO t3;
}
do_execsql_test 12.2 {
INSERT INTO t3 VALUES('WWW');
SELECT * FROM t1;
} {WWW}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 13.0 {
CREATE TABLE t1(x, y);
CREATE TABLE t2(a, b);
CREATE TABLE log(c);
CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
INSERT INTO log SELECT y FROM t1, t2;
END;
}
do_execsql_test 13.1 {
INSERT INTO t1 VALUES(1, 2);
}
do_catchsql_test 13.2 {
ALTER TABLE t2 RENAME b TO y;
} {1 {error in trigger tr1 after rename: ambiguous column name: y}}
#-------------------------------------------------------------------------
reset_db
ifcapable rtree {
do_execsql_test 14.0 {
CREATE VIRTUAL TABLE rt USING rtree(id, minx, maxx, miny, maxy);
CREATE TABLE "mytable" ( "fid" INTEGER PRIMARY KEY, "geom" BLOB);
CREATE TRIGGER tr1 AFTER UPDATE OF "geom" ON "mytable"
WHEN OLD."fid" = NEW."fid" AND NEW."geom" IS NULL BEGIN
DELETE FROM rt WHERE id = OLD."fid";
END;
INSERT INTO mytable VALUES(1, X'abcd');
}
do_execsql_test 14.1 {
UPDATE mytable SET geom = X'1234'
}
do_execsql_test 14.2 {
ALTER TABLE mytable RENAME TO mytable_renamed;
}
do_execsql_test 14.3 {
CREATE TRIGGER tr2 AFTER INSERT ON mytable_renamed BEGIN
DELETE FROM rt WHERE id=(SELECT min(id) FROM rt);
END;
}
do_execsql_test 14.4 {
ALTER TABLE mytable_renamed RENAME TO mytable2;
}
}
reset_db
do_execsql_test 14.5 {
CREATE TABLE t1(a, b, c);
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE TRIGGER xyz AFTER INSERT ON t1 BEGIN
SELECT a, b FROM v1;
END;
}
do_execsql_test 14.6 {
ALTER TABLE t1 RENAME TO tt1;
}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 15.0 {
CREATE TABLE t1(a integer NOT NULL PRIMARY KEY);
CREATE VIEW v1 AS SELECT a FROM t1;
CREATE TRIGGER tr1 INSTEAD OF INSERT ON v1 BEGIN
UPDATE t1 SET a = NEW.a;
END;
CREATE TRIGGER tr2 INSTEAD OF INSERT ON v1 BEGIN
SELECT new.a;
END;
CREATE TABLE t2 (b);
}
do_execsql_test 15.1 {
INSERT INTO v1 VALUES(1);
ALTER TABLE t2 RENAME TO t3;
}
do_execsql_test 15.2 {
CREATE TABLE x(f1 integer NOT NULL);
CREATE VIEW y AS SELECT f1 AS f1 FROM x;
CREATE TRIGGER t INSTEAD OF UPDATE OF f1 ON y BEGIN
UPDATE x SET f1 = NEW.f1;
END;
CREATE TABLE z (f1 integer NOT NULL PRIMARY KEY);
ALTER TABLE z RENAME TO z2;
}
do_execsql_test 15.3 {
INSERT INTO x VALUES(1), (2), (3);
ALTER TABLE x RENAME f1 TO f2;
SELECT * FROM x;
} {1 2 3}
do_execsql_test 15.4 {
UPDATE y SET f1 = 'x' WHERE f1 = 1;
SELECT * FROM x;
} {x x x}
do_execsql_test 15.5 {
SELECT sql FROM sqlite_master WHERE name = 'y';
} {{CREATE VIEW y AS SELECT f2 AS f1 FROM x}}
#-------------------------------------------------------------------------
# Test that it is not possible to rename a shadow table in DEFENSIVE mode.
#
ifcapable fts3 {
proc vtab_command {method args} {
switch -- $method {
xConnect {
if {[info exists ::vtab_connect_sql]} {
execsql $::vtab_connect_sql
}
return "CREATE TABLE t1(a, b, c)"
}
xBestIndex {
set clist [lindex $args 0]
if {[llength $clist]!=1} { error "unexpected constraint list" }
catch { array unset C }
array set C [lindex $clist 0]
if {$C(usable)} {
return "omit 0 cost 0 rows 1 idxnum 555 idxstr eq!"
} else {
return "cost 1000000 rows 0 idxnum 0 idxstr scan..."
}
}
}
return {}
}
register_tcl_module db
sqlite3_db_config db DEFENSIVE 1
do_execsql_test 16.0 {
CREATE VIRTUAL TABLE y1 USING fts3;
}
do_catchsql_test 16.10 {
INSERT INTO y1_segments VALUES(1, X'1234567890');
} {1 {table y1_segments may not be modified}}
do_catchsql_test 16.20 {
DROP TABLE y1_segments;
} {1 {table y1_segments may not be dropped}}
do_catchsql_test 16.20 {
ALTER TABLE y1_segments RENAME TO abc;
} {1 {table y1_segments may not be altered}}
sqlite3_db_config db DEFENSIVE 0
do_catchsql_test 16.22 {
ALTER TABLE y1_segments RENAME TO abc;
} {0 {}}
sqlite3_db_config db DEFENSIVE 1
do_catchsql_test 16.23 {
CREATE TABLE y1_segments AS SELECT * FROM abc;
} {1 {object name reserved for internal use: y1_segments}}
do_catchsql_test 16.24 {
CREATE VIEW y1_segments AS SELECT * FROM abc;
} {1 {object name reserved for internal use: y1_segments}}
sqlite3_db_config db DEFENSIVE 0
do_catchsql_test 16.25 {
ALTER TABLE abc RENAME TO y1_segments;
} {0 {}}
sqlite3_db_config db DEFENSIVE 1
do_execsql_test 16.30 {
ALTER TABLE y1 RENAME TO z1;
}
do_execsql_test 16.40 {
SELECT * FROM z1_segments;
}
}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 17.0 {
CREATE TABLE sqlite1234 (id integer);
ALTER TABLE sqlite1234 RENAME TO User;
SELECT name, sql FROM sqlite_master WHERE sql IS NOT NULL;
} {
User {CREATE TABLE "User" (id integer)}
}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 18.1.0 {
CREATE TABLE t0 (c0 INTEGER, PRIMARY KEY(c0)) WITHOUT ROWID;
}
do_execsql_test 18.1.1 {
ALTER TABLE t0 RENAME COLUMN c0 TO c1;
}
do_execsql_test 18.1.2 {
SELECT sql FROM sqlite_master;
} {{CREATE TABLE t0 (c1 INTEGER, PRIMARY KEY(c1)) WITHOUT ROWID}}
reset_db
do_execsql_test 18.2.0 {
CREATE TABLE t0 (c0 INTEGER, PRIMARY KEY(c0));
}
do_execsql_test 18.2.1 {
ALTER TABLE t0 RENAME COLUMN c0 TO c1;
}
do_execsql_test 18.2.2 {
SELECT sql FROM sqlite_master;
} {{CREATE TABLE t0 (c1 INTEGER, PRIMARY KEY(c1))}}
# 2020-02-23 ticket f50af3e8a565776b
reset_db
do_execsql_test 19.100 {
CREATE TABLE t1(x);
CREATE VIEW t2 AS SELECT 1 FROM t1, (t1 AS a0, t1);
ALTER TABLE t1 RENAME TO t3;
SELECT sql FROM sqlite_master;
} {{CREATE TABLE "t3"(x)} {CREATE VIEW t2 AS SELECT 1 FROM "t3", ("t3" AS a0, "t3")}}
do_execsql_test 19.110 {
INSERT INTO t3(x) VALUES(123);
SELECT * FROM t2;
} {1}
do_execsql_test 19.120 {
INSERT INTO t3(x) VALUES('xyz');
SELECT * FROM t2;
} {1 1 1 1 1 1 1 1}
# Ticket 4722bdab08cb14
reset_db
do_execsql_test 20.0 {
CREATE TABLE a(a);
CREATE VIEW b AS SELECT(SELECT *FROM c JOIN a USING(d, a, a, a) JOIN a) IN();
}
do_execsql_test 20.1 {
ALTER TABLE a RENAME a TO e;
} {}
reset_db
do_execsql_test 21.0 {
CREATE TABLE a(b);
CREATE VIEW c AS
SELECT NULL INTERSECT
SELECT NULL ORDER BY
likelihood(NULL, (d, (SELECT c)));
} {}
do_catchsql_test 21.1 {
SELECT likelihood(NULL, (d, (SELECT c)));
} {1 {second argument to likelihood() must be a constant between 0.0 and 1.0}}
do_catchsql_test 21.2 {
SELECT * FROM c;
} {1 {1st ORDER BY term does not match any column in the result set}}
do_catchsql_test 21.3 {
ALTER TABLE a RENAME TO e;
} {1 {error in view c: 1st ORDER BY term does not match any column in the result set}}
# After forum thread https://sqlite.org/forum/forumpost/ddbe1c7efa
# Ensure that PRAGMA schema_version=N causes a full schema reload.
#
reset_db
do_execsql_test 22.0 {
CREATE TABLE t1(a INT, b TEXT NOT NULL);
INSERT INTO t1 VALUES(1,2),('a','b');
BEGIN;
PRAGMA writable_schema=ON;
UPDATE sqlite_schema SET sql='CREATE TABLE t1(a INT, b TEXT)' WHERE name LIKE 't1';
PRAGMA schema_version=1234;
COMMIT;
PRAGMA integrity_check;
} {ok}
do_execsql_test 22.1 {
ALTER TABLE t1 ADD COLUMN c INT DEFAULT 78;
SELECT * FROM t1;
} {1 2 78 a b 78}
finish_test
|
{
"pile_set_name": "Github"
}
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,12m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0"
android:strokeAlpha="0.3"
android:fillAlpha="0.3"/>
<path
android:fillColor="@android:color/white"
android:pathData="M7,12c0,2.76 2.24,5 5,5s5,-2.24 5,-5 -2.24,-5 -5,-5 -5,2.24 -5,5zM15,12c0,1.65 -1.35,3 -3,3s-3,-1.35 -3,-3 1.35,-3 3,-3 3,1.35 3,3zM3,19c0,1.1 0.9,2 2,2h4v-2L5,19v-4L3,15v4zM3,5v4h2L5,5h4L9,3L5,3c-1.1,0 -2,0.9 -2,2zM21,5c0,-1.1 -0.9,-2 -2,-2h-4v2h4v4h2L21,5zM19,19h-4v2h4c1.1,0 2,-0.9 2,-2v-4h-2v4z"/>
</vector>
|
{
"pile_set_name": "Github"
}
|
$NetBSD: distinfo,v 1.5 2015/11/03 03:28:34 agc Exp $
SHA1 (MooseX-Types-Perl-0.101343.tar.gz) = 44378c6053a6e9c6929d36ad40da7127472f90e4
RMD160 (MooseX-Types-Perl-0.101343.tar.gz) = 990897c18fb422d8fc8bbe0155103160ebe87678
SHA512 (MooseX-Types-Perl-0.101343.tar.gz) = a3ad0f1b3dcde93f23254f084faadde7d3b03076f045802d7757c5580b2d0fb6cb748143a99fcd650492fc7da8938e28d8e0b7714070386638d972ab7d799e9a
Size (MooseX-Types-Perl-0.101343.tar.gz) = 14353 bytes
|
{
"pile_set_name": "Github"
}
|
#ifndef TESTENGINE_H
#define TESTENGINE_H
#include <QtTest>
class TestEngine : public QObject {
Q_OBJECT
public:
TestEngine();
private:
QString tmpFileName;
private slots:
void initTestCase();
void testGetFinishTime();
void testCurrentSubtitleIndex();
void testGetTimeWithSubtitleOffset();
void cleanupTestCase();
};
#endif // TESTENGINE_H
|
{
"pile_set_name": "Github"
}
|
# Generator Functions
Ref: [MDN Generator Functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator)
A generator function does have a specific syntax. You put an asterisk after the `function` keyword. You use generator functions when you need to retrieve the next item in a series of values at any time. It maintains its state across each execution, where non-generator functions do not.
The following function will return `Red` every time because once it executes, the memory used is released and all variables are eradicated.
```js
// Non-generator function
const getNextColor = function () {
const colors = ["Red", "Yellow", "Green", "Goldenrod"]
let counter = 0
const currentColor = colors[counter] // Red
counter += 1 // Increment the counter
return currentColor
}
console.log(getNextColor()) // Red
console.log(getNextColor()) // Red
```
Conversely, the variables in a generator function do not get released between executions.
```js
const getNextColor = function* () {
const colors = ["Red", "Yellow", "Green", "Goldenrod"]
let counter = 0
while (counter < colors.length) {
yield currentColor = colors[counter]
counter += 1 // Increment the counter
}
}
// Create an instance of the generator
const colorFactory = getNextColor()
// Get the first generated item in the collection
colorFactory.next().value // Red
// Get the next generated item in the collection
colorFactory.next().value // Yellow
```

## Combining Generator and Factory Functions
A good, practical use case for these types of objects is for when you need to create a new object, on demand, that has a unique identifier. Let's look at an example of a generator function that produced a UUID every time the `next()` method is invoked on it.
```js
/*
We will be using the following generator function to generate unique
identifiers for objects in our database while we use local storage. Do
not worry about understanding the code inside it - it's not important.
What is important is the output, and understanding how we use that
output in the factory function.
*/
const uuidGenerator = function* () {
while (true) {
let time = new Date().getTime()
let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (char) {
const random = (time + Math.random() * 16) % 16 | 0
return (char === 'x' ? random : (random & 0x3 | 0x8)).toString(16)
})
yield uuid
}
}
// Create instance of generator
const blogPostId = uuidGenerator()
// Factory function that returns a blog article object
const blogObjectFactory = function (title, entry, ...tags) {
return {
"id": blogPostId.next().value,
"title": title,
"body": entry,
"tags": tags,
"published": Date.now()
}
}
// Create a blog article about your first day at NSS
const firstDay = blogObjectFactory("My first day at NSS", "I felt completely lost", "nss", "life changes", "software")
// Create a blog article about your instructor
const instructor = blogObjectFactory("Our instructor", "This guy is a jerk", "nss", "teachers", "loser")
```

## Videos to Watch
1. [Javascript Generators](https://www.youtube.com/watch?v=QO07THdLWQo)
1. [JavaScript ES6 - Iterators and Generators](https://www.youtube.com/watch?v=lbBZXw2hKH4)
## Practice - Colored Reindeer
In this exercise, you start with a collection of reindeer names. Your task is to add each reindeer name to an HTML `article` element with an `id` of `colored-reindeer`.
After you read the instructions, your goal is to have three functions.
1. A generator function to yield colors.
1. A factory function to build a new reindeer object. This function will need to use the generator.
1. The main builder function (see below) which will call the factory function and then place each object in an array.
To start you off, paste in the following code into your JavaScript file.
```js
const coloredReindeerBuilder = function () {
const reindeer = ["Dasher", "Dancer", "Prancer", "Vixen", "Comet", "Cupid", "Donner", "Blitzen"]
// Write a for loop that looks at each reindeer
// Invoke factory function to create reindeer object
// Put new reindeer object in coloredReindeer array
// Return coloredReindeer array
}
```
Your job is to...
1. Create a new object that represents a reindeer - the object will include the reindeer's name and its color. Use a generator function to attach each of the following colors, in order, to the reindeer. Use a factory function to generate the reindeer object.
```js
["Blue", "Red", "Orange", "Purple", "Goldenrod", "Aquamarine", "Olive", "Azure", "Fuchsia", "Chocolate", "Salmon", "Amaranth"]
```
1. Place each object in an array named `coloredReindeer`.
```js
// Each object produced by the factory function
[{ "name": "Dasher", "color": "Blue" }, etc...]
```
1. Iterate over the `coloredReindeer` array and insert a new `<section>` element in the `colored-reindeer` element that displays the reindeer name, with a font color corresponding to the color in the object.
```html
<!-- Example of what your HTML should look like -->
<article id="colored-reindeer">
<section style="color: Blue">Dasher</section>
<section style="color: Red">Dancer</section>
etc...
</article>
```
> **Pro tip:** Remember to make your code modular. The JavaScript for generating the data should be in one file, and the JavaScript for manipulating the DOM should be in a different file.
|
{
"pile_set_name": "Github"
}
|
<!--
- Copyright (C) 2004-2012, 2014 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2003 Internet Software Consortium.
-
- 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 ISC DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL ISC 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.
-->
<!-- Id -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>nsupdate</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="man.nsupdate"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p><span class="application">nsupdate</span> — Dynamic DNS update utility</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p><code class="command">nsupdate</code> [<code class="option">-d</code>] [<code class="option">-D</code>] [[<code class="option">-g</code>] | [<code class="option">-o</code>] | [<code class="option">-l</code>] | [<code class="option">-y <em class="replaceable"><code>[<span class="optional">hmac:</span>]keyname:secret</code></em></code>] | [<code class="option">-k <em class="replaceable"><code>keyfile</code></em></code>]] [<code class="option">-t <em class="replaceable"><code>timeout</code></em></code>] [<code class="option">-u <em class="replaceable"><code>udptimeout</code></em></code>] [<code class="option">-r <em class="replaceable"><code>udpretries</code></em></code>] [<code class="option">-R <em class="replaceable"><code>randomdev</code></em></code>] [<code class="option">-v</code>] [<code class="option">-T</code>] [<code class="option">-P</code>] [<code class="option">-V</code>] [filename]</p></div>
</div>
<div class="refsect1" lang="en">
<a name="id2543485"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">nsupdate</strong></span>
is used to submit Dynamic DNS Update requests as defined in RFC 2136
to a name server.
This allows resource records to be added or removed from a zone
without manually editing the zone file.
A single update request can contain requests to add or remove more than
one
resource record.
</p>
<p>
Zones that are under dynamic control via
<span><strong class="command">nsupdate</strong></span>
or a DHCP server should not be edited by hand.
Manual edits could
conflict with dynamic updates and cause data to be lost.
</p>
<p>
The resource records that are dynamically added or removed with
<span><strong class="command">nsupdate</strong></span>
have to be in the same zone.
Requests are sent to the zone's master server.
This is identified by the MNAME field of the zone's SOA record.
</p>
<p>
The
<code class="option">-d</code>
option makes
<span><strong class="command">nsupdate</strong></span>
operate in debug mode.
This provides tracing information about the update requests that are
made and the replies received from the name server.
</p>
<p>
The <code class="option">-D</code> option makes <span><strong class="command">nsupdate</strong></span>
report additional debugging information to <code class="option">-d</code>.
</p>
<p>
The <code class="option">-L</code> option with an integer argument of zero or
higher sets the logging debug level. If zero, logging is disabled.
</p>
<p>
Transaction signatures can be used to authenticate the Dynamic
DNS updates. These use the TSIG resource record type described
in RFC 2845 or the SIG(0) record described in RFC 2535 and
RFC 2931 or GSS-TSIG as described in RFC 3645. TSIG relies on
a shared secret that should only be known to
<span><strong class="command">nsupdate</strong></span> and the name server. Currently,
the only supported encryption algorithm for TSIG is HMAC-MD5,
which is defined in RFC 2104. Once other algorithms are
defined for TSIG, applications will need to ensure they select
the appropriate algorithm as well as the key when authenticating
each other. For instance, suitable <span class="type">key</span> and
<span class="type">server</span> statements would be added to
<code class="filename">/etc/named.conf</code> so that the name server
can associate the appropriate secret key and algorithm with
the IP address of the client application that will be using
TSIG authentication. SIG(0) uses public key cryptography.
To use a SIG(0) key, the public key must be stored in a KEY
record in a zone served by the name server.
<span><strong class="command">nsupdate</strong></span> does not read
<code class="filename">/etc/named.conf</code>.
</p>
<p>
GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode
is switched on with the <code class="option">-g</code> flag. A
non-standards-compliant variant of GSS-TSIG used by Windows
2000 can be switched on with the <code class="option">-o</code> flag.
</p>
<p><span><strong class="command">nsupdate</strong></span>
uses the <code class="option">-y</code> or <code class="option">-k</code> option
to provide the shared secret needed to generate a TSIG record
for authenticating Dynamic DNS update requests, default type
HMAC-MD5. These options are mutually exclusive.
</p>
<p>
When the <code class="option">-y</code> option is used, a signature is
generated from
[<span class="optional"><em class="parameter"><code>hmac:</code></em></span>]<em class="parameter"><code>keyname:secret.</code></em>
<em class="parameter"><code>keyname</code></em> is the name of the key, and
<em class="parameter"><code>secret</code></em> is the base64 encoded shared secret.
<em class="parameter"><code>hmac</code></em> is the name of the key algorithm;
valid choices are <code class="literal">hmac-md5</code>,
<code class="literal">hmac-sha1</code>, <code class="literal">hmac-sha224</code>,
<code class="literal">hmac-sha256</code>, <code class="literal">hmac-sha384</code>, or
<code class="literal">hmac-sha512</code>. If <em class="parameter"><code>hmac</code></em>
is not specified, the default is <code class="literal">hmac-md5</code>.
NOTE: Use of the <code class="option">-y</code> option is discouraged because the
shared secret is supplied as a command line argument in clear text.
This may be visible in the output from
<span class="citerefentry"><span class="refentrytitle">ps</span>(1)</span>
or in a history file maintained by the user's shell.
</p>
<p>
With the
<code class="option">-k</code> option, <span><strong class="command">nsupdate</strong></span> reads
the shared secret from the file <em class="parameter"><code>keyfile</code></em>.
Keyfiles may be in two formats: a single file containing
a <code class="filename">named.conf</code>-format <span><strong class="command">key</strong></span>
statement, which may be generated automatically by
<span><strong class="command">ddns-confgen</strong></span>, or a pair of files whose names are
of the format <code class="filename">K{name}.+157.+{random}.key</code> and
<code class="filename">K{name}.+157.+{random}.private</code>, which can be
generated by <span><strong class="command">dnssec-keygen</strong></span>.
The <code class="option">-k</code> may also be used to specify a SIG(0) key used
to authenticate Dynamic DNS update requests. In this case, the key
specified is not an HMAC-MD5 key.
</p>
<p>
<span><strong class="command">nsupdate</strong></span> can be run in a local-host only mode
using the <code class="option">-l</code> flag. This sets the server address to
localhost (disabling the <span><strong class="command">server</strong></span> so that the server
address cannot be overridden). Connections to the local server will
use a TSIG key found in <code class="filename">/var/run/named/session.key</code>,
which is automatically generated by <span><strong class="command">named</strong></span> if any
local master zone has set <span><strong class="command">update-policy</strong></span> to
<span><strong class="command">local</strong></span>. The location of this key file can be
overridden with the <code class="option">-k</code> option.
</p>
<p>
By default, <span><strong class="command">nsupdate</strong></span>
uses UDP to send update requests to the name server unless they are too
large to fit in a UDP request in which case TCP will be used.
The
<code class="option">-v</code>
option makes
<span><strong class="command">nsupdate</strong></span>
use a TCP connection.
This may be preferable when a batch of update requests is made.
</p>
<p>
The <code class="option">-p</code> sets the default port number to use for
connections to a name server. The default is 53.
</p>
<p>
The <code class="option">-t</code> option sets the maximum time an update request
can
take before it is aborted. The default is 300 seconds. Zero can be
used
to disable the timeout.
</p>
<p>
The <code class="option">-u</code> option sets the UDP retry interval. The default
is
3 seconds. If zero, the interval will be computed from the timeout
interval
and number of UDP retries.
</p>
<p>
The <code class="option">-r</code> option sets the number of UDP retries. The
default is
3. If zero, only one update request will be made.
</p>
<p>
The <code class="option">-R <em class="replaceable"><code>randomdev</code></em></code> option
specifies a source of randomness. If the operating system
does not provide a <code class="filename">/dev/random</code> or
equivalent device, the default source of randomness is keyboard
input. <code class="filename">randomdev</code> specifies the name of
a character device or file containing random data to be used
instead of the default. The special value
<code class="filename">keyboard</code> indicates that keyboard input
should be used. This option may be specified multiple times.
</p>
<p>
Other types can be entered using "TYPEXXXXX" where "XXXXX" is the
decimal value of the type with no leading zeros. The rdata,
if present, will be parsed using the UNKNOWN rdata format,
(<backslash> <hash> <space> <length>
<space> <hexstring>).
</p>
<p>
The <code class="option">-T</code> and <code class="option">-P</code> options print out
lists of non-meta types for which the type-specific presentation
formats are known. <code class="option">-T</code> prints out the list of
IANA-assigned types. <code class="option">-P</code> prints out the list of
private types specific to <span><strong class="command">named</strong></span>. These options
may be combined. <span><strong class="command">nsupdate</strong></span> will exit after the
lists are printed.
</p>
<p>
The -V option causes <span><strong class="command">nsupdate</strong></span> to print the
version number and exit.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2543885"></a><h2>INPUT FORMAT</h2>
<p><span><strong class="command">nsupdate</strong></span>
reads input from
<em class="parameter"><code>filename</code></em>
or standard input.
Each command is supplied on exactly one line of input.
Some commands are for administrative purposes.
The others are either update instructions or prerequisite checks on the
contents of the zone.
These checks set conditions that some name or set of
resource records (RRset) either exists or is absent from the zone.
These conditions must be met if the entire update request is to succeed.
Updates will be rejected if the tests for the prerequisite conditions
fail.
</p>
<p>
Every update request consists of zero or more prerequisites
and zero or more updates.
This allows a suitably authenticated update request to proceed if some
specified resource records are present or missing from the zone.
A blank input line (or the <span><strong class="command">send</strong></span> command)
causes the
accumulated commands to be sent as one Dynamic DNS update request to the
name server.
</p>
<p>
The command formats and their meaning are as follows:
</p>
<div class="variablelist"><dl>
<dt><span class="term">
<span><strong class="command">server</strong></span>
{servername}
[port]
</span></dt>
<dd><p>
Sends all dynamic update requests to the name server
<em class="parameter"><code>servername</code></em>.
When no server statement is provided,
<span><strong class="command">nsupdate</strong></span>
will send updates to the master server of the correct zone.
The MNAME field of that zone's SOA record will identify the
master
server for that zone.
<em class="parameter"><code>port</code></em>
is the port number on
<em class="parameter"><code>servername</code></em>
where the dynamic update requests get sent.
If no port number is specified, the default DNS port number of
53 is
used.
</p></dd>
<dt><span class="term">
<span><strong class="command">local</strong></span>
{address}
[port]
</span></dt>
<dd><p>
Sends all dynamic update requests using the local
<em class="parameter"><code>address</code></em>.
When no local statement is provided,
<span><strong class="command">nsupdate</strong></span>
will send updates using an address and port chosen by the
system.
<em class="parameter"><code>port</code></em>
can additionally be used to make requests come from a specific
port.
If no port number is specified, the system will assign one.
</p></dd>
<dt><span class="term">
<span><strong class="command">zone</strong></span>
{zonename}
</span></dt>
<dd><p>
Specifies that all updates are to be made to the zone
<em class="parameter"><code>zonename</code></em>.
If no
<em class="parameter"><code>zone</code></em>
statement is provided,
<span><strong class="command">nsupdate</strong></span>
will attempt determine the correct zone to update based on the
rest of the input.
</p></dd>
<dt><span class="term">
<span><strong class="command">class</strong></span>
{classname}
</span></dt>
<dd><p>
Specify the default class.
If no <em class="parameter"><code>class</code></em> is specified, the
default class is
<em class="parameter"><code>IN</code></em>.
</p></dd>
<dt><span class="term">
<span><strong class="command">ttl</strong></span>
{seconds}
</span></dt>
<dd><p>
Specify the default time to live for records to be added.
The value <em class="parameter"><code>none</code></em> will clear the default
ttl.
</p></dd>
<dt><span class="term">
<span><strong class="command">key</strong></span>
[hmac:] {keyname}
{secret}
</span></dt>
<dd><p>
Specifies that all updates are to be TSIG-signed using the
<em class="parameter"><code>keyname</code></em> <em class="parameter"><code>secret</code></em> pair.
If <em class="parameter"><code>hmac</code></em> is specified, then it sets the
signing algorithm in use; the default is
<code class="literal">hmac-md5</code>. The <span><strong class="command">key</strong></span>
command overrides any key specified on the command line via
<code class="option">-y</code> or <code class="option">-k</code>.
</p></dd>
<dt><span class="term">
<span><strong class="command">gsstsig</strong></span>
</span></dt>
<dd><p>
Use GSS-TSIG to sign the updated. This is equivalent to
specifying <code class="option">-g</code> on the commandline.
</p></dd>
<dt><span class="term">
<span><strong class="command">oldgsstsig</strong></span>
</span></dt>
<dd><p>
Use the Windows 2000 version of GSS-TSIG to sign the updated.
This is equivalent to specifying <code class="option">-o</code> on the
commandline.
</p></dd>
<dt><span class="term">
<span><strong class="command">realm</strong></span>
{[<span class="optional">realm_name</span>]}
</span></dt>
<dd><p>
When using GSS-TSIG use <em class="parameter"><code>realm_name</code></em> rather
than the default realm in <code class="filename">krb5.conf</code>. If no
realm is specified the saved realm is cleared.
</p></dd>
<dt><span class="term">
<span><strong class="command">[<span class="optional">prereq</span>] nxdomain</strong></span>
{domain-name}
</span></dt>
<dd><p>
Requires that no resource record of any type exists with name
<em class="parameter"><code>domain-name</code></em>.
</p></dd>
<dt><span class="term">
<span><strong class="command">[<span class="optional">prereq</span>] yxdomain</strong></span>
{domain-name}
</span></dt>
<dd><p>
Requires that
<em class="parameter"><code>domain-name</code></em>
exists (has as at least one resource record, of any type).
</p></dd>
<dt><span class="term">
<span><strong class="command">[<span class="optional">prereq</span>] nxrrset</strong></span>
{domain-name}
[class]
{type}
</span></dt>
<dd><p>
Requires that no resource record exists of the specified
<em class="parameter"><code>type</code></em>,
<em class="parameter"><code>class</code></em>
and
<em class="parameter"><code>domain-name</code></em>.
If
<em class="parameter"><code>class</code></em>
is omitted, IN (internet) is assumed.
</p></dd>
<dt><span class="term">
<span><strong class="command">[<span class="optional">prereq</span>] yxrrset</strong></span>
{domain-name}
[class]
{type}
</span></dt>
<dd><p>
This requires that a resource record of the specified
<em class="parameter"><code>type</code></em>,
<em class="parameter"><code>class</code></em>
and
<em class="parameter"><code>domain-name</code></em>
must exist.
If
<em class="parameter"><code>class</code></em>
is omitted, IN (internet) is assumed.
</p></dd>
<dt><span class="term">
<span><strong class="command">[<span class="optional">prereq</span>] yxrrset</strong></span>
{domain-name}
[class]
{type}
{data...}
</span></dt>
<dd><p>
The
<em class="parameter"><code>data</code></em>
from each set of prerequisites of this form
sharing a common
<em class="parameter"><code>type</code></em>,
<em class="parameter"><code>class</code></em>,
and
<em class="parameter"><code>domain-name</code></em>
are combined to form a set of RRs. This set of RRs must
exactly match the set of RRs existing in the zone at the
given
<em class="parameter"><code>type</code></em>,
<em class="parameter"><code>class</code></em>,
and
<em class="parameter"><code>domain-name</code></em>.
The
<em class="parameter"><code>data</code></em>
are written in the standard text representation of the resource
record's
RDATA.
</p></dd>
<dt><span class="term">
<span><strong class="command">[<span class="optional">update</span>] del[<span class="optional">ete</span>]</strong></span>
{domain-name}
[ttl]
[class]
[type [data...]]
</span></dt>
<dd><p>
Deletes any resource records named
<em class="parameter"><code>domain-name</code></em>.
If
<em class="parameter"><code>type</code></em>
and
<em class="parameter"><code>data</code></em>
is provided, only matching resource records will be removed.
The internet class is assumed if
<em class="parameter"><code>class</code></em>
is not supplied. The
<em class="parameter"><code>ttl</code></em>
is ignored, and is only allowed for compatibility.
</p></dd>
<dt><span class="term">
<span><strong class="command">[<span class="optional">update</span>] add</strong></span>
{domain-name}
{ttl}
[class]
{type}
{data...}
</span></dt>
<dd><p>
Adds a new resource record with the specified
<em class="parameter"><code>ttl</code></em>,
<em class="parameter"><code>class</code></em>
and
<em class="parameter"><code>data</code></em>.
</p></dd>
<dt><span class="term">
<span><strong class="command">show</strong></span>
</span></dt>
<dd><p>
Displays the current message, containing all of the
prerequisites and
updates specified since the last send.
</p></dd>
<dt><span class="term">
<span><strong class="command">send</strong></span>
</span></dt>
<dd><p>
Sends the current message. This is equivalent to entering a
blank line.
</p></dd>
<dt><span class="term">
<span><strong class="command">answer</strong></span>
</span></dt>
<dd><p>
Displays the answer.
</p></dd>
<dt><span class="term">
<span><strong class="command">debug</strong></span>
</span></dt>
<dd><p>
Turn on debugging.
</p></dd>
<dt><span class="term">
<span><strong class="command">version</strong></span>
</span></dt>
<dd><p>
Print version number.
</p></dd>
<dt><span class="term">
<span><strong class="command">help</strong></span>
</span></dt>
<dd><p>
Print a list of commands.
</p></dd>
</dl></div>
<p>
</p>
<p>
Lines beginning with a semicolon are comments and are ignored.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544859"></a><h2>EXAMPLES</h2>
<p>
The examples below show how
<span><strong class="command">nsupdate</strong></span>
could be used to insert and delete resource records from the
<span class="type">example.com</span>
zone.
Notice that the input in each example contains a trailing blank line so
that
a group of commands are sent as one dynamic update request to the
master name server for
<span class="type">example.com</span>.
</p>
<pre class="programlisting">
# nsupdate
> update delete oldhost.example.com A
> update add newhost.example.com 86400 A 172.16.1.1
> send
</pre>
<p>
</p>
<p>
Any A records for
<span class="type">oldhost.example.com</span>
are deleted.
And an A record for
<span class="type">newhost.example.com</span>
with IP address 172.16.1.1 is added.
The newly-added record has a 1 day TTL (86400 seconds).
</p>
<pre class="programlisting">
# nsupdate
> prereq nxdomain nickname.example.com
> update add nickname.example.com 86400 CNAME somehost.example.com
> send
</pre>
<p>
</p>
<p>
The prerequisite condition gets the name server to check that there
are no resource records of any type for
<span class="type">nickname.example.com</span>.
If there are, the update request fails.
If this name does not exist, a CNAME for it is added.
This ensures that when the CNAME is added, it cannot conflict with the
long-standing rule in RFC 1034 that a name must not exist as any other
record type if it exists as a CNAME.
(The rule has been updated for DNSSEC in RFC 2535 to allow CNAMEs to have
RRSIG, DNSKEY and NSEC records.)
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544903"></a><h2>FILES</h2>
<div class="variablelist"><dl>
<dt><span class="term"><code class="constant">/etc/resolv.conf</code></span></dt>
<dd><p>
used to identify default name server
</p></dd>
<dt><span class="term"><code class="constant">/var/run/named/session.key</code></span></dt>
<dd><p>
sets the default TSIG key for use in local-only mode
</p></dd>
<dt><span class="term"><code class="constant">K{name}.+157.+{random}.key</code></span></dt>
<dd><p>
base-64 encoding of HMAC-MD5 key created by
<span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
</p></dd>
<dt><span class="term"><code class="constant">K{name}.+157.+{random}.private</code></span></dt>
<dd><p>
base-64 encoding of HMAC-MD5 key created by
<span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
</p></dd>
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id2541982"></a><h2>SEE ALSO</h2>
<p>
<em class="citetitle">RFC 2136</em>,
<em class="citetitle">RFC 3007</em>,
<em class="citetitle">RFC 2104</em>,
<em class="citetitle">RFC 2845</em>,
<em class="citetitle">RFC 1034</em>,
<em class="citetitle">RFC 2535</em>,
<em class="citetitle">RFC 2931</em>,
<span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
<span class="citerefentry"><span class="refentrytitle">ddns-confgen</span>(8)</span>,
<span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2542040"></a><h2>BUGS</h2>
<p>
The TSIG key is redundantly stored in two separate files.
This is a consequence of nsupdate using the DST library
for its cryptographic operations, and may change in future
releases.
</p>
</div>
</div></body>
</html>
|
{
"pile_set_name": "Github"
}
|
#pragma once
#include "../Object.h"
namespace kv
{
class UnsyncGenerator : public Object
{
public:
DECLARE_SAVEABLE(UnsyncGenerator, Object);
REGISTER_CLASS_AS(UnsyncGenerator);
UnsyncGenerator();
void PerformUnsync();
private:
QString KV_SAVEABLE(unsync_string_);
};
END_DECLARE(UnsyncGenerator);
}
|
{
"pile_set_name": "Github"
}
|
<!--
SOFT BODY
-->
<HTML>
<HEAD>
<TITLE>DYN SOFT BODY FREE VERTEX</TITLE>
<link rel="stylesheet" type="text/css" href="style1.css"/>
</HEAD>
<BODY id = "wrap">
<span class="returns"></span>
DYN SOFT BODY FREE VERTEX
<span class="parameters">(int softBodyID, int vertexID)
</span>
<br><br>Frees a previously attached soft body vertex.
<br><br>
<span class="parameters">Parameters:
</span>
<br>softBodyID - ID number of the soft body.
<br>vertexID - ID of the vertex you wish to free.
<br>
<br>
<br>
<span class="returns">Returns:
</span>
<br>None
<br>
</BODY>
</HTML>
<br>
<br>
|
{
"pile_set_name": "Github"
}
|
<a href="https://github.com/TencentCloudBase/cloudbase-templates"><img src="https://main.qcloudimg.com/raw/918830a5ad3321fd0524eaef4c0e4c1e.png"></a>
# Next SSR 应用示例
这个目录是基于云开发的一个 [Next-SSR](https://nextjs.org/) 应用示例,包含 Next + 云函数 + 静态网站部署,可以基于 **[CloudBase Framework](https://github.com/TencentCloudBase/cloudbase-framework)** 框架将项目一键部署到云开发环境
## 部署一个 Next SSR 应用
### 步骤一. 准备工作
具体步骤请参照 [准备云开发环境和 CloudBase CLI 命令工具](https://github.com/TencentCloudBase/cloudbase-framework/blob/master/CLI_GUIDE.md)
### 步骤二. 初始化应用示例
在命令行执行
```
cloudbase init --tempate next-ssr
```
### 步骤三. 一键部署
进入到项目目录,在命令行执行
```
cloudbase framework:deploy
```
## 开发命令及配置
### 本地开发
```
npm run dev
```
### 上线部署
```
npm run deploy
```
### CloudBase Framework 相关开发配置
查看 [CloudBase Framework 配置](https://github.com/TencentCloudBase/cloudbase-framework).
### Next 相关开发配置
查看 [Configuration Reference](https://nextjs.org/docs/api-reference/next.config.js/introduction).
|
{
"pile_set_name": "Github"
}
|
; RUN: opt -instcombine -S < %s | FileCheck %s
; --------------------------------------------------------------------
; llvm.amdgcn.rcp
; --------------------------------------------------------------------
declare float @llvm.amdgcn.rcp.f32(float) nounwind readnone
declare double @llvm.amdgcn.rcp.f64(double) nounwind readnone
; CHECK-LABEL: @test_constant_fold_rcp_f32_undef
; CHECK-NEXT: ret float undef
define float @test_constant_fold_rcp_f32_undef() nounwind {
%val = call float @llvm.amdgcn.rcp.f32(float undef) nounwind readnone
ret float %val
}
; CHECK-LABEL: @test_constant_fold_rcp_f32_1
; CHECK-NEXT: ret float 1.000000e+00
define float @test_constant_fold_rcp_f32_1() nounwind {
%val = call float @llvm.amdgcn.rcp.f32(float 1.0) nounwind readnone
ret float %val
}
; CHECK-LABEL: @test_constant_fold_rcp_f64_1
; CHECK-NEXT: ret double 1.000000e+00
define double @test_constant_fold_rcp_f64_1() nounwind {
%val = call double @llvm.amdgcn.rcp.f64(double 1.0) nounwind readnone
ret double %val
}
; CHECK-LABEL: @test_constant_fold_rcp_f32_half
; CHECK-NEXT: ret float 2.000000e+00
define float @test_constant_fold_rcp_f32_half() nounwind {
%val = call float @llvm.amdgcn.rcp.f32(float 0.5) nounwind readnone
ret float %val
}
; CHECK-LABEL: @test_constant_fold_rcp_f64_half
; CHECK-NEXT: ret double 2.000000e+00
define double @test_constant_fold_rcp_f64_half() nounwind {
%val = call double @llvm.amdgcn.rcp.f64(double 0.5) nounwind readnone
ret double %val
}
; CHECK-LABEL: @test_constant_fold_rcp_f32_43
; CHECK-NEXT: call float @llvm.amdgcn.rcp.f32(float 4.300000e+01)
define float @test_constant_fold_rcp_f32_43() nounwind {
%val = call float @llvm.amdgcn.rcp.f32(float 4.300000e+01) nounwind readnone
ret float %val
}
; CHECK-LABEL: @test_constant_fold_rcp_f64_43
; CHECK-NEXT: call double @llvm.amdgcn.rcp.f64(double 4.300000e+01)
define double @test_constant_fold_rcp_f64_43() nounwind {
%val = call double @llvm.amdgcn.rcp.f64(double 4.300000e+01) nounwind readnone
ret double %val
}
; --------------------------------------------------------------------
; llvm.amdgcn.rsq
; --------------------------------------------------------------------
declare float @llvm.amdgcn.rsq.f32(float) nounwind readnone
; CHECK-LABEL: @test_constant_fold_rsq_f32_undef
; CHECK-NEXT: ret float undef
define float @test_constant_fold_rsq_f32_undef() nounwind {
%val = call float @llvm.amdgcn.rsq.f32(float undef) nounwind readnone
ret float %val
}
; --------------------------------------------------------------------
; llvm.amdgcn.frexp.mant
; --------------------------------------------------------------------
declare float @llvm.amdgcn.frexp.mant.f32(float) nounwind readnone
declare double @llvm.amdgcn.frexp.mant.f64(double) nounwind readnone
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_undef(
; CHECK-NEXT: ret float undef
define float @test_constant_fold_frexp_mant_f32_undef() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float undef)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_undef(
; CHECK-NEXT: ret double undef
define double @test_constant_fold_frexp_mant_f64_undef() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double undef)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_0(
; CHECK-NEXT: ret float 0.000000e+00
define float @test_constant_fold_frexp_mant_f32_0() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float 0.0)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_0(
; CHECK-NEXT: ret double 0.000000e+00
define double @test_constant_fold_frexp_mant_f64_0() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double 0.0)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_n0(
; CHECK-NEXT: ret float -0.000000e+00
define float @test_constant_fold_frexp_mant_f32_n0() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float -0.0)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_n0(
; CHECK-NEXT: ret double -0.000000e+00
define double @test_constant_fold_frexp_mant_f64_n0() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double -0.0)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_1(
; CHECK-NEXT: ret float 5.000000e-01
define float @test_constant_fold_frexp_mant_f32_1() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float 1.0)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_1(
; CHECK-NEXT: ret double 5.000000e-01
define double @test_constant_fold_frexp_mant_f64_1() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double 1.0)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_n1(
; CHECK-NEXT: ret float -5.000000e-01
define float @test_constant_fold_frexp_mant_f32_n1() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float -1.0)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_n1(
; CHECK-NEXT: ret double -5.000000e-01
define double @test_constant_fold_frexp_mant_f64_n1() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double -1.0)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_nan(
; CHECK-NEXT: ret float 0x7FF8000000000000
define float @test_constant_fold_frexp_mant_f32_nan() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float 0x7FF8000000000000)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_nan(
; CHECK-NEXT: ret double 0x7FF8000000000000
define double @test_constant_fold_frexp_mant_f64_nan() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double 0x7FF8000000000000)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_inf(
; CHECK-NEXT: ret float 0x7FF0000000000000
define float @test_constant_fold_frexp_mant_f32_inf() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float 0x7FF0000000000000)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_inf(
; CHECK-NEXT: ret double 0x7FF0000000000000
define double @test_constant_fold_frexp_mant_f64_inf() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double 0x7FF0000000000000)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_ninf(
; CHECK-NEXT: ret float 0xFFF0000000000000
define float @test_constant_fold_frexp_mant_f32_ninf() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float 0xFFF0000000000000)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_ninf(
; CHECK-NEXT: ret double 0xFFF0000000000000
define double @test_constant_fold_frexp_mant_f64_ninf() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double 0xFFF0000000000000)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_max_num(
; CHECK-NEXT: ret float 0x3FEFFFFFE0000000
define float @test_constant_fold_frexp_mant_f32_max_num() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float 0x47EFFFFFE0000000)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_max_num(
; CHECK-NEXT: ret double 0x3FEFFFFFFFFFFFFF
define double @test_constant_fold_frexp_mant_f64_max_num() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double 0x7FEFFFFFFFFFFFFF)
ret double %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f32_min_num(
; CHECK-NEXT: ret float 5.000000e-01
define float @test_constant_fold_frexp_mant_f32_min_num() nounwind {
%val = call float @llvm.amdgcn.frexp.mant.f32(float 0x36A0000000000000)
ret float %val
}
; CHECK-LABEL: @test_constant_fold_frexp_mant_f64_min_num(
; CHECK-NEXT: ret double 5.000000e-01
define double @test_constant_fold_frexp_mant_f64_min_num() nounwind {
%val = call double @llvm.amdgcn.frexp.mant.f64(double 4.940656e-324)
ret double %val
}
; --------------------------------------------------------------------
; llvm.amdgcn.frexp.exp
; --------------------------------------------------------------------
declare i32 @llvm.amdgcn.frexp.exp.f32(float) nounwind readnone
declare i32 @llvm.amdgcn.frexp.exp.f64(double) nounwind readnone
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_undef(
; CHECK-NEXT: ret i32 undef
define i32 @test_constant_fold_frexp_exp_f32_undef() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float undef)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_undef(
; CHECK-NEXT: ret i32 undef
define i32 @test_constant_fold_frexp_exp_f64_undef() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double undef)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_0(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f32_0() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float 0.0)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_0(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f64_0() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double 0.0)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_n0(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f32_n0() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float -0.0)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_n0(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f64_n0() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double -0.0)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_1024(
; CHECK-NEXT: ret i32 11
define i32 @test_constant_fold_frexp_exp_f32_1024() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float 1024.0)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_1024(
; CHECK-NEXT: ret i32 11
define i32 @test_constant_fold_frexp_exp_f64_1024() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double 1024.0)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_n1024(
; CHECK-NEXT: ret i32 11
define i32 @test_constant_fold_frexp_exp_f32_n1024() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float -1024.0)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_n1024(
; CHECK-NEXT: ret i32 11
define i32 @test_constant_fold_frexp_exp_f64_n1024() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double -1024.0)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_1_1024(
; CHECK-NEXT: ret i32 -9
define i32 @test_constant_fold_frexp_exp_f32_1_1024() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float 0.0009765625)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_1_1024(
; CHECK-NEXT: ret i32 -9
define i32 @test_constant_fold_frexp_exp_f64_1_1024() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double 0.0009765625)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_nan(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f32_nan() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float 0x7FF8000000000000)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_nan(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f64_nan() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double 0x7FF8000000000000)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_inf(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f32_inf() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float 0x7FF0000000000000)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_inf(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f64_inf() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double 0x7FF0000000000000)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_ninf(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f32_ninf() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float 0xFFF0000000000000)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_ninf(
; CHECK-NEXT: ret i32 0
define i32 @test_constant_fold_frexp_exp_f64_ninf() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double 0xFFF0000000000000)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_max_num(
; CHECK-NEXT: ret i32 128
define i32 @test_constant_fold_frexp_exp_f32_max_num() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float 0x47EFFFFFE0000000)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_max_num(
; CHECK-NEXT: ret i32 1024
define i32 @test_constant_fold_frexp_exp_f64_max_num() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double 0x7FEFFFFFFFFFFFFF)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f32_min_num(
; CHECK-NEXT: ret i32 -148
define i32 @test_constant_fold_frexp_exp_f32_min_num() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f32(float 0x36A0000000000000)
ret i32 %val
}
; CHECK-LABEL: @test_constant_fold_frexp_exp_f64_min_num(
; CHECK-NEXT: ret i32 -1073
define i32 @test_constant_fold_frexp_exp_f64_min_num() nounwind {
%val = call i32 @llvm.amdgcn.frexp.exp.f64(double 4.940656e-324)
ret i32 %val
}
; --------------------------------------------------------------------
; llvm.amdgcn.class
; --------------------------------------------------------------------
declare i1 @llvm.amdgcn.class.f32(float, i32) nounwind readnone
declare i1 @llvm.amdgcn.class.f64(double, i32) nounwind readnone
; CHECK-LABEL: @test_class_undef_mask_f32(
; CHECK: ret i1 false
define i1 @test_class_undef_mask_f32(float %x) nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float %x, i32 undef)
ret i1 %val
}
; CHECK-LABEL: @test_class_over_max_mask_f32(
; CHECK: %val = call i1 @llvm.amdgcn.class.f32(float %x, i32 1)
define i1 @test_class_over_max_mask_f32(float %x) nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float %x, i32 1025)
ret i1 %val
}
; CHECK-LABEL: @test_class_no_mask_f32(
; CHECK: ret i1 false
define i1 @test_class_no_mask_f32(float %x) nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float %x, i32 0)
ret i1 %val
}
; CHECK-LABEL: @test_class_full_mask_f32(
; CHECK: ret i1 true
define i1 @test_class_full_mask_f32(float %x) nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float %x, i32 1023)
ret i1 %val
}
; CHECK-LABEL: @test_class_undef_no_mask_f32(
; CHECK: ret i1 false
define i1 @test_class_undef_no_mask_f32() nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float undef, i32 0)
ret i1 %val
}
; CHECK-LABEL: @test_class_undef_full_mask_f32(
; CHECK: ret i1 true
define i1 @test_class_undef_full_mask_f32() nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float undef, i32 1023)
ret i1 %val
}
; CHECK-LABEL: @test_class_undef_val_f32(
; CHECK: ret i1 undef
define i1 @test_class_undef_val_f32() nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float undef, i32 4)
ret i1 %val
}
; CHECK-LABEL: @test_class_undef_undef_f32(
; CHECK: ret i1 undef
define i1 @test_class_undef_undef_f32() nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float undef, i32 undef)
ret i1 %val
}
; CHECK-LABEL: @test_class_var_mask_f32(
; CHECK: %val = call i1 @llvm.amdgcn.class.f32(float %x, i32 %mask)
define i1 @test_class_var_mask_f32(float %x, i32 %mask) nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float %x, i32 %mask)
ret i1 %val
}
; CHECK-LABEL: @test_class_isnan_f32(
; CHECK: %val = fcmp uno float %x, 0.000000e+00
define i1 @test_class_isnan_f32(float %x) nounwind {
%val = call i1 @llvm.amdgcn.class.f32(float %x, i32 3)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_snan_test_snan_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_snan_test_snan_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF0000000000001, i32 1)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_qnan_test_qnan_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_qnan_test_qnan_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF8000000000000, i32 2)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_qnan_test_snan_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_qnan_test_snan_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF8000000000000, i32 1)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_ninf_test_ninf_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_ninf_test_ninf_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0xFFF0000000000000, i32 4)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_pinf_test_ninf_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_pinf_test_ninf_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF0000000000000, i32 4)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_qnan_test_ninf_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_qnan_test_ninf_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF8000000000000, i32 4)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_snan_test_ninf_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_snan_test_ninf_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF0000000000001, i32 4)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_nnormal_test_nnormal_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_nnormal_test_nnormal_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double -1.0, i32 8)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_pnormal_test_nnormal_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_pnormal_test_nnormal_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 1.0, i32 8)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_nsubnormal_test_nsubnormal_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_nsubnormal_test_nsubnormal_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x800fffffffffffff, i32 16)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_psubnormal_test_nsubnormal_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_psubnormal_test_nsubnormal_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x000fffffffffffff, i32 16)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_nzero_test_nzero_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_nzero_test_nzero_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double -0.0, i32 32)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_pzero_test_nzero_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_pzero_test_nzero_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0.0, i32 32)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_pzero_test_pzero_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_pzero_test_pzero_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0.0, i32 64)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_nzero_test_pzero_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_nzero_test_pzero_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double -0.0, i32 64)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_psubnormal_test_psubnormal_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_psubnormal_test_psubnormal_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x000fffffffffffff, i32 128)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_nsubnormal_test_psubnormal_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_nsubnormal_test_psubnormal_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x800fffffffffffff, i32 128)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_pnormal_test_pnormal_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_pnormal_test_pnormal_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 1.0, i32 256)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_nnormal_test_pnormal_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_nnormal_test_pnormal_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double -1.0, i32 256)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_pinf_test_pinf_f64(
; CHECK: ret i1 true
define i1 @test_constant_class_pinf_test_pinf_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF0000000000000, i32 512)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_ninf_test_pinf_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_ninf_test_pinf_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0xFFF0000000000000, i32 512)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_qnan_test_pinf_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_qnan_test_pinf_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF8000000000000, i32 512)
ret i1 %val
}
; CHECK-LABEL: @test_constant_class_snan_test_pinf_f64(
; CHECK: ret i1 false
define i1 @test_constant_class_snan_test_pinf_f64() nounwind {
%val = call i1 @llvm.amdgcn.class.f64(double 0x7FF0000000000001, i32 512)
ret i1 %val
}
; --------------------------------------------------------------------
; llvm.amdgcn.cos
; --------------------------------------------------------------------
declare float @llvm.amdgcn.cos.f32(float) nounwind readnone
declare float @llvm.fabs.f32(float) nounwind readnone
; CHECK-LABEL: @cos_fneg_f32(
; CHECK: %cos = call float @llvm.amdgcn.cos.f32(float %x)
; CHECK-NEXT: ret float %cos
define float @cos_fneg_f32(float %x) {
%x.fneg = fsub float -0.0, %x
%cos = call float @llvm.amdgcn.cos.f32(float %x.fneg)
ret float %cos
}
; CHECK-LABEL: @cos_fabs_f32(
; CHECK-NEXT: %cos = call float @llvm.amdgcn.cos.f32(float %x)
; CHECK-NEXT: ret float %cos
define float @cos_fabs_f32(float %x) {
%x.fabs = call float @llvm.fabs.f32(float %x)
%cos = call float @llvm.amdgcn.cos.f32(float %x.fabs)
ret float %cos
}
; CHECK-LABEL: @cos_fabs_fneg_f32(
; CHECK-NEXT: %cos = call float @llvm.amdgcn.cos.f32(float %x)
; CHECK-NEXT: ret float %cos
define float @cos_fabs_fneg_f32(float %x) {
%x.fabs = call float @llvm.fabs.f32(float %x)
%x.fabs.fneg = fsub float -0.0, %x.fabs
%cos = call float @llvm.amdgcn.cos.f32(float %x.fabs.fneg)
ret float %cos
}
; --------------------------------------------------------------------
; llvm.amdgcn.cvt.pkrtz
; --------------------------------------------------------------------
declare <2 x half> @llvm.amdgcn.cvt.pkrtz(float, float) nounwind readnone
; CHECK-LABEL: @vars_lhs_cvt_pkrtz(
; CHECK: %cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float %x, float %y)
define <2 x half> @vars_lhs_cvt_pkrtz(float %x, float %y) {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float %x, float %y)
ret <2 x half> %cvt
}
; CHECK-LABEL: @constant_lhs_cvt_pkrtz(
; CHECK: %cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float 0.000000e+00, float %y)
define <2 x half> @constant_lhs_cvt_pkrtz(float %y) {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float 0.0, float %y)
ret <2 x half> %cvt
}
; CHECK-LABEL: @constant_rhs_cvt_pkrtz(
; CHECK: %cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float %x, float 0.000000e+00)
define <2 x half> @constant_rhs_cvt_pkrtz(float %x) {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float %x, float 0.0)
ret <2 x half> %cvt
}
; CHECK-LABEL: @undef_lhs_cvt_pkrtz(
; CHECK: %cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float undef, float %y)
define <2 x half> @undef_lhs_cvt_pkrtz(float %y) {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float undef, float %y)
ret <2 x half> %cvt
}
; CHECK-LABEL: @undef_rhs_cvt_pkrtz(
; CHECK: %cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float %x, float undef)
define <2 x half> @undef_rhs_cvt_pkrtz(float %x) {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float %x, float undef)
ret <2 x half> %cvt
}
; CHECK-LABEL: @undef_cvt_pkrtz(
; CHECK: ret <2 x half> undef
define <2 x half> @undef_cvt_pkrtz() {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float undef, float undef)
ret <2 x half> %cvt
}
; CHECK-LABEL: @constant_splat0_cvt_pkrtz(
; CHECK: ret <2 x half> zeroinitializer
define <2 x half> @constant_splat0_cvt_pkrtz() {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float 0.0, float 0.0)
ret <2 x half> %cvt
}
; CHECK-LABEL: @constant_cvt_pkrtz(
; CHECK: ret <2 x half> <half 0xH4000, half 0xH4400>
define <2 x half> @constant_cvt_pkrtz() {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float 2.0, float 4.0)
ret <2 x half> %cvt
}
; Test constant values where rtz changes result
; CHECK-LABEL: @constant_rtz_pkrtz(
; CHECK: ret <2 x half> <half 0xH7BFF, half 0xH7BFF>
define <2 x half> @constant_rtz_pkrtz() {
%cvt = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float 65535.0, float 65535.0)
ret <2 x half> %cvt
}
; --------------------------------------------------------------------
; llvm.amdgcn.ubfe
; --------------------------------------------------------------------
declare i32 @llvm.amdgcn.ubfe.i32(i32, i32, i32) nounwind readnone
declare i64 @llvm.amdgcn.ubfe.i64(i64, i32, i32) nounwind readnone
; CHECK-LABEL: @ubfe_var_i32(
; CHECK-NEXT: %bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 %width)
define i32 @ubfe_var_i32(i32 %src, i32 %offset, i32 %width) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_clear_high_bits_constant_offset_i32(
; CHECK-NEXT: %bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 5, i32 %width)
define i32 @ubfe_clear_high_bits_constant_offset_i32(i32 %src, i32 %width) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 133, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_clear_high_bits_constant_width_i32(
; CHECK-NEXT: %bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 5)
define i32 @ubfe_clear_high_bits_constant_width_i32(i32 %src, i32 %offset) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 133)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_width_0(
; CHECK-NEXT: ret i32 0
define i32 @ubfe_width_0(i32 %src, i32 %offset) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 0)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_width_31(
; CHECK: %bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 31)
define i32 @ubfe_width_31(i32 %src, i32 %offset) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 31)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_width_32(
; CHECK-NEXT: ret i32 0
define i32 @ubfe_width_32(i32 %src, i32 %offset) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 32)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_width_33(
; CHECK-NEXT: %bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 1)
define i32 @ubfe_width_33(i32 %src, i32 %offset) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 33)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_33(
; CHECK-NEXT: %bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 1, i32 %width)
define i32 @ubfe_offset_33(i32 %src, i32 %width) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 33, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_0(
; CHECK-NEXT: %1 = sub i32 32, %width
; CHECK-NEXT: %2 = shl i32 %src, %1
; CHECK-NEXT: %bfe = lshr i32 %2, %1
; CHECK-NEXT: ret i32 %bfe
define i32 @ubfe_offset_0(i32 %src, i32 %width) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 0, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_32(
; CHECK-NEXT: %1 = sub i32 32, %width
; CHECK-NEXT: %2 = shl i32 %src, %1
; CHECK-NEXT: %bfe = lshr i32 %2, %1
; CHECK-NEXT: ret i32 %bfe
define i32 @ubfe_offset_32(i32 %src, i32 %width) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 32, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_31(
; CHECK-NEXT: %1 = sub i32 32, %width
; CHECK-NEXT: %2 = shl i32 %src, %1
; CHECK-NEXT: %bfe = lshr i32 %2, %1
; CHECK-NEXT: ret i32 %bfe
define i32 @ubfe_offset_31(i32 %src, i32 %width) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 32, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_0_width_0(
; CHECK-NEXT: ret i32 0
define i32 @ubfe_offset_0_width_0(i32 %src) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 0, i32 0)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_0_width_3(
; CHECK-NEXT: and i32 %src, 7
; CHECK-NEXT: ret
define i32 @ubfe_offset_0_width_3(i32 %src) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 0, i32 3)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_3_width_1(
; CHECK-NEXT: %1 = lshr i32 %src, 3
; CHECK-NEXT: and i32 %1, 1
; CHECK-NEXT: ret i32
define i32 @ubfe_offset_3_width_1(i32 %src) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 3, i32 1)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_3_width_4(
; CHECK-NEXT: %1 = lshr i32 %src, 3
; CHECK-NEXT: and i32 %1, 15
; CHECK-NEXT: ret i32
define i32 @ubfe_offset_3_width_4(i32 %src) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 3, i32 4)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_0_0_0(
; CHECK-NEXT: ret i32 0
define i32 @ubfe_0_0_0() {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 0, i32 0, i32 0)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_neg1_5_7(
; CHECK-NEXT: ret i32 127
define i32 @ubfe_neg1_5_7() {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 -1, i32 5, i32 7)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_undef_src_i32(
; CHECK-NEXT: ret i32 undef
define i32 @ubfe_undef_src_i32(i32 %offset, i32 %width) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 undef, i32 %offset, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_undef_offset_i32(
; CHECK: %bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 undef, i32 %width)
define i32 @ubfe_undef_offset_i32(i32 %src, i32 %width) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 undef, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_undef_width_i32(
; CHECK: %bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 undef)
define i32 @ubfe_undef_width_i32(i32 %src, i32 %offset) {
%bfe = call i32 @llvm.amdgcn.ubfe.i32(i32 %src, i32 %offset, i32 undef)
ret i32 %bfe
}
; CHECK-LABEL: @ubfe_offset_33_width_4_i64(
; CHECK-NEXT: %1 = lshr i64 %src, 33
; CHECK-NEXT: %bfe = and i64 %1, 15
define i64 @ubfe_offset_33_width_4_i64(i64 %src) {
%bfe = call i64 @llvm.amdgcn.ubfe.i64(i64 %src, i32 33, i32 4)
ret i64 %bfe
}
; CHECK-LABEL: @ubfe_offset_0_i64(
; CHECK-NEXT: %1 = sub i32 64, %width
; CHECK-NEXT: %2 = zext i32 %1 to i64
; CHECK-NEXT: %3 = shl i64 %src, %2
; CHECK-NEXT: %bfe = lshr i64 %3, %2
; CHECK-NEXT: ret i64 %bfe
define i64 @ubfe_offset_0_i64(i64 %src, i32 %width) {
%bfe = call i64 @llvm.amdgcn.ubfe.i64(i64 %src, i32 0, i32 %width)
ret i64 %bfe
}
; CHECK-LABEL: @ubfe_offset_32_width_32_i64(
; CHECK-NEXT: %bfe = lshr i64 %src, 32
; CHECK-NEXT: ret i64 %bfe
define i64 @ubfe_offset_32_width_32_i64(i64 %src) {
%bfe = call i64 @llvm.amdgcn.ubfe.i64(i64 %src, i32 32, i32 32)
ret i64 %bfe
}
; --------------------------------------------------------------------
; llvm.amdgcn.sbfe
; --------------------------------------------------------------------
declare i32 @llvm.amdgcn.sbfe.i32(i32, i32, i32) nounwind readnone
declare i64 @llvm.amdgcn.sbfe.i64(i64, i32, i32) nounwind readnone
; CHECK-LABEL: @sbfe_offset_31(
; CHECK-NEXT: %1 = sub i32 32, %width
; CHECK-NEXT: %2 = shl i32 %src, %1
; CHECK-NEXT: %bfe = ashr i32 %2, %1
; CHECK-NEXT: ret i32 %bfe
define i32 @sbfe_offset_31(i32 %src, i32 %width) {
%bfe = call i32 @llvm.amdgcn.sbfe.i32(i32 %src, i32 32, i32 %width)
ret i32 %bfe
}
; CHECK-LABEL: @sbfe_neg1_5_7(
; CHECK-NEXT: ret i32 -1
define i32 @sbfe_neg1_5_7() {
%bfe = call i32 @llvm.amdgcn.sbfe.i32(i32 -1, i32 5, i32 7)
ret i32 %bfe
}
; CHECK-LABEL: @sbfe_offset_32_width_32_i64(
; CHECK-NEXT: %bfe = ashr i64 %src, 32
; CHECK-NEXT: ret i64 %bfe
define i64 @sbfe_offset_32_width_32_i64(i64 %src) {
%bfe = call i64 @llvm.amdgcn.sbfe.i64(i64 %src, i32 32, i32 32)
ret i64 %bfe
}
; --------------------------------------------------------------------
; llvm.amdgcn.exp
; --------------------------------------------------------------------
declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) nounwind inaccessiblememonly
; Make sure no crashing on invalid variable params
; CHECK-LABEL: @exp_invalid_inputs(
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 %en, float 1.000000e+00, float 2.000000e+00, float 5.000000e-01, float 4.000000e+00, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 %tgt, i32 15, float 1.000000e+00, float 2.000000e+00, float 5.000000e-01, float 4.000000e+00, i1 true, i1 false)
define void @exp_invalid_inputs(i32 %tgt, i32 %en) {
call void @llvm.amdgcn.exp.f32(i32 0, i32 %en, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 %tgt, i32 15, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
ret void
}
; CHECK-LABEL: @exp_disabled_inputs_to_undef(
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 1, float 1.000000e+00, float undef, float undef, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float undef, float 2.000000e+00, float undef, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 4, float undef, float undef, float 5.000000e-01, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 8, float undef, float undef, float undef, float 4.000000e+00, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 1, float %x, float undef, float undef, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float undef, float %y, float undef, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 4, float undef, float undef, float %z, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 8, float undef, float undef, float undef, float %w, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 0, float undef, float undef, float undef, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 3, float 1.000000e+00, float 2.000000e+00, float undef, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 5, float 1.000000e+00, float undef, float 5.000000e-01, float undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 9, float 1.000000e+00, float undef, float undef, float 4.000000e+00, i1 false, i1 false)
; CHECK: call void @llvm.amdgcn.exp.f32(i32 0, i32 15, float 1.000000e+00, float 2.000000e+00, float 5.000000e-01, float 4.000000e+00, i1 false, i1 false)
define void @exp_disabled_inputs_to_undef(float %x, float %y, float %z, float %w) {
; enable src0..src3 constants
call void @llvm.amdgcn.exp.f32(i32 0, i32 1, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 4, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 8, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
; enable src0..src3 variables
call void @llvm.amdgcn.exp.f32(i32 0, i32 1, float %x, float %y, float %z, float %w, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float %x, float %y, float %z, float %w, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 4, float %x, float %y, float %z, float %w, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 8, float %x, float %y, float %z, float %w, i1 true, i1 false)
; enable none
call void @llvm.amdgcn.exp.f32(i32 0, i32 0, float %x, float %y, float %z, float %w, i1 true, i1 false)
; enable different source combinations
call void @llvm.amdgcn.exp.f32(i32 0, i32 3, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 5, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 9, float 1.0, float 2.0, float 0.5, float 4.0, i1 false, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 15, float 1.0, float 2.0, float 0.5, float 4.0, i1 false, i1 false)
ret void
}
; --------------------------------------------------------------------
; llvm.amdgcn.exp.compr
; --------------------------------------------------------------------
declare void @llvm.amdgcn.exp.compr.v2f16(i32, i32, <2 x half>, <2 x half>, i1, i1) nounwind inaccessiblememonly
; CHECK-LABEL: @exp_compr_invalid_inputs(
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 %en, <2 x half> <half 0xH3C00, half 0xH4000>, <2 x half> <half 0xH3800, half 0xH4400>, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 %tgt, i32 5, <2 x half> <half 0xH3C00, half 0xH4000>, <2 x half> <half 0xH3800, half 0xH4400>, i1 true, i1 false)
define void @exp_compr_invalid_inputs(i32 %tgt, i32 %en) {
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 %en, <2 x half> <half 1.0, half 2.0>, <2 x half> <half 0.5, half 4.0>, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 %tgt, i32 5, <2 x half> <half 1.0, half 2.0>, <2 x half> <half 0.5, half 4.0>, i1 true, i1 false)
ret void
}
; CHECK-LABEL: @exp_compr_disabled_inputs_to_undef(
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 0, <2 x half> undef, <2 x half> undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 1, <2 x half> <half 0xH3C00, half 0xH4000>, <2 x half> undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 2, <2 x half> <half 0xH3C00, half 0xH4000>, <2 x half> undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 3, <2 x half> <half 0xH3C00, half 0xH4000>, <2 x half> undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 0, <2 x half> undef, <2 x half> undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 1, <2 x half> %xy, <2 x half> undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 2, <2 x half> %xy, <2 x half> undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 3, <2 x half> %xy, <2 x half> undef, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 12, <2 x half> undef, <2 x half> %zw, i1 true, i1 false)
; CHECK: call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 15, <2 x half> %xy, <2 x half> %zw, i1 true, i1 false)
define void @exp_compr_disabled_inputs_to_undef(<2 x half> %xy, <2 x half> %zw) {
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 0, <2 x half> <half 1.0, half 2.0>, <2 x half> <half 0.5, half 4.0>, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 1, <2 x half> <half 1.0, half 2.0>, <2 x half> <half 0.5, half 4.0>, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 2, <2 x half> <half 1.0, half 2.0>, <2 x half> <half 0.5, half 4.0>, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 3, <2 x half> <half 1.0, half 2.0>, <2 x half> <half 0.5, half 4.0>, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 0, <2 x half> %xy, <2 x half> %zw, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 1, <2 x half> %xy, <2 x half> %zw, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 2, <2 x half> %xy, <2 x half> %zw, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 3, <2 x half> %xy, <2 x half> %zw, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 12, <2 x half> %xy, <2 x half> %zw, i1 true, i1 false)
call void @llvm.amdgcn.exp.compr.v2f16(i32 0, i32 15, <2 x half> %xy, <2 x half> %zw, i1 true, i1 false)
ret void
}
; --------------------------------------------------------------------
; llvm.amdgcn.fmed3
; --------------------------------------------------------------------
declare float @llvm.amdgcn.fmed3.f32(float, float, float) nounwind readnone
; CHECK-LABEL: @fmed3_f32(
; CHECK: %med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float %z)
define float @fmed3_f32(float %x, float %y, float %z) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float %z)
ret float %med3
}
; CHECK-LABEL: @fmed3_canonicalize_x_c0_c1_f32(
; CHECK: call float @llvm.amdgcn.fmed3.f32(float %x, float 0.000000e+00, float 1.000000e+00)
define float @fmed3_canonicalize_x_c0_c1_f32(float %x) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float 0.0, float 1.0)
ret float %med3
}
; CHECK-LABEL: @fmed3_canonicalize_c0_x_c1_f32(
; CHECK: call float @llvm.amdgcn.fmed3.f32(float %x, float 0.000000e+00, float 1.000000e+00)
define float @fmed3_canonicalize_c0_x_c1_f32(float %x) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0.0, float %x, float 1.0)
ret float %med3
}
; CHECK-LABEL: @fmed3_canonicalize_c0_c1_x_f32(
; CHECK: call float @llvm.amdgcn.fmed3.f32(float %x, float 0.000000e+00, float 1.000000e+00)
define float @fmed3_canonicalize_c0_c1_x_f32(float %x) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0.0, float 1.0, float %x)
ret float %med3
}
; CHECK-LABEL: @fmed3_canonicalize_x_y_c_f32(
; CHECK: call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float 1.000000e+00)
define float @fmed3_canonicalize_x_y_c_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float 1.0)
ret float %med3
}
; CHECK-LABEL: @fmed3_canonicalize_x_c_y_f32(
; CHECK: %med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float 1.000000e+00)
define float @fmed3_canonicalize_x_c_y_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float 1.0, float %y)
ret float %med3
}
; CHECK-LABEL: @fmed3_canonicalize_c_x_y_f32(
; CHECK: call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float 1.000000e+00)
define float @fmed3_canonicalize_c_x_y_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 1.0, float %x, float %y)
ret float %med3
}
; CHECK-LABEL: @fmed3_undef_x_y_f32(
; CHECK: call float @llvm.minnum.f32(float %x, float %y)
define float @fmed3_undef_x_y_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float undef, float %x, float %y)
ret float %med3
}
; CHECK-LABEL: @fmed3_fmf_undef_x_y_f32(
; CHECK: call nnan float @llvm.minnum.f32(float %x, float %y)
define float @fmed3_fmf_undef_x_y_f32(float %x, float %y) {
%med3 = call nnan float @llvm.amdgcn.fmed3.f32(float undef, float %x, float %y)
ret float %med3
}
; CHECK-LABEL: @fmed3_x_undef_y_f32(
; CHECK: call float @llvm.minnum.f32(float %x, float %y)
define float @fmed3_x_undef_y_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float undef, float %y)
ret float %med3
}
; CHECK-LABEL: @fmed3_x_y_undef_f32(
; CHECK: call float @llvm.minnum.f32(float %x, float %y)
define float @fmed3_x_y_undef_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float undef)
ret float %med3
}
; CHECK-LABEL: @fmed3_qnan0_x_y_f32(
; CHECK: call float @llvm.minnum.f32(float %x, float %y)
define float @fmed3_qnan0_x_y_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0x7FF8000000000000, float %x, float %y)
ret float %med3
}
; CHECK-LABEL: @fmed3_x_qnan0_y_f32(
; CHECK: call float @llvm.minnum.f32(float %x, float %y)
define float @fmed3_x_qnan0_y_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float 0x7FF8000000000000, float %y)
ret float %med3
}
; CHECK-LABEL: @fmed3_x_y_qnan0_f32(
; CHECK: call float @llvm.minnum.f32(float %x, float %y)
define float @fmed3_x_y_qnan0_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float 0x7FF8000000000000)
ret float %med3
}
; CHECK-LABEL: @fmed3_qnan1_x_y_f32(
; CHECK: call float @llvm.minnum.f32(float %x, float %y)
define float @fmed3_qnan1_x_y_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0x7FF8000100000000, float %x, float %y)
ret float %med3
}
; This can return any of the qnans.
; CHECK-LABEL: @fmed3_qnan0_qnan1_qnan2_f32(
; CHECK: ret float 0x7FF8002000000000
define float @fmed3_qnan0_qnan1_qnan2_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0x7FF8000100000000, float 0x7FF8002000000000, float 0x7FF8030000000000)
ret float %med3
}
; CHECK-LABEL: @fmed3_constant_src0_0_f32(
; CHECK: ret float 5.000000e-01
define float @fmed3_constant_src0_0_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0.5, float -1.0, float 4.0)
ret float %med3
}
; CHECK-LABEL: @fmed3_constant_src0_1_f32(
; CHECK: ret float 5.000000e-01
define float @fmed3_constant_src0_1_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0.5, float 4.0, float -1.0)
ret float %med3
}
; CHECK-LABEL: @fmed3_constant_src1_0_f32(
; CHECK: ret float 5.000000e-01
define float @fmed3_constant_src1_0_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float -1.0, float 0.5, float 4.0)
ret float %med3
}
; CHECK-LABEL: @fmed3_constant_src1_1_f32(
; CHECK: ret float 5.000000e-01
define float @fmed3_constant_src1_1_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 4.0, float 0.5, float -1.0)
ret float %med3
}
; CHECK-LABEL: @fmed3_constant_src2_0_f32(
; CHECK: ret float 5.000000e-01
define float @fmed3_constant_src2_0_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float -1.0, float 4.0, float 0.5)
ret float %med3
}
; CHECK-LABEL: @fmed3_constant_src2_1_f32(
; CHECK: ret float 5.000000e-01
define float @fmed3_constant_src2_1_f32(float %x, float %y) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 4.0, float -1.0, float 0.5)
ret float %med3
}
; CHECK-LABEL: @fmed3_x_qnan0_qnan1_f32(
; CHECK: ret float %x
define float @fmed3_x_qnan0_qnan1_f32(float %x) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float %x, float 0x7FF8001000000000, float 0x7FF8002000000000)
ret float %med3
}
; CHECK-LABEL: @fmed3_qnan0_x_qnan1_f32(
; CHECK: ret float %x
define float @fmed3_qnan0_x_qnan1_f32(float %x) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0x7FF8001000000000, float %x, float 0x7FF8002000000000)
ret float %med3
}
; CHECK-LABEL: @fmed3_qnan0_qnan1_x_f32(
; CHECK: ret float %x
define float @fmed3_qnan0_qnan1_x_f32(float %x) {
%med3 = call float @llvm.amdgcn.fmed3.f32(float 0x7FF8001000000000, float 0x7FF8002000000000, float %x)
ret float %med3
}
; --------------------------------------------------------------------
; llvm.amdgcn.icmp
; --------------------------------------------------------------------
declare i64 @llvm.amdgcn.icmp.i32(i32, i32, i32) nounwind readnone convergent
declare i64 @llvm.amdgcn.icmp.i64(i64, i64, i32) nounwind readnone convergent
; Make sure there's no crash for invalid input
; CHECK-LABEL: @invalid_nonconstant_icmp_code(
; CHECK: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 %c)
define i64 @invalid_nonconstant_icmp_code(i32 %a, i32 %b, i32 %c) {
%result = call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 %c)
ret i64 %result
}
; CHECK-LABEL: @invalid_icmp_code(
; CHECK: %under = call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 31)
; CHECK: %over = call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 42)
define i64 @invalid_icmp_code(i32 %a, i32 %b) {
%under = call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 31)
%over = call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 42)
%or = or i64 %under, %over
ret i64 %or
}
; CHECK-LABEL: @icmp_constant_inputs_false(
; CHECK: ret i64 0
define i64 @icmp_constant_inputs_false() {
%result = call i64 @llvm.amdgcn.icmp.i32(i32 9, i32 8, i32 32)
ret i64 %result
}
; CHECK-LABEL: @icmp_constant_inputs_true(
; CHECK: %result = call i64 @llvm.read_register.i64(metadata !0) #5
define i64 @icmp_constant_inputs_true() {
%result = call i64 @llvm.amdgcn.icmp.i32(i32 9, i32 8, i32 34)
ret i64 %result
}
; CHECK-LABEL: @icmp_constant_to_rhs_slt(
; CHECK: %result = call i64 @llvm.amdgcn.icmp.i32(i32 %x, i32 9, i32 38)
define i64 @icmp_constant_to_rhs_slt(i32 %x) {
%result = call i64 @llvm.amdgcn.icmp.i32(i32 9, i32 %x, i32 40)
ret i64 %result
}
; CHECK-LABEL: @fold_icmp_ne_0_zext_icmp_eq_i32(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 32)
define i64 @fold_icmp_ne_0_zext_icmp_eq_i32(i32 %a, i32 %b) {
%cmp = icmp eq i32 %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_ne_0_zext_icmp_ne_i32(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 33)
define i64 @fold_icmp_ne_0_zext_icmp_ne_i32(i32 %a, i32 %b) {
%cmp = icmp ne i32 %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_ne_0_zext_icmp_sle_i32(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 41)
define i64 @fold_icmp_ne_0_zext_icmp_sle_i32(i32 %a, i32 %b) {
%cmp = icmp sle i32 %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_ne_0_zext_icmp_ugt_i64(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i64(i64 %a, i64 %b, i32 34)
define i64 @fold_icmp_ne_0_zext_icmp_ugt_i64(i64 %a, i64 %b) {
%cmp = icmp ugt i64 %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_ne_0_zext_icmp_ult_swap_i64(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i64(i64 %a, i64 %b, i32 34)
define i64 @fold_icmp_ne_0_zext_icmp_ult_swap_i64(i64 %a, i64 %b) {
%cmp = icmp ugt i64 %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 0, i32 %zext.cmp, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_ne_0_zext_fcmp_oeq_f32(
; CHECK-NEXT: call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 1)
define i64 @fold_icmp_ne_0_zext_fcmp_oeq_f32(float %a, float %b) {
%cmp = fcmp oeq float %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_ne_0_zext_fcmp_une_f32(
; CHECK-NEXT: call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 14)
define i64 @fold_icmp_ne_0_zext_fcmp_une_f32(float %a, float %b) {
%cmp = fcmp une float %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_ne_0_zext_fcmp_olt_f64(
; CHECK-NEXT: call i64 @llvm.amdgcn.fcmp.f64(double %a, double %b, i32 4)
define i64 @fold_icmp_ne_0_zext_fcmp_olt_f64(double %a, double %b) {
%cmp = fcmp olt double %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_sext_icmp_ne_0_i32(
; CHECK: %mask = call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 32)
define i64 @fold_icmp_sext_icmp_ne_0_i32(i32 %a, i32 %b) {
%cmp = icmp eq i32 %a, %b
%sext.cmp = sext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cmp, i32 0, i32 33)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_eq_0_zext_icmp_eq_i32(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 33)
define i64 @fold_icmp_eq_0_zext_icmp_eq_i32(i32 %a, i32 %b) {
%cmp = icmp eq i32 %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_eq_0_zext_icmp_slt_i32(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 39)
define i64 @fold_icmp_eq_0_zext_icmp_slt_i32(i32 %a, i32 %b) {
%cmp = icmp slt i32 %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_eq_0_zext_fcmp_oeq_f32(
; CHECK-NEXT: call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 14)
define i64 @fold_icmp_eq_0_zext_fcmp_oeq_f32(float %a, float %b) {
%cmp = fcmp oeq float %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_eq_0_zext_fcmp_ule_f32(
; CHECK-NEXT: call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 2)
define i64 @fold_icmp_eq_0_zext_fcmp_ule_f32(float %a, float %b) {
%cmp = fcmp ule float %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_eq_0_zext_fcmp_ogt_f32(
; CHECK-NEXT: call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 13)
define i64 @fold_icmp_eq_0_zext_fcmp_ogt_f32(float %a, float %b) {
%cmp = fcmp ogt float %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_zext_icmp_eq_1_i32(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 32)
define i64 @fold_icmp_zext_icmp_eq_1_i32(i32 %a, i32 %b) {
%cmp = icmp eq i32 %a, %b
%zext.cmp = zext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 1, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_zext_argi1_eq_1_i32(
; CHECK: %zext.cond = zext i1 %cond to i32
; CHECK: call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cond, i32 0, i32 33)
define i64 @fold_icmp_zext_argi1_eq_1_i32(i1 %cond) {
%zext.cond = zext i1 %cond to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cond, i32 1, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_zext_argi1_eq_neg1_i32(
; CHECK: %zext.cond = zext i1 %cond to i32
; CHECK: call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cond, i32 -1, i32 32)
define i64 @fold_icmp_zext_argi1_eq_neg1_i32(i1 %cond) {
%zext.cond = zext i1 %cond to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cond, i32 -1, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_sext_argi1_eq_1_i32(
; CHECK: %sext.cond = sext i1 %cond to i32
; CHECK: call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cond, i32 1, i32 32)
define i64 @fold_icmp_sext_argi1_eq_1_i32(i1 %cond) {
%sext.cond = sext i1 %cond to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cond, i32 1, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_sext_argi1_eq_neg1_i32(
; CHECK: %sext.cond = sext i1 %cond to i32
; CHECK: call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cond, i32 0, i32 33)
define i64 @fold_icmp_sext_argi1_eq_neg1_i32(i1 %cond) {
%sext.cond = sext i1 %cond to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cond, i32 -1, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_sext_argi1_eq_neg1_i64(
; CHECK: %sext.cond = sext i1 %cond to i64
; CHECK: call i64 @llvm.amdgcn.icmp.i64(i64 %sext.cond, i64 0, i32 33)
define i64 @fold_icmp_sext_argi1_eq_neg1_i64(i1 %cond) {
%sext.cond = sext i1 %cond to i64
%mask = call i64 @llvm.amdgcn.icmp.i64(i64 %sext.cond, i64 -1, i32 32)
ret i64 %mask
}
; TODO: Should be able to fold to false
; CHECK-LABEL: @fold_icmp_sext_icmp_eq_1_i32(
; CHECK: %cmp = icmp eq i32 %a, %b
; CHECK: %sext.cmp = sext i1 %cmp to i32
; CHECK: %mask = call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cmp, i32 1, i32 32)
define i64 @fold_icmp_sext_icmp_eq_1_i32(i32 %a, i32 %b) {
%cmp = icmp eq i32 %a, %b
%sext.cmp = sext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cmp, i32 1, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_sext_icmp_eq_neg1_i32(
; CHECK: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 32)
define i64 @fold_icmp_sext_icmp_eq_neg1_i32(i32 %a, i32 %b) {
%cmp = icmp eq i32 %a, %b
%sext.cmp = sext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cmp, i32 -1, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_icmp_sext_icmp_sge_neg1_i32(
; CHECK: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 39)
define i64 @fold_icmp_sext_icmp_sge_neg1_i32(i32 %a, i32 %b) {
%cmp = icmp sge i32 %a, %b
%sext.cmp = sext i1 %cmp to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %sext.cmp, i32 -1, i32 32)
ret i64 %mask
}
; CHECK-LABEL: @fold_not_icmp_ne_0_zext_icmp_sle_i32(
; CHECK-NEXT: call i64 @llvm.amdgcn.icmp.i32(i32 %a, i32 %b, i32 38)
define i64 @fold_not_icmp_ne_0_zext_icmp_sle_i32(i32 %a, i32 %b) {
%cmp = icmp sle i32 %a, %b
%not = xor i1 %cmp, true
%zext.cmp = zext i1 %not to i32
%mask = call i64 @llvm.amdgcn.icmp.i32(i32 %zext.cmp, i32 0, i32 33)
ret i64 %mask
}
; --------------------------------------------------------------------
; llvm.amdgcn.fcmp
; --------------------------------------------------------------------
declare i64 @llvm.amdgcn.fcmp.f32(float, float, i32) nounwind readnone convergent
; Make sure there's no crash for invalid input
; CHECK-LABEL: @invalid_nonconstant_fcmp_code(
; CHECK: call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 %c)
define i64 @invalid_nonconstant_fcmp_code(float %a, float %b, i32 %c) {
%result = call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 %c)
ret i64 %result
}
; CHECK-LABEL: @invalid_fcmp_code(
; CHECK: %under = call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 -1)
; CHECK: %over = call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 16)
define i64 @invalid_fcmp_code(float %a, float %b) {
%under = call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 -1)
%over = call i64 @llvm.amdgcn.fcmp.f32(float %a, float %b, i32 16)
%or = or i64 %under, %over
ret i64 %or
}
; CHECK-LABEL: @fcmp_constant_inputs_false(
; CHECK: ret i64 0
define i64 @fcmp_constant_inputs_false() {
%result = call i64 @llvm.amdgcn.fcmp.f32(float 2.0, float 4.0, i32 1)
ret i64 %result
}
; CHECK-LABEL: @fcmp_constant_inputs_true(
; CHECK: %result = call i64 @llvm.read_register.i64(metadata !0) #5
define i64 @fcmp_constant_inputs_true() {
%result = call i64 @llvm.amdgcn.fcmp.f32(float 2.0, float 4.0, i32 4)
ret i64 %result
}
; CHECK-LABEL: @fcmp_constant_to_rhs_olt(
; CHECK: %result = call i64 @llvm.amdgcn.fcmp.f32(float %x, float 4.000000e+00, i32 2)
define i64 @fcmp_constant_to_rhs_olt(float %x) {
%result = call i64 @llvm.amdgcn.fcmp.f32(float 4.0, float %x, i32 4)
ret i64 %result
}
; CHECK: attributes #5 = { convergent }
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Filter
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
/**
* @see Zend_Filter_PregReplace
*/
/**
* @category Zend
* @package Zend_Filter
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Filter_Word_SeparatorToCamelCase extends Zend_Filter_Word_Separator_Abstract
{
public function filter($value)
{
// a unicode safe way of converting characters to \x00\x00 notation
$pregQuotedSeparator = preg_quote($this->_separator, '#');
if (self::isUnicodeSupportEnabled()) {
parent::setMatchPattern(array('#('.$pregQuotedSeparator.')(\p{L}{1})#','#(^\p{Ll}{1})#'));
parent::setReplacement(array('Zend_Filter_Word_SeparatorToCamelCase', '_strtoupperArray'));
} else {
parent::setMatchPattern(array('#('.$pregQuotedSeparator.')([A-Za-z]{1})#','#(^[A-Za-z]{1})#'));
parent::setReplacement(array('Zend_Filter_Word_SeparatorToCamelCase', '_strtoupperArray'));
}
return preg_replace_callback($this->_matchPattern, $this->_replacement, $value);
}
/**
* @param array $matches
* @return string
*/
private static function _strtoupperArray(array $matches)
{
if (array_key_exists(2, $matches)) {
return strtoupper($matches[2]);
}
return strtoupper($matches[1]);
}
}
|
{
"pile_set_name": "Github"
}
|
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Train the model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
# Standard Imports
from absl import app
import tensorflow.compat.v1 as tf
import configuration
import show_and_tell_model
from tensorflow.contrib import cluster_resolver as contrib_cluster_resolver
from tensorflow.contrib import estimator as contrib_estimator
from tensorflow.contrib import tpu as contrib_tpu
from tensorflow.contrib import training as contrib_training
FLAGS = tf.app.flags.FLAGS
tf.flags.DEFINE_string(
"tpu", default=None,
help="The Cloud TPU to use for training. This should be either the name "
"used when creating the Cloud TPU, or a grpc://ip.address.of.tpu:8470 "
"url.")
tf.flags.DEFINE_string(
"gcp_project", default=None,
help="Project name for the Cloud TPU-enabled project. If not specified, we "
"will attempt to automatically detect the GCE project from metadata.")
tf.flags.DEFINE_string(
"tpu_zone", default=None,
help="GCE zone where the Cloud TPU is located in. If not specified, we "
"will attempt to automatically detect the GCE project from metadata.")
tf.flags.DEFINE_bool("use_tpu", True, "If true, use TPU")
tf.flags.DEFINE_string("mode", "train",
"Execution mode: one of train|evaluate .")
tf.flags.DEFINE_string("input_file_pattern", "",
"File pattern of sharded TFRecord input files.")
tf.flags.DEFINE_string("inception_checkpoint_file", "",
"Path to a pretrained inception_v3 model.")
tf.flags.DEFINE_string("model_dir", "",
"Directory for saving and loading model checkpoints.")
tf.flags.DEFINE_boolean("train_inception", False,
"Whether to train inception submodel variables.")
tf.flags.DEFINE_integer("train_steps", 10000, "Number of batches for training.")
tf.flags.DEFINE_integer("train_batch_size", 1024, "Batch size for training.")
tf.flags.DEFINE_integer("eval_batch_size", 1024, "Batch size for evaluation.")
tf.flags.DEFINE_integer("iterations_per_loop", 100,
"TPU batch iterations per loop.")
MODEKEY_TO_MODE = {
tf.estimator.ModeKeys.PREDICT: "inference",
tf.estimator.ModeKeys.EVAL: "evaluate",
tf.estimator.ModeKeys.TRAIN: "train",
}
def model_fn(features, labels, mode, params):
im_mode = MODEKEY_TO_MODE[mode]
model_config = configuration.ModelConfig()
training_config = configuration.TrainingConfig()
model = show_and_tell_model.ShowAndTellModel(
model_config, mode=im_mode, train_inception=FLAGS.train_inception)
model.build_model_for_tpu(
images=features["images"],
input_seqs=features["input_seqs"],
target_seqs=features["target_seqs"],
input_mask=features["input_mask"])
optimizer = tf.train.GradientDescentOptimizer(
learning_rate=training_config.initial_learning_rate)
optimizer = contrib_estimator.clip_gradients_by_norm(
optimizer, training_config.clip_gradients)
if FLAGS.use_tpu:
optimizer = contrib_tpu.CrossShardOptimizer(optimizer)
train_op = optimizer.minimize(
model.total_loss, global_step=tf.train.get_or_create_global_step())
def scaffold_fn():
"""Load pretrained Inception checkpoint at initialization time."""
return tf.train.Scaffold(init_fn=model.init_fn)
return contrib_tpu.TPUEstimatorSpec(
mode=mode,
loss=model.total_loss,
train_op=train_op,
scaffold_fn=scaffold_fn)
def input_fn(params):
model_config = configuration.ModelConfig()
model_config.input_file_pattern = params["input_file_pattern"]
model_config.batch_size = params["batch_size"]
model_config.mode = params["mode"]
model = show_and_tell_model.ShowAndTellModel(model_config, mode="train")
model.build_inputs()
return {
"images": model.images,
"input_seqs": model.input_seqs,
"target_seqs": model.target_seqs,
"input_mask": model.input_mask
}
def main(unused_argv):
assert FLAGS.input_file_pattern, "--input_file_pattern is required"
assert FLAGS.model_dir, "--model_dir is required"
if FLAGS.use_tpu:
tpu_cluster_resolver = contrib_cluster_resolver.TPUClusterResolver(
FLAGS.tpu, zone=FLAGS.tpu_zone, project=FLAGS.gcp_project)
tpu_grpc_url = tpu_cluster_resolver.get_master()
else:
tpu_grpc_url = ''
run_config = contrib_tpu.RunConfig(
master=tpu_grpc_url,
model_dir=FLAGS.model_dir,
save_checkpoints_steps=1000,
keep_checkpoint_max=None,
tpu_config=contrib_tpu.TPUConfig(
iterations_per_loop=FLAGS.iterations_per_loop,))
estimator = contrib_tpu.TPUEstimator(
use_tpu=FLAGS.use_tpu,
model_fn=model_fn,
config=run_config,
train_batch_size=FLAGS.train_batch_size,
eval_batch_size=FLAGS.eval_batch_size,
params={
"input_file_pattern": FLAGS.input_file_pattern,
"use_tpu": FLAGS.use_tpu,
"mode": FLAGS.mode,
})
training_config = configuration.TrainingConfig()
if FLAGS.mode == "train":
estimator.train(
input_fn=input_fn,
max_steps=FLAGS.train_steps,
)
else:
# Run evaluation when there"s a new checkpoint
for ckpt in contrib_training.checkpoints_iterator(FLAGS.model_dir):
tf.logging.info("Starting to evaluate.")
try:
eval_results = estimator.evaluate(
input_fn=input_fn,
steps=(
training_config.num_examples_per_epoch // FLAGS.eval_batch_size
),
checkpoint_path=ckpt)
tf.logging.info("Eval results: %s", eval_results)
current_step = int(os.path.basename(ckpt).split("-")[1])
if current_step >= FLAGS.train_steps:
tf.logging.info(
"Evaluation finished after training step %d" % current_step)
break
except tf.errors.NotFoundError:
tf.logging.info(
"Checkpoint %s no longer exists, skipping checkpoint" % ckpt)
if __name__ == "__main__":
tf.logging.set_verbosity(tf.logging.INFO)
app.run(main)
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_group_card"
android:layout_width="73.5dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="73.5dp"
android:layout_height="73.5dp"
android:foreground="?attr/selectableItemBackground"
card_view:cardCornerRadius="2dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardUseCompatPadding="true">
<android.support.v4.widget.Space
android:layout_width="71dp"
android:layout_height="71dp"/>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/tv_group_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="17dp"
android:layout_marginTop="9dp"
android:textColor="#6B6B6B"
android:textSize="14sp"/>
</LinearLayout>
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python3
#
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
def plugin_start(cli):
# Place holder for future commands
# cli.add_command(PluginCli().xyz)
pass
class PluginCli(object):
def __init__(self):
# Place holder for future commands
pass
|
{
"pile_set_name": "Github"
}
|
<script type="x/ignore" id="the-html">
<div ng-controller="MyCtrl" class="demo-section">
<ul kendo-mobile-button-group k-on-select="selected(kendoEvent.index)">
<li>
Month
</li>
<li>
Quarter
</li>
<li>
Year
</li>
</ul>
</div>
<style>
.demo-section {
width: 500px;
text-align: center;
}
.demo-section .km-buttongroup {
margin: 0 auto;
}
</style>
</script>
<script id="the-javascript">
function MyCtrl($scope) {
$scope.selected = function(index) {
alert("Selected index: " + index);
};
}
</script>
<div ng-include src="SHOW_SOURCE"></div>
|
{
"pile_set_name": "Github"
}
|
(function($) {
$.extend($.summernote.lang, {
'fi-FI': {
font: {
bold: 'Lihavointi',
italic: 'Kursivointi',
underline: 'Alleviivaus',
clear: 'Tyhjennä muotoilu',
height: 'Riviväli',
name: 'Kirjasintyyppi',
strikethrough: 'Yliviivaus',
subscript: 'Alaindeksi',
superscript: 'Yläindeksi',
size: 'Kirjasinkoko'
},
image: {
image: 'Kuva',
insert: 'Lisää kuva',
resizeFull: 'Koko leveys',
resizeHalf: 'Puolikas leveys',
resizeQuarter: 'Neljäsosa leveys',
floatLeft: 'Sijoita vasemmalle',
floatRight: 'Sijoita oikealle',
floatNone: 'Ei sijoitusta',
shapeRounded: 'Muoto: Pyöristetty',
shapeCircle: 'Muoto: Ympyrä',
shapeThumbnail: 'Muoto: Esikatselukuva',
shapeNone: 'Muoto: Ei muotoilua',
dragImageHere: 'Vedä kuva tähän',
selectFromFiles: 'Valitse tiedostoista',
maximumFileSize: 'Maksimi tiedosto koko',
maximumFileSizeError: 'Maksimi tiedosto koko ylitetty.',
url: 'URL-osoitteen mukaan',
remove: 'Poista kuva',
original: 'Alkuperäinen'
},
video: {
video: 'Video',
videoLink: 'Linkki videoon',
insert: 'Lisää video',
url: 'Videon URL-osoite',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion tai Youku)'
},
link: {
link: 'Linkki',
insert: 'Lisää linkki',
unlink: 'Poista linkki',
edit: 'Muokkaa',
textToDisplay: 'Näytettävä teksti',
url: 'Linkin URL-osoite',
openInNewWindow: 'Avaa uudessa ikkunassa'
},
table: {
table: 'Taulukko',
addRowAbove: 'Lisää rivi yläpuolelle',
addRowBelow: 'Lisää rivi alapuolelle',
addColLeft: 'Lisää sarake vasemmalle puolelle',
addColRight: 'Lisää sarake oikealle puolelle',
delRow: 'Poista rivi',
delCol: 'Poista sarake',
delTable: 'Poista taulukko'
},
hr: {
insert: 'Lisää vaakaviiva'
},
style: {
style: 'Tyyli',
p: 'Normaali',
blockquote: 'Lainaus',
pre: 'Koodi',
h1: 'Otsikko 1',
h2: 'Otsikko 2',
h3: 'Otsikko 3',
h4: 'Otsikko 4',
h5: 'Otsikko 5',
h6: 'Otsikko 6'
},
lists: {
unordered: 'Luettelomerkitty luettelo',
ordered: 'Numeroitu luettelo'
},
options: {
help: 'Ohje',
fullscreen: 'Koko näyttö',
codeview: 'HTML-näkymä'
},
paragraph: {
paragraph: 'Kappale',
outdent: 'Pienennä sisennystä',
indent: 'Suurenna sisennystä',
left: 'Tasaa vasemmalle',
center: 'Keskitä',
right: 'Tasaa oikealle',
justify: 'Tasaa'
},
color: {
recent: 'Viimeisin väri',
more: 'Lisää värejä',
background: 'Korostusväri',
foreground: 'Tekstin väri',
transparent: 'Läpinäkyvä',
setTransparent: 'Aseta läpinäkyväksi',
reset: 'Palauta',
resetToDefault: 'Palauta oletusarvoksi'
},
shortcut: {
shortcuts: 'Pikanäppäimet',
close: 'Sulje',
textFormatting: 'Tekstin muotoilu',
action: 'Toiminto',
paragraphFormatting: 'Kappaleen muotoilu',
documentStyle: 'Asiakirjan tyyli'
},
help: {
'insertParagraph': 'Lisää kappale',
'undo': 'Kumoa viimeisin komento',
'redo': 'Tee uudelleen kumottu komento',
'tab': 'Sarkain',
'untab': 'Sarkainmerkin poisto',
'bold': 'Lihavointi',
'italic': 'Kursiivi',
'underline': 'Alleviivaus',
'strikethrough': 'Yliviivaus',
'removeFormat': 'Poista asetetut tyylit',
'justifyLeft': 'Tasaa vasemmalle',
'justifyCenter': 'Keskitä',
'justifyRight': 'Tasaa oikealle',
'justifyFull': 'Tasaa',
'insertUnorderedList': 'Luettelomerkillä varustettu lista',
'insertOrderedList': 'Numeroitu lista',
'outdent': 'Pienennä sisennystä',
'indent': 'Suurenna sisennystä',
'formatPara': 'Muuta kappaleen formaatti p',
'formatH1': 'Muuta kappaleen formaatti H1',
'formatH2': 'Muuta kappaleen formaatti H2',
'formatH3': 'Muuta kappaleen formaatti H3',
'formatH4': 'Muuta kappaleen formaatti H4',
'formatH5': 'Muuta kappaleen formaatti H5',
'formatH6': 'Muuta kappaleen formaatti H6',
'insertHorizontalRule': 'Lisää vaakaviiva',
'linkDialog.show': 'Lisää linkki'
},
history: {
undo: 'Kumoa',
redo: 'Toista'
},
specialChar: {
specialChar: 'ERIKOISMERKIT',
select: 'Valitse erikoismerkit'
}
}
});
})(jQuery);
|
{
"pile_set_name": "Github"
}
|
#Sat Mar 11 14:07:55 EET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
{
"pile_set_name": "Github"
}
|
var baseCallback = require('../internal/baseCallback'),
isIterateeCall = require('../internal/isIterateeCall'),
isObjectLike = require('../internal/isObjectLike'),
matches = require('./matches');
/**
* Creates a function that invokes `func` with the `this` binding of `thisArg`
* and arguments of the created function. If `func` is a property name the
* created callback returns the property value for a given element. If `func`
* is an object the created callback returns `true` for elements that contain
* the equivalent object properties, otherwise it returns `false`.
*
* @static
* @memberOf _
* @alias iteratee
* @category Utility
* @param {*} [func=_.identity] The value to convert to a callback.
* @param {*} [thisArg] The `this` binding of `func`.
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
* @returns {Function} Returns the callback.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // wrap to create custom callback shorthands
* _.callback = _.wrap(_.callback, function(callback, func, thisArg) {
* var match = /^(.+?)__([gl]t)(.+)$/.exec(func);
* if (!match) {
* return callback(func, thisArg);
* }
* return function(object) {
* return match[2] == 'gt'
* ? object[match[1]] > match[3]
* : object[match[1]] < match[3];
* };
* });
*
* _.filter(users, 'age__gt36');
* // => [{ 'user': 'fred', 'age': 40 }]
*/
function callback(func, thisArg, guard) {
if (guard && isIterateeCall(func, thisArg, guard)) {
thisArg = undefined;
}
return isObjectLike(func)
? matches(func)
: baseCallback(func, thisArg);
}
module.exports = callback;
|
{
"pile_set_name": "Github"
}
|
"""Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".
* Change both
v = list(EXPR)
v.sort()
foo(v)
and the more general
v = EXPR
v.sort()
foo(v)
into
v = sorted(EXPR)
foo(v)
"""
# Author: Jacques Frechet, Collin Winter
# Local imports
from .. import fixer_base
from ..fixer_util import Call, Comma, Name, Node, BlankLine, syms
CMP = "(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)"
TYPE = "power< 'type' trailer< '(' x=any ')' > >"
class FixIdioms(fixer_base.BaseFix):
explicit = True # The user must ask for this fixer
PATTERN = r"""
isinstance=comparison< %s %s T=any >
|
isinstance=comparison< T=any %s %s >
|
while_stmt< 'while' while='1' ':' any+ >
|
sorted=any<
any*
simple_stmt<
expr_stmt< id1=any '='
power< list='list' trailer< '(' (not arglist<any+>) any ')' > >
>
'\n'
>
sort=
simple_stmt<
power< id2=any
trailer< '.' 'sort' > trailer< '(' ')' >
>
'\n'
>
next=any*
>
|
sorted=any<
any*
simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' >
sort=
simple_stmt<
power< id2=any
trailer< '.' 'sort' > trailer< '(' ')' >
>
'\n'
>
next=any*
>
""" % (TYPE, CMP, CMP, TYPE)
def match(self, node):
r = super(FixIdioms, self).match(node)
# If we've matched one of the sort/sorted subpatterns above, we
# want to reject matches where the initial assignment and the
# subsequent .sort() call involve different identifiers.
if r and "sorted" in r:
if r["id1"] == r["id2"]:
return r
return None
return r
def transform(self, node, results):
if "isinstance" in results:
return self.transform_isinstance(node, results)
elif "while" in results:
return self.transform_while(node, results)
elif "sorted" in results:
return self.transform_sort(node, results)
else:
raise RuntimeError("Invalid match")
def transform_isinstance(self, node, results):
x = results["x"].clone() # The thing inside of type()
T = results["T"].clone() # The type being compared against
x.prefix = u""
T.prefix = u" "
test = Call(Name(u"isinstance"), [x, Comma(), T])
if "n" in results:
test.prefix = u" "
test = Node(syms.not_test, [Name(u"not"), test])
test.prefix = node.prefix
return test
def transform_while(self, node, results):
one = results["while"]
one.replace(Name(u"True", prefix=one.prefix))
def transform_sort(self, node, results):
sort_stmt = results["sort"]
next_stmt = results["next"]
list_call = results.get("list")
simple_expr = results.get("expr")
if list_call:
list_call.replace(Name(u"sorted", prefix=list_call.prefix))
elif simple_expr:
new = simple_expr.clone()
new.prefix = u""
simple_expr.replace(Call(Name(u"sorted"), [new],
prefix=simple_expr.prefix))
else:
raise RuntimeError("should not have reached here")
sort_stmt.remove()
btwn = sort_stmt.prefix
# Keep any prefix lines between the sort_stmt and the list_call and
# shove them right after the sorted() call.
if u"\n" in btwn:
if next_stmt:
# The new prefix should be everything from the sort_stmt's
# prefix up to the last newline, then the old prefix after a new
# line.
prefix_lines = (btwn.rpartition(u"\n")[0], next_stmt[0].prefix)
next_stmt[0].prefix = u"\n".join(prefix_lines)
else:
assert list_call.parent
assert list_call.next_sibling is None
# Put a blank line after list_call and set its prefix.
end_line = BlankLine()
list_call.parent.append_child(end_line)
assert list_call.next_sibling is end_line
# The new prefix should be everything up to the first new line
# of sort_stmt's prefix.
end_line.prefix = btwn.rpartition(u"\n")[0]
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2011-2018, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.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 boofcv.abst.fiducial;
import boofcv.alg.drawing.FiducialImageEngine;
import boofcv.alg.fiducial.square.FiducialSquareGenerator;
import boofcv.factory.fiducial.ConfigFiducialBinary;
import boofcv.factory.fiducial.FactoryFiducial;
import boofcv.factory.filter.binary.ConfigThreshold;
import boofcv.factory.filter.binary.ThresholdType;
import boofcv.struct.image.GrayF32;
import boofcv.struct.image.GrayU8;
import boofcv.struct.image.ImageGray;
import boofcv.struct.image.ImageType;
/**
* @author Peter Abeles
*/
public class TestSquareBinary_to_FiducialDetector extends GenericFiducialDetectorChecks
{
public TestSquareBinary_to_FiducialDetector() {
types.add( ImageType.single(GrayU8.class));
types.add( ImageType.single(GrayF32.class));
pixelAndProjectedTol = 1.0; // should be very close
}
@Override
public GrayF32 renderFiducial() {
FiducialImageEngine render = new FiducialImageEngine();
render.configure(0,200);
FiducialSquareGenerator generator = new FiducialSquareGenerator(render);
generator.setMarkerWidth(200);
generator.generate(345,4);
return render.getGrayF32();
}
@Override
public FiducialDetector createDetector(ImageType imageType) {
return FactoryFiducial.squareBinary(new ConfigFiducialBinary(1.5),
ConfigThreshold.local(ThresholdType.LOCAL_MEAN,13),
(Class<ImageGray>)imageType.getImageClass());
}
}
|
{
"pile_set_name": "Github"
}
|
{
"name": "odinlib",
"version": "0.2.0",
"description": "A nodejs package for gathering information in odin jobs",
"license": "MIT",
"repository": "github.com/theycallmemac/odin",
"main": "odin/odin.js",
"scripts": {
"test": "mocha"
},
"keywords": [
"odin",
"odinlib"
],
"dependencies": {
"yamljs": "^0.3.0"
},
"devDependencies": {
"eslint": "^7.4.0",
"eslint-config-google": "^0.14.0",
"mocha": "^7.2.0",
"mongodb": "^3.5.8"
}
}
|
{
"pile_set_name": "Github"
}
|
% Test file for chebtech/real.m
function pass = test_real(pref)
if ( nargin < 1 )
pref = chebtech.techPref();
end
for n = 1:2
if ( n == 1 )
testclass = chebtech1();
else
testclass = chebtech2();
end
% Test a scalar-valued function:
f = testclass.make(@(x) exp(1i*x) + 1i*sin(x), [], pref);
g = testclass.make(@(x) cos(x), [], pref);
h = real(f);
pass(n, 1) = norm(h.coeffs - g.coeffs, inf) < 10*vscale(h)*eps;
% Test an array-valued function:
f = testclass.make(@(x) [exp(1i*x) + 1i*sin(x), -exp(1i*x)], [], pref);
g = testclass.make(@(x) [cos(x), -real(exp(1i*x))], [], pref);
h = real(f);
pass(n, 2) = norm(h.coeffs - g.coeffs, inf) < 10*max(vscale(h)*eps);
% Test a real function:
f = testclass.make(@(x) 1i*cos(x), [], pref);
g = real(f);
pass(n, 3) = numel(g.coeffs) == 1 && g.coeffs == 0;
% Test an array-valued real function:
f = testclass.make(@(x) 1i*[cos(x), sin(x), exp(x)], [], pref);
g = real(f);
pass(n, 4) = all(size(g.coeffs) == [1, 3]) && all(g.coeffs == 0);
end
end
|
{
"pile_set_name": "Github"
}
|
---
lang-ref: ch.07-3
title: 自动编码器的简介
lecturer: Alfredo Canziani
authors: Xinmeng Li, Atul Gandhi, Li Jiang, Xiao Li
date: 10 March 2020
lang: zh
translation-date: 20 June 2020
translator: Jonathan Sum
---
## [自动编码器的应用](https://www.youtube.com/watch?v=bggWQ14DD9M&t=55s)
### 图片生成
在图1,你可以去说出那一个脸对是假的吗?事实上,两个都是由StyleGan2生成器生成的。虽然脸部细节非常逼真,但背景看起来很奇怪(左:模糊,右: 这是因为那个神经网络由脸部样本来训练。背景就是十分易变。这里的数据流型是50维,等于人脸图像的自由度。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/1_faces_gen.jpg" height="150px" /><br>
<b>图1</b>: 生成的人脸
</center>
### 像素空間和潛在空間中插值的差異
<center>
<img src="{{site.baseurl}}/images/week07/07-3/2_dog.jpg" height="120px"/><img src="{{site.baseurl}}/images/week07/07-3/2_bird.jpg" height="120px"/>
<br>
<b>图2</b>: 狗和鸟
</center>
如果我们在狗和鸟的图像的像素空间之间进行线性插值,那我们就会在图3中看到有两幅图像淡入淡出。由上左方到下右方,狗的图像就消失,而鸟的图像就出现。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/3_dog2bird.jpg" height="200px"/><br>
<b>图3</b>: 插值后的结果
</center>
如果我们对两个潜在空间表示进行插值并将其输入到解码器,我们将会在图4中获得从狗到鸟的转换。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/4_model_d2b.jpg" height="200px"/><br>
<b>图4</b>: 如果我们对两个潜在空间表示进行插值并将其输入到解码器,我们将会在图4中获得从狗到鸟的转换。
</center>
明显然,潜在空间更适合取得图像的结构
### 转换实例
<center>
<img src="{{site.baseurl}}/images/week07/07-3/5_zoom1.jpg
" height="120px"/><img src="{{site.baseurl}}/images/week07/07-3/5_zoom2.jpg
" height="120px"/>
<br>
<b>图5</b>: 放大
</center>
<center>
<img src="{{site.baseurl}}/images/week07/07-3/6_shift1.jpg
" height="120px"/><img src="{{site.baseurl}}/images/week07/07-3/6_shift2.jpg
" height="120px"/>
<br>
<b>图6</b>: 移动
</center>
<center>
<img src="{{site.baseurl}}/images/week07/07-3/7_bright1.jpg
" height="120px"/><img src="{{site.baseurl}}/images/week07/07-3/7_bright2.jpg" height="120px"/>
<br>
<b>图7</b>: 亮度
</center>
<center>
<img src="{{site.baseurl}}/images/week07/07-3/8_rotation1.jpg" height="120px"/><img src="{{site.baseurl}}/images/week07/07-3/8_rotation2.jpg" height="120px"/>
<br>
<b>图8</b>: 转动(注意旋转可以是3D)
</center>
### 图像超级分辨率
该模型目的是放大图片同时重建原始脸孔图片。在图9由左到右,第一列是16x16图片,而第2部份是从标准的双三次插值中得到的,而第二部份是神经网路输出的,而其右边的是真实图片。 (https://github.com/david-gpu/srez)
<center><img src="{{site.baseurl}}/images/week07/07-3/9_reconstruct.jpg" height="120px"/>
<br>
<b>图9</b>: 重建原来的脸孔
</center>
由输出的图片中,我们可以看到训练数据中是有偏见,那会令重建的脸孔不准确。比如,上左方的亚洲人面孔在输出中变得像欧洲人,那是因为训用来训练的图像例子中的占比数量不平衡,而左下角女人的重建后的脸看起来很奇怪,那是因为训练图像例子中没有足够的图像有奇数角。
### 图像修补
<center>
<img src="{{site.baseurl}}/images/week07/07-3/10_facepatch.jpg" height="120px"/>
<br>
<b>图10</b>: 在脸上放上灰色的掩蔽
</center>
在脸上放上灰色的掩蔽如图10那样会令图片远离训练流形。而如图11那样重组是利用能量函数最小化在训练流形中找出最接近的样本图片。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/11_fixfacepatch.jpg" height="120px"/>
<br>
<b>图11</b>: <b>图10</b>的重建图像
</center>
### 由文字说明转成图片
<center>
<img src="{{site.baseurl}}/images/week07/07-3/12_caption.jpg" height="50px"/><img src="{{site.baseurl}}/images/week07/07-3/12_capimage.jpg" height="150px"/>
<br>
<b>图12</b>: 由文字说明转成图片
</center>
在图12中,由文字描述翻译成图片是由提取图片中一些文字性的重要视觉信息,然后转换它们成图片。
## [什么是自动编码器?](https://www.youtube.com/watch?v=bggWQ14DD9M&t=879s)
自动编码器是由无监督方式来训练的人工神经网络,它目的是先学习我们数据的编码式表示,然后由学习了的编码式表示来生成输入数据(尽可接近地)。所以,自动编码器的输出是预测它自身的输入。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/13_ae_structure.png" width="40%"/> <br>
<b>图13</b>: 基本自动编码器的架构<br>
</center>
图13显示出一个基本的自动编码器的架构。就如之前,我们由底部的输入 $\boldsymbol{x}$ 开始去输入到编码器( $\boldsymbol{W_h}$, followed by squashing). This results in the intermediate hidden layer $\boldsymbol{h}$. 定义的仿射变换,然后压缩),然后结果在于中间隐藏层 $\boldsymbol{W_x}$定义的仿射变换,然后压缩)。这生成输出 $\boldsymbol{\hat{x}}$,也就是我们模型的预测或对输入的重建。按照我们的惯例,我们说这是3层神经网路。
我们可以使用以下方程式来数学上表示上方的网络:
$$
\boldsymbol{h} = f(\boldsymbol{W_h}\boldsymbol{x} + \boldsymbol{b_h}) \\
\boldsymbol{\hat{x}} = g(\boldsymbol{W_x}\boldsymbol{h} + \boldsymbol{b_x})
$$
以下是我们所使用的维度:
$$
\boldsymbol{x},\boldsymbol{\hat{x}} \in \mathbb{R}^n\\
\boldsymbol{h} \in \mathbb{R}^d\\
\boldsymbol{W_h} \in \mathbb{R}^{d \times n}\\
\boldsymbol{W_x} \in \mathbb{R}^{n \times d}\\
$$
<b>注意:</b> 为了表示PCA,我们可以有一个很近的权重(或已经很近),如以下表示 $\boldsymbol{W_x}\ \dot{=}\ \boldsymbol{W_h}^\top$
上方的点上等号意思是大约等于或很近﹑很接近。
## 为什么我们用自动编码器?
现在,你或很惊愕为什么要预测出输出和自动编码器的应用会是什么。
自动编码器的主要的应用是检测出异常或图像降噪。你知道自动编码器能够对在数据流形中的数据进行数据重建。换句话说,当给予了一个数据流形,我们就希望那个自动编码器仅能够重构该流形中存在的输入。所以我们去限制模型去重建那些在训练中模型看过的事物,而且这样的话,如果有任何变异存在新的输入中,那些变异都会被移除,因为模型对这类干扰不敏感。
另一个自动编码的应用是图像压缩器。如果有一个输入后的层的维度是 $d$ ,而且低低于输入的维度 $n$,那编码器可用作压缩器「隐藏的表示」(以编码方式表示的表示)将处理输入中的所有(或大部分)信息,但用更少的空间。
## 重建损失
让我们看一下我们一般使用的重建损失。数据集的总损失为每个样本损失的平均值,也就是
$$
L = \frac{1}{m} \sum_{j=1}^m \ell(x^{(j)},\hat{x}^{(j)})
$$
当输入是分类的时,我们可以使用交叉熵损失来计算每个样本的损失,下方所示
$$
\ell(\boldsymbol{x},\boldsymbol{\hat{x}}) = -\sum_{i=1}^n [x_i \log(\hat{x}_i) + (1-x_i)\log(1-\hat{x}_i)]
$$
而且当输入是实值,我们或想使用「均方误差损失」,下方所示
$$
\ell(\boldsymbol{x},\boldsymbol{\hat{x}}) = \frac{1}{2} \lVert \boldsymbol{x} - \boldsymbol{\hat{x}} \rVert^2
$$
## 完成过度
当隐藏层的维数$d$是小于输入$n$的维数,那我们说这是低于完成不足的隐藏层。而且类似地,当$d>n$,我们称这为过度完成的隐藏层。图14显示出左方是一个未完成的隐藏层,而右方是过度完成的隐藏层。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/14_over_under_complete.png" width="60%"/> <br>
<b>图14</b>: 未完成与完全未完成的隐藏层<br>
</center>
就如上方讨论过的,一个未完成的隐藏层可以被用在压缩用途,比如我们去把输入编码当中的信息编码到在更少的维度上。另外一面,在过度完成层中,那就会把输入编码到比输入更高的维度。
由于我们正在尝试对输入进行重建,模型倾向于复制所有输入的特性到隐藏层,然后将其作为输出输出来,所有这只不过是和恒等函数没分别。这虽要避免,因为这意味着你的模型无法学习任东西。所以,我们虽要用「信息瓶颈information bottleneck」来加上一些约束。我们去约束隐藏层可以采用的格局到仅适用于训练期间看到的那些配置。这样就可以进行选择性重建(被限于输入空间的一个子集),而同时令模型更对所有不在流形中的东西更不敏感。
是可以看到的是「未完成层」是不能表现得如恒等函数一样,因为隐藏层的没有足够的维度来复制输入。所以「未完成隐藏层」和「过度完成隐藏层」比,它是不太会发生过度拟合问题,但它仍然可以发生过度拟合问题。比如,给予一个强大的编码器和一个解码器,模型简单地会将一个数字关联到每个数据点,同时这样地学会了映射。是有多个方法来避免过度拟合问题,比如正则化方法和架构法﹑其他方法。
## Denoising autoencoder
图15 显示了降噪自动编码器的流形及由看下图直觉地看出其工作原理。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/15_denoising_ae.png" width="500px" /><br>
<b>图15</b>: 降噪自动编码器(Denoising autoencoder)<br>
</center>
在这个模型,我们注入同样现实中我们将在现实中观察到的噪音分布(noisy distribution,就像一个数据点移开,如把正常声音弄成噪音一样,一个噪音分布或弄乱了的分布) ,所以我们可以学到如何稳健地恢复它。
由通过比较输入和输出,我们可以说出已经在流形中点没有移,而在点之外的移动了很多。
图16 给出了输入数据和输出数据之间的关系。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/16_relation1.png" width="350px" />
<img src="{{site.baseurl}}/images/week07/07-3/16_relation2.png" width="330px" />
<br>
<b>图16</b>: 降噪自动编码器的输入和输出<br>
</center>
我们也可以使用不同颜色去代表每一个点移动了的距离。图17显示了其图表。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/17_distance.png" width="500px" /><br>
<b>图17</b>: 测量输入数据的移动距离<br>
</center>
颜色越浅,移动了的距离就更远。由图表所看到的,我们可以说那些在角落的点移动了1个单位,而那些在两个分枝之间的没有移动过,那是因为它们在训练中被上方和下方的分支各自吸引着。
## 压缩式自动编码器
图18 显示出压缩式自动编码器的损失函数和其流形。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/18_contractive_ae.png" width="500px" /><br>
<b>图18</b>: 压缩式自动编码器 <br>
</center>
损失函数包含对「项」重行建进行,同时外加对应输入的隐藏表示的梯度的平方范数(squared norm of the gradient of the hidden representation with respect to the input)。因此,在输入变化的情况下,总损失将最小化隐藏层的变化。好处就是模型就会对重建目标而要走的方向感到敏感,同时不会对其化方向有敏感。图19显示了这些自动编码器的总体工作方式。
图19显示了这些自动编码器的总体工作方式。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/19_basic_ae.png" width="500px" /><br>
<b>图19</b>: 基本自动编码器 <br>
</center>
训练流形是一个单独有维度性的三维物体。而 $\boldsymbol{x}\in \boldsymbol{X}\subseteq\mathbb{R}^{n}$,自动编码器的目标是对卷曲线以一个方式来向下伸展或向内伸展,而$\boldsymbol{z}\in \boldsymbol{Z}\subseteq\mathbb{R}^{d}$。结果是,一个来自于输入层的点会被转成一个在潜在层的1点。现在,我们就有输入空间中的点和潜在空间中的点之间的对应性,但我们没有输入空间的区域和潜在空间的区域之间的对应性。之后,我们用解码器把潜在空间的一个点转换来生成一个有用的输出层。
## [实现自动编码器 - Notebook](https://www.youtube.com/watch?v=bggWQ14DD9M&t=2491s)
Jupyter笔记本可以在[这里找到。](https://github.com/Atcold/pytorch-Deep-Learning/blob/master/10-autoencoder.ipynb).
在这个笔记本中,我们将实现一个标准的自动编码器和降噪自动编码器,然后去比较它们的输出。
### 定义自动编码器模型架构和重建损失
使用大小为 $28 \times 28$ 图片,和30维的隐藏层。转换程序就会是由 $784\to30\to784$. 。如果使用双曲正切目标函数(hyperbolic tangent function )在编码器和解码器的转换程序之中,那我们就能够将输出范围限制为$(-1,1)$。均方误差损失(Mean Squared Error loss)会在模型中被作为损失函数来使用。
```python=
class Autoencoder(nn.Module):
def __init__(self):
super().__init__()
self.encoder = nn.Sequential(
nn.Linear(n, d),
nn.Tanh(),
)
self.decoder = nn.Sequential(
nn.Linear(d, n),
nn.Tanh(),
)
def forward(self, x):
x = self.encoder(x)
x = self.decoder(x)
return x
model = Autoencoder().to(device)
criterion = nn.MSELoss()
```
### 训练标准的自动编码器
去使用PyTorch训练一个标准的自动编码器,你要用接下来五个方法在训练循环中:
#### 向前:
1) 给模型输入图片,那就要用上这个: `output = model(img)` 。 <br>
2) 比较损失,就用这个: `criterion(output, img.data)`。
#### 向后:
3) 清理梯度来确保我们没有积累其值,那就要用上这个: `optimizer.zero_grad()`。 <br>
4) 反向传播,用这个:`loss.backward()`<br>
5) 向后退一步: `optimizer.step()`
图20 显示了标准自动编码器的输出。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/21_output_stae.png" width="500px" /><br>
<b>图20</b>: 标准的自动编码器的输出 <br>
</center>
<br/>
### 训练降噪自动编码器
要对自动编码器进行降噪,您需要添加以下步骤:<br>
1) 叫 `nn.Dropout()` 来随机关闭一些神经元。 <br>
2) 创建掩盖型噪音: `do(torch.ones(img.shape))`。<br>
3) 把好图片乘「二进制掩盖码binary masks」来创建一个坏了的图片: `img_bad = (img * noise).to(device)`。
图21 示出了降噪自动编码器的输出。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/22_out_denoising_ae.png" width="500px" /><br>
<b>图21</b>: 降噪自动编码器的输出 <br>
</center>
### Kernels comparison
一个重要的注意是,即使事实上输入维度是 $28 \times 28 = 784$,但一个维度为 500的隐藏层也还是过度完成层,因为图片中的黑色像素。下方内核的例子用未完成层的标准自动编码器来训练。明显地,一些存在数字的区域中的像素说明了某种图案被检测到,同时地,这些区外的像素就基本上是随机的。这说明了一个标准自动编码器是不会理会数字存在的区域以外的区域。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/AE_kernels.png" style="zoom: 40%; background-color:#DCDCDC;" /><br>
<b>图22:</b> 标准AE内核。
</center>
相反地,当同样的数据被传到降噪自动编码器中时,而在拟合(fitting)模型之前对每一张图都用了Dropout 掩膜(Dropout mask)时,一些不一样的东西就会发生了。每个学习存在数字之外的区域的结构的内核都会学到成一些恒定值,所以这个模型现在就会关心数字区域以外的像素,那是因为对图片实行了Dropout 掩膜(Dropout mask )。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/denoiser_kernels.png" style="zoom: 50%; background-color:#DCDCDC;" /><br>
<b>图23:</b> 降噪AE内核。
</center>
比较一下那一个最强最厉害的话,那我们的自动编码器是做得更好!你可以在下方看到其结果。
<center>
<img src="{{site.baseurl}}/images/week07/07-3/AE_output.png" style="zoom: 40%; background-color:#DCDCDC;" /><br>
<b>图24:</b> 输入数据(MNIST数字版)。
</center>
<center>
<img src="{{site.baseurl}}/images/week07/07-3/denoiser_output.png" style="zoom: 40%; background-color:#DCDCDC;" /><br>
<b>图25:</b> 降噪AE重建。
</center>
<center>
<img src="{{site.baseurl}}/images/week07/07-3/telea_output.png" style="zoom: 40%; background-color:#DCDCDC;" /><br>
<b>图26:</b> Telea修复输出。
</center>
<center>
<img src="{{site.baseurl}}/images/week07/07-3/navier-stokes_output.png" style="zoom: 40%; background-color:#DCDCDC;" /><br>
<b>图27:</b> Navier-Stokes修复输出。
</center>
|
{
"pile_set_name": "Github"
}
|
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Article 1 from feed 1</title>
</head>
<body>
<h1>Article 3 from Feed 14</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
{
"@metadata": {
"authors": [
"J budissin",
"Michawiki"
]
},
"ooui-outline-control-move-down": "Zapisk dele přesunyć",
"ooui-outline-control-move-up": "Zapisk horje přesunyć",
"ooui-outline-control-remove": "Zapisk wotstronić",
"ooui-toolbar-more": "Wjace",
"ooui-toolgroup-expand": "Wjace",
"ooui-toolgroup-collapse": "Mjenje",
"ooui-dialog-message-accept": "W porjadku",
"ooui-dialog-message-reject": "Přetorhnyć",
"ooui-dialog-process-error": "Něšto je so nimokuliło",
"ooui-dialog-process-dismiss": "Schować",
"ooui-dialog-process-retry": "Hišće raz spytać",
"ooui-dialog-process-continue": "Dale"
}
|
{
"pile_set_name": "Github"
}
|
<ng-container [ngSwitch]="name">
<svg *ngSwitchCase="'menu'" style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#ffffff" d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
</svg>
<svg *ngSwitchCase="'account'" style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#ffffff" d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z" />
</svg>
<svg *ngSwitchCase="'cart'" style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#ffffff" d="M17,18C15.89,18 15,18.89 15,20A2,2 0 0,0 17,22A2,2 0 0,0 19,20C19,18.89 18.1,18 17,18M1,2V4H3L6.6,11.59L5.24,14.04C5.09,14.32 5,14.65 5,15A2,2 0 0,0 7,17H19V15H7.42A0.25,0.25 0 0,1 7.17,14.75C7.17,14.7 7.18,14.66 7.2,14.63L8.1,13H15.55C16.3,13 16.96,12.58 17.3,11.97L20.88,5.5C20.95,5.34 21,5.17 21,5A1,1 0 0,0 20,4H5.21L4.27,2M7,18C5.89,18 5,18.89 5,20A2,2 0 0,0 7,22A2,2 0 0,0 9,20C9,18.89 8.1,18 7,18Z" />
</svg>
<svg *ngSwitchCase="'magnify'" style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#303030" d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" />
</svg>
</ng-container>
|
{
"pile_set_name": "Github"
}
|
/**
* Alternate Sphinx design
* Originally created by Armin Ronacher for Werkzeug, adapted by Georg Brandl.
*/
body {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif;
font-size: 14px;
letter-spacing: -0.01em;
line-height: 150%;
text-align: center;
/*background-color: #AFC1C4; */
background-color: #BFD1D4;
color: black;
padding: 0;
border: 1px solid #aaa;
margin: 0px 80px 0px 80px;
min-width: 740px;
}
a {
color: #CA7900;
text-decoration: none;
}
a:hover {
color: #2491CF;
}
pre {
font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
font-size: 0.95em;
letter-spacing: 0.015em;
padding: 0.5em;
border: 1px solid #ccc;
background-color: #f8f8f8;
}
td.linenos pre {
padding: 0.5em 0;
border: 0;
background-color: transparent;
color: #aaa;
}
table.highlighttable {
margin-left: 0.5em;
}
table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
cite, code, tt {
font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
font-size: 0.95em;
letter-spacing: 0.01em;
}
hr {
border: 1px solid #abc;
margin: 2em;
}
tt {
background-color: #f2f2f2;
border-bottom: 1px solid #ddd;
color: #333;
}
tt.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
border: 0;
}
tt.descclassname {
background-color: transparent;
border: 0;
}
tt.xref {
background-color: transparent;
font-weight: bold;
border: 0;
}
a tt {
background-color: transparent;
font-weight: bold;
border: 0;
color: #CA7900;
}
a tt:hover {
color: #2491CF;
}
dl {
margin-bottom: 15px;
}
dd p {
margin-top: 0px;
}
dd ul, dd table {
margin-bottom: 10px;
}
dd {
margin-top: 3px;
margin-bottom: 10px;
margin-left: 30px;
}
.refcount {
color: #060;
}
dt:target,
.highlight {
background-color: #fbe54e;
}
dl.class, dl.function {
border-top: 2px solid #888;
}
dl.method, dl.attribute {
border-top: 1px solid #aaa;
}
dl.glossary dt {
font-weight: bold;
font-size: 1.1em;
}
pre {
line-height: 120%;
}
pre a {
color: inherit;
text-decoration: underline;
}
.first {
margin-top: 0 !important;
}
div.document {
background-color: white;
text-align: left;
background-image: url(contents.png);
background-repeat: repeat-x;
}
/*
div.documentwrapper {
width: 100%;
}
*/
div.clearer {
clear: both;
}
div.related h3 {
display: none;
}
div.related ul {
background-image: url(navigation.png);
height: 2em;
list-style: none;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 0;
padding-left: 10px;
}
div.related ul li {
margin: 0;
padding: 0;
height: 2em;
float: left;
}
div.related ul li.right {
float: right;
margin-right: 5px;
}
div.related ul li a {
margin: 0;
padding: 0 5px 0 5px;
line-height: 1.75em;
color: #EE9816;
}
div.related ul li a:hover {
color: #3CA8E7;
}
div.body {
margin: 0;
padding: 0.5em 20px 20px 20px;
}
div.bodywrapper {
margin: 0 240px 0 0;
border-right: 1px solid #ccc;
}
div.body a {
text-decoration: underline;
}
div.sphinxsidebar {
margin: 0;
padding: 0.5em 15px 15px 0;
width: 210px;
float: right;
text-align: left;
/* margin-left: -100%; */
}
div.sphinxsidebar h4, div.sphinxsidebar h3 {
margin: 1em 0 0.5em 0;
font-size: 0.9em;
padding: 0.1em 0 0.1em 0.5em;
color: white;
border: 1px solid #86989B;
background-color: #AFC1C4;
}
div.sphinxsidebar ul {
padding-left: 1.5em;
margin-top: 7px;
list-style: none;
padding: 0;
line-height: 130%;
}
div.sphinxsidebar ul ul {
list-style: square;
margin-left: 20px;
}
p {
margin: 0.8em 0 0.5em 0;
}
p.rubric {
font-weight: bold;
}
h1 {
margin: 0;
padding: 0.7em 0 0.3em 0;
font-size: 1.5em;
color: #11557C;
}
h2 {
margin: 1.3em 0 0.2em 0;
font-size: 1.35em;
padding: 0;
}
h3 {
margin: 1em 0 -0.3em 0;
font-size: 1.2em;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: black!important;
}
h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor {
display: none;
margin: 0 0 0 0.3em;
padding: 0 0.2em 0 0.2em;
color: #aaa!important;
}
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor,
h5:hover a.anchor, h6:hover a.anchor {
display: inline;
}
h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover,
h5 a.anchor:hover, h6 a.anchor:hover {
color: #777;
background-color: #eee;
}
table {
border-collapse: collapse;
margin: 0 -0.5em 0 -0.5em;
}
table td, table th {
padding: 0.2em 0.5em 0.2em 0.5em;
}
div.footer {
background-color: #E3EFF1;
color: #86989B;
padding: 3px 8px 3px 0;
clear: both;
font-size: 0.8em;
text-align: right;
}
div.footer a {
color: #86989B;
text-decoration: underline;
}
div.pagination {
margin-top: 2em;
padding-top: 0.5em;
border-top: 1px solid black;
text-align: center;
}
div.sphinxsidebar ul.toc {
margin: 1em 0 1em 0;
padding: 0 0 0 0.5em;
list-style: none;
}
div.sphinxsidebar ul.toc li {
margin: 0.5em 0 0.5em 0;
font-size: 0.9em;
line-height: 130%;
}
div.sphinxsidebar ul.toc li p {
margin: 0;
padding: 0;
}
div.sphinxsidebar ul.toc ul {
margin: 0.2em 0 0.2em 0;
padding: 0 0 0 1.8em;
}
div.sphinxsidebar ul.toc ul li {
padding: 0;
}
div.admonition, div.warning {
font-size: 0.9em;
margin: 1em 0 0 0;
border: 1px solid #86989B;
background-color: #f7f7f7;
}
div.admonition p, div.warning p {
margin: 0.5em 1em 0.5em 1em;
padding: 0;
}
div.admonition pre, div.warning pre {
margin: 0.4em 1em 0.4em 1em;
}
div.admonition p.admonition-title,
div.warning p.admonition-title {
margin: 0;
padding: 0.1em 0 0.1em 0.5em;
color: white;
border-bottom: 1px solid #86989B;
font-weight: bold;
background-color: #AFC1C4;
}
div.warning {
border: 1px solid #940000;
}
div.warning p.admonition-title {
background-color: #CF0000;
border-bottom-color: #940000;
}
div.admonition ul, div.admonition ol,
div.warning ul, div.warning ol {
margin: 0.1em 0.5em 0.5em 3em;
padding: 0;
}
div.versioninfo {
margin: 1em 0 0 0;
border: 1px solid #ccc;
background-color: #DDEAF0;
padding: 8px;
line-height: 1.3em;
font-size: 0.9em;
}
a.headerlink {
color: #c60f0f!important;
font-size: 1em;
margin-left: 6px;
padding: 0 4px 0 4px;
text-decoration: none!important;
visibility: hidden;
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink {
visibility: visible;
}
a.headerlink:hover {
background-color: #ccc;
color: white!important;
}
table.indextable td {
text-align: left;
vertical-align: top;
}
table.indextable dl, table.indextable dd {
margin-top: 0;
margin-bottom: 0;
}
table.indextable tr.pcap {
height: 10px;
}
table.indextable tr.cap {
margin-top: 10px;
background-color: #f2f2f2;
}
img.toggler {
margin-right: 3px;
margin-top: 3px;
cursor: pointer;
}
img.inheritance {
border: 0px
}
form.pfform {
margin: 10px 0 20px 0;
}
table.contentstable {
width: 90%;
}
table.contentstable p.biglink {
line-height: 150%;
}
a.biglink {
font-size: 1.3em;
}
span.linkdescr {
font-style: italic;
padding-top: 5px;
font-size: 90%;
}
ul.search {
margin: 10px 0 0 20px;
padding: 0;
}
ul.search li {
padding: 5px 0 5px 20px;
background-image: url(file.png);
background-repeat: no-repeat;
background-position: 0 7px;
}
ul.search li a {
font-weight: bold;
}
ul.search li div.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
}
ul.keywordmatches li.goodmatch a {
font-weight: bold;
}
|
{
"pile_set_name": "Github"
}
|
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
package fixtures
const (
SampleShards = `
[{
"state": "STARTED",
"prirep": "p",
"node": "stack-sample-es-lkrjf7224s",
"shard": "0",
"index": "sample-data-2"
},
{
"state": "STARTED",
"prirep": "r",
"node": "stack-sample-es-4fxm76vnwj",
"shard": "1",
"index": "sample-data-2"
},
{
"state": "UNASSIGNED",
"prirep": "p",
"node": null,
"shard": "2",
"index": "sample-data-2"
}
]
`
RelocatingShards = `[{
"index": "data-integrity-check",
"shard": "1",
"state": "RELOCATING",
"node": "test-mutation-less-nodes-sqn9-es-masterdata-1 -> 10.56.2.33 8DqGuLtrSNyMfE2EfKNDgg test-mutation-less-nodes-sqn9-es-masterdata-0"
}, {
"index": "data-integrity-check",
"shard": "2",
"state": "RELOCATING",
"node": "test-mutation-less-nodes-sqn9-es-masterdata-2 -> 10.56.2.33 8DqGuLtrSNyMfE2EfKNDgg test-mutation-less-nodes-sqn9-es-masterdata-0"
}, {
"index": "data-integrity-check",
"shard": "0",
"state": "STARTED",
"node": "test-mutation-less-nodes-sqn9-es-masterdata-0"
}, {
"index": "data-integrity-check",
"shard": "3",
"state": "UNASSIGNED",
"node": ""
}]`
NoShards = `
[]
`
)
|
{
"pile_set_name": "Github"
}
|
---
layout: "default"
title: "Operator: &>>="
description: "Swift documentation for the '&>>=' operator."
root: "/v3.1"
---
<code class="language-swift"> operator &>>= {
associativity right
precedence
assignment
}</code>
<h3>Declarations</h3>
<div class="declaration" id="func-ampgtgteq-t-where-t_-fixedwidthinteger_-inout-t-rhs_-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampgtgteq-t-where-t_-fixedwidthinteger_-inout-t-rhs_-t">func <wbr>&>>= <T where T : FixedWidthInteger>(<wbr>_:<wbr> inout T, rhs: T)</a>
<div class="comment collapse" id="comment-func-ampgtgteq-t-where-t_-fixedwidthinteger_-inout-t-rhs_-t"><div class="p">
<h4>Declaration</h4>
<code class="language-swift">func &>>=<T where T : FixedWidthInteger>(lhs: inout T, rhs: T)</code>
</div></div>
</div>
<div class="declaration" id="func-ampgtgteq-t-u-where-t_-fixedwidthinteger-u_-binaryinteger_-inout-t-rhs_-u">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-ampgtgteq-t-u-where-t_-fixedwidthinteger-u_-binaryinteger_-inout-t-rhs_-u">func <wbr>&>>= <T, U where T :<wbr> FixedWidthInteger, U : BinaryInteger>(<wbr>_:<wbr> inout T, rhs: U)</a>
<div class="comment collapse" id="comment-func-ampgtgteq-t-u-where-t_-fixedwidthinteger-u_-binaryinteger_-inout-t-rhs_-u"><div class="p">
<h4>Declaration</h4>
<code class="language-swift">func &>>=<T, U where T : FixedWidthInteger, U : BinaryInteger>(lhs: inout T, rhs: U)</code>
</div></div>
</div>
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.