code stringlengths 5 1.01M | repo_name stringlengths 5 84 | path stringlengths 4 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 5 1.01M | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: predefined colorspaces, rec2020, percent values</title>
<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#predefined">
<link rel="match" href="greensquare-ref.html">
<meta name="assert" content="Color function with explicit rec2020 value as percent matches sRGB #009900">
<style>
.test { background-color: red; width: 12em; height: 6em; margin-top:0}
.ref { background-color: #009900; width: 12em; height: 6em; margin-bottom: 0}
.test {background-color: color(rec2020 33.033% 55.976% 14.863%)}
</style>
<body>
<p>Test passes if you see a green square, and no red.</p>
<p class="ref"> </p>
<p class="test"> </p>
</body> | asajeffrey/servo | tests/wpt/web-platform-tests/css/css-color/predefined-012.html | HTML | mpl-2.0 | 780 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
2516,
1028,
20116,
2015,
3609,
1018,
1024,
3653,
3207,
23460,
2094,
6087,
15327,
2015,
1010,
28667,
11387,
11387,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
##大纲
* DevOps基础
* DevOps是什么
* DevOps解决什么问题
* DevOps都做什么
* Vagrant基础
* init
* box管理
* up
* ssh
* reload
* destroy
* port forward
* multi-machines
##目标
* 基本理解DevOps以及DevOps要做的事情
* 可以使用Vagrant创建虚拟机并使用虚拟机工作
##详细内容
#### DevOps是啥?
```
DevOps顾名思义, 就是Developer + Operatior,开发 + 运维。
当然,其实这里面还得加上QA。如图所示,三不像。
难道DevOps仅仅就是干三个角色的事儿么?
必然不是
DevOps是互相紧扣的一个过程。
通过Dev看QA,通过Ops看Dev等等
以上的概念太大,说个例子:
现在BOSS要你把所有javaEE的API拆成单独的jar包或者war包
然后每个包都部署到一个或者多个机器上。
真的你会去启动N个机器手动去部署么?
QA怎么去验证各个java实例的运行?
开发以后还怎么开发?
DevOps就会cover到上面的事儿
比如引入gradle自动拆成api包,然后要引入一个CI工具,比如jenkins或者go
当然构建出artifact是远远不够的,引入CD,我们要通过一系列的脚本来达到快速部署
还有在这个PIPELINE上的QA流程,是否通过job
最后,还能把虚拟化引入,比如vagrant、docker来部署单个java进程。
以上cover的就是devops的事儿
```
#### DevOps都干些啥?
```
如图,这些工具DevOps或多或少都会用
当然,我们普遍在LINUX下玩这件事儿,所以中间的BASH和SHELL SCRIPT是必须要求的
这里可以看到
有各种语言平台
有各种配置管理
有各种CI工具
有各种虚拟化产品
这些都会穿插在我们整个开发周期,所以,DevOps会一直跟这些工具打交到
```
#### DevOps解决什么问题
```
在提DevOps定义的时候举了一个例子,
实际上,DevOps就是解决整个开发过程中的协调问题
如何快速的给DEV和QA配置环境,开发的产出如何快速的到QA手里
QA反馈如何能及时到Dev手上
最重要的:CD
仅修改一行代码,要多久才能部署到产品环境,个人认为这就是DevOps。
```
#### SESSION课程和范围
```
一共会有5节课,这次是ITERATOR 0
目标是做一套完整的PIPELINE,达到快速部署的目的
会涉及到 java、jenkins、vagrant、tomcat、git等软件
通过是MAC作为宿主机,LINUX作为虚拟机进行整个课程的练习
```
| ThoughtWorks-Chengdu-DevOps-Club/tw_devops_workshop | season_1/workshop_0/introduction.md | Markdown | bsd-2-clause | 2,470 | [
30522,
1001,
1001,
1810,
100,
1008,
16475,
11923,
100,
100,
1008,
16475,
11923,
100,
100,
100,
1008,
16475,
11923,
100,
100,
100,
100,
100,
100,
1008,
16475,
11923,
1961,
100,
100,
100,
1008,
12436,
18980,
100,
100,
1008,
30524,
100,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*The MIT License (MIT)
Copyright (c) 2014 PMU Staff
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
using System;
using System.Collections.Generic;
using System.Text;
using Client.Logic.Maps;
namespace Client.Logic.Editors.RDungeons
{
public class EditableRDungeonTrap
{
public Tile SpecialTile { get; set; }
public int AppearanceRate { get; set; }
public EditableRDungeonTrap()
{
SpecialTile = new Tile();
}
}
}
| Sprinkoringo/PMU-Client | Client/Editors/RDungeons/EditableRDungeonTrap.cs | C# | mit | 1,465 | [
30522,
1013,
1008,
1996,
10210,
6105,
1006,
10210,
1007,
9385,
1006,
1039,
1007,
2297,
7610,
2226,
3095,
6656,
2003,
2182,
3762,
4379,
1010,
2489,
1997,
3715,
1010,
2000,
2151,
2711,
11381,
1037,
6100,
1997,
2023,
4007,
1998,
3378,
12653,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var path = require('path');
console.log(path.join(path.relative('.', __dirname),'include'));
| geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtlocation/src/3rdparty/mapbox-gl-native/src/3rd_party/protozero/include_dirs.js | JavaScript | gpl-3.0 | 93 | [
30522,
13075,
4130,
1027,
5478,
1006,
1005,
4130,
1005,
1007,
1025,
10122,
1012,
8833,
1006,
4130,
1012,
3693,
1006,
4130,
1012,
5816,
1006,
1005,
1012,
1005,
1010,
1035,
1035,
16101,
18442,
1007,
1010,
1005,
2421,
1005,
1007,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<TS language="vi_VN" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Nhấn chuột phải để sửa địa chỉ hoặc nhãn</translation>
</message>
<message>
<source>Create a new address</source>
<translation>Tạo một địa chỉ mới</translation>
</message>
<message>
<source>&New</source>
<translation>&Tạo mới</translation>
</message>
<message>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Copy địa chỉ được chọn vào clipboard</translation>
</message>
<message>
<source>&Copy</source>
<translation>&Copy</translation>
</message>
<message>
<source>C&lose</source>
<translation>Đó&ng</translation>
</message>
<message>
<source>Delete the currently selected address from the list</source>
<translation>Xóa địa chỉ hiện tại từ danh sách</translation>
</message>
<message>
<source>Export the data in the current tab to a file</source>
<translation>Xuất dữ liệu trong mục hiện tại ra file</translation>
</message>
<message>
<source>&Export</source>
<translation>&Xuất</translation>
</message>
<message>
<source>&Delete</source>
<translation>&Xóa</translation>
</message>
<message>
<source>Choose the address to send coins to</source>
<translation>Chọn địa chỉ để gửi coin đến</translation>
</message>
<message>
<source>Choose the address to receive coins with</source>
<translation>Chọn địa chỉ để nhận coin</translation>
</message>
<message>
<source>C&hoose</source>
<translation>Chọn</translation>
</message>
<message>
<source>Sending addresses</source>
<translation>Địa chỉ gửi đến</translation>
</message>
<message>
<source>Receiving addresses</source>
<translation>Địa chỉ nhận</translation>
</message>
<message>
<source>These are your Peercoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>Đây là các địa chỉ Peercoin để gửi bạn gửi tiền. Trước khi gửi bạn nên kiểm tra lại số tiền bạn muốn gửi và địa chỉ peercoin của người nhận.</translation>
</message>
<message>
<source>These are your Peercoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>
<translation>Đây là các địa chỉ Peercoin để bạn nhận tiền. Với mỗi giao dịch, bạn nên dùng một địa chỉ Peercoin mới để nhận tiền.</translation>
</message>
<message>
<source>&Copy Address</source>
<translation>&Chép Địa chỉ</translation>
</message>
<message>
<source>Copy &Label</source>
<translation>Chép &Nhãn</translation>
</message>
<message>
<source>&Edit</source>
<translation>&Sửa</translation>
</message>
<message>
<source>Export Address List</source>
<translation>Xuất Danh Sách Địa Chỉ</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Các tệp tác nhau bằng đấu phẩy (* .csv)</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation>Xuất không thành công</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<source>Label</source>
<translation>Nhãn</translation>
</message>
<message>
<source>Address</source>
<translation>Địa chỉ</translation>
</message>
<message>
<source>(no label)</source>
<translation>(không nhãn)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<source>Passphrase Dialog</source>
<translation>Hội thoại Passphrase</translation>
</message>
<message>
<source>Enter passphrase</source>
<translation>Điền passphrase</translation>
</message>
<message>
<source>New passphrase</source>
<translation>Passphrase mới</translation>
</message>
<message>
<source>Repeat new passphrase</source>
<translation>Điền lại passphrase</translation>
</message>
<message>
<source>Show password</source>
<translation>Hiện mật khẩu</translation>
</message>
<message>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Nhập passphrase mới cho Ví của bạn.<br/>Vui long dùng passphrase gồm<b>ít nhất 10 ký tự bất kỳ </b>, hoặc <b>ít nhất 8 chữ</b>.</translation>
</message>
<message>
<source>Encrypt wallet</source>
<translation>Mã hóa ví</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Thao tác này cần cụm từ mật khẩu để mở khóa ví.</translation>
</message>
<message>
<source>Unlock wallet</source>
<translation>Mở khóa ví</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Thao tác này cần cụm mật khẩu ví của bạn để giải mã ví.</translation>
</message>
<message>
<source>Decrypt wallet</source>
<translation>Giải mã ví</translation>
</message>
<message>
<source>Change passphrase</source>
<translation>Đổi cụm mật khẩu</translation>
</message>
<message>
<source>Enter the old passphrase and new passphrase to the wallet.</source>
<translation>Nhập cụm từ mật khẩu cũ và cụm mật khẩu mới vào ví.</translation>
</message>
<message>
<source>Confirm wallet encryption</source>
<translation>Xác nhận mã hóa ví</translation>
</message>
<message>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Bạn có chắc chắn muốn mã hóa ví của bạn?</translation>
</message>
<message>
<source>Wallet encrypted</source>
<translation>Ví đã được mã hóa</translation>
</message>
<message>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>QUAN TRỌNG: Bất kỳ bản sao lưu trước nào bạn đã làm từ tệp ví tiền của bạn phải được thay thế bằng tệp ví tiền mới được tạo và mã hóa. Vì lý do bảo mật, các bản sao lưu trước đó của tệp ví tiền không được mã hóa sẽ trở nên vô dụng ngay khi bạn bắt đầu sử dụng ví đã được mã hóa.</translation>
</message>
<message>
<source>Wallet encryption failed</source>
<translation>Mã hóa ví không thành công</translation>
</message>
<message>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Mã hóa ví không thành công do có lỗi bên trong.
Ví của bạn chưa được mã hóa.</translation>
</message>
<message>
<source>The supplied passphrases do not match.</source>
<translation>Cụm mật khẩu được cung cấp không khớp.</translation>
</message>
<message>
<source>Wallet unlock failed</source>
<translation>Mở khóa ví không thành công</translation>
</message>
<message>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Cụm từ mật mã nhập vào không đúng</translation>
</message>
<message>
<source>Wallet decryption failed</source>
<translation>Giải mã ví không thành công</translation>
</message>
<message>
<source>Wallet passphrase was successfully changed.</source>
<translation>Cụm từ mật khẩu mã hóa của ví đã được thay đổi.</translation>
</message>
<message>
<source>Warning: The Caps Lock key is on!</source>
<translation>Chú ý: Caps Lock đang được bật!</translation>
</message>
</context>
<context>
<name>BanTableModel</name>
<message>
<source>IP/Netmask</source>
<translation>IP/Netmask</translation>
</message>
<message>
<source>Banned Until</source>
<translation>Bị cấm đến</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<source>Sign &message...</source>
<translation>Chứ ký & Tin nhắn...</translation>
</message>
<message>
<source>Synchronizing with network...</source>
<translation>Đồng bộ hóa với mạng</translation>
</message>
<message>
<source>&Overview</source>
<translation>&Tổng quan</translation>
</message>
<message>
<source>Node</source>
<translation>Node</translation>
</message>
<message>
<source>Show general overview of wallet</source>
<translation>Hiện thỉ thông tin sơ lược chung về Ví</translation>
</message>
<message>
<source>&Transactions</source>
<translation>&Giao dịch</translation>
</message>
<message>
<source>Browse transaction history</source>
<translation>Duyệt tìm lịch sử giao dịch</translation>
</message>
<message>
<source>E&xit</source>
<translation>T&hoát</translation>
</message>
<message>
<source>Quit application</source>
<translation>Thoát chương trình</translation>
</message>
<message>
<source>&About %1</source>
<translation>&Thông tin về %1</translation>
</message>
<message>
<source>Show information about %1</source>
<translation>Hiện thông tin về %1</translation>
</message>
<message>
<source>About &Qt</source>
<translation>Về &Qt</translation>
</message>
<message>
<source>Show information about Qt</source>
<translation>Xem thông tin về Qt</translation>
</message>
<message>
<source>&Options...</source>
<translation>&Tùy chọn...</translation>
</message>
<message>
<source>Modify configuration options for %1</source>
<translation>Chỉnh sửa thiết đặt tùy chọn cho %1</translation>
</message>
<message>
<source>&Encrypt Wallet...</source>
<translation>&Mã hóa ví tiền</translation>
</message>
<message>
<source>&Backup Wallet...</source>
<translation>&Sao lưu ví tiền...</translation>
</message>
<message>
<source>&Change Passphrase...</source>
<translation>&Thay đổi mật khẩu...</translation>
</message>
<message>
<source>&Sending addresses...</source>
<translation>&Địa chỉ gửi</translation>
</message>
<message>
<source>&Receiving addresses...</source>
<translation>Địa chỉ nhận</translation>
</message>
<message>
<source>Open &URI...</source>
<translation>Mở &URI...</translation>
</message>
<message>
<source>Click to disable network activity.</source>
<translation>Nhấp để vô hiệu hóa kết nối mạng.</translation>
</message>
<message>
<source>Network activity disabled.</source>
<translation>Kết nối mạng đã bị ngắt</translation>
</message>
<message>
<source>Click to enable network activity again.</source>
<translation>Nhấp để kết nối lại mạng.</translation>
</message>
<message>
<source>Syncing Headers (%1%)...</source>
<translation>Đồng bộ hóa các Headers (%1%)...</translation>
</message>
<message>
<source>Reindexing blocks on disk...</source>
<translation>Đánh chỉ số (indexing) lại các khối (blocks) trên ổ đĩa ...</translation>
</message>
<message>
<source>Send coins to a Peercoin address</source>
<translation>Gửi coins đến tài khoản Peercoin</translation>
</message>
<message>
<source>Backup wallet to another location</source>
<translation>Sao lưu ví tiền ở vị trí khác</translation>
</message>
<message>
<source>Change the passphrase used for wallet encryption</source>
<translation>Thay đổi cụm mật mã dùng cho mã hoá Ví</translation>
</message>
<message>
<source>&Debug window</source>
<translation>&Cửa sổ xử lý lỗi (debug)</translation>
</message>
<message>
<source>Open debugging and diagnostic console</source>
<translation>Mở trình gỡ lỗi và bảng lệnh chuẩn đoán</translation>
</message>
<message>
<source>&Verify message...</source>
<translation>&Tin nhắn xác thực</translation>
</message>
<message>
<source>Peercoin</source>
<translation>Peercoin</translation>
</message>
<message>
<source>Wallet</source>
<translation>Ví</translation>
</message>
<message>
<source>&Send</source>
<translation>&Gửi</translation>
</message>
<message>
<source>&Receive</source>
<translation>&Nhận</translation>
</message>
<message>
<source>&Show / Hide</source>
<translation>Ẩn / H&iện</translation>
</message>
<message>
<source>Show or hide the main Window</source>
<translation>Hiện hoặc ẩn cửa sổ chính</translation>
</message>
<message>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>Mã hoá các khoá bí mật trong Ví của bạn.</translation>
</message>
<message>
<source>Sign messages with your Peercoin addresses to prove you own them</source>
<translation>Dùng địa chỉ Peercoin của bạn ký các tin nhắn để xác minh những nội dung tin nhắn đó là của bạn.</translation>
</message>
<message>
<source>Verify messages to ensure they were signed with specified Peercoin addresses</source>
<translation>Kiểm tra các tin nhắn để chắc chắn rằng chúng được ký bằng các địa chỉ Peercoin xác định.</translation>
</message>
<message>
<source>&File</source>
<translation>&File</translation>
</message>
<message>
<source>&Settings</source>
<translation>&Thiết lập</translation>
</message>
<message>
<source>&Help</source>
<translation>Trợ &giúp</translation>
</message>
<message>
<source>Tabs toolbar</source>
<translation>Thanh công cụ (toolbar)</translation>
</message>
<message>
<source>Request payments (generates QR codes and peercoin: URIs)</source>
<translation>Yêu cầu thanh toán(tạo mã QR và địa chỉ Peercoin: URLs)</translation>
</message>
<message>
<source>Show the list of used sending addresses and labels</source>
<translation>Hiện thỉ danh sách các địa chỉ và nhãn đã dùng để gửi.</translation>
</message>
<message>
<source>Show the list of used receiving addresses and labels</source>
<translation>Hiện thỉ danh sách các địa chỉ và nhãn đã dùng để nhận.</translation>
</message>
<message>
<source>Open a peercoin: URI or payment request</source>
<translation>Mở peercoin:URL hoặc yêu cầu thanh toán</translation>
</message>
<message>
<source>&Command-line options</source>
<translation>7Tùy chọn dòng lệnh</translation>
</message>
<message numerus="yes">
<source>%n active connection(s) to Peercoin network</source>
<translation><numerusform>%n liên kết hoạt động với mạng lưới Peercoin</numerusform></translation>
</message>
<message>
<source>Indexing blocks on disk...</source>
<translation>Đang lập chỉ mục các khối trên ổ đĩa</translation>
</message>
<message>
<source>Processing blocks on disk...</source>
<translation>Đang xử lý các khối trên ổ đĩa...</translation>
</message>
<message numerus="yes">
<source>Processed %n block(s) of transaction history.</source>
<translation><numerusform>Đã xử lý %n khối của lịch sử giao dịch.</numerusform></translation>
</message>
<message>
<source>%1 behind</source>
<translation>%1 chậm trễ</translation>
</message>
<message>
<source>Last received block was generated %1 ago.</source>
<translation>Khối (block) cuối cùng nhận được cách đây %1</translation>
</message>
<message>
<source>Transactions after this will not yet be visible.</source>
<translation>Những giao dịch sau đó sẽ không hiện thị.</translation>
</message>
<message>
<source>Error</source>
<translation>Lỗi</translation>
</message>
<message>
<source>Warning</source>
<translation>Chú ý</translation>
</message>
<message>
<source>Information</source>
<translation>Thông tin</translation>
</message>
<message>
<source>Up to date</source>
<translation>Đã cập nhật</translation>
</message>
<message>
<source>Show the %1 help message to get a list with possible Peercoin command-line options</source>
<translation>Hiển thị tin nhắn trợ giúp %1 để có được danh sách với các tùy chọn dòng lệnh Peercoin.</translation>
</message>
<message>
<source>Connecting to peers...</source>
<translation>Kết nối với các máy ngang hàng...</translation>
</message>
<message>
<source>Catching up...</source>
<translation>Bắt kịp...</translation>
</message>
<message>
<source>Date: %1
</source>
<translation>Ngày: %1
</translation>
</message>
<message>
<source>Amount: %1
</source>
<translation>Số lượng: %1
</translation>
</message>
<message>
<source>Type: %1
</source>
<translation>Loại: %1
</translation>
</message>
<message>
<source>Label: %1
</source>
<translation>Nhãn hiệu: %1
</translation>
</message>
<message>
<source>Address: %1
</source>
<translation>Địa chỉ: %1
</translation>
</message>
<message>
<source>Sent transaction</source>
<translation>Giao dịch đã gửi</translation>
</message>
<message>
<source>Incoming transaction</source>
<translation>Giao dịch đang tới</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Ví tiền <b> đã được mã hóa</b>và hiện <b>đang mở</b></translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Ví tiền <b> đã được mã hóa</b>và hiện <b>đang khóa</b></translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<source>Quantity:</source>
<translation>Lượng:</translation>
</message>
<message>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<source>Amount:</source>
<translation>Lượng:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Phí:</translation>
</message>
<message>
<source>After Fee:</source>
<translation>Sau thuế, phí:</translation>
</message>
<message>
<source>Change:</source>
<translation>Thay đổi:</translation>
</message>
<message>
<source>(un)select all</source>
<translation>(bỏ)chọn tất cả</translation>
</message>
<message>
<source>Tree mode</source>
<translation>Chế độ cây</translation>
</message>
<message>
<source>List mode</source>
<translation>Chế độ danh sách</translation>
</message>
<message>
<source>Amount</source>
<translation>Lượng</translation>
</message>
<message>
<source>Date</source>
<translation>Ngày tháng</translation>
</message>
<message>
<source>Confirmations</source>
<translation>Lần xác nhận</translation>
</message>
<message>
<source>Confirmed</source>
<translation>Đã xác nhận</translation>
</message>
<message>
<source>(no label)</source>
<translation>(không nhãn)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<source>Edit Address</source>
<translation>Thay đổi địa chỉ</translation>
</message>
<message>
<source>&Label</source>
<translation>Nhãn</translation>
</message>
<message>
<source>&Address</source>
<translation>Địa chỉ</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
<message>
<source>name</source>
<translation>tên</translation>
</message>
</context>
<context>
<name>HelpMessageDialog</name>
<message>
<source>version</source>
<translation>version</translation>
</message>
<message>
<source>(%1-bit)</source>
<translation>(%1-bit)</translation>
</message>
<message>
<source>Command-line options</source>
<translation>&Tùy chọn dòng lệnh</translation>
</message>
<message>
<source>Usage:</source>
<translation>Mức sử dụng</translation>
</message>
<message>
<source>command-line options</source>
<translation>tùy chọn dòng lệnh</translation>
</message>
<message>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Chọn ngôn ngữ, ví dụ "de_DE" (mặc định: Vị trí hệ thống)</translation>
</message>
<message>
<source>Set SSL root certificates for payment request (default: -system-)</source>
<translation>Đặt chứng nhận SSL gốc cho yêu cầu giao dịch (mặc định: -hệ thống-)</translation>
</message>
</context>
<context>
<name>Intro</name>
<message>
<source>Welcome</source>
<translation>Chào mừng</translation>
</message>
<message>
<source>Use the default data directory</source>
<translation>Sử dụng vị trí dữ liệu mặc định</translation>
</message>
<message>
<source>Peercoin</source>
<translation>Peercoin</translation>
</message>
<message>
<source>Error</source>
<translation>Lỗi</translation>
</message>
</context>
<context>
<name>ModalOverlay</name>
<message>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<source>Hide</source>
<translation>Ẩn</translation>
</message>
</context>
<context>
<name>OpenURIDialog</name>
<message>
<source>Open URI</source>
<translation>Mở URI</translation>
</message>
<message>
<source>URI:</source>
<translation>URI:</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<source>Options</source>
<translation>Lựa chọn</translation>
</message>
<message>
<source>&Main</source>
<translation>&Chính</translation>
</message>
<message>
<source>MB</source>
<translation>MB</translation>
</message>
<message>
<source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>
<translation>Địa chỉ IP của proxy (ví dụ IPv4: 127.0.0.1 / IPv6: ::1)</translation>
</message>
<message>
<source>W&allet</source>
<translation>Ví</translation>
</message>
<message>
<source>Connect to the Peercoin network through a SOCKS5 proxy.</source>
<translation>Kết nối đến máy chủ Peercoin thông qua SOCKS5 proxy.</translation>
</message>
<message>
<source>Proxy &IP:</source>
<translation>Proxy &IP:</translation>
</message>
<message>
<source>&Port:</source>
<translation>&Cổng:</translation>
</message>
<message>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Cổng proxy (e.g. 9050) </translation>
</message>
<message>
<source>IPv4</source>
<translation>IPv4</translation>
</message>
<message>
<source>IPv6</source>
<translation>IPv6</translation>
</message>
<message>
<source>&Display</source>
<translation>&Hiển thị</translation>
</message>
<message>
<source>User Interface &language:</source>
<translation>Giao diện người dùng & ngôn ngữ</translation>
</message>
<message>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<source>&Cancel</source>
<translation>&Từ chối</translation>
</message>
<message>
<source>default</source>
<translation>mặc định</translation>
</message>
<message>
<source>none</source>
<translation>Trống</translation>
</message>
<message>
<source>Error</source>
<translation>Lỗi</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<source>Available:</source>
<translation>Khả dụng</translation>
</message>
<message>
<source>Pending:</source>
<translation>Đang chờ</translation>
</message>
<message>
<source>Total:</source>
<translation>Tổng:</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
</context>
<context>
<name>PeerTableModel</name>
<message>
<source>User Agent</source>
<translation>User Agent</translation>
</message>
<message>
<source>Sent</source>
<translation>Đã gửi</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Amount</source>
<translation>Lượng</translation>
</message>
<message>
<source>%1 and %2</source>
<translation>%1 và %2</translation>
</message>
<message>
<source>%1 B</source>
<translation>%1 B</translation>
</message>
<message>
<source>%1 KB</source>
<translation>%1 KB</translation>
</message>
<message>
<source>%1 MB</source>
<translation>%1 MB</translation>
</message>
<message>
<source>%1 GB</source>
<translation>%1 GB</translation>
</message>
</context>
<context>
<name>QObject::QObject</name>
</context>
<context>
<name>QRImageWidget</name>
<message>
<source>&Save Image...</source>
<translation>$Lưu hình ảnh...</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<source>&Information</source>
<translation>Thông tin</translation>
</message>
<message>
<source>General</source>
<translation>Nhìn Chung</translation>
</message>
<message>
<source>Name</source>
<translation>Tên</translation>
</message>
<message>
<source>Block chain</source>
<translation>Block chain</translation>
</message>
<message>
<source>Sent</source>
<translation>Đã gửi</translation>
</message>
<message>
<source>User Agent</source>
<translation>User Agent</translation>
</message>
<message>
<source>1 &hour</source>
<translation>1&giờ</translation>
</message>
<message>
<source>1 &day</source>
<translation>1&ngày</translation>
</message>
<message>
<source>1 &week</source>
<translation>1&tuần</translation>
</message>
<message>
<source>1 &year</source>
<translation>1&năm</translation>
</message>
<message>
<source>never</source>
<translation>không bao giờ</translation>
</message>
<message>
<source>Yes</source>
<translation>Đồng ý</translation>
</message>
<message>
<source>No</source>
<translation>Không</translation>
</message>
</context>
<context>
<name>ReceiveCoinsDialog</name>
<message>
<source>&Amount:</source>
<translation>Lượng:</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Nhãn</translation>
</message>
<message>
<source>&Message:</source>
<translation>&Tin nhắn:</translation>
</message>
<message>
<source>Use this form to request payments. All fields are <b>optional</b>.</source>
<translation>Sử dụng form này để yêu cầu thanh toán. Tất cả các trường <b>không bắt buộc<b></translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation>Xóa tất cả các trường trong biểu mẫu</translation>
</message>
<message>
<source>Clear</source>
<translation>Xóa</translation>
</message>
<message>
<source>Requested payments history</source>
<translation>Lịch sử yêu cầu thanh toán</translation>
</message>
<message>
<source>&Request payment</source>
<translation>&Yêu cầu thanh toán</translation>
</message>
<message>
<source>Show</source>
<translation>Hiển thị</translation>
</message>
<message>
<source>Remove the selected entries from the list</source>
<translation>Xóa khỏi danh sách</translation>
</message>
<message>
<source>Remove</source>
<translation>Xóa</translation>
</message>
<message>
<source>Copy message</source>
<translation>Copy tin nhắn</translation>
</message>
</context>
<context>
<name>ReceiveRequestDialog</name>
<message>
<source>QR Code</source>
<translation>QR Code</translation>
</message>
<message>
<source>Copy &URI</source>
<translation>Copy &URI</translation>
</message>
<message>
<source>Copy &Address</source>
<translation>&Copy Địa Chỉ</translation>
</message>
<message>
<source>&Save Image...</source>
<translation>$Lưu hình ảnh...</translation>
</message>
<message>
<source>Request payment to %1</source>
<translation>Yêu cầu thanh toán cho %1</translation>
</message>
<message>
<source>Payment information</source>
<translation>Thông tin thanh toán</translation>
</message>
<message>
<source>URI</source>
<translation>URI</translation>
</message>
<message>
<source>Address</source>
<translation>Địa chỉ</translation>
</message>
<message>
<source>Amount</source>
<translation>Lượng</translation>
</message>
<message>
<source>Label</source>
<translation>Nhãn</translation>
</message>
<message>
<source>Message</source>
<translation>Tin nhắn</translation>
</message>
<message>
<source>Error encoding URI into QR Code.</source>
<translation>Lỗi khi encode từ URI thành QR Code</translation>
</message>
</context>
<context>
<name>RecentRequestsTableModel</name>
<message>
<source>Label</source>
<translation>Nhãn</translation>
</message>
<message>
<source>Message</source>
<translation>Tin nhắn</translation>
</message>
<message>
<source>(no label)</source>
<translation>(không nhãn)</translation>
</message>
<message>
<source>(no message)</source>
<translation>(không tin nhắn)</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<source>Send Coins</source>
<translation>Gửi Coins</translation>
</message>
<message>
<source>Coin Control Features</source>
<translation>Tính năng Control Coin</translation>
</message>
<message>
<source>Inputs...</source>
<translation>Nhập...</translation>
</message>
<message>
<source>automatically selected</source>
<translation>Tự động chọn</translation>
</message>
<message>
<source>Insufficient funds!</source>
<translation>Không đủ tiền</translation>
</message>
<message>
<source>Quantity:</source>
<translation>Lượng:</translation>
</message>
<message>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<source>Amount:</source>
<translation>Lượng:</translation>
</message>
<message>
<source>Fee:</source>
<translation>Phí:</translation>
</message>
<message>
<source>After Fee:</source>
<translation>Sau thuế, phí:</translation>
</message>
<message>
<source>Change:</source>
<translation>Thay đổi:</translation>
</message>
<message>
<source>Transaction Fee:</source>
<translation>Phí giao dịch</translation>
</message>
<message>
<source>Choose...</source>
<translation>Chọn...</translation>
</message>
<message>
<source>collapse fee-settings</source>
<translation>Thu gọn fee-settings</translation>
</message>
<message>
<source>per kilobyte</source>
<translation>trên KB</translation>
</message>
<message>
<source>Hide</source>
<translation>Ẩn</translation>
</message>
<message>
<source>(read the tooltip)</source>
<translation>(Đọc hướng dẫn)</translation>
</message>
<message>
<source>Send to multiple recipients at once</source>
<translation>Gửi đến nhiều người nhận trong một lần</translation>
</message>
<message>
<source>Add &Recipient</source>
<translation>Thêm &Người nhận</translation>
</message>
<message>
<source>Clear all fields of the form.</source>
<translation>Xóa tất cả các trường trong biểu mẫu</translation>
</message>
<message>
<source>Clear &All</source>
<translation>Xóa &Tất cả</translation>
</message>
<message>
<source>Balance:</source>
<translation>Tài khoản</translation>
</message>
<message>
<source>Confirm the send action</source>
<translation>Xác nhận sự gửi</translation>
</message>
<message>
<source>%1 to %2</source>
<translation>%1 đến %2</translation>
</message>
<message>
<source>Total Amount %1</source>
<translation>Tổng cộng %1</translation>
</message>
<message>
<source>or</source>
<translation>hoặc</translation>
</message>
<message>
<source>Confirm send coins</source>
<translation>Xác nhận gửi coins</translation>
</message>
<message>
<source>(no label)</source>
<translation>(không nhãn)</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<source>A&mount:</source>
<translation>Lượng:</translation>
</message>
<message>
<source>&Label:</source>
<translation>&Nhãn</translation>
</message>
</context>
<context>
<name>SendConfirmationDialog</name>
<message>
<source>Yes</source>
<translation>Đồng ý</translation>
</message>
</context>
<context>
<name>ShutdownWindow</name>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<source>Clear &All</source>
<translation>Xóa &Tất cả</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
</context>
<context>
<name>TrafficGraphWidget</name>
</context>
<context>
<name>TransactionDesc</name>
<message>
<source>Message</source>
<translation>Tin nhắn</translation>
</message>
<message>
<source>Amount</source>
<translation>Lượng</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<source>Label</source>
<translation>Nhãn</translation>
</message>
<message>
<source>(no label)</source>
<translation>(không nhãn)</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Các tệp tác nhau bằng đấu phẩy (* .csv)</translation>
</message>
<message>
<source>Label</source>
<translation>Nhãn</translation>
</message>
<message>
<source>Address</source>
<translation>Địa chỉ</translation>
</message>
<message>
<source>Exporting Failed</source>
<translation>Xuất không thành công</translation>
</message>
</context>
<context>
<name>UnitDisplayStatusBarControl</name>
</context>
<context>
<name>WalletFrame</name>
</context>
<context>
<name>WalletModel</name>
<message>
<source>Send Coins</source>
<translation>Gửi Coins</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<source>&Export</source>
<translation>&Xuất</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<source>Options:</source>
<translation>Lựa chọn:</translation>
</message>
<message>
<source>Peercoin Core</source>
<translation>Peercoin Core</translation>
</message>
<message>
<source>(default: %u)</source>
<translation>(mặc định: %u)</translation>
</message>
<message>
<source>Information</source>
<translation>Thông tin</translation>
</message>
<message>
<source>Transaction too large</source>
<translation>Giao dịch quá lớn</translation>
</message>
<message>
<source>Warning</source>
<translation>Chú ý</translation>
</message>
<message>
<source>(default: %s)</source>
<translation>(mặc định: %s)</translation>
</message>
<message>
<source>Insufficient funds</source>
<translation>Không đủ tiền</translation>
</message>
<message>
<source>Loading block index...</source>
<translation>Đang đọc block index...</translation>
</message>
<message>
<source>Loading wallet...</source>
<translation>Đang đọc ví...</translation>
</message>
<message>
<source>Cannot downgrade wallet</source>
<translation>Không downgrade được ví</translation>
</message>
<message>
<source>Rescanning...</source>
<translation>Đang quét lại...</translation>
</message>
<message>
<source>Done loading</source>
<translation>Đã nạp xong</translation>
</message>
<message>
<source>Error</source>
<translation>Lỗi</translation>
</message>
</context>
</TS> | ppcoin/ppcoin | src/qt/locale/bitcoin_vi_VN.ts | TypeScript | mit | 42,099 | [
30522,
1026,
24529,
2653,
1027,
1000,
6819,
1035,
1058,
2078,
1000,
2544,
1027,
1000,
1016,
1012,
1015,
1000,
1028,
1026,
6123,
1028,
1026,
2171,
1028,
4769,
8654,
13704,
1026,
1013,
2171,
1028,
1026,
4471,
1028,
1026,
3120,
1028,
2157,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/****************************************************************************
* cansocket-qt.lib - Qt socketcan library
* Copyright (C) 2016 Georgije Bosiger <gbosiger@gmail.com>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef CANFRAME_H
#define CANFRAME_H
#include <QtCore/qshareddata.h>
#include <QtCore/qmetatype.h>
#include <cansocketglobal.h>
class CanFrame;
class CanFrameData;
#ifndef QT_NO_DATASTREAM
CANSOCKET_EXPORT QDataStream &operator<<(QDataStream &, const CanFrame &);
CANSOCKET_EXPORT QDataStream &operator>>(QDataStream &, CanFrame &);
#endif //QT_NO_DATASTREAM
#ifndef QT_NO_DEBUG_STREAM
CANSOCKET_EXPORT QDebug operator<<(QDebug, const CanFrame &);
#endif //QT_NO_DEBUG_STREAM
class CANSOCKET_EXPORT CanFrame
{
Q_GADGET
public:
enum CanFrameType {
DataFrame,
FdFrame,
ErrorFrame,
RtrFrame,
UnknownFrame = -1,
};
Q_ENUM(CanFrameType)
enum CanFrameError {
NoError = 0x000,
TxTimeoutError = 0x001,
LostArbitrationError = 0x002,
ControllerProblemsError = 0x004,
ProtocolViolationsError = 0x008,
TransceiverStatusError = 0x010,
NoAckOnTransmissionError = 0x020,
BusOffError = 0x040,
BusError = 0x080,
ControllerRestartedError = 0x100,
UnknownCanFrameError = 0x200,
AllCanFrameErrors = 0x1FFFFFFF,
};
Q_FLAG(CanFrameError)
Q_DECLARE_FLAGS(CanFrameErrors, CanFrameError)
enum CanFrameFormat {
StandardFrameFormat,
ExtendedFrameFormat
};
Q_ENUM(CanFrameFormat)
enum CanFrameIdMask {
SffIdMask = 0x000007FF,
EffIdMask = 0x1FFFFFFF
};
Q_ENUM(CanFrameIdMask)
Q_DECLARE_FLAGS(CanFrameIdMasks, CanFrameIdMask)
enum CanFrameIdFlag {
EffIdFlag = 0x80000000,
RtrIdFlag = 0x40000000,
ErrorIdFlag = 0x20000000
};
Q_FLAG(CanFrameIdFlag)
Q_DECLARE_FLAGS(CanFrameIdFlags, CanFrameIdFlag)
enum CanFdFrameFlag {
NoFdFrameFlag = 0x00,
BitRateSwitchFlag = 0x01,
ErrorStateIndicatorFlag = 0x02
};
Q_FLAG(CanFdFrameFlag)
Q_DECLARE_FLAGS(CanFdFrameFlags, CanFdFrameFlag)
CanFrame();
CanFrame(CanFrameType type);
CanFrame(const CanFrame &rhs);
~CanFrame();
void swap(CanFrame &other);
bool isValid() const;
bool isEmpty() const;
bool isNull() const;
void clear();
int maxDataLength() const;
int maxDataTransferUnit() const;
void setFrameType(CanFrameType frameType);
CanFrameType frameType() const;
bool isDataFrame() const;
bool isFdFrame() const;
bool isErrorFrame() const;
bool isRtrFrame() const;
void toDataFrame();
void toFdFrame();
void toErrorFrame();
void toRtrFrame();
bool operator ==(const CanFrame &rhs) const;
bool operator !=(const CanFrame &rhs) const { return !operator==(rhs); }
bool operator >(const CanFrame &rhs) const;
bool operator <(const CanFrame &rhs) const;
void setCanId(uint canId);
uint canId() const;
void setId(uint id);
uint id() const;
void setFrameFormat(CanFrameFormat format);
CanFrameFormat frameFormat() const;
bool setDataLength(int bytes);
int dataLength() const;
bool setFdFrameFlags(CanFdFrameFlags flags);
CanFdFrameFlags fdFrameFlags() const;
void setData(const char* data, int len = -1);
char *data();
const char *data() const;
const char *constData() const { return data(); }
const char &at(int i) const;
const char &operator[](int i) const;
char &operator[](int i);
CanFrameErrors error() const;
protected:
QSharedDataPointer<CanFrameData> d;
private:
friend CANSOCKET_EXPORT QDataStream &operator<<(QDataStream &, const CanFrame &);
friend CANSOCKET_EXPORT QDataStream &operator>>(QDataStream &, CanFrame &);
};
Q_DECLARE_SHARED(CanFrame)
Q_DECLARE_OPERATORS_FOR_FLAGS(CanFrame::CanFrameErrors)
Q_DECLARE_OPERATORS_FOR_FLAGS(CanFrame::CanFrameIdMasks)
Q_DECLARE_OPERATORS_FOR_FLAGS(CanFrame::CanFrameIdFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(CanFrame::CanFdFrameFlags)
Q_DECLARE_METATYPE(CanFrame)
Q_DECLARE_METATYPE(CanFrame::CanFrameErrors)
#endif // CANFRAME_H
| gbosiger/cansocket-qt-lib | src/cansocket/canframe.h | C | lgpl-3.0 | 4,938 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Copyright 2005-2016 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.fabric8.commands;
import java.io.IOException;
import io.fabric8.api.Container;
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.felix.gogo.commands.Option;
import io.fabric8.api.CreateChildContainerOptions;
import io.fabric8.api.CreateContainerMetadata;
import io.fabric8.api.FabricAuthenticationException;
import io.fabric8.api.FabricService;
import io.fabric8.api.ZooKeeperClusterService;
import io.fabric8.boot.commands.support.AbstractContainerCreateAction;
import io.fabric8.utils.shell.ShellUtils;
import static io.fabric8.utils.FabricValidations.validateProfileNames;
@Command(name = ContainerCreateChild.FUNCTION_VALUE, scope = ContainerCreateChild.SCOPE_VALUE, description = ContainerCreateChild.DESCRIPTION, detailedDescription = "classpath:containerCreateChild.txt")
public class ContainerCreateChildAction extends AbstractChildContainerCreateAction {
@Option(name = "--jmx-user", multiValued = false, required = false, description = "The jmx user name of the parent container.")
protected String username;
@Option(name = "--jmx-password", multiValued = false, required = false, description = "The jmx password of the parent container.")
protected String password;
@Argument(index = 0, required = true, description = "Parent (root) container ID")
protected String parent;
@Argument(index = 1, required = true, description = "The name of the containers to be created. When creating multiple containers it serves as a prefix")
protected String name;
@Argument(index = 2, required = false, description = "The number of containers that should be created")
protected int number = 0;
ContainerCreateChildAction(FabricService fabricService, ZooKeeperClusterService clusterService) {
super(fabricService, clusterService);
}
@Override
protected Object doExecute() throws Exception {
CreateContainerMetadata[] metadata = null;
validateProfileNames(profiles);
// validate input before creating containers
preCreateContainer(name);
validateParentContainer(parent);
String jmxUser = username != null ? username : ShellUtils.retrieveFabricUser(session);
String jmxPassword = password != null ? password : ShellUtils.retrieveFabricUserPassword(session);
// okay create child container
CreateChildContainerOptions.Builder builder = CreateChildContainerOptions.builder()
.name(name)
.parent(parent)
.bindAddress(bindAddress)
.resolver(resolver)
.manualIp(manualIp)
.ensembleServer(false)
.number(number)
.zookeeperUrl(fabricService.getZookeeperUrl())
.zookeeperPassword(fabricService.getZookeeperPassword())
.jvmOpts(jvmOpts != null ? jvmOpts : fabricService.getDefaultJvmOptions())
.jmxUser(jmxUser)
.jmxPassword(jmxPassword)
.version(version)
.profiles(getProfileNames())
.dataStoreProperties(getDataStoreProperties());
try {
metadata = fabricService.createContainers(builder.build());
rethrowAuthenticationErrors(metadata);
ShellUtils.storeFabricCredentials(session, jmxUser, jmxPassword);
} catch (FabricAuthenticationException ex) {
//If authentication fails, prompts for credentials and try again.
username = null;
password = null;
promptForJmxCredentialsIfNeeded();
metadata = fabricService.createContainers(builder.jmxUser(username).jmxPassword(password).build());
ShellUtils.storeFabricCredentials(session, username, password);
}
// display containers
displayContainers(metadata);
return null;
}
protected void validateParentContainer(String parent) {
Container container = fabricService.getContainer(parent);
if (container == null) {
throw new IllegalArgumentException("Parent container " + parent + " does not exists!");
}
if (!container.isRoot()) {
throw new IllegalArgumentException("Parent container " + parent + " must be a root container!");
}
}
@Override
protected void preCreateContainer(String name) {
super.preCreateContainer(name);
// validate number is not out of bounds
if (number < 0 || number > 99) {
throw new IllegalArgumentException("The number of containers must be between 1 and 99.");
}
}
private void promptForJmxCredentialsIfNeeded() throws IOException {
// If the username was not configured via cli, then prompt the user for the values
if (username == null) {
log.debug("Prompting user for jmx login");
username = ShellUtils.readLine(session, "Jmx Login for " + parent + ": ", false);
}
if (password == null) {
password = ShellUtils.readLine(session, "Jmx Password for " + parent + ": ", true);
}
}
}
| jludvice/fabric8 | fabric/fabric-commands/src/main/java/io/fabric8/commands/ContainerCreateChildAction.java | Java | apache-2.0 | 5,818 | [
30522,
1013,
1008,
1008,
1008,
9385,
2384,
1011,
2355,
2417,
6045,
1010,
4297,
1012,
1008,
1008,
2417,
6045,
15943,
2023,
5371,
2000,
2017,
2104,
1996,
15895,
6105,
1010,
2544,
1008,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/env python
#*********************************************************************
# Software License Agreement (BSD License)
#
# Copyright (c) 2011 andrewtron3000
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of the Willow Garage nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#********************************************************************/
import roslib; roslib.load_manifest('face_detection')
import rospy
import sys
import cv
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
from geometry_msgs.msg import Point
from geometry_msgs.msg import PointStamped
#
# Instantiate a new opencv to ROS bridge adaptor
#
cv_bridge = CvBridge()
#
# Define the callback that will be called when a new image is received.
#
def callback(publisher, coord_publisher, cascade, imagemsg):
#
# Convert the ROS imagemsg to an opencv image.
#
image = cv_bridge.imgmsg_to_cv(imagemsg, 'mono8')
#
# Blur the image.
#
cv.Smooth(image, image, cv.CV_GAUSSIAN)
#
# Allocate some storage for the haar detect operation.
#
storage = cv.CreateMemStorage(0)
#
# Call the face detector function.
#
faces = cv.HaarDetectObjects(image, cascade, storage, 1.2, 2,
cv.CV_HAAR_DO_CANNY_PRUNING, (100,100))
#
# If faces are detected, compute the centroid of all the faces
# combined.
#
face_centroid_x = 0.0
face_centroid_y = 0.0
if len(faces) > 0:
#
# For each face, draw a rectangle around it in the image,
# and also add the position of the face to the centroid
# of all faces combined.
#
for (i, n) in faces:
x = int(i[0])
y = int(i[1])
width = int(i[2])
height = int(i[3])
cv.Rectangle(image,
(x, y),
(x + width, y + height),
cv.CV_RGB(0,255,0), 3, 8, 0)
face_centroid_x += float(x) + (float(width) / 2.0)
face_centroid_y += float(y) + (float(height) / 2.0)
#
# Finish computing the face_centroid by dividing by the
# number of faces found above.
#
face_centroid_x /= float(len(faces))
face_centroid_y /= float(len(faces))
#
# Lastly, if faces were detected, publish a PointStamped
# message that contains the centroid values.
#
pt = Point(x = face_centroid_x, y = face_centroid_y, z = 0.0)
pt_stamped = PointStamped(point = pt)
coord_publisher.publish(pt_stamped)
#
# Convert the opencv image back to a ROS image using the
# cv_bridge.
#
newmsg = cv_bridge.cv_to_imgmsg(image, 'mono8')
#
# Republish the image. Note this image has boxes around
# faces if faces were found.
#
publisher.publish(newmsg)
def listener(publisher, coord_publisher):
rospy.init_node('face_detector', anonymous=True)
#
# Load the haar cascade. Note we get the
# filename from the "classifier" parameter
# that is configured in the launch script.
#
cascadeFileName = rospy.get_param("~classifier")
cascade = cv.Load(cascadeFileName)
rospy.Subscriber("/stereo/left/image_rect",
Image,
lambda image: callback(publisher, coord_publisher, cascade, image))
rospy.spin()
# This is called first.
if __name__ == '__main__':
publisher = rospy.Publisher('face_view', Image)
coord_publisher = rospy.Publisher('face_coords', PointStamped)
listener(publisher, coord_publisher)
| andrewtron3000/hacdc-ros-pkg | face_detection/src/detector.py | Python | bsd-2-clause | 5,077 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
4372,
2615,
18750,
1001,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { Merch } from '../data/merch';
import { MerchService } from '../data/merch.service';
@Component({
selector: 'app-merch-display',
templateUrl: './merch-display.component.html',
styleUrls: ['./merch-display.component.scss'],
})
export class MerchDisplayComponent implements OnInit {
merch: Merch[] = [];
private _serviceWorker: ServiceWorker|null = null;
constructor(
private route: ActivatedRoute,
private merchService: MerchService,
private location: Location
) {}
ngOnInit(): void {
navigator.serviceWorker.ready.then( registration => {
this._serviceWorker = registration.active;
});
this.route.params.subscribe((routeParams) => {
this.getMerch(routeParams.category);
if (this._serviceWorker) {
this._serviceWorker.postMessage({ page: routeParams.category });
}
});
}
getMerch(category: string): void {
this.merchService
.getMerchList(category)
.then((merch) => (this.merch = merch));
}
goBack(): void {
this.location.back();
}
}
| tensorflow/tfjs-examples | angular-predictive-prefetching/client/src/app/merch-display/merch-display.component.ts | TypeScript | apache-2.0 | 1,198 | [
30522,
12324,
1063,
6922,
1010,
2006,
5498,
2102,
1065,
2013,
1005,
1030,
16108,
1013,
4563,
1005,
1025,
12324,
1063,
8878,
22494,
2618,
1065,
2013,
1005,
1030,
16108,
1013,
2799,
2099,
1005,
1025,
12324,
1063,
3295,
1065,
2013,
1005,
1030,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*! selectize.css - v0.6.1 | https://github.com/brianreavis/selectize.js | Apache License (v2) */
/* --- file: "src/selectize.css" --- */
/**********************************************************
* THEME: "default" *
**********************************************************/
.selectize-control.default.multi .selectize-input > div {
color: #3d5d18;
text-shadow: 0 1px 0 rgba(255,255,255,0.1);
border: 1px solid #74b21e;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background: #b8e76f;
background: -moz-linear-gradient(top, #b8e76f 0%, #a9e25c 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b8e76f), color-stop(100%,#a9e25c));
background: -webkit-linear-gradient(top, #b8e76f 0%,#a9e25c 100%);
background: -o-linear-gradient(top, #b8e76f 0%,#a9e25c 100%);
background: -ms-linear-gradient(top, #b8e76f 0%,#a9e25c 100%);
background: linear-gradient(to bottom, #b8e76f 0%,#a9e25c 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b8e76f', endColorstr='#a9e25c',GradientType=0 );
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.1);
-moz-box-shadow: 0 1px 1px rgba(0,0,0,0.1);
box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.selectize-control.default.multi .selectize-input > div.active {
border-color: #6f9839;
background: #92c836;
background: -moz-linear-gradient(top, #92c836 0%, #006e2e 0%, #92c836 0%, #7abc2c 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#92c836), color-stop(0%,#006e2e), color-stop(0%,#92c836), color-stop(100%,#7abc2c));
background: -webkit-linear-gradient(top, #92c836 0%,#006e2e 0%,#92c836 0%,#7abc2c 100%);
background: -o-linear-gradient(top, #92c836 0%,#006e2e 0%,#92c836 0%,#7abc2c 100%);
background: -ms-linear-gradient(top, #92c836 0%,#006e2e 0%,#92c836 0%,#7abc2c 100%);
background: linear-gradient(to bottom, #92c836 0%,#006e2e 0%,#92c836 0%,#7abc2c 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#92c836', endColorstr='#7abc2c',GradientType=0 );
}
.selectize-control.default.multi .selectize-input.disabled > div {
border-color: #d8d8d8;
background: #fafafa;
color: #808080;
}
/**********************************************************
* BASIC AESTHETIC STYLES (common) *
**********************************************************/
.selectize-input, .selectize-control.single .selectize-input.focus {
background: #fff;
padding: 10px;
cursor: text;
display: inline-block;
width: 100%;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
}
.selectize-input.focus {
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.selectize-input.dropdown-active {
-webkit-border-radius: 3px 3px 0 0 !important;
-moz-border-radius: 3px 3px 0 0 !important;
border-radius: 3px 3px 0 0 !important;
}
.selectize-input.full {
background-color: #f2f2f2;
}
.selectize-input.dropdown-active::before {
content: ' ';
display: block;
position: absolute;
background: #f2f2f2;
height: 1px;
bottom: 0;
left: 0;
right: 0;
}
.selectize-control.multi .selectize-input.has-items {
padding-top: 8px !important;
padding-bottom: 3px !important;
}
.selectize-control.multi .selectize-input > div {
cursor: pointer;
margin: 0 5px 5px 0;
padding: 1px 5px;
}
.selectize-input > div:last-child {
margin-right: 5px;
}
.selectize-input > input {
margin-right: 2px !important;
}
.selectize-dropdown, .selectize-input, .selectize-control.single .selectize-input.dropdown-active {
border: 1px solid #d0d0d0;
}
.selectize-dropdown {
max-height: 200px;
overflow-y: auto;
overflow-x: hidden;
background: #fff;
margin-top: -1px;
border-top: 0 none;
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1);
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
}
.selectize-dropdown [data-selectable],
.selectize-dropdown .optgroup-header {
padding: 6px 9px;
}
.selectize-dropdown .optgroup:first-child .optgroup-header {
border-top: 0 none;
}
.selectize-dropdown .optgroup-header {
background: #fafafa;
border-bottom: 1px solid #e8e8e8;
border-top: 1px solid #e8e8e8;
font-weight: bold;
font-size: 0.8em;
cursor: default;
}
.selectize-dropdown .create {
color: #a0a0a0;
}
.selectize-dropdown .active {
background-color: #fffceb;
}
.selectize-dropdown, .selectize-input, .selectize-input input {
color: #303030;
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 20px;
-webkit-font-smoothing: antialiased;
}
.selectize-dropdown [data-selectable] .highlight {
background: rgba(255,237,40,0.4);
border-radius: 1px;
}
.selectize-input.disabled, .selectize-input.disabled * {
cursor: default !important;
}
/**********************************************************
* BASIC AESTHETIC STYLES (single) *
**********************************************************/
.selectize-control.single .selectize-input {
cursor: pointer;
border-color: #b8b8b8;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 0 #c6c6c6;
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 0 #c6c6c6;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 0 #e0e0e0, 0 3px 0 #c8c8c8, 0 4px 1px rgba(0,0,0,0.1);
background: #f6f6f6;
background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#efefef));
background: -webkit-linear-gradient(top, #f5f5f5 0%,#efefef 100%);
background: -o-linear-gradient(top, #f5f5f5 0%,#efefef 100%);
background: -ms-linear-gradient(top, #f5f5f5 0%,#efefef 100%);
background: linear-gradient(to bottom, #fafafa 0%,#f2f2f2 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f6f6f6', endColorstr='#e8e8e8',GradientType=0 );
}
.selectize-control.single .selectize-input::after {
content: ' ';
display: block;
position: absolute;
top: 50%;
right: 15px;
margin-top: -2px;
width: 0;
height: 0;
border-style: solid;
border-width: 5px 5px 0 5px;
border-color: #808080 transparent transparent transparent;
}
.selectize-control.single .selectize-input.dropdown-active::after {
margin-top: -3px;
border-width: 0 5px 5px 5px;
border-color: transparent transparent #808080 transparent;
}
.selectize-control.single .selectize-input.disabled {
opacity: 0.5;
}
/**********************************************************
* BASIC AESTHETIC STYLES (multi) *
**********************************************************/
.selectize-control.multi .selectize-input.disabled {
background-color: #fafafa;
}
/**********************************************************
* LAYOUT STYLES (mandatory) *
**********************************************************/
.selectize-control {
position: relative;
}
.selectize-input {
overflow: hidden;
position: relative;
z-index: 1;
}
.selectize-input:after {
content: ' ';
display: block;
clear: left;
}
.selectize-input .items {
display: inline;
}
.selectize-input > * {
vertical-align: baseline;
display: -moz-inline-stack;
display: inline-block;
zoom: 1;
*display: inline;
}
.selectize-input > input {
max-width: 100% !important;
text-indent: 0 !important;
border: 0 none !important;
background: none !important;
padding: 0 !important;
margin: 0;
line-height: inherit !important;
-webkit-user-select: auto !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
}
.selectize-input > input:focus {
outline: none !important;
}
.selectize-dropdown {
position: absolute;
z-index: 2;
}
.selectize-dropdown > * {
cursor: pointer;
overflow: hidden;
}
.selectize-input, .selectize-dropdown {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* --- file: "src/plugins/drag_drop/plugin.css" --- */
.selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
visibility: visible !important;
background: #f2f2f2 !important;
background: rgba(0,0,0,0.06) !important;
border: 0 none !important;
-webkit-box-shadow: inset 0 0 12px 4px #fff;
-moz-box-shadow: inset 0 0 12px 4px #fff;
box-shadow: inset 0 0 12px 4px #fff;
}
.selectize-control.plugin-drag_drop .ui-sortable-placeholder::after {
content: '!';
visibility: hidden;
}
.selectize-control.plugin-drag_drop .ui-sortable-helper {
-webkit-box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
-moz-box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
}
/* --- file: "src/plugins/optgroup_columns/plugin.css" --- */
.selectize-control.plugin-optgroup_columns .optgroup {
border-right: 1px solid #f2f2f2;
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.selectize-control.plugin-optgroup_columns .optgroup:last-child {
border-right: 0 none;
}
.selectize-control.plugin-optgroup_columns .optgroup-header {
border-top: 0 none;
}
/* --- file: "src/plugins/remove_button/plugin.css" --- */
.selectize-control.plugin-remove_button .item {
position: relative;
padding-right: 24px !important;
}
.selectize-control.plugin-remove_button .item .remove {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 17px;
-moz-sizing: border-box;
-webkit-sizing: border-box;
box-sizing: border-box;
text-align: center;
font-size: 12px;
font-weight: bold;
color: inherit;
vertical-align: middle;
display: inline-block;
padding: 7px 0 0 0;
line-height: 8px;
-webkit-border-radius: 0 2px 2px 0;
-moz-border-radius: 0 2px 2px 0;
border-radius: 0 2px 2px 0;
border-left: 1px solid #74b21e;
}
.selectize-control.plugin-remove_button .item .remove:hover {
border-left-color: #5e8f1a;
background: rgba(50,90,0,0.15);
}
| dlueth/cdnjs | ajax/libs/selectize.js/0.6.1/selectize.css | CSS | mit | 10,206 | [
30522,
1013,
1008,
999,
7276,
4697,
1012,
20116,
2015,
1011,
1058,
2692,
1012,
1020,
1012,
1015,
1064,
16770,
30524,
1011,
1011,
1011,
1008,
1013,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
// Template Name: 100% Width
get_header(); ?>
<div id="content" class="full-width">
<?php while(have_posts()): the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<span class="entry-title" style="display: none;"><?php the_title(); ?></span>
<span class="vcard" style="display: none;"><span class="fn"><?php the_author_posts_link(); ?></span></span>
<span class="updated" style="display: none;"><?php the_time('c'); ?></span>
<?php global $data; if(!$data['featured_images_pages'] ): ?>
<?php if($data['legacy_posts_slideshow']):
$args = array(
'post_type' => 'attachment',
'numberposts' => $data['posts_slideshow_number']-1,
'post_status' => null,
'post_parent' => $post->ID,
'orderby' => 'menu_order',
'order' => 'ASC',
'post_mime_type' => 'image',
'exclude' => get_post_thumbnail_id()
);
$attachments = get_posts($args);
if((has_post_thumbnail() || get_post_meta($post->ID, 'pyre_video', true))):
?>
<div class="flexslider post-slideshow">
<ul class="slides">
<?php if(!$data['posts_slideshow']): ?>
<?php if(get_post_meta($post->ID, 'pyre_video', true)): ?>
<li>
<div class="full-video">
<?php echo get_post_meta($post->ID, 'pyre_video', true); ?>
</div>
</li>
<?php elseif(has_post_thumbnail() ): ?>
<?php $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<?php $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<?php $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id()); ?>
<li>
<a href="<?php echo $full_image[0]; ?>" rel="prettyPhoto[gallery<?php the_ID(); ?>]" title="<?php echo get_post_field('post_excerpt', get_post_thumbnail_id()); ?>"><img src="<?php echo $attachment_image[0]; ?>" alt="<?php echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); ?>" /></a>
</li>
<?php endif; ?>
<?php else: ?>
<?php if(get_post_meta($post->ID, 'pyre_video', true)): ?>
<li>
<div class="full-video">
<?php echo get_post_meta($post->ID, 'pyre_video', true); ?>
</div>
</li>
<?php endif; ?>
<?php if(has_post_thumbnail() && !get_post_meta($post->ID, 'pyre_video', true)): ?>
<?php $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<?php $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<?php $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id()); ?>
<li>
<a href="<?php echo $full_image[0]; ?>" rel="prettyPhoto[gallery<?php the_ID(); ?>]" title="<?php echo get_post_field('post_excerpt', get_post_thumbnail_id()); ?>"><img src="<?php echo $attachment_image[0]; ?>" alt="<?php echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); ?>" /></a>
</li>
<?php endif; ?>
<?php foreach($attachments as $attachment): ?>
<?php $attachment_image = wp_get_attachment_image_src($attachment->ID, 'full'); ?>
<?php $full_image = wp_get_attachment_image_src($attachment->ID, 'full'); ?>
<?php $attachment_data = wp_get_attachment_metadata($attachment->ID); ?>
<li>
<a href="<?php echo $full_image[0]; ?>" rel="prettyPhoto[gallery<?php the_ID(); ?>]" title="<?php echo get_post_field('post_excerpt', $attachment->ID); ?>"><img src="<?php echo $attachment_image[0]; ?>" alt="<?php echo get_post_meta($attachment->ID, '_wp_attachment_image_alt', true); ?>" /></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
<?php else: ?>
<?php
if((has_post_thumbnail() || get_post_meta($post->ID, 'pyre_video', true))):
?>
<div class="flexslider post-slideshow">
<ul class="slides">
<?php if(!$data['posts_slideshow']): ?>
<?php if(get_post_meta($post->ID, 'pyre_video', true)): ?>
<li>
<div class="full-video">
<?php echo get_post_meta($post->ID, 'pyre_video', true); ?>
</div>
</li>
<?php elseif(has_post_thumbnail() ): ?>
<?php $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<?php $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<?php $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id()); ?>
<li>
<a href="<?php echo $full_image[0]; ?>" rel="prettyPhoto[gallery<?php the_ID(); ?>]" title="<?php echo get_post_field('post_excerpt', get_post_thumbnail_id()); ?>"><img src="<?php echo $attachment_image[0]; ?>" alt="<?php echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); ?>" /></a>
</li>
<?php endif; ?>
<?php else: ?>
<?php if(get_post_meta($post->ID, 'pyre_video', true)): ?>
<li>
<div class="full-video">
<?php echo get_post_meta($post->ID, 'pyre_video', true); ?>
</div>
</li>
<?php endif; ?>
<?php if(has_post_thumbnail() ): ?>
<?php $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<?php $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<?php $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id()); ?>
<li>
<a href="<?php echo $full_image[0]; ?>" rel="prettyPhoto[gallery<?php the_ID(); ?>]" title="<?php echo get_post_field('post_excerpt', get_post_thumbnail_id()); ?>"><img src="<?php echo $attachment_image[0]; ?>" alt="<?php echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); ?>" /></a>
</li>
<?php endif; ?>
<?php
$i = 2;
while($i <= $data['posts_slideshow_number']):
$attachment_new_id = kd_mfi_get_featured_image_id('featured-image-'.$i, 'page');
if($attachment_new_id):
?>
<?php $attachment_image = wp_get_attachment_image_src($attachment_new_id, 'full'); ?>
<?php $full_image = wp_get_attachment_image_src($attachment_new_id, 'full'); ?>
<?php $attachment_data = wp_get_attachment_metadata($attachment_new_id); ?>
<li>
<a href="<?php echo $full_image[0]; ?>" rel="prettyPhoto[gallery<?php the_ID(); ?>]" title="<?php echo get_post_field('post_excerpt', $attachment_new_id); ?>"><img src="<?php echo $attachment_image[0]; ?>" alt="<?php echo get_post_meta($attachment_new_id, '_wp_attachment_image_alt', true); ?>" /></a>
</li>
<?php endif; $i++; endwhile; ?>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<div class="post-content">
<?php the_content(); ?>
<?php wp_link_pages(); ?>
</div>
<?php if($data['comments_pages']): ?>
<?php wp_reset_query(); ?>
<?php comments_template(); ?>
<?php endif; ?>
</div>
<?php endwhile; ?>
</div>
<?php get_footer(); ?> | FelixNong1990/wp-3.8 | wp-content/themes/avada/100-width.php | PHP | gpl-2.0 | 6,869 | [
30522,
1026,
1029,
25718,
1013,
1013,
23561,
2171,
1024,
2531,
1003,
9381,
2131,
1035,
20346,
1006,
1007,
1025,
1029,
1028,
1026,
4487,
2615,
8909,
1027,
1000,
4180,
1000,
2465,
1027,
1000,
2440,
1011,
9381,
1000,
1028,
1026,
1029,
25718,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package org.gsonformat.intellij.process;
import com.intellij.psi.*;
import org.apache.http.util.TextUtils;
import org.gsonformat.intellij.config.Config;
import org.gsonformat.intellij.config.Constant;
import org.gsonformat.intellij.entity.FieldEntity;
import org.gsonformat.intellij.entity.ClassEntity;
import java.util.regex.Pattern;
/**
* Created by dim on 16/11/7.
*/
class AutoValueProcessor extends Processor {
@Override
public void onStarProcess(ClassEntity classEntity, PsiElementFactory factory, PsiClass cls,IProcessor visitor) {
super.onStarProcess(classEntity, factory, cls, visitor);
injectAutoAnnotation(factory, cls);
}
private void injectAutoAnnotation(PsiElementFactory factory, PsiClass cls) {
PsiModifierList modifierList = cls.getModifierList();
PsiElement firstChild = modifierList.getFirstChild();
Pattern pattern = Pattern.compile("@.*?AutoValue");
if (firstChild != null && !pattern.matcher(firstChild.getText()).find()) {
PsiAnnotation annotationFromText = factory.createAnnotationFromText("@com.google.auto.value.AutoValue", cls);
modifierList.addBefore(annotationFromText, firstChild);
}
if (!modifierList.hasModifierProperty(PsiModifier.ABSTRACT)) {
modifierList.setModifierProperty(PsiModifier.ABSTRACT, true);
}
}
@Override
public void generateField(PsiElementFactory factory, FieldEntity fieldEntity, PsiClass cls, ClassEntity classEntity) {
if (fieldEntity.isGenerate()) {
StringBuilder fieldSb = new StringBuilder();
String filedName = fieldEntity.getGenerateFieldName();
if (!TextUtils.isEmpty(classEntity.getExtra())) {
fieldSb.append(classEntity.getExtra()).append("\n");
classEntity.setExtra(null);
}
if (fieldEntity.getTargetClass() != null) {
fieldEntity.getTargetClass().setGenerate(true);
}
fieldSb.append(String.format("public abstract %s %s() ; ", fieldEntity.getFullNameType(), filedName));
cls.add(factory.createMethodFromText(fieldSb.toString(), cls));
}
}
@Override
public void generateGetterAndSetter(PsiElementFactory factory, PsiClass cls, ClassEntity classEntity) {
}
@Override
public void generateConvertMethod(PsiElementFactory factory, PsiClass cls, ClassEntity classEntity) {
super.generateConvertMethod(factory, cls, classEntity);
createMethod(factory, Constant.autoValueMethodTemplate.replace("$className$", cls.getName()).trim(), cls);
}
@Override
protected void onEndGenerateClass(PsiElementFactory factory, ClassEntity classEntity, PsiClass parentClass, PsiClass generateClass, IProcessor visitor) {
super.onEndGenerateClass(factory, classEntity, parentClass, generateClass, visitor);
injectAutoAnnotation(factory, generateClass);
}
}
| gengjiawen/GsonFormat | src/main/java/org/gsonformat/intellij/process/AutoValueProcessor.java | Java | apache-2.0 | 2,976 | [
30522,
7427,
8917,
1012,
28177,
2239,
14192,
4017,
1012,
13420,
3669,
3501,
1012,
2832,
1025,
12324,
4012,
1012,
13420,
3669,
3501,
1012,
17816,
1012,
1008,
1025,
12324,
8917,
1012,
15895,
1012,
8299,
1012,
21183,
4014,
1012,
3793,
21823,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"use strict";
require("./setup");
var exchange = require("../src/exchange"),
assert = require("assert"),
config = require("config"),
async = require("async");
describe("Exchange", function () {
describe("rounding", function () {
it("should round as expected", function() {
assert.equal( exchange.round("USD", 33.38 + 10.74), 44.12);
});
});
describe("Load and keep fresh the exchange rates", function () {
it("should be using test path", function () {
// check it is faked out for tests
var stubbedPath = "config/initial_exchange_rates.json";
assert.equal( exchange.pathToLatestJSON(), stubbedPath);
// check it is normally correct
exchange.pathToLatestJSON.restore();
assert.notEqual( exchange.pathToLatestJSON(), stubbedPath);
});
it("fx object should convert correctly", function () {
assert.equal(exchange.convert(100, "GBP", "USD"), 153.85 ); // 2 dp
assert.equal(exchange.convert(100, "GBP", "JPY"), 15083 ); // 0 dp
assert.equal(exchange.convert(100, "GBP", "LYD"), 195.385 ); // 3 dp
assert.equal(exchange.convert(100, "GBP", "XAG"), 6.15 ); // null dp
});
it("should reload exchange rates periodically", function (done) {
var fx = exchange.fx;
var clock = this.sandbox.clock;
// change one of the exchange rates to test for the reload
var originalGBP = fx.rates.GBP;
fx.rates.GBP = 123.456;
// start the delayAndReload
exchange.initiateDelayAndReload();
// work out how long to wait
var delay = exchange.calculateDelayUntilNextReload();
// go almost to the roll over and check no change
clock.tick( delay-10 );
assert.equal(fx.rates.GBP, 123.456);
async.series([
function (cb) {
// go past rollover and check for change
exchange.hub.once("reloaded", function () {
assert.equal(fx.rates.GBP, originalGBP);
cb();
});
clock.tick( 20 );
},
function (cb) {
// reset it again and go ahead another interval and check for change
fx.rates.GBP = 123.456;
exchange.hub.once("reloaded", function () {
assert.equal(fx.rates.GBP, originalGBP);
cb();
});
clock.tick( config.exchangeReloadIntervalSeconds * 1000 );
}
], done);
});
it.skip("should handle bad exchange rates JSON");
});
});
| OpenBookPrices/openbookprices-api | test/exchange.js | JavaScript | agpl-3.0 | 2,486 | [
30522,
1000,
2224,
9384,
1000,
1025,
5478,
1006,
1000,
1012,
1013,
16437,
1000,
1007,
1025,
13075,
3863,
1027,
5478,
1006,
1000,
1012,
1012,
1013,
5034,
2278,
1013,
3863,
1000,
1007,
1010,
20865,
1027,
5478,
1006,
1000,
20865,
1000,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright 2015 Google Inc. 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.
*/
package com.google.security.zynamics.reil.translators.ppc;
import com.google.security.zynamics.reil.OperandSize;
import com.google.security.zynamics.reil.ReilInstruction;
import com.google.security.zynamics.reil.translators.IInstructionTranslator;
import com.google.security.zynamics.reil.translators.ITranslationEnvironment;
import com.google.security.zynamics.reil.translators.InternalTranslationException;
import com.google.security.zynamics.zylib.disassembly.IInstruction;
import java.util.List;
public class LhzuxTranslator implements IInstructionTranslator {
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction,
final List<ReilInstruction> instructions) throws InternalTranslationException {
LoadGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction,
instructions, "lhzux", OperandSize.WORD, true, true, false, false, false);
}
}
| dgrif/binnavi | src/main/java/com/google/security/zynamics/reil/translators/ppc/LhzuxTranslator.java | Java | apache-2.0 | 1,532 | [
30522,
1013,
1008,
9385,
2325,
8224,
4297,
1012,
2035,
2916,
9235,
1012,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_14) on Fri Jun 18 18:05:18 BST 2010 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class gr.forth.ics.graph.layout.forces2d.Forces.FRSpring (FlexiGraph Reference)
</TITLE>
<META NAME="date" CONTENT="2010-06-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class gr.forth.ics.graph.layout.forces2d.Forces.FRSpring (FlexiGraph Reference)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../gr/forth/ics/graph/layout/forces2d/Forces.FRSpring.html" title="class in gr.forth.ics.graph.layout.forces2d"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?gr/forth/ics/graph/layout/forces2d/\class-useForces.FRSpring.html" target="_top"><B>FRAMES</B></A>
<A HREF="Forces.FRSpring.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>gr.forth.ics.graph.layout.forces2d.Forces.FRSpring</B></H2>
</CENTER>
No usage of gr.forth.ics.graph.layout.forces2d.Forces.FRSpring
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../gr/forth/ics/graph/layout/forces2d/Forces.FRSpring.html" title="class in gr.forth.ics.graph.layout.forces2d"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?gr/forth/ics/graph/layout/forces2d/\class-useForces.FRSpring.html" target="_top"><B>FRAMES</B></A>
<A HREF="Forces.FRSpring.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
| unidesigner/pyconto | scratch/flexigraph-0.1/dist/javadoc/gr/forth/ics/graph/layout/forces2d/class-use/Forces.FRSpring.html | HTML | gpl-3.0 | 6,443 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# mrb\_manager
[](https://gitter.im/rrreeeyyy/mrb_manager?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
mruby binary manager having a affinity for mgem
## Installation
Install it yourself as:
$ gem install mrb_manager
Afterwards you will still need to add ```eval "$(mrbm init)"``` to your profile.
You'll only ever have to do this once.
## Usage
### Install mruby with current active mgems
You should be able to:
$ mgem add mruby-redis
$ mrbm install
If ```-t tag_name``` specified, you can install tagged mruby
$ mgem add mryby-redis
$ mgem add mruby-http2
$ mrbm install -t redis-and-http2
### Uninstall mruby
You should be able to:
# list all available mruby
$ mrbm list
ID CREATED VERSION TAG
cfb43c1811c5 1 month ago 1.1.0
$ mrbm uninstall cfb43c1811c5
If you tagged:
$ mrbm list
ID CREATED VERSION TAG
cf3889727b2a 1 month ago 1.0.0 redis-and-http2
$ mrbm uninstall -t redis-and-http2
## Contributing
1. Fork it ( https://github.com/rrreeeyyy/mrb_manager/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
| rrreeeyyy/mrb_manager | README.md | Markdown | mit | 1,328 | [
30522,
1001,
2720,
2497,
1032,
1035,
3208,
1031,
999,
1031,
21025,
12079,
1033,
1006,
16770,
1024,
1013,
1013,
23433,
1012,
21025,
12079,
1012,
10047,
1013,
3693,
1003,
2322,
7507,
2102,
1012,
17917,
2290,
1007,
1033,
1006,
16770,
1024,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/bin/bash
# vagrant_node1.command
# CoreOS Cluster for OS X
#
# Created by Rimantas on 01/04/2014.
# Copyright (c) 2014 Rimantas Mocevicius. All rights reserved.
cd ~/coreos-osx-cluster/workers
vagrant ssh node-01 -- -A
| rimusz/coreos-cluster-osx | src/vagrant_node1.command | Shell | apache-2.0 | 229 | [
30522,
1001,
999,
1013,
8026,
1013,
24234,
1001,
12436,
18980,
1035,
13045,
2487,
1012,
3094,
1001,
4563,
2891,
9324,
2005,
9808,
1060,
1001,
1001,
2580,
2011,
11418,
26802,
2015,
2006,
5890,
1013,
5840,
1013,
2297,
1012,
1001,
9385,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Theme Name: Twenty Fourteen
Description: Adds support for languages written in a Right To Left (RTL) direction.
It's easy, just a matter of overwriting all the horizontal positioning attributes
of your CSS stylesheet in a separate stylesheet file named rtl.css.
See https://codex.wordpress.org/Right_to_Left_Language_Support
*/
/**
* Table of Contents:
*
* 1.0 - Reset
* 2.0 - Repeatable Patterns
* 4.0 - Header
* 5.0 - Navigation
* 6.0 - Content
* 6.3 - Entry Meta
* 6.4 - Entry Content
* 6.5 - Galleries
* 6.7 - Post/Image/Paging Navigation
* 6.10 - Contributor Page
* 6.14 - Comments
* 7.0 - Sidebar
* 7.1 - Widgets
* 7.2 - Content Sidebar Widgets
* 9.0 - Featured Content
* 10.0 - Media Queries
* -----------------------------------------------------------------------------
*/
/**
* 1.0 Reset
* -----------------------------------------------------------------------------
*/
body {
direction: rtl;
unicode-bidi: embed;
}
a {
display: inline-block;
}
ul,
ol {
margin: 0 20px 24px 0;
}
li > ul,
li > ol {
margin: 0 20px 0 0;
}
caption,
th,
td {
text-align: right;
}
/**
* 2.0 Repeatable Patterns
* -----------------------------------------------------------------------------
*/
.wp-caption-text {
padding-left: 10px;
padding-right: 0;
}
.screen-reader-text:focus {
right: 5px;
left: auto;
}
/**
* 4.0 Header
* -----------------------------------------------------------------------------
*/
.site-title {
float: right;
}
.search-toggle {
float: left;
margin-left: 38px;
margin-right: auto;
}
.search-box .search-field {
float: left;
padding: 1px 6px 2px 2px;
}
.search-toggle .screen-reader-text {
right: 5px; /* Avoid a horizontal scrollbar when the site has a long menu */
left: auto;
}
/**
* 5.0 Navigation
* -----------------------------------------------------------------------------
*/
.site-navigation ul ul {
margin-right: 20px;
margin-left: auto;
}
.menu-toggle {
right: auto;
left: 0;
}
/**
* 6.0 Content
* -----------------------------------------------------------------------------
*/
/**
* 6.3 Entry Meta
* -----------------------------------------------------------------------------
*/
.entry-meta .tag-links a {
margin: 0 10px 4px 4px;
}
.entry-meta .tag-links a:before {
border-right: 0;
border-left: 8px solid #767676;
right: -7px;
left: auto;
}
.entry-meta .tag-links a:hover:before,
.entry-meta .tag-links a:focus:before {
border-left-color: #41a62a;
}
.entry-meta .tag-links a:after {
right: -2px;
left: auto;
}
/**
* 6.4 Entry Content
* -----------------------------------------------------------------------------
*/
.page-links a,
.page-links > span {
margin: 0 0 2px 1px;
}
.page-links > .page-links-title {
padding-right: 0;
padding-left: 7px;
}
/**
* 6.5 Galleries
* -----------------------------------------------------------------------------
*/
.gallery-item {
float: right;
margin: 0 0 4px 4px;
}
.gallery-columns-1 .gallery-item:nth-of-type(1n),
.gallery-columns-2 .gallery-item:nth-of-type(2n),
.gallery-columns-3 .gallery-item:nth-of-type(3n),
.gallery-columns-4 .gallery-item:nth-of-type(4n),
.gallery-columns-5 .gallery-item:nth-of-type(5n),
.gallery-columns-6 .gallery-item:nth-of-type(6n),
.gallery-columns-7 .gallery-item:nth-of-type(7n),
.gallery-columns-8 .gallery-item:nth-of-type(8n),
.gallery-columns-9 .gallery-item:nth-of-type(9n) {
margin-right: auto;
margin-left: 0;
}
.gallery-caption {
padding: 6px 8px;
right: 0;
left: auto;
text-align: right;
}
.gallery-caption:before {
right: 0;
left: auto;
}
/**
* 6.7 Post/Image/Paging Navigation
* -----------------------------------------------------------------------------
*/
.paging-navigation .page-numbers {
margin-right: auto;
margin-left: 1px;
}
/**
* 6.10 Contributor Page
* -----------------------------------------------------------------------------
*/
.contributor-avatar {
float: right;
margin: 0 0 20px 30px;
}
/**
* 6.14 Comments
* -----------------------------------------------------------------------------
*/
.comment-author .avatar {
right: 0;
left: auto;
}
.bypostauthor > article .fn:before {
margin: 0 -2px 0 2px;
}
.comment-author,
.comment-awaiting-moderation,
.comment-content,
.comment-list .reply,
.comment-metadata {
padding-right: 30px;
padding-left: 0;
}
.comment-edit-link {
margin-right: 10px;
margin-left: auto;
}
.comment-reply-link:before,
.comment-reply-login:before {
margin-left: auto;
margin-right: 2px;
}
.comment-reply-link:before,
.comment-reply-login:before,
.comment-edit-link:before {
-webkit-transform: scaleX(-1);
-moz-transform: scaleX(-1);
-ms-transform: scaleX(-1);
-o-transform: scaleX(-1);
transform: scaleX(-1);
}
.comment-content ul,
.comment-content ol {
margin: 0 22px 24px 0;
}
.comment-list .children {
margin-right: 15px;
margin-left: auto;
}
.comment-reply-title small a {
float: left;
}
.comment-navigation .nav-previous a {
margin-right: auto;
margin-left: 10px;
}
/**
* 7.0 Sidebars
* -----------------------------------------------------------------------------
*/
/**
* 7.1 Widgets
* -----------------------------------------------------------------------------
*/
.widget li > ol,
.widget li > ul {
margin-right: 10px;
margin-left: auto;
}
.widget input,
.widget textarea {
padding: 1px 4px 2px 2px;
}
.widget_calendar caption {
text-align: right;
}
.widget_calendar #prev {
padding-right: 5px;
padding-left: 0;
}
.widget_calendar #next {
padding-right: 0;
padding-left: 5px;
text-align: left;
}
.widget_twentyfourteen_ephemera .entry-content ul,
.widget_twentyfourteen_ephemera .entry-content ol {
margin: 0 20px 18px 0;
}
.widget_twentyfourteen_ephemera .entry-content li > ul,
.widget_twentyfourteen_ephemera .entry-content li > ol {
margin: 0 20px 0 0;
}
/**
* 7.2 Content Sidebar Widgets
* -----------------------------------------------------------------------------
*/
.content-sidebar .widget li > ol,
.content-sidebar .widget li > ul {
margin-right: 18px;
margin-left: auto;
}
.content-sidebar .widget_twentyfourteen_ephemera .widget-title:before {
margin: -1px 0 0 18px;
}
/**
* 9.0 Featured Content
* -----------------------------------------------------------------------------
*/
.featured-content .post-thumbnail img {
right: 0;
left: auto;
}
.slider-viewport {
direction: ltr;
}
.slider .featured-content .entry-header {
right: 0;
left: auto;
text-align: right;
}
.slider-control-paging {
float: right;
}
.slider-control-paging li {
float: right;
margin: 2px 0 2px 4px;
}
.slider-control-paging li:last-child {
margin-right: auto;
margin-left: 0;
}
.slider-control-paging a:before {
right: 10px;
left: auto;
}
.slider-direction-nav li {
border-width: 2px 0 0 1px;
float: right;
}
.slider-direction-nav li:last-child {
border-width: 2px 1px 0 0;
}
.slider-direction-nav a:before {
content: "\f429";
}
.slider-direction-nav .slider-next:before {
content: "\f430";
}
/**
* 10.0 Media Queries
* -----------------------------------------------------------------------------
*/
@media screen and (max-width: 400px) {
.list-view .site-content .post-thumbnail img {
float: right;
margin: 0 0 3px 10px;
}
}
@media screen and (min-width: 401px) {
.site-content .entry-meta > span {
margin-right: auto;
margin-left: 10px;
}
.site-content .format-quote .post-format a:before {
margin-right: auto;
margin-left: 2px;
}
.site-content .format-gallery .post-format a:before {
margin-right: auto;
margin-left: 4px;
}
.site-content .format-aside .post-format a:before {
margin-right: auto;
margin-left: 2px;
}
.site-content .featured-post:before {
margin-right: auto;
margin-left: 3px;
}
.site-content .entry-date a:before,
.attachment .site-content span.entry-date:before {
margin-right: auto;
margin-left: 1px;
}
.site-content .comments-link a:before {
margin-right: auto;
margin-left: 2px;
}
.site-content .full-size-link a:before {
margin-right: auto;
margin-left: 1px;
}
.entry-content .edit-link a:before,
.entry-meta .edit-link a:before {
-webkit-transform: scaleX(-1);
-moz-transform: scaleX(-1);
-ms-transform: scaleX(-1);
-o-transform: scaleX(-1);
transform: scaleX(-1);
}
}
@media screen and (min-width: 594px) {
.site-content .entry-header {
padding-right: 30px;
padding-left: 30px;
}
}
@media screen and (min-width: 673px) {
.search-toggle {
margin-right: auto;
margin-left: 18px;
}
.content-area {
float: right;
}
.site-content {
margin-right: auto;
margin-left: 33.33333333%;
}
.archive-header,
.comments-area,
.image-navigation,
.page-header,
.page-content,
.post-navigation,
.site-content .entry-content,
.site-content .entry-summary,
.site-content footer.entry-meta {
padding-right: 30px;
padding-left: 30px;
}
.full-width .site-content {
margin-left: 0;
}
.content-sidebar {
float: left;
margin-right: -33.33333333%;
margin-left: auto;
}
.grid .featured-content .hentry {
float: right;
}
.slider-control-paging {
padding-right: 20px;
padding-left: 0;
}
.slider-direction-nav {
float: left;
}
.slider-direction-nav li {
padding: 0 0 0 1px;
}
.slider-direction-nav li:last-child {
padding: 0 1px 0 0;
}
}
@media screen and (min-width: 783px) {
.header-main {
padding-right: 30px;
padding-left: 0;
}
.search-toggle {
margin-right: auto;
margin-left: 0;
}
.primary-navigation {
float: left;
margin: 0 -12px 0 1px;
}
.primary-navigation ul ul {
float: right;
margin: 0;
right: -999em;
left: auto;
}
.primary-navigation ul ul ul {
right: -999em;
left: auto;
}
.primary-navigation ul li:hover > ul,
.primary-navigation ul li.focus > ul {
right: auto;
}
.primary-navigation ul ul li:hover > ul,
.primary-navigation ul ul li.focus > ul {
right: 100%;
left: auto;
}
.primary-navigation .menu-item-has-children > a,
.primary-navigation .page_item_has_children > a {
padding-right: 12px;
padding-left: 26px;
}
.primary-navigation .menu-item-has-children > a:after,
.primary-navigation .page_item_has_children > a:after {
right: auto;
left: 12px;
}
.primary-navigation li .menu-item-has-children > a,
.primary-navigation li .page_item_has_children > a {
padding-right: 12px;
padding-left: 20px;
}
.primary-navigation .menu-item-has-children li.menu-item-has-children > a:after,
.primary-navigation .menu-item-has-children li.page_item_has_children > a:after,
.primary-navigation .page_item_has_children li.menu-item-has-children > a:after,
.primary-navigation .page_item_has_children li.page_item_has_children > a:after {
content: "\f503";
right: auto;
left: 8px;
}
}
@media screen and (min-width: 810px) {
.attachment .entry-attachment .attachment {
margin-right: -168px;
margin-left: -168px;
}
.attachment .entry-attachment .attachment a {
display: block;
}
.contributor-avatar {
margin-right: -168px;
margin-left: auto;
}
.contributor-summary {
float: right;
}
.full-width .site-content blockquote.alignright,
.full-width .site-content img.size-full.alignright,
.full-width .site-content img.size-large.alignright,
.full-width .site-content img.size-medium.alignright,
.full-width .site-content .wp-caption.alignright {
margin-right: -168px;
margin-left: auto;
}
.full-width .site-content blockquote.alignleft,
.full-width .site-content img.size-full.alignleft,
.full-width .site-content img.size-large.alignleft,
.full-width .site-content img.size-medium.alignleft,
.full-width .site-content .wp-caption.alignleft {
margin-right: auto;
margin-left: -168px;
}
}
@media screen and (min-width: 846px) {
.comment-author,
.comment-awaiting-moderation,
.comment-content,
.comment-list .reply,
.comment-metadata {
padding-right: 50px;
padding-left: 0;
}
.comment-list .children {
margin-right: 20px;
margin-left: auto;
}
}
@media screen and (min-width: 1008px) {
.search-box-wrapper {
padding-right: 182px;
padding-left: 0;
}
.main-content {
float: right;
}
.site-content {
margin-right: 182px;
margin-left: 29.04761904%;
}
.full-width .site-content {
margin-right: 182px;
}
.content-sidebar {
margin-right: -29.04761904%;
margin-left: auto;
}
.site:before {
right: 0;
left: auto;
}
#secondary {
float: right;
margin: 0 -100% 0 0;
}
.secondary-navigation ul ul {
right: -999em;
left: auto;
}
.secondary-navigation ul li:hover > ul,
.secondary-navigation ul li.focus > ul {
right: 162px;
left: auto;
}
.secondary-navigation .menu-item-has-children > a {
padding-right: 30px;
padding-left: 38px;
}
.secondary-navigation .menu-item-has-children > a:after {
border-right-color: #fff;
border-left-color: transparent;
right: auto;
left: 26px;
content: "\f503";
}
.footer-sidebar .widget {
float: right;
}
.featured-content {
padding-right: 182px;
padding-left: 0;
}
}
@media screen and (min-width: 1040px) {
.archive-header,
.comments-area,
.image-navigation,
.page-header,
.page-content,
.post-navigation,
.site-content .entry-header,
.site-content .entry-content,
.site-content .entry-summary,
.site-content footer.entry-meta {
padding-right: 15px;
padding-left: 15px;
}
.full-width .archive-header,
.full-width .comments-area,
.full-width .image-navigation,
.full-width .page-header,
.full-width .page-content,
.full-width .post-navigation,
.full-width .site-content .entry-header,
.full-width .site-content .entry-content,
.full-width .site-content .entry-summary,
.full-width .site-content footer.entry-meta {
padding-right: 30px;
padding-left: 30px;
}
}
@media screen and (min-width: 1080px) {
.site-content {
margin-right: 222px;
margin-left: 29.04761904%;
}
.full-width .site-content {
margin-right: 222px;
}
.search-box-wrapper,
.featured-content {
padding-right: 222px;
padding-left: 0;
}
.secondary-navigation ul li:hover > ul,
.secondary-navigation ul li.focus > ul {
right: 202px;
left: auto;
}
.slider-control-paging {
padding-right: 24px;
padding-left: 0;
}
.slider-control-paging li {
margin: 12px 0 12px 12px;
}
.slider-control-paging a:before {
right: 6px;
left: auto;
}
}
@media screen and (min-width: 1110px) {
.archive-header,
.comments-area,
.image-navigation,
.page-header,
.page-content,
.post-navigation,
.site-content .entry-header,
.site-content .entry-content,
.site-content .entry-summary,
.site-content footer.entry-meta {
padding-right: 30px;
padding-left: 30px;
}
}
@media screen and (min-width: 1218px) {
.archive-header,
.comments-area,
.image-navigation,
.page-header,
.page-content,
.post-navigation,
.site-content .entry-header,
.site-content .entry-content,
.site-content .entry-summary,
.site-content footer.entry-meta {
margin-left: 54px;
}
.full-width .archive-header,
.full-width .comments-area,
.full-width .image-navigation,
.full-width .page-header,
.full-width .page-content,
.full-width .post-navigation,
.full-width .site-content .entry-header,
.full-width .site-content .entry-content,
.full-width .site-content .entry-summary,
.full-width .site-content footer.entry-meta {
margin-right: auto;
margin-left: auto;
}
}
@media screen and (min-width: 1260px) {
.site-content blockquote.alignright {
margin-right: -18%;
margin-left: auto;
}
.site-content blockquote.alignleft {
margin-left: -18%;
margin-right: auto;
}
} | BiStormLLC/blog | wp/wp-content/themes/twentyfourteen/rtl.css | CSS | gpl-3.0 | 16,432 | [
30522,
1013,
1008,
4323,
2171,
1024,
3174,
7426,
6412,
1024,
9909,
2490,
2005,
4155,
2517,
1999,
1037,
2157,
2000,
2187,
1006,
19387,
2140,
1007,
3257,
1012,
2009,
1005,
1055,
3733,
1010,
2074,
1037,
3043,
1997,
2058,
18560,
2035,
1996,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#system_notice_area_dismiss{
color: #FFFFFF;
cursor: pointer;
}
.system_notice_area_style1 {
background: #00C348;
border: 1px solid green;
}
.system_notice_area_style0 {
background: #FA5A6A;
border: 1px solid brown;
}
.bottonWidth{
width:120px;
}
.img{
width:20px;
height: 20px;
}
#bottomBorderNone{
border-bottom:none;
}
.submit{
background:#25A6E1;
background:-moz-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#25A6E1),color-stop(100%,#188BC0));
background:-webkit-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
background:-o-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
background:-ms-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
background:linear-gradient(top,#25A6E1 0%,#188BC0 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#25A6E1",endColorstr="#188BC0",GradientType=0);
padding:1px 13px;
color:#ffffff;
font-family:"Helvetica Neue",sans-serif;
font-size:15px;
cursor:pointer;
}
| JaredOlson/MuskegonFun | wp-content/plugins/contact-form-manager/css/xyz_cfm_styles.css | CSS | gpl-2.0 | 1,009 | [
30522,
1001,
2291,
1035,
5060,
1035,
2181,
1035,
19776,
1063,
3609,
1024,
1001,
21461,
4246,
4246,
1025,
12731,
25301,
2099,
1024,
20884,
1025,
1065,
1012,
2291,
1035,
5060,
1035,
2181,
1035,
2806,
2487,
1063,
4281,
1024,
1001,
4002,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:
description:
- hotstname of mikrotik router
required: True
username:
description:
- username used to connect to mikrotik router
required: True
password:
description:
- password used for authentication to mikrotik router
required: True
parameter:
description:
- sub enpoint for mikrotik system
required: True
options:
- ntp_client
- clock
- logging
- routerboard
- identity
settings:
description:
- All Mikrotik compatible parameters for this particular endpoint.
Any yes/no values must be enclosed in double quotes
state:
description:
- absent or present
'''
EXAMPLES = '''
- mt_system:
hostname: "{{ inventory_hostname }}"
username: "{{ mt_user }}"
password: "{{ mt_pass }}"
parameter: identity
settings:
name: test_ansible
'''
from ansible.module_utils.mt_common import clean_params, MikrotikIdempotent
from ansible.module_utils.basic import AnsibleModule
def main():
module = AnsibleModule(
argument_spec = dict(
hostname = dict(required=True),
username = dict(required=True),
password = dict(required=True, no_log=True),
settings = dict(required=False, type='dict'),
parameter = dict(
required = True,
choices = ['ntp_client', 'clock', 'identity', 'logging', 'routerboard_settings'],
type = 'str'
),
state = dict(
required = False,
choices = ['present', 'absent'],
type = 'str'
),
),
supports_check_mode=True
)
params = module.params
if params['parameter'] == 'routerboard_settings':
params['parameter'] = 'routerboard/settings'
if params['parameter'] == 'ntp_client':
params['parameter'] = 'ntp/client'
clean_params(params['settings'])
mt_obj = MikrotikIdempotent(
hostname = params['hostname'],
username = params['username'],
password = params['password'],
state = params['state'],
desired_params = params['settings'],
idempotent_param= None,
api_path = '/system/' + params['parameter'],
check_mode = module.check_mode
)
mt_obj.sync_state()
if mt_obj.failed:
module.fail_json(
msg = mt_obj.failed_msg
)
elif mt_obj.changed:
module.exit_json(
failed=False,
changed=True,
msg=mt_obj.changed_msg,
diff={ "prepared": {
"old": mt_obj.old_params,
"new": mt_obj.new_params,
}},
)
else:
module.exit_json(
failed=False,
changed=False,
#msg='',
msg=params['settings'],
)
if __name__ == '__main__':
main()
| zahodi/ansible-mikrotik | library/mt_system.py | Python | apache-2.0 | 2,989 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
12653,
1027,
1005,
1005,
1005,
11336,
1024,
11047,
1035,
2291,
1012,
1052,
2100,
3166,
1024,
1011,
1000,
24632,
19739,
10867,
28640,
1000,
2544,
1035,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Stylochaeton zenkeri Engl. SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Liliopsida/Alismatales/Araceae/Stylochaeton/Stylochaeton zenkeri/README.md | Markdown | apache-2.0 | 184 | [
30522,
1001,
2358,
8516,
11663,
6679,
2669,
16729,
5484,
2072,
25540,
2140,
1012,
2427,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
1996,
10161,
1997,
2166,
1010,
3822,
2254,
2249,
1001,
1001,
1001,
1001,
2405,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.hcentive.webservice.soap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import com.hcentive.service.FormResponse;
import com.hcentive.webservice.exception.HcentiveSOAPException;
import org.apache.log4j.Logger;
/**
* @author Mebin.Jacob
*Endpoint class.
*/
@Endpoint
public final class FormEndpoint {
private static final String NAMESPACE_URI = "http://hcentive.com/service";
Logger logger = Logger.getLogger(FormEndpoint.class);
@Autowired
FormRepository formRepo;
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "FormResponse")
@ResponsePayload
public FormResponse submitForm(@RequestPayload FormResponse request) throws HcentiveSOAPException {
// GetCountryResponse response = new GetCountryResponse();
// response.setCountry(countryRepository.findCountry(request.getName()));
FormResponse response = null;
logger.debug("AAGAYA");
try{
response = new FormResponse();
response.setForm1(formRepo.findForm("1"));
//make API call
}catch(Exception exception){
throw new HcentiveSOAPException("Something went wrong!!! The exception is --- " + exception);
}
return response;
// return null;
}
}
| mebinjacob/spring-boot-soap | src/main/java/com/hcentive/webservice/soap/FormEndpoint.java | Java | apache-2.0 | 1,458 | [
30522,
7427,
4012,
1012,
16731,
4765,
3512,
1012,
4773,
8043,
7903,
2063,
1012,
7815,
1025,
12324,
8917,
1012,
3500,
15643,
6198,
1012,
13435,
1012,
4713,
1012,
5754,
17287,
3508,
1012,
8285,
20357,
2094,
1025,
12324,
8917,
1012,
3500,
1564... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#ifndef _M68KNOMMU_DMA_MAPPING_H
#define _M68KNOMMU_DMA_MAPPING_H
#ifdef CONFIG_PCI
#include <asm-generic/dma-mapping.h>
#else
#include <asm-generic/dma-mapping-broken.h>
#endif
#endif /* _M68KNOMMU_DMA_MAPPING_H */
| impedimentToProgress/UCI-BlueChip | snapgear_linux/linux-2.6.21.1/include/asm-m68knommu/dma-mapping.h | C | mit | 219 | [
30522,
1001,
2065,
13629,
2546,
1035,
1049,
2575,
2620,
2243,
3630,
7382,
2226,
1035,
1040,
2863,
1035,
12375,
1035,
1044,
1001,
9375,
1035,
1049,
2575,
2620,
2243,
3630,
7382,
2226,
1035,
1040,
2863,
1035,
12375,
1035,
1044,
1001,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace mobilejazz\yii2\oauth2server;
use Yii;
/**
* For example,
*
* ```php
* 'oauth2' => [
* 'class' => 'filsh\yii2\oauth2server\Module',
* 'options' => [
* 'token_param_name' => 'accessToken',
* 'access_lifetime' => 3600
* ],
* 'storageMap' => [
* 'user_credentials' => 'common\models\User'
* ],
* 'grantTypes' => [
* 'client_credentials' => [
* 'class' => '\OAuth2\GrantType\ClientCredentials',
* 'allow_public_clients' => false
* ],
* 'user_credentials' => [
* 'class' => '\OAuth2\GrantType\UserCredentials'
* ],
* 'refresh_token' => [
* 'class' => '\OAuth2\GrantType\RefreshToken',
* 'always_issue_new_refresh_token' => true
* ]
* ],
* ]
* ```
*/
class Module extends \yii\base\Module
{
public $options = [];
public $storageMap = [];
public $storageDefault = 'mobilejazz\yii2\oauth2server\storage\Pdo';
public $grantTypes = [];
public $modelClasses = [];
public $i18n;
private $server;
private $request;
private $models = [];
public $tokenParamName = 'accessToken';
public $tokenAccessLifetime = 3600 * 24;
private $_server;
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->modelClasses = array_merge($this->getDefaultModelClasses(), $this->modelClasses);
$this->registerTranslations();
}
/**
* Get oauth2 server instance
*
* @param bool $force
*
* @return \OAuth2\Server
*/
public function getServer($force = false)
{
if ($this->server === null || $force === true) {
$storages = $this->createStorages();
$server = new \OAuth2\Server($storages, $this->options);
foreach ($this->grantTypes as $name => $options) {
if (!isset($storages[ $name ]) || empty($options['class'])) {
throw new \yii\base\InvalidConfigException('Invalid grant types configuration.');
}
$class = $options['class'];
unset($options['class']);
$reflection = new \ReflectionClass($class);
$config = array_merge([0 => $storages[ $name ]], [$options]);
$instance = $reflection->newInstanceArgs($config);
$server->addGrantType($instance);
}
$this->server = $server;
}
return $this->server;
}
/**
* Get oauth2 request instance from global variables
*
* @return \OAuth2\Request
*/
public function getRequest($force = false)
{
if ($this->request === null || $force) {
$this->request = \OAuth2\Request::createFromGlobals();
};
return $this->request;
}
/**
* Get oauth2 response instance
*
* @return \OAuth2\Response
*/
public function getResponse()
{
return new \OAuth2\Response();
}
/**
* Create storages
*
* @return array
*/
public function createStorages()
{
$connection = Yii::$app->getDb();
if (!$connection->getIsActive()) {
$connection->open();
}
$storages = [];
foreach ($this->storageMap as $name => $storage) {
$storages[ $name ] = Yii::createObject($storage);
}
$defaults = [
'access_token',
'authorization_code',
'client_credentials',
'client',
'refresh_token',
'user_credentials',
'public_key',
'jwt_bearer',
'scope',
];
foreach ($defaults as $name) {
if (!isset($storages[ $name ])) {
$storages[ $name ] = Yii::createObject($this->storageDefault);
}
}
return $storages;
}
/**
* Get object instance of model
*
* @param string $name
* @param array $config
*
* @return ActiveRecord
*/
public function model($name, $config = [])
{
if (!isset($this->models[ $name ])) {
$className = $this->modelClasses[ ucfirst($name) ];
$this->models[ $name ] = Yii::createObject(array_merge(['class' => $className], $config));
}
return $this->models[ $name ];
}
/**
* Register translations for this module
*
* @return void
*/
public function registerTranslations()
{
Yii::setAlias('@oauth2server', dirname(__FILE__));
if (empty($this->i18n)) {
$this->i18n = [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@oauth2server/messages',
];
}
Yii::$app->i18n->translations['oauth2server'] = $this->i18n;
}
/**
* Get default model classes
*
* @return array
*/
protected function getDefaultModelClasses()
{
return [
'Clients' => 'mobilejazz\yii2\oauth2server\models\OauthClients',
'AccessTokens' => 'mobilejazz\yii2\oauth2server\models\OauthAccessTokens',
'AuthorizationCodes' => 'mobilejazz\yii2\oauth2server\models\OauthAuthorizationCodes',
'RefreshTokens' => 'mobilejazz\yii2\oauth2server\models\OauthRefreshTokens',
'Scopes' => 'mobilejazz\yii2\oauth2server\models\OauthScopes',
];
}
}
| mobilejazz/yii2-oauth2-server | Module.php | PHP | mit | 5,562 | [
30522,
1026,
1029,
25718,
3415,
15327,
4684,
3900,
13213,
1032,
12316,
2072,
2475,
1032,
1051,
4887,
2705,
2475,
8043,
6299,
1025,
2224,
12316,
2072,
1025,
1013,
1008,
1008,
1008,
2005,
2742,
1010,
1008,
1008,
1036,
1036,
1036,
25718,
1008,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# We borrow heavily from the kernel build setup, though we are simpler since
# we don't have Kconfig tweaking settings on us.
# The implicit make rules have it looking for RCS files, among other things.
# We instead explicitly write all the rules we care about.
# It's even quicker (saves ~200ms) to pass -r on the command line.
MAKEFLAGS=-r
# The source directory tree.
srcdir := ..
abs_srcdir := $(abspath $(srcdir))
# The name of the builddir.
builddir_name ?= .
# The V=1 flag on command line makes us verbosely print command lines.
ifdef V
quiet=
else
quiet=quiet_
endif
# Specify BUILDTYPE=Release on the command line for a release build.
BUILDTYPE ?= Release
# Directory all our build output goes into.
# Note that this must be two directories beneath src/ for unit tests to pass,
# as they reach into the src/ directory for data with relative paths.
builddir ?= $(builddir_name)/$(BUILDTYPE)
abs_builddir := $(abspath $(builddir))
depsdir := $(builddir)/.deps
# Object output directory.
obj := $(builddir)/obj
abs_obj := $(abspath $(obj))
# We build up a list of every single one of the targets so we can slurp in the
# generated dependency rule Makefiles in one pass.
all_deps :=
CC.target ?= $(CC)
CFLAGS.target ?= $(CFLAGS)
CXX.target ?= $(CXX)
CXXFLAGS.target ?= $(CXXFLAGS)
LINK.target ?= $(LINK)
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
# C++ apps need to be linked with g++.
#
# Note: flock is used to seralize linking. Linking is a memory-intensive
# process so running parallel links can often lead to thrashing. To disable
# the serialization, override LINK via an envrionment variable as follows:
#
# export LINK=g++
#
# This will allow make to invoke N linker processes as specified in -jN.
LINK ?= ./gyp-mac-tool flock $(builddir)/linker.lock $(CXX.target)
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= gcc
CFLAGS.host ?=
CXX.host ?= g++
CXXFLAGS.host ?=
LINK.host ?= $(CXX.host)
LDFLAGS.host ?=
AR.host ?= ar
# Define a dir function that can handle spaces.
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
# "leading spaces cannot appear in the text of the first argument as written.
# These characters can be put into the argument value by variable substitution."
empty :=
space := $(empty) $(empty)
# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
replace_spaces = $(subst $(space),?,$1)
unreplace_spaces = $(subst ?,$(space),$1)
dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
# Flags to make gcc output dependency info. Note that you need to be
# careful here to use the flags that ccache and distcc can understand.
# We write to a dep file on the side first and then rename at the end
# so we can't end up with a broken dep file.
depfile = $(depsdir)/$(call replace_spaces,$@).d
DEPFLAGS = -MMD -MF $(depfile).raw
# We have to fixup the deps output in a few ways.
# (1) the file output should mention the proper .o file.
# ccache or distcc lose the path to the target, so we convert a rule of
# the form:
# foobar.o: DEP1 DEP2
# into
# path/to/foobar.o: DEP1 DEP2
# (2) we want missing files not to cause us to fail to build.
# We want to rewrite
# foobar.o: DEP1 DEP2 \
# DEP3
# to
# DEP1:
# DEP2:
# DEP3:
# so if the files are missing, they're just considered phony rules.
# We have to do some pretty insane escaping to get those backslashes
# and dollar signs past make, the shell, and sed at the same time.
# Doesn't work with spaces, but that's fine: .d files have spaces in
# their names replaced with other characters.
define fixup_dep
# The depfile may not exist if the input file didn't have any #includes.
touch $(depfile).raw
# Fixup path as in (1).
sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
# Add extra rules as in (2).
# We remove slashes and replace spaces with new lines;
# remove blank lines;
# delete the first line and append a colon to the remaining lines.
sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
grep -v '^$$' |\
sed -e 1d -e 's|$$|:|' \
>> $(depfile)
rm $(depfile).raw
endef
# Command definitions:
# - cmd_foo is the actual command to run;
# - quiet_cmd_foo is the brief-output summary of the command.
quiet_cmd_cc = CC($(TOOLSET)) $@
cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_cxx = CXX($(TOOLSET)) $@
cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_objc = CXX($(TOOLSET)) $@
cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
quiet_cmd_objcxx = CXX($(TOOLSET)) $@
cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<
# Commands for precompiled header files.
quiet_cmd_pch_c = CXX($(TOOLSET)) $@
cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_pch_cc = CXX($(TOOLSET)) $@
cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_pch_m = CXX($(TOOLSET)) $@
cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
quiet_cmd_pch_mm = CXX($(TOOLSET)) $@
cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<
# gyp-mac-tool is written next to the root Makefile by gyp.
# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd
# already.
quiet_cmd_mac_tool = MACTOOL $(4) $<
cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@"
quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@
cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4)
quiet_cmd_infoplist = INFOPLIST $@
cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@"
quiet_cmd_touch = TOUCH $@
cmd_touch = touch $@
quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
cmd_copy = rm -rf "$@" && cp -af "$<" "$@"
quiet_cmd_alink = LIBTOOL-STATIC $@
cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
# Define an escape_quotes function to escape single quotes.
# This allows us to handle quotes properly as long as we always use
# use single quotes and escape_quotes.
escape_quotes = $(subst ','\'',$(1))
# This comment is here just to include a ' to unconfuse syntax highlighting.
# Define an escape_vars function to escape '$' variable syntax.
# This allows us to read/write command lines with shell variables (e.g.
# $LD_LIBRARY_PATH), without triggering make substitution.
escape_vars = $(subst $$,$$$$,$(1))
# Helper that expands to a shell command to echo a string exactly as it is in
# make. This uses printf instead of echo because printf's behaviour with respect
# to escape sequences is more portable than echo's across different shells
# (e.g., dash, bash).
exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
# Helper to compare the command we're about to run against the command
# we logged the last time we ran the command. Produces an empty
# string (false) when the commands match.
# Tricky point: Make has no string-equality test function.
# The kernel uses the following, but it seems like it would have false
# positives, where one string reordered its arguments.
# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
# $(filter-out $(cmd_$@), $(cmd_$(1))))
# We instead substitute each for the empty string into the other, and
# say they're equal if both substitutions produce the empty string.
# .d files contain ? instead of spaces, take that into account.
command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
$(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
# Helper that is non-empty when a prerequisite changes.
# Normally make does this implicitly, but we force rules to always run
# so we can check their command lines.
# $? -- new prerequisites
# $| -- order-only dependencies
prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
# Helper that executes all postbuilds until one fails.
define do_postbuilds
@E=0;\
for p in $(POSTBUILDS); do\
eval $$p;\
E=$$?;\
if [ $$E -ne 0 ]; then\
break;\
fi;\
done;\
if [ $$E -ne 0 ]; then\
rm -rf "$@";\
exit $$E;\
fi
endef
# do_cmd: run a command via the above cmd_foo names, if necessary.
# Should always run for a given target to handle command-line changes.
# Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
# Third argument, if non-zero, makes it do POSTBUILDS processing.
# Note: We intentionally do NOT call dirx for depfile, since it contains ? for
# spaces already and dirx strips the ? characters.
define do_cmd
$(if $(or $(command_changed),$(prereq_changed)),
@$(call exact_echo, $($(quiet)cmd_$(1)))
@mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
$(if $(findstring flock,$(word 2,$(cmd_$1))),
@$(cmd_$(1))
@echo " $(quiet_cmd_$(1)): Finished",
@$(cmd_$(1))
)
@$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
@$(if $(2),$(fixup_dep))
$(if $(and $(3), $(POSTBUILDS)),
$(call do_postbuilds)
)
)
endef
# Declare the "all" target first so it is the default,
# even though we don't have the deps yet.
.PHONY: all
all:
# make looks for ways to re-generate included makefiles, but in our case, we
# don't have a direct way. Explicitly telling make that it has nothing to do
# for them makes it go faster.
%.d: ;
# Use FORCE_DO_CMD to force a target to run. Should be coupled with
# do_cmd.
.PHONY: FORCE_DO_CMD
FORCE_DO_CMD:
TOOLSET := target
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD
@$(call do_cmd,objc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD
@$(call do_cmd,objcxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD
@$(call do_cmd,objc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD
@$(call do_cmd,objcxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD
@$(call do_cmd,objc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD
@$(call do_cmd,objcxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,kerberos.target.mk)))),)
include kerberos.target.mk
endif
quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/galen0531/Dropbox/Dev/3-phase/new-tech/gtools/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/galen0531/.node-gyp/0.12.4/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/galen0531/.node-gyp/0.12.4" "-Dmodule_root_dir=/Users/galen0531/Dropbox/Dev/3-phase/new-tech/gtools/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos" binding.gyp
Makefile: $(srcdir)/../../../../../../../../../../../.node-gyp/0.12.4/common.gypi $(srcdir)/../../../../../../../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp
$(call do_cmd,regen_makefile)
# "all" is a concatenation of the "all" targets from all the included
# sub-makefiles. This is just here to clarify.
all:
# Add in dependency-tracking rules. $(all_deps) is the list of every single
# target in our tree. Only consider the ones with .d (dependency) info:
d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
ifneq ($(d_files),)
include $(d_files)
endif
| galenscook/gtools | node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/build/Makefile | Makefile | mit | 13,750 | [
30522,
1001,
2057,
17781,
4600,
2013,
1996,
16293,
3857,
16437,
1010,
2295,
2057,
2024,
16325,
2144,
1001,
2057,
2123,
1005,
1056,
2031,
21117,
2239,
8873,
2290,
1056,
8545,
15495,
10906,
2006,
2149,
1012,
1001,
1996,
24655,
2191,
3513,
203... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en" itemscope itemtype="https://schema.org/WebPage">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Vitess / GitHub Workflow</title>
<!-- Webfont -->
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<!--<link rel="shortcut icon" type="image/png" href="/favicon.png">-->
<!-- Bootstrap -->
<link href="/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="/css/site.css" />
<!-- Font Awesome icons -->
<link href="/libs/font-awesome-4.4.0/css/font-awesome.min.css"
rel="stylesheet"
type="text/css">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/libs/bootstrap/js/bootstrap.min.js"></script>
<!-- metadata -->
<meta name="og:title" content="Vitess / GitHub Workflow"/>
<meta name="og:image" content="/images/vitess_logomark_cropped.svg"/>
<meta name="og:description" content="Vitess is a database clustering system for horizontal scaling of MySQL."/>
<link rel="icon" href="/images/vitess_icon.png" type="image/png">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-60219601-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body class="docs" id="top_of_page">
<span id="toc-depth" data-toc-depth="h2,h3"></span>
<nav id="common-nav" class="navbar navbar-fixed-top inverse">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<img class="logo" src="/images/vitess_logomark_cropped.svg" alt="Vitess">
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav navbar-right" id="standard-menu-links">
<li><a href="/overview/">Overview</a></li>
<li><a href="/user-guide/introduction.html">Guides</a></li>
<li><a href="/reference/vitess-api.html">Reference</a></li>
<li><a href="http://blog.vitess.io">Blog</a></li>
<li><a href="https://github.com/youtube/vitess"><i class="fa fa-github"></i> GitHub</a></li>
<!-- Hide link to blog unless we have actual posts -->
<!-- <li><a href="/blog/" title="">Blog</a></li> -->
</ul>
<ul class="nav nav-stacked mobile-left-nav-menu" id="collapsed-left-menu">
<li class="submenu">
<h4 class="arrow-r no-top-margin">Overview</h4>
<ul style="display: none">
<li><a href="/overview/">What is Vitess</a></li>
<li><a href="/overview/scaling-mysql.html">Scaling MySQL with Vitess</a></li>
<li><a href="/overview/concepts.html">Key Concepts</a></li>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">Getting Started</h4>
<ul style="display: none">
<li style="padding-bottom: 0"><a href="/getting-started/">Run Vitess on Kubernetes</a>
<ul style="display: block">
<li style="padding-bottom: 0"><a href="/getting-started/docker-build.html">Custom Docker Build</a></li>
</ul>
</li>
<li><a href="/getting-started/local-instance.html">Run Vitess Locally</a></li>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">User Guide</h4>
<ul style="display: none">
<li><a href="/user-guide/introduction.html">Introduction</a>
<li><a href="/user-guide/client-libraries.html">Client Libraries</a>
<li><a href="/user-guide/backup-and-restore.html">Backing Up Data</a>
<li><a href="/user-guide/reparenting.html">Reparenting</a></li>
<li style="padding-bottom: 0"><a href="/user-guide/schema-management.html">Schema Management</a></li>
<ul style="display: block">
<li style="padding-bottom: 0"><a href="/user-guide/pivot-schema-changes.html">Pivot Schema Changes (Tutorial)</a></li>
</ul>
<li style="padding-bottom: 0"><a href="/user-guide/sharding.html">Sharding</a>
<ul style="display: block">
<li><a href="/user-guide/horizontal-sharding.html">Horizontal Sharding (Codelab)</a></li>
<li style="padding-bottom: 0"><a href="/user-guide/sharding-kubernetes.html">Sharding in Kubernetes (Codelab)</a></li>
</ul>
</li>
<li><a href="/user-guide/vitess-replication.html">Vitess and Replication</a></li>
<li><a href="/user-guide/topology-service.html">Topology Service</a></li>
<li><a href="/user-guide/transport-security-model.html">Transport Security Model</a></li>
<li style="padding-bottom: 0"><a href="/user-guide/launching.html">Launching</a>
<ul style="display: block">
<li><a href="/user-guide/scalability-philosophy.html">Scalability Philosophy</a></li>
<li><a href="/user-guide/production-planning.html">Production Planning</a></li>
<li><a href="/user-guide/server-configuration.html">Server Configuration</a></li>
<li style="padding-bottom: 0"><a href="/user-guide/troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
<li><a href="/user-guide/upgrading.html">Upgrading</a></li>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">Reference Guides</h4>
<ul style="display: none">
<li><a href="/reference/vitess-api.html">Vitess API</a>
<li><a href="/reference/vtctl.html">vtctl Commands</a>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">Other Resources</h4>
<ul style="display: none">
<li><a href="/resources/presentations.html">Presentations</a>
<li><a href="http://blog.vitess.io/">Blog</a>
<li><a href="/resources/roadmap.html">Roadmap</a>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">Contributing</h4>
<ul style="display: none">
<li><a href="/contributing/">Contributing to Vitess</a>
<li><a href="/contributing/github-workflow.html">GitHub Workflow</a>
<li><a href="/contributing/code-reviews.html">Code Reviews</a>
</ul>
</li>
<div>
<form method="get" action="/search/">
<input id="search-form" name="q" type="text" placeholder="Search">
</form>
</div>
<li><a href="https://github.com/youtube/vitess" id="collapsed-left-menu-repo-link"><i class="fa fa-github"></i> GitHub</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div id="masthead">
<div class="container">
<div class="row">
<div class="col-md-9">
<h1>GitHub Workflow</h1>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row scroll-margin" id="toc-content-row">
<div class="col-md-2" id="leftCol">
<ul class="nav nav-stacked mobile-left-nav-menu" id="sidebar">
<li class="submenu">
<h4 class="arrow-r no-top-margin">Overview</h4>
<ul style="display: none">
<li><a href="/overview/">What is Vitess</a></li>
<li><a href="/overview/scaling-mysql.html">Scaling MySQL with Vitess</a></li>
<li><a href="/overview/concepts.html">Key Concepts</a></li>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">Getting Started</h4>
<ul style="display: none">
<li style="padding-bottom: 0"><a href="/getting-started/">Run Vitess on Kubernetes</a>
<ul style="display: block">
<li style="padding-bottom: 0"><a href="/getting-started/docker-build.html">Custom Docker Build</a></li>
</ul>
</li>
<li><a href="/getting-started/local-instance.html">Run Vitess Locally</a></li>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">User Guide</h4>
<ul style="display: none">
<li><a href="/user-guide/introduction.html">Introduction</a>
<li><a href="/user-guide/client-libraries.html">Client Libraries</a>
<li><a href="/user-guide/backup-and-restore.html">Backing Up Data</a>
<li><a href="/user-guide/reparenting.html">Reparenting</a></li>
<li style="padding-bottom: 0"><a href="/user-guide/schema-management.html">Schema Management</a></li>
<ul style="display: block">
<li style="padding-bottom: 0"><a href="/user-guide/pivot-schema-changes.html">Pivot Schema Changes (Tutorial)</a></li>
</ul>
<li style="padding-bottom: 0"><a href="/user-guide/sharding.html">Sharding</a>
<ul style="display: block">
<li><a href="/user-guide/horizontal-sharding.html">Horizontal Sharding (Codelab)</a></li>
<li style="padding-bottom: 0"><a href="/user-guide/sharding-kubernetes.html">Sharding in Kubernetes (Codelab)</a></li>
</ul>
</li>
<li><a href="/user-guide/vitess-replication.html">Vitess and Replication</a></li>
<li><a href="/user-guide/topology-service.html">Topology Service</a></li>
<li><a href="/user-guide/transport-security-model.html">Transport Security Model</a></li>
<li style="padding-bottom: 0"><a href="/user-guide/launching.html">Launching</a>
<ul style="display: block">
<li><a href="/user-guide/scalability-philosophy.html">Scalability Philosophy</a></li>
<li><a href="/user-guide/production-planning.html">Production Planning</a></li>
<li><a href="/user-guide/server-configuration.html">Server Configuration</a></li>
<li style="padding-bottom: 0"><a href="/user-guide/troubleshooting.html">Troubleshooting</a></li>
</ul>
</li>
<li><a href="/user-guide/upgrading.html">Upgrading</a></li>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">Reference Guides</h4>
<ul style="display: none">
<li><a href="/reference/vitess-api.html">Vitess API</a>
<li><a href="/reference/vtctl.html">vtctl Commands</a>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">Other Resources</h4>
<ul style="display: none">
<li><a href="/resources/presentations.html">Presentations</a>
<li><a href="http://blog.vitess.io/">Blog</a>
<li><a href="/resources/roadmap.html">Roadmap</a>
</ul>
</li>
<li class="submenu">
<h4 class="arrow-r">Contributing</h4>
<ul style="display: none">
<li><a href="/contributing/">Contributing to Vitess</a>
<li><a href="/contributing/github-workflow.html">GitHub Workflow</a>
<li><a href="/contributing/code-reviews.html">Code Reviews</a>
</ul>
</li>
<div>
<form method="get" action="/search/">
<input id="search-form" name="q" type="text" placeholder="Search">
</form>
</div>
</ul>
</div>
<div class="col-md-3" id="rightCol">
<div class="nav nav-stacked" id="tocSidebar">
<div id="toc"></div>
</div>
</div>
<div class="col-md-7" id="centerCol">
<div id="centerTextCol">
<h1 id="github-workflow">GitHub Workflow</h1>
<p>If you are new to Git and GitHub, we recommend to read this page. Otherwise, you may skip it.</p>
<p>Our GitHub workflow is a so called triangular workflow:</p>
<p><img src="https://cloud.githubusercontent.com/assets/1319791/8943755/5dcdcae4-354a-11e5-9f82-915914fad4f7.png" alt="visualization of the GitHub triangular workflow" style="width: 100%;"/></p>
<p><em>Image Source:</em> <a href="https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows">https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows</a></p>
<p>You develop and commit your changes in a clone of our upstream repository
(<code class="prettyprint">local</code>). Then you push your changes to your forked repository (<code class="prettyprint">origin</code>) and
send us a pull request. Eventually, we will merge your pull request back into
the <code class="prettyprint">upstream</code> repository.</p>
<h2 id="remotes">Remotes</h2>
<p>Since you should have cloned the repository from your fork, the <code class="prettyprint">origin</code> remote
should look like this:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">$ git remote -v
origin git@github.com:<yourname>/vitess.git (fetch)
origin git@github.com:<yourname>/vitess.git (push)
</code></pre></div>
<p>To help you keep your fork in sync with the main repo, add an <code class="prettyprint">upstream</code> remote:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">$ git remote add upstream git@github.com:youtube/vitess.git
$ git remote -v
origin git@github.com:<yourname>/vitess.git (fetch)
origin git@github.com:<yourname>/vitess.git (push)
upstream git@github.com:youtube/vitess.git (fetch)
upstream git@github.com:youtube/vitess.git (push)
</code></pre></div>
<p>Now to sync your local <code class="prettyprint">master</code> branch, do this:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">$ git checkout master
(master) $ git pull upstream master
</code></pre></div>
<p>Note: In the example output above we prefixed the prompt with <code class="prettyprint">(master)</code> to
stress the fact that the command must be run from the branch <code class="prettyprint">master</code>.</p>
<p>You can omit the <code class="prettyprint">upstream master</code> from the <code class="prettyprint">git pull</code> command when you let your
<code class="prettyprint">master</code> branch always track the main <code class="prettyprint">youtube/vitess</code> repository. To achieve
this, run this command once:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">(master) $ git branch --set-upstream-to=upstream/master
</code></pre></div>
<p>Now the following command syncs your local <code class="prettyprint">master</code> branch as well:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">(master) $ git pull
</code></pre></div>
<h2 id="topic-branches">Topic Branches</h2>
<p>Before you start working on changes, create a topic branch:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">$ git checkout master
(master) $ git pull
(master) $ git checkout -b new-feature
(new-feature) $ # You are now in the new-feature branch.
</code></pre></div>
<p>Try to commit small pieces along the way as you finish them, with an explanation
of the changes in the commit message. As you work in a package, you can run just
the unit tests for that package by running <code class="prettyprint">go test</code> from within that package.</p>
<p>When you're ready to test the whole system, run the full test suite with <code class="prettyprint">make
test</code> from the root of the Git tree.
If you haven't installed all dependencies for <code class="prettyprint">make test</code>, you can rely on the Travis CI test results as well.
These results will be linked on your pull request.</p>
<h2 id="sending-pull-requests">Sending Pull Requests</h2>
<p>Push your branch to the repository (and set it to track with <code class="prettyprint">-u</code>):</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">(new-feature) $ git push -u origin new-feature
</code></pre></div>
<p>You can omit <code class="prettyprint">origin</code> and <code class="prettyprint">-u new-feature</code> parameters from the <code class="prettyprint">git push</code>
command with the following two Git configuration changes:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">$ git config remote.pushdefault origin
$ git config push.default current
</code></pre></div>
<p>The first setting saves you from typing <code class="prettyprint">origin</code> every time. And with the second
setting, Git assumes that the remote branch on the GitHub side will have the
same name as your local branch.</p>
<p>After this change, you can run <code class="prettyprint">git push</code> without arguments:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">(new-feature) $ git push
</code></pre></div>
<p>Then go to the <a href="https://github.com/youtube/vitess">repository page</a> and it
should prompt you to create a Pull Request from a branch you recently pushed.
You can also <a href="https://github.com/youtube/vitess/compare">choose a branch manually</a>.</p>
<h2 id="addressing-changes">Addressing Changes</h2>
<p>If you need to make changes in response to the reviewer's comments, just make
another commit on your branch and then push it again:</p>
<div class="highlight"><pre><code class="language-text" data-lang="text">$ git checkout new-feature
(new-feature) $ git commit
(new-feature) $ git push
</code></pre></div>
<p>That is because a pull request always mirrors all commits from your topic branch which are not in the master branch.</p>
<p>After you merge, close the issue (if it wasn't automatically closed) and delete
the topic branch.</p>
</div>
</div>
</div>
</div>
<div class="page-spacer"></div>
<footer role="contentinfo" id="site-footer">
<nav role="navigation" class="menu bottom-menu">
<a href="https://groups.google.com/forum/#!forum/vitess" target="_blank">Contact: vitess@googlegroups.com</a> <b>·</b>
<a href="https://groups.google.com/forum/#!forum/vitess-announce" target="_blank">Announcements</a> <b>·</b>
© 2016 <a href="/">Vitess</a> powered by <a href="https://developers.google.com/open-source/">Google Inc</a>
</nav>
</footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> -->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!--
<script src="/libs/bootstrap/js/bootstrap.min.js"></script>
-->
<!-- Include the common site javascript -->
<script src="/js/common.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
| mapbased/vitess | docs/contributing/github-workflow.html | HTML | bsd-3-clause | 20,308 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1000,
5167,
16186,
8875,
13874,
1027,
1000,
16770,
1024,
1013,
1013,
8040,
28433,
1012,
8917,
1013,
4773,
13704,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.gmail.altakey.ray;
import android.app.Activity;
import android.os.Bundle;
import android.os.Parcelable;
import android.net.Uri;
import android.content.Intent;
import android.widget.Toast;
import android.util.Log;
import android.net.http.AndroidHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.util.EntityUtils;
import java.io.File;
import java.io.IOException;
import java.util.Random;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import java.nio.*;
import android.os.AsyncTask;
import android.view.View;
import android.view.ViewGroup;
import android.view.LayoutInflater;
import android.widget.EditText;
import android.app.AlertDialog;
import android.content.DialogInterface;
import java.util.*;
public class EnqueueActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final String action = getIntent().getAction();
final Bundle extras = getIntent().getExtras();
if (Intent.ACTION_SEND.equals(action)) {
if (extras.containsKey(Intent.EXTRA_STREAM)) {
new EnqueueTaskInvoker((Uri)extras.getParcelable(Intent.EXTRA_STREAM)).invokeOnFriend();
}
} else if (Intent.ACTION_SEND_MULTIPLE.equals(action)) {
if (extras.containsKey(Intent.EXTRA_STREAM)) {
for (Parcelable p : extras.getParcelableArrayList(Intent.EXTRA_STREAM)) {
new EnqueueTaskInvoker((Uri)p).invokeOnFriend();
}
}
} else {
finish();
}
}
private class EnqueueTaskInvoker {
private Uri mmForUri;
private List<String> mmOptions = new LinkedList<String>();
public EnqueueTaskInvoker(Uri forUri) {
mmForUri = forUri;
mmOptions.add("(local)");
mmOptions.add("10.0.0.50");
mmOptions.add("10.0.0.52");
mmOptions.add("192.168.1.15");
mmOptions.add("192.168.1.17");
mmOptions.add("Other...");
}
public void invokeOnFriend() {
AlertDialog.Builder builder = new AlertDialog.Builder(EnqueueActivity.this);
builder
.setTitle(R.string.dialog_title_send_to)
.setOnCancelListener(new CancelAction())
.setItems(mmOptions.toArray(new String[0]), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String choice = mmOptions.get(which);
if (choice != null) {
if ("Other...".equals(choice)) {
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(
R.layout.friend,
(ViewGroup)findViewById(R.id.root));
AlertDialog.Builder builder = new AlertDialog.Builder(EnqueueActivity.this);
EditText field = (EditText)layout.findViewById(R.id.name);
builder
.setTitle(R.string.dialog_title_send_to)
.setView(layout)
.setOnCancelListener(new CancelAction())
.setNegativeButton(android.R.string.cancel, new CancelAction())
.setPositiveButton(android.R.string.ok, new ConfirmAction(field));
dialog.dismiss();
builder.create().show();
} else if ("(local)".equals(choice)) {
dialog.dismiss();
new EnqueueToFriendTask("localhost:8080", mmForUri).execute();
finish();
} else {
dialog.dismiss();
new EnqueueToFriendTask(String.format("%s:8080", choice), mmForUri).execute();
finish();
}
} else {
dialog.dismiss();
}
}
});
builder.create().show();
}
private class CancelAction implements DialogInterface.OnClickListener, DialogInterface.OnCancelListener {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
}
@Override
public void onCancel(DialogInterface dialog) {
dialog.dismiss();
finish();
}
}
private class ConfirmAction implements DialogInterface.OnClickListener {
private EditText mmmField;
public ConfirmAction(EditText field) {
mmmField = field;
}
@Override
public void onClick(DialogInterface dialog, int which) {
String name = mmmField.getText().toString();
dialog.dismiss();
new EnqueueToFriendTask(name, mmForUri).execute();
finish();
}
}
}
private class EnqueueToFriendTask extends AsyncTask<Void, Void, Throwable> {
private Uri mmUri;
private String mmFriendAddress;
public EnqueueToFriendTask(String friendAddress, Uri uri) {
mmUri = uri;
mmFriendAddress = friendAddress;
}
@Override
public void onPreExecute() {
Toast.makeText(EnqueueActivity.this, "Sending...", Toast.LENGTH_LONG).show();
}
@Override
public Throwable doInBackground(Void... args) {
File tempFile = null;
try {
tempFile = new Cacher().cache();
new Enqueuer(tempFile).enqueue();
return null;
} catch (IOException e) {
Log.e("EA", "Cannot send to remote playlist", e);
return e;
} finally {
if (tempFile != null) {
tempFile.delete();
}
}
}
@Override
public void onPostExecute(Throwable ret) {
if (ret == null) {
Toast.makeText(EnqueueActivity.this, "Sent to remote playlist.", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(EnqueueActivity.this, "Cannot send to remote playlist", Toast.LENGTH_SHORT).show();
}
}
private class Enqueuer {
private AndroidHttpClient mmmHttpClient;
private File mmmBlob;
public Enqueuer(File blob) {
mmmHttpClient = AndroidHttpClient.newInstance(getUserAgent());
mmmBlob = blob;
}
private String getUserAgent() {
return String.format("%s/%s", getString(R.string.app_name), "0.0.1");
}
public void enqueue() throws IOException {
HttpPost req = new HttpPost(String.format("http://%s", mmFriendAddress));
MultipartEntity entity = new MultipartEntity();
entity.addPart("stream", new FileBody(mmmBlob, "application/octet-stream"));
req.setEntity(entity);
int code = mmmHttpClient.execute(req).getStatusLine().getStatusCode();
Log.d("EA", String.format("posted, code=%d", code));
}
}
private class Cacher {
public File cache() throws IOException {
FileChannel src = null;
FileChannel dest = null;
File destFile = null;
try {
destFile = new File(root(), randomName());
src = new FileInputStream(getContentResolver().openFileDescriptor(mmUri, "r").getFileDescriptor()).getChannel();
dest = new FileOutputStream(destFile).getChannel();
dest.transferFrom(src, 0, Integer.MAX_VALUE);
Log.d("MA", String.format("cached %s as %s", mmUri.toString(), destFile.getName()));
return destFile;
} catch (IOException e) {
Log.e("MA", "cannot cache", e);
destFile.delete();
throw e;
} finally {
if (src != null) {
try {
src.close();
} catch (IOException e) {
}
}
if (dest != null) {
try {
dest.close();
} catch (IOException e) {
}
}
}
}
private String randomName() {
byte[] buffer = new byte[32];
new Random().nextBytes(buffer);
StringBuilder sb = new StringBuilder();
try {
for (byte b : MessageDigest.getInstance("MD5").digest(buffer)) {
sb.append(Integer.toHexString(((int)b) & 0xff));
}
return sb.toString();
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
private File root() {
return getExternalFilesDir(null);
}
}
}
}
| taky/ray | src/com/gmail/altakey/ray/EnqueueActivity.java | Java | gpl-3.0 | 10,120 | [
30522,
7427,
4012,
1012,
20917,
4014,
1012,
23647,
14839,
1012,
4097,
1025,
12324,
11924,
1012,
10439,
1012,
4023,
1025,
12324,
11924,
1012,
9808,
1012,
14012,
1025,
12324,
11924,
1012,
9808,
1012,
20463,
3085,
1025,
12324,
11924,
1012,
5658,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular-multi-select-tree
=============================
A native Angular multi select tree. No JQuery.

#### Demo Page:
[Demo] (http://htmlpreview.github.io/?https://github.com/kjvelarde/angular-multiselectsearchtree/blob/master/demo/index.html)
#### Features:
Very Easy to Use:
- Plug and Play component
- Tree List
- Databind
- Filter/NoFilter by search textbox
- Checkbox
- Select one only or Multiselect
- NO JQuery
#### Design details:
Custom element using Angular Directive and Templating
#### Callbacks:
This is your onchange :)
##### Usage:
Get this awesome component to your project by:
```sh
bower install kjvelarde-angular-multiselectsearchtree --save
# bower install long name ehhfsaduasdu lol . just kidding use the first one :)
```
Make sure to load the scripts in your html.
```html
<link rel="stylesheet" href="../dist/kjvelarde-multiselect-searchtree.min.css">
<script type="text/javascript" src="../dist/angular-multi-select-tree.min.js"></script>
<script type="text/javascript" src="../dist/angular-multi-select-tree.tpl.js"></script>
```
And Inject the module as dependency to your angular app.
```
angular.module('[YOURAPPNAMEHERE!]', ['multiselect-searchtree', '....']);
```
###### Html Structure:
```html
<multiselect-searchtree
multi-select="true"
data-input-model="data"
data-output-model="selectedItem2"
data-callback="CustomCallback(item, selectedItems)"
data-select-only-leafs="true">
</multiselect-searchtree>
```
That's what all you have to do.
##### License
MIT, see [LICENSE.md](./LICENSE.md).
| kjvelarde/angular-multiselectsearchtree | README.md | Markdown | mit | 1,739 | [
30522,
16108,
1011,
4800,
1011,
7276,
1011,
3392,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1037,
3128,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.vimeo.sample_java_model;
import com.vimeo.stag.UseStag;
/**
* Model which references a generically typed object without generic bounds (i.e., as a raw
* type).
*/
@UseStag
public class RawGenericField {
@SuppressWarnings("rawtypes")
public ExternalModelGeneric rawTypedField;
}
| Flipkart/stag-java | integration-test-java/src/main/java/com/vimeo/sample_java_model/RawGenericField.java | Java | mit | 305 | [
30522,
7427,
4012,
1012,
6819,
26247,
1012,
7099,
1035,
9262,
1035,
2944,
1025,
12324,
4012,
1012,
6819,
26247,
1012,
2358,
8490,
1012,
3594,
15900,
1025,
1013,
1008,
1008,
1008,
2944,
2029,
7604,
1037,
12391,
3973,
21189,
4874,
2302,
12391... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2014 TIBCO Software Inc. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is part of JasperReports.
*
* JasperReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JasperReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.jasperreports.engine.virtualization;
import java.io.IOException;
/**
* @author Lucian Chirita (lucianc@users.sourceforge.net)
*/
public class FloatSerializer implements ObjectSerializer<Float>
{
@Override
public int typeValue()
{
return SerializationConstants.OBJECT_TYPE_FLOAT;
}
@Override
public ReferenceType defaultReferenceType()
{
return ReferenceType.OBJECT;
}
@Override
public boolean defaultStoreReference()
{
return true;
}
@Override
public void write(Float value, VirtualizationOutput out) throws IOException
{
out.writeFloat(value);
}
@Override
public Float read(VirtualizationInput in) throws IOException
{
return in.readFloat();
}
} | aleatorio12/ProVentasConnector | jasperreports-6.2.1-project/jasperreports-6.2.1/src/net/sf/jasperreports/engine/virtualization/FloatSerializer.java | Java | gpl-3.0 | 1,687 | [
30522,
1013,
1008,
1008,
14791,
2890,
25378,
1011,
2489,
9262,
7316,
3075,
1012,
1008,
9385,
1006,
1039,
1007,
2541,
1011,
2297,
14841,
9818,
2080,
4007,
4297,
1012,
2035,
2916,
9235,
1012,
1008,
8299,
1024,
1013,
1013,
7479,
1012,
14791,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright 2013, KISSY UI Library v1.30
MIT Licensed
build time: Jul 1 20:13
*/
var KISSY=function(a){var b=this,i,k=0;i={__BUILD_TIME:"20130701201313",Env:{host:b,nodejs:"function"==typeof require&&"object"==typeof exports},Config:{debug:"",fns:{}},version:"1.30",config:function(b,j){var l,e,f=this,d,h=i.Config,c=h.fns;i.isObject(b)?i.each(b,function(m,a){(d=c[a])?d.call(f,m):h[a]=m}):(l=c[b],j===a?e=l?l.call(f):h[b]:l?e=l.call(f,j):h[b]=j);return e},log:function(g,j,l){if(i.Config.debug&&(l&&(g=l+": "+g),b.console!==a&&console.log))console[j&&console[j]?j:"log"](g)},
error:function(a){if(i.Config.debug)throw a instanceof Error?a:Error(a);},guid:function(a){return(a||"")+k++}};i.Env.nodejs&&(i.KISSY=i,module.exports=i);return i}();
(function(a,b){function i(){}function k(c,a){var b;d?b=d(c):(i.prototype=c,b=new i);b.constructor=a;return b}function g(c,d,h,e,g,i){if(!d||!c)return c;h===b&&(h=f);var k=0,s,u,v;d[l]=c;i.push(d);if(e){v=e.length;for(k=0;k<v;k++)s=e[k],s in d&&j(s,c,d,h,e,g,i)}else{u=a.keys(d);v=u.length;for(k=0;k<v;k++)s=u[k],s!=l&&j(s,c,d,h,e,g,i)}return c}function j(c,d,h,e,j,i,k){if(e||!(c in d)||i){var s=d[c],h=h[c];if(s===h)s===b&&(d[c]=s);else if(i&&h&&(a.isArray(h)||a.isPlainObject(h)))h[l]?d[c]=h[l]:(i=s&&
(a.isArray(s)||a.isPlainObject(s))?s:a.isArray(h)?[]:{},d[c]=i,g(i,h,e,j,f,k));else if(h!==b&&(e||!(c in d)))d[c]=h}}var l="__MIX_CIRCULAR",e=this,f=!0,d=Object.create,h=!{toString:1}.propertyIsEnumerable("toString"),c="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toString,toLocaleString,valueOf".split(",");(function(c,a){for(var d in a)c[d]=a[d]})(a,{stamp:function(c,d,h){if(!c)return c;var h=h||"__~ks_stamped",f=c[h];if(!f&&!d)try{f=c[h]=a.guid(h)}catch(e){f=b}return f},keys:function(a){var d=
[],b,f;for(b in a)d.push(b);if(h)for(f=c.length-1;0<=f;f--)b=c[f],a.hasOwnProperty(b)&&d.push(b);return d},mix:function(c,a,d,b,h){"object"===typeof d&&(b=d.whitelist,h=d.deep,d=d.overwrite);var f=[],e=0;for(g(c,a,d,b,h,f);a=f[e++];)delete a[l];return c},merge:function(c){var c=a.makeArray(arguments),d={},b,h=c.length;for(b=0;b<h;b++)a.mix(d,c[b]);return d},augment:function(c,d){var h=a.makeArray(arguments),f=h.length-2,e=1,j=h[f],g=h[f+1];a.isArray(g)||(j=g,g=b,f++);a.isBoolean(j)||(j=b,f++);for(;e<
f;e++)a.mix(c.prototype,h[e].prototype||h[e],j,g);return c},extend:function(c,d,b,h){if(!d||!c)return c;var f=d.prototype,e;e=k(f,c);c.prototype=a.mix(e,c.prototype);c.superclass=k(f,d);b&&a.mix(e,b);h&&a.mix(c,h);return c},namespace:function(){var c=a.makeArray(arguments),d=c.length,b=null,h,j,g,i=c[d-1]===f&&d--;for(h=0;h<d;h++){g=(""+c[h]).split(".");b=i?e:this;for(j=e[g[0]]===b?1:0;j<g.length;++j)b=b[g[j]]=b[g[j]]||{}}return b}})})(KISSY);
(function(a,b){var i=Array.prototype,k=i.indexOf,g=i.lastIndexOf,j=i.filter,l=i.every,e=i.some,f=i.map;a.mix(a,{each:function(d,h,c){if(d){var m,f,e=0;m=d&&d.length;f=m===b||"function"===a.type(d);c=c||null;if(f)for(f=a.keys(d);e<f.length&&!(m=f[e],!1===h.call(c,d[m],m,d));e++);else for(f=d[0];e<m&&!1!==h.call(c,f,e,d);f=d[++e]);}return d},indexOf:k?function(d,a){return k.call(a,d)}:function(d,a){for(var c=0,b=a.length;c<b;++c)if(a[c]===d)return c;return-1},lastIndexOf:g?function(d,a){return g.call(a,
d)}:function(d,a){for(var c=a.length-1;0<=c&&a[c]!==d;c--);return c},unique:function(d,b){var c=d.slice();b&&c.reverse();for(var m=0,f,e;m<c.length;){for(e=c[m];(f=a.lastIndexOf(e,c))!==m;)c.splice(f,1);m+=1}b&&c.reverse();return c},inArray:function(d,b){return-1<a.indexOf(d,b)},filter:j?function(d,a,c){return j.call(d,a,c||this)}:function(d,b,c){var m=[];a.each(d,function(d,a,f){b.call(c||this,d,a,f)&&m.push(d)});return m},map:f?function(d,a,c){return f.call(d,a,c||this)}:function(d,a,c){for(var b=
d.length,f=Array(b),e=0;e<b;e++){var j="string"==typeof d?d.charAt(e):d[e];if(j||e in d)f[e]=a.call(c||this,j,e,d)}return f},reduce:function(a,f,c){var m=a.length;if("function"!==typeof f)throw new TypeError("callback is not function!");if(0===m&&2==arguments.length)throw new TypeError("arguments invalid");var e=0,j;if(3<=arguments.length)j=arguments[2];else{do{if(e in a){j=a[e++];break}e+=1;if(e>=m)throw new TypeError;}while(1)}for(;e<m;)e in a&&(j=f.call(b,j,a[e],e,a)),e++;return j},every:l?function(a,
b,c){return l.call(a,b,c||this)}:function(a,b,c){for(var f=a&&a.length||0,e=0;e<f;e++)if(e in a&&!b.call(c,a[e],e,a))return!1;return!0},some:e?function(a,b,c){return e.call(a,b,c||this)}:function(a,b,c){for(var f=a&&a.length||0,e=0;e<f;e++)if(e in a&&b.call(c,a[e],e,a))return!0;return!1},makeArray:function(d){if(null==d)return[];if(a.isArray(d))return d;if("number"!==typeof d.length||d.alert||"string"==typeof d||a.isFunction(d))return[d];for(var b=[],c=0,f=d.length;c<f;c++)b[c]=d[c];return b}})})(KISSY);
(function(a,b){function i(c){var a=typeof c;return null==c||"object"!==a&&"function"!==a}function k(){if(f)return f;var c=j;a.each(l,function(a){c+=a+"|"});c=c.slice(0,-1);return f=RegExp(c,"g")}function g(){if(d)return d;var c=j;a.each(e,function(a){c+=a+"|"});c+="&#(\\d{1,5});";return d=RegExp(c,"g")}var j="",l={"&":"&",">":">","<":"<","`":"`","/":"/",""":'"',"'":"'"},e={},f,d,h=/[\-#$\^*()+\[\]{}|\\,.?\s]/g;(function(){for(var c in l)e[l[c]]=c})();a.mix(a,{urlEncode:function(c){return encodeURIComponent(""+
c)},urlDecode:function(c){return decodeURIComponent(c.replace(/\+/g," "))},fromUnicode:function(c){return c.replace(/\\u([a-f\d]{4})/ig,function(c,a){return String.fromCharCode(parseInt(a,16))})},escapeHTML:function(c){return(c+"").replace(k(),function(c){return e[c]})},escapeRegExp:function(c){return c.replace(h,"\\$&")},unEscapeHTML:function(c){return c.replace(g(),function(c,a){return l[c]||String.fromCharCode(+a)})},param:function(c,d,f,e){if(!a.isPlainObject(c))return j;d=d||"&";f=f||"=";a.isUndefined(e)&&
(e=!0);var h=[],g,l,k,s,u,v=a.urlEncode;for(g in c)if(u=c[g],g=v(g),i(u))h.push(g),u!==b&&h.push(f,v(u+j)),h.push(d);else if(a.isArray(u)&&u.length){l=0;for(s=u.length;l<s;++l)k=u[l],i(k)&&(h.push(g,e?v("[]"):j),k!==b&&h.push(f,v(k+j)),h.push(d))}h.pop();return h.join(j)},unparam:function(c,d,f){if("string"!=typeof c||!(c=a.trim(c)))return{};for(var f=f||"=",e={},h,j=a.urlDecode,c=c.split(d||"&"),g=0,i=c.length;g<i;++g){h=c[g].indexOf(f);if(-1==h)d=j(c[g]),h=b;else{d=j(c[g].substring(0,h));h=c[g].substring(h+
1);try{h=j(h)}catch(l){}a.endsWith(d,"[]")&&(d=d.substring(0,d.length-2))}d in e?a.isArray(e[d])?e[d].push(h):e[d]=[e[d],h]:e[d]=h}return e}})})(KISSY);
(function(a){function b(a,b,g){var j=[].slice,l=j.call(arguments,3),e=function(){},f=function(){var d=j.call(arguments);return b.apply(this instanceof e?this:g,a?d.concat(l):l.concat(d))};e.prototype=b.prototype;f.prototype=new e;return f}a.mix(a,{noop:function(){},bind:b(0,b,null,0),rbind:b(0,b,null,1),later:function(b,k,g,j,l){var k=k||0,e=b,f=a.makeArray(l),d;"string"==typeof b&&(e=j[b]);b=function(){e.apply(j,f)};d=g?setInterval(b,k):setTimeout(b,k);return{id:d,interval:g,cancel:function(){this.interval?
clearInterval(d):clearTimeout(d)}}},throttle:function(b,k,g){k=k||150;if(-1===k)return function(){b.apply(g||this,arguments)};var j=a.now();return function(){var l=a.now();l-j>k&&(j=l,b.apply(g||this,arguments))}},buffer:function(b,k,g){function j(){j.stop();l=a.later(b,k,0,g||this,arguments)}k=k||150;if(-1===k)return function(){b.apply(g||this,arguments)};var l=null;j.stop=function(){l&&(l.cancel(),l=0)};return j}})})(KISSY);
(function(a,b){function i(b,d,e){var c=b,m,n,g,o;if(!b)return c;if(b[l])return e[b[l]].destination;if("object"===typeof b){o=b.constructor;if(a.inArray(o,[Boolean,String,Number,Date,RegExp]))c=new o(b.valueOf());else if(m=a.isArray(b))c=d?a.filter(b,d):b.concat();else if(n=a.isPlainObject(b))c={};b[l]=o=a.guid();e[o]={destination:c,input:b}}if(m)for(b=0;b<c.length;b++)c[b]=i(c[b],d,e);else if(n)for(g in b)if(g!==l&&(!d||d.call(b,b[g],g,b)!==j))c[g]=i(b[g],d,e);return c}function k(f,d,h,c){if(f[e]===
d&&d[e]===f)return g;f[e]=d;d[e]=f;var m=function(c,a){return null!==c&&c!==b&&c[a]!==b},n;for(n in d)!m(f,n)&&m(d,n)&&h.push("expected has key '"+n+"', but missing from actual.");for(n in f)!m(d,n)&&m(f,n)&&h.push("expected missing key '"+n+"', but present in actual.");for(n in d)n!=e&&(a.equals(f[n],d[n],h,c)||c.push("'"+n+"' was '"+(d[n]?d[n].toString():d[n])+"' in expected, but was '"+(f[n]?f[n].toString():f[n])+"' in actual."));a.isArray(f)&&a.isArray(d)&&f.length!=d.length&&c.push("arrays were not the same length");
delete f[e];delete d[e];return 0===h.length&&0===c.length}var g=!0,j=!1,l="__~ks_cloned",e="__~ks_compared";a.mix(a,{equals:function(e,d,h,c){h=h||[];c=c||[];return e===d?g:e===b||null===e||d===b||null===d?null==e&&null==d:e instanceof Date&&d instanceof Date?e.getTime()==d.getTime():"string"==typeof e&&"string"==typeof d||a.isNumber(e)&&a.isNumber(d)?e==d:"object"===typeof e&&"object"===typeof d?k(e,d,h,c):e===d},clone:function(e,d){var h={},c=i(e,d,h);a.each(h,function(c){c=c.input;if(c[l])try{delete c[l]}catch(a){c[l]=
b}});h=null;return c},now:Date.now||function(){return+new Date}})})(KISSY);
(function(a,b){var i=/^[\s\xa0]+|[\s\xa0]+$/g,k=String.prototype.trim,g=/\\?\{([^{}]+)\}/g;a.mix(a,{trim:k?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(i,"")},substitute:function(a,i,e){return"string"!=typeof a||!i?a:a.replace(e||g,function(a,d){return"\\"===a.charAt(0)?a.slice(1):i[d]===b?"":i[d]})},ucfirst:function(a){a+="";return a.charAt(0).toUpperCase()+a.substring(1)},startsWith:function(a,b){return 0===a.lastIndexOf(b,0)},endsWith:function(a,b){var e=
a.length-b.length;return 0<=e&&a.indexOf(b,e)==e}})})(KISSY);
(function(a,b){var i={},k=Object.prototype.toString;a.mix(a,{isBoolean:0,isNumber:0,isString:0,isFunction:0,isArray:0,isDate:0,isRegExp:0,isObject:0,type:function(a){return null==a?""+a:i[k.call(a)]||"object"},isNull:function(a){return null===a},isUndefined:function(a){return a===b},isEmptyObject:function(a){for(var j in a)if(j!==b)return!1;return!0},isPlainObject:function(g){if(!g||"object"!==a.type(g)||g.nodeType||g.window==g)return!1;try{if(g.constructor&&!Object.prototype.hasOwnProperty.call(g,
"constructor")&&!Object.prototype.hasOwnProperty.call(g.constructor.prototype,"isPrototypeOf"))return!1}catch(j){return!1}for(var i in g);return i===b||Object.prototype.hasOwnProperty.call(g,i)}});a.each("Boolean,Number,String,Function,Array,Date,RegExp,Object".split(","),function(b,j){i["[object "+b+"]"]=j=b.toLowerCase();a["is"+b]=function(b){return a.type(b)==j}})})(KISSY);
(function(a,b){function i(a,d,e){if(a instanceof l)return e(a[h]);var f=a[h];if(a=a[c])a.push([d,e]);else if(g(f))i(f,d,e);else return d&&d(f);return b}function k(a){if(!(this instanceof k))return new k(a);this.promise=a||new j}function g(a){return a&&a instanceof j}function j(a){this[h]=a;a===b&&(this[c]=[])}function l(a){if(a instanceof l)return a;j.apply(this,arguments);return b}function e(a,c,b){function d(a){try{return c?c(a):a}catch(b){return new l(b)}}function e(a){try{return b?b(a):new l(a)}catch(c){return new l(c)}}
function h(a){g||(g=1,f.resolve(d(a)))}var f=new k,g=0;a instanceof j?i(a,h,function(a){g||(g=1,f.resolve(e(a)))}):h(a);return f.promise}function f(a){return!d(a)&&g(a)&&a[c]===b&&(!g(a[h])||f(a[h]))}function d(a){return g(a)&&a[c]===b&&a[h]instanceof l}var h="__promise_value",c="__promise_pendings";k.prototype={constructor:k,resolve:function(d){var e=this.promise,f;if(!(f=e[c]))return b;e[h]=d;f=[].concat(f);e[c]=b;a.each(f,function(a){i(e,a[0],a[1])});return d},reject:function(a){return this.resolve(new l(a))}};
j.prototype={constructor:j,then:function(a,c){return e(this,a,c)},fail:function(a){return e(this,0,a)},fin:function(a){return e(this,function(c){return a(c,!0)},function(c){return a(c,!1)})},isResolved:function(){return f(this)},isRejected:function(){return d(this)}};a.extend(l,j);KISSY.Defer=k;KISSY.Promise=j;j.Defer=k;a.mix(j,{when:e,isPromise:g,isResolved:f,isRejected:d,all:function(a){var c=a.length;if(!c)return a;for(var b=k(),d=0;d<a.length;d++)(function(d,h){e(d,function(d){a[h]=d;0===--c&&
b.resolve(a)},function(a){b.reject(a)})})(a[d],d);return b.promise}})})(KISSY);
(function(a){function b(a,b){for(var i=0,e=a.length-1,f=[],d;0<=e;e--)d=a[e],"."!=d&&(".."===d?i++:i?i--:f[f.length]=d);if(b)for(;i--;i)f[f.length]="..";return f=f.reverse()}var i=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,k={resolve:function(){var g="",j,i=arguments,e,f=0;for(j=i.length-1;0<=j&&!f;j--)e=i[j],"string"==typeof e&&e&&(g=e+"/"+g,f="/"==e.charAt(0));g=b(a.filter(g.split("/"),function(a){return!!a}),!f).join("/");return(f?"/":"")+g||"."},normalize:function(g){var j=
"/"==g.charAt(0),i="/"==g.slice(-1),g=b(a.filter(g.split("/"),function(a){return!!a}),!j).join("/");!g&&!j&&(g=".");g&&i&&(g+="/");return(j?"/":"")+g},join:function(){var b=a.makeArray(arguments);return k.normalize(a.filter(b,function(a){return a&&"string"==typeof a}).join("/"))},relative:function(b,j){var b=k.normalize(b),j=k.normalize(j),i=a.filter(b.split("/"),function(a){return!!a}),e=[],f,d,h=a.filter(j.split("/"),function(a){return!!a});d=Math.min(i.length,h.length);for(f=0;f<d&&i[f]==h[f];f++);
for(d=f;f<i.length;)e.push(".."),f++;e=e.concat(h.slice(d));return e=e.join("/")},basename:function(a,b){var k;k=(a.match(i)||[])[3]||"";b&&k&&k.slice(-1*b.length)==b&&(k=k.slice(0,-1*b.length));return k},dirname:function(a){var b=a.match(i)||[],a=b[1]||"",b=b[2]||"";if(!a&&!b)return".";b&&(b=b.substring(0,b.length-1));return a+b},extname:function(a){return(a.match(i)||[])[4]||""}};a.Path=k})(KISSY);
(function(a,b){function i(c){c._queryMap||(c._queryMap=a.unparam(c._query))}function k(a){this._query=a||""}function g(a,c){return encodeURI(a).replace(c,function(a){a=a.charCodeAt(0).toString(16);return"%"+(1==a.length?"0"+a:a)})}function j(c){if(c instanceof j)return c.clone();var b=this;a.mix(b,{scheme:"",userInfo:"",hostname:"",port:"",path:"",query:"",fragment:""});c=j.getComponents(c);a.each(c,function(c,d){c=c||"";if("query"==d)b.query=new k(c);else{try{c=a.urlDecode(c)}catch(e){}b[d]=c}});
return b}var l=/[#\/\?@]/g,e=/[#\?]/g,f=/[#@]/g,d=/#/g,h=RegExp("^(?:([\\w\\d+.-]+):)?(?://(?:([^/?#@]*)@)?([\\w\\d\\-\\u0100-\\uffff.+%]*|\\[[^\\]]+\\])(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),c=a.Path,m={scheme:1,userInfo:2,hostname:3,port:4,path:5,query:6,fragment:7};k.prototype={constructor:k,clone:function(){return new k(this.toString())},reset:function(a){this._query=a||"";this._queryMap=null;return this},count:function(){var c,b=0,d;i(this);c=this._queryMap;for(d in c)a.isArray(c[d])?
b+=c[d].length:b++;return b},has:function(c){var b;i(this);b=this._queryMap;return c?c in b:!a.isEmptyObject(b)},get:function(a){var c;i(this);c=this._queryMap;return a?c[a]:c},keys:function(){i(this);return a.keys(this._queryMap)},set:function(c,b){var d;i(this);d=this._queryMap;"string"==typeof c?this._queryMap[c]=b:(c instanceof k&&(c=c.get()),a.each(c,function(a,c){d[c]=a}));return this},remove:function(a){i(this);a?delete this._queryMap[a]:this._queryMap={};return this},add:function(c,d){var e=
this,h,f;a.isObject(c)?(c instanceof k&&(c=c.get()),a.each(c,function(a,c){e.add(c,a)})):(i(e),h=e._queryMap,f=h[c],f=f===b?d:[].concat(f).concat(d),h[c]=f);return e},toString:function(c){i(this);return a.param(this._queryMap,b,b,c)}};j.prototype={constructor:j,clone:function(){var c=new j,b=this;a.each(m,function(a,d){c[d]=b[d]});c.query=c.query.clone();return c},resolve:function(b){"string"==typeof b&&(b=new j(b));var d=0,e,h=this.clone();a.each("scheme,userInfo,hostname,port,path,query,fragment".split(","),
function(f){if(f=="path")if(d)h[f]=b[f];else{if(f=b.path){d=1;if(!a.startsWith(f,"/"))if(h.hostname&&!h.path)f="/"+f;else if(h.path){e=h.path.lastIndexOf("/");e!=-1&&(f=h.path.slice(0,e+1)+f)}h.path=c.normalize(f)}}else if(f=="query"){if(d||b.query.toString()){h.query=b.query.clone();d=1}}else if(d||b[f]){h[f]=b[f];d=1}});return h},getScheme:function(){return this.scheme},setScheme:function(a){this.scheme=a;return this},getHostname:function(){return this.hostname},setHostname:function(a){this.hostname=
a;return this},setUserInfo:function(a){this.userInfo=a;return this},getUserInfo:function(){return this.userInfo},setPort:function(a){this.port=a;return this},getPort:function(){return this.port},setPath:function(a){this.path=a;return this},getPath:function(){return this.path},setQuery:function(c){"string"==typeof c&&(a.startsWith(c,"?")&&(c=c.slice(1)),c=new k(g(c,f)));this.query=c;return this},getQuery:function(){return this.query},getFragment:function(){return this.fragment},setFragment:function(c){a.startsWith(c,
"#")&&(c=c.slice(1));this.fragment=c;return this},isSameOriginAs:function(a){return this.hostname.toLowerCase()==a.hostname.toLowerCase()&&this.scheme.toLowerCase()==a.scheme.toLowerCase()&&this.port.toLowerCase()==a.port.toLowerCase()},toString:function(b){var h=[],f,m;if(f=this.scheme)h.push(g(f,l)),h.push(":");if(f=this.hostname){h.push("//");if(m=this.userInfo)h.push(g(m,l)),h.push("@");h.push(encodeURIComponent(f));if(m=this.port)h.push(":"),h.push(m)}if(m=this.path)f&&!a.startsWith(m,"/")&&
(m="/"+m),m=c.normalize(m),h.push(g(m,e));if(b=this.query.toString.call(this.query,b))h.push("?"),h.push(b);if(b=this.fragment)h.push("#"),h.push(g(b,d));return h.join("")}};j.Query=k;j.getComponents=function(c){var b=(c||"").match(h)||[],d={};a.each(m,function(a,c){d[c]=b[a]});return d};a.Uri=j})(KISSY);
(function(a,b){function i(a){var c;return(c=a.match(/MSIE\s([^;]*)/))&&c[1]?n(c[1]):0}var k=a.Env.host,g=k.document,k=(k=k.navigator)&&k.userAgent||"",j,l="",e="",f,d=[6,9],h=g&&g.createElement("div"),c=[],m=KISSY.UA={webkit:b,trident:b,gecko:b,presto:b,chrome:b,safari:b,firefox:b,ie:b,opera:b,mobile:b,core:b,shell:b,phantomjs:b,os:b,ipad:b,iphone:b,ipod:b,ios:b,android:b,nodejs:b},n=function(a){var c=0;return parseFloat(a.replace(/\./g,function(){return 0===c++?".":""}))};h&&(h.innerHTML="<\!--[if IE {{version}}]><s></s><![endif]--\>".replace("{{version}}",
""),c=h.getElementsByTagName("s"));if(0<c.length){e="ie";m[l="trident"]=0.1;if((f=k.match(/Trident\/([\d.]*)/))&&f[1])m[l]=n(f[1]);f=d[0];for(d=d[1];f<=d;f++)if(h.innerHTML="<\!--[if IE {{version}}]><s></s><![endif]--\>".replace("{{version}}",f),0<c.length){m[e]=f;break}var p;if(!m.ie&&(p=i(k)))m[e="ie"]=p}else if((f=k.match(/AppleWebKit\/([\d.]*)/))&&f[1]){m[l="webkit"]=n(f[1]);if((f=k.match(/Chrome\/([\d.]*)/))&&f[1])m[e="chrome"]=n(f[1]);else if((f=k.match(/\/([\d.]*) Safari/))&&f[1])m[e="safari"]=
n(f[1]);if(/ Mobile\//.test(k)&&k.match(/iPad|iPod|iPhone/)){m.mobile="apple";if((f=k.match(/OS ([^\s]*)/))&&f[1])m.ios=n(f[1].replace("_","."));j="ios";if((f=k.match(/iPad|iPod|iPhone/))&&f[0])m[f[0].toLowerCase()]=m.ios}else if(/ Android/.test(k)){if(/Mobile/.test(k)&&(j=m.mobile="android"),(f=k.match(/Android ([^\s]*);/))&&f[1])m.android=n(f[1])}else if(f=k.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))m.mobile=f[0].toLowerCase();if((f=k.match(/PhantomJS\/([^\s]*)/))&&f[1])m.phantomjs=n(f[1])}else if((f=
k.match(/Presto\/([\d.]*)/))&&f[1]){if(m[l="presto"]=n(f[1]),(f=k.match(/Opera\/([\d.]*)/))&&f[1]){m[e="opera"]=n(f[1]);if((f=k.match(/Opera\/.* Version\/([\d.]*)/))&&f[1])m[e]=n(f[1]);if((f=k.match(/Opera Mini[^;]*/))&&f)m.mobile=f[0].toLowerCase();else if((f=k.match(/Opera Mobi[^;]*/))&&f)m.mobile=f[0]}}else if((f=k.match(/MSIE\s([^;]*)/))&&f[1]){if(m[l="trident"]=0.1,m[e="ie"]=n(f[1]),(f=k.match(/Trident\/([\d.]*)/))&&f[1])m[l]=n(f[1])}else if(f=k.match(/Gecko/)){m[l="gecko"]=0.1;if((f=k.match(/rv:([\d.]*)/))&&
f[1])m[l]=n(f[1]);if((f=k.match(/Firefox\/([\d.]*)/))&&f[1])m[e="firefox"]=n(f[1])}j||(/windows|win32/i.test(k)?j="windows":/macintosh|mac_powerpc/i.test(k)?j="macintosh":/linux/i.test(k)?j="linux":/rhino/i.test(k)&&(j="rhino"));if("object"===typeof process){var o,q;if((o=process.versions)&&(q=o.node))j=process.platform,m.nodejs=n(q)}m.os=j;m.core=l;m.shell=e;m._numberify=n;j="webkit,trident,gecko,presto,chrome,safari,firefox,ie,opera".split(",");var g=g&&g.documentElement,r="";g&&(a.each(j,function(a){var c=
m[a];if(c){r=r+(" ks-"+a+(parseInt(c)+""));r=r+(" ks-"+a)}}),a.trim(r)&&(g.className=a.trim(g.className+r)))})(KISSY);(function(a){var b=a.Env,i=b.host,k=a.UA,g=i.document||{},j="ontouchstart"in g&&!k.phantomjs,l=(g=g.documentMode)||k.ie,e=(b.nodejs&&"object"===typeof global?global:i).JSON;g&&9>g&&(e=0);a.Features={isTouchSupported:function(){return j},isDeviceMotionSupported:function(){return!!i.DeviceMotionEvent},isHashChangeSupported:function(){return"onhashchange"in i&&(!l||7<l)},isNativeJSONSupported:function(){return e}}})(KISSY);
(function(a){function b(a){this.runtime=a}b.Status={INIT:0,LOADING:1,LOADED:2,ERROR:3,ATTACHED:4};a.Loader=b;a.Loader.Status=b.Status})(KISSY);
(function(a){function b(a,b,j){a=a[i]||(a[i]={});j&&(a[b]=a[b]||[]);return a[b]}a.namespace("Loader");var i="__events__"+a.now();KISSY.Loader.Target={on:function(a,g){b(this,a,1).push(g)},detach:function(k,g){var j,l;if(k){if(j=b(this,k))g&&(l=a.indexOf(g,j),-1!=l&&j.splice(l,1)),(!g||!j.length)&&delete (this[i]||(this[i]={}))[k]}else delete this[i]},fire:function(a,g){var j=b(this,a)||[],i,e=j.length;for(i=0;i<e;i++)j[i].call(null,g)}}})(KISSY);
(function(a){function b(a){if("string"==typeof a)return i(a);for(var c=[],b=0,d=a.length;b<d;b++)c[b]=i(a[b]);return c}function i(a){"/"==a.charAt(a.length-1)&&(a+="index");return a}function k(c,b,d){var c=c.Env.mods,e,h,b=a.makeArray(b);for(h=0;h<b.length;h++)if(e=c[b[h]],!e||e.status!==d)return 0;return 1}var g=a.Loader,j=a.Path,l=a.Env.host,e=a.startsWith,f=g.Status,d=f.ATTACHED,h=f.LOADED,c=a.Loader.Utils={},m=l.document;a.mix(c,{docHead:function(){return m.getElementsByTagName("head")[0]||m.documentElement},
normalDepModuleName:function(a,b){var d=0,h;if(!b)return b;if("string"==typeof b)return e(b,"../")||e(b,"./")?j.resolve(j.dirname(a),b):j.normalize(b);for(h=b.length;d<h;d++)b[d]=c.normalDepModuleName(a,b[d]);return b},createModulesInfo:function(b,d){a.each(d,function(a){c.createModuleInfo(b,a)})},createModuleInfo:function(c,b,d){var b=i(b),e=c.Env.mods,h=e[b];return h?h:e[b]=h=new g.Module(a.mix({name:b,runtime:c},d))},isAttached:function(a,c){return k(a,c,d)},isLoaded:function(a,c){return k(a,c,
h)},getModules:function(b,e){var h=[b],f,m,g,j,i=b.Env.mods;a.each(e,function(e){f=i[e];if(!f||"css"!=f.getType())m=c.unalias(b,e),(g=a.reduce(m,function(a,c){j=i[c];return a&&j&&j.status==d},!0))?h.push(i[m[0]].value):h.push(null)});return h},attachModsRecursively:function(a,b,d){var d=d||[],e,h=1,f=a.length,m=d.length;for(e=0;e<f;e++)h=c.attachModRecursively(a[e],b,d)&&h,d.length=m;return h},attachModRecursively:function(b,e,f){var m,g=e.Env.mods[b];if(!g)return 0;m=g.status;if(m==d)return 1;if(m!=
h)return 0;if(a.Config.debug){if(a.inArray(b,f))return f.push(b),0;f.push(b)}return c.attachModsRecursively(g.getNormalizedRequires(),e,f)?(c.attachMod(e,g),1):0},attachMod:function(a,b){if(b.status==h){var e=b.fn;e&&(b.value=e.apply(b,c.getModules(a,b.getRequiresWithAlias())));b.status=d;a.getLoader().fire("afterModAttached",{mod:b})}},getModNamesAsArray:function(a){"string"==typeof a&&(a=a.replace(/\s+/g,"").split(","));return a},normalizeModNames:function(a,b,d){return c.unalias(a,c.normalizeModNamesWithAlias(a,
b,d))},unalias:function(a,c){for(var d=[].concat(c),e,h,f,m=0,g,j=a.Env.mods;!m;){m=1;for(e=d.length-1;0<=e;e--)if((h=j[d[e]])&&(f=h.alias)){m=0;for(g=f.length-1;0<=g;g--)f[g]||f.splice(g,1);d.splice.apply(d,[e,1].concat(b(f)))}}return d},normalizeModNamesWithAlias:function(a,d,e){var a=[],h,f;if(d){h=0;for(f=d.length;h<f;h++)d[h]&&a.push(b(d[h]))}e&&(a=c.normalDepModuleName(e,a));return a},registerModule:function(b,d,e,f){var m=b.Env.mods,g=m[d];if(!g||!g.fn)c.createModuleInfo(b,d),g=m[d],a.mix(g,
{name:d,status:h,fn:e}),a.mix(g,f)},getMappedPath:function(a,c,b){for(var a=b||a.Config.mappedRules||[],d,b=0;b<a.length;b++)if(d=a[b],c.match(d[0]))return c.replace(d[0],d[1]);return c}})})(KISSY);
(function(a){function b(a,b){return b in a?a[b]:a.runtime.Config[b]}function i(b){a.mix(this,b)}function k(b){this.status=j.Status.INIT;a.mix(this,b)}var g=a.Path,j=a.Loader,l=j.Utils;a.augment(i,{getTag:function(){return b(this,"tag")},getName:function(){return this.name},getBase:function(){return b(this,"base")},getPrefixUriForCombo:function(){var a=this.getName();return this.getBase()+(a&&!this.isIgnorePackageNameInUri()?a+"/":"")},getBaseUri:function(){return b(this,"baseUri")},isDebug:function(){return b(this,
"debug")},isIgnorePackageNameInUri:function(){return b(this,"ignorePackageNameInUri")},getCharset:function(){return b(this,"charset")},isCombine:function(){return b(this,"combine")}});j.Package=i;a.augment(k,{setValue:function(a){this.value=a},getType:function(){var a=this.type;a||(this.type=a=".css"==g.extname(this.name).toLowerCase()?"css":"js");return a},getFullPath:function(){var a,b,d,h,c;if(!this.fullpath){d=this.getPackage();b=d.getBaseUri();c=this.getPath();if(d.isIgnorePackageNameInUri()&&
(h=d.getName()))c=g.relative(h,c);b=b.resolve(c);(a=this.getTag())&&b.query.set("t",a);this.fullpath=l.getMappedPath(this.runtime,b.toString())}return this.fullpath},getPath:function(){var a;if(!(a=this.path)){a=this.name;var b="."+this.getType(),d="-min";a=g.join(g.dirname(a),g.basename(a,b));this.getPackage().isDebug()&&(d="");a=this.path=a+d+b}return a},getValue:function(){return this.value},getName:function(){return this.name},getPackage:function(){var b;if(!(b=this.packageInfo)){b=this.runtime;
var f=this.name,d=b.config("packages"),h="",c;for(c in d)a.startsWith(f,c)&&c.length>h.length&&(h=c);b=this.packageInfo=d[h]||b.config("systemPackage")}return b},getTag:function(){return this.tag||this.getPackage().getTag()},getCharset:function(){return this.charset||this.getPackage().getCharset()},getRequiredMods:function(){var b=this.runtime;return a.map(this.getNormalizedRequires(),function(a){return l.createModuleInfo(b,a)})},getRequiresWithAlias:function(){var a=this.requiresWithAlias,b=this.requires;
if(!b||0==b.length)return b||[];a||(this.requiresWithAlias=a=l.normalizeModNamesWithAlias(this.runtime,b,this.name));return a},getNormalizedRequires:function(){var a,b=this.normalizedRequiresStatus,d=this.status,h=this.requires;if(!h||0==h.length)return h||[];if((a=this.normalizedRequires)&&b==d)return a;this.normalizedRequiresStatus=d;return this.normalizedRequires=l.normalizeModNames(this.runtime,h,this.name)}});j.Module=k})(KISSY);
(function(a){function b(){for(var l in j){var e=j[l],f=e.node,d,h=0;if(k.webkit)f.sheet&&(h=1);else if(f.sheet)try{f.sheet.cssRules&&(h=1)}catch(c){d=c.name,"NS_ERROR_DOM_SECURITY_ERR"==d&&(h=1)}h&&(e.callback&&e.callback.call(f),delete j[l])}g=a.isEmptyObject(j)?0:setTimeout(b,i)}var i=30,k=a.UA,g=0,j={};a.mix(a.Loader.Utils,{pollCss:function(a,e){var f;f=j[a.href]={};f.node=a;f.callback=e;g||b()}})})(KISSY);
(function(a){var b=a.Env.host.document,i=a.Loader.Utils,k=a.Path,g={},j=536>a.UA.webkit;a.mix(a,{getScript:function(l,e,f){var d=e,h=0,c,m,n,p;a.startsWith(k.extname(l).toLowerCase(),".css")&&(h=1);a.isPlainObject(d)&&(e=d.success,c=d.error,m=d.timeout,f=d.charset,n=d.attrs);d=g[l]=g[l]||[];d.push([e,c]);if(1<d.length)return d.node;var e=i.docHead(),o=b.createElement(h?"link":"script");n&&a.each(n,function(a,b){o.setAttribute(b,a)});h?(o.href=l,o.rel="stylesheet"):(o.src=l,o.async=!0);d.node=o;f&&
(o.charset=f);var q=function(b){var c;if(p){p.cancel();p=void 0}a.each(g[l],function(a){(c=a[b])&&c.call(o)});delete g[l]},f=!h;h&&(f=j?!1:"onload"in o);f?(o.onload=o.onreadystatechange=function(){var a=o.readyState;if(!a||a=="loaded"||a=="complete"){o.onreadystatechange=o.onload=null;q(0)}},o.onerror=function(){o.onerror=null;q(1)}):i.pollCss(o,function(){q(0)});m&&(p=a.later(function(){q(1)},1E3*m));h?e.appendChild(o):e.insertBefore(o,e.firstChild);return o}})})(KISSY);
(function(a,b){function i(b){"/"!=b.charAt(b.length-1)&&(b+="/");l?b=l.resolve(b):(a.startsWith(b,"file:")||(b="file:"+b),b=new a.Uri(b));return b}var k=a.Loader,g=k.Utils,j=a.Env.host.location,l,e,f=a.Config.fns;if(!a.Env.nodejs&&j&&(e=j.href))l=new a.Uri(e);f.map=function(a){var b=this.Config;return!1===a?b.mappedRules=[]:b.mappedRules=(b.mappedRules||[]).concat(a||[])};f.mapCombo=function(a){var b=this.Config;return!1===a?b.mappedComboRules=[]:b.mappedComboRules=(b.mappedComboRules||[]).concat(a||
[])};f.packages=function(d){var h,c=this.Config,e=c.packages=c.packages||{};return d?(a.each(d,function(b,c){h=b.name||c;var d=i(b.base||b.path);b.name=h;b.base=d.toString();b.baseUri=d;b.runtime=a;delete b.path;e[h]=new k.Package(b)}),b):!1===d?(c.packages={},b):e};f.modules=function(b){var h=this,c=h.Env;b&&a.each(b,function(b,d){g.createModuleInfo(h,d,b);a.mix(c.mods[d],b)})};f.base=function(a){var h=this.Config;if(!a)return h.base;a=i(a);h.base=a.toString();h.baseUri=a;return b}})(KISSY);
(function(a){var b=a.Loader,i=a.UA,k=b.Utils;a.augment(b,b.Target,{__currentMod:null,__startLoadTime:0,__startLoadModName:null,add:function(b,j,l){var e=this.runtime;if("string"==typeof b)k.registerModule(e,b,j,l);else if(a.isFunction(b))if(l=j,j=b,i.ie){var b=a.Env.host.document.getElementsByTagName("script"),f,d,h;for(d=b.length-1;0<=d;d--)if(h=b[d],"interactive"==h.readyState){f=h;break}b=f?f.getAttribute("data-mod-name"):this.__startLoadModName;k.registerModule(e,b,j,l);this.__startLoadModName=
null;this.__startLoadTime=0}else this.__currentMod={fn:j,config:l}}})})(KISSY);
(function(a,b){function i(b){a.mix(this,{fn:b,waitMods:{},requireLoadedMods:{}})}function k(a,b,d){var f,m=b.length;for(f=0;f<m;f++){var j=a,i=b[f],k=d,l=j.runtime,w=void 0,A=void 0,w=l.Env.mods,y=w[i];y||(e.createModuleInfo(l,i),y=w[i]);w=y.status;w!=n&&(w===c?k.loadModRequires(j,y):(A=k.isModWait(i),A||(k.addWaitMod(i),w<=h&&g(j,y,k))))}}function g(c,g,j){function i(){g.fn?(d[l]||(d[l]=1),j.loadModRequires(c,g),j.removeWaitMod(l),j.check()):g.status=m}var k=c.runtime,l=g.getName(),n=g.getCharset(),
v=g.getFullPath(),x=0,w=f.ie,A="css"==g.getType();g.status=h;w&&!A&&(c.__startLoadModName=l,c.__startLoadTime=Number(+new Date));a.getScript(v,{attrs:w?{"data-mod-name":l}:b,success:function(){if(g.status==h)if(A)e.registerModule(k,l,a.noop);else if(x=c.__currentMod){e.registerModule(k,l,x.fn,x.config);c.__currentMod=null}a.later(i)},error:i,charset:n})}var j,l,e,f,d={},h,c,m,n;j=a.Loader;l=j.Status;e=j.Utils;f=a.UA;h=l.LOADING;c=l.LOADED;m=l.ERROR;n=l.ATTACHED;i.prototype={check:function(){var b=
this.fn;b&&a.isEmptyObject(this.waitMods)&&(b(),this.fn=null)},addWaitMod:function(a){this.waitMods[a]=1},removeWaitMod:function(a){delete this.waitMods[a]},isModWait:function(a){return this.waitMods[a]},loadModRequires:function(a,b){var c=this.requireLoadedMods,d=b.name;c[d]||(c[d]=1,c=b.getNormalizedRequires(),k(a,c,this))}};a.augment(j,{use:function(a,b,c){var d,h=new i(function(){e.attachModsRecursively(d,f);b&&b.apply(f,e.getModules(f,a))}),f=this.runtime,a=e.getModNamesAsArray(a),a=e.normalizeModNamesWithAlias(f,
a);d=e.unalias(f,a);k(this,d,h);c?h.check():setTimeout(function(){h.check()},0);return this}})})(KISSY);
(function(a,b){function i(b,c,d){var h=b&&b.length;h?a.each(b,function(b){a.getScript(b,function(){--h||c()},d)}):c()}function k(b){a.mix(this,{runtime:b,queue:[],loading:0})}function g(a){if(a.queue.length){var b=a.queue.shift();l(a,b)}}function j(a,b){a.queue.push(b)}function l(b,c){function d(){w&&x&&(m.attachModsRecursively(g,B)?j.apply(null,m.getModules(B,h)):l(b,c))}var h=c.modNames,g=c.unaliasModNames,j=c.fn,k,u,v,x,w,A,y,B=b.runtime;b.loading=1;k=b.calculate(g);m.createModulesInfo(B,k);k=
b.getComboUrls(k);u=k.css;A=0;for(y in u)A++;x=0;w=!A;for(y in u)i(u[y],function(){if(!--A){for(y in u)a.each(u[y].mods,function(b){m.registerModule(B,b.name,a.noop)});e(u);w=1;d()}},u[y].charset);v=k.js;f(v,function(a){(x=a)&&e(v);d()})}function e(b){if(a.Config.debug){var c=[],d,h=[];for(d in b)h.push.apply(h,b[d]),a.each(b[d].mods,function(a){c.push(a.name)})}}function f(d,h){var e,f,m=0;for(e in d)m++;if(m)for(e in f=1,d)(function(e){i(d[e],function(){a.each(d[e].mods,function(a){return!a.fn?
(a.status=c.ERROR,f=0,!1):b});f&&!--m&&h(1)},d[e].charset)})(e);else h(1)}function d(b,c,h){var e=b.runtime,f,g;f=b.runtime.Env.mods[c];var j=h[c];if(j)return j;h[c]=j={};if(f&&!m.isAttached(e,c)){c=f.getNormalizedRequires();for(f=0;f<c.length;f++)g=c[f],!m.isLoaded(e,g)&&!m.isAttached(e,g)&&(j[g]=1),g=d(b,g,h),a.mix(j,g)}return j}var h=a.Loader,c=h.Status,m=h.Utils;a.augment(k,h.Target);a.augment(k,{clear:function(){this.loading=0},use:function(a,b,c){var d=this,h=d.runtime,a=m.getModNamesAsArray(a),
a=m.normalizeModNamesWithAlias(h,a),e=m.unalias(h,a);m.isAttached(h,e)?b&&(c?b.apply(null,m.getModules(h,a)):setTimeout(function(){b.apply(null,m.getModules(h,a))},0)):(j(d,{modNames:a,unaliasModNames:e,fn:function(){setTimeout(function(){d.loading=0;g(d)},0);b&&b.apply(this,arguments)}}),d.loading||g(d))},add:function(a,b,c){m.registerModule(this.runtime,a,b,c)},calculate:function(b){var c={},h,e,f,g=this.runtime,j={};for(h=0;h<b.length;h++)e=b[h],m.isAttached(g,e)||(m.isLoaded(g,e)||(c[e]=1),a.mix(c,
d(this,e,j)));b=[];for(f in c)b.push(f);return b},getComboUrls:function(b){var c=this,d,h=c.runtime,e=h.Config,f={};a.each(b,function(a){var a=c.runtime.Env.mods[a],b=a.getPackage(),d=a.getType(),h,e=b.getName();f[e]=f[e]||{};if(!(h=f[e][d]))h=f[e][d]=f[e][d]||[],h.packageInfo=b;h.push(a)});var g={js:{},css:{}},j,i,k,b=e.comboPrefix,l=e.comboSep,A=e.comboMaxFileNum,y=e.comboMaxUrlLength;for(i in f)for(k in f[i]){j=[];var B=f[i][k],D=B.packageInfo,C=(d=D.getTag())?"?t="+encodeURIComponent(d):"",I=
C.length,z,F,K,J=D.getPrefixUriForCombo();g[k][i]=[];g[k][i].charset=D.getCharset();g[k][i].mods=[];z=J+b;K=z.length;var L=function(){g[k][i].push(m.getMappedPath(h,z+j.join(l)+C,e.mappedComboRules))};for(d=0;d<B.length;d++)if(F=B[d].getFullPath(),g[k][i].mods.push(B[d]),!D.isCombine()||!a.startsWith(F,J))g[k][i].push(F);else if(F=F.slice(J.length).replace(/\?.*$/,""),j.push(F),j.length>A||K+j.join(l).length+I>y)j.pop(),L(),j=[],d--;j.length&&L()}return g}});h.Combo=k})(KISSY);
(function(a,b){function i(){var e=/^(.*)(seed|kissy)(?:-min)?\.js[^/]*/i,f=/(seed|kissy)(?:-min)?\.js/i,d,h,c=g.host.document.getElementsByTagName("script"),m=c[c.length-1],c=m.src,m=(m=m.getAttribute("data-config"))?(new Function("return "+m))():{};d=m.comboPrefix=m.comboPrefix||"??";h=m.comboSep=m.comboSep||",";var j,i=c.indexOf(d);-1==i?j=c.replace(e,"$1"):(j=c.substring(0,i),"/"!=j.charAt(j.length-1)&&(j+="/"),c=c.substring(i+d.length).split(h),a.each(c,function(a){return a.match(f)?(j+=a.replace(e,
"$1"),!1):b}));return a.mix({base:j},m)}a.mix(a,{add:function(a,b,d){this.getLoader().add(a,b,d)},use:function(a,b){var d=this.getLoader();d.use.apply(d,arguments)},getLoader:function(){var a=this.Env;return this.Config.combine&&!a.nodejs?a._comboLoader:a._loader},require:function(a){return j.getModules(this,[a])[1]}});var k=a.Loader,g=a.Env,j=k.Utils,l=a.Loader.Combo;a.Env.nodejs?a.config({charset:"utf-8",base:__dirname.replace(/\\/g,"/").replace(/\/$/,"")+"/"}):a.config(a.mix({comboMaxUrlLength:2E3,
comboMaxFileNum:40,charset:"utf-8",tag:"20130701201313"},i()));a.config("systemPackage",new k.Package({name:"",runtime:a}));g.mods={};g._loader=new k(a);l&&(g._comboLoader=new l(a))})(KISSY);
(function(a,b){function i(){j&&o(k,n,i);f.resolve(a)}var k=a.Env.host,g=a.UA,j=k.document,l=j&&j.documentElement,e=k.location,f=new a.Defer,d=f.promise,h=/^#?([\w-]+)$/,c=/\S/,m=!(!j||!j.addEventListener),n="load",p=m?function(a,b,c){a.addEventListener(b,c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)},o=m?function(a,b,c){a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent("on"+b,c)};a.mix(a,{isWindow:function(a){return null!=a&&a==a.window},parseXML:function(a){if(a.documentElement)return a;
var c;try{k.DOMParser?c=(new DOMParser).parseFromString(a,"text/xml"):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a))}catch(d){c=b}!c||!c.documentElement||c.getElementsByTagName("parsererror");return c},globalEval:function(a){a&&c.test(a)&&(k.execScript||function(a){k.eval.call(k,a)})(a)},ready:function(a){d.then(a);return this},available:function(b,c){var b=(b+"").match(h)[1],d=1,e,f=a.later(function(){((e=j.getElementById(b))&&(c(e)||1)||500<++d)&&f.cancel()},40,!0)}});if(e&&-1!==
(e.search||"").indexOf("ks-debug"))a.Config.debug=!0;(function(){if(!j||"complete"===j.readyState)i();else if(p(k,n,i),m){var a=function(){o(j,"DOMContentLoaded",a);i()};p(j,"DOMContentLoaded",a)}else{var b=function(){"complete"===j.readyState&&(o(j,"readystatechange",b),i())};p(j,"readystatechange",b);var c,d=l&&l.doScroll;try{c=null===k.frameElement}catch(h){c=!1}if(d&&c){var e=function(){try{d("left"),i()}catch(a){setTimeout(e,40)}};e()}}})();if(g.ie)try{j.execCommand("BackgroundImageCache",!1,
!0)}catch(q){}})(KISSY,void 0);(function(a){var b=a.startsWith(location.href,"https")?"https://s.tbcdn.cn/s/kissy/":"http://a.tbcdn.cn/s/kissy/";a.config({packages:{gallery:{base:b},mobile:{base:b}},modules:{core:{alias:"dom,event,ajax,anim,base,node,json,ua,cookie".split(",")}}})})(KISSY);
(function(a,b,i){a({ajax:{requires:["dom","json","event"]}});a({anim:{requires:["dom","event"]}});a({base:{requires:["event/custom"]}});a({button:{requires:["component/base","event"]}});a({calendar:{requires:["node","event"]}});a({color:{requires:["base"]}});a({combobox:{requires:["dom","component/base","node","menu","ajax"]}});a({"component/base":{requires:["rich-base","node","event"]}});a({"component/extension":{requires:["dom","node"]}});a({"component/plugin/drag":{requires:["rich-base","dd/base"]}});
a({"component/plugin/resize":{requires:["resizable"]}});a({datalazyload:{requires:["dom","event","base"]}});a({dd:{alias:["dd/base","dd/droppable"]}});a({"dd/base":{requires:["dom","node","event","rich-base","base"]}});a({"dd/droppable":{requires:["dd/base","dom","node","rich-base"]}});a({"dd/plugin/constrain":{requires:["base","node"]}});a({"dd/plugin/proxy":{requires:["node","base","dd/base"]}});a({"dd/plugin/scroll":{requires:["dd/base","base","node","dom"]}});a({dom:{alias:["dom/base",i.ie&&(9>
i.ie||9>document.documentMode)?"dom/ie":""]}});a({"dom/ie":{requires:["dom/base"]}});a({editor:{requires:["htmlparser","component/base","core"]}});a({event:{alias:["event/base","event/dom","event/custom"]}});a({"event/custom":{requires:["event/base"]}});a({"event/dom":{alias:["event/dom/base",b.isTouchSupported()?"event/dom/touch":"",b.isDeviceMotionSupported()?"event/dom/shake":"",b.isHashChangeSupported()?"":"event/dom/hashchange",9>i.ie?"event/dom/ie":"",i.ie?"":"event/dom/focusin"]}});a({"event/dom/base":{requires:["dom",
"event/base"]}});a({"event/dom/focusin":{requires:["event/dom/base"]}});a({"event/dom/hashchange":{requires:["event/dom/base","dom"]}});a({"event/dom/ie":{requires:["event/dom/base","dom"]}});a({"event/dom/shake":{requires:["event/dom/base"]}});a({"event/dom/touch":{requires:["event/dom/base","dom"]}});a({imagezoom:{requires:["node","overlay"]}});a({json:{requires:[KISSY.Features.isNativeJSONSupported()?"":"json/json2"]}});a({kison:{requires:["base"]}});a({menu:{requires:["component/extension","node",
"component/base","event"]}});a({menubutton:{requires:["node","menu","button","component/base"]}});a({mvc:{requires:["event","base","ajax","json","node"]}});a({node:{requires:["dom","event/dom","anim"]}});a({overlay:{requires:["node","component/base","component/extension","event"]}});a({resizable:{requires:["node","rich-base","dd/base"]}});a({"rich-base":{requires:["base"]}});a({separator:{requires:["component/base"]}});a({"split-button":{requires:["component/base","button","menubutton"]}});a({stylesheet:{requires:["dom"]}});
a({swf:{requires:["dom","json","base"]}});a({switchable:{requires:["dom","event","anim",KISSY.Features.isTouchSupported()?"dd/base":""]}});a({tabs:{requires:["button","toolbar","component/base"]}});a({toolbar:{requires:["component/base","node"]}});a({tree:{requires:["node","component/base","event"]}});a({waterfall:{requires:["node","base"]}});a({xtemplate:{alias:["xtemplate/facade"]}});a({"xtemplate/compiler":{requires:["xtemplate/runtime"]}});a({"xtemplate/facade":{requires:["xtemplate/runtime",
"xtemplate/compiler"]}})})(function(a){KISSY.config("modules",a)},KISSY.Features,KISSY.UA);(function(a){a.add("empty",a.noop);a.add("promise",function(){return a.Promise});a.add("ua",function(){return a.UA});a.add("uri",function(){return a.Uri});a.add("path",function(){return a.Path})})(KISSY);
KISSY.add("dom/base/api",function(a){var b=a.Env.host,i=a.UA,k={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},g={isCustomDomain:function(a){var a=a||b,g=a.document.domain,a=a.location.hostname;return g!=a&&g!="["+a+"]"},getEmptyIframeSrc:function(a){a=a||b;return i.ie&&g.isCustomDomain(a)?"javascript:void(function(){"+
encodeURIComponent("document.open();document.domain='"+a.document.domain+"';document.close();")+"}())":""},NodeType:k,getWindow:function(a){return!a?b:"scrollTo"in a&&a.document?a:a.nodeType==k.DOCUMENT_NODE?a.defaultView||a.parentWindow:!1},_isNodeList:function(a){return a&&!a.nodeType&&a.item&&!a.setTimeout},nodeName:function(a){var b=g.get(a),a=b.nodeName.toLowerCase();i.ie&&(b=b.scopeName)&&"HTML"!=b&&(a=b.toLowerCase()+":"+a);return a},_RE_NUM_NO_PX:RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+
")(?!px)[a-z%]+$","i")};a.mix(g,k);return g});
KISSY.add("dom/base/attr",function(a,b,i){function k(a,b){var b=q[b]||b,c=t[b];return c&&c.get?c.get(a,b):a[b]}var g=a.Env.host.document,j=b.NodeType,l=(g=g&&g.documentElement)&&g.textContent===i?"innerText":"textContent",e=b.nodeName,f=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,d=/^(?:button|input|object|select|textarea)$/i,h=/^a(?:rea)?$/i,c=/:|^on/,m=/\r/g,n={},p={val:1,css:1,html:1,text:1,data:1,width:1,height:1,
offset:1,scrollTop:1,scrollLeft:1},o={tabindex:{get:function(a){var b=a.getAttributeNode("tabindex");return b&&b.specified?parseInt(b.value,10):d.test(a.nodeName)||h.test(a.nodeName)&&a.href?0:i}}},q={hidefocus:"hideFocus",tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},r={get:function(a,
c){return b.prop(a,c)?c.toLowerCase():i},set:function(a,c,d){!1===c?b.removeAttr(a,d):(c=q[d]||d,c in a&&(a[c]=!0),a.setAttribute(d,d.toLowerCase()));return d}},t={},s={},u={select:{get:function(a){var c=a.selectedIndex,d=a.options,h;if(0>c)return null;if("select-one"===a.type)return b.val(d[c]);a=[];c=0;for(h=d.length;c<h;++c)d[c].selected&&a.push(b.val(d[c]));return a},set:function(c,d){var h=a.makeArray(d);a.each(c.options,function(c){c.selected=a.inArray(b.val(c),h)});h.length||(c.selectedIndex=
-1);return h}}};a.each(["radio","checkbox"],function(c){u[c]={get:function(a){return null===a.getAttribute("value")?"on":a.value},set:function(c,d){if(a.isArray(d))return c.checked=a.inArray(b.val(c),d)}}});o.style={get:function(a){return a.style.cssText}};a.mix(b,{_valHooks:u,_propFix:q,_attrHooks:o,_propHooks:t,_attrNodeHook:s,_attrFix:n,prop:function(c,d,h){var e=b.query(c),f,m;if(a.isPlainObject(d))return a.each(d,function(a,c){b.prop(e,c,a)}),i;d=q[d]||d;m=t[d];if(h!==i)for(c=e.length-1;0<=c;c--)f=
e[c],m&&m.set?m.set(f,h,d):f[d]=h;else if(e.length)return k(e[0],d);return i},hasProp:function(a,c){var d=b.query(a),h,e=d.length,f;for(h=0;h<e;h++)if(f=d[h],k(f,c)!==i)return!0;return!1},removeProp:function(a,c){var c=q[c]||c,d=b.query(a),h,e;for(h=d.length-1;0<=h;h--){e=d[h];try{e[c]=i,delete e[c]}catch(f){}}},attr:function(d,h,m,g){var k=b.query(d),l=k[0];if(a.isPlainObject(h)){var g=m,q;for(q in h)b.attr(k,q,h[q],g);return i}if(!(h=a.trim(h)))return i;if(g&&p[h])return b[h](d,m);h=h.toLowerCase();
if(g&&p[h])return b[h](d,m);h=n[h]||h;d=f.test(h)?r:c.test(h)?s:o[h];if(m===i){if(l&&l.nodeType===j.ELEMENT_NODE){"form"==e(l)&&(d=s);if(d&&d.get)return d.get(l,h);h=l.getAttribute(h);return null===h?i:h}}else for(g=k.length-1;0<=g;g--)if((l=k[g])&&l.nodeType===j.ELEMENT_NODE)"form"==e(l)&&(d=s),d&&d.set?d.set(l,m,h):l.setAttribute(h,""+m);return i},removeAttr:function(a,c){var c=c.toLowerCase(),c=n[c]||c,d=b.query(a),h,e,m;for(m=d.length-1;0<=m;m--)if(e=d[m],e.nodeType==j.ELEMENT_NODE&&(e.removeAttribute(c),
f.test(c)&&(h=q[c]||c)in e))e[h]=!1},hasAttr:g&&!g.hasAttribute?function(a,c){var c=c.toLowerCase(),d=b.query(a),h,e;for(h=0;h<d.length;h++)if(e=d[h],(e=e.getAttributeNode(c))&&e.specified)return!0;return!1}:function(a,c){var d=b.query(a),h,e=d.length;for(h=0;h<e;h++)if(d[h].hasAttribute(c))return!0;return!1},val:function(c,d){var h,f,g,j,k;if(d===i){if(g=b.get(c)){if((h=u[e(g)]||u[g.type])&&"get"in h&&(f=h.get(g,"value"))!==i)return f;f=g.value;return"string"===typeof f?f.replace(m,""):null==f?"":
f}return i}f=b.query(c);for(j=f.length-1;0<=j;j--){g=f[j];if(1!==g.nodeType)break;k=d;null==k?k="":"number"===typeof k?k+="":a.isArray(k)&&(k=a.map(k,function(a){return a==null?"":a+""}));h=u[e(g)]||u[g.type];if(!h||!("set"in h)||h.set(g,k,"value")===i)g.value=k}return i},text:function(a,c){var d,h,e;if(c===i){d=b.get(a);if(d.nodeType==j.ELEMENT_NODE)return d[l]||"";if(d.nodeType==j.TEXT_NODE)return d.nodeValue}else{h=b.query(a);for(e=h.length-1;0<=e;e--)d=h[e],d.nodeType==j.ELEMENT_NODE?d[l]=c:d.nodeType==
j.TEXT_NODE&&(d.nodeValue=c)}return i}});return b},{requires:["./api"]});KISSY.add("dom/base",function(a,b){a.mix(a,{DOM:b,get:b.get,query:b.query});return b},{requires:"./base/api,./base/attr,./base/class,./base/create,./base/data,./base/insertion,./base/offset,./base/style,./base/selector,./base/traversal".split(",")});
KISSY.add("dom/base/class",function(a,b,i){function k(e,f,d,h){if(!(f=a.trim(f)))return h?!1:i;var e=b.query(e),c=e.length,m=f.split(j),f=[],k,l;for(l=0;l<m.length;l++)(k=a.trim(m[l]))&&f.push(k);for(l=0;l<c;l++)if(m=e[l],m.nodeType==g.ELEMENT_NODE&&(m=d(m,f,f.length),m!==i))return m;return h?!1:i}var g=b.NodeType,j=/[\.\s]\s*\.?/,l=/[\n\t]/g;a.mix(b,{hasClass:function(a,b){return k(a,b,function(a,b,c){var a=a.className,e,f;if(a){a=(" "+a+" ").replace(l," ");e=0;for(f=!0;e<c;e++)if(0>a.indexOf(" "+
b[e]+" ")){f=!1;break}if(f)return!0}},!0)},addClass:function(b,f){k(b,f,function(b,h,c){var e=b.className,g,i;if(e){g=(" "+e+" ").replace(l," ");for(i=0;i<c;i++)0>g.indexOf(" "+h[i]+" ")&&(e+=" "+h[i]);b.className=a.trim(e)}else b.className=f},i)},removeClass:function(b,f){k(b,f,function(b,h,c){var e=b.className,f,g;if(e)if(c){e=(" "+e+" ").replace(l," ");for(f=0;f<c;f++)for(g=" "+h[f]+" ";0<=e.indexOf(g);)e=e.replace(g," ");b.className=a.trim(e)}else b.className=""},i)},replaceClass:function(a,f,
d){b.removeClass(a,f);b.addClass(a,d)},toggleClass:function(e,f,d){var h=a.isBoolean(d),c,g;k(e,f,function(a,e,i){for(g=0;g<i;g++)f=e[g],c=h?!d:b.hasClass(a,f),b[c?"removeClass":"addClass"](a,f)},i)}});return b},{requires:["./api"]});
KISSY.add("dom/base/create",function(a,b,i){function k(c){var d=a.require("event/dom");d&&d.detach(c);b.removeData(c)}function g(a,b){var d=b&&b!=f?b.createElement(c):m;d.innerHTML="m<div>"+a+"</div>";return d.lastChild}function j(a,b,c){var h=b.nodeType;if(h==d.DOCUMENT_FRAGMENT_NODE){b=b.childNodes;c=c.childNodes;for(h=0;b[h];)c[h]&&j(a,b[h],c[h]),h++}else if(h==d.ELEMENT_NODE){b=b.getElementsByTagName("*");c=c.getElementsByTagName("*");for(h=0;b[h];)c[h]&&a(b[h],c[h]),h++}}function l(c,h){var e=
a.require("event/dom"),f,g;if(h.nodeType!=d.ELEMENT_NODE||b.hasData(c)){f=b.data(c);for(g in f)b.data(h,g,f[g]);e&&(e._DOMUtils.removeData(h),e._clone(c,h))}}function e(b){var c=null,d,h;if(b&&(b.push||b.item)&&b[0]){c=b[0].ownerDocument;c=c.createDocumentFragment();b=a.makeArray(b);d=0;for(h=b.length;d<h;d++)c.appendChild(b[d])}return c}var f=a.Env.host.document,d=b.NodeType,h=a.UA.ie,c="div",m=f&&f.createElement(c),n=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,p=/<([\w:]+)/,
o=/^\s+/,q=h&&9>h,r=/<|&#?\w+;/,t=f&&"outerHTML"in f.documentElement,s=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;a.mix(b,{create:function(h,m,j,k){var l=null;if(!h)return l;if(h.nodeType)return b.clone(h);if("string"!=typeof h)return l;k===i&&(k=!0);k&&(h=a.trim(h));var k=b._creators,t,u,j=j||f,w,v=c;if(r.test(h))if(w=s.exec(h))l=j.createElement(w[1]);else{h=h.replace(n,"<$1></$2>");if((w=p.exec(h))&&(t=w[1]))v=t.toLowerCase();t=(k[v]||g)(h,j);q&&(u=h.match(o))&&t.insertBefore(j.createTextNode(u[0]),t.firstChild);
h=t.childNodes;1===h.length?l=h[0].parentNode.removeChild(h[0]):h.length&&(l=e(h))}else l=j.createTextNode(h);a.isPlainObject(m)&&(l.nodeType==d.ELEMENT_NODE?b.attr(l,m,!0):l.nodeType==d.DOCUMENT_FRAGMENT_NODE&&b.attr(l.childNodes,m,!0));return l},_fixCloneAttributes:null,_creators:{div:g},_defaultCreator:g,html:function(a,c,h,e){var a=b.query(a),f=a[0],g=!1,m,j;if(f){if(c===i)return f.nodeType==d.ELEMENT_NODE?f.innerHTML:null;c+="";if(!c.match(/<(?:script|style|link)/i)&&(!q||!c.match(o))&&!x[(c.match(p)||
["",""])[1].toLowerCase()])try{for(m=a.length-1;0<=m;m--)j=a[m],j.nodeType==d.ELEMENT_NODE&&(k(j.getElementsByTagName("*")),j.innerHTML=c);g=!0}catch(l){}g||(c=b.create(c,0,f.ownerDocument,0),b.empty(a),b.append(c,a,h));e&&e()}},outerHTML:function(a,h,e){var g=b.query(a),j=g.length;if(a=g[0]){if(h===i){if(t)return a.outerHTML;h=(h=a.ownerDocument)&&h!=f?h.createElement(c):m;h.innerHTML="";h.appendChild(b.clone(a,!0));return h.innerHTML}h+="";if(!h.match(/<(?:script|style|link)/i)&&t)for(e=j-1;0<=
e;e--)a=g[e],a.nodeType==d.ELEMENT_NODE&&(k(a),k(a.getElementsByTagName("*")),a.outerHTML=h);else a=b.create(h,0,a.ownerDocument,0),b.insertBefore(a,g,e),b.remove(g)}},remove:function(a,c){var h,e=b.query(a),f,g;for(g=e.length-1;0<=g;g--)h=e[g],!c&&h.nodeType==d.ELEMENT_NODE&&(f=h.getElementsByTagName("*"),k(f),k(h)),h.parentNode&&h.parentNode.removeChild(h)},clone:function(a,c,h,e){"object"===typeof c&&(e=c.deepWithDataAndEvent,h=c.withDataAndEvent,c=c.deep);var a=b.get(a),f,g=b._fixCloneAttributes,
m;if(!a)return null;m=a.nodeType;f=a.cloneNode(c);if(m==d.ELEMENT_NODE||m==d.DOCUMENT_FRAGMENT_NODE)g&&m==d.ELEMENT_NODE&&g(a,f),c&&g&&j(g,a,f);h&&(l(a,f),c&&e&&j(l,a,f));return f},empty:function(a){var a=b.query(a),c,d;for(d=a.length-1;0<=d;d--)c=a[d],b.remove(c.childNodes)},_nodeListToFragment:e});var u=b._creators,v=b.create,x={option:"select",optgroup:"select",area:"map",thead:"table",td:"tr",th:"tr",tr:"tbody",tbody:"table",tfoot:"table",caption:"table",colgroup:"table",col:"colgroup",legend:"fieldset"},
w;for(w in x)(function(a){u[w]=function(b,c){return v("<"+a+">"+b+"</"+a+">",null,c)}})(x[w]);return b},{requires:["./api"]});
KISSY.add("dom/base/data",function(a,b,i){var k=a.Env.host,g="__ks_data_"+a.now(),j={},l={},e={applet:1,object:1,embed:1},f={hasData:function(b,d){if(b)if(d!==i){if(d in b)return!0}else if(!a.isEmptyObject(b))return!0;return!1}},d={hasData:function(a,b){return a==k?d.hasData(l,b):f.hasData(a[g],b)},data:function(a,b,h){if(a==k)return d.data(l,b,h);var e=a[g];if(h!==i)e=a[g]=a[g]||{},e[b]=h;else return b!==i?e&&e[b]:e=a[g]=a[g]||{}},removeData:function(b,h){if(b==k)return d.removeData(l,h);var e=b[g];
if(h!==i)delete e[h],a.isEmptyObject(e)&&d.removeData(b);else try{delete b[g]}catch(f){b[g]=i}}},h={hasData:function(a,b){var d=a[g];return!d?!1:f.hasData(j[d],b)},data:function(b,d,h){if(e[b.nodeName.toLowerCase()])return i;var f=b[g];if(!f){if(d!==i&&h===i)return i;f=b[g]=a.guid()}b=j[f];if(h!==i)b=j[f]=j[f]||{},b[d]=h;else return d!==i?b&&b[d]:b=j[f]=j[f]||{}},removeData:function(b,d){var e=b[g],f;if(e)if(f=j[e],d!==i)delete f[d],a.isEmptyObject(f)&&h.removeData(b);else{delete j[e];try{delete b[g]}catch(k){b[g]=
i}b.removeAttribute&&b.removeAttribute(g)}}};a.mix(b,{__EXPANDO:g,hasData:function(a,e){for(var f=!1,g=b.query(a),j=0;j<g.length&&!(f=g[j],f=f.nodeType?h.hasData(f,e):d.hasData(f,e));j++);return f},data:function(c,e,f){var c=b.query(c),g=c[0];if(a.isPlainObject(e)){for(var j in e)b.data(c,j,e[j]);return i}if(f===i){if(g)return g.nodeType?h.data(g,e):d.data(g,e)}else for(j=c.length-1;0<=j;j--)g=c[j],g.nodeType?h.data(g,e,f):d.data(g,e,f);return i},removeData:function(a,e){var f=b.query(a),g,j;for(j=
f.length-1;0<=j;j--)g=f[j],g.nodeType?h.removeData(g,e):d.removeData(g,e)}});return b},{requires:["./api"]});
KISSY.add("dom/base/insertion",function(a,b){function i(a,b){var g=[],k,o,q;for(k=0;a[k];k++)if(o=a[k],q=e(o),o.nodeType==j.DOCUMENT_FRAGMENT_NODE)g.push.apply(g,i(f(o.childNodes),b));else if("script"===q&&(!o.type||h.test(o.type)))o.parentNode&&o.parentNode.removeChild(o),b&&b.push(o);else{if(o.nodeType==j.ELEMENT_NODE&&!l.test(q)){q=[];var r,t,s=o.getElementsByTagName("script");for(t=0;t<s.length;t++)r=s[t],(!r.type||h.test(r.type))&&q.push(r);d.apply(a,[k+1,0].concat(q))}g.push(o)}return g}function k(b){b.src?
a.getScript(b.src):(b=a.trim(b.text||b.textContent||b.innerHTML||""))&&a.globalEval(b)}function g(c,d,h,e){c=b.query(c);e&&(e=[]);c=i(c,e);b._fixInsertionChecked&&b._fixInsertionChecked(c);var d=b.query(d),f,g,j,l,s=d.length;if((c.length||e&&e.length)&&s){c=b._nodeListToFragment(c);1<s&&(l=b.clone(c,!0),d=a.makeArray(d));for(f=0;f<s;f++)g=d[f],c&&(j=0<f?b.clone(l,!0):c,h(j,g)),e&&e.length&&a.each(e,k)}}var j=b.NodeType,l=/^(?:button|input|object|select|textarea)$/i,e=b.nodeName,f=a.makeArray,d=[].splice,
h=/\/(java|ecma)script/i;a.mix(b,{_fixInsertionChecked:null,insertBefore:function(a,b,d){g(a,b,function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b)},d)},insertAfter:function(a,b,d){g(a,b,function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)},d)},appendTo:function(a,b,d){g(a,b,function(a,b){b.appendChild(a)},d)},prependTo:function(a,b,d){g(a,b,function(a,b){b.insertBefore(a,b.firstChild)},d)},wrapAll:function(a,d){d=b.clone(b.get(d),!0);a=b.query(a);a[0].parentNode&&b.insertBefore(d,
a[0]);for(var h;(h=d.firstChild)&&1==h.nodeType;)d=h;b.appendTo(a,d)},wrap:function(c,d){c=b.query(c);d=b.get(d);a.each(c,function(a){b.wrapAll(a,d)})},wrapInner:function(c,d){c=b.query(c);d=b.get(d);a.each(c,function(a){var c=a.childNodes;c.length?b.wrapAll(c,d):a.appendChild(d)})},unwrap:function(c){c=b.query(c);a.each(c,function(a){a=a.parentNode;b.replaceWith(a,a.childNodes)})},replaceWith:function(a,d){var h=b.query(a),d=b.query(d);b.remove(d,!0);b.insertBefore(d,h);b.remove(h)}});a.each({prepend:"prependTo",
append:"appendTo",before:"insertBefore",after:"insertAfter"},function(a,d){b[d]=b[a]});return b},{requires:["./api"]});
KISSY.add("dom/base/offset",function(a,b,i){function k(a){var b,c=a.ownerDocument.body;if(!a.getBoundingClientRect)return{left:0,top:0};b=a.getBoundingClientRect();a=b[n];b=b[p];a-=f.clientLeft||c.clientLeft||0;b-=f.clientTop||c.clientTop||0;return{left:a,top:b}}function g(a,c){var h={left:0,top:0},e=d(a[m]),f,g=a,c=c||e;do{if(e==c){var j=g;f=k(j);j=d(j[m]);f.left+=b[q](j);f.top+=b[r](j)}else f=k(g);h.left+=f.left;h.top+=f.top}while(e&&e!=c&&(g=e.frameElement)&&(e=e.parent));return h}var j=a.Env.host,
l=j.document,e=b.NodeType,f=l&&l.documentElement,d=b.getWindow,h=Math.max,c=parseFloat,m="ownerDocument",n="left",p="top",o=a.isNumber,q="scrollLeft",r="scrollTop";a.mix(b,{offset:function(a,d,h){if(d===i){var a=b.get(a),e;a&&(e=g(a,h));return e}h=b.query(a);for(e=h.length-1;0<=e;e--){var a=h[e],f=d;"static"===b.css(a,"position")&&(a.style.position="relative");var j=g(a),k={},m=void 0,l=void 0;for(l in f)m=c(b.css(a,l))||0,k[l]=c(m+f[l]-j[l]);b.css(a,k)}return i},scrollIntoView:function(h,f,g,j){var k,
m,l,o;if(l=b.get(h)){f&&(f=b.get(f));f||(f=l.ownerDocument);f.nodeType==e.DOCUMENT_NODE&&(f=d(f));a.isPlainObject(g)&&(j=g.allowHorizontalScroll,o=g.onlyScrollIfNeeded,g=g.alignWithTop);j=j===i?!0:j;m=!!d(f);var h=b.offset(l),q=b.outerHeight(l);k=b.outerWidth(l);var r,C,I,z;m?(m=f,r=b.height(m),C=b.width(m),z={left:b.scrollLeft(m),top:b.scrollTop(m)},m=h[n]-z[n],l=h[p]-z[p],k=h[n]+k-(z[n]+C),h=h[p]+q-(z[p]+r)):(r=b.offset(f),C=f.clientHeight,I=f.clientWidth,z={left:b.scrollLeft(f),top:b.scrollTop(f)},
m=h[n]-(r[n]+(c(b.css(f,"borderLeftWidth"))||0)),l=h[p]-(r[p]+(c(b.css(f,"borderTopWidth"))||0)),k=h[n]+k-(r[n]+I+(c(b.css(f,"borderRightWidth"))||0)),h=h[p]+q-(r[p]+C+(c(b.css(f,"borderBottomWidth"))||0)));if(o){if(0>l||0<h)!0===g?b.scrollTop(f,z.top+l):!1===g?b.scrollTop(f,z.top+h):0>l?b.scrollTop(f,z.top+l):b.scrollTop(f,z.top+h)}else(g=g===i?!0:!!g)?b.scrollTop(f,z.top+l):b.scrollTop(f,z.top+h);if(j)if(o){if(0>m||0<k)!0===g?b.scrollLeft(f,z.left+m):!1===g?b.scrollLeft(f,z.left+k):0>m?b.scrollLeft(f,
z.left+m):b.scrollLeft(f,z.left+k)}else(g=g===i?!0:!!g)?b.scrollLeft(f,z.left+m):b.scrollLeft(f,z.left+k)}},docWidth:0,docHeight:0,viewportHeight:0,viewportWidth:0,scrollTop:0,scrollLeft:0});a.each(["Left","Top"],function(a,c){var h="scroll"+a;b[h]=function(f,g){if(o(f))return arguments.callee(j,f);var f=b.get(f),m,k,l,n=d(f);n?g!==i?(g=parseFloat(g),k="Left"==a?g:b.scrollLeft(n),l="Top"==a?g:b.scrollTop(n),n.scrollTo(k,l)):(m=n["page"+(c?"Y":"X")+"Offset"],o(m)||(k=n.document,m=k.documentElement[h],
o(m)||(m=k.body[h]))):f.nodeType==e.ELEMENT_NODE&&(g!==i?f[h]=parseFloat(g):m=f[h]);return m}});a.each(["Width","Height"],function(a){b["doc"+a]=function(c){c=b.get(c);c=d(c).document;return h(c.documentElement["scroll"+a],c.body["scroll"+a],b["viewport"+a](c))};b["viewport"+a]=function(c){var c=b.get(c),h="client"+a,c=d(c).document,e=c.body,f=c.documentElement[h];return"CSS1Compat"===c.compatMode&&f||e&&e[h]||f}});return b},{requires:["./api"]});
KISSY.add("dom/base/selector",function(a,b,i){function k(a){var b,c;for(c=0;c<this.length&&!(b=this[c],!1===a(b,c));c++);}function g(d,h){var e,f,m="string"==typeof d,o=h===i&&(f=1)?[c]:g(h);d?m?(d=v(d),f&&"body"==d?e=[c.body]:1==o.length&&d&&(e=l(d,o[0]))):f&&(e=d.nodeType||d.setTimeout?[d]:d.getDOMNodes?d.getDOMNodes():p(d)?d:q(d)?a.makeArray(d):[d]):e=[];if(!e&&(e=[],d)){for(f=0;f<o.length;f++)t.apply(e,j(d,o[f]));1<e.length&&(1<o.length||m&&-1<d.indexOf(u))&&b.unique(e)}e.each=k;return e}function j(b,
c){var d="string"==typeof b;if(d&&b.match(w)||!d)d=e(b,c);else if(d&&-1<b.replace(/"(?:(?:\\.)|[^"])*"/g,"").replace(/'(?:(?:\\.)|[^'])*'/g,"").indexOf(u)){var d=[],h,f=b.split(/\s*,\s*/);for(h=0;h<f.length;h++)t.apply(d,j(f[h],c))}else d=[],(h=a.require("sizzle"))&&h(b,c,d);return d}function l(a,c){var h,e,g,j;if(x.test(a))h=(e=f(a.slice(1),c))?[e]:[];else if(g=w.exec(a)){e=g[1];j=g[2];g=g[3];if(c=e?f(e,c):c)g?!e||-1!=a.indexOf(s)?h=[].concat(b._getElementsByClassName(g,j,c)):(e=f(e,c),d(e,g)&&(h=
[e])):j&&(h=o(b._getElementsByTagName(j,c)));h=h||[]}return h}function e(a,d){var h;"string"==typeof a?h=l(a,d)||[]:p(a)||q(a)?h=n(a,function(a){return!a?!1:d==c?!0:b._contains(d,a)}):(!a?0:d==c||b._contains(d,a))&&(h=[a]);return h}function f(a,c){var d=c.nodeType==m.DOCUMENT_NODE;return b._getElementById(a,c,d?c:c.ownerDocument,d)}function d(a,b){var c=a&&a.className;return c&&-1<(s+c+s).indexOf(s+b+s)}function h(a,b){var c=a&&a.getAttributeNode(b);return c&&c.nodeValue}var c=a.Env.host.document,
m=b.NodeType,n=a.filter,p=a.isArray,o=a.makeArray,q=b._isNodeList,r=b.nodeName,t=Array.prototype.push,s=" ",u=",",v=a.trim,x=/^#[\w-]+$/,w=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/;a.mix(b,{_getAttr:h,_hasSingleClass:d,_getElementById:function(a,c,d,h){var e=d.getElementById(a),f=b._getAttr(e,"id");return!e&&!h&&!b._contains(d,c)||e&&f!=a?b.filter("*","#"+a,c)[0]||null:h||e&&b._contains(c,e)?e:null},_getElementsByTagName:function(a,b){return b.getElementsByTagName(a)},_getElementsByClassName:function(a,
b,c){return o(c.querySelectorAll((b||"")+"."+a))},_compareNodeOrder:function(a,b){return!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition?-1:1:a.compareDocumentPosition(b)&4?-1:1},query:g,get:function(a,b){return g(a,b)[0]||null},unique:function(){function a(d,h){return d==h?(c=!0,0):b._compareNodeOrder(d,h)}var c,d=!0;[0,0].sort(function(){d=!1;return 0});return function(b){c=d;b.sort(a);if(c)for(var h=1,e=b.length;h<e;)b[h]===b[h-1]?b.splice(h,1):h++;return b}}(),
filter:function(b,c,e){var b=g(b,e),e=a.require("sizzle"),f,j,i,m,k=[];if("string"==typeof c&&(c=v(c))&&(f=w.exec(c)))i=f[1],j=f[2],m=f[3],i?i&&!j&&!m&&(c=function(a){return h(a,"id")==i}):c=function(a){var b=!0,c=!0;j&&(b=r(a)==j.toLowerCase());m&&(c=d(a,m));return c&&b};a.isFunction(c)?k=a.filter(b,c):c&&e&&(k=e.matches(c,b));return k},test:function(a,c,d){a=g(a,d);return a.length&&b.filter(a,c,d).length===a.length}});return b},{requires:["./api"]});
KISSY.add("dom/base/style",function(a,b,i){function k(a){return a.replace(t,"ms-").replace(s,u)}function g(a,b,c){var d={},h;for(h in b)d[h]=a[m][h],a[m][h]=b[h];c.call(a);for(h in b)a[m][h]=d[h]}function j(a,b,c){var d,h,e;if(3===a.nodeType||8===a.nodeType||!(d=a[m]))return i;b=k(b);e=A[b];b=y[b]||b;if(c!==i){null===c||c===x?c=x:!isNaN(Number(c))&&!r[b]&&(c+=w);e&&e.set&&(c=e.set(a,c));if(c!==i){try{d[b]=c}catch(f){}c===x&&d.removeAttribute&&d.removeAttribute(b)}d.cssText||a.removeAttribute("style");
return i}if(!e||!("get"in e&&(h=e.get(a,!1))!==i))h=d[b];return h===i?"":h}function l(a){var b,c=arguments;0!==a.offsetWidth?b=e.apply(i,c):g(a,D,function(){b=e.apply(i,c)});return b}function e(c,d,h){if(a.isWindow(c))return d==p?b.viewportWidth(c):b.viewportHeight(c);if(9==c.nodeType)return d==p?b.docWidth(c):b.docHeight(c);var e=d===p?["Left","Right"]:["Top","Bottom"],f=d===p?c.offsetWidth:c.offsetHeight;if(0<f)return"border"!==h&&a.each(e,function(a){h||(f-=parseFloat(b.css(c,"padding"+a))||0);
f="margin"===h?f+(parseFloat(b.css(c,h+a))||0):f-(parseFloat(b.css(c,"border"+a+"Width"))||0)}),f;f=b._getComputedStyle(c,d);if(null==f||0>Number(f))f=c.style[d]||0;f=parseFloat(f)||0;h&&a.each(e,function(a){f+=parseFloat(b.css(c,"padding"+a))||0;"padding"!==h&&(f+=parseFloat(b.css(c,"border"+a+"Width"))||0);"margin"===h&&(f+=parseFloat(b.css(c,h+a))||0)});return f}var f=a.Env.host,d=a.UA,h=b.nodeName,c=f.document,m="style",n=/^margin/,p="width",o="display"+a.now(),q=parseInt,r={fillOpacity:1,fontWeight:1,
lineHeight:1,opacity:1,orphans:1,widows:1,zIndex:1,zoom:1},t=/^-ms-/,s=/-([a-z])/ig,u=function(a,b){return b.toUpperCase()},v=/([A-Z]|^ms)/g,x="",w="px",A={},y={},B={};y["float"]="cssFloat";a.mix(b,{_camelCase:k,_CUSTOM_STYLES:A,_cssProps:y,_getComputedStyle:function(a,c){var d="",h,e,f,g,j;e=a.ownerDocument;c=c.replace(v,"-$1").toLowerCase();if(h=e.defaultView.getComputedStyle(a,null))d=h.getPropertyValue(c)||h[c];""===d&&!b.contains(e,a)&&(c=y[c]||c,d=a[m][c]);b._RE_NUM_NO_PX.test(d)&&n.test(c)&&
(j=a.style,e=j.width,f=j.minWidth,g=j.maxWidth,j.minWidth=j.maxWidth=j.width=d,d=h.width,j.width=e,j.minWidth=f,j.maxWidth=g);return d},style:function(c,d,h){var c=b.query(c),e,f=c[0];if(a.isPlainObject(d)){for(e in d)for(f=c.length-1;0<=f;f--)j(c[f],e,d[e]);return i}if(h===i)return e="",f&&(e=j(f,d,h)),e;for(f=c.length-1;0<=f;f--)j(c[f],d,h);return i},css:function(c,d,h){var c=b.query(c),e=c[0],f;if(a.isPlainObject(d)){for(f in d)for(e=c.length-1;0<=e;e--)j(c[e],f,d[f]);return i}d=k(d);f=A[d];if(h===
i){h="";if(e&&(!f||!("get"in f&&(h=f.get(e,!0))!==i)))h=b._getComputedStyle(e,d);return h===i?"":h}for(e=c.length-1;0<=e;e--)j(c[e],d,h);return i},show:function(a){var a=b.query(a),d,h,e;for(e=a.length-1;0<=e;e--)if(h=a[e],h[m].display=b.data(h,o)||x,"none"===b.css(h,"display")){d=h.tagName.toLowerCase();var f=void 0,g=B[d],j=void 0;B[d]||(f=c.body||c.documentElement,j=c.createElement(d),b.prepend(j,f),g=b.css(j,"display"),f.removeChild(j),B[d]=g);d=g;b.data(h,o,d);h[m].display=d}},hide:function(a){var a=
b.query(a),c,d;for(d=a.length-1;0<=d;d--){c=a[d];var h=c[m],e=h.display;"none"!==e&&(e&&b.data(c,o,e),h.display="none")}},toggle:function(a){var a=b.query(a),c,d;for(d=a.length-1;0<=d;d--)c=a[d],"none"===b.css(c,"display")?b.show(c):b.hide(c)},addStyleSheet:function(a,c,d){a=a||f;"string"==typeof a&&(d=c,c=a,a=f);var a=b.get(a),a=b.getWindow(a).document,h;if(d&&(d=d.replace("#",x)))h=b.get("#"+d,a);h||(h=b.create("<style>",{id:d},a),b.get("head",a).appendChild(h),h.styleSheet?h.styleSheet.cssText=
c:h.appendChild(a.createTextNode(c)))},unselectable:function(c){var c=b.query(c),e,f,g=0,j,i;for(f=c.length-1;0<=f;f--)if(e=c[f],d.gecko)e[m].MozUserSelect="none";else if(d.webkit)e[m].KhtmlUserSelect="none";else if(d.ie||d.opera){i=e.getElementsByTagName("*");e.setAttribute("unselectable","on");for(j=["iframe","textarea","input","select"];e=i[g++];)a.inArray(h(e),j)||e.setAttribute("unselectable","on")}},innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,width:0,height:0});a.each([p,"height"],
function(c){b["inner"+a.ucfirst(c)]=function(a){return(a=b.get(a))&&l(a,c,"padding")};b["outer"+a.ucfirst(c)]=function(a,d){var h=b.get(a);return h&&l(h,c,d?"margin":"border")};b[c]=function(a,d){var h=b.css(a,c,d);h&&(h=parseFloat(h));return h}});var D={position:"absolute",visibility:"hidden",display:"block"};a.each(["height","width"],function(a){A[a]={get:function(b,c){return c?l(b,a)+"px":i}}});a.each(["left","top"],function(h){A[h]={get:function(e,f){var g;if(f&&(g=b._getComputedStyle(e,h),"auto"===
g)){g=0;if(a.inArray(b.css(e,"position"),["absolute","fixed"])){g=e["left"===h?"offsetLeft":"offsetTop"];if(d.ie&&9>(c.documentMode||0)||d.opera)g-=e.offsetParent&&e.offsetParent["client"+("left"==h?"Left":"Top")]||0;g-=q(b.css(e,"margin-"+h))||0}g+="px"}return g}}});return b},{requires:["./api"]});
KISSY.add("dom/base/traversal",function(a,b,i){function k(e,f,d,h,c,j,k){if(!(e=b.get(e)))return null;if(0===f)return e;j||(e=e[d]);if(!e)return null;c=c&&b.get(c)||null;f===i&&(f=1);var j=[],p=a.isArray(f),o,q;a.isNumber(f)&&(o=0,q=f,f=function(){return++o===q});for(;e&&e!=c;){if((e.nodeType==l.ELEMENT_NODE||e.nodeType==l.TEXT_NODE&&k)&&g(e,f)&&(!h||h(e)))if(j.push(e),!p)break;e=e[d]}return p?j:j[0]||null}function g(e,f){if(!f)return!0;if(a.isArray(f)){var d,h=f.length;if(!h)return!0;for(d=0;d<h;d++)if(b.test(e,
f[d]))return!0}else if(b.test(e,f))return!0;return!1}function j(e,f,d,h){var c=[],g,j;if((g=e=b.get(e))&&d)g=e.parentNode;if(g){d=a.makeArray(g.childNodes);for(g=0;g<d.length;g++)j=d[g],(h||j.nodeType==l.ELEMENT_NODE)&&j!=e&&c.push(j);f&&(c=b.filter(c,f))}return c}var l=b.NodeType;a.mix(b,{_contains:function(a,b){return!!(a.compareDocumentPosition(b)&16)},closest:function(a,b,d,h){return k(a,b,"parentNode",function(a){return a.nodeType!=l.DOCUMENT_FRAGMENT_NODE},d,!0,h)},parent:function(a,b,d){return k(a,
b,"parentNode",function(a){return a.nodeType!=l.DOCUMENT_FRAGMENT_NODE},d,i)},first:function(a,f,d){a=b.get(a);return k(a&&a.firstChild,f,"nextSibling",i,i,!0,d)},last:function(a,f,d){a=b.get(a);return k(a&&a.lastChild,f,"previousSibling",i,i,!0,d)},next:function(a,b,d){return k(a,b,"nextSibling",i,i,i,d)},prev:function(a,b,d){return k(a,b,"previousSibling",i,i,i,d)},siblings:function(a,b,d){return j(a,b,!0,d)},children:function(a,b){return j(a,b,i)},contents:function(a,b){return j(a,b,i,1)},contains:function(a,
f){a=b.get(a);f=b.get(f);return a&&f?b._contains(a,f):!1},index:function(e,f){var d=b.query(e),h,c=0;h=d[0];if(!f){d=h&&h.parentNode;if(!d)return-1;for(;h=h.previousSibling;)h.nodeType==l.ELEMENT_NODE&&c++;return c}c=b.query(f);return"string"===typeof f?a.indexOf(h,c):a.indexOf(c[0],d)},equals:function(a,f){a=b.query(a);f=b.query(f);if(a.length!=f.length)return!1;for(var d=a.length;0<=d;d--)if(a[d]!=f[d])return!1;return!0}});return b},{requires:["./api"]});
KISSY.add("dom/ie/attr",function(a,b){var i=b._attrHooks,k=b._attrNodeHook,g=b.NodeType,j=b._valHooks,l=b._propFix;if(8>(document.documentMode||a.UA.ie))i.style.set=function(a,b){a.style.cssText=b},a.mix(k,{get:function(a,b){var d=a.getAttributeNode(b);return d&&(d.specified||d.nodeValue)?d.nodeValue:void 0},set:function(a,b,d){var h=a.getAttributeNode(d),c;if(h)h.nodeValue=b;else try{c=a.ownerDocument.createAttribute(d),c.value=b,a.setAttributeNode(c)}catch(g){return a.setAttribute(d,b,0)}}}),a.mix(b._attrFix,
l),i.tabIndex=i.tabindex,a.each("href,src,width,height,colSpan,rowSpan".split(","),function(a){i[a]={get:function(b){b=b.getAttribute(a,2);return b===null?void 0:b}}}),j.button=i.value=k,j.option={get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}};(i.href=i.href||{}).set=function(a,b,d){for(var h=a.childNodes,c,j=h.length,i=0<j,j=j-1;0<=j;j--)h[j].nodeType!=g.TEXT_NODE&&(i=0);i&&(c=a.ownerDocument.createElement("b"),c.style.display="none",a.appendChild(c));a.setAttribute(d,
""+b);c&&a.removeChild(c)};return b},{requires:["dom/base"]});
KISSY.add("dom/ie/create",function(a,b){var i=document.documentMode||a.UA.ie;b._fixCloneAttributes=function(a,e){e.clearAttributes&&e.clearAttributes();e.mergeAttributes&&e.mergeAttributes(a);var f=e.nodeName.toLowerCase(),d=a.childNodes;if("object"===f&&!e.childNodes.length)for(f=0;f<d.length;f++)e.appendChild(d[f].cloneNode(!0));else if("input"===f&&("checkbox"===a.type||"radio"===a.type)){if(a.checked&&(e.defaultChecked=e.checked=a.checked),e.value!==a.value)e.value=a.value}else if("option"===
f)e.selected=a.defaultSelected;else if("input"===f||"textarea"===f)e.defaultValue=a.defaultValue;e.removeAttribute(b.__EXPANDO)};var k=b._creators,g=b._defaultCreator,j=/<tbody/i;8>i&&(k.table=function(i,e){var f=g(i,e);if(j.test(i))return f;var d=f.firstChild,h=a.makeArray(d.childNodes);a.each(h,function(a){"tbody"==b.nodeName(a)&&!a.childNodes.length&&d.removeChild(a)});return f})},{requires:["dom/base"]});KISSY.add("dom/ie",function(a,b){return b},{requires:"./ie/attr,./ie/create,./ie/insertion,./ie/selector,./ie/style,./ie/traversal,./ie/input-selection".split(",")});
KISSY.add("dom/ie/input-selection",function(a,b){function i(a,b){var d=0,h=0,c=a.ownerDocument.selection.createRange(),g=k(a);g.inRange(c)&&(g.setEndPoint("EndToStart",c),d=j(a,g).length,b&&(h=d+j(a,c).length));return[d,h]}function k(a){if("textarea"==a.type){var b=a.document.body.createTextRange();b.moveToElementText(a);return b}return a.createTextRange()}function g(a,b,d){var h=Math.min(b,d),c=Math.max(b,d);return h==c?0:"textarea"==a.type?(a=a.value.substring(h,c).replace(/\r\n/g,"\n").length,
b>d&&(a=-a),a):d-b}function j(a,b){if("textarea"==a.type){var d=b.text,h=b.duplicate();if(0==h.compareEndPoints("StartToEnd",h))return d;h.moveEnd("character",-1);h.text==d&&(d+="\r\n");return d}return b.text}var l=b._propHooks;l.selectionStart={set:function(a,b){var d=a.ownerDocument.selection.createRange();if(k(a).inRange(d)){var h=i(a,1)[1],c=g(a,b,h);d.collapse(!1);d.moveStart("character",-c);b>h&&d.collapse(!0);d.select()}},get:function(a){return i(a)[0]}};l.selectionEnd={set:function(a,b){var d=
a.ownerDocument.selection.createRange();if(k(a).inRange(d)){var h=i(a)[0],c=g(a,h,b);d.collapse(!0);d.moveEnd("character",c);h>b&&d.collapse(!1);d.select()}},get:function(a){return i(a,1)[1]}}},{requires:["dom/base"]});
KISSY.add("dom/ie/insertion",function(a,b){if(8>(document.documentMode||a.UA.ie))b._fixInsertionChecked=function k(a){for(var j=0;j<a.length;j++){var l=a[j];if(l.nodeType==b.NodeType.DOCUMENT_FRAGMENT_NODE)k(l.childNodes);else if("input"==b.nodeName(l)){if("checkbox"===l.type||"radio"===l.type)l.defaultChecked=l.checked}else if(l.nodeType==b.NodeType.ELEMENT_NODE)for(var l=l.getElementsByTagName("input"),e=0;e<l.length;e++)k(l[e])}}},{requires:["dom/base"]});
KISSY.add("dom/ie/selector",function(a,b){var i=a.Env.host.document;b._compareNodeOrder=function(a,b){return a.sourceIndex-b.sourceIndex};i.querySelectorAll||(b._getElementsByClassName=function(a,g,j){if(!j)return[];for(var g=j.getElementsByTagName(g||"*"),j=[],i=0,e=0,f=g.length,d;i<f;++i)d=g[i],b._hasSingleClass(d,a)&&(j[e++]=d);return j});b._getElementsByTagName=function(b,g){var j=a.makeArray(g.getElementsByTagName(b)),i,e,f,d;if(b==="*"){i=[];for(f=e=0;d=j[e++];)d.nodeType===1&&(i[f++]=d);j=
i}return j}},{requires:["dom/base"]});
KISSY.add("dom/ie/style",function(a,b){var i=b._cssProps,k=document.documentMode||a.UA.ie,g=a.Env.host.document,g=g&&g.documentElement,j=/^(top|right|bottom|left)$/,l=b._CUSTOM_STYLES,e=/opacity\s*=\s*([^)]*)/,f=/alpha\([^)]*\)/i;i["float"]="styleFloat";l.backgroundPosition={get:function(a,b){return b?a.currentStyle.backgroundPositionX+" "+a.currentStyle.backgroundPositionY:a.style.backgroundPosition}};try{null==g.style.opacity&&(l.opacity={get:function(a,b){return e.test((b&&a.currentStyle?a.currentStyle.filter:
a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(b,d){var d=parseFloat(d),h=b.style,e=b.currentStyle,g=isNaN(d)?"":"alpha(opacity="+100*d+")",j=a.trim(e&&e.filter||h.filter||"");h.zoom=1;if((1<=d||!g)&&!a.trim(j.replace(f,"")))if(h.removeAttribute("filter"),!g||e&&!e.filter)return;h.filter=f.test(j)?j.replace(f,g):j+(j?", ":"")+g}})}catch(d){}var k=8==k,h={};h.thin=k?"1px":"2px";h.medium=k?"3px":"4px";h.thick=k?"5px":"6px";a.each(["","Top","Left","Right","Bottom"],function(a){var b=
"border"+a+"Width",d="border"+a+"Style";l[b]={get:function(a,c){var f=c?a.currentStyle:0,e=f&&""+f[b]||void 0;e&&0>e.indexOf("px")&&(e=h[e]&&"none"!==f[d]?h[e]:0);return e}}});b._getComputedStyle=function(a,d){var d=i[d]||d,h=a.currentStyle&&a.currentStyle[d];if(b._RE_NUM_NO_PX.test(h)&&!j.test(d)){var e=a.style,f=e.left,g=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left="fontSize"===d?"1em":h||0;h=e.pixelLeft+"px";e.left=f;a.runtimeStyle.left=g}return""===h?"auto":h}},{requires:["dom/base"]});
KISSY.add("dom/ie/traversal",function(a,b){b._contains=function(a,k){a.nodeType==b.NodeType.DOCUMENT_NODE&&(a=a.documentElement);k=k.parentNode;return a==k?!0:k&&k.nodeType==b.NodeType.ELEMENT_NODE?a.contains&&a.contains(k):!1}},{requires:["dom/base"]});KISSY.add("event/base",function(a,b,i,k,g){return a.Event={_Utils:b,_Object:i,_Observer:k,_ObservableEvent:g}},{requires:["./base/utils","./base/object","./base/observer","./base/observable"]});
KISSY.add("event/base/object",function(a){function b(){this.timeStamp=a.now()}var i=function(){return!1},k=function(){return!0};b.prototype={constructor:b,isDefaultPrevented:i,isPropagationStopped:i,isImmediatePropagationStopped:i,preventDefault:function(){this.isDefaultPrevented=k},stopPropagation:function(){this.isPropagationStopped=k},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=k;this.stopPropagation()},halt:function(a){a?this.stopImmediatePropagation():this.stopPropagation();
this.preventDefault()}};return b});
KISSY.add("event/base/observable",function(a){function b(b){a.mix(this,b);this.reset()}b.prototype={constructor:b,hasObserver:function(){return!!this.observers.length},reset:function(){this.observers=[]},removeObserver:function(a){var b,g=this.observers,j=g.length;for(b=0;b<j;b++)if(g[b]==a){g.splice(b,1);break}this.checkMemory()},checkMemory:function(){},findObserver:function(a){var b=this.observers,g;for(g=b.length-1;0<=g;--g)if(a.equals(b[g]))return g;return-1}};return b});
KISSY.add("event/base/observer",function(a){function b(b){a.mix(this,b)}b.prototype={constructor:b,equals:function(b){var k=this;return!!a.reduce(k.keys,function(a,j){return a&&k[j]===b[j]},1)},simpleNotify:function(a,b){var g;g=this.fn.call(this.context||b.currentTarget,a,this.data);this.once&&b.removeObserver(this);return g},notifyInternal:function(a,b){return this.simpleNotify(a,b)},notify:function(a,b){var g;g=a._ks_groups;if(!g||this.groups&&this.groups.match(g))return g=this.notifyInternal(a,
b),!1===g&&a.halt(),g}};return b});
KISSY.add("event/base/utils",function(a){var b,i;return{splitAndRun:i=function(b,g){b=a.trim(b);-1==b.indexOf(" ")?g(b):a.each(b.split(/\s+/),g)},normalizeParam:function(i,g,j){var l=g||{},l=a.isFunction(g)?{fn:g,context:j}:a.merge(l),g=b(i),i=g[0];l.groups=g[1];l.type=i;return l},batchForType:function(b,g){var j=a.makeArray(arguments);i(j[2+g],function(a){var e=[].concat(j);e.splice(0,2);e[g]=a;b.apply(null,e)})},getTypedGroups:b=function(a){if(0>a.indexOf("."))return[a,""];var b=a.match(/([^.]+)?(\..+)?$/),
a=[b[1]];(b=b[2])?(b=b.split(".").sort(),a.push(b.join("."))):a.push("");return a},getGroupsRe:function(a){return RegExp(a.split(".").join(".*\\.")+"(?:\\.|$)")}}});
KISSY.add("event/custom/api-impl",function(a,b,i,k){var g=a.trim,j=i._Utils,l=j.splitAndRun;return a.mix(b,{fire:function(a,b,d){var h=void 0,d=d||{};l(b,function(b){var f,b=j.getTypedGroups(b);f=b[1];b=b[0];f&&(f=j.getGroupsRe(f),d._ks_groups=f);f=(k.getCustomEvent(a,b)||new k({currentTarget:a,type:b})).fire(d);!1!==h&&(h=f)});return h},publish:function(b,f,d){var h;l(f,function(c){h=k.getCustomEvent(b,c,1);a.mix(h,d)});return b},addTarget:function(e,f){var d=b.getTargets(e);a.inArray(f,d)||d.push(f);
return e},removeTarget:function(e,f){var d=b.getTargets(e),h=a.indexOf(f,d);-1!=h&&d.splice(h,1);return e},getTargets:function(a){a["__~ks_bubble_targets"]=a["__~ks_bubble_targets"]||[];return a["__~ks_bubble_targets"]},on:function(a,b,d,h){b=g(b);j.batchForType(function(b,d,h){d=j.normalizeParam(b,d,h);b=d.type;if(b=k.getCustomEvent(a,b,1))b.on(d)},0,b,d,h);return a},detach:function(b,f,d,h){f=g(f);j.batchForType(function(c,d,h){var f=j.normalizeParam(c,d,h);(c=f.type)?(c=k.getCustomEvent(b,c,1))&&
c.detach(f):(c=k.getCustomEvents(b),a.each(c,function(a){a.detach(f)}))},0,f,d,h);return b}})},{requires:["./api","event/base","./observable"]});KISSY.add("event/custom/api",function(){return{}});KISSY.add("event/custom",function(a,b,i,k){var g={};a.each(i,function(b,i){g[i]=function(){var e=a.makeArray(arguments);e.unshift(this);return b.apply(null,e)}});i=a.mix({_ObservableCustomEvent:k,Target:g},i);a.mix(b,{Target:g,custom:i});a.EventTarget=g;return i},{requires:["./base","./custom/api-impl","./custom/observable"]});
KISSY.add("event/custom/object",function(a,b){function i(b){i.superclass.constructor.call(this);a.mix(this,b)}a.extend(i,b._Object);return i},{requires:["event/base"]});
KISSY.add("event/custom/observable",function(a,b,i,k,g){function j(){j.superclass.constructor.apply(this,arguments);this.defaultFn=null;this.defaultTargetOnly=!1;this.bubbles=!0}var l=g._Utils;a.extend(j,g._ObservableEvent,{constructor:j,on:function(a){a=new i(a);-1==this.findObserver(a)&&this.observers.push(a)},checkMemory:function(){var b=this.currentTarget,d=j.getCustomEvents(b);d&&(this.hasObserver()||delete d[this.type],a.isEmptyObject(d)&&delete b[e])},fire:function(a){if(this.hasObserver()||
this.bubbles){var a=a||{},d=this.type,h=this.defaultFn,c,e,g;c=this.currentTarget;var i=a,l;a.type=d;i instanceof k||(i.target=c,i=new k(i));i.currentTarget=c;a=this.notify(i);!1!==l&&(l=a);if(this.bubbles){g=(e=b.getTargets(c))&&e.length||0;for(c=0;c<g&&!i.isPropagationStopped();c++)a=b.fire(e[c],d,i),!1!==l&&(l=a)}h&&!i.isDefaultPrevented()&&(d=j.getCustomEvent(i.target,i.type),(!this.defaultTargetOnly&&!d.defaultTargetOnly||this==i.target)&&h.call(this));return l}},notify:function(a){var b=this.observers,
h,c,e=b.length,g;for(g=0;g<e&&!a.isImmediatePropagationStopped();g++)h=b[g].notify(a,this),!1!==c&&(c=h),!1===h&&a.halt();return c},detach:function(a){var b,h=a.fn,c=a.context,e=this.currentTarget,g=this.observers,a=a.groups;if(g.length){a&&(b=l.getGroupsRe(a));var j,i,k,r,t=g.length;if(h||b){c=c||e;j=a=0;for(i=[];a<t;++a)if(k=g[a],r=k.context||e,c!=r||h&&h!=k.fn||b&&!k.groups.match(b))i[j++]=k;this.observers=i}else this.reset();this.checkMemory()}}});var e="__~ks_custom_events";j.getCustomEvent=
function(a,b,h){var c,e=j.getCustomEvents(a,h);c=e&&e[b];!c&&h&&(c=e[b]=new j({currentTarget:a,type:b}));return c};j.getCustomEvents=function(a,b){!a[e]&&b&&(a[e]={});return a[e]};return j},{requires:["./api","./observer","./object","event/base"]});KISSY.add("event/custom/observer",function(a,b){function i(){i.superclass.constructor.apply(this,arguments)}a.extend(i,b._Observer,{keys:["fn","context","groups"]});return i},{requires:["event/base"]});
KISSY.add("event/dom/base/api",function(a,b,i,k,g,j,l){function e(a,b){var d=k[b]||{};a.originalType||(a.selector?d.delegateFix&&(a.originalType=b,b=d.delegateFix):d.onFix&&(a.originalType=b,b=d.onFix));return b}function f(b,c,d){var f,g,i,d=a.merge(d),c=e(d,c);f=j.getCustomEvents(b,1);if(!(i=f.handle))i=f.handle=function(a){var b=a.type,c=i.currentTarget;if(!(j.triggeredEvent==b||"undefined"==typeof KISSY))if(b=j.getCustomEvent(c,b))return a.currentTarget=c,a=new l(a),b.notify(a)},i.currentTarget=
b;if(!(g=f.events))g=f.events={};f=g[c];f||(f=g[c]=new j({type:c,fn:i,currentTarget:b}),f.setup());f.on(d);b=null}var d=b._Utils;a.mix(b,{add:function(b,c,e,g){c=a.trim(c);b=i.query(b);d.batchForType(function(a,b,c,h){c=d.normalizeParam(b,c,h);b=c.type;for(h=a.length-1;0<=h;h--)f(a[h],b,c)},1,b,c,e,g);return b},remove:function(b,c,f,g){c=a.trim(c);b=i.query(b);d.batchForType(function(b,c,h,f){h=d.normalizeParam(c,h,f);c=h.type;for(f=b.length-1;0<=f;f--){var g=b[f],i=c,k=h,k=a.merge(k),l=void 0,i=
e(k,i),g=j.getCustomEvents(g),l=(g||{}).events;if(g&&l)if(i)(l=l[i])&&l.detach(k);else for(i in l)l[i].detach(k)}},1,b,c,f,g);return b},delegate:function(a,c,d,e,f){return b.add(a,c,{fn:e,context:f,selector:d})},undelegate:function(a,c,d,e,f){return b.remove(a,c,{fn:e,context:f,selector:d})},fire:function(b,c,e,f){var g=void 0,e=e||{};e.synthetic=1;d.splitAndRun(c,function(c){e.type=c;var k,l,t,c=d.getTypedGroups(c);(l=c[1])&&(l=d.getGroupsRe(l));c=c[0];a.mix(e,{type:c,_ks_groups:l});b=i.query(b);
for(l=b.length-1;0<=l;l--)k=b[l],t=j.getCustomEvent(k,c),!f&&!t&&(t=new j({type:c,currentTarget:k})),t&&(k=t.fire(e,f),!1!==g&&(g=k))});return g},fireHandler:function(a,c,d){return b.fire(a,c,d,1)},_clone:function(b,c){var d;(d=j.getCustomEvents(b))&&a.each(d.events,function(b,d){a.each(b.observers,function(a){f(c,d,a)})})},_ObservableDOMEvent:j});b.on=b.add;b.detach=b.remove;return b},{requires:"event/base,dom,./special,./utils,./observable,./object".split(",")});
KISSY.add("event/dom/base",function(a,b,i,k,g,j){a.mix(b,{KeyCodes:i,_DOMUtils:k,Gesture:g,_Special:j});return b},{requires:"event/base,./base/key-codes,./base/utils,./base/gesture,./base/special,./base/api,./base/mouseenter,./base/mousewheel,./base/valuechange".split(",")});KISSY.add("event/dom/base/gesture",function(){return{start:"mousedown",move:"mousemove",end:"mouseup",tap:"click",doubleTap:"dblclick"}});
KISSY.add("event/dom/base/key-codes",function(a){var b=a.UA,i={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,
Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,
WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(a){if(a.altKey&&!a.ctrlKey||a.metaKey||a.keyCode>=i.F1&&a.keyCode<=i.F12)return!1;switch(a.keyCode){case i.ALT:case i.CAPS_LOCK:case i.CONTEXT_MENU:case i.CTRL:case i.DOWN:case i.END:case i.ESC:case i.HOME:case i.INSERT:case i.LEFT:case i.MAC_FF_META:case i.META:case i.NUMLOCK:case i.NUM_CENTER:case i.PAGE_DOWN:case i.PAGE_UP:case i.PAUSE:case i.PRINT_SCREEN:case i.RIGHT:case i.SHIFT:case i.UP:case i.WIN_KEY:case i.WIN_KEY_RIGHT:return!1;
default:return!0}},isCharacterKey:function(a){if(a>=i.ZERO&&a<=i.NINE||a>=i.NUM_ZERO&&a<=i.NUM_MULTIPLY||a>=i.A&&a<=i.Z||b.webkit&&0==a)return!0;switch(a){case i.SPACE:case i.QUESTION_MARK:case i.NUM_PLUS:case i.NUM_MINUS:case i.NUM_PERIOD:case i.NUM_DIVISION:case i.SEMICOLON:case i.DASH:case i.EQUALS:case i.COMMA:case i.PERIOD:case i.SLASH:case i.APOSTROPHE:case i.SINGLE_QUOTE:case i.OPEN_SQUARE_BRACKET:case i.BACKSLASH:case i.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};return i});
KISSY.add("event/dom/base/mouseenter",function(a,b,i,k){a.each([{name:"mouseenter",fix:"mouseover"},{name:"mouseleave",fix:"mouseout"}],function(a){k[a.name]={onFix:a.fix,delegateFix:a.fix,handle:function(a,b,e){var f=a.currentTarget,d=a.relatedTarget;if(!d||d!==f&&!i.contains(f,d))return[b.simpleNotify(a,e)]}}});return b},{requires:["./api","dom","./special"]});
KISSY.add("event/dom/base/mousewheel",function(a,b){var i=a.UA.gecko?"DOMMouseScroll":"mousewheel";b.mousewheel={onFix:i,delegateFix:i}},{requires:["./special"]});
KISSY.add("event/dom/base/object",function(a,b,i){function k(a){this.scale=this.rotation=this.targetTouches=this.touches=this.changedTouches=this.which=this.wheelDelta=this.view=this.toElement=this.srcElement=this.shiftKey=this.screenY=this.screenX=this.relatedTarget=this.relatedNode=this.prevValue=this.pageY=this.pageX=this.offsetY=this.offsetX=this.newValue=this.metaKey=this.keyCode=this.handler=this.fromElement=this.eventPhase=this.detail=this.data=this.ctrlKey=this.clientY=this.clientX=this.charCode=
this.cancelable=this.button=this.bubbles=this.attrName=this.attrChange=this.altKey=i;k.superclass.constructor.call(this);this.originalEvent=a;this.isDefaultPrevented=a.defaultPrevented||a.returnValue===f||a.getPreventDefault&&a.getPreventDefault()?function(){return e}:function(){return f};g(this);j(this)}function g(a){for(var b=a.originalEvent,e=d.length,f,g=b.currentTarget,g=9===g.nodeType?g:g.ownerDocument||l;e;)f=d[--e],a[f]=b[f];a.target||(a.target=a.srcElement||g);3===a.target.nodeType&&(a.target=
a.target.parentNode);!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);a.pageX===i&&a.clientX!==i&&(b=g.documentElement,e=g.body,a.pageX=a.clientX+(b&&b.scrollLeft||e&&e.scrollLeft||0)-(b&&b.clientLeft||e&&e.clientLeft||0),a.pageY=a.clientY+(b&&b.scrollTop||e&&e.scrollTop||0)-(b&&b.clientTop||e&&e.clientTop||0));a.which===i&&(a.which=a.charCode===i?a.keyCode:a.charCode);a.metaKey===i&&(a.metaKey=a.ctrlKey);!a.which&&a.button!==i&&(a.which=a.button&
1?1:a.button&2?3:a.button&4?2:0)}function j(b){var c,d,e,f=b.detail;b.wheelDelta&&(e=b.wheelDelta/120);b.detail&&(e=-(0==f%3?f/3:f));b.axis!==i&&(b.axis===b.HORIZONTAL_AXIS?(d=0,c=-1*e):b.axis===b.VERTICAL_AXIS&&(c=0,d=e));b.wheelDeltaY!==i&&(d=b.wheelDeltaY/120);b.wheelDeltaX!==i&&(c=-1*b.wheelDeltaX/120);!c&&!d&&(d=e);(c!==i||d!==i||e!==i)&&a.mix(b,{deltaY:d,delta:e,deltaX:c})}var l=a.Env.host.document,e=!0,f=!1,d="type,altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,pageX,pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which,axis,changedTouches,touches,targetTouches,rotation,scale".split(",");
a.extend(k,b._Object,{constructor:k,preventDefault:function(){var a=this.originalEvent;a.preventDefault?a.preventDefault():a.returnValue=f;k.superclass.preventDefault.call(this)},stopPropagation:function(){var a=this.originalEvent;a.stopPropagation?a.stopPropagation():a.cancelBubble=e;k.superclass.stopPropagation.call(this)}});return b.DOMEventObject=k},{requires:["event/base"]});
KISSY.add("event/dom/base/observable",function(a,b,i,k,g,j,l){function e(b){a.mix(this,b);this.reset()}var f=l._Utils;a.extend(e,l._ObservableEvent,{setup:function(){var a=this.type,b=i[a]||{},c=this.currentTarget,e=k.data(c).handle;(!b.setup||!1===b.setup.call(c,a))&&k.simpleAdd(c,a,e)},constructor:e,reset:function(){e.superclass.reset.call(this);this.lastCount=this.delegateCount=0},notify:function(a){var h=a.target,c=this.currentTarget,e=this.observers,f=[],g,j,i=this.delegateCount||0,l,k;if(i&&
!h.disabled)for(;h!=c;){l=[];for(j=0;j<i;j++)k=e[j],b.test(h,k.selector)&&l.push(k);l.length&&f.push({currentTarget:h,currentTargetObservers:l});h=h.parentNode||c}f.push({currentTarget:c,currentTargetObservers:e.slice(i)});j=0;for(h=f.length;!a.isPropagationStopped()&&j<h;++j){c=f[j];l=c.currentTargetObservers;c=c.currentTarget;a.currentTarget=c;for(c=0;!a.isImmediatePropagationStopped()&&c<l.length;c++)e=l[c],e=e.notify(a,this),!1!==g&&(g=e)}return g},fire:function(d,h){var d=d||{},c=this.type,f=
i[c];f&&f.onFix&&(c=f.onFix);var g,l,f=this.currentTarget,k=!0;d.type=c;d instanceof j||(l=d,d=new j({currentTarget:f,target:f}),a.mix(d,l));l=f;g=b.getWindow(l.ownerDocument||l);var q=g.document,r=[],t=0,s="on"+c;do r.push(l),l=l.parentNode||l.ownerDocument||l===q&&g;while(l);l=r[t];do{d.currentTarget=l;if(g=e.getCustomEvent(l,c))g=g.notify(d),!1!==k&&(k=g);l[s]&&!1===l[s].call(l)&&d.preventDefault();l=r[++t]}while(!h&&l&&!d.isPropagationStopped());if(!h&&!d.isDefaultPrevented()){var u;try{if(s&&
f[c]&&("focus"!==c&&"blur"!==c||0!==f.offsetWidth)&&!a.isWindow(f))(u=f[s])&&(f[s]=null),e.triggeredEvent=c,f[c]()}catch(v){}u&&(f[s]=u);e.triggeredEvent=""}return k},on:function(a){var b=this.observers,c=i[this.type]||{},a=a instanceof g?a:new g(a);-1==this.findObserver(a)&&(a.selector?(b.splice(this.delegateCount,0,a),this.delegateCount++):a.last?(b.push(a),this.lastCount++):b.splice(b.length-this.lastCount,0,a),c.add&&c.add.call(this.currentTarget,a))},detach:function(a){var b,c=i[this.type]||
{},e="selector"in a,g=a.selector,j=a.context,l=a.fn,k=this.currentTarget,r=this.observers,a=a.groups;if(r.length){a&&(b=f.getGroupsRe(a));var t,s,u,v,x=r.length;if(l||e||b){j=j||k;t=a=0;for(s=[];a<x;++a)u=r[a],v=u.context||k,j!=v||l&&l!=u.fn||e&&(g&&g!=u.selector||!g&&!u.selector)||b&&!u.groups.match(b)?s[t++]=u:(u.selector&&this.delegateCount&&this.delegateCount--,u.last&&this.lastCount&&this.lastCount--,c.remove&&c.remove.call(k,u));this.observers=s}else this.reset();this.checkMemory()}},checkMemory:function(){var b=
this.type,h,c,e=i[b]||{},f=this.currentTarget,g=k.data(f);if(g&&(h=g.events,this.hasObserver()||(c=g.handle,(!e.tearDown||!1===e.tearDown.call(f,b))&&k.simpleRemove(f,b,c),delete h[b]),a.isEmptyObject(h)))g.handle=null,k.removeData(f)}});e.triggeredEvent="";e.getCustomEvent=function(a,b){var c=k.data(a),e;c&&(e=c.events);if(e)return e[b]};e.getCustomEvents=function(a,b){var c=k.data(a);!c&&b&&k.data(a,c={});return c};return e},{requires:"dom,./special,./utils,./observer,./object,event/base".split(",")});
KISSY.add("event/dom/base/observer",function(a,b,i){function k(a){k.superclass.constructor.apply(this,arguments)}a.extend(k,i._Observer,{keys:"fn,selector,data,context,originalType,groups,last".split(","),notifyInternal:function(a,j){var i,e,f=a.type;this.originalType&&(a.type=this.originalType);(i=b[a.type])&&i.handle?(i=i.handle(a,this,j))&&0<i.length&&(e=i[0]):e=this.simpleNotify(a,j);a.type=f;return e}});return k},{requires:["./special","event/base"]});KISSY.add("event/dom/base/special",function(){return{}});
KISSY.add("event/dom/base/utils",function(a,b){var i=a.Env.host.document;return{simpleAdd:i&&i.addEventListener?function(a,b,j,i){a.addEventListener&&a.addEventListener(b,j,!!i)}:function(a,b,j){a.attachEvent&&a.attachEvent("on"+b,j)},simpleRemove:i&&i.removeEventListener?function(a,b,j,i){a.removeEventListener&&a.removeEventListener(b,j,!!i)}:function(a,b,j){a.detachEvent&&a.detachEvent("on"+b,j)},data:function(a,g){return b.data(a,"ksEventTargetId_1.30",g)},removeData:function(a){return b.removeData(a,
"ksEventTargetId_1.30")}}},{requires:["dom"]});
KISSY.add("event/dom/base/valuechange",function(a,b,i,k){function g(a){if(i.hasData(a,p)){var b=i.data(a,p);clearTimeout(b);i.removeData(a,p)}}function j(a){g(a.target)}function l(a){var d=a.value,h=i.data(a,n);d!==h&&(b.fireHandler(a,c,{prevVal:h,newVal:d}),i.data(a,n,d))}function e(a){i.hasData(a,p)||i.data(a,p,setTimeout(function(){l(a);i.data(a,p,setTimeout(arguments.callee,o))},o))}function f(a){var b=a.target;"focus"==a.type&&i.data(b,n,b.value);e(b)}function d(a){l(a.target)}function h(a){i.removeData(a,
n);g(a);b.remove(a,"blur",j);b.remove(a,"webkitspeechchange",d);b.remove(a,"mousedown keyup keydown focus",f)}var c="valuechange",m=i.nodeName,n="event/valuechange/history",p="event/valuechange/poll",o=50;k[c]={setup:function(){var a=m(this);if("input"==a||"textarea"==a)h(this),b.on(this,"blur",j),b.on(this,"webkitspeechchange",d),b.on(this,"mousedown keyup keydown focus",f)},tearDown:function(){h(this)}};return b},{requires:["./api","dom","./special"]});
KISSY.add("event/dom/focusin",function(a,b){var i=b._Special;a.each([{name:"focusin",fix:"focus"},{name:"focusout",fix:"blur"}],function(k){function g(a){return b.fire(a.target,k.name)}var j=a.guid("attaches_"+a.now()+"_");i[k.name]={setup:function(){var a=this.ownerDocument||this;j in a||(a[j]=0);a[j]+=1;1===a[j]&&a.addEventListener(k.fix,g,!0)},tearDown:function(){var a=this.ownerDocument||this;a[j]-=1;0===a[j]&&a.removeEventListener(k.fix,g,!0)}}});return b},{requires:["event/dom/base"]});
KISSY.add("event/dom/hashchange",function(a,b,i){var k=a.UA,g=b._Special,j=a.Env.host,l=j.document,e=l&&l.documentMode,f="__replace_history_"+a.now(),k=e||k.ie;b.REPLACE_HISTORY=f;var d="<html><head><title>"+(l&&l.title||"")+" - {hash}</title>{head}</head><body>{hash}</body></html>",h=function(){return"#"+(new a.Uri(location.href)).getFragment()},c,m,n=function(){var b=h(),d;if(d=a.endsWith(b,f))b=b.slice(0,-f.length),location.hash=b;b!==m&&(m=b,p(b,d));c=setTimeout(n,50)},p=k&&8>k?function(b,c){var h=
a.substitute(d,{hash:a.escapeHTML(b),head:i.isCustomDomain()?"<script>document.domain = '"+l.domain+"';<\/script>":""}),e=r.contentWindow.document;try{c?e.open("text/html","replace"):e.open(),e.write(h),e.close()}catch(f){}}:function(){b.fireHandler(j,"hashchange")},o=function(){c||n()},q=function(){c&&clearTimeout(c);c=0},r;k&&8>k&&(o=function(){if(!r){var c=i.getEmptyIframeSrc();r=i.create("<iframe "+(c?'src="'+c+'"':"")+' style="display: none" height="0" width="0" tabindex="-1" title="empty"/>');
i.prepend(r,l.documentElement);b.add(r,"load",function(){b.remove(r,"load");p(h());b.add(r,"load",d);n()});l.onpropertychange=function(){try{"title"===event.propertyName&&(r.contentWindow.document.title=l.title+" - "+h())}catch(a){}};var d=function(){var c=a.trim(r.contentWindow.document.body.innerText),d=h();c!=d&&(m=location.hash=c);b.fireHandler(j,"hashchange")}}},q=function(){c&&clearTimeout(c);c=0;b.detach(r);i.remove(r);r=0});g.hashchange={setup:function(){if(this===j){m=h();o()}},tearDown:function(){this===
j&&q()}}},{requires:["event/dom/base","dom"]});
KISSY.add("event/dom/ie/change",function(a,b,i){function k(a){a=a.type;return"checkbox"==a||"radio"==a}function g(a){"checked"==a.originalEvent.propertyName&&(this.__changed=1)}function j(a){this.__changed&&(this.__changed=0,b.fire(this,"change",a))}function l(a){a=a.target;f.test(a.nodeName)&&!a.__changeHandler&&(a.__changeHandler=1,b.on(a,"change",{fn:e,last:1}))}function e(a){if(!a.isPropagationStopped()&&!k(this)){var h;(h=this.parentNode)&&b.fire(h,"change",a)}}var f=/^(?:textarea|input|select)$/i;
b._Special.change={setup:function(){if(f.test(this.nodeName))if(k(this))b.on(this,"propertychange",g),b.on(this,"click",j);else return!1;else b.on(this,"beforeactivate",l)},tearDown:function(){if(f.test(this.nodeName))if(k(this))b.remove(this,"propertychange",g),b.remove(this,"click",j);else return!1;else b.remove(this,"beforeactivate",l),a.each(i.query("textarea,input,select",this),function(a){a.__changeHandler&&(a.__changeHandler=0,b.remove(a,"change",{fn:e,last:1}))})}}},{requires:["event/dom/base",
"dom"]});KISSY.add("event/dom/ie",function(){},{requires:["./ie/change","./ie/submit"]});
KISSY.add("event/dom/ie/submit",function(a,b,i){function k(a){var a=a.target,e=j(a);if((a="input"==e||"button"==e?a.form:null)&&!a.__submit__fix)a.__submit__fix=1,b.on(a,"submit",{fn:g,last:1})}function g(a){this.parentNode&&!a.isPropagationStopped()&&!a.synthetic&&b.fire(this.parentNode,"submit",a)}var j=i.nodeName;b._Special.submit={setup:function(){if("form"==j(this))return!1;b.on(this,"click keypress",k)},tearDown:function(){if("form"==j(this))return!1;b.remove(this,"click keypress",k);a.each(i.query("form",
this),function(a){a.__submit__fix&&(a.__submit__fix=0,b.remove(a,"submit",{fn:g,last:1}))})}}},{requires:["event/dom/base","dom"]});
KISSY.add("event/dom/shake",function(a,b,i){function k(a){var b=a.accelerationIncludingGravity,a=b.x,g=b.y,b=b.z,k;f!==i&&(k=c(m(a-f),m(g-d),m(b-h)),k>j&&p(),k>l&&(e=1));f=a;d=g;h=b}var g=b._Special,j=5,l=20,e=0,f,d,h,c=Math.max,m=Math.abs,n=a.Env.host,p=a.buffer(function(){e&&(b.fireHandler(n,"shake",{accelerationIncludingGravity:{x:f,y:d,z:h}}),f=i,e=0)},250);g.shake={setup:function(){this==n&&n.addEventListener("devicemotion",k,!1)},tearDown:function(){this==n&&(p.stop(),f=i,e=0,n.removeEventListener("devicemotion",
k,!1))}}},{requires:["event/dom/base"]});
KISSY.add("event/dom/touch/double-tap",function(a,b,i,k){function g(){}a.extend(g,k,{onTouchStart:function(a){if(!1===g.superclass.onTouchStart.apply(this,arguments))return!1;this.startTime=a.timeStamp;this.singleTapTimer&&(clearTimeout(this.singleTapTimer),this.singleTapTimer=0)},onTouchMove:function(){return!1},onTouchEnd:function(a){var b=this.lastEndTime,e=a.timeStamp,f=a.target,d=a.changedTouches[0],h=e-this.startTime;this.lastEndTime=e;if(b&&(h=e-b,300>h)){this.lastEndTime=0;i.fire(f,"doubleTap",
{touch:d,duration:h/1E3});return}h=e-this.startTime;300<h?i.fire(f,"singleTap",{touch:d,duration:h/1E3}):this.singleTapTimer=setTimeout(function(){i.fire(f,"singleTap",{touch:d,duration:h/1E3})},300)}});b.singleTap=b.doubleTap={handle:new g};return g},{requires:["./handle-map","event/dom/base","./single-touch"]});
KISSY.add("event/dom/touch/gesture",function(a,b){var i=b.Gesture,k,g,j;a.Features.isTouchSupported()&&(k="touchstart",g="touchmove",j="touchend");k&&(i.start=k,i.move=g,i.end=j,i.tap="tap",i.doubleTap="doubleTap");return i},{requires:["event/dom/base"]});KISSY.add("event/dom/touch/handle-map",function(){return{}});
KISSY.add("event/dom/touch/handle",function(a,b,i,k,g){function j(a){this.doc=a;this.eventHandle={};this.init()}var l=a.guid("touch-handle"),e=a.Features,f={};f[g.start]="onTouchStart";f[g.move]="onTouchMove";f[g.end]="onTouchEnd";"mousedown"!==g.start&&(f.touchcancel="onTouchEnd");var d=a.throttle(function(a){this.callEventHandle("onTouchMove",a)},30);j.prototype={init:function(){var a=this.doc,b,d;for(b in f){d=f[b];k.on(a,b,this[d],this)}},normalize:function(a){var b=a.type,d;if(!e.isTouchSupported()){if(b.indexOf("mouse")!=
-1&&a.which!=1)return;d=[a];b=!b.match(/up$/i);a.touches=b?d:[];a.targetTouches=b?d:[];a.changedTouches=d}return a},onTouchMove:function(a){d.call(this,a)},onTouchStart:function(a){var b,d,e=this.eventHandle;for(b in e){d=e[b].handle;d.isActive=1}this.callEventHandle("onTouchStart",a)},onTouchEnd:function(a){this.callEventHandle("onTouchEnd",a)},callEventHandle:function(a,b){var d=this.eventHandle,e,f;if(b=this.normalize(b)){for(e in d){f=d[e].handle;if(!f.processed){f.processed=1;if(f.isActive&&
f[a](b)===false)f.isActive=0}}for(e in d){f=d[e].handle;f.processed=0}}},addEventHandle:function(a){var b=this.eventHandle,d=i[a].handle;b[a]?b[a].count++:b[a]={count:1,handle:d}},removeEventHandle:function(a){var b=this.eventHandle;if(b[a]){b[a].count--;b[a].count||delete b[a]}},destroy:function(){var a=this.doc,b,d;for(b in f){d=f[b];k.detach(a,b,this[d],this)}}};return{addDocumentHandle:function(a,c){var d=b.getWindow(a.ownerDocument||a).document,e=i[c].setup,f=b.data(d,l);f||b.data(d,l,f=new j(d));
e&&e.call(a,c);f.addEventHandle(c)},removeDocumentHandle:function(d,c){var e=b.getWindow(d.ownerDocument||d).document,f=i[c].tearDown,g=b.data(e,l);f&&f.call(d,c);if(g){g.removeEventHandle(c);if(a.isEmptyObject(g.eventHandle)){g.destroy();b.removeData(e,l)}}}}},{requires:"dom,./handle-map,event/dom/base,./gesture,./tap,./swipe,./double-tap,./pinch,./tap-hold,./rotate".split(",")});
KISSY.add("event/dom/touch/multi-touch",function(a,b){function i(){}i.prototype={requiredTouchCount:2,onTouchStart:function(a){var b=this.requiredTouchCount,j=a.touches.length;j===b?this.start():j>b&&this.end(a)},onTouchEnd:function(a){this.end(a)},start:function(){this.isTracking||(this.isTracking=!0,this.isStarted=!1)},fireEnd:a.noop,getCommonTarget:function(a){var g=a.touches,a=g[0].target,g=g[1].target;if(a==g||b.contains(a,g))return a;for(;;){if(b.contains(g,a))return g;g=g.parentNode}},end:function(a){this.isTracking&&
(this.isTracking=!1,this.isStarted&&(this.isStarted=!1,this.fireEnd(a)))}};return i},{requires:["dom"]});
KISSY.add("event/dom/touch/pinch",function(a,b,i,k,g){function j(){}function l(a){(!a.touches||2==a.touches.length)&&a.preventDefault()}a.extend(j,k,{onTouchMove:function(b){if(this.isTracking){var f=b.touches,d,h=f[0],c=f[1];d=h.pageX-c.pageX;h=h.pageY-c.pageY;d=Math.sqrt(d*d+h*h);this.lastTouches=f;this.isStarted?i.fire(this.target,"pinch",a.mix(b,{distance:d,scale:d/this.startDistance})):(this.isStarted=!0,this.startDistance=d,f=this.target=this.getCommonTarget(b),i.fire(f,"pinchStart",a.mix(b,
{distance:d,scale:1})))}},fireEnd:function(b){i.fire(this.target,"pinchEnd",a.mix(b,{touches:this.lastTouches}))}});k=new j;b.pinchStart=b.pinchEnd={handle:k};b.pinch={handle:k,setup:function(){i.on(this,g.move,l)},tearDown:function(){i.detach(this,g.move,l)}};return j},{requires:["./handle-map","event/dom/base","./multi-touch","./gesture"]});
KISSY.add("event/dom/touch/rotate",function(a,b,i,k,g,j){function l(){}function e(a){(!a.touches||2==a.touches.length)&&a.preventDefault()}var f=180/Math.PI;a.extend(l,i,{onTouchMove:function(b){if(this.isTracking){var e=b.touches,c=e[0],g=e[1],i=this.lastAngle,c=Math.atan2(g.pageY-c.pageY,g.pageX-c.pageX)*f;if(i!==j){var g=Math.abs(c-i),l=(c+360)%360,o=(c-360)%360;Math.abs(l-i)<g?c=l:Math.abs(o-i)<g&&(c=o)}this.lastTouches=e;this.lastAngle=c;this.isStarted?k.fire(this.target,"rotate",a.mix(b,{angle:c,
rotation:c-this.startAngle})):(this.isStarted=!0,this.startAngle=c,this.target=this.getCommonTarget(b),k.fire(this.target,"rotateStart",a.mix(b,{angle:c,rotation:0})))}},end:function(){this.lastAngle=j;l.superclass.end.apply(this,arguments)},fireEnd:function(b){k.fire(this.target,"rotateEnd",a.mix(b,{touches:this.lastTouches}))}});i=new l;b.rotateEnd=b.rotateStart={handle:i};b.rotate={handle:i,setup:function(){k.on(this,g.move,e)},tearDown:function(){k.detach(this,g.move,e)}};return l},{requires:["./handle-map",
"./multi-touch","event/dom/base","./gesture"]});KISSY.add("event/dom/touch/single-touch",function(a){function b(){}b.prototype={requiredTouchCount:1,onTouchStart:function(a){if(a.touches.length!=this.requiredTouchCount)return!1;this.lastTouches=a.touches},onTouchMove:a.noop,onTouchEnd:a.noop};return b});
KISSY.add("event/dom/touch/swipe",function(a,b,i,k){function g(a,b,c){var g=b.changedTouches[0],j=g.pageX-a.startX,k=g.pageY-a.startY,o=Math.abs(j),q=Math.abs(k);if(c)a.isVertical&&a.isHorizontal&&(q>o?a.isHorizontal=0:a.isVertical=0);else if(a.isVertical&&q<f&&(a.isVertical=0),a.isHorizontal&&o<f)a.isHorizontal=0;if(a.isHorizontal)j=0>j?"left":"right";else if(a.isVertical)j=0>k?"up":"down",o=q;else return!1;i.fire(b.target,c?e:l,{originalEvent:b.originalEvent,touch:g,direction:j,distance:o,duration:(b.timeStamp-
a.startTime)/1E3})}function j(){}var l="swipe",e="swiping",f=50;a.extend(j,k,{onTouchStart:function(a){if(!1===j.superclass.onTouchStart.apply(this,arguments))return!1;var b=a.touches[0];this.startTime=a.timeStamp;this.isVertical=this.isHorizontal=1;this.startX=b.pageX;this.startY=b.pageY;-1!=a.type.indexOf("mouse")&&a.preventDefault()},onTouchMove:function(a){var b=a.changedTouches[0],c=b.pageY-this.startY,b=Math.abs(b.pageX-this.startX),c=Math.abs(c);if(1E3<a.timeStamp-this.startTime)return!1;this.isVertical&&
35<b&&(this.isVertical=0);this.isHorizontal&&35<c&&(this.isHorizontal=0);return g(this,a,1)},onTouchEnd:function(a){return!1===this.onTouchMove(a)?!1:g(this,a,0)}});b[l]=b[e]={handle:new j};return j},{requires:["./handle-map","event/dom/base","./single-touch"]});
KISSY.add("event/dom/touch/tap-hold",function(a,b,i,k,g){function j(){}function l(a){(!a.touches||1==a.touches.length)&&a.preventDefault()}a.extend(j,i,{onTouchStart:function(b){if(!1===j.superclass.onTouchStart.call(this,b))return!1;this.timer=setTimeout(function(){k.fire(b.target,"tapHold",{touch:b.touches[0],duration:(a.now()-b.timeStamp)/1E3})},1E3)},onTouchMove:function(){clearTimeout(this.timer);return!1},onTouchEnd:function(){clearTimeout(this.timer)}});b.tapHold={setup:function(){k.on(this,
g.start,l)},tearDown:function(){k.detach(this,g.start,l)},handle:new j};return j},{requires:["./handle-map","./single-touch","event/dom/base","./gesture"]});KISSY.add("event/dom/touch/tap",function(a,b,i,k){function g(){}a.extend(g,k,{onTouchMove:function(){return!1},onTouchEnd:function(a){i.fire(a.target,"tap",{touch:a.changedTouches[0]})}});b.tap={handle:new g};return g},{requires:["./handle-map","event/dom/base","./single-touch"]});
KISSY.add("event/dom/touch",function(a,b,i,k){var a=b._Special,b={setup:function(a){k.addDocumentHandle(this,a)},tearDown:function(a){k.removeDocumentHandle(this,a)}},g;for(g in i)a[g]=b},{requires:["event/dom/base","./touch/handle-map","./touch/handle"]});
KISSY.add("json/json2",function(){function a(a){return 10>a?"0"+a:a}function b(a){j.lastIndex=0;return j.test(a)?'"'+a.replace(j,function(a){var b=f[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function i(a,c){var f,g,j,k,q=l,r,t=c[a];t&&"object"===typeof t&&"function"===typeof t.toJSON&&(t=t.toJSON(a));"function"===typeof d&&(t=d.call(c,a,t));switch(typeof t){case "string":return b(t);case "number":return isFinite(t)?""+t:"null";case "boolean":case "null":return""+
t;case "object":if(!t)return"null";l+=e;r=[];if("[object Array]"===Object.prototype.toString.apply(t)){k=t.length;for(f=0;f<k;f+=1)r[f]=i(f,t)||"null";j=0===r.length?"[]":l?"[\n"+l+r.join(",\n"+l)+"\n"+q+"]":"["+r.join(",")+"]";l=q;return j}if(d&&"object"===typeof d){k=d.length;for(f=0;f<k;f+=1)g=d[f],"string"===typeof g&&(j=i(g,t))&&r.push(b(g)+(l?": ":":")+j)}else for(g in t)Object.hasOwnProperty.call(t,g)&&(j=i(g,t))&&r.push(b(g)+(l?": ":":")+j);j=0===r.length?"{}":l?"{\n"+l+r.join(",\n"+l)+"\n"+
q+"}":"{"+r.join(",")+"}";l=q;return j}}var k={};"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var g=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
j=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l,e,f={"":"\\b","\t":"\\t","\n":"\\n","":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d;k.stringify=function(a,b,f){var g;e=l="";if(typeof f==="number")for(g=0;g<f;g=g+1)e=e+" ";else typeof f==="string"&&(e=f);if((d=b)&&typeof b!=="function"&&(typeof b!=="object"||typeof b.length!=="number"))throw Error("JSON.stringify");return i("",{"":a})};k.parse=function(a,b){function d(a,
f){var e,h,g=a[f];if(g&&typeof g==="object")for(e in g)if(Object.hasOwnProperty.call(g,e)){h=d(g,e);h!==void 0?g[e]=h:delete g[e]}return b.call(a,f,g)}var f,a=""+a;g.lastIndex=0;g.test(a)&&(a=a.replace(g,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){f=eval("("+a+")");return typeof b===
"function"?d({"":f},""):f}throw new SyntaxError("JSON.parse");};return k});KISSY.add("json",function(a,b){b||(b=JSON);return a.JSON={parse:function(a){return null==a||""===a?null:b.parse(a)},stringify:b.stringify}},{requires:[KISSY.Features.isNativeJSONSupported()?"":"json/json2"]});
KISSY.add("ajax",function(a,b,i){function k(b,l,e,f,d){a.isFunction(l)&&(f=e,e=l,l=g);return i({type:d||"get",url:b,data:l,success:e,dataType:f})}var g=void 0;a.mix(i,{serialize:b.serialize,get:k,post:function(b,i,e,f){a.isFunction(i)&&(f=e,e=i,i=g);return k(b,i,e,f,"post")},jsonp:function(b,i,e){a.isFunction(i)&&(e=i,i=g);return k(b,i,e,"jsonp")},getScript:a.getScript,getJSON:function(b,i,e){a.isFunction(i)&&(e=i,i=g);return k(b,i,e,"json")},upload:function(b,k,e,f,d){a.isFunction(e)&&(d=f,f=e,e=
g);return i({url:b,type:"post",dataType:d,form:k,data:e,success:f})}});a.mix(a,{Ajax:i,IO:i,ajax:i,io:i,jsonp:i.jsonp});return i},{requires:"ajax/form-serializer,ajax/base,ajax/xhr-transport,ajax/script-transport,ajax/jsonp,ajax/form,ajax/iframe-transport,ajax/methods".split(",")});
KISSY.add("ajax/base",function(a,b,i,k){function g(b){var d=b.context;delete b.context;b=a.mix(a.clone(p),b,{deep:!0});b.context=d||b;var e,h=b.type,g=b.dataType,d=b.uri=m.resolve(b.url);b.uri.setQuery("");"crossDomain"in b||(b.crossDomain=!b.uri.isSameOriginAs(m));h=b.type=h.toUpperCase();b.hasContent=!c.test(h);if(b.processData&&(e=b.data)&&"string"!=typeof e)b.data=a.param(e,k,k,b.serializeArray);g=b.dataType=a.trim(g||"*").split(f);!("cache"in b)&&a.inArray(g[0],["script","jsonp"])&&(b.cache=
!1);b.hasContent||(b.data&&d.query.add(a.unparam(b.data)),!1===b.cache&&d.query.set("_ksTS",a.now()+"_"+a.guid()));return b}function j(a,b){l.fire(a,{ajaxConfig:b.config,io:b})}function l(b){function c(a){return function(c){if(i=d.timeoutTimer)clearTimeout(i),d.timeoutTimer=0;var f=b[a];f&&f.apply(w,c);j(a,d)}}var d=this;if(!(d instanceof l))return new l(b);h.call(d);b=g(b);a.mix(d,{responseData:null,config:b||{},timeoutTimer:null,responseText:null,responseXML:null,responseHeadersString:"",responseHeaders:null,
requestHeaders:{},readyState:0,state:0,statusText:null,status:0,transport:null,_defer:new a.Defer(this)});var f;j("start",d);f=new (n[b.dataType[0]]||n["*"])(d);d.transport=f;b.contentType&&d.setRequestHeader("Content-Type",b.contentType);var e=b.dataType[0],i,k,m=b.timeout,w=b.context,p=b.headers,y=b.accepts;d.setRequestHeader("Accept",e&&y[e]?y[e]+("*"===e?"":", */*; q=0.01"):y["*"]);for(k in p)d.setRequestHeader(k,p[k]);if(b.beforeSend&&!1===b.beforeSend.call(w,d,b))return d;d.then(c("success"),
c("error"));d.fin(c("complete"));d.readyState=1;j("send",d);b.async&&0<m&&(d.timeoutTimer=setTimeout(function(){d.abort("timeout")},1E3*m));try{d.state=1,f.send()}catch(B){2>d.state&&d._ioReady(-1,B.message)}return d}var e=/^(?:about|app|app\-storage|.+\-extension|file|widget)$/,f=/\s+/,d=function(a){return a},h=a.Promise,c=/^(?:GET|HEAD)$/,m=new a.Uri((a.Env.host.location||{}).href),e=m&&e.test(m.getScheme()),n={},p={type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",async:!0,
serializeArray:!0,processData:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},converters:{text:{json:b.parse,html:d,text:d,xml:a.parseXML}},contents:{xml:/xml/,html:/html/,json:/json/}};p.converters.html=p.converters.text;a.mix(l,i.Target);a.mix(l,{isLocal:e,setupConfig:function(b){a.mix(p,b,{deep:!0})},setupTransport:function(a,b){n[a]=b},getTransport:function(a){return n[a]},getConfig:function(){return p}});return l},
{requires:["json","event"]});
KISSY.add("ajax/form-serializer",function(a,b){function i(a){return a.replace(g,"\r\n")}var k=/^(?:select|textarea)/i,g=/\r?\n/g,j,l=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i;return j={serialize:function(b,f){return a.param(j.getFormData(b),void 0,void 0,f||!1)},getFormData:function(e){var f=[],d={};a.each(b.query(e),function(b){b=b.elements?a.makeArray(b.elements):[b];f.push.apply(f,b)});f=a.filter(f,function(a){return a.name&&!a.disabled&&
(a.checked||k.test(a.nodeName)||l.test(a.type))});a.each(f,function(f){var c=b.val(f),e;null!==c&&(c=a.isArray(c)?a.map(c,i):i(c),(e=d[f.name])?(e&&!a.isArray(e)&&(e=d[f.name]=[e]),e.push.apply(e,a.makeArray(c))):d[f.name]=c)});return d}}},{requires:["dom"]});
KISSY.add("ajax/form",function(a,b,i,k){b.on("start",function(b){var j,l,e,b=b.io.config;if(e=b.form)j=i.get(e),l=j.encoding||j.enctype,e=b.data,"multipart/form-data"!=l.toLowerCase()?(j=k.getFormData(j),b.hasContent?(j=a.param(j,void 0,void 0,b.serializeArray),b.data=e?b.data+("&"+j):j):b.uri.query.add(j)):(e=b.dataType,b=e[0],"*"==b&&(b="text"),e.length=2,e[0]="iframe",e[1]=b)});return b},{requires:["./base","dom","./form-serializer"]});
KISSY.add("ajax/iframe-transport",function(a,b,i,k){function g(f){var d=a.guid("io-iframe"),h=b.getEmptyIframeSrc(),f=f.iframe=b.create("<iframe "+(h?' src="'+h+'" ':"")+' id="'+d+'" name="'+d+'" style="position:absolute;left:-9999px;top:-9999px;"/>');b.prepend(f,e.body||e.documentElement);return f}function j(f,d,h){var c=[],g,j,i,k;a.each(f,function(f,l){g=a.isArray(f);j=a.makeArray(f);for(i=0;i<j.length;i++)k=e.createElement("input"),k.type="hidden",k.name=l+(g&&h?"[]":""),k.value=j[i],b.append(k,
d),c.push(k)});return c}function l(a){this.io=a}var e=a.Env.host.document;k.setupConfig({converters:{iframe:k.getConfig().converters.text,text:{iframe:function(a){return a}},xml:{iframe:function(a){return a}}}});a.augment(l,{send:function(){function f(){i.on(l,"load error",d._callback,d);q.submit()}var d=this,e=d.io,c=e.config,k,l,p,o=c.data,q=b.get(c.form);d.attrs={target:b.attr(q,"target")||"",action:b.attr(q,"action")||"",method:b.attr(q,"method")};d.form=q;l=g(e);b.attr(q,{target:l.id,action:e._getUrlForSend(),
method:"post"});o&&(p=a.unparam(o));p&&(k=j(p,q,c.serializeArray));d.fields=k;6==a.UA.ie?setTimeout(f,0):f()},_callback:function(e){var d=this,h=d.form,c=d.io,e=e.type,g,j=c.iframe;if(j)if("abort"==e&&6==a.UA.ie?setTimeout(function(){b.attr(h,d.attrs)},0):b.attr(h,d.attrs),b.remove(this.fields),i.detach(j),setTimeout(function(){b.remove(j)},30),c.iframe=null,"load"==e)try{if((g=j.contentWindow.document)&&g.body)c.responseText=a.trim(b.text(g.body)),a.startsWith(c.responseText,"<?xml")&&(c.responseText=
void 0);c.responseXML=g&&g.XMLDocument?g.XMLDocument:g;g?c._ioReady(200,"success"):c._ioReady(500,"parser error")}catch(k){c._ioReady(500,"parser error")}else"error"==e&&c._ioReady(500,"error")},abort:function(){this._callback({type:"abort"})}});k.setupTransport("iframe",l);return k},{requires:["dom","event","./base"]});
KISSY.add("ajax/jsonp",function(a,b){var i=a.Env.host;b.setupConfig({jsonp:"callback",jsonpCallback:function(){return a.guid("jsonp")}});b.on("start",function(b){var g=b.io,j=g.config,b=j.dataType;if("jsonp"==b[0]){var l,e=j.jsonpCallback,f=a.isFunction(e)?e():e,d=i[f];j.uri.query.set(j.jsonp,f);i[f]=function(b){1<arguments.length&&(b=a.makeArray(arguments));l=[b]};g.fin(function(){i[f]=d;if(void 0===d)try{delete i[f]}catch(a){}else l&&d(l[0])});g=g.converters=g.converters||{};g.script=g.script||
{};g.script.json=function(){return l[0]};b.length=2;b[0]="script";b[1]="json"}});return b},{requires:["./base"]});
KISSY.add("ajax/methods",function(a,b,i){function k(b){var g=b.responseText,e=b.responseXML,f=b.config,d=f.converters,h=b.converters||{},c,k,n=f.contents,p=f.dataType;if(g||e){for(f=b.mimeType||b.getResponseHeader("Content-Type");"*"==p[0];)p.shift();if(!p.length)for(c in n)if(n[c].test(f)){p[0]!=c&&p.unshift(c);break}p[0]=p[0]||"text";if("text"==p[0]&&g!==i)k=g;else if("xml"==p[0]&&e!==i)k=e;else{var o={text:g,xml:e};a.each(["text","xml"],function(a){var b=p[0];return(h[a]&&h[a][b]||d[a]&&d[a][b])&&
o[a]?(p.unshift(a),k="text"==a?g:e,!1):i})}}n=p[0];for(f=1;f<p.length;f++){c=p[f];var q=h[n]&&h[n][c]||d[n]&&d[n][c];if(!q)throw"no covert for "+n+" => "+c;k=q(k);n=c}b.responseData=k}var g=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg;a.extend(b,a.Promise,{setRequestHeader:function(a,b){this.requestHeaders[a]=b;return this},getAllResponseHeaders:function(){return 2===this.state?this.responseHeadersString:null},getResponseHeader:function(a){var b,e;if(2===this.state){if(!(e=this.responseHeaders))for(e=this.responseHeaders=
{};b=g.exec(this.responseHeadersString);)e[b[1]]=b[2];b=e[a]}return b===i?null:b},overrideMimeType:function(a){this.state||(this.mimeType=a);return this},abort:function(a){a=a||"abort";this.transport&&this.transport.abort(a);this._ioReady(0,a);return this},getNativeXhr:function(){var a;return(a=this.transport)?a.nativeXhr:null},_ioReady:function(a,b){if(2!=this.state){this.state=2;this.readyState=4;var e;if(200<=a&&300>a||304==a)if(304==a)b="not modified",e=!0;else try{k(this),b="success",e=!0}catch(f){b=
"parser error"}else 0>a&&(a=0);this.status=a;this.statusText=b;this._defer[e?"resolve":"reject"]([this.responseData,b,this])}},_getUrlForSend:function(){var b=this.config,g=b.uri,e=a.Uri.getComponents(b.url).query||"";return g.toString(b.serializeArray)+(e?(g.query.has()?"&":"?")+e:e)}})},{requires:["./base"]});
KISSY.add("ajax/script-transport",function(a,b,i,k){function g(a){if(!a.config.crossDomain)return new (b.getTransport("*"))(a);this.io=a;return this}var j=a.Env.host,l=j.document;b.setupConfig({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{text:{script:function(b){a.globalEval(b);return b}}}});a.augment(g,{send:function(){var a=this,b,d=a.io,h=d.config,c=l.head||l.getElementsByTagName("head")[0]||
l.documentElement;a.head=c;b=l.createElement("script");a.script=b;b.async=!0;h.scriptCharset&&(b.charset=h.scriptCharset);b.src=d._getUrlForSend();b.onerror=b.onload=b.onreadystatechange=function(b){b=b||j.event;a._callback((b.type||"error").toLowerCase())};c.insertBefore(b,c.firstChild)},_callback:function(a,b){var d=this.script,h=this.io,c=this.head;if(d&&(b||!d.readyState||/loaded|complete/.test(d.readyState)||"error"==a))d.onerror=d.onload=d.onreadystatechange=null,c&&d.parentNode&&c.removeChild(d),
this.head=this.script=k,!b&&"error"!=a?h._ioReady(200,"success"):"error"==a&&h._ioReady(500,"script error")},abort:function(){this._callback(0,1)}});b.setupTransport("script",g);return b},{requires:["./base","./xhr-transport"]});
KISSY.add("ajax/sub-domain-transport",function(a,b,i,k){function g(a){var b=a.config;this.io=a;b.crossDomain=!1}function j(){var a=this.io.config.uri.getHostname(),a=e[a];a.ready=1;i.detach(a.iframe,"load",j,this);this.send()}var l=a.Env.host.document,e={};a.augment(g,b.proto,{send:function(){var f=this.io.config,d=f.uri,h=d.getHostname(),c;c=e[h];var g="/sub_domain_proxy.html";f.xdr&&f.xdr.subDomain&&f.xdr.subDomain.proxy&&(g=f.xdr.subDomain.proxy);c&&c.ready?(this.nativeXhr=b.nativeXhr(0,c.iframe.contentWindow))&&
this.sendInternal():(c?f=c.iframe:(c=e[h]={},f=c.iframe=l.createElement("iframe"),k.css(f,{position:"absolute",left:"-9999px",top:"-9999px"}),k.prepend(f,l.body||l.documentElement),c=new a.Uri,c.setScheme(d.getScheme()),c.setPort(d.getPort()),c.setHostname(h),c.setPath(g),f.src=c.toString()),i.on(f,"load",j,this))}});return g},{requires:["./xhr-transport-base","event","dom"]});
KISSY.add("ajax/xdr-flash-transport",function(a,b,i){function k(a,b,e){d||(d=!0,a='<object id="'+l+'" type="application/x-shockwave-flash" data="'+a+'" width="0" height="0"><param name="movie" value="'+a+'" /><param name="FlashVars" value="yid='+b+"&uid="+e+'&host=KISSY.IO" /><param name="allowScriptAccess" value="always" /></object>',b=f.createElement("div"),i.prepend(b,f.body||f.documentElement),b.innerHTML=a)}function g(a){this.io=a}var j={},l="io_swf",e,f=a.Env.host.document,d=!1;a.augment(g,
{send:function(){var b=this,c=b.io,d=c.config;k((d.xdr||{}).src||a.Config.base+"ajax/io.swf",1,1);e?(b._uid=a.guid(),j[b._uid]=b,e.send(c._getUrlForSend(),{id:b._uid,uid:b._uid,method:d.type,data:d.hasContent&&d.data||{}})):setTimeout(function(){b.send()},200)},abort:function(){e.abort(this._uid)},_xdrResponse:function(a,b){var d,e=b.id,f,g=b.c,i=this.io;if(g&&(f=g.responseText))i.responseText=decodeURI(f);switch(a){case "success":d={status:200,statusText:"success"};delete j[e];break;case "abort":delete j[e];
break;case "timeout":case "transport error":case "failure":delete j[e],d={status:"status"in g?g.status:500,statusText:g.statusText||a}}d&&i._ioReady(d.status,d.statusText)}});b.applyTo=function(d,c,e){var d=c.split(".").slice(1),f=b;a.each(d,function(a){f=f[a]});f.apply(null,e)};b.xdrReady=function(){e=f.getElementById(l)};b.xdrResponse=function(a,b){var d=j[b.uid];d&&d._xdrResponse(a,b)};return g},{requires:["./base","dom"]});
KISSY.add("ajax/xhr-transport-base",function(a,b){function i(a,b){try{return new (b||g).XMLHttpRequest}catch(c){}}function k(a){var b;a.ifModified&&(b=a.uri,!1===a.cache&&(b=b.clone(),b.query.remove("_ksTS")),b=b.toString());return b}var g=a.Env.host,j=7<a.UA.ie&&g.XDomainRequest,l={proto:{}},e={},f={};b.__lastModifiedCached=e;b.__eTagCached=f;l.nativeXhr=g.ActiveXObject?function(a,e){var c;if(!l.supportCORS&&a&&j)c=new j;else if(!(c=!b.isLocal&&i(a,e)))a:{try{c=new (e||g).ActiveXObject("Microsoft.XMLHTTP");
break a}catch(f){}c=void 0}return c}:i;l._XDomainRequest=j;l.supportCORS="withCredentials"in l.nativeXhr();a.mix(l.proto,{sendInternal:function(){var a=this,b=a.io,c=b.config,g=a.nativeXhr,i=c.type,l=c.async,o,q=b.mimeType,r=b.requestHeaders||{},b=b._getUrlForSend(),t=k(c),s,u;if(t){if(s=e[t])r["If-Modified-Since"]=s;if(s=f[t])r["If-None-Match"]=s}(o=c.username)?g.open(i,b,l,o,c.password):g.open(i,b,l);if(i=c.xhrFields)for(u in i)g[u]=i[u];q&&g.overrideMimeType&&g.overrideMimeType(q);r["X-Requested-With"]||
(r["X-Requested-With"]="XMLHttpRequest");if("undefined"!==typeof g.setRequestHeader)for(u in r)g.setRequestHeader(u,r[u]);g.send(c.hasContent&&c.data||null);!l||4==g.readyState?a._callback():j&&g instanceof j?(g.onload=function(){g.readyState=4;g.status=200;a._callback()},g.onerror=function(){g.readyState=4;g.status=500;a._callback()}):g.onreadystatechange=function(){a._callback()}},abort:function(){this._callback(0,1)},_callback:function(d,g){var c=this.nativeXhr,i=this.io,l,p,o,q,r,t=i.config;try{if(g||
4==c.readyState)if(j&&c instanceof j?(c.onerror=a.noop,c.onload=a.noop):c.onreadystatechange=a.noop,g)4!==c.readyState&&c.abort();else{l=k(t);var s=c.status;j&&c instanceof j||(i.responseHeadersString=c.getAllResponseHeaders());l&&(p=c.getResponseHeader("Last-Modified"),o=c.getResponseHeader("ETag"),p&&(e[l]=p),o&&(f[o]=o));if((r=c.responseXML)&&r.documentElement)i.responseXML=r;i.responseText=c.responseText;try{q=c.statusText}catch(u){q=""}!s&&b.isLocal&&!t.crossDomain?s=i.responseText?200:404:1223===
s&&(s=204);i._ioReady(s,q)}}catch(v){c.onreadystatechange=a.noop,g||i._ioReady(-1,v)}}});return l},{requires:["./base"]});
KISSY.add("ajax/xhr-transport",function(a,b,i,k,g){function j(b){var d=b.config,h=d.crossDomain,c=d.xdr||{},j=c.subDomain=c.subDomain||{};this.io=b;if(h){d=d.uri.getHostname();if(l.domain&&a.endsWith(d,l.domain)&&!1!==j.proxy)return new k(b);if(!i.supportCORS&&("flash"===""+c.use||!e))return new g(b)}this.nativeXhr=i.nativeXhr(h);return this}var l=a.Env.host.document,e=i._XDomainRequest;a.augment(j,i.proto,{send:function(){this.sendInternal()}});b.setupTransport("*",j);return b},{requires:["./base",
"./xhr-transport-base","./sub-domain-transport","./xdr-flash-transport"]});
KISSY.add("cookie",function(a){function b(a){return"string"==typeof a&&""!==a}var i=a.Env.host.document,k=encodeURIComponent,g=a.urlDecode;return a.Cookie={get:function(a){var k,e;if(b(a)&&(e=(""+i.cookie).match(RegExp("(?:^| )"+a+"(?:(?:=([^;]*))|;|$)"))))k=e[1]?g(e[1]):"";return k},set:function(a,g,e,f,d,h){var g=""+k(g),c=e;"number"===typeof c&&(c=new Date,c.setTime(c.getTime()+864E5*e));c instanceof Date&&(g+="; expires="+c.toUTCString());b(f)&&(g+="; domain="+f);b(d)&&(g+="; path="+d);h&&(g+=
"; secure");i.cookie=a+"="+g},remove:function(a,b,e,f){this.set(a,"",-1,b,e,f)}}});
KISSY.add("base/attribute",function(a,b){function i(a,b){return"string"==typeof b?a[b]:b}function k(b,c,d,e,f,g,h){h=h||d;return b.fire(c+a.ucfirst(d)+"Change",{attrName:h,subAttrName:g,prevVal:e,newVal:f})}function g(a,b,c){var d=a[b]||{};c&&(a[b]=d);return d}function j(a){return g(a,"__attrs",!0)}function l(a){return g(a,"__attrVals",!0)}function e(a,c){for(var d=0,e=c.length;a!=b&&d<e;d++)a=a[c[d]];return a}function f(a,b){var c;!a.hasAttr(b)&&-1!==b.indexOf(".")&&(c=b.split("."),b=c.shift());
return{path:c,name:b}}function d(c,d,e){var f=e;if(d){var c=f=c===b?{}:a.clone(c),g=d.length-1;if(0<=g){for(var h=0;h<g;h++)c=c[d[h]];c!=b&&(c[d[h]]=e)}}return f}function h(a,c,g,h,i){var h=h||{},j,m,n;n=f(a,c);var w=c,c=n.name;j=n.path;n=a.get(c);j&&(m=e(n,j));if(!j&&n===g||j&&m===g)return b;g=d(n,j,g);if(!h.silent&&!1===k(a,"before",c,n,g,w))return!1;g=a.setInternal(c,g,h);if(!1===g)return g;h.silent||(g=l(a)[c],k(a,"after",c,n,g,w),i?i.push({prevVal:n,newVal:g,attrName:c,subAttrName:w}):k(a,"",
"*",[n],[g],[w],[c]));return a}function c(){}function m(a,c){var d=j(a),e=g(d,c),f=e.valueFn;if(f&&(f=i(a,f)))f=f.call(a),f!==b&&(e.value=f),delete e.valueFn,d[c]=e;return e.value}function n(a,c,e,h){var k,l;k=f(a,c);c=k.name;if(k=k.path)l=a.get(c),e=d(l,k,e);if((k=g(j(a),c,!0).validator)&&(k=i(a,k)))if(a=k.call(a,e,c,h),a!==b&&!0!==a)return a;return b}c.INVALID={};var p=c.INVALID;c.prototype={getAttrs:function(){return j(this)},getAttrVals:function(){var a={},b,c=j(this);for(b in c)a[b]=this.get(b);
return a},addAttr:function(b,c,d){var e=j(this),c=a.clone(c);e[b]?a.mix(e[b],c,d):e[b]=c;return this},addAttrs:function(b,c){var d=this;a.each(b,function(a,b){d.addAttr(b,a)});c&&d.set(c);return d},hasAttr:function(a){return j(this).hasOwnProperty(a)},removeAttr:function(a){this.hasAttr(a)&&(delete j(this)[a],delete l(this)[a]);return this},set:function(c,d,e){if(a.isPlainObject(c)){var e=d,d=Object(c),f=[],g,i=[];for(c in d)(g=n(this,c,d[c],d))!==b&&i.push(g);if(i.length)return e&&e.error&&e.error(i),
!1;for(c in d)h(this,c,d[c],e,f);var j=[],l=[],m=[],p=[];a.each(f,function(a){l.push(a.prevVal);m.push(a.newVal);j.push(a.attrName);p.push(a.subAttrName)});j.length&&k(this,"","*",l,m,p,j);return this}return h(this,c,d,e)},setInternal:function(a,c,d){var e,f,h=g(j(this),a,!0).setter;f=n(this,a,c);if(f!==b)return d.error&&d.error(f),!1;if(h&&(h=i(this,h)))e=h.call(this,c,a);if(e===p)return!1;e!==b&&(c=e);l(this)[a]=c},get:function(a){var c,d=this.hasAttr(a),f=l(this),h;!d&&-1!==a.indexOf(".")&&(c=
a.split("."),a=c.shift());d=g(j(this),a).getter;h=a in f?f[a]:m(this,a);if(d&&(d=i(this,d)))h=d.call(this,h,a);!(a in f)&&h!==b&&(f[a]=h);c&&(h=e(h,c));return h},reset:function(a,b){if("string"==typeof a)return this.hasAttr(a)?this.set(a,m(this,a),b):this;var b=a,c=j(this),d={};for(a in c)d[a]=m(this,a);this.set(d,b);return this}};return c});
KISSY.add("base",function(a,b,i){function k(a){var b=this.constructor;for(this.userConfig=a;b;){var i=b.ATTRS;if(i){var e=void 0;for(e in i)this.addAttr(e,i[e],!1)}b=b.superclass?b.superclass.constructor:null}if(a)for(var f in a)this.setInternal(f,a[f])}a.augment(k,i.Target,b);k.Attribute=b;return a.Base=k},{requires:["base/attribute","event/custom"]});KISSY.add("anim",function(a,b,i){b.Easing=i;a.mix(a,{Anim:b,Easing:b.Easing});return b},{requires:["anim/base","anim/easing","anim/color","anim/background-position"]});
KISSY.add("anim/background-position",function(a,b,i,k){function g(a){a=a.replace(/left|top/g,"0px").replace(/right|bottom/g,"100%").replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");a=a.match(/(-?[0-9\.]+)(px|%|em|pt)\s(-?[0-9\.]+)(px|%|em|pt)/);return[parseFloat(a[1]),a[2],parseFloat(a[3]),a[4]]}function j(){j.superclass.constructor.apply(this,arguments)}a.extend(j,k,{load:function(){j.superclass.load.apply(this,arguments);this.unit=["px","px"];if(this.from){var a=g(this.from);this.from=[a[0],a[2]]}else this.from=
[0,0];this.to?(a=g(this.to),this.to=[a[0],a[2]],this.unit=[a[1],a[3]]):this.to=[0,0]},interpolate:function(a,b,f){var d=this.unit,g=j.superclass.interpolate;return g(a[0],b[0],f)+d[0]+" "+g(a[1],b[1],f)+d[1]},cur:function(){return b.css(this.anim.config.el,"backgroundPosition")},update:function(){var a=this.prop,e=this.anim.config.el,f=this.interpolate(this.from,this.to,this.pos);b.css(e,a,f)}});return k.Factories.backgroundPosition=j},{requires:["dom","./base","./fx"]});
KISSY.add("anim/base",function(a,b,i,k,g,j,l){function e(c,d,g,h,i){if(c.el)return g=c.el,d=c.props,delete c.el,delete c.props,new e(g,d,c);if(c=b.get(c)){if(!(this instanceof e))return new e(c,d,g,h,i);d="string"==typeof d?a.unparam(""+d,";",":"):a.clone(d);a.each(d,function(b,c){var e=a.trim(o(c));e?c!=e&&(d[e]=d[c],delete d[c]):delete d[c]});g=a.isPlainObject(g)?a.clone(g):{duration:parseFloat(g)||void 0,easing:h,complete:i};g=a.merge(s,g);g.el=c;g.props=d;this.config=g;this._duration=1E3*g.duration;
this.domEl=c;this._backupProps={};this._fxs={};this.on("complete",f)}}function f(c){var d,e,f=this.config;a.isEmptyObject(d=this._backupProps)||b.css(f.el,d);(e=f.complete)&&e.call(this,c)}function d(){var c=this.config,d=this._backupProps,e=c.el,f,i,l,m=c.specialEasing||{},n=this._fxs,o=c.props;h(this);if(!1===this.fire("beforeStart"))this.stop(0);else{if(e.nodeType==q.ELEMENT_NODE)for(l in i="none"===b.css(e,"display"),o)if(f=o[l],"hide"==f&&i||"show"==f&&!i){this.stop(1);return}if(e.nodeType==
q.ELEMENT_NODE&&(o.width||o.height))f=e.style,a.mix(d,{overflow:f.overflow,"overflow-x":f.overflowX,"overflow-y":f.overflowY}),f.overflow="hidden","inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(p.ie?f.zoom=1:f.display="inline-block");a.each(o,function(b,d){var e;a.isArray(b)?(e=m[d]=b[1],o[d]=b[0]):e=m[d]=m[d]||c.easing;"string"==typeof e&&(e=m[d]=k[e]);m[d]=e||k.easeNone});a.each(t,function(c,d){var f,g;if(g=o[d])f={},a.each(c,function(a){f[a]=b.css(e,a);m[a]=m[d]}),b.css(e,d,g),a.each(f,
function(a,c){o[c]=b.css(e,c);b.css(e,c,a)}),delete o[d]});for(l in o){f=a.trim(o[l]);var s,v,x={prop:l,anim:this,easing:m[l]},E=j.getFx(x);a.inArray(f,r)?(d[l]=b.style(e,l),"toggle"==f&&(f=i?"show":"hide"),"hide"==f?(s=0,v=E.cur(),d.display="none"):(v=0,s=E.cur(),b.css(e,l,v),b.show(e)),f=s):(s=f,v=E.cur());f+="";var H="",G=f.match(u);if(G){s=parseFloat(G[2]);if((H=G[3])&&"px"!==H)b.css(e,l,f),v*=s/E.cur(),b.css(e,l,v+H);G[1]&&(s=("-="===G[1]?-1:1)*s+v)}x.from=v;x.to=s;x.unit=H;E.load(x);n[l]=E}this._startTime=
a.now();g.start(this)}}function h(c){var d=c.config.el,e=b.data(d,v);e||b.data(d,v,e={});e[a.stamp(c)]=c}function c(c){var d=c.config.el,e=b.data(d,v);e&&(delete e[a.stamp(c)],a.isEmptyObject(e)&&b.removeData(d,v))}function m(c,d,e){c=b.data(c,"resume"==e?x:v);c=a.merge(c);a.each(c,function(a){if(void 0===d||a.config.queue==d)a[e]()})}function n(c,d,e,f){e&&!1!==f&&l.removeQueue(c,f);c=b.data(c,v);c=a.merge(c);a.each(c,function(a){a.config.queue==f&&a.stop(d)})}var p=a.UA,o=b._camelCase,q=b.NodeType,
r=["hide","show","toggle"],t={background:["backgroundPosition"],border:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],borderBottom:["borderBottomWidth"],borderLeft:["borderLeftWidth"],borderTop:["borderTopWidth"],borderRight:["borderRightWidth"],font:["fontSize","fontWeight"],margin:["marginBottom","marginLeft","marginRight","marginTop"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"]},s={duration:1,easing:"easeNone"},u=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i;
e.SHORT_HANDS=t;e.prototype={constructor:e,isRunning:function(){var c=b.data(this.config.el,v);return c?!!c[a.stamp(this)]:0},isPaused:function(){var c=b.data(this.config.el,x);return c?!!c[a.stamp(this)]:0},pause:function(){if(this.isRunning()){this._pauseDiff=a.now()-this._startTime;g.stop(this);c(this);var d=this.config.el,e=b.data(d,x);e||b.data(d,x,e={});e[a.stamp(this)]=this}return this},resume:function(){if(this.isPaused()){this._startTime=a.now()-this._pauseDiff;var c=this.config.el,d=b.data(c,
x);d&&(delete d[a.stamp(this)],a.isEmptyObject(d)&&b.removeData(c,x));h(this);g.start(this)}return this},_runInternal:d,run:function(){!1===this.config.queue?d.call(this):l.queue(this);return this},_frame:function(){var a,b=this.config,c=1,d,e,f=this._fxs;for(a in f)if(!(e=f[a]).finished)b.frame&&(d=b.frame(e)),1==d||0==d?(e.finished=d,c&=d):(c&=e.frame())&&b.frame&&b.frame(e);(!1===this.fire("step")||c)&&this.stop(c)},stop:function(a){var b=this.config,d=b.queue,e,f=this._fxs;if(!this.isRunning())return!1!==
d&&l.remove(this),this;if(a){for(e in f)if(!(a=f[e]).finished)b.frame?b.frame(a,1):a.frame(1);this.fire("complete")}g.stop(this);c(this);!1!==d&&l.dequeue(this);return this}};a.augment(e,i.Target);var v=a.guid("ks-anim-unqueued-"+a.now()+"-"),x=a.guid("ks-anim-paused-"+a.now()+"-");e.stop=function(c,d,e,f){if(null===f||"string"==typeof f||!1===f)return n.apply(void 0,arguments);e&&l.removeQueues(c);var g=b.data(c,v),g=a.merge(g);a.each(g,function(a){a.stop(d)})};a.each(["pause","resume"],function(a){e[a]=
function(b,c){if(null===c||"string"==typeof c||!1===c)return m(b,c,a);m(b,void 0,a)}});e.isRunning=function(c){return(c=b.data(c,v))&&!a.isEmptyObject(c)};e.isPaused=function(c){return(c=b.data(c,x))&&!a.isEmptyObject(c)};e.Q=l;return e},{requires:"dom,event,./easing,./manager,./fx,./queue".split(",")});
KISSY.add("anim/color",function(a,b,i,k){function g(a){var a=a+"",b;if(b=a.match(d))return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])];if(b=a.match(h))return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3]),parseInt(b[4])];if(b=a.match(c)){for(a=1;a<b.length;a++)2>b[a].length&&(b[a]+=b[a]);return[parseInt(b[1],l),parseInt(b[2],l),parseInt(b[3],l)]}return f[a=a.toLowerCase()]?f[a]:[255,255,255]}function j(){j.superclass.constructor.apply(this,arguments)}var l=16,e=Math.floor,f={black:[0,0,0],silver:[192,
192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255]},d=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,h=/^rgba\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+),\s*([0-9]+)\)$/i,c=/^#?([0-9A-F]{1,2})([0-9A-F]{1,2})([0-9A-F]{1,2})$/i,b=i.SHORT_HANDS;b.background=b.background||[];b.background.push("backgroundColor");
b.borderColor=["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"];b.border.push("borderBottomColor","borderLeftColor","borderRightColor","borderTopColor");b.borderBottom.push("borderBottomColor");b.borderLeft.push("borderLeftColor");b.borderRight.push("borderRightColor");b.borderTop.push("borderTopColor");a.extend(j,k,{load:function(){j.superclass.load.apply(this,arguments);this.from&&(this.from=g(this.from));this.to&&(this.to=g(this.to))},interpolate:function(a,b,c){var d=
j.superclass.interpolate;if(3==a.length&&3==b.length)return"rgb("+[e(d(a[0],b[0],c)),e(d(a[1],b[1],c)),e(d(a[2],b[2],c))].join(", ")+")";if(4==a.length||4==b.length)return"rgba("+[e(d(a[0],b[0],c)),e(d(a[1],b[1],c)),e(d(a[2],b[2],c)),e(d(a[3]||1,b[3]||1,c))].join(", ")+")"}});a.each("backgroundColor,borderBottomColor,borderLeftColor,borderRightColor,borderTopColor,color,outlineColor".split(","),function(a){k.Factories[a]=j});return j},{requires:["dom","./base","./fx"]});
KISSY.add("anim/easing",function(){var a=Math.PI,b=Math.pow,i=Math.sin,k={swing:function(b){return-Math.cos(b*a)/2+0.5},easeNone:function(a){return a},easeIn:function(a){return a*a},easeOut:function(a){return(2-a)*a},easeBoth:function(a){return 1>(a*=2)?0.5*a*a:0.5*(1- --a*(a-2))},easeInStrong:function(a){return a*a*a*a},easeOutStrong:function(a){return 1- --a*a*a*a},easeBothStrong:function(a){return 1>(a*=2)?0.5*a*a*a*a:0.5*(2-(a-=2)*a*a*a)},elasticIn:function(g){return 0===g||1===g?g:-(b(2,10*(g-=
1))*i((g-0.075)*2*a/0.3))},elasticOut:function(g){return 0===g||1===g?g:b(2,-10*g)*i((g-0.075)*2*a/0.3)+1},elasticBoth:function(g){return 0===g||2===(g*=2)?g:1>g?-0.5*b(2,10*(g-=1))*i((g-0.1125)*2*a/0.45):0.5*b(2,-10*(g-=1))*i((g-0.1125)*2*a/0.45)+1},backIn:function(a){1===a&&(a-=0.001);return a*a*(2.70158*a-1.70158)},backOut:function(a){return(a-=1)*a*(2.70158*a+1.70158)+1},backBoth:function(a){var b,i=(b=2.5949095)+1;return 1>(a*=2)?0.5*a*a*(i*a-b):0.5*((a-=2)*a*(i*a+b)+2)},bounceIn:function(a){return 1-
k.bounceOut(1-a)},bounceOut:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375},bounceBoth:function(a){return 0.5>a?0.5*k.bounceIn(2*a):0.5*k.bounceOut(2*a-1)+0.5}};return k});
KISSY.add("anim/fx",function(a,b,i){function k(a){this.load(a)}function g(a,g){return(!a.style||null==a.style[g])&&null!=b.attr(a,g,i,1)?1:0}k.prototype={constructor:k,load:function(b){a.mix(this,b);this.pos=0;this.unit=this.unit||""},frame:function(b){var g=this.anim,e=0;if(this.finished)return 1;var f=a.now(),d=g._startTime,g=g._duration;b||f>=g+d?e=this.pos=1:this.pos=this.easing((f-d)/g);this.update();this.finished=this.finished||e;return e},interpolate:function(b,g,e){return a.isNumber(b)&&a.isNumber(g)?
(b+(g-b)*e).toFixed(3):i},update:function(){var a=this.prop,k=this.anim.config.el,e=this.to,f=this.interpolate(this.from,e,this.pos);f===i?this.finished||(this.finished=1,b.css(k,a,e)):(f+=this.unit,g(k,a)?b.attr(k,a,f,1):b.css(k,a,f))},cur:function(){var a=this.prop,k=this.anim.config.el;if(g(k,a))return b.attr(k,a,i,1);var e,a=b.css(k,a);return isNaN(e=parseFloat(a))?!a||"auto"===a?0:a:e}};k.Factories={};k.getFx=function(a){return new (k.Factories[a.prop]||k)(a)};return k},{requires:["dom"]});
KISSY.add("anim/manager",function(a){var b=a.stamp;return{interval:15,runnings:{},timer:null,start:function(a){var k=b(a);this.runnings[k]||(this.runnings[k]=a,this.startTimer())},stop:function(a){this.notRun(a)},notRun:function(i){delete this.runnings[b(i)];a.isEmptyObject(this.runnings)&&this.stopTimer()},pause:function(a){this.notRun(a)},resume:function(a){this.start(a)},startTimer:function(){var a=this;a.timer||(a.timer=setTimeout(function(){a.runFrames()?a.stopTimer():(a.timer=0,a.startTimer())},
a.interval))},stopTimer:function(){var a=this.timer;a&&(clearTimeout(a),this.timer=0)},runFrames:function(){var a=1,b,g=this.runnings;for(b in g)a=0,g[b]._frame();return a}}});
KISSY.add("anim/queue",function(a,b){function i(a,f,d){var f=f||j,h,c=b.data(a,g);!c&&!d&&b.data(a,g,c={});c&&(h=c[f],!h&&!d&&(h=c[f]=[]));return h}function k(e,f){var f=f||j,d=b.data(e,g);d&&delete d[f];a.isEmptyObject(d)&&b.removeData(e,g)}var g=a.guid("ks-queue-"+a.now()+"-"),j=a.guid("ks-queue-"+a.now()+"-"),l={queueCollectionKey:g,queue:function(a){var b=i(a.config.el,a.config.queue);b.push(a);"..."!==b[0]&&l.dequeue(a);return b},remove:function(b){var f=i(b.config.el,b.config.queue,1);f&&(b=
a.indexOf(b,f),-1<b&&f.splice(b,1))},removeQueues:function(a){b.removeData(a,g)},removeQueue:k,dequeue:function(a){var b=a.config.el,a=a.config.queue,d=i(b,a,1),h=d&&d.shift();"..."==h&&(h=d.shift());h?(d.unshift("..."),h._runInternal()):k(b,a)}};return l},{requires:["dom"]});
KISSY.add("node/anim",function(a,b,i,k,g){function j(a,b,d){for(var h=[],c={},d=d||0;d<b;d++)h.push.apply(h,l[d]);for(d=0;d<h.length;d++)c[h[d]]=a;return c}var l=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];a.augment(k,{animate:function(b){var f=a.makeArray(arguments);a.each(this,function(b){var e=a.clone(f),c=e[0];c.props?(c.el=b,i(c).run()):i.apply(g,[b].concat(e)).run()});return this},stop:function(b,
f,d){a.each(this,function(a){i.stop(a,b,f,d)});return this},pause:function(b,f){a.each(this,function(a){i.pause(a,f)});return this},resume:function(b,f){a.each(this,function(a){i.resume(a,f)});return this},isRunning:function(){for(var a=0;a<this.length;a++)if(i.isRunning(this[a]))return!0;return!1},isPaused:function(){for(var a=0;a<this.length;a++)if(i.isPaused(this[a]))return 1;return 0}});a.each({show:j("show",3),hide:j("hide",3),toggle:j("toggle",3),fadeIn:j("show",3,2),fadeOut:j("hide",3,2),fadeToggle:j("toggle",
3,2),slideDown:j("show",1),slideUp:j("hide",1),slideToggle:j("toggle",1)},function(e,f){k.prototype[f]=function(d,h,c){if(b[f]&&!d)b[f](this);else a.each(this,function(a){i(a,e,d,c||"easeOut",h).run()});return this}})},{requires:["dom","anim","./base"]});
KISSY.add("node/attach",function(a,b,i,k,g){function j(a,d,e){e.unshift(d);a=b[a].apply(b,e);return a===g?d:a}var l=k.prototype,e=a.makeArray;k.KeyCodes=i.KeyCodes;a.each("nodeName,equals,contains,index,scrollTop,scrollLeft,height,width,innerHeight,innerWidth,outerHeight,outerWidth,addStyleSheet,appendTo,prependTo,insertBefore,before,after,insertAfter,test,hasClass,addClass,removeClass,replaceClass,toggleClass,removeAttr,hasAttr,hasProp,scrollIntoView,remove,empty,removeData,hasData,unselectable,wrap,wrapAll,replaceWith,wrapInner,unwrap".split(","),function(a){l[a]=
function(){var b=e(arguments);return j(a,this,b)}});a.each("filter,first,last,parent,closest,next,prev,clone,siblings,contents,children".split(","),function(a){l[a]=function(){var d=e(arguments);d.unshift(this);d=b[a].apply(b,d);return d===g?this:d===null?null:new k(d)}});a.each({attr:1,text:0,css:1,style:1,val:0,prop:1,offset:0,html:0,outerHTML:0,data:1},function(f,d){l[d]=function(){var h;h=e(arguments);h[f]===g&&!a.isObject(h[0])?(h.unshift(this),h=b[d].apply(b,h)):h=j(d,this,h);return h}});a.each("on,detach,fire,fireHandler,delegate,undelegate".split(","),
function(a){l[a]=function(){var b=e(arguments);b.unshift(this);i[a].apply(i,b);return this}})},{requires:["dom","event/dom","./base"]});
KISSY.add("node/base",function(a,b,i){function k(h,c,g){if(!(this instanceof k))return new k(h,c,g);if(h)if("string"==typeof h){if(h=b.create(h,c,g),h.nodeType===l.DOCUMENT_FRAGMENT_NODE)return e.apply(this,f(h.childNodes)),this}else{if(a.isArray(h)||d(h))return e.apply(this,f(h)),this}else return this;this[0]=h;this.length=1;return this}var g=Array.prototype,j=g.slice,l=b.NodeType,e=g.push,f=a.makeArray,d=b._isNodeList;k.prototype={constructor:k,length:0,item:function(b){return a.isNumber(b)?b>=
this.length?null:new k(this[b]):new k(b)},add:function(b,c,d){a.isNumber(c)&&(d=c,c=i);b=k.all(b,c).getDOMNodes();c=new k(this);d===i?e.apply(c,b):(d=[d,0],d.push.apply(d,b),g.splice.apply(c,d));return c},slice:function(a,b){return new k(j.apply(this,arguments))},getDOMNodes:function(){return j.call(this)},each:function(b,c){var d=this;a.each(d,function(a,e){a=new k(a);return b.call(c||a,a,e,d)});return d},getDOMNode:function(){return this[0]},end:function(){return this.__parent||this},all:function(a){a=
0<this.length?k.all(a,this):new k;a.__parent=this;return a},one:function(a){a=this.all(a);if(a=a.length?a.slice(0,1):null)a.__parent=this;return a}};a.mix(k,{all:function(d,c){return"string"==typeof d&&(d=a.trim(d))&&3<=d.length&&a.startsWith(d,"<")&&a.endsWith(d,">")?(c&&(c.getDOMNode&&(c=c[0]),c=c.ownerDocument||c),new k(d,i,c)):new k(b.query(d,c))},one:function(a,b){var d=k.all(a,b);return d.length?d.slice(0,1):null}});k.NodeType=l;return k},{requires:["dom"]});
KISSY.add("node",function(a,b){a.mix(a,{Node:b,NodeList:b,one:b.one,all:b.all});return b},{requires:["node/base","node/attach","node/override","node/anim"]});
KISSY.add("node/override",function(a,b,i){var k=i.prototype;a.each(["append","prepend","before","after"],function(a){k[a]=function(i){"string"==typeof i&&(i=b.create(i));if(i)b[a](i,this);return this}});a.each(["wrap","wrapAll","replaceWith","wrapInner"],function(a){var b=k[a];k[a]=function(a){"string"==typeof a&&(a=i.all(a,this[0].ownerDocument));return b.call(this,a)}})},{requires:["dom","./base"]});KISSY.use("ua,dom,event,node,json,ajax,anim,base,cookie",0,1); | tossmilestone/TmallAutoOrder | seed-min.js | JavaScript | mit | 144,147 | [
30522,
1013,
1008,
9385,
2286,
1010,
3610,
2100,
21318,
3075,
1058,
2487,
1012,
2382,
10210,
7000,
3857,
2051,
1024,
21650,
1015,
2322,
1024,
2410,
1008,
1013,
13075,
3610,
2100,
1027,
3853,
1006,
1037,
1007,
1063,
13075,
1038,
1027,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/bin/bash
mkdir ~/.vim/plugged
mkdir ~/.vim/swap
git clone https://github.com/junegunn/vim-plug ~/.vim/plugged/vim-plug
| TaDaa/.vim | install.sh | Shell | mit | 122 | [
30522,
1001,
999,
1013,
8026,
1013,
24234,
12395,
4305,
2099,
1066,
1013,
1012,
6819,
2213,
1013,
13354,
5999,
12395,
4305,
2099,
1066,
1013,
1012,
6819,
2213,
1013,
19948,
21025,
2102,
17598,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from __future__ import print_function
import numpy as np
from bokeh.client import push_session
from bokeh.io import curdoc
from bokeh.models import (ColumnDataSource, DataRange1d, Plot, Circle, WidgetBox,
Row, Button, TapTool)
N = 9
x = np.linspace(-2, 2, N)
y = x**2
source1 = ColumnDataSource(dict(x = x, y = y, radius = [0.1]*N))
xdr1 = DataRange1d()
ydr1 = DataRange1d()
plot1 = Plot(x_range=xdr1, y_range=ydr1, plot_width=400, plot_height=400)
plot1.title.text = "Plot1"
plot1.tools.append(TapTool(plot=plot1))
plot1.add_glyph(source1, Circle(x="x", y="y", radius="radius", fill_color="red"))
source2 = ColumnDataSource(dict(x = x, y = y, color = ["blue"]*N))
xdr2 = DataRange1d()
ydr2 = DataRange1d()
plot2 = Plot(x_range=xdr2, y_range=ydr2, plot_width=400, plot_height=400)
plot2.title.text = "Plot2"
plot2.tools.append(TapTool(plot=plot2))
plot2.add_glyph(source2, Circle(x="x", y="y", radius=0.1, fill_color="color"))
def on_selection_change1(attr, _, inds):
color = ["blue"]*N
if inds['1d']['indices']:
indices = inds['1d']['indices']
for i in indices:
color[i] = "red"
source2.data["color"] = color
source1.on_change('selected', on_selection_change1)
def on_selection_change2(attr, _, inds):
inds = inds['1d']['indices']
if inds:
[index] = inds
radius = [0.1]*N
radius[index] = 0.2
else:
radius = [0.1]*N
source1.data["radius"] = radius
source2.on_change('selected', on_selection_change2)
reset = Button(label="Reset")
def on_reset_click():
source1.selected = {
'0d': {'flag': False, 'indices': []},
'1d': {'indices': []},
'2d': {'indices': {}}
}
source2.selected = {
'0d': {'flag': False, 'indices': []},
'1d': {'indices': []},
'2d': {'indices': {}}
}
reset.on_click(on_reset_click)
widgetBox = WidgetBox(children=[reset], width=150)
row = Row(children=[widgetBox, plot1, plot2])
document = curdoc()
document.add_root(row)
if __name__ == "__main__":
print("\npress ctrl-C to exit")
session = push_session(document)
session.show()
session.loop_until_closed()
| DuCorey/bokeh | examples/models/server/linked_tap.py | Python | bsd-3-clause | 2,181 | [
30522,
2013,
1035,
1035,
2925,
1035,
1035,
12324,
6140,
1035,
3853,
12324,
16371,
8737,
2100,
2004,
27937,
2013,
8945,
3489,
2232,
1012,
7396,
12324,
5245,
1035,
5219,
2013,
8945,
3489,
2232,
1012,
22834,
12324,
12731,
20683,
2278,
2013,
89... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
#include <mach/board.h>
#include <mach/camera.h>
#include <media/msm_isp.h>
#include "msm_csid.h"
#include "msm.h"
#define V4L2_IDENT_CSID 50002
/* MIPI CSID registers */
#define CSID_HW_VERSION_ADDR 0x0
#define CSID_CORE_CTRL_ADDR 0x4
#define CSID_RST_CMD_ADDR 0x8
#define CSID_CID_LUT_VC_0_ADDR 0xc
#define CSID_CID_LUT_VC_1_ADDR 0x10
#define CSID_CID_LUT_VC_2_ADDR 0x14
#define CSID_CID_LUT_VC_3_ADDR 0x18
#define CSID_CID_n_CFG_ADDR 0x1C
#define CSID_IRQ_CLEAR_CMD_ADDR 0x5c
#define CSID_IRQ_MASK_ADDR 0x60
#define CSID_IRQ_STATUS_ADDR 0x64
#define CSID_CAPTURED_UNMAPPED_LONG_PKT_HDR_ADDR 0x68
#define CSID_CAPTURED_MMAPPED_LONG_PKT_HDR_ADDR 0x6c
#define CSID_CAPTURED_SHORT_PKT_ADDR 0x70
#define CSID_CAPTURED_LONG_PKT_HDR_ADDR 0x74
#define CSID_CAPTURED_LONG_PKT_FTR_ADDR 0x78
#define CSID_PIF_MISR_DL0_ADDR 0x7C
#define CSID_PIF_MISR_DL1_ADDR 0x80
#define CSID_PIF_MISR_DL2_ADDR 0x84
#define CSID_PIF_MISR_DL3_ADDR 0x88
#define CSID_STATS_TOTAL_PKTS_RCVD_ADDR 0x8C
#define CSID_STATS_ECC_ADDR 0x90
#define CSID_STATS_CRC_ADDR 0x94
#define CSID_TG_CTRL_ADDR 0x9C
#define CSID_TG_VC_CFG_ADDR 0xA0
#define CSID_TG_DT_n_CFG_0_ADDR 0xA8
#define CSID_TG_DT_n_CFG_1_ADDR 0xAC
#define CSID_TG_DT_n_CFG_2_ADDR 0xB0
#define CSID_TG_DT_n_CFG_3_ADDR 0xD8
#define CSID_RST_DONE_IRQ_BITSHIFT 11
#define CSID_RST_STB_ALL 0x7FFF
#define DBG_CSID 0
static int msm_csid_cid_lut(
struct msm_camera_csid_lut_params *csid_lut_params,
void __iomem *csidbase)
{
int rc = 0, i = 0;
uint32_t val = 0;
for (i = 0; i < csid_lut_params->num_cid && i < 4; i++) {
if (csid_lut_params->vc_cfg[i].dt < 0x12 ||
csid_lut_params->vc_cfg[i].dt > 0x37) {
CDBG("%s: unsupported data type 0x%x\n",
__func__, csid_lut_params->vc_cfg[i].dt);
return rc;
}
val = msm_camera_io_r(csidbase + CSID_CID_LUT_VC_0_ADDR +
(csid_lut_params->vc_cfg[i].cid >> 2) * 4)
& ~(0xFF << csid_lut_params->vc_cfg[i].cid * 8);
val |= csid_lut_params->vc_cfg[i].dt <<
csid_lut_params->vc_cfg[i].cid * 8;
msm_camera_io_w(val, csidbase + CSID_CID_LUT_VC_0_ADDR +
(csid_lut_params->vc_cfg[i].cid >> 2) * 4);
val = csid_lut_params->vc_cfg[i].decode_format << 4 | 0x3;
msm_camera_io_w(val, csidbase + CSID_CID_n_CFG_ADDR +
(csid_lut_params->vc_cfg[i].cid * 4));
}
return rc;
}
#if DBG_CSID
static void msm_csid_set_debug_reg(void __iomem *csidbase,
struct msm_camera_csid_params *csid_params)
{
uint32_t val = 0;
val = ((1 << csid_params->lane_cnt) - 1) << 20;
msm_camera_io_w(0x7f010800 | val, csidbase + CSID_IRQ_MASK_ADDR);
msm_camera_io_w(0x7f010800 | val, csidbase + CSID_IRQ_CLEAR_CMD_ADDR);
}
#else
static void msm_csid_set_debug_reg(void __iomem *csidbase,
struct msm_camera_csid_params *csid_params) {}
#endif
static int msm_csid_config(struct csid_cfg_params *cfg_params)
{
int rc = 0;
uint32_t val = 0;
struct csid_device *csid_dev;
struct msm_camera_csid_params *csid_params;
void __iomem *csidbase;
csid_dev = v4l2_get_subdevdata(cfg_params->subdev);
csidbase = csid_dev->base;
if (csidbase == NULL)
return -ENOMEM;
csid_params = cfg_params->parms;
val = csid_params->lane_cnt - 1;
val |= csid_params->lane_assign << 2;
val |= 0x1 << 10;
val |= 0x1 << 11;
val |= 0x1 << 12;
val |= 0x1 << 13;
val |= 0x1 << 28;
msm_camera_io_w(val, csidbase + CSID_CORE_CTRL_ADDR);
rc = msm_csid_cid_lut(&csid_params->lut_params, csidbase);
if (rc < 0)
return rc;
msm_csid_set_debug_reg(csidbase, csid_params);
return rc;
}
static irqreturn_t msm_csid_irq(int irq_num, void *data)
{
uint32_t irq;
struct csid_device *csid_dev = data;
irq = msm_camera_io_r(csid_dev->base + CSID_IRQ_STATUS_ADDR);
CDBG("%s CSID%d_IRQ_STATUS_ADDR = 0x%x\n",
__func__, csid_dev->pdev->id, irq);
if (irq & (0x1 << CSID_RST_DONE_IRQ_BITSHIFT))
complete(&csid_dev->reset_complete);
msm_camera_io_w(irq, csid_dev->base + CSID_IRQ_CLEAR_CMD_ADDR);
return IRQ_HANDLED;
}
static void msm_csid_reset(struct csid_device *csid_dev)
{
msm_camera_io_w(CSID_RST_STB_ALL, csid_dev->base + CSID_RST_CMD_ADDR);
wait_for_completion_interruptible(&csid_dev->reset_complete);
return;
}
static int msm_csid_subdev_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
BUG_ON(!chip);
chip->ident = V4L2_IDENT_CSID;
chip->revision = 0;
return 0;
}
static struct msm_cam_clk_info csid_clk_info[] = {
{"csi_src_clk", 177780000},
{"csi_clk", -1},
{"csi_phy_clk", -1},
{"csi_pclk", -1},
};
static struct camera_vreg_t csid_vreg_info[] = {
{"mipi_csi_vdd", REG_LDO, 1200000, 1200000, 20000},
};
static int msm_csid_init(struct v4l2_subdev *sd, uint32_t *csid_version)
{
int rc = 0;
struct csid_device *csid_dev;
csid_dev = v4l2_get_subdevdata(sd);
if (csid_dev == NULL) {
rc = -ENOMEM;
return rc;
}
if (csid_dev->csid_state == CSID_POWER_UP) {
pr_err("%s: csid invalid state %d\n", __func__,
csid_dev->csid_state);
rc = -EINVAL;
return rc;
}
csid_dev->base = ioremap(csid_dev->mem->start,
resource_size(csid_dev->mem));
if (!csid_dev->base) {
rc = -ENOMEM;
return rc;
}
rc = msm_camera_config_vreg(&csid_dev->pdev->dev, csid_vreg_info,
ARRAY_SIZE(csid_vreg_info), &csid_dev->csi_vdd, 1);
if (rc < 0) {
pr_err("%s: regulator on failed\n", __func__);
goto vreg_config_failed;
}
rc = msm_camera_enable_vreg(&csid_dev->pdev->dev, csid_vreg_info,
ARRAY_SIZE(csid_vreg_info), &csid_dev->csi_vdd, 1);
if (rc < 0) {
pr_err("%s: regulator enable failed\n", __func__);
goto vreg_enable_failed;
}
rc = msm_cam_clk_enable(&csid_dev->pdev->dev, csid_clk_info,
csid_dev->csid_clk, ARRAY_SIZE(csid_clk_info), 1);
if (rc < 0) {
pr_err("%s: regulator enable failed\n", __func__);
goto clk_enable_failed;
}
csid_dev->hw_version =
msm_camera_io_r(csid_dev->base + CSID_HW_VERSION_ADDR);
*csid_version = csid_dev->hw_version;
init_completion(&csid_dev->reset_complete);
rc = request_irq(csid_dev->irq->start, msm_csid_irq,
IRQF_TRIGGER_RISING, "csid", csid_dev);
msm_csid_reset(csid_dev);
csid_dev->csid_state = CSID_POWER_UP;
return rc;
clk_enable_failed:
msm_camera_enable_vreg(&csid_dev->pdev->dev, csid_vreg_info,
ARRAY_SIZE(csid_vreg_info), &csid_dev->csi_vdd, 0);
vreg_enable_failed:
msm_camera_config_vreg(&csid_dev->pdev->dev, csid_vreg_info,
ARRAY_SIZE(csid_vreg_info), &csid_dev->csi_vdd, 0);
vreg_config_failed:
iounmap(csid_dev->base);
csid_dev->base = NULL;
return rc;
}
static int msm_csid_release(struct v4l2_subdev *sd)
{
uint32_t irq;
struct csid_device *csid_dev;
csid_dev = v4l2_get_subdevdata(sd);
if (csid_dev->csid_state != CSID_POWER_UP) {
pr_err("%s: csid invalid state %d\n", __func__,
csid_dev->csid_state);
return -EINVAL;
}
irq = msm_camera_io_r(csid_dev->base + CSID_IRQ_STATUS_ADDR);
msm_camera_io_w(irq, csid_dev->base + CSID_IRQ_CLEAR_CMD_ADDR);
msm_camera_io_w(0, csid_dev->base + CSID_IRQ_MASK_ADDR);
free_irq(csid_dev->irq->start, csid_dev);
msm_cam_clk_enable(&csid_dev->pdev->dev, csid_clk_info,
csid_dev->csid_clk, ARRAY_SIZE(csid_clk_info), 0);
msm_camera_enable_vreg(&csid_dev->pdev->dev, csid_vreg_info,
ARRAY_SIZE(csid_vreg_info), &csid_dev->csi_vdd, 0);
msm_camera_config_vreg(&csid_dev->pdev->dev, csid_vreg_info,
ARRAY_SIZE(csid_vreg_info), &csid_dev->csi_vdd, 0);
iounmap(csid_dev->base);
csid_dev->base = NULL;
csid_dev->csid_state = CSID_POWER_DOWN;
return 0;
}
static long msm_csid_subdev_ioctl(struct v4l2_subdev *sd,
unsigned int cmd, void *arg)
{
int rc = -ENOIOCTLCMD;
struct csid_cfg_params cfg_params;
struct csid_device *csid_dev = v4l2_get_subdevdata(sd);
mutex_lock(&csid_dev->mutex);
switch (cmd) {
case VIDIOC_MSM_CSID_CFG:
cfg_params.subdev = sd;
cfg_params.parms = arg;
rc = msm_csid_config((struct csid_cfg_params *)&cfg_params);
break;
case VIDIOC_MSM_CSID_INIT:
rc = msm_csid_init(sd, (uint32_t *)arg);
break;
case VIDIOC_MSM_CSID_RELEASE:
rc = msm_csid_release(sd);
break;
default:
pr_err("%s: command not found\n", __func__);
}
mutex_unlock(&csid_dev->mutex);
return rc;
}
static const struct v4l2_subdev_internal_ops msm_csid_internal_ops;
static struct v4l2_subdev_core_ops msm_csid_subdev_core_ops = {
.g_chip_ident = &msm_csid_subdev_g_chip_ident,
.ioctl = &msm_csid_subdev_ioctl,
};
static const struct v4l2_subdev_ops msm_csid_subdev_ops = {
.core = &msm_csid_subdev_core_ops,
};
static int __devinit csid_probe(struct platform_device *pdev)
{
struct csid_device *new_csid_dev;
int rc = 0;
CDBG("%s: device id = %d\n", __func__, pdev->id);
new_csid_dev = kzalloc(sizeof(struct csid_device), GFP_KERNEL);
if (!new_csid_dev) {
pr_err("%s: no enough memory\n", __func__);
return -ENOMEM;
}
v4l2_subdev_init(&new_csid_dev->subdev, &msm_csid_subdev_ops);
new_csid_dev->subdev.internal_ops = &msm_csid_internal_ops;
new_csid_dev->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
snprintf(new_csid_dev->subdev.name,
ARRAY_SIZE(new_csid_dev->subdev.name), "msm_csid");
v4l2_set_subdevdata(&new_csid_dev->subdev, new_csid_dev);
platform_set_drvdata(pdev, &new_csid_dev->subdev);
mutex_init(&new_csid_dev->mutex);
new_csid_dev->mem = platform_get_resource_byname(pdev,
IORESOURCE_MEM, "csid");
if (!new_csid_dev->mem) {
pr_err("%s: no mem resource?\n", __func__);
rc = -ENODEV;
goto csid_no_resource;
}
new_csid_dev->irq = platform_get_resource_byname(pdev,
IORESOURCE_IRQ, "csid");
if (!new_csid_dev->irq) {
pr_err("%s: no irq resource?\n", __func__);
rc = -ENODEV;
goto csid_no_resource;
}
new_csid_dev->io = request_mem_region(new_csid_dev->mem->start,
resource_size(new_csid_dev->mem), pdev->name);
if (!new_csid_dev->io) {
pr_err("%s: no valid mem region\n", __func__);
rc = -EBUSY;
goto csid_no_resource;
}
new_csid_dev->pdev = pdev;
msm_cam_register_subdev_node(&new_csid_dev->subdev, CSID_DEV, pdev->id);
new_csid_dev->csid_state = CSID_POWER_DOWN;
return 0;
csid_no_resource:
mutex_destroy(&new_csid_dev->mutex);
kfree(new_csid_dev);
return 0;
}
static struct platform_driver csid_driver = {
.probe = csid_probe,
.driver = {
.name = MSM_CSID_DRV_NAME,
.owner = THIS_MODULE,
},
};
static int __init msm_csid_init_module(void)
{
return platform_driver_register(&csid_driver);
}
static void __exit msm_csid_exit_module(void)
{
platform_driver_unregister(&csid_driver);
}
module_init(msm_csid_init_module);
module_exit(msm_csid_exit_module);
MODULE_DESCRIPTION("MSM CSID driver");
MODULE_LICENSE("GPL v2");
| rbheromax/raybst-kernel | drivers/media/video/msm/csi/msm_csid.c | C | gpl-2.0 | 11,694 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2249,
1011,
2262,
1010,
3642,
13158,
7057,
1012,
2035,
2916,
9235,
1012,
1008,
1008,
2023,
2565,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
30524,
2009,
2104,
1996,
3408,
1997,
1996,
27004,
2236,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<head>
<title>Asterisk Project : Asterisk 12 Recordings REST API</title>
<link rel="stylesheet" href="styles/site.css" type="text/css" />
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body class="theme-default aui-theme-default">
<div id="page">
<div id="main" class="aui-page-panel">
<div id="main-header">
<div id="breadcrumb-section">
<ol id="breadcrumbs">
<li class="first">
<span><a href="index.html">Asterisk Project</a></span>
</li>
<li>
<span><a href="Asterisk-12-Documentation_25919697.html">Asterisk 12 Documentation</a></span>
</li>
<li>
<span><a href="Asterisk-12-Command-Reference_26476688.html">Asterisk 12 Command Reference</a></span>
</li>
<li>
<span><a href="Asterisk-12-ARI_22773909.html">Asterisk 12 ARI</a></span>
</li>
</ol>
</div>
<h1 id="title-heading" class="pagetitle">
<span id="title-text">
Asterisk Project : Asterisk 12 Recordings REST API
</span>
</h1>
</div>
<div id="content" class="view">
<div class="page-metadata">
Added by dlee , edited by wikibot on Nov 08, 2013
</div>
<div id="main-content" class="wiki-content group">
<h1 id="Asterisk12RecordingsRESTAPI-Recordings">Recordings</h1>
<div class="table-wrap"><table class="confluenceTable"><tbody>
<tr>
<th class="confluenceTh"><p> Method </p></th>
<th class="confluenceTh"><p> Path </p></th>
<th class="confluenceTh"><p> Return Model </p></th>
<th class="confluenceTh"><p> Summary </p></th>
</tr>
<tr>
<td class="confluenceTd"><p> GET </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/stored</a> </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-REST-Data-Models_22773915.html#Asterisk12RESTDataModels-StoredRecording">List[StoredRecording]</a> </p></td>
<td class="confluenceTd"><p> List recordings that are complete. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> GET </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/stored/{recordingName}</a> </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-REST-Data-Models_22773915.html#Asterisk12RESTDataModels-StoredRecording">StoredRecording</a> </p></td>
<td class="confluenceTd"><p> Get a stored recording's details. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> DELETE </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/stored/{recordingName}</a> </p></td>
<td class="confluenceTd"><p> void </p></td>
<td class="confluenceTd"><p> Delete a stored recording. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> GET </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/live/{recordingName}</a> </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-REST-Data-Models_22773915.html#Asterisk12RESTDataModels-LiveRecording">LiveRecording</a> </p></td>
<td class="confluenceTd"><p> List live recordings. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> DELETE </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/live/{recordingName}</a> </p></td>
<td class="confluenceTd"><p> void </p></td>
<td class="confluenceTd"><p> Stop a live recording and discard it. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> POST </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/live/{recordingName}/stop</a> </p></td>
<td class="confluenceTd"><p> void </p></td>
<td class="confluenceTd"><p> Stop a live recording and store it. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> POST </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/live/{recordingName}/pause</a> </p></td>
<td class="confluenceTd"><p> void </p></td>
<td class="confluenceTd"><p> Pause a live recording. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> DELETE </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/live/{recordingName}/pause</a> </p></td>
<td class="confluenceTd"><p> void </p></td>
<td class="confluenceTd"><p> Unpause a live recording. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> POST </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/live/{recordingName}/mute</a> </p></td>
<td class="confluenceTd"><p> void </p></td>
<td class="confluenceTd"><p> Mute a live recording. </p></td>
</tr>
<tr>
<td class="confluenceTd"><p> DELETE </p></td>
<td class="confluenceTd"><p> <a href="Asterisk-12-Recordings-REST-API_22773916.html">/recordings/live/{recordingName}/mute</a> </p></td>
<td class="confluenceTd"><p> void </p></td>
<td class="confluenceTd"><p> Unmute a live recording. </p></td>
</tr>
</tbody></table></div>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-listStored"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-GET%2Frecordings%2Fstored">GET /recordings/stored</h2>
<p>List recordings that are complete.</p>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-getStored"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-GET%2Frecordings%2Fstored%2F%7BrecordingName%7D">GET /recordings/stored/{recordingName}</h2>
<p>Get a stored recording's details.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
</ul>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-deleteStored"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-DELETE%2Frecordings%2Fstored%2F%7BrecordingName%7D">DELETE /recordings/stored/{recordingName}</h2>
<p>Delete a stored recording.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters.1">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses.1">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
</ul>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-getLive"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-GET%2Frecordings%2Flive%2F%7BrecordingName%7D">GET /recordings/live/{recordingName}</h2>
<p>List live recordings.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters.2">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses.2">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
</ul>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-cancel"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-DELETE%2Frecordings%2Flive%2F%7BrecordingName%7D">DELETE /recordings/live/{recordingName}</h2>
<p>Stop a live recording and discard it.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters.3">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses.3">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
</ul>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-stop"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-POST%2Frecordings%2Flive%2F%7BrecordingName%7D%2Fstop">POST /recordings/live/{recordingName}/stop</h2>
<p>Stop a live recording and store it.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters.4">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses.4">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
</ul>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-pause"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-POST%2Frecordings%2Flive%2F%7BrecordingName%7D%2Fpause">POST /recordings/live/{recordingName}/pause</h2>
<p>Pause a live recording. Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters.5">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses.5">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
<li>409 - Recording not in session</li>
</ul>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-unpause"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-DELETE%2Frecordings%2Flive%2F%7BrecordingName%7D%2Fpause">DELETE /recordings/live/{recordingName}/pause</h2>
<p>Unpause a live recording.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters.6">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses.6">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
<li>409 - Recording not in session</li>
</ul>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-mute"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-POST%2Frecordings%2Flive%2F%7BrecordingName%7D%2Fmute">POST /recordings/live/{recordingName}/mute</h2>
<p>Mute a live recording. Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters.7">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses.7">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
<li>409 - Recording not in session</li>
</ul>
<p><span class="confluence-anchor-link" id="Asterisk12RecordingsRESTAPI-unmute"></span></p>
<h2 id="Asterisk12RecordingsRESTAPI-DELETE%2Frecordings%2Flive%2F%7BrecordingName%7D%2Fmute">DELETE /recordings/live/{recordingName}/mute</h2>
<p>Unmute a live recording.</p>
<h3 id="Asterisk12RecordingsRESTAPI-Pathparameters.8">Path parameters</h3>
<ul>
<li>recordingName: string - The name of the recording</li>
</ul>
<h3 id="Asterisk12RecordingsRESTAPI-ErrorResponses.8">Error Responses</h3>
<ul>
<li>404 - Recording not found</li>
<li>409 - Recording not in session</li>
</ul>
</div>
</div> </div>
<div id="footer">
<section class="footer-body">
<p>Document generated by Confluence on Dec 20, 2013 14:15</p>
</section>
</div>
</div> </body>
</html>
| truongduy134/asterisk | doc/Asterisk-Admin-Guide/Asterisk-12-Recordings-REST-API_22773916.html | HTML | gpl-2.0 | 11,615 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
2516,
1028,
2004,
3334,
20573,
2622,
1024,
2004,
3334,
20573,
2260,
5633,
2717,
17928,
1026,
1013,
2516,
1028,
1026,
4957,
2128,
2140,
1027,
1000,
6782,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System.Collections.Generic;
using Newtonsoft.Json;
namespace SitecoreCognitiveServices.Foundation.IBMSDK.Discovery.Models
{
public class QueryNoticesResponse
{
[JsonProperty("matching_results", NullValueHandling = NullValueHandling.Ignore)]
public long? MatchingResults { get; set; }
[JsonProperty("results", NullValueHandling = NullValueHandling.Ignore)]
public List<QueryNoticesResult> Results { get; set; }
[JsonProperty("aggregations", NullValueHandling = NullValueHandling.Ignore)]
public List<QueryAggregation> Aggregations { get; set; }
[JsonProperty("passages", NullValueHandling = NullValueHandling.Ignore)]
public List<QueryPassages> Passages { get; set; }
[JsonProperty("duplicates_removed", NullValueHandling = NullValueHandling.Ignore)]
public long? DuplicatesRemoved { get; set; }
}
}
| markstiles/SitecoreCognitiveServices | src/Foundation/IBMSDK/code/Discovery/Models/QueryNoticesResponse.cs | C# | mit | 898 | [
30522,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
8446,
6499,
6199,
1012,
1046,
3385,
1025,
3415,
15327,
2609,
17345,
3597,
29076,
6024,
8043,
7903,
2229,
1012,
3192,
1012,
9980,
16150,
2243,
1012,
5456,
1012,
4275,
1063,
2270,
2465,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import threading
import numpy as np
def ros_ensure_valid_name(name):
return name.replace('-','_')
def lineseg_box(xmin, ymin, xmax, ymax):
return [ [xmin,ymin,xmin,ymax],
[xmin,ymax,xmax,ymax],
[xmax,ymax,xmax,ymin],
[xmax,ymin,xmin,ymin],
]
def lineseg_circle(x,y,radius,N=64):
draw_linesegs = []
theta = np.arange(N)*2*np.pi/N
xdraw = x+np.cos(theta)*radius
ydraw = y+np.sin(theta)*radius
for i in range(N-1):
draw_linesegs.append(
(xdraw[i],ydraw[i],xdraw[i+1],ydraw[i+1]))
draw_linesegs.append(
(xdraw[-1],ydraw[-1],xdraw[0],ydraw[0]))
return draw_linesegs
class SharedValue:
def __init__(self):
self.evt = threading.Event()
self._val = None
def set(self,value):
# called from producer thread
self._val = value
self.evt.set()
def is_new_value_waiting(self):
return self.evt.isSet()
def get(self,*args,**kwargs):
# called from consumer thread
self.evt.wait(*args,**kwargs)
val = self._val
self.evt.clear()
return val
def get_nowait(self):
# XXX TODO this is not atomic and is thus dangerous.
# (The value could get read, then another thread could set it,
# and only then might it get flagged as clear by this thread,
# even though a new value is waiting.)
val = self._val
self.evt.clear()
return val
class SharedValue1(object):
def __init__(self,initial_value):
self._val = initial_value
self.lock = threading.Lock()
def get(self):
self.lock.acquire()
try:
val = self._val
finally:
self.lock.release()
return val
def set(self,new_value):
self.lock.acquire()
try:
self._val = new_value
finally:
self.lock.release()
| motmot/fview | motmot/fview/utils.py | Python | bsd-3-clause | 1,929 | [
30522,
12324,
11689,
2075,
12324,
16371,
8737,
2100,
2004,
27937,
13366,
20996,
2015,
1035,
5676,
1035,
9398,
1035,
2171,
1006,
2171,
1007,
1024,
2709,
2171,
1012,
5672,
1006,
1005,
1011,
1005,
1010,
1005,
1035,
1005,
1007,
13366,
3210,
139... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import time
from ajenti.com import *
from ajenti.ui import *
from ajenti.utils import shell, str_fsize
class BSDIfconfig(Plugin):
platform = ['FreeBSD']
def get_info(self, iface):
ui = UI.Container(
UI.Formline(
UI.HContainer(
UI.Image(file='/dl/network/%s.png'%('up' if iface.up else 'down')),
UI.Label(text=iface.name, bold=True)
),
text='Interface',
),
UI.Formline(
UI.Label(text=self.get_ip(iface)),
text='Address',
),
UI.Formline(
UI.Label(text='Up %s, down %s' % (
str_fsize(self.get_tx(iface)),
str_fsize(self.get_rx(iface)),
)),
text='Traffic',
),
)
return ui
def get_tx(self, iface):
s = shell('netstat -bI %s | grep -v Link | grep -v pkts'%iface.name)
try:
s = s.split()[10]
except:
s = '0'
return int(s)
def get_rx(self, iface):
s = shell('netstat -bI %s | grep -v Link | grep -v pkts'%iface.name)
try:
s = s.split()[7]
except:
s = '0'
return int(s)
def get_ip(self, iface):
s = shell('ifconfig %s | grep \'inet \''%iface.name)
try:
s = s.split()[1]
except:
s = '0.0.0.0'
return s
def detect_dev_class(self, iface):
if iface.name[:-1] == 'gif':
return 'tunnel'
if iface.name == 'lo':
return 'loopback'
return 'ethernet'
def detect_iface_bits(self, iface):
r = ['bsd-basic']
cls = self.detect_dev_class(iface)
if iface.addressing == 'static':
r.append('bsd-ipv4')
if cls == 'tunnel':
r.append('bsd-tunnel')
return r
def up(self, iface):
shell('ifconfig %s up' % iface.name)
time.sleep(1)
def down(self, iface):
shell('ifconfig %s down' % iface.name)
time.sleep(1)
| DVSBA/ajenti | plugins/network/nctp_bsd.py | Python | lgpl-3.0 | 2,275 | [
30522,
12324,
2051,
2013,
19128,
4765,
2072,
1012,
4012,
12324,
1008,
2013,
19128,
4765,
2072,
1012,
21318,
12324,
1008,
2013,
19128,
4765,
2072,
1012,
21183,
12146,
12324,
5806,
1010,
2358,
2099,
1035,
1042,
5332,
4371,
2465,
18667,
4305,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (C) 2017 the original author or authors.
*
* This file is part of jBB Application Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*/
package org.jbb.system.impl.database.provider;
import org.jbb.lib.db.DbProperties;
import org.jbb.lib.db.provider.H2InMemoryProvider;
import org.jbb.system.api.database.DatabaseProvider;
import org.jbb.system.api.database.DatabaseSettings;
import org.jbb.system.api.database.h2.H2InMemorySettings;
import org.springframework.stereotype.Component;
import lombok.RequiredArgsConstructor;
@Component
@RequiredArgsConstructor
public class H2InMemoryManager implements DatabaseProviderManager<H2InMemorySettings> {
public static final String PROVIDER_PROPERTY_VALUE = H2InMemoryProvider.PROVIDER_VALUE;
private final DbProperties dbProperties;
@Override
public DatabaseProvider getProviderName() {
return DatabaseProvider.H2_IN_MEMORY;
}
@Override
public H2InMemorySettings getCurrentProviderSettings() {
return H2InMemorySettings.builder()
.databaseName(dbProperties.h2InMemoryDbName())
.build();
}
@Override
public void setProviderSettings(DatabaseSettings newDatabaseSettings) {
H2InMemorySettings newProviderSettings = newDatabaseSettings
.getH2InMemorySettings();
dbProperties.setProperty(DbProperties.H2_IN_MEMORY_DB_NAME_KEY,
newProviderSettings.getDatabaseName());
}
}
| jbb-project/jbb | domain-services/jbb-system/src/main/java/org/jbb/system/impl/database/provider/H2InMemoryManager.java | Java | apache-2.0 | 1,603 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2418,
1996,
2434,
3166,
2030,
6048,
1012,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
1046,
10322,
4646,
2622,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Statamic\Data\Globals;
use Statamic\Data\Content\ContentFactory;
use Statamic\Contracts\Data\Globals\GlobalFactory as GlobalFactoryContract;
class GlobalFactory extends ContentFactory implements GlobalFactoryContract
{
protected $slug;
/**
* @param string $slug
* @return $this
*/
public function create($slug)
{
$this->slug = $slug;
return $this;
}
/**
* @return GlobalSet
*/
public function get()
{
$global = new GlobalSet;
$global->slug($this->slug);
$global->data($this->data);
if (! $this->path) {
$this->path = $global->path();
}
$global = $this->identify($global);
$global->syncOriginal();
return $global;
}
}
| ICJIA/icjia-tvpp | statamic/core/Data/Globals/GlobalFactory.php | PHP | mit | 805 | [
30522,
1026,
1029,
25718,
3415,
15327,
28093,
10631,
2278,
1032,
2951,
1032,
3795,
2015,
1025,
2224,
28093,
10631,
2278,
1032,
2951,
1032,
4180,
1032,
4180,
21450,
1025,
2224,
28093,
10631,
2278,
1032,
8311,
1032,
2951,
1032,
3795,
2015,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
resource_name :code_deploy_agent
default_action %i[install enable start]
provides :code_deploy_agent_linux
provides :code_deploy_agent, platform_family: 'debian'
property :auto_update, [true, false], default: false
action_class do
include CodeDeploy::Helper
end
action :install do
include_recipe 'apt'
package 'ruby' do
package_name 'ruby2.0' if ubuntu_less_than_15?
end
download_installer_to_cache('deb')
dpkg_package installer_cache_path('deb')
service 'codedeploy-agent' do
action :nothing
retries 2
end
file '/etc/cron.d/codedeploy-agent-update' do
action :delete
not_if { new_resource.auto_update }
end
end
action :uninstall do
execute 'systemctl daemon-reload' do
only_if { systemd? }
action :nothing
end
package 'codedeploy-agent' do
action :purge
notifies :run, 'execute[systemctl daemon-reload]'
end
end
%i[
disable
enable
restart
start
stop
].each do |a|
action a do
service 'codedeploy-agent' do
action a
retries 2
end
end
end
| meringu/code_deploy | resources/agent_debian.rb | Ruby | apache-2.0 | 1,052 | [
30522,
7692,
1035,
2171,
1024,
3642,
1035,
21296,
1035,
4005,
12398,
1035,
2895,
1003,
1045,
1031,
16500,
9585,
2707,
1033,
3640,
1024,
3642,
1035,
21296,
1035,
4005,
1035,
11603,
3640,
1024,
3642,
1035,
21296,
1035,
4005,
1010,
4132,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package org.apache.commons.ssl.asn1;
import java.io.ByteArrayInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
public class ASN1StreamParser {
InputStream _in;
private int _limit;
private boolean _eofFound;
public ASN1StreamParser(
InputStream in) {
this(in, Integer.MAX_VALUE);
}
public ASN1StreamParser(
InputStream in,
int limit) {
this._in = in;
this._limit = limit;
}
public ASN1StreamParser(
byte[] encoding) {
this(new ByteArrayInputStream(encoding), encoding.length);
}
InputStream getParentStream() {
return _in;
}
private int readLength()
throws IOException {
int length = _in.read();
if (length < 0) {
throw new EOFException("EOF found when length expected");
}
if (length == 0x80) {
return -1; // indefinite-length encoding
}
if (length > 127) {
int size = length & 0x7f;
if (size > 4) {
throw new IOException("DER length more than 4 bytes");
}
length = 0;
for (int i = 0; i < size; i++) {
int next = _in.read();
if (next < 0) {
throw new EOFException("EOF found reading length");
}
length = (length << 8) + next;
}
if (length < 0) {
throw new IOException("corrupted stream - negative length found");
}
if (length >= _limit) // after all we must have read at least 1 byte
{
throw new IOException("corrupted stream - out of bounds length found");
}
}
return length;
}
public DEREncodable readObject()
throws IOException {
int tag = _in.read();
if (tag == -1) {
if (_eofFound) {
throw new EOFException("attempt to read past end of file.");
}
_eofFound = true;
return null;
}
//
// turn of looking for "00" while we resolve the tag
//
set00Check(false);
//
// calculate tag number
//
int baseTagNo = tag & ~DERTags.CONSTRUCTED;
int tagNo = baseTagNo;
if ((tag & DERTags.TAGGED) != 0) {
tagNo = tag & 0x1f;
//
// with tagged object tag number is bottom 5 bits, or stored at the start of the content
//
if (tagNo == 0x1f) {
tagNo = 0;
int b = _in.read();
while ((b >= 0) && ((b & 0x80) != 0)) {
tagNo |= (b & 0x7f);
tagNo <<= 7;
b = _in.read();
}
if (b < 0) {
_eofFound = true;
throw new EOFException("EOF encountered inside tag value.");
}
tagNo |= (b & 0x7f);
}
}
//
// calculate length
//
int length = readLength();
if (length < 0) // indefinite length
{
IndefiniteLengthInputStream indIn = new IndefiniteLengthInputStream(_in);
switch (baseTagNo) {
case DERTags.NULL:
while (indIn.read() >= 0) {
// make sure we skip to end of object
}
return BERNull.INSTANCE;
case DERTags.OCTET_STRING:
return new BEROctetStringParser(new ASN1ObjectParser(tag, tagNo, indIn));
case DERTags.SEQUENCE:
return new BERSequenceParser(new ASN1ObjectParser(tag, tagNo, indIn));
case DERTags.SET:
return new BERSetParser(new ASN1ObjectParser(tag, tagNo, indIn));
default:
return new BERTaggedObjectParser(tag, tagNo, indIn);
}
} else {
DefiniteLengthInputStream defIn = new DefiniteLengthInputStream(_in, length);
switch (baseTagNo) {
case DERTags.INTEGER:
return new DERInteger(defIn.toByteArray());
case DERTags.NULL:
defIn.toByteArray(); // make sure we read to end of object bytes.
return DERNull.INSTANCE;
case DERTags.OBJECT_IDENTIFIER:
return new DERObjectIdentifier(defIn.toByteArray());
case DERTags.OCTET_STRING:
return new DEROctetString(defIn.toByteArray());
case DERTags.SEQUENCE:
return new DERSequence(loadVector(defIn, length)).parser();
case DERTags.SET:
return new DERSet(loadVector(defIn, length)).parser();
default:
return new BERTaggedObjectParser(tag, tagNo, defIn);
}
}
}
private void set00Check(boolean enabled) {
if (_in instanceof IndefiniteLengthInputStream) {
((IndefiniteLengthInputStream) _in).setEofOn00(enabled);
}
}
private ASN1EncodableVector loadVector(InputStream in, int length)
throws IOException {
ASN1InputStream aIn = new ASN1InputStream(in, length);
ASN1EncodableVector v = new ASN1EncodableVector();
DERObject obj;
while ((obj = aIn.readObject()) != null) {
v.add(obj);
}
return v;
}
}
| dvandok/not-yet-commons-ssl-debian | src/java/org/apache/commons/ssl/asn1/ASN1StreamParser.java | Java | apache-2.0 | 5,634 | [
30522,
7427,
8917,
1012,
15895,
1012,
7674,
1012,
7020,
2140,
1012,
2004,
2078,
2487,
1025,
12324,
9262,
1012,
22834,
1012,
24880,
2906,
9447,
2378,
18780,
21422,
1025,
12324,
9262,
1012,
22834,
1012,
1041,
11253,
10288,
24422,
1025,
12324,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* 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 com.intellij.xdebugger.impl.breakpoints;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.markup.GutterIconRenderer;
import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.XDebuggerManager;
import com.intellij.xdebugger.XDebuggerUtil;
import com.intellij.xdebugger.breakpoints.*;
import com.intellij.xdebugger.breakpoints.ui.XBreakpointGroupingRule;
import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem;
import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider;
import com.intellij.xdebugger.impl.breakpoints.ui.grouping.XBreakpointCustomGroupingRule;
import com.intellij.xdebugger.impl.breakpoints.ui.grouping.XBreakpointFileGroupingRule;
import com.intellij.xdebugger.impl.breakpoints.ui.grouping.XBreakpointGroupingByTypeRule;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.List;
/**
* @author nik
*/
public class XBreakpointPanelProvider extends BreakpointPanelProvider<XBreakpoint> {
private final List<MyXBreakpointListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
@Override
public void createBreakpointsGroupingRules(Collection<XBreakpointGroupingRule> rules) {
rules.add(new XBreakpointGroupingByTypeRule());
rules.add(new XBreakpointFileGroupingRule());
rules.add(new XBreakpointCustomGroupingRule());
}
@Override
public void addListener(final BreakpointsListener listener, Project project, Disposable disposable) {
XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
final MyXBreakpointListener listener1 = new MyXBreakpointListener(listener, breakpointManager);
breakpointManager.addBreakpointListener(listener1);
myListeners.add(listener1);
Disposer.register(disposable, new Disposable() {
@Override
public void dispose() {
removeListener(listener);
}
});
}
@Override
protected void removeListener(BreakpointsListener listener) {
for (MyXBreakpointListener breakpointListener : myListeners) {
if (breakpointListener.myListener == listener) {
XBreakpointManager manager = breakpointListener.myBreakpointManager;
manager.removeBreakpointListener(breakpointListener);
myListeners.remove(breakpointListener);
break;
}
}
}
public int getPriority() {
return 0;
}
@Nullable
public XBreakpoint<?> findBreakpoint(@NotNull final Project project, @NotNull final Document document, final int offset) {
XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
int line = document.getLineNumber(offset);
VirtualFile file = FileDocumentManager.getInstance().getFile(document);
if (file == null) {
return null;
}
for (XLineBreakpointType<?> type : XDebuggerUtil.getInstance().getLineBreakpointTypes()) {
XLineBreakpoint<? extends XBreakpointProperties> breakpoint = breakpointManager.findBreakpointAtLine(type, file, line);
if (breakpoint != null) {
return breakpoint;
}
}
return null;
}
@Override
public GutterIconRenderer getBreakpointGutterIconRenderer(Object breakpoint) {
if (breakpoint instanceof XLineBreakpointImpl) {
RangeHighlighter highlighter = ((XLineBreakpointImpl)breakpoint).getHighlighter();
if (highlighter != null) {
return highlighter.getGutterIconRenderer();
}
}
return null;
}
public void onDialogClosed(final Project project) {
}
@Override
public void provideBreakpointItems(Project project, Collection<BreakpointItem> items) {
final XBreakpointType<?, ?>[] types = XBreakpointUtil.getBreakpointTypes();
final XBreakpointManager manager = XDebuggerManager.getInstance(project).getBreakpointManager();
for (XBreakpointType<?, ?> type : types) {
final Collection<? extends XBreakpoint<?>> breakpoints = manager.getBreakpoints(type);
if (breakpoints.isEmpty()) continue;
for (XBreakpoint<?> breakpoint : breakpoints) {
items.add(new XBreakpointItem(breakpoint));
}
}
}
private static class MyXBreakpointListener implements XBreakpointListener<XBreakpoint<?>> {
public final BreakpointsListener myListener;
public final XBreakpointManager myBreakpointManager;
public MyXBreakpointListener(BreakpointsListener listener, XBreakpointManager breakpointManager) {
myListener = listener;
myBreakpointManager = breakpointManager;
}
@Override
public void breakpointAdded(@NotNull XBreakpoint<?> breakpoint) {
myListener.breakpointsChanged();
}
@Override
public void breakpointRemoved(@NotNull XBreakpoint<?> breakpoint) {
myListener.breakpointsChanged();
}
@Override
public void breakpointChanged(@NotNull XBreakpoint<?> breakpoint) {
myListener.breakpointsChanged();
}
}
private static class AddXBreakpointAction extends AnAction {
private final XBreakpointType<?, ?> myType;
public AddXBreakpointAction(XBreakpointType<?, ?> type) {
myType = type;
getTemplatePresentation().setIcon(type.getEnabledIcon());
getTemplatePresentation().setText(type.getTitle());
}
@Override
public void actionPerformed(AnActionEvent e) {
myType.addBreakpoint(getEventProject(e), null);
}
}
}
| MichaelNedzelsky/intellij-community | platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointPanelProvider.java | Java | apache-2.0 | 6,449 | [
30522,
1013,
1008,
1008,
9385,
2456,
1011,
2325,
6892,
10024,
7076,
1055,
1012,
1054,
1012,
1051,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Copyright 2015 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.
# ==============================================================================
"""Generate some standard test data for debugging TensorBoard.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import bisect
import math
import os
import os.path
import random
import shutil
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
tf.flags.DEFINE_string("target", None, """The directoy where serialized data
will be written""")
tf.flags.DEFINE_boolean("overwrite", False, """Whether to remove and overwrite
TARGET if it already exists.""")
FLAGS = tf.flags.FLAGS
# Hardcode a start time and reseed so script always generates the same data.
_start_time = 0
random.seed(0)
def _MakeHistogramBuckets():
v = 1E-12
buckets = []
neg_buckets = []
while v < 1E20:
buckets.append(v)
neg_buckets.append(-v)
v *= 1.1
# Should include DBL_MAX, but won't bother for test data.
return neg_buckets[::-1] + [0] + buckets
def _MakeHistogram(values):
"""Convert values into a histogram proto using logic from histogram.cc."""
limits = _MakeHistogramBuckets()
counts = [0] * len(limits)
for v in values:
idx = bisect.bisect_left(limits, v)
counts[idx] += 1
limit_counts = [(limits[i], counts[i]) for i in xrange(len(limits))
if counts[i]]
bucket_limit = [lc[0] for lc in limit_counts]
bucket = [lc[1] for lc in limit_counts]
sum_sq = sum(v * v for v in values)
return tf.HistogramProto(min=min(values),
max=max(values),
num=len(values),
sum=sum(values),
sum_squares=sum_sq,
bucket_limit=bucket_limit,
bucket=bucket)
def WriteScalarSeries(writer, tag, f, n=5):
"""Write a series of scalar events to writer, using f to create values."""
step = 0
wall_time = _start_time
for i in xrange(n):
v = f(i)
value = tf.Summary.Value(tag=tag, simple_value=v)
summary = tf.Summary(value=[value])
event = tf.Event(wall_time=wall_time, step=step, summary=summary)
writer.add_event(event)
step += 1
wall_time += 10
def WriteHistogramSeries(writer, tag, mu_sigma_tuples, n=20):
"""Write a sequence of normally distributed histograms to writer."""
step = 0
wall_time = _start_time
for [mean, stddev] in mu_sigma_tuples:
data = [random.normalvariate(mean, stddev) for _ in xrange(n)]
histo = _MakeHistogram(data)
summary = tf.Summary(value=[tf.Summary.Value(tag=tag, histo=histo)])
event = tf.Event(wall_time=wall_time, step=step, summary=summary)
writer.add_event(event)
step += 10
wall_time += 100
def WriteImageSeries(writer, tag, n_images=1):
"""Write a few dummy images to writer."""
step = 0
session = tf.Session()
p = tf.placeholder("uint8", (1, 4, 4, 3))
s = tf.image_summary(tag, p)
for _ in xrange(n_images):
im = np.random.random_integers(0, 255, (1, 4, 4, 3))
summ = session.run(s, feed_dict={p: im})
writer.add_summary(summ, step)
step += 20
session.close()
def WriteAudioSeries(writer, tag, n_audio=1):
"""Write a few dummy audio clips to writer."""
step = 0
session = tf.Session()
min_frequency_hz = 440
max_frequency_hz = 880
sample_rate = 4000
duration_frames = sample_rate * 0.5 # 0.5 seconds.
frequencies_per_run = 1
num_channels = 2
p = tf.placeholder("float32", (frequencies_per_run, duration_frames,
num_channels))
s = tf.audio_summary(tag, p, sample_rate)
for _ in xrange(n_audio):
# Generate a different frequency for each channel to show stereo works.
frequencies = np.random.random_integers(
min_frequency_hz, max_frequency_hz,
size=(frequencies_per_run, num_channels))
tiled_frequencies = np.tile(frequencies, (1, duration_frames))
tiled_increments = np.tile(
np.arange(0, duration_frames), (num_channels, 1)).T.reshape(
1, duration_frames * num_channels)
tones = np.sin(2.0 * np.pi * tiled_frequencies * tiled_increments /
sample_rate)
tones = tones.reshape(frequencies_per_run, duration_frames, num_channels)
summ = session.run(s, feed_dict={p: tones})
writer.add_summary(summ, step)
step += 20
session.close()
def GenerateTestData(path):
"""Generates the test data directory."""
run1_path = os.path.join(path, "run1")
os.makedirs(run1_path)
writer1 = tf.train.SummaryWriter(run1_path)
WriteScalarSeries(writer1, "foo/square", lambda x: x * x)
WriteScalarSeries(writer1, "bar/square", lambda x: x * x)
WriteScalarSeries(writer1, "foo/sin", math.sin)
WriteScalarSeries(writer1, "foo/cos", math.cos)
WriteHistogramSeries(writer1, "histo1", [[0, 1], [0.3, 1], [0.5, 1], [0.7, 1],
[1, 1]])
WriteImageSeries(writer1, "im1")
WriteImageSeries(writer1, "im2")
WriteAudioSeries(writer1, "au1")
run2_path = os.path.join(path, "run2")
os.makedirs(run2_path)
writer2 = tf.train.SummaryWriter(run2_path)
WriteScalarSeries(writer2, "foo/square", lambda x: x * x * 2)
WriteScalarSeries(writer2, "bar/square", lambda x: x * x * 3)
WriteScalarSeries(writer2, "foo/cos", lambda x: math.cos(x) * 2)
WriteHistogramSeries(writer2, "histo1", [[0, 2], [0.3, 2], [0.5, 2], [0.7, 2],
[1, 2]])
WriteHistogramSeries(writer2, "histo2", [[0, 1], [0.3, 1], [0.5, 1], [0.7, 1],
[1, 1]])
WriteImageSeries(writer2, "im1")
WriteAudioSeries(writer2, "au2")
graph_def = tf.GraphDef()
node1 = graph_def.node.add()
node1.name = "a"
node1.op = "matmul"
node2 = graph_def.node.add()
node2.name = "b"
node2.op = "matmul"
node2.input.extend(["a:0"])
writer1.add_graph(graph_def)
node3 = graph_def.node.add()
node3.name = "c"
node3.op = "matmul"
node3.input.extend(["a:0", "b:0"])
writer2.add_graph(graph_def)
writer1.close()
writer2.close()
def main(unused_argv=None):
target = FLAGS.target
if not target:
print("The --target flag is required.")
return -1
if os.path.exists(target):
if FLAGS.overwrite:
if os.path.isdir(target):
shutil.rmtree(target)
else:
os.remove(target)
else:
print("Refusing to overwrite target %s without --overwrite" % target)
return -2
GenerateTestData(target)
if __name__ == "__main__":
tf.app.run()
| cg31/tensorflow | tensorflow/tensorboard/scripts/generate_testdata.py | Python | apache-2.0 | 7,184 | [
30522,
1001,
9385,
2325,
1996,
23435,
12314,
6048,
1012,
2035,
2916,
9235,
1012,
1001,
1001,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1001,
2017,
2089,
2025,
2224,
2023,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/bin/sh
export KDEWM=/usr/bin/i3
| renaudll/dotfiles | i3/kde-i3.sh | Shell | bsd-2-clause | 35 | [
30522,
1001,
999,
1013,
8026,
1013,
14021,
9167,
1047,
3207,
2860,
2213,
1027,
1013,
2149,
2099,
1013,
8026,
1013,
1045,
2509,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Erythrotrichia porphyroides N.L. Gardner SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Rhodophyta/Compsopogonophyceae/Erythropeltidales/Erythrotrichiaceae/Erythrotrichia/Erythrotrichia porphyroides/README.md | Markdown | apache-2.0 | 198 | [
30522,
1001,
9413,
22123,
8093,
4140,
13149,
2401,
18499,
21281,
22943,
2229,
1050,
1012,
1048,
1012,
11764,
2427,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
1996,
10161,
1997,
2166,
1010,
3822,
2254,
2249,
1001... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.example.cdm.huntfun.activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.widget.TextView;
import com.example.cdm.huntfun.R;
import com.example.cdm.huntfun.photoView.ImageDetailFragment;
import com.example.cdm.huntfun.widget.HackyViewPager;
import java.util.List;
/**
* 图片查看器
*/
public class ImagePagerActivity extends FragmentActivity {
private static final String STATE_POSITION = "STATE_POSITION";
public static final String EXTRA_IMAGE_INDEX = "image_index";
public static final String EXTRA_IMAGE_URLS = "image_urls";
private HackyViewPager mPager;
private int pagerPosition;
private TextView indicator;
// public static Drawable DEFAULTDRAWABLE;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.umessage_image_detail_pager);
// DEFAULTDRAWABLE=this.getResources().getDrawable(R.drawable.umessage_load_default);
pagerPosition = getIntent().getIntExtra(EXTRA_IMAGE_INDEX, 0);
List<String> urls = getIntent().getStringArrayListExtra(EXTRA_IMAGE_URLS);
mPager = (HackyViewPager) findViewById(R.id.pager);
ImagePagerAdapter mAdapter = new ImagePagerAdapter(getSupportFragmentManager(), urls);
mPager.setAdapter(mAdapter);
indicator = (TextView) findViewById(R.id.indicator);
CharSequence text = getString(R.string.xq_viewpager_indicator, 1, mPager.getAdapter().getCount());
indicator.setText(text);
// 更新下标
mPager.addOnPageChangeListener(new OnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int arg0) {
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
@Override
public void onPageSelected(int arg0) {
CharSequence text = getString(R.string.xq_viewpager_indicator, arg0 + 1, mPager.getAdapter().getCount());
indicator.setText(text);
}
});
if (savedInstanceState != null) {
pagerPosition = savedInstanceState.getInt(STATE_POSITION);
}
mPager.setCurrentItem(pagerPosition);
}
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putInt(STATE_POSITION, mPager.getCurrentItem());
}
private class ImagePagerAdapter extends FragmentStatePagerAdapter {
public List<String> fileList;
public ImagePagerAdapter(FragmentManager fm, List<String> fileList) {
super(fm);
this.fileList = fileList;
}
@Override
public int getCount() {
return fileList == null ? 0 : fileList.size();
}
@Override
public Fragment getItem(int position) {
String url = fileList.get(position);
return ImageDetailFragment.newInstance(url);
}
}
}
| skycdm/HuntFun | app/src/main/java/com/example/cdm/huntfun/activity/ImagePagerActivity.java | Java | apache-2.0 | 2,872 | [
30522,
7427,
4012,
1012,
2742,
1012,
3729,
2213,
1012,
5690,
11263,
2078,
1012,
4023,
1025,
12324,
11924,
1012,
9808,
1012,
14012,
1025,
12324,
11924,
1012,
2490,
1012,
1058,
2549,
1012,
10439,
1012,
15778,
1025,
12324,
11924,
1012,
2490,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright (C) 2013 Rainmeter Project Developers
*
* This Source Code Form is subject to the terms of the GNU General Public
* License; either version 2 of the License, or (at your option) any later
* version. If a copy of the GPL was not distributed with this file, You can
* obtain one at <https://www.gnu.org/licenses/gpl-2.0.html>. */
#include "StdAfx.h"
#include "CanvasD2D.h"
#include "TextFormatD2D.h"
#include "Util/DWriteFontCollectionLoader.h"
#include "Util/DWriteHelpers.h"
#include "Util/WICBitmapLockGDIP.h"
#include "../../Library/Util.h"
namespace {
D2D1_COLOR_F ToColorF(const Gdiplus::Color& color)
{
return D2D1::ColorF(color.GetR() / 255.0f, color.GetG() / 255.0f, color.GetB() / 255.0f, color.GetA() / 255.0f);
}
D2D1_RECT_F ToRectF(const Gdiplus::Rect& rect)
{
return D2D1::RectF((FLOAT)rect.X, (FLOAT)rect.Y, (FLOAT)(rect.X + rect.Width), (FLOAT)(rect.Y + rect.Height));
}
D2D1_RECT_F ToRectF(const Gdiplus::RectF& rect)
{
return D2D1::RectF(rect.X, rect.Y, rect.X + rect.Width, rect.Y + rect.Height);
}
} // namespace
namespace Gfx {
UINT CanvasD2D::c_Instances = 0;
Microsoft::WRL::ComPtr<ID2D1Factory1> CanvasD2D::c_D2DFactory;
Microsoft::WRL::ComPtr<IDWriteFactory1> CanvasD2D::c_DWFactory;
Microsoft::WRL::ComPtr<IDWriteGdiInterop> CanvasD2D::c_DWGDIInterop;
Microsoft::WRL::ComPtr<IWICImagingFactory> CanvasD2D::c_WICFactory;
CanvasD2D::CanvasD2D() : Canvas(),
m_Bitmap(),
m_TextAntiAliasing(false),
m_CanUseAxisAlignClip(false)
{
}
CanvasD2D::~CanvasD2D()
{
Finalize();
}
bool CanvasD2D::Initialize()
{
++c_Instances;
if (c_Instances == 1)
{
if (!IsWindows7OrGreater()) return false;
D2D1_FACTORY_OPTIONS fo = {};
#ifdef _DEBUG
fo.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
#endif
HRESULT hr = D2D1CreateFactory(
D2D1_FACTORY_TYPE_SINGLE_THREADED,
fo,
c_D2DFactory.GetAddressOf());
if (FAILED(hr)) return false;
hr = CoCreateInstance(
CLSID_WICImagingFactory,
nullptr,
CLSCTX_INPROC_SERVER,
IID_IWICImagingFactory,
(LPVOID*)c_WICFactory.GetAddressOf());
if (FAILED(hr)) return false;
hr = DWriteCreateFactory(
DWRITE_FACTORY_TYPE_SHARED,
__uuidof(c_DWFactory),
(IUnknown**)c_DWFactory.GetAddressOf());
if (FAILED(hr)) return false;
hr = c_DWFactory->GetGdiInterop(c_DWGDIInterop.GetAddressOf());
if (FAILED(hr)) return false;
hr = c_DWFactory->RegisterFontCollectionLoader(Util::DWriteFontCollectionLoader::GetInstance());
if (FAILED(hr)) return false;
}
return true;
}
void CanvasD2D::Finalize()
{
--c_Instances;
if (c_Instances == 0)
{
c_D2DFactory.Reset();
c_WICFactory.Reset();
c_DWGDIInterop.Reset();
if (c_DWFactory)
{
c_DWFactory->UnregisterFontCollectionLoader(Util::DWriteFontCollectionLoader::GetInstance());
c_DWFactory.Reset();
}
}
}
void CanvasD2D::Resize(int w, int h)
{
__super::Resize(w, h);
m_Target.Reset();
m_Bitmap.Resize(w, h);
m_GdipBitmap.reset(new Gdiplus::Bitmap(w, h, w * 4, PixelFormat32bppPARGB, m_Bitmap.GetData()));
m_GdipGraphics.reset(new Gdiplus::Graphics(m_GdipBitmap.get()));
}
bool CanvasD2D::BeginDraw()
{
return true;
}
void CanvasD2D::EndDraw()
{
EndTargetDraw();
}
bool CanvasD2D::BeginTargetDraw()
{
if (m_Target) return true;
const D2D1_PIXEL_FORMAT format = D2D1::PixelFormat(
DXGI_FORMAT_B8G8R8A8_UNORM,
D2D1_ALPHA_MODE_PREMULTIPLIED);
const D2D1_RENDER_TARGET_PROPERTIES properties = D2D1::RenderTargetProperties(
D2D1_RENDER_TARGET_TYPE_DEFAULT,
format,
0.0f, // Default DPI
0.0f, // Default DPI
D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE);
// A new Direct2D render target must be created for each sequence of Direct2D draw operations
// since we use GDI+ to render to the same pixel data. Without creating a new render target
// each time, it has been found that Direct2D may overwrite the draws by GDI+ since it is
// unaware of the changes made by GDI+. By creating a new render target and then releasing it
// before the next GDI+ draw operations, we ensure that the pixel data result is as expected
// Once GDI+ drawing is no longer needed, we change to recreate the render target only when the
// bitmap size is changed.
HRESULT hr = c_D2DFactory->CreateWicBitmapRenderTarget(&m_Bitmap, properties, &m_Target);
if (SUCCEEDED(hr))
{
SetTextAntiAliasing(m_TextAntiAliasing);
m_Target->BeginDraw();
// Apply any transforms that occurred before creation of |m_Target|.
UpdateTargetTransform();
return true;
}
return false;
}
void CanvasD2D::EndTargetDraw()
{
if (m_Target)
{
m_Target->EndDraw();
m_Target.Reset();
}
}
Gdiplus::Graphics& CanvasD2D::BeginGdiplusContext()
{
EndTargetDraw();
return *m_GdipGraphics;
}
void CanvasD2D::EndGdiplusContext()
{
}
HDC CanvasD2D::GetDC()
{
EndTargetDraw();
HDC dcMemory = CreateCompatibleDC(nullptr);
SelectObject(dcMemory, m_Bitmap.GetHandle());
return dcMemory;
}
void CanvasD2D::ReleaseDC(HDC dc)
{
DeleteDC(dc);
}
bool CanvasD2D::IsTransparentPixel(int x, int y)
{
if (!(x >= 0 && y >= 0 && x < m_W && y < m_H)) return false;
bool transparent = true;
DWORD* data = (DWORD*)m_Bitmap.GetData();
if (data)
{
DWORD pixel = data[y * m_W + x]; // Top-down DIB.
transparent = (pixel & 0xFF000000) != 0;
}
return transparent;
}
void CanvasD2D::UpdateTargetTransform()
{
Gdiplus::Matrix gdipMatrix;
m_GdipGraphics->GetTransform(&gdipMatrix);
D2D1_MATRIX_3X2_F d2dMatrix;
gdipMatrix.GetElements((Gdiplus::REAL*)&d2dMatrix);
m_Target->SetTransform(d2dMatrix);
m_CanUseAxisAlignClip =
d2dMatrix._12 == 0.0f && d2dMatrix._21 == 0.0f &&
d2dMatrix._31 == 0.0f && d2dMatrix._32 == 0.0f;
}
void CanvasD2D::SetTransform(const Gdiplus::Matrix& matrix)
{
m_GdipGraphics->SetTransform(&matrix);
if (m_Target)
{
UpdateTargetTransform();
}
}
void CanvasD2D::ResetTransform()
{
m_GdipGraphics->ResetTransform();
if (m_Target)
{
m_Target->SetTransform(D2D1::Matrix3x2F::Identity());
}
}
void CanvasD2D::RotateTransform(float angle, float x, float y, float dx, float dy)
{
m_GdipGraphics->TranslateTransform(x, y);
m_GdipGraphics->RotateTransform(angle);
m_GdipGraphics->TranslateTransform(dx, dy);
if (m_Target)
{
UpdateTargetTransform();
}
}
void CanvasD2D::SetAntiAliasing(bool enable)
{
// TODO: Set m_Target aliasing?
m_GdipGraphics->SetSmoothingMode(
enable ? Gdiplus::SmoothingModeHighQuality : Gdiplus::SmoothingModeNone);
m_GdipGraphics->SetPixelOffsetMode(
enable ? Gdiplus::PixelOffsetModeHighQuality : Gdiplus::PixelOffsetModeDefault);
}
void CanvasD2D::SetTextAntiAliasing(bool enable)
{
// TODO: Add support for D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE?
m_TextAntiAliasing = enable;
if (m_Target)
{
m_Target->SetTextAntialiasMode(
m_TextAntiAliasing ? D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE : D2D1_TEXT_ANTIALIAS_MODE_ALIASED);
}
}
void CanvasD2D::Clear(const Gdiplus::Color& color)
{
if (!m_Target) // Use GDI+ if D2D render target has not been created.
{
m_GdipGraphics->Clear(color);
return;
}
m_Target->Clear(ToColorF(color));
}
void CanvasD2D::DrawTextW(const WCHAR* str, UINT strLen, const TextFormat& format, Gdiplus::RectF& rect,
const Gdiplus::SolidBrush& brush, bool applyInlineFormatting)
{
if (!BeginTargetDraw()) return;
Gdiplus::Color color;
brush.GetColor(&color);
Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> solidBrush;
HRESULT hr = m_Target->CreateSolidColorBrush(ToColorF(color), solidBrush.GetAddressOf());
if (FAILED(hr)) return;
TextFormatD2D& formatD2D = (TextFormatD2D&)format;
if (!formatD2D.CreateLayout(
m_Target.Get(), str, strLen, rect.Width, rect.Height, !m_AccurateText && m_TextAntiAliasing)) return;
D2D1_POINT_2F drawPosition;
drawPosition.x = [&]()
{
if (!m_AccurateText)
{
const float xOffset = formatD2D.m_TextFormat->GetFontSize() / 6.0f;
switch (formatD2D.GetHorizontalAlignment())
{
case HorizontalAlignment::Left: return rect.X + xOffset;
case HorizontalAlignment::Right: return rect.X - xOffset;
}
}
return rect.X;
} ();
drawPosition.y = [&]()
{
// GDI+ compatibility.
float yPos = rect.Y - formatD2D.m_LineGap;
switch (formatD2D.GetVerticalAlignment())
{
case VerticalAlignment::Bottom: yPos -= formatD2D.m_ExtraHeight; break;
case VerticalAlignment::Center: yPos -= formatD2D.m_ExtraHeight / 2; break;
}
return yPos;
} ();
if (formatD2D.m_Trimming)
{
D2D1_RECT_F clipRect = ToRectF(rect);
if (m_CanUseAxisAlignClip)
{
m_Target->PushAxisAlignedClip(clipRect, D2D1_ANTIALIAS_MODE_ALIASED);
}
else
{
const D2D1_LAYER_PARAMETERS layerParams =
D2D1::LayerParameters(clipRect, nullptr, D2D1_ANTIALIAS_MODE_ALIASED);
m_Target->PushLayer(layerParams, nullptr);
}
}
// When different "effects" are used with inline coloring options, we need to
// remove the previous inline coloring, then reapply them (if needed) - instead
// of destroying/recreating the text layout.
formatD2D.ResetInlineColoring(solidBrush.Get(), strLen);
if (applyInlineFormatting)
{
formatD2D.ApplyInlineColoring(m_Target.Get(), &drawPosition);
}
m_Target->DrawTextLayout(drawPosition, formatD2D.m_TextLayout.Get(), solidBrush.Get());
if (applyInlineFormatting)
{
// Inline gradients require the drawing position, so in case that position
// changes, we need a way to reset it after drawing time so on the next
// iteration it will know the correct position.
formatD2D.ResetGradientPosition(&drawPosition);
}
if (formatD2D.m_Trimming)
{
if (m_CanUseAxisAlignClip)
{
m_Target->PopAxisAlignedClip();
}
else
{
m_Target->PopLayer();
}
}
}
bool CanvasD2D::MeasureTextW(const WCHAR* str, UINT strLen, const TextFormat& format, Gdiplus::RectF& rect)
{
TextFormatD2D& formatD2D = (TextFormatD2D&)format;
const DWRITE_TEXT_METRICS metrics = formatD2D.GetMetrics(str, strLen, !m_AccurateText);
rect.Width = metrics.width;
rect.Height = metrics.height;
return true;
}
bool CanvasD2D::MeasureTextLinesW(const WCHAR* str, UINT strLen, const TextFormat& format, Gdiplus::RectF& rect, UINT& lines)
{
TextFormatD2D& formatD2D = (TextFormatD2D&)format;
formatD2D.m_TextFormat->SetWordWrapping(DWRITE_WORD_WRAPPING_WRAP);
const DWRITE_TEXT_METRICS metrics = formatD2D.GetMetrics(str, strLen, !m_AccurateText, rect.Width);
rect.Width = metrics.width;
rect.Height = metrics.height;
lines = metrics.lineCount;
if (rect.Height > 0.0f)
{
// GDI+ draws multi-line text even though the last line may be clipped slightly at the
// bottom. This is a workaround to emulate that behaviour.
rect.Height += 1.0f;
}
else
{
// GDI+ compatibility: Zero height text has no visible lines.
lines = 0;
}
return true;
}
void CanvasD2D::DrawBitmap(Gdiplus::Bitmap* bitmap, const Gdiplus::Rect& dstRect, const Gdiplus::Rect& srcRect)
{
if (srcRect.Width != dstRect.Width || srcRect.Height != dstRect.Height)
{
// If the bitmap needs to be scaled, get rid of the D2D target and use the GDI+ code path
// to draw the bitmap. This is due to antialiasing differences between GDI+ and D2D on
// scaled bitmaps.
EndTargetDraw();
}
if (!m_Target) // Use GDI+ if D2D render target has not been created.
{
m_GdipGraphics->DrawImage(
bitmap, dstRect, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, Gdiplus::UnitPixel);
return;
}
// The D2D DrawBitmap seems to perform exactly like Gdiplus::Graphics::DrawImage since we are
// not using a hardware accelerated render target. Nevertheless, we will use it to avoid
// the EndDraw() call needed for GDI+ drawing.
Util::WICBitmapLockGDIP* bitmapLock = new Util::WICBitmapLockGDIP();
Gdiplus::Rect lockRect(0, 0, bitmap->GetWidth(), bitmap->GetHeight());
Gdiplus::Status status = bitmap->LockBits(
&lockRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData());
if (status == Gdiplus::Ok)
{
D2D1_BITMAP_PROPERTIES props = D2D1::BitmapProperties(
D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED));
Microsoft::WRL::ComPtr<ID2D1Bitmap> d2dBitmap;
HRESULT hr = m_Target->CreateSharedBitmap(
__uuidof(IWICBitmapLock), bitmapLock, &props, d2dBitmap.GetAddressOf());
if (SUCCEEDED(hr))
{
auto rDst = ToRectF(dstRect);
auto rSrc = ToRectF(srcRect);
m_Target->DrawBitmap(d2dBitmap.Get(), rDst, 1.0F, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, rSrc);
}
// D2D will still use the pixel data after this call (at the next Flush() or EndDraw()).
bitmap->UnlockBits(bitmapLock->GetBitmapData());
}
bitmapLock->Release();
}
void CanvasD2D::DrawMaskedBitmap(Gdiplus::Bitmap* bitmap, Gdiplus::Bitmap* maskBitmap, const Gdiplus::Rect& dstRect,
const Gdiplus::Rect& srcRect, const Gdiplus::Rect& srcRect2)
{
if (!BeginTargetDraw()) return;
auto rDst = ToRectF(dstRect);
auto rSrc = ToRectF(srcRect);
Util::WICBitmapLockGDIP* bitmapLock = new Util::WICBitmapLockGDIP();
Gdiplus::Rect lockRect(srcRect2);
Gdiplus::Status status = bitmap->LockBits(
&lockRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData());
if (status == Gdiplus::Ok)
{
D2D1_BITMAP_PROPERTIES props = D2D1::BitmapProperties(
D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED));
Microsoft::WRL::ComPtr<ID2D1Bitmap> d2dBitmap;
HRESULT hr = m_Target->CreateSharedBitmap(
__uuidof(IWICBitmapLock), bitmapLock, &props, d2dBitmap.GetAddressOf());
if (SUCCEEDED(hr))
{
// Create bitmap brush from original |bitmap|.
Microsoft::WRL::ComPtr<ID2D1BitmapBrush> brush;
D2D1_BITMAP_BRUSH_PROPERTIES propertiesXClampYClamp = D2D1::BitmapBrushProperties(
D2D1_EXTEND_MODE_CLAMP,
D2D1_EXTEND_MODE_CLAMP,
D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
// "Move" and "scale" the |bitmap| to match the destination.
D2D1_MATRIX_3X2_F translate = D2D1::Matrix3x2F::Translation(rDst.left, rDst.top);
D2D1_MATRIX_3X2_F scale = D2D1::Matrix3x2F::Scale(
D2D1::SizeF((rDst.right - rDst.left) / (float)srcRect2.Width, (rDst.bottom - rDst.top) / (float)srcRect2.Height));
D2D1_BRUSH_PROPERTIES brushProps = D2D1::BrushProperties(1.0F, scale * translate);
hr = m_Target->CreateBitmapBrush(
d2dBitmap.Get(),
propertiesXClampYClamp,
brushProps,
brush.GetAddressOf());
// Load the |maskBitmap| and use the bitmap brush to "fill" its contents.
// Note: The image must be aliased when applying the opacity mask.
if (SUCCEEDED(hr))
{
Util::WICBitmapLockGDIP* maskBitmapLock = new Util::WICBitmapLockGDIP();
Gdiplus::Rect maskLockRect(0, 0, maskBitmap->GetWidth(), maskBitmap->GetHeight());
status = maskBitmap->LockBits(
&maskLockRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, maskBitmapLock->GetBitmapData());
if (status == Gdiplus::Ok)
{
D2D1_BITMAP_PROPERTIES maskProps = D2D1::BitmapProperties(
D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED));
Microsoft::WRL::ComPtr<ID2D1Bitmap> d2dMaskBitmap;
hr = m_Target->CreateSharedBitmap(
__uuidof(IWICBitmapLock), maskBitmapLock, &props, d2dMaskBitmap.GetAddressOf());
if (SUCCEEDED(hr))
{
m_Target->SetAntialiasMode(D2D1_ANTIALIAS_MODE_ALIASED); // required
m_Target->FillOpacityMask(
d2dMaskBitmap.Get(),
brush.Get(),
D2D1_OPACITY_MASK_CONTENT_GRAPHICS,
&rDst,
&rSrc);
m_Target->SetAntialiasMode(D2D1_ANTIALIAS_MODE_PER_PRIMITIVE);
}
maskBitmap->UnlockBits(bitmapLock->GetBitmapData());
}
maskBitmapLock->Release();
}
}
bitmap->UnlockBits(bitmapLock->GetBitmapData());
}
bitmapLock->Release();
}
void CanvasD2D::FillRectangle(Gdiplus::Rect& rect, const Gdiplus::SolidBrush& brush)
{
if (!m_Target) // Use GDI+ if D2D render target has not been created.
{
m_GdipGraphics->FillRectangle(&brush, rect);
return;
}
Gdiplus::Color color;
brush.GetColor(&color);
Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> solidBrush;
HRESULT hr = m_Target->CreateSolidColorBrush(ToColorF(color), solidBrush.GetAddressOf());
if (SUCCEEDED(hr))
{
m_Target->FillRectangle(ToRectF(rect), solidBrush.Get());
}
}
} // namespace Gfx
| tomkort/rainmeter | Common/Gfx/CanvasD2D.cpp | C++ | gpl-2.0 | 16,684 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2286,
4542,
22828,
2622,
9797,
1008,
1008,
2023,
3120,
3642,
2433,
2003,
3395,
2000,
1996,
3408,
1997,
1996,
27004,
2236,
2270,
1008,
6105,
1025,
2593,
2544,
1016,
1997,
1996,
6105,
1010,
2030,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* CoAP on Moterunner Demonstration
* Copyright (c) 2013-2014, SAP AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the SAP AG nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* Matthias Thoma
* Martin Zabel
* Theofilos Kakantousis
*
* The following things need to be added before any public release:
* 3. Consider to add TTL / Resend stuff (see hellosensor.java)
* 4. Have a look at rules for message id and consider to move it either here or to some generic class
*/
package com.sap.coap;
import com.ibm.saguaro.system.*;
import com.ibm.iris.*;
import com.ibm.saguaro.mrv6.*;
//##if LOGGING
import com.ibm.saguaro.logger.*;
//##endif
public class Message {
public byte[] header = new byte[4];
public byte[] token = null;
public byte[] payload = null;
public int payloadLength = 0;
public byte[] options;
public int optionArraySize = 0;
public int roundCounter = 0;
@Immutable public static final byte CON = 0x00;
@Immutable public static final byte NON = 0x01;
@Immutable public static final byte ACK = 0x02;
@Immutable public static final byte RST = 0x03;
@Immutable public static final byte EMPTY = 0x00;
@Immutable public static final byte GET = 0x01;
@Immutable public static final byte POST = 0x02;
@Immutable public static final byte PUT = 0x03;
@Immutable public static final byte DELETE = 0x04;
public final void setPayload(byte[] mypayload){
this.payload = mypayload;
this.payloadLength = mypayload.length;
}
public Message() {
header[0] = 0x40; // set the version number
}
/// <summary>
/// Constructor.
/// </summary>
/// <param name="type"> something </param>
/// <param name="tokenLen"> token legnth </param>
/// <param name="code"> CoAP message code </param>
/// <param name="msgid"> CoAP message id </param>
public Message(byte type, byte tokenLen, byte code, int msgid) {
setMessageHeader(type, tokenLen, code, msgid);
}
public final void setMessageHeader(byte type, byte tokenLen, byte code, int msgid) {
header[0] = (byte) ((0x40 | (type << 4)) | tokenLen);
header[1] = code;
Util.set16be(header,2,msgid);
}
public static byte createResponseCode(final byte cl, final byte cc) {
return (byte) ((cl << 5) | cc);
}
public final byte getVersion() {
return (byte) ((header[0] >>> 6) & 0x03);
}
public final byte getType() {
return (byte) ((header[0] & 0x30) >> 4);
}
public final void setType(final byte type) {
byte tl = (byte) (header [0] & 0x0F);
header[0] = (byte) ((0x40 | (type << 4)) | tl); // set the version number
}
public final byte getTokenLength() {
return (byte) (header[0] & 0x0F);
}
public final byte getCode() {
return header[1];
}
public final int getMessageId() {
return Util.get16be(header,2);
}
public final void clearOptions() {
options=null;
optionArraySize=0;
}
public final void clearPayload() {
payloadLength = 0;
payload = null;
}
public final byte[] getPayload() {
return this.payload;
}
public final int getPayloadSize() {
return this.payloadLength;
}
public byte[] getURIfromOptionArray() {
int partNo = 0;
int bufferOffset = 0;
int offset = getOffsetOfOptionWithId(11, partNo);
if (offset<0)
return null;
int bufferSize = 0;
// Calculate buffer size
int firstOffset = offset;
while (offset>=0) {
if (partNo>0)
bufferSize++;
int valueSize = getValueSizeOfOptionWithOffset(offset);
bufferSize += valueSize;
partNo++;
offset = getOffsetOfOptionWithId(11, partNo);
}
byte[] buffer = new byte[bufferSize];
partNo=0;
offset = getOffsetOfOptionWithId(11, partNo);
int valueSize = getValueSizeOfOptionWithOffset(offset);
byte[] data = getValueOfOptionWithOffset(offset);
while (data != null) {
if (partNo>0) {
buffer[bufferOffset]='/';
bufferOffset++;
}
partNo++;
Util.copyData(data, 0, buffer, bufferOffset, valueSize);
bufferOffset += valueSize;
offset = getOffsetOfOptionWithId(11, partNo);
data = null;
if (offset>=0) {
valueSize = getValueSizeOfOptionWithOffset(offset);
data = getValueOfOptionWithOffset(offset);
}
}
return buffer;
}
public boolean hasOption(int id) {
return (getOffsetOfOptionWithId(id,0) != -1);
}
public void insertOption(int id, byte[] value, int valueSize) {
//1. find position
// an ascending order of the options has to be kept
// find start offsets of the 'enclosing' options left and right of the one to insert
// special case: inserting at the beginning: offsetRightOption = 0
// special case: inserting at the end: offsetRightOption = optionArraySize (i.e. points behind the array)
int offsetRightOption = 0;
int idRightOption = 0;
int idLeftOption = 0;
while(offsetRightOption < optionArraySize) { //if the loop is not left by a break, the option has to be inserted at the end
idRightOption = idOfOptionWithOffset(options, offsetRightOption, idRightOption);
if(idRightOption > id) { //insertion point found
break;
}
idLeftOption = idRightOption;
offsetRightOption = findOffsetOfNextOption(options, offsetRightOption);
}
//2. calculate value length field size for this option
int optionExtendedLengthFieldSize = getExtendedOptionFieldSizeFor(valueSize);
//3. calculate delta value for this option.
// depends on the previous id (being 0 when no previous option exists)
int delta = id - idLeftOption;
//4. calculate delta field size for this option
int optionExtendedDeltaFieldSize = getExtendedOptionFieldSizeFor(delta);
//5. recalculate the delta field size for the next option
// the delta value for the next option decreases due to the insertion
// this may result in less bytes being used for the size field
int deltaFieldSizeRightOption = 0;
int deltaFieldSizeRightOptionNew = 0;
int deltaRightOptionNew = 0;
int extendedDeltaFieldSizeDifferenceRightOption = 0;
//only if a next option exists
if(offsetRightOption != optionArraySize) {
//get the old field size for the next option
deltaFieldSizeRightOption = optionExtendedDeltaFieldSize(options, offsetRightOption);
//recalculate delta field size for next option
deltaRightOptionNew = idRightOption - id;
deltaFieldSizeRightOptionNew = getExtendedOptionFieldSizeFor(deltaRightOptionNew);
//determine the size difference between the new and the old field
extendedDeltaFieldSizeDifferenceRightOption = deltaFieldSizeRightOption - deltaFieldSizeRightOptionNew;
}
//7. calculate total size of new option array
int optionArraySizeNew = optionArraySize
+ 1
+ optionExtendedLengthFieldSize
+ optionExtendedDeltaFieldSize
+ valueSize
- extendedDeltaFieldSizeDifferenceRightOption;
//8. allocate mem for new option array
byte[] optionsNew = new byte[optionArraySizeNew];
//9. copy options until insertion point to new array
if(offsetRightOption>0) {
Util.copyData(options, 0, optionsNew, 0, offsetRightOption);
}
int currentOffset = offsetRightOption; //next position to read from the old options where no additional option is present. points now to the header byte of the next option
int offsetFirstByte = offsetRightOption; //points to the header byte of the option to insert
int currentOffsetNew = offsetFirstByte+1; //next position to write in the new array (after the header byte of the option to insert)
//10. write delta
if(optionExtendedDeltaFieldSize == 1) {
optionsNew[offsetFirstByte] += 13 << 4;
optionsNew[currentOffsetNew] = (byte)(delta-13);
}
else if(optionExtendedDeltaFieldSize == 2) {
optionsNew[offsetFirstByte] += 14 << 4;
Util.set16(optionsNew, currentOffsetNew, delta-269);
}
else { //optionExtendedDeltaFieldSize == 0
optionsNew[offsetFirstByte] += delta << 4;
}
currentOffsetNew += optionExtendedDeltaFieldSize;
//11. write value length
if(optionExtendedLengthFieldSize == 1) {
optionsNew[offsetFirstByte] += 13;
optionsNew[currentOffsetNew] = (byte)(valueSize-13);
}
else if(optionExtendedLengthFieldSize == 2) {
optionsNew[offsetFirstByte] += 14;
Util.set16(optionsNew, currentOffsetNew, valueSize-269);
}
else { //optionExtendedLengthFieldSize == 0
optionsNew[offsetFirstByte] += valueSize;
}
currentOffsetNew += optionExtendedLengthFieldSize;
//12. copy value
if(valueSize>0) {
Util.copyData(value, 0, optionsNew, currentOffsetNew, valueSize);
}
currentOffsetNew += valueSize;
//only if a next option exists
if(offsetRightOption != optionArraySize) {
//13. write header of next option with adjusted delta
//length stays constant, delta is erased
optionsNew[currentOffsetNew] = (byte) (options[currentOffset] & 0x0F);
//write recalculated delta to the next option
if(deltaFieldSizeRightOptionNew == 1) {
optionsNew[currentOffsetNew] += 13 << 4;
optionsNew[currentOffsetNew+1] = (byte) (deltaRightOptionNew-13);
}
else if(deltaFieldSizeRightOptionNew == 2){
optionsNew[currentOffsetNew] += 14 << 4;
Util.set16(optionsNew, currentOffsetNew+1, deltaRightOptionNew-269);
}
else { //deltaFieldSizeRightOptionNew == 0
optionsNew[currentOffsetNew] += deltaRightOptionNew << 4;
}
//jump behind the next option's extended delta field delta in the new array
currentOffsetNew += 1+deltaFieldSizeRightOptionNew;
//jump behind the next option's extended delta field in the old array
currentOffset += 1+deltaFieldSizeRightOption;
//14. copy rest of array (= next option's extended value length field, next option's value, all subsequent options)
int restLength = optionArraySize - currentOffset;
Util.copyData(options, currentOffset, optionsNew, currentOffsetNew, restLength);
}
//15. replace old options by new
options = optionsNew;
optionArraySize = optionArraySizeNew;
}
public int getOffsetOfOptionWithId(int wantedOptionId, int matchNumber) {
int currentOptionOffset = 0;
int currentDelta = 0;
while(currentOptionOffset < optionArraySize) {
int currentOptionId = idOfOptionWithOffset(options, currentOptionOffset, currentDelta);
if(currentOptionId == wantedOptionId) { //first of the options has been found. iterate them until the right match number is found
for(int i = 0; i<matchNumber; i++) {
currentOptionOffset = findOffsetOfNextOption(options, currentOptionOffset);
if(currentOptionOffset == optionArraySize || (options[currentOptionOffset] & 0xF0) != 0x00) {
return -1; //array length has been exceeded or the delta is not 0, i.e. an option with an higher id was found
}
}
return currentOptionOffset;
}
if(currentOptionId > wantedOptionId) {
return -1;
}
currentDelta = currentOptionId;
currentOptionOffset = findOffsetOfNextOption(options, currentOptionOffset);
}
return -1;
}
public byte[] getValueOfOptionWithOffset(int offset) {
int valueSize = getValueSizeOfOptionWithOffset(options, offset);
int headerSize = headerSizeOfOptionWithOffset(options, offset);
offset += headerSize;
byte[] value = new byte[valueSize];
if(valueSize>0) {
Util.copyData(options, offset, value, 0, valueSize);
}
return value;
}
public int getValueSizeOfOptionWithOffset(int offset) {
return getValueSizeOfOptionWithOffset(options, offset);
}
public void removeOptionWithOffset(int offset) {
//1. get delta of this option
int delta = idOfOptionWithOffset(options, offset, 0); //this method with 0 as previous delta gives just the delta of this option
//2. get length of the block to remove
int optionSize = headerSizeOfOptionWithOffset(options, offset)
+ getValueSizeOfOptionWithOffset(options, offset);
//3. recalculate next option's new delta value
int offsetRightOption = offset + optionSize; //same as findOffsetOfNextOption(options, offset);
int deltaRightOption;
int deltaFieldSizeRightOption = 0;
int deltaRightOptionNew = 0;
int deltaFieldSizeRightOptionNew = 0;
int deltaFieldSizeDifferenceRightOption = 0;
if(offsetRightOption != optionArraySize) {
//get the old field size for the next option
deltaRightOption = idOfOptionWithOffset(options, offsetRightOption, 0); //this method with 0 as previous delta gives just the delta of this option
deltaFieldSizeRightOption = optionExtendedDeltaFieldSize(options, offsetRightOption);
//recalculate delta field size for next option
deltaRightOptionNew = delta + deltaRightOption;
deltaFieldSizeRightOptionNew = getExtendedOptionFieldSizeFor(deltaRightOptionNew);
//determine the size difference between the new and the old field
deltaFieldSizeDifferenceRightOption = deltaFieldSizeRightOptionNew - deltaFieldSizeRightOption;
}
//6. calculate new array size
int optionArraySizeNew = optionArraySize
- optionSize
+ deltaFieldSizeDifferenceRightOption;
//7. allocate mem for new option array
byte[] optionsNew = new byte[optionArraySizeNew];
//8. copy old option array to the start of the option to remove
if (offset>0)
Util.copyData(options, 0, optionsNew, 0, offset);
int offsetNew = offset;
offset += optionSize;
//only if a next option exists
if(offsetRightOption != optionArraySize) {
//9. write new delta for next option
//length stays constant, delta is erased
optionsNew[offsetNew] = (byte) (options[offset] & 0x0F);
//write recalculated delta to the next option
if(deltaFieldSizeRightOptionNew == 1) {
optionsNew[offsetNew] += 13 << 4;
optionsNew[offsetNew+1] = (byte) (deltaRightOptionNew-13);
}
else if(deltaFieldSizeRightOptionNew == 2){
optionsNew[offsetNew] += 14 << 4;
Util.set16(optionsNew, offsetNew+1, deltaRightOptionNew-269);
}
else { //deltaFieldSizeRightOptionNew == 0
optionsNew[offsetNew] += deltaRightOptionNew << 4;
}
//jump behind the next option's extended delta field delta in the new array
offsetNew += 1+deltaFieldSizeRightOptionNew;
//jump behind the next option's extended delta field in the old array
offset += 1+deltaFieldSizeRightOption;
//10. copy rest of the array
int restLength = optionArraySizeNew - offsetNew;
Util.copyData(options, offset, optionsNew, offsetNew, restLength);
}
options = optionsNew;
optionArraySize = optionArraySizeNew;
}
public void removeOptionWithId(int id, int matchNumber) {
int offset = getOffsetOfOptionWithId(id, matchNumber);
removeOptionWithOffset(offset);
}
public byte[] valueOfOptionWithId(int id, int no) {
int partNo = 0;
int offset = getOffsetOfOptionWithId(id, no);
if (offset>=0) {
int valueSize = getValueSizeOfOptionWithOffset(offset);
byte[] data = getValueOfOptionWithOffset(offset);
return data;
}
return null;
}
public int findOffsetOfNextOption(int offset) {
return findOffsetOfNextOption(this.options, offset);
}
public int idOfOptionWithOffset(int offset, int currentDelta) {
return idOfOptionWithOffset(this.options, offset, currentDelta);
}
public void encodeTo(byte[] buffer, int offset) {
int iOffset = 0;
Util.copyData(header, 0, buffer, offset, 4);
iOffset+=4;
byte tokenLength = this.getTokenLength();
if (tokenLength > 0) {
Util.copyData(token,0, buffer, offset+iOffset, tokenLength);
iOffset += tokenLength;
}
if (optionArraySize>0) {
Util.copyData(options, 0, buffer, offset+iOffset, optionArraySize);
iOffset += optionArraySize;
}
if (this.payloadLength!=0) {
buffer[offset+iOffset] = (byte) 0xFF;
iOffset++;
Util.copyData(this.payload,0, buffer, offset+iOffset, this.payloadLength);
}
}
//
// Return:
// 0: OK
// -1: Protocol error
// -2: Currently unsupported feature
public byte decode(byte[] inBuffer, int offset, int len) {
//##if LOGGING
Logger.appendString(csr.s2b("CoAPDecode :: ENTER DECODE"));
Logger.flush(Mote.INFO);
//##endif
int inOffset = offset;
int endLen = offset+len;
payloadLength = 0;
Util.copyData(inBuffer, offset, header, 0, 4);
inOffset += 4;
// Read token
byte tokenLength = getTokenLength();
if(tokenLength > 8) {
return -1;
}
if(inOffset == -1) {
return -1;
}
//##if LOGGING
Logger.appendString(csr.s2b("CoAPDecode :: token len"));
Logger.appendInt(tokenLength);
Logger.flush(Mote.INFO);
//##endif
if (tokenLength>0) {
token = new byte[tokenLength];
Util.copyData(inBuffer, inOffset, token, 0, tokenLength);
}
inOffset += tokenLength;
// Check if end of Message
if (inOffset >= endLen) // Zero length Message, zero options
return 0;
//##if LOGGING
Logger.appendString(csr.s2b("CoAPDecode :: start reading options "));
Logger.flush(Mote.INFO);
//##endif
// Check if payload marker or options
int optionOffset = inOffset;
inOffset = jumpOverOptions(inBuffer, inOffset, endLen);
if(inOffset == -1) {
return -1;
}
//##if LOGGING
Logger.appendString(csr.s2b("CoAPDecode :: new offset"));
Logger.appendInt(inOffset);
Logger.appendString(csr.s2b("CoAPDecode :: endlen"));
Logger.appendInt(endLen);
Logger.flush(Mote.INFO);
//##endif
optionArraySize = inOffset - optionOffset; //may be 0 if no options are given
options = new byte[optionArraySize];
if(optionArraySize > 0) {
Util.copyData(inBuffer, optionOffset, options, 0, optionArraySize);
}
//##if LOGGING
Logger.appendString(csr.s2b("CoAPDecode :: end reading options "));
Logger.flush(Mote.INFO);
//##endif
if (inOffset == endLen) { // Zero length Message
//##if LOGGING
Logger.appendString(csr.s2b("CoAPDecode :: no payload "));
Logger.flush(Mote.INFO);
//##endif
return 0;
}
if (inBuffer[inOffset] == (byte) 0xFF) {
inOffset++;
if(inOffset == endLen) { //protocol error: there is no payload though the marker indicates
//##if LOGGING
Logger.appendString(csr.s2b("CoAPDecode :: protocol error "));
Logger.flush(Mote.INFO);
//##endif
return -1;
}
// Payload
payloadLength = endLen-inOffset;
payload = new byte[payloadLength];
Util.copyData(inBuffer, inOffset, payload, 0, payloadLength);
}
else {
inOffset++;
if(inOffset < endLen) { //protocol error: there is payload though there is no marker
//##if LOGGING
Logger.appendString(csr.s2b("CoAPDecode :: protocol error "));
Logger.flush(Mote.INFO);
//##endif
return -1;
}
}
return 0;
}
public final int getMessageLength() {
int len=4+getTokenLength();
if (this.payloadLength!=0)
len += 1+payloadLength;
len += optionArraySize;
return len;
}
public final Packet prepareResponseForSourcePacket(int inDstPort, byte[] inDstAddr, byte[] inSrcAddr, int srcPort) {
int dstport = inDstPort;
int lenp = getMessageLength();
Packet tempPacket = Mac.getPacket();
tempPacket.release();
Address.copyAddress(inDstAddr, 0, tempPacket.dstaddr, 0);
Address.copyAddress(inSrcAddr, 0, tempPacket.srcaddr, 0);
tempPacket.create(dstport, srcPort, lenp);
encodeTo(tempPacket.payloadBuf, tempPacket.payloadOff);
return tempPacket;
}
private static int jumpOverOptions(byte[] inBuffer, int offset, int len) {
int nextOptionOffset = offset;
while(nextOptionOffset < len && inBuffer[nextOptionOffset] != (byte) 0xFF) {
// checking for protocol violation -- one of the nibbles is F but it's not the payload marker
// check belongs only here since the first time parsing of a received message happens here
if( (inBuffer[offset] & 0x0F) == 0x0F || (inBuffer[offset] & 0xF0) == 0xF0 ) {
return -1;
}
nextOptionOffset = findOffsetOfNextOption(inBuffer, nextOptionOffset);
}
return nextOptionOffset;
}
private static int findOffsetOfNextOption(byte[] inBuffer, int offset) {
int headerSize = headerSizeOfOptionWithOffset(inBuffer, offset);
int valueSize = getValueSizeOfOptionWithOffset(inBuffer, offset);
int currentOptionSize = headerSize + valueSize;
return offset + currentOptionSize;
}
private static int headerSizeOfOptionWithOffset(byte[] inBuffer, int offset) {
int size = 1;
size += optionExtendedDeltaFieldSize(inBuffer, offset);
size += optionExtendedLengthFieldSize(inBuffer, offset);
return size;
}
private static int optionExtendedDeltaFieldSize(byte[] inBuffer, int offset) {
byte optionDelta = (byte) (((inBuffer[offset] & 0xF0) >> 4));
if(optionDelta < 13)
return 0;
if(optionDelta == 13)
return 1;
return 2; //optionDelta == 14
}
private static int optionExtendedLengthFieldSize(byte[] inBuffer, int offset) {
byte optionLength = (byte) (inBuffer[offset] & 0x0F);
if(optionLength < 13)
return 0;
if(optionLength == 13)
return 1;
return 2; //optionLength == 14
}
private static int getValueSizeOfOptionWithOffset(byte[] inBuffer, int offset) {
byte optionLength = (byte) (inBuffer[offset] & 0x0F);
if(optionLength < 13)
return optionLength;
else {
offset += 1 + optionExtendedDeltaFieldSize(inBuffer, offset);
if(optionLength == 13) {
return inBuffer[offset] + 13;
}
return Util.get16(inBuffer, offset) + 269; //optionLength == 14
}
}
private static int idOfOptionWithOffset(byte[] inBuffer, int offset, int currentDelta) {
byte optionDelta = (byte) (((inBuffer[offset] & 0xF0) >> 4));
if(optionDelta < 13)
return currentDelta + optionDelta;
else {
offset += 1;
if(optionDelta == 13) {
return currentDelta + inBuffer[offset] + 13;
}
return currentDelta + Util.get16(inBuffer, offset) + 269; //optionDelta == 14
}
}
private static int getExtendedOptionFieldSizeFor(int input) {
if(input<13)
return 0;
else if(input >= 13 && input < 269)
return 1;
return 2; //input >= 269
}
} | MR-CoAP/CoAP | src/com/sap/coap/Message.java | Java | bsd-3-clause | 26,430 | [
30522,
1013,
1008,
28155,
2361,
2006,
9587,
3334,
4609,
3678,
10467,
1008,
9385,
1006,
1039,
1007,
2286,
1011,
2297,
1010,
20066,
12943,
1008,
2035,
2916,
9235,
1012,
1008,
1008,
25707,
1998,
2224,
1999,
3120,
1998,
12441,
3596,
1010,
2007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# -*- coding: utf8 -*-
#
# Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
#
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from . import stock_procurement_split
| ndp-systemes/odoo-addons | stock_procurement_split/__init__.py | Python | agpl-3.0 | 822 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
2620,
1011,
1008,
1011,
1001,
1001,
9385,
1006,
1039,
1007,
2418,
21915,
2291,
2229,
1006,
1026,
8299,
1024,
1013,
1013,
7479,
1012,
21915,
1011,
2291,
2229,
1012,
10424,
1028,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Item Controller
*
* @package ReReplacer
* @version 5.4.4
*
* @author Peter van Westen <peter@nonumber.nl>
* @link http://www.nonumber.nl
* @copyright Copyright © 2012 NoNumber All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
jimport('joomla.application.component.controllerform');
/**
* Item Controller
*/
class ReReplacerControllerItem extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
*/
protected $text_prefix = 'NN';
// Parent class access checks are sufficient for this controller.
}
| cristhian-fe/EidonKaires | administrator/components/com_rereplacer/controllers/item.php | PHP | gpl-2.0 | 682 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
8875,
11486,
1008,
1008,
1030,
7427,
2128,
2890,
24759,
10732,
2099,
1008,
1030,
2544,
1019,
1012,
1018,
1012,
1018,
1008,
1008,
1030,
3166,
2848,
3158,
2225,
2368,
1026,
2848,
1030,
2512,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
* Foundation.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* or from the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* Copyright (c) 2001 - 2013 Object Refinery Ltd, Pentaho Corporation and Contributors.. All rights reserved.
*/
package org.pentaho.reporting.engine.classic.core.style;
import org.pentaho.reporting.engine.classic.core.util.ObjectStreamResolveException;
import java.io.ObjectStreamException;
import java.io.Serializable;
/**
* Creation-Date: 24.11.2005, 17:08:01
*
* @author Thomas Morgner
*/
public class VerticalTextAlign implements Serializable {
public static final VerticalTextAlign USE_SCRIPT = new VerticalTextAlign( "use-script" );
public static final VerticalTextAlign BASELINE = new VerticalTextAlign( "baseline" );
public static final VerticalTextAlign SUB = new VerticalTextAlign( "sub" );
public static final VerticalTextAlign SUPER = new VerticalTextAlign( "super" );
public static final VerticalTextAlign TOP = new VerticalTextAlign( "top" );
public static final VerticalTextAlign TEXT_TOP = new VerticalTextAlign( "text-top" );
public static final VerticalTextAlign CENTRAL = new VerticalTextAlign( "central" );
public static final VerticalTextAlign MIDDLE = new VerticalTextAlign( "middle" );
public static final VerticalTextAlign BOTTOM = new VerticalTextAlign( "bottom" );
public static final VerticalTextAlign TEXT_BOTTOM = new VerticalTextAlign( "text-bottom" );
private String id;
private VerticalTextAlign( final String id ) {
this.id = id;
}
/**
* Replaces the automatically generated instance with one of the enumeration instances.
*
* @return the resolved element
* @throws java.io.ObjectStreamException
* if the element could not be resolved.
*/
protected Object readResolve() throws ObjectStreamException {
if ( this.id.equals( VerticalTextAlign.USE_SCRIPT.id ) ) {
return VerticalTextAlign.USE_SCRIPT;
}
if ( this.id.equals( VerticalTextAlign.BASELINE.id ) ) {
return VerticalTextAlign.BASELINE;
}
if ( this.id.equals( VerticalTextAlign.SUPER.id ) ) {
return VerticalTextAlign.SUPER;
}
if ( this.id.equals( VerticalTextAlign.SUB.id ) ) {
return VerticalTextAlign.SUB;
}
if ( this.id.equals( VerticalTextAlign.TOP.id ) ) {
return VerticalTextAlign.TOP;
}
if ( this.id.equals( VerticalTextAlign.TEXT_TOP.id ) ) {
return VerticalTextAlign.TEXT_TOP;
}
if ( this.id.equals( VerticalTextAlign.BOTTOM.id ) ) {
return VerticalTextAlign.BOTTOM;
}
if ( this.id.equals( VerticalTextAlign.TEXT_BOTTOM.id ) ) {
return VerticalTextAlign.TEXT_BOTTOM;
}
if ( this.id.equals( VerticalTextAlign.CENTRAL.id ) ) {
return VerticalTextAlign.CENTRAL;
}
if ( this.id.equals( VerticalTextAlign.MIDDLE.id ) ) {
return VerticalTextAlign.MIDDLE;
}
// unknown element alignment...
throw new ObjectStreamResolveException();
}
public static VerticalTextAlign valueOf( String id ) {
if ( id == null ) {
return null;
}
if ( id.equals( VerticalTextAlign.USE_SCRIPT.id ) ) {
return VerticalTextAlign.USE_SCRIPT;
}
if ( id.equals( VerticalTextAlign.BASELINE.id ) ) {
return VerticalTextAlign.BASELINE;
}
if ( id.equals( VerticalTextAlign.SUPER.id ) ) {
return VerticalTextAlign.SUPER;
}
if ( id.equals( VerticalTextAlign.SUB.id ) ) {
return VerticalTextAlign.SUB;
}
if ( id.equals( VerticalTextAlign.TOP.id ) ) {
return VerticalTextAlign.TOP;
}
if ( id.equals( VerticalTextAlign.TEXT_TOP.id ) ) {
return VerticalTextAlign.TEXT_TOP;
}
if ( id.equals( VerticalTextAlign.BOTTOM.id ) ) {
return VerticalTextAlign.BOTTOM;
}
if ( id.equals( VerticalTextAlign.TEXT_BOTTOM.id ) ) {
return VerticalTextAlign.TEXT_BOTTOM;
}
if ( id.equals( VerticalTextAlign.CENTRAL.id ) ) {
return VerticalTextAlign.CENTRAL;
}
if ( id.equals( VerticalTextAlign.MIDDLE.id ) ) {
return VerticalTextAlign.MIDDLE;
}
return null;
}
public boolean equals( final Object o ) {
if ( this == o ) {
return true;
}
if ( o == null || getClass() != o.getClass() ) {
return false;
}
final VerticalTextAlign that = (VerticalTextAlign) o;
if ( !id.equals( that.id ) ) {
return false;
}
return true;
}
public int hashCode() {
return id.hashCode();
}
/**
* Returns a string representation of the object. In general, the <code>toString</code> method returns a string that
* "textually represents" this object. The result should be a concise but informative representation that is easy for
* a person to read. It is recommended that all subclasses override this method.
* <p/>
* The <code>toString</code> method for class <code>Object</code> returns a string consisting of the name of the class
* of which the object is an instance, the at-sign character `<code>@</code>', and the unsigned hexadecimal
* representation of the hash code of the object. In other words, this method returns a string equal to the value of:
* <blockquote>
*
* <pre>
* getClass().getName() + '@' + Integer.toHexString( hashCode() )
* </pre>
*
* </blockquote>
*
* @return a string representation of the object.
*/
public String toString() {
return id;
}
}
| EgorZhuk/pentaho-reporting | engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/style/VerticalTextAlign.java | Java | lgpl-2.1 | 6,057 | [
30522,
1013,
1008,
1008,
2023,
2565,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,
2009,
2104,
1996,
1008,
3408,
1997,
1996,
27004,
8276,
2236,
2270,
6105,
1010,
2544,
1016,
1012,
1015,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import traverse from "../lib";
import assert from "assert";
import { parse } from "babylon";
import * as t from "babel-types";
function getPath(code) {
const ast = parse(code, { plugins: ["flow", "asyncGenerators"] });
let path;
traverse(ast, {
Program: function (_path) {
path = _path;
_path.stop();
},
});
return path;
}
describe("inference", function () {
describe("baseTypeStrictlyMatches", function () {
it("it should work with null", function () {
const path = getPath("var x = null; x === null").get("body")[1].get("expression");
const left = path.get("left");
const right = path.get("right");
const strictMatch = left.baseTypeStrictlyMatches(right);
assert.ok(strictMatch, "null should be equal to null");
});
it("it should work with numbers", function () {
const path = getPath("var x = 1; x === 2").get("body")[1].get("expression");
const left = path.get("left");
const right = path.get("right");
const strictMatch = left.baseTypeStrictlyMatches(right);
assert.ok(strictMatch, "number should be equal to number");
});
it("it should bail when type changes", function () {
const path = getPath("var x = 1; if (foo) x = null;else x = 3; x === 2")
.get("body")[2].get("expression");
const left = path.get("left");
const right = path.get("right");
const strictMatch = left.baseTypeStrictlyMatches(right);
assert.ok(!strictMatch, "type might change in if statement");
});
it("it should differentiate between null and undefined", function () {
const path = getPath("var x; x === null").get("body")[1].get("expression");
const left = path.get("left");
const right = path.get("right");
const strictMatch = left.baseTypeStrictlyMatches(right);
assert.ok(!strictMatch, "null should not match undefined");
});
});
describe("getTypeAnnotation", function () {
it("should infer from type cast", function () {
const path = getPath("(x: number)").get("body")[0].get("expression");
assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number");
});
it("should infer string from template literal", function () {
const path = getPath("`hey`").get("body")[0].get("expression");
assert.ok(t.isStringTypeAnnotation(path.getTypeAnnotation()), "should be string");
});
it("should infer number from +x", function () {
const path = getPath("+x").get("body")[0].get("expression");
assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number");
});
it("should infer T from new T", function () {
const path = getPath("new T").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "T", "should be T");
});
it("should infer number from ++x", function () {
const path = getPath("++x").get("body")[0].get("expression");
assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number");
});
it("should infer number from --x", function () {
const path = getPath("--x").get("body")[0].get("expression");
assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number");
});
it("should infer void from void x", function () {
const path = getPath("void x").get("body")[0].get("expression");
assert.ok(t.isVoidTypeAnnotation(path.getTypeAnnotation()), "should be void");
});
it("should infer string from typeof x", function () {
const path = getPath("typeof x").get("body")[0].get("expression");
assert.ok(t.isStringTypeAnnotation(path.getTypeAnnotation()), "should be string");
});
it("should infer boolean from !x", function () {
const path = getPath("!x").get("body")[0].get("expression");
assert.ok(t.isBooleanTypeAnnotation(path.getTypeAnnotation()), "should be boolean");
});
it("should infer type of sequence expression", function () {
const path = getPath("a,1").get("body")[0].get("expression");
assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number");
});
it("should infer type of logical expression", function () {
const path = getPath("'a' && 1").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isUnionTypeAnnotation(type), "should be a union");
assert.ok(t.isStringTypeAnnotation(type.types[0]), "first type in union should be string");
assert.ok(t.isNumberTypeAnnotation(type.types[1]), "second type in union should be number");
});
it("should infer type of conditional expression", function () {
const path = getPath("q ? true : 0").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isUnionTypeAnnotation(type), "should be a union");
assert.ok(t.isBooleanTypeAnnotation(type.types[0]), "first type in union should be boolean");
assert.ok(t.isNumberTypeAnnotation(type.types[1]), "second type in union should be number");
});
it("should infer RegExp from RegExp literal", function () {
const path = getPath("/.+/").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "RegExp", "should be RegExp");
});
it("should infer Object from object expression", function () {
const path = getPath("({ a: 5 })").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "Object", "should be Object");
});
it("should infer Array from array expression", function () {
const path = getPath("[ 5 ]").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "Array", "should be Array");
});
it("should infer Function from function", function () {
const path = getPath("(function (): string {})").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "Function", "should be Function");
});
it("should infer call return type using function", function () {
const path = getPath("(function (): string {})()").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isStringTypeAnnotation(type), "should be string");
});
it("should infer call return type using async function", function () {
const path = getPath("(async function (): string {})()").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "Promise", "should be Promise");
});
it("should infer call return type using async generator function", function () {
const path = getPath("(async function * (): string {})()").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "AsyncIterator",
"should be AsyncIterator");
});
it("should infer number from x/y", function () {
const path = getPath("x/y").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isNumberTypeAnnotation(type), "should be number");
});
it("should infer boolean from x instanceof y", function () {
const path = getPath("x instanceof y").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isBooleanTypeAnnotation(type), "should be boolean");
});
it("should infer number from 1 + 2", function () {
const path = getPath("1 + 2").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isNumberTypeAnnotation(type), "should be number");
});
it("should infer string|number from x + y", function () {
const path = getPath("x + y").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isUnionTypeAnnotation(type), "should be a union");
assert.ok(t.isStringTypeAnnotation(type.types[0]), "first type in union should be string");
assert.ok(t.isNumberTypeAnnotation(type.types[1]), "second type in union should be number");
});
it("should infer type of tagged template literal", function () {
const path = getPath("(function (): RegExp {}) `hey`").get("body")[0].get("expression");
const type = path.getTypeAnnotation();
assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "RegExp", "should be RegExp");
});
});
});
| STRML/babel | packages/babel-traverse/test/inference.js | JavaScript | mit | 8,822 | [
30522,
12324,
20811,
2013,
1000,
1012,
1012,
1013,
5622,
2497,
1000,
1025,
12324,
20865,
2013,
1000,
20865,
1000,
1025,
12324,
1063,
11968,
3366,
1065,
2013,
1000,
17690,
1000,
1025,
12324,
1008,
2004,
1056,
2013,
1000,
11561,
2140,
1011,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"""Worker implementation."""
from __future__ import absolute_import, unicode_literals
from .worker import WorkController
__all__ = ('WorkController',)
| kawamon/hue | desktop/core/ext-py/celery-4.2.1/celery/worker/__init__.py | Python | apache-2.0 | 152 | [
30522,
1000,
1000,
1000,
7309,
7375,
1012,
1000,
1000,
1000,
2013,
1035,
1035,
2925,
1035,
1035,
12324,
7619,
1035,
12324,
1010,
27260,
1035,
18204,
2015,
2013,
1012,
7309,
12324,
2147,
8663,
13181,
10820,
1035,
1035,
2035,
1035,
1035,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Layman is a complete library for the operation and maintainance
on all gentoo repositories and overlays
"""
import sys
try:
from layman.api import LaymanAPI
from layman.config import BareConfig
from layman.output import Message
except ImportError:
sys.stderr.write("!!! Layman API imports failed.")
raise
class Layman(LaymanAPI):
"""A complete high level interface capable of performing all
overlay repository actions."""
def __init__(self, stdout=sys.stdout, stdin=sys.stdin, stderr=sys.stderr,
config=None, read_configfile=True, quiet=False, quietness=4,
verbose=False, nocolor=False, width=0, root=None
):
"""Input parameters are optional to override the defaults.
sets up our LaymanAPI with defaults or passed in values
and returns an instance of it"""
self.message = Message(out=stdout, err=stderr)
self.config = BareConfig(
output=self.message,
stdout=stdout,
stdin=stdin,
stderr=stderr,
config=config,
read_configfile=read_configfile,
quiet=quiet,
quietness=quietness,
verbose=verbose,
nocolor=nocolor,
width=width,
root=root
)
LaymanAPI.__init__(self, self.config,
report_errors=True,
output=self.config['output']
)
return
| jmesmon/layman | layman/__init__.py | Python | gpl-2.0 | 1,585 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
18750,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
1000,
1000,
1000,
3913,
2386,
2003,
1037,
3143,
3075,
2005,
1996,
3169,
1998,
5441,
6651,
2006,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON FRAMEWORK
// Copyright 2013, Typhoon Framework Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
#import <UIKit/UIKit.h>
@protocol PFCityDao;
@class PFRootViewController;
@class INJContainer;
@class PFAppContext;
@interface PFAppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, strong) INJContainer *container;
@property (nonatomic, strong) PFAppContext *appContext;
@property(nonatomic, strong) UIWindow *window;
@property(nonatomic, strong) id <PFCityDao> cityDao;
@property(nonatomic, strong) PFRootViewController *rootViewController;
@end
| vangelov/Injineer | Example/PocketForecast/PFAppDelegate.h | C | isc | 894 | [
30522,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
30524,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Package serviceconsumermanagement provides access to the Service Consumer Management API.
//
// See https://cloud.google.com/service-consumer-management/docs/overview
//
// Usage example:
//
// import "google.golang.org/api/serviceconsumermanagement/v1"
// ...
// serviceconsumermanagementService, err := serviceconsumermanagement.New(oauthHttpClient)
package serviceconsumermanagement // import "google.golang.org/api/serviceconsumermanagement/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
context "golang.org/x/net/context"
ctxhttp "golang.org/x/net/context/ctxhttp"
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "serviceconsumermanagement:v1"
const apiName = "serviceconsumermanagement"
const apiVersion = "v1"
const basePath = "https://serviceconsumermanagement.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
func New(client *http.Client) (*APIService, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &APIService{client: client, BasePath: basePath}
s.Operations = NewOperationsService(s)
s.Services = NewServicesService(s)
return s, nil
}
type APIService struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Operations *OperationsService
Services *ServicesService
}
func (s *APIService) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewOperationsService(s *APIService) *OperationsService {
rs := &OperationsService{s: s}
return rs
}
type OperationsService struct {
s *APIService
}
func NewServicesService(s *APIService) *ServicesService {
rs := &ServicesService{s: s}
rs.TenancyUnits = NewServicesTenancyUnitsService(s)
return rs
}
type ServicesService struct {
s *APIService
TenancyUnits *ServicesTenancyUnitsService
}
func NewServicesTenancyUnitsService(s *APIService) *ServicesTenancyUnitsService {
rs := &ServicesTenancyUnitsService{s: s}
return rs
}
type ServicesTenancyUnitsService struct {
s *APIService
}
// AddTenantProjectRequest: Request to add a newly created and
// configured tenant project to a tenancy
// unit.
type AddTenantProjectRequest struct {
// ProjectConfig: Configuration of the new tenant project that will be
// added to tenancy unit
// resources.
ProjectConfig *TenantProjectConfig `json:"projectConfig,omitempty"`
// Tag: Tag of the added project. Must be less than 128 characters.
// Required.
Tag string `json:"tag,omitempty"`
// ForceSendFields is a list of field names (e.g. "ProjectConfig") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ProjectConfig") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AddTenantProjectRequest) MarshalJSON() ([]byte, error) {
type NoMethod AddTenantProjectRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Api: Api is a light-weight descriptor for an API
// Interface.
//
// Interfaces are also described as "protocol buffer services" in some
// contexts,
// such as by the "service" keyword in a .proto file, but they are
// different
// from API Services, which represent a concrete implementation of an
// interface
// as opposed to simply a description of methods and bindings. They are
// also
// sometimes simply referred to as "APIs" in other contexts, such as the
// name of
// this message itself. See
// https://cloud.google.com/apis/design/glossary for
// detailed terminology.
type Api struct {
// Methods: The methods of this interface, in unspecified order.
Methods []*Method `json:"methods,omitempty"`
// Mixins: Included interfaces. See Mixin.
Mixins []*Mixin `json:"mixins,omitempty"`
// Name: The fully qualified name of this interface, including package
// name
// followed by the interface's simple name.
Name string `json:"name,omitempty"`
// Options: Any metadata attached to the interface.
Options []*Option `json:"options,omitempty"`
// SourceContext: Source context for the protocol buffer service
// represented by this
// message.
SourceContext *SourceContext `json:"sourceContext,omitempty"`
// Syntax: The source syntax of the service.
//
// Possible values:
// "SYNTAX_PROTO2" - Syntax `proto2`.
// "SYNTAX_PROTO3" - Syntax `proto3`.
Syntax string `json:"syntax,omitempty"`
// Version: A version string for this interface. If specified, must have
// the form
// `major-version.minor-version`, as in `1.10`. If the minor version
// is
// omitted, it defaults to zero. If the entire version field is empty,
// the
// major version is derived from the package name, as outlined below. If
// the
// field is not empty, the version in the package name will be verified
// to be
// consistent with what is provided here.
//
// The versioning schema uses [semantic
// versioning](http://semver.org) where the major version
// number
// indicates a breaking change and the minor version an
// additive,
// non-breaking change. Both version numbers are signals to users
// what to expect from different versions, and should be
// carefully
// chosen based on the product plan.
//
// The major version is also reflected in the package name of
// the
// interface, which must end in `v<major-version>`, as
// in
// `google.feature.v1`. For major versions 0 and 1, the suffix can
// be omitted. Zero major versions must only be used for
// experimental, non-GA interfaces.
//
Version string `json:"version,omitempty"`
// ForceSendFields is a list of field names (e.g. "Methods") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Methods") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Api) MarshalJSON() ([]byte, error) {
type NoMethod Api
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthProvider: Configuration for an anthentication provider, including
// support for
// [JSON Web Token
// (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32)
// .
type AuthProvider struct {
// Audiences: The list of
// JWT
// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-
// token-32#section-4.1.3).
// that are allowed to access. A JWT containing any of these audiences
// will
// be accepted. When this setting is absent, only JWTs with
// audience
// "https://Service_name/API_name"
// will be accepted. For example, if no audiences are in the
// setting,
// LibraryService API will only accept JWTs with the following
// audience
// "https://library-example.googleapis.com/google.example.librar
// y.v1.LibraryService".
//
// Example:
//
// audiences: bookstore_android.apps.googleusercontent.com,
// bookstore_web.apps.googleusercontent.com
Audiences string `json:"audiences,omitempty"`
// AuthorizationUrl: Redirect URL if JWT token is required but no
// present or is expired.
// Implement authorizationUrl of securityDefinitions in OpenAPI spec.
AuthorizationUrl string `json:"authorizationUrl,omitempty"`
// Id: The unique identifier of the auth provider. It will be referred
// to by
// `AuthRequirement.provider_id`.
//
// Example: "bookstore_auth".
Id string `json:"id,omitempty"`
// Issuer: Identifies the principal that issued the JWT.
// See
// https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#sec
// tion-4.1.1
// Usually a URL or an email address.
//
// Example: https://securetoken.google.com
// Example: 1234567-compute@developer.gserviceaccount.com
Issuer string `json:"issuer,omitempty"`
// JwksUri: URL of the provider's public key set to validate signature
// of the JWT. See
// [OpenID
// Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#
// ProviderMetadata).
// Optional if the key set document:
// - can be retrieved from
// [OpenID
// Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html
//
// of the issuer.
// - can be inferred from the email domain of the issuer (e.g. a Google
// service account).
//
// Example: https://www.googleapis.com/oauth2/v1/certs
JwksUri string `json:"jwksUri,omitempty"`
// ForceSendFields is a list of field names (e.g. "Audiences") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Audiences") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AuthProvider) MarshalJSON() ([]byte, error) {
type NoMethod AuthProvider
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthRequirement: User-defined authentication requirements, including
// support for
// [JSON Web Token
// (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32)
// .
type AuthRequirement struct {
// Audiences: NOTE: This will be deprecated soon, once
// AuthProvider.audiences is
// implemented and accepted in all the runtime components.
//
// The list of
// JWT
// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-
// token-32#section-4.1.3).
// that are allowed to access. A JWT containing any of these audiences
// will
// be accepted. When this setting is absent, only JWTs with
// audience
// "https://Service_name/API_name"
// will be accepted. For example, if no audiences are in the
// setting,
// LibraryService API will only accept JWTs with the following
// audience
// "https://library-example.googleapis.com/google.example.librar
// y.v1.LibraryService".
//
// Example:
//
// audiences: bookstore_android.apps.googleusercontent.com,
// bookstore_web.apps.googleusercontent.com
Audiences string `json:"audiences,omitempty"`
// ProviderId: id from authentication provider.
//
// Example:
//
// provider_id: bookstore_auth
ProviderId string `json:"providerId,omitempty"`
// ForceSendFields is a list of field names (e.g. "Audiences") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Audiences") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AuthRequirement) MarshalJSON() ([]byte, error) {
type NoMethod AuthRequirement
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Authentication: `Authentication` defines the authentication
// configuration for an API.
//
// Example for an API targeted for external use:
//
// name: calendar.googleapis.com
// authentication:
// providers:
// - id: google_calendar_auth
// jwks_uri: https://www.googleapis.com/oauth2/v1/certs
// issuer: https://securetoken.google.com
// rules:
// - selector: "*"
// requirements:
// provider_id: google_calendar_auth
type Authentication struct {
// Providers: Defines a set of authentication providers that a service
// supports.
Providers []*AuthProvider `json:"providers,omitempty"`
// Rules: A list of authentication rules that apply to individual API
// methods.
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*AuthenticationRule `json:"rules,omitempty"`
// ForceSendFields is a list of field names (e.g. "Providers") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Providers") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Authentication) MarshalJSON() ([]byte, error) {
type NoMethod Authentication
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthenticationRule: Authentication rules for the service.
//
// By default, if a method has any authentication requirements, every
// request
// must include a valid credential matching one of the
// requirements.
// It's an error to include more than one kind of credential in a
// single
// request.
//
// If a method doesn't have any auth requirements, request credentials
// will be
// ignored.
type AuthenticationRule struct {
// AllowWithoutCredential: If true, the service accepts API keys without
// any other credential.
AllowWithoutCredential bool `json:"allowWithoutCredential,omitempty"`
// Oauth: The requirements for OAuth credentials.
Oauth *OAuthRequirements `json:"oauth,omitempty"`
// Requirements: Requirements for additional authentication providers.
Requirements []*AuthRequirement `json:"requirements,omitempty"`
// Selector: Selects the methods to which this rule applies.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AllowWithoutCredential") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AllowWithoutCredential")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AuthenticationRule) MarshalJSON() ([]byte, error) {
type NoMethod AuthenticationRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthorizationConfig: Configuration of authorization.
//
// This section determines the authorization provider, if unspecified,
// then no
// authorization check will be done.
//
// Example:
//
// experimental:
// authorization:
// provider: firebaserules.googleapis.com
type AuthorizationConfig struct {
// Provider: The name of the authorization provider, such
// as
// firebaserules.googleapis.com.
Provider string `json:"provider,omitempty"`
// ForceSendFields is a list of field names (e.g. "Provider") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Provider") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AuthorizationConfig) MarshalJSON() ([]byte, error) {
type NoMethod AuthorizationConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AuthorizationRule: Authorization rule for API services.
//
// It specifies the permission(s) required for an API element for the
// overall
// API request to succeed. It is typically used to mark request message
// fields
// that contain the name of the resource and indicates the permissions
// that
// will be checked on that resource.
//
// For example:
//
// package google.storage.v1;
//
// message CopyObjectRequest {
// string source = 1 [
// (google.api.authz).permissions = "storage.objects.get"];
//
// string destination = 2 [
// (google.api.authz).permissions =
// "storage.objects.create,storage.objects.update"];
// }
type AuthorizationRule struct {
// Permissions: The required permissions. The acceptable values vary
// depend on the
// authorization system used. For Google APIs, it should be a
// comma-separated
// Google IAM permission values. When multiple permissions are listed,
// the
// semantics is not defined by the system. Additional documentation
// must
// be provided manually.
Permissions string `json:"permissions,omitempty"`
// Selector: Selects the API elements to which this rule applies.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g. "Permissions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Permissions") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AuthorizationRule) MarshalJSON() ([]byte, error) {
type NoMethod AuthorizationRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Backend: `Backend` defines the backend configuration for a service.
type Backend struct {
// Rules: A list of API backend rules that apply to individual API
// methods.
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*BackendRule `json:"rules,omitempty"`
// ForceSendFields is a list of field names (e.g. "Rules") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Rules") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Backend) MarshalJSON() ([]byte, error) {
type NoMethod Backend
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackendRule: A backend rule provides configuration for an individual
// API element.
type BackendRule struct {
// Address: The address of the API backend.
Address string `json:"address,omitempty"`
// Deadline: The number of seconds to wait for a response from a
// request. The default
// deadline for gRPC is infinite (no deadline) and HTTP requests is 5
// seconds.
Deadline float64 `json:"deadline,omitempty"`
// MinDeadline: Minimum deadline in seconds needed for this method.
// Calls having deadline
// value lower than this will be rejected.
MinDeadline float64 `json:"minDeadline,omitempty"`
// Selector: Selects the methods to which this rule applies.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g. "Address") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Address") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BackendRule) MarshalJSON() ([]byte, error) {
type NoMethod BackendRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *BackendRule) UnmarshalJSON(data []byte) error {
type NoMethod BackendRule
var s1 struct {
Deadline gensupport.JSONFloat64 `json:"deadline"`
MinDeadline gensupport.JSONFloat64 `json:"minDeadline"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Deadline = float64(s1.Deadline)
s.MinDeadline = float64(s1.MinDeadline)
return nil
}
// Billing: Billing related configuration of the service.
//
// The following example shows how to configure monitored resources and
// metrics
// for billing:
//
// monitored_resources:
// - type: library.googleapis.com/branch
// labels:
// - key: /city
// description: The city where the library branch is located
// in.
// - key: /name
// description: The name of the branch.
// metrics:
// - name: library.googleapis.com/book/borrowed_count
// metric_kind: DELTA
// value_type: INT64
// billing:
// consumer_destinations:
// - monitored_resource: library.googleapis.com/branch
// metrics:
// - library.googleapis.com/book/borrowed_count
type Billing struct {
// ConsumerDestinations: Billing configurations for sending metrics to
// the consumer project.
// There can be multiple consumer destinations per service, each one
// must have
// a different monitored resource type. A metric can be used in at
// most
// one consumer destination.
ConsumerDestinations []*BillingDestination `json:"consumerDestinations,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ConsumerDestinations") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConsumerDestinations") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Billing) MarshalJSON() ([]byte, error) {
type NoMethod Billing
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BillingConfig: Describes billing configuration for a new tenant
// project.
type BillingConfig struct {
// BillingAccount: Name of the billing account.
// For example `billingAccounts/012345-567890-ABCDEF`.
BillingAccount string `json:"billingAccount,omitempty"`
// ForceSendFields is a list of field names (e.g. "BillingAccount") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BillingAccount") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BillingConfig) MarshalJSON() ([]byte, error) {
type NoMethod BillingConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BillingDestination: Configuration of a specific billing destination
// (Currently only support
// bill against consumer project).
type BillingDestination struct {
// Metrics: Names of the metrics to report to this billing
// destination.
// Each name must be defined in Service.metrics section.
Metrics []string `json:"metrics,omitempty"`
// MonitoredResource: The monitored resource type. The type must be
// defined in
// Service.monitored_resources section.
MonitoredResource string `json:"monitoredResource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Metrics") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Metrics") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BillingDestination) MarshalJSON() ([]byte, error) {
type NoMethod BillingDestination
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CancelOperationRequest: The request message for
// Operations.CancelOperation.
type CancelOperationRequest struct {
}
// Context: `Context` defines which contexts an API
// requests.
//
// Example:
//
// context:
// rules:
// - selector: "*"
// requested:
// - google.rpc.context.ProjectContext
// - google.rpc.context.OriginContext
//
// The above specifies that all methods in the API
// request
// `google.rpc.context.ProjectContext`
// and
// `google.rpc.context.OriginContext`.
//
// Available context types are defined in
// package
// `google.rpc.context`.
//
// This also provides mechanism to whitelist any protobuf message
// extension that
// can be sent in grpc metadata using
// “x-goog-ext-<extension_id>-bin”
// and
// “x-goog-ext-<extension_id>-jspb” format. For example, list any
// service
// specific protobuf types that can appear in grpc metadata as follows
// in your
// yaml file:
//
// Example:
//
// context:
// rules:
// - selector:
// "google.example.library.v1.LibraryService.CreateBook"
// allowed_request_extensions:
// - google.foo.v1.NewExtension
// allowed_response_extensions:
// - google.foo.v1.NewExtension
//
// You can also specify extension ID instead of fully qualified
// extension name
// here.
type Context struct {
// Rules: A list of RPC context rules that apply to individual API
// methods.
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*ContextRule `json:"rules,omitempty"`
// ForceSendFields is a list of field names (e.g. "Rules") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Rules") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Context) MarshalJSON() ([]byte, error) {
type NoMethod Context
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ContextRule: A context rule provides information about the context
// for an individual API
// element.
type ContextRule struct {
// AllowedRequestExtensions: A list of full type names or extension IDs
// of extensions allowed in grpc
// side channel from client to backend.
AllowedRequestExtensions []string `json:"allowedRequestExtensions,omitempty"`
// AllowedResponseExtensions: A list of full type names or extension IDs
// of extensions allowed in grpc
// side channel from backend to client.
AllowedResponseExtensions []string `json:"allowedResponseExtensions,omitempty"`
// Provided: A list of full type names of provided contexts.
Provided []string `json:"provided,omitempty"`
// Requested: A list of full type names of requested contexts.
Requested []string `json:"requested,omitempty"`
// Selector: Selects the methods to which this rule applies.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AllowedRequestExtensions") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AllowedRequestExtensions")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ContextRule) MarshalJSON() ([]byte, error) {
type NoMethod ContextRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Control: Selects and configures the service controller used by the
// service. The
// service controller handles features like abuse, quota, billing,
// logging,
// monitoring, etc.
type Control struct {
// Environment: The service control environment to use. If empty, no
// control plane
// feature (like quota and billing) will be enabled.
Environment string `json:"environment,omitempty"`
// ForceSendFields is a list of field names (e.g. "Environment") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Environment") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Control) MarshalJSON() ([]byte, error) {
type NoMethod Control
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateTenancyUnitRequest: Request to create a tenancy unit for a
// consumer of a service.
type CreateTenancyUnitRequest struct {
// TenancyUnitId: Optional producer provided identifier of the tenancy
// unit.
// Must be no longer than 40 characters and preferably URI friendly.
// If it is not provided, a UID for the tenancy unit will be auto
// generated.
// It must be unique across a service.
// If the tenancy unit already exists for the service and consumer
// pair,
// `CreateTenancyUnit` will return the existing tenancy unit if the
// provided
// identifier is identical or empty, otherwise the call will fail.
TenancyUnitId string `json:"tenancyUnitId,omitempty"`
// ForceSendFields is a list of field names (e.g. "TenancyUnitId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "TenancyUnitId") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CreateTenancyUnitRequest) MarshalJSON() ([]byte, error) {
type NoMethod CreateTenancyUnitRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomError: Customize service error responses. For example, list
// any service
// specific protobuf types that can appear in error detail lists
// of
// error responses.
//
// Example:
//
// custom_error:
// types:
// - google.foo.v1.CustomError
// - google.foo.v1.AnotherError
type CustomError struct {
// Rules: The list of custom error rules that apply to individual API
// messages.
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*CustomErrorRule `json:"rules,omitempty"`
// Types: The list of custom error detail types, e.g.
// 'google.foo.v1.CustomError'.
Types []string `json:"types,omitempty"`
// ForceSendFields is a list of field names (e.g. "Rules") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Rules") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CustomError) MarshalJSON() ([]byte, error) {
type NoMethod CustomError
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomErrorRule: A custom error rule.
type CustomErrorRule struct {
// IsErrorType: Mark this message as possible payload in error response.
// Otherwise,
// objects of this type will be filtered when they appear in error
// payload.
IsErrorType bool `json:"isErrorType,omitempty"`
// Selector: Selects messages to which this rule applies.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g. "IsErrorType") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "IsErrorType") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CustomErrorRule) MarshalJSON() ([]byte, error) {
type NoMethod CustomErrorRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomHttpPattern: A custom pattern is used for defining custom HTTP
// verb.
type CustomHttpPattern struct {
// Kind: The name of this custom HTTP verb.
Kind string `json:"kind,omitempty"`
// Path: The path matched by this custom verb.
Path string `json:"path,omitempty"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CustomHttpPattern) MarshalJSON() ([]byte, error) {
type NoMethod CustomHttpPattern
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Documentation: `Documentation` provides the information for
// describing a service.
//
// Example:
// <pre><code>documentation:
// summary: >
// The Google Calendar API gives access
// to most calendar features.
// pages:
// - name: Overview
// content: (== include google/foo/overview.md ==)
// - name: Tutorial
// content: (== include google/foo/tutorial.md ==)
// subpages;
// - name: Java
// content: (== include google/foo/tutorial_java.md ==)
// rules:
// - selector: google.calendar.Calendar.Get
// description: >
// ...
// - selector: google.calendar.Calendar.Put
// description: >
// ...
// </code></pre>
// Documentation is provided in markdown syntax. In addition to
// standard markdown features, definition lists, tables and fenced
// code blocks are supported. Section headers can be provided and
// are
// interpreted relative to the section nesting of the context where
// a documentation fragment is embedded.
//
// Documentation from the IDL is merged with documentation defined
// via the config at normalization time, where documentation provided
// by config rules overrides IDL provided.
//
// A number of constructs specific to the API platform are supported
// in documentation text.
//
// In order to reference a proto element, the following
// notation can be
// used:
// <pre><code>[fully.qualified.proto.name][]</code></pre>
// T
// o override the display text used for the link, this can be
// used:
// <pre><code>[display
// text][fully.qualified.proto.name]</code></pre>
// Text can be excluded from doc using the following
// notation:
// <pre><code>(-- internal comment --)</code></pre>
//
// A few directives are available in documentation. Note that
// directives must appear on a single line to be properly
// identified. The `include` directive includes a markdown file from
// an external source:
// <pre><code>(== include path/to/file ==)</code></pre>
// The `resource_for` directive marks a message to be the resource of
// a collection in REST view. If it is not specified, tools attempt
// to infer the resource from the operations in a
// collection:
// <pre><code>(== resource_for v1.shelves.books
// ==)</code></pre>
// The directive `suppress_warning` does not directly affect
// documentation
// and is documented together with service config validation.
type Documentation struct {
// DocumentationRootUrl: The URL to the root of documentation.
DocumentationRootUrl string `json:"documentationRootUrl,omitempty"`
// Overview: Declares a single overview page. For
// example:
// <pre><code>documentation:
// summary: ...
// overview: (== include overview.md ==)
// </code></pre>
// This is a shortcut for the following declaration (using pages
// style):
// <pre><code>documentation:
// summary: ...
// pages:
// - name: Overview
// content: (== include overview.md ==)
// </code></pre>
// Note: you cannot specify both `overview` field and `pages` field.
Overview string `json:"overview,omitempty"`
// Pages: The top level pages for the documentation set.
Pages []*Page `json:"pages,omitempty"`
// Rules: A list of documentation rules that apply to individual API
// elements.
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*DocumentationRule `json:"rules,omitempty"`
// Summary: A short summary of what the service does. Can only be
// provided by
// plain text.
Summary string `json:"summary,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "DocumentationRootUrl") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DocumentationRootUrl") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Documentation) MarshalJSON() ([]byte, error) {
type NoMethod Documentation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DocumentationRule: A documentation rule provides information about
// individual API elements.
type DocumentationRule struct {
// DeprecationDescription: Deprecation description of the selected
// element(s). It can be provided if an
// element is marked as `deprecated`.
DeprecationDescription string `json:"deprecationDescription,omitempty"`
// Description: Description of the selected API(s).
Description string `json:"description,omitempty"`
// Selector: The selector is a comma-separated list of patterns. Each
// pattern is a
// qualified name of the element which may end in "*", indicating a
// wildcard.
// Wildcards are only allowed at the end and for a whole component of
// the
// qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar".
// To
// specify a default for all applicable elements, the whole pattern
// "*"
// is used.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "DeprecationDescription") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DeprecationDescription")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *DocumentationRule) MarshalJSON() ([]byte, error) {
type NoMethod DocumentationRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Empty: A generic empty message that you can re-use to avoid defining
// duplicated
// empty messages in your APIs. A typical example is to use it as the
// request
// or the response type of an API method. For instance:
//
// service Foo {
// rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty);
// }
//
// The JSON representation for `Empty` is empty JSON object `{}`.
type Empty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// Endpoint: `Endpoint` describes a network endpoint that serves a set
// of APIs.
// A service may expose any number of endpoints, and all endpoints share
// the
// same service configuration, such as quota configuration and
// monitoring
// configuration.
//
// Example service configuration:
//
// name: library-example.googleapis.com
// endpoints:
// # Below entry makes 'google.example.library.v1.Library'
// # API be served from endpoint address
// library-example.googleapis.com.
// # It also allows HTTP OPTIONS calls to be passed to the
// backend, for
// # it to decide whether the subsequent cross-origin request is
// # allowed to proceed.
// - name: library-example.googleapis.com
// allow_cors: true
type Endpoint struct {
// Aliases: DEPRECATED: This field is no longer supported. Instead of
// using aliases,
// please specify multiple google.api.Endpoint for each of the
// intended
// aliases.
//
// Additional names that this endpoint will be hosted on.
Aliases []string `json:"aliases,omitempty"`
// AllowCors:
// Allowing
// [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sh
// aring), aka
// cross-domain traffic, would allow the backends served from this
// endpoint to
// receive and respond to HTTP OPTIONS requests. The response will be
// used by
// the browser to determine whether the subsequent cross-origin request
// is
// allowed to proceed.
AllowCors bool `json:"allowCors,omitempty"`
// Features: The list of features enabled on this endpoint.
Features []string `json:"features,omitempty"`
// Name: The canonical name of this endpoint.
Name string `json:"name,omitempty"`
// Target: The specification of an Internet routable address of API
// frontend that will
// handle requests to this [API
// Endpoint](https://cloud.google.com/apis/design/glossary).
// It should be either a valid IPv4 address or a fully-qualified domain
// name.
// For example, "8.8.8.8" or "myservice.appspot.com".
Target string `json:"target,omitempty"`
// ForceSendFields is a list of field names (e.g. "Aliases") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Aliases") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Endpoint) MarshalJSON() ([]byte, error) {
type NoMethod Endpoint
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Enum: Enum type definition.
type Enum struct {
// Enumvalue: Enum value definitions.
Enumvalue []*EnumValue `json:"enumvalue,omitempty"`
// Name: Enum type name.
Name string `json:"name,omitempty"`
// Options: Protocol buffer options.
Options []*Option `json:"options,omitempty"`
// SourceContext: The source context.
SourceContext *SourceContext `json:"sourceContext,omitempty"`
// Syntax: The source syntax.
//
// Possible values:
// "SYNTAX_PROTO2" - Syntax `proto2`.
// "SYNTAX_PROTO3" - Syntax `proto3`.
Syntax string `json:"syntax,omitempty"`
// ForceSendFields is a list of field names (e.g. "Enumvalue") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Enumvalue") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Enum) MarshalJSON() ([]byte, error) {
type NoMethod Enum
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// EnumValue: Enum value definition.
type EnumValue struct {
// Name: Enum value name.
Name string `json:"name,omitempty"`
// Number: Enum value number.
Number int64 `json:"number,omitempty"`
// Options: Protocol buffer options.
Options []*Option `json:"options,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *EnumValue) MarshalJSON() ([]byte, error) {
type NoMethod EnumValue
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Experimental: Experimental service configuration. These configuration
// options can
// only be used by whitelisted users.
type Experimental struct {
// Authorization: Authorization configuration.
Authorization *AuthorizationConfig `json:"authorization,omitempty"`
// ForceSendFields is a list of field names (e.g. "Authorization") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Authorization") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Experimental) MarshalJSON() ([]byte, error) {
type NoMethod Experimental
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Field: A single field of a message type.
type Field struct {
// Cardinality: The field cardinality.
//
// Possible values:
// "CARDINALITY_UNKNOWN" - For fields with unknown cardinality.
// "CARDINALITY_OPTIONAL" - For optional fields.
// "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only.
// "CARDINALITY_REPEATED" - For repeated fields.
Cardinality string `json:"cardinality,omitempty"`
// DefaultValue: The string value of the default value of this field.
// Proto2 syntax only.
DefaultValue string `json:"defaultValue,omitempty"`
// JsonName: The field JSON name.
JsonName string `json:"jsonName,omitempty"`
// Kind: The field type.
//
// Possible values:
// "TYPE_UNKNOWN" - Field type unknown.
// "TYPE_DOUBLE" - Field type double.
// "TYPE_FLOAT" - Field type float.
// "TYPE_INT64" - Field type int64.
// "TYPE_UINT64" - Field type uint64.
// "TYPE_INT32" - Field type int32.
// "TYPE_FIXED64" - Field type fixed64.
// "TYPE_FIXED32" - Field type fixed32.
// "TYPE_BOOL" - Field type bool.
// "TYPE_STRING" - Field type string.
// "TYPE_GROUP" - Field type group. Proto2 syntax only, and
// deprecated.
// "TYPE_MESSAGE" - Field type message.
// "TYPE_BYTES" - Field type bytes.
// "TYPE_UINT32" - Field type uint32.
// "TYPE_ENUM" - Field type enum.
// "TYPE_SFIXED32" - Field type sfixed32.
// "TYPE_SFIXED64" - Field type sfixed64.
// "TYPE_SINT32" - Field type sint32.
// "TYPE_SINT64" - Field type sint64.
Kind string `json:"kind,omitempty"`
// Name: The field name.
Name string `json:"name,omitempty"`
// Number: The field number.
Number int64 `json:"number,omitempty"`
// OneofIndex: The index of the field type in `Type.oneofs`, for message
// or enumeration
// types. The first type has index 1; zero means the type is not in the
// list.
OneofIndex int64 `json:"oneofIndex,omitempty"`
// Options: The protocol buffer options.
Options []*Option `json:"options,omitempty"`
// Packed: Whether to use alternative packed wire representation.
Packed bool `json:"packed,omitempty"`
// TypeUrl: The field type URL, without the scheme, for message or
// enumeration
// types. Example: "type.googleapis.com/google.protobuf.Timestamp".
TypeUrl string `json:"typeUrl,omitempty"`
// ForceSendFields is a list of field names (e.g. "Cardinality") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Cardinality") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Field) MarshalJSON() ([]byte, error) {
type NoMethod Field
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Http: Defines the HTTP configuration for an API service. It contains
// a list of
// HttpRule, each specifying the mapping of an RPC method
// to one or more HTTP REST API methods.
type Http struct {
// FullyDecodeReservedExpansion: When set to true, URL path parmeters
// will be fully URI-decoded except in
// cases of single segment matches in reserved expansion, where "%2F"
// will be
// left encoded.
//
// The default behavior is to not decode RFC 6570 reserved characters in
// multi
// segment matches.
FullyDecodeReservedExpansion bool `json:"fullyDecodeReservedExpansion,omitempty"`
// Rules: A list of HTTP configuration rules that apply to individual
// API methods.
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*HttpRule `json:"rules,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "FullyDecodeReservedExpansion") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "FullyDecodeReservedExpansion") to include in API requests with the
// JSON null value. By default, fields with empty values are omitted
// from API requests. However, any field with an empty value appearing
// in NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Http) MarshalJSON() ([]byte, error) {
type NoMethod Http
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// HttpRule: `HttpRule` defines the mapping of an RPC method to one or
// more HTTP
// REST API methods. The mapping specifies how different portions of the
// RPC
// request message are mapped to URL path, URL query parameters,
// and
// HTTP request body. The mapping is typically specified as
// an
// `google.api.http` annotation on the RPC method,
// see "google/api/annotations.proto" for details.
//
// The mapping consists of a field specifying the path template
// and
// method kind. The path template can refer to fields in the
// request
// message, as in the example below which describes a REST GET
// operation on a resource collection of messages:
//
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http).get =
// "/v1/messages/{message_id}/{sub.subfield}";
// }
// }
// message GetMessageRequest {
// message SubMessage {
// string subfield = 1;
// }
// string message_id = 1; // mapped to the URL
// SubMessage sub = 2; // `sub.subfield` is url-mapped
// }
// message Message {
// string text = 1; // content of the resource
// }
//
// The same http annotation can alternatively be expressed inside
// the
// `GRPC API Configuration` YAML file.
//
// http:
// rules:
// - selector: <proto_package_name>.Messaging.GetMessage
// get: /v1/messages/{message_id}/{sub.subfield}
//
// This definition enables an automatic, bidrectional mapping of
// HTTP
// JSON to RPC. Example:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456"
// sub: SubMessage(subfield: "foo"))`
//
// In general, not only fields but also field paths can be
// referenced
// from a path pattern. Fields mapped to the path pattern cannot
// be
// repeated and must have a primitive (non-message) type.
//
// Any fields in the request message which are not bound by the
// path
// pattern automatically become (optional) HTTP query
// parameters. Assume the following definition of the request
// message:
//
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http).get = "/v1/messages/{message_id}";
// }
// }
// message GetMessageRequest {
// message SubMessage {
// string subfield = 1;
// }
// string message_id = 1; // mapped to the URL
// int64 revision = 2; // becomes a parameter
// SubMessage sub = 3; // `sub.subfield` becomes a parameter
// }
//
//
// This enables a HTTP JSON to RPC mapping as below:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
// `GetMessage(message_id: "123456" revision: 2 sub:
// SubMessage(subfield: "foo"))`
//
// Note that fields which are mapped to HTTP parameters must have
// a
// primitive type or a repeated primitive type. Message types are
// not
// allowed. In the case of a repeated type, the parameter can
// be
// repeated in the URL, as in `...?param=A¶m=B`.
//
// For HTTP method kinds which allow a request body, the `body`
// field
// specifies the mapping. Consider a REST update method on the
// message resource collection:
//
//
// service Messaging {
// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
// option (google.api.http) = {
// put: "/v1/messages/{message_id}"
// body: "message"
// };
// }
// }
// message UpdateMessageRequest {
// string message_id = 1; // mapped to the URL
// Message message = 2; // mapped to the body
// }
//
//
// The following HTTP JSON to RPC mapping is enabled, where
// the
// representation of the JSON in the request body is determined
// by
// protos JSON encoding:
//
// HTTP | RPC
// -----|-----
// `PUT /v1/messages/123456 { "text": "Hi!" }` |
// `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
//
// The special name `*` can be used in the body mapping to define
// that
// every field not bound by the path template should be mapped to
// the
// request body. This enables the following alternative definition
// of
// the update method:
//
// service Messaging {
// rpc UpdateMessage(Message) returns (Message) {
// option (google.api.http) = {
// put: "/v1/messages/{message_id}"
// body: "*"
// };
// }
// }
// message Message {
// string message_id = 1;
// string text = 2;
// }
//
//
// The following HTTP JSON to RPC mapping is enabled:
//
// HTTP | RPC
// -----|-----
// `PUT /v1/messages/123456 { "text": "Hi!" }` |
// `UpdateMessage(message_id: "123456" text: "Hi!")`
//
// Note that when using `*` in the body mapping, it is not possible
// to
// have HTTP parameters, as all fields not bound by the path end in
// the body. This makes this option more rarely used in practice
// of
// defining REST APIs. The common usage of `*` is in custom
// methods
// which don't use the URL at all for transferring data.
//
// It is possible to define multiple HTTP methods for one RPC by
// using
// the `additional_bindings` option. Example:
//
// service Messaging {
// rpc GetMessage(GetMessageRequest) returns (Message) {
// option (google.api.http) = {
// get: "/v1/messages/{message_id}"
// additional_bindings {
// get: "/v1/users/{user_id}/messages/{message_id}"
// }
// };
// }
// }
// message GetMessageRequest {
// string message_id = 1;
// string user_id = 2;
// }
//
//
// This enables the following two alternative HTTP JSON to
// RPC
// mappings:
//
// HTTP | RPC
// -----|-----
// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me"
// message_id: "123456")`
//
// # Rules for HTTP mapping
//
// The rules for mapping HTTP path, query parameters, and body fields
// to the request message are as follows:
//
// 1. The `body` field specifies either `*` or a field path, or is
// omitted. If omitted, it indicates there is no HTTP request
// body.
// 2. Leaf fields (recursive expansion of nested messages in the
// request) can be classified into three types:
// (a) Matched in the URL template.
// (b) Covered by body (if body is `*`, everything except (a)
// fields;
// else everything under the body field)
// (c) All other fields.
// 3. URL query parameters found in the HTTP request are mapped to (c)
// fields.
// 4. Any body sent with an HTTP request can contain only (b)
// fields.
//
// The syntax of the path template is as follows:
//
// Template = "/" Segments [ Verb ] ;
// Segments = Segment { "/" Segment } ;
// Segment = "*" | "**" | LITERAL | Variable ;
// Variable = "{" FieldPath [ "=" Segments ] "}" ;
// FieldPath = IDENT { "." IDENT } ;
// Verb = ":" LITERAL ;
//
// The syntax `*` matches a single path segment. The syntax `**` matches
// zero
// or more path segments, which must be the last part of the path except
// the
// `Verb`. The syntax `LITERAL` matches literal text in the path.
//
// The syntax `Variable` matches part of the URL path as specified by
// its
// template. A variable template must not contain other variables. If a
// variable
// matches a single path segment, its template may be omitted, e.g.
// `{var}`
// is equivalent to `{var=*}`.
//
// If a variable contains exactly one path segment, such as "{var}"
// or
// "{var=*}", when such a variable is expanded into a URL path, all
// characters
// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up
// in the
// Discovery Document as `{var}`.
//
// If a variable contains one or more path segments, such as
// "{var=foo/*}"
// or "{var=**}", when such a variable is expanded into a URL path,
// all
// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such
// variables
// show up in the Discovery Document as `{+var}`.
//
// NOTE: While the single segment variable matches the semantics of
// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
// Simple String Expansion, the multi segment variable **does not**
// match
// RFC 6570 Reserved Expansion. The reason is that the Reserved
// Expansion
// does not expand special characters like `?` and `#`, which would
// lead
// to invalid URLs.
//
// NOTE: the field paths in variables and in the `body` must not refer
// to
// repeated fields or map fields.
type HttpRule struct {
// AdditionalBindings: Additional HTTP bindings for the selector. Nested
// bindings must
// not contain an `additional_bindings` field themselves (that is,
// the nesting may only be one level deep).
AdditionalBindings []*HttpRule `json:"additionalBindings,omitempty"`
// Authorizations: Specifies the permission(s) required for an API
// element for the overall
// API request to succeed. It is typically used to mark request message
// fields
// that contain the name of the resource and indicates the permissions
// that
// will be checked on that resource.
Authorizations []*AuthorizationRule `json:"authorizations,omitempty"`
// Body: The name of the request field whose value is mapped to the HTTP
// body, or
// `*` for mapping all fields not captured by the path pattern to the
// HTTP
// body. NOTE: the referred field must not be a repeated field and must
// be
// present at the top-level of request message type.
Body string `json:"body,omitempty"`
// Custom: The custom pattern is used for specifying an HTTP method that
// is not
// included in the `pattern` field, such as HEAD, or "*" to leave
// the
// HTTP method unspecified for this rule. The wild-card rule is
// useful
// for services that provide content to Web (HTML) clients.
Custom *CustomHttpPattern `json:"custom,omitempty"`
// Delete: Used for deleting a resource.
Delete string `json:"delete,omitempty"`
// Get: Used for listing and getting information about resources.
Get string `json:"get,omitempty"`
// MediaDownload: Use this only for Scotty Requests. Do not use this for
// bytestream methods.
// For media support, add instead [][google.bytestream.RestByteStream]
// as an
// API to your configuration.
MediaDownload *MediaDownload `json:"mediaDownload,omitempty"`
// MediaUpload: Use this only for Scotty Requests. Do not use this for
// media support using
// Bytestream, add instead
// [][google.bytestream.RestByteStream] as an API to your
// configuration for Bytestream methods.
MediaUpload *MediaUpload `json:"mediaUpload,omitempty"`
// Patch: Used for updating a resource.
Patch string `json:"patch,omitempty"`
// Post: Used for creating a resource.
Post string `json:"post,omitempty"`
// Put: Used for updating a resource.
Put string `json:"put,omitempty"`
// ResponseBody: Optional. The name of the response field whose value is
// mapped to the HTTP
// body of response. Other response fields are ignored. When
// not set, the response message will be used as HTTP body of response.
ResponseBody string `json:"responseBody,omitempty"`
// RestCollection: DO NOT USE. This is an experimental field.
//
// Optional. The REST collection name is by default derived from the
// URL
// pattern. If specified, this field overrides the default collection
// name.
// Example:
//
// rpc AddressesAggregatedList(AddressesAggregatedListRequest)
// returns (AddressesAggregatedListResponse) {
// option (google.api.http) = {
// get: "/v1/projects/{project_id}/aggregated/addresses"
// rest_collection: "projects.addresses"
// };
// }
//
// This method has the automatically derived collection
// name
// "projects.aggregated". Because, semantically, this rpc is actually
// an
// operation on the "projects.addresses" collection, the
// `rest_collection`
// field is configured to override the derived collection name.
RestCollection string `json:"restCollection,omitempty"`
// RestMethodName: DO NOT USE. This is an experimental field.
//
// Optional. The rest method name is by default derived from the
// URL
// pattern. If specified, this field overrides the default method
// name.
// Example:
//
// rpc CreateResource(CreateResourceRequest)
// returns (CreateResourceResponse) {
// option (google.api.http) = {
// post: "/v1/resources",
// body: "resource",
// rest_method_name: "insert"
// };
// }
//
// This method has the automatically derived rest method name
// "create", but for backwards compatibility with apiary, it is
// specified as
// insert.
RestMethodName string `json:"restMethodName,omitempty"`
// Selector: Selects methods to which this rule applies.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g. "AdditionalBindings")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AdditionalBindings") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *HttpRule) MarshalJSON() ([]byte, error) {
type NoMethod HttpRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LabelDescriptor: A description of a label.
type LabelDescriptor struct {
// Description: A human-readable description for the label.
Description string `json:"description,omitempty"`
// Key: The label key.
Key string `json:"key,omitempty"`
// ValueType: The type of data that can be assigned to the label.
//
// Possible values:
// "STRING" - A variable-length string. This is the default.
// "BOOL" - Boolean; true or false.
// "INT64" - A 64-bit signed integer.
ValueType string `json:"valueType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
type NoMethod LabelDescriptor
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListOperationsResponse: The response message for
// Operations.ListOperations.
type ListOperationsResponse struct {
// NextPageToken: The standard List next-page token.
NextPageToken string `json:"nextPageToken,omitempty"`
// Operations: A list of operations that matches the specified filter in
// the request.
Operations []*Operation `json:"operations,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListOperationsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListTenancyUnitsResponse: Response for the list request.
type ListTenancyUnitsResponse struct {
// NextPageToken: Pagination token for large results.
NextPageToken string `json:"nextPageToken,omitempty"`
// TenancyUnits: Tenancy units matching the request.
TenancyUnits []*TenancyUnit `json:"tenancyUnits,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListTenancyUnitsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListTenancyUnitsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogDescriptor: A description of a log type. Example in YAML format:
//
// - name: library.googleapis.com/activity_history
// description: The history of borrowing and returning library
// items.
// display_name: Activity
// labels:
// - key: /customer_id
// description: Identifier of a library customer
type LogDescriptor struct {
// Description: A human-readable description of this log. This
// information appears in
// the documentation and can contain details.
Description string `json:"description,omitempty"`
// DisplayName: The human-readable name for this log. This information
// appears on
// the user interface and should be concise.
DisplayName string `json:"displayName,omitempty"`
// Labels: The set of labels that are available to describe a specific
// log entry.
// Runtime requests that contain labels not specified here
// are
// considered invalid.
Labels []*LabelDescriptor `json:"labels,omitempty"`
// Name: The name of the log. It must be less than 512 characters long
// and can
// include the following characters: upper- and lower-case
// alphanumeric
// characters [A-Za-z0-9], and punctuation characters including
// slash, underscore, hyphen, period [/_-.].
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogDescriptor) MarshalJSON() ([]byte, error) {
type NoMethod LogDescriptor
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Logging: Logging configuration of the service.
//
// The following example shows how to configure logs to be sent to
// the
// producer and consumer projects. In the example, the
// `activity_history`
// log is sent to both the producer and consumer projects, whereas
// the
// `purchase_history` log is only sent to the producer project.
//
// monitored_resources:
// - type: library.googleapis.com/branch
// labels:
// - key: /city
// description: The city where the library branch is located
// in.
// - key: /name
// description: The name of the branch.
// logs:
// - name: activity_history
// labels:
// - key: /customer_id
// - name: purchase_history
// logging:
// producer_destinations:
// - monitored_resource: library.googleapis.com/branch
// logs:
// - activity_history
// - purchase_history
// consumer_destinations:
// - monitored_resource: library.googleapis.com/branch
// logs:
// - activity_history
type Logging struct {
// ConsumerDestinations: Logging configurations for sending logs to the
// consumer project.
// There can be multiple consumer destinations, each one must have
// a
// different monitored resource type. A log can be used in at most
// one consumer destination.
ConsumerDestinations []*LoggingDestination `json:"consumerDestinations,omitempty"`
// ProducerDestinations: Logging configurations for sending logs to the
// producer project.
// There can be multiple producer destinations, each one must have
// a
// different monitored resource type. A log can be used in at most
// one producer destination.
ProducerDestinations []*LoggingDestination `json:"producerDestinations,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ConsumerDestinations") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConsumerDestinations") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Logging) MarshalJSON() ([]byte, error) {
type NoMethod Logging
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LoggingDestination: Configuration of a specific logging destination
// (the producer project
// or the consumer project).
type LoggingDestination struct {
// Logs: Names of the logs to be sent to this destination. Each name
// must
// be defined in the Service.logs section. If the log name is
// not a domain scoped name, it will be automatically prefixed with
// the service name followed by "/".
Logs []string `json:"logs,omitempty"`
// MonitoredResource: The monitored resource type. The type must be
// defined in the
// Service.monitored_resources section.
MonitoredResource string `json:"monitoredResource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Logs") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Logs") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LoggingDestination) MarshalJSON() ([]byte, error) {
type NoMethod LoggingDestination
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MediaDownload: Defines the Media configuration for a service in case
// of a download.
// Use this only for Scotty Requests. Do not use this for media support
// using
// Bytestream, add instead [][google.bytestream.RestByteStream] as an
// API to
// your configuration for Bytestream methods.
type MediaDownload struct {
// CompleteNotification: A boolean that determines whether a
// notification for the completion of a
// download should be sent to the backend.
CompleteNotification bool `json:"completeNotification,omitempty"`
// DownloadService: DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING
// IS REMOVED.
//
// Specify name of the download service if one is used for download.
DownloadService string `json:"downloadService,omitempty"`
// Dropzone: Name of the Scotty dropzone to use for the current API.
Dropzone string `json:"dropzone,omitempty"`
// Enabled: Whether download is enabled.
Enabled bool `json:"enabled,omitempty"`
// MaxDirectDownloadSize: Optional maximum acceptable size for direct
// download.
// The size is specified in bytes.
MaxDirectDownloadSize int64 `json:"maxDirectDownloadSize,omitempty,string"`
// UseDirectDownload: A boolean that determines if direct download from
// ESF should be used for
// download of this media.
UseDirectDownload bool `json:"useDirectDownload,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "CompleteNotification") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CompleteNotification") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *MediaDownload) MarshalJSON() ([]byte, error) {
type NoMethod MediaDownload
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MediaUpload: Defines the Media configuration for a service in case of
// an upload.
// Use this only for Scotty Requests. Do not use this for media support
// using
// Bytestream, add instead [][google.bytestream.RestByteStream] as an
// API to
// your configuration for Bytestream methods.
type MediaUpload struct {
// CompleteNotification: A boolean that determines whether a
// notification for the completion of an
// upload should be sent to the backend. These notifications will not be
// seen
// by the client and will not consume quota.
CompleteNotification bool `json:"completeNotification,omitempty"`
// Dropzone: Name of the Scotty dropzone to use for the current API.
Dropzone string `json:"dropzone,omitempty"`
// Enabled: Whether upload is enabled.
Enabled bool `json:"enabled,omitempty"`
// MaxSize: Optional maximum acceptable size for an upload.
// The size is specified in bytes.
MaxSize int64 `json:"maxSize,omitempty,string"`
// MimeTypes: An array of mimetype patterns. Esf will only accept
// uploads that match one
// of the given patterns.
MimeTypes []string `json:"mimeTypes,omitempty"`
// ProgressNotification: Whether to receive a notification for progress
// changes of media upload.
ProgressNotification bool `json:"progressNotification,omitempty"`
// StartNotification: Whether to receive a notification on the start of
// media upload.
StartNotification bool `json:"startNotification,omitempty"`
// UploadService: DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING
// IS REMOVED.
//
// Specify name of the upload service if one is used for upload.
UploadService string `json:"uploadService,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "CompleteNotification") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CompleteNotification") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *MediaUpload) MarshalJSON() ([]byte, error) {
type NoMethod MediaUpload
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Method: Method represents a method of an API interface.
type Method struct {
// Name: The simple name of this method.
Name string `json:"name,omitempty"`
// Options: Any metadata attached to the method.
Options []*Option `json:"options,omitempty"`
// RequestStreaming: If true, the request is streamed.
RequestStreaming bool `json:"requestStreaming,omitempty"`
// RequestTypeUrl: A URL of the input message type.
RequestTypeUrl string `json:"requestTypeUrl,omitempty"`
// ResponseStreaming: If true, the response is streamed.
ResponseStreaming bool `json:"responseStreaming,omitempty"`
// ResponseTypeUrl: The URL of the output message type.
ResponseTypeUrl string `json:"responseTypeUrl,omitempty"`
// Syntax: The source syntax of this method.
//
// Possible values:
// "SYNTAX_PROTO2" - Syntax `proto2`.
// "SYNTAX_PROTO3" - Syntax `proto3`.
Syntax string `json:"syntax,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Method) MarshalJSON() ([]byte, error) {
type NoMethod Method
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricDescriptor: Defines a metric type and its schema. Once a metric
// descriptor is created,
// deleting or altering it stops data collection and makes the metric
// type's
// existing data unusable.
type MetricDescriptor struct {
// Description: A detailed description of the metric, which can be used
// in documentation.
Description string `json:"description,omitempty"`
// DisplayName: A concise name for the metric, which can be displayed in
// user interfaces.
// Use sentence case without an ending period, for example "Request
// count".
// This field is optional but it is recommended to be set for any
// metrics
// associated with user-visible concepts, such as Quota.
DisplayName string `json:"displayName,omitempty"`
// Labels: The set of labels that can be used to describe a
// specific
// instance of this metric type. For example,
// the
// `appengine.googleapis.com/http/server/response_latencies` metric
// type has a label for the HTTP response code, `response_code`, so
// you can look at latencies for successful responses or just
// for responses that failed.
Labels []*LabelDescriptor `json:"labels,omitempty"`
// Metadata: Optional. Metadata which can be used to guide usage of the
// metric.
Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"`
// MetricKind: Whether the metric records instantaneous values, changes
// to a value, etc.
// Some combinations of `metric_kind` and `value_type` might not be
// supported.
//
// Possible values:
// "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
// "GAUGE" - An instantaneous measurement of a value.
// "DELTA" - The change in a value during a time interval.
// "CUMULATIVE" - A value accumulated over a time interval.
// Cumulative
// measurements in a time series should have the same start time
// and increasing end times, until an event resets the cumulative
// value to zero and sets a new start time for the following
// points.
MetricKind string `json:"metricKind,omitempty"`
// Name: The resource name of the metric descriptor.
Name string `json:"name,omitempty"`
// Type: The metric type, including its DNS name prefix. The type is
// not
// URL-encoded. All user-defined metric types have the DNS
// name
// `custom.googleapis.com` or `external.googleapis.com`. Metric types
// should
// use a natural hierarchical grouping. For example:
//
// "custom.googleapis.com/invoice/paid/amount"
// "external.googleapis.com/prometheus/up"
// "appengine.googleapis.com/http/server/response_latencies"
Type string `json:"type,omitempty"`
// Unit: The unit in which the metric value is reported. It is only
// applicable
// if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`.
// The
// supported units are a subset of [The Unified Code for Units
// of
// Measure](http://unitsofmeasure.org/ucum.html) standard:
//
// **Basic units (UNIT)**
//
// * `bit` bit
// * `By` byte
// * `s` second
// * `min` minute
// * `h` hour
// * `d` day
//
// **Prefixes (PREFIX)**
//
// * `k` kilo (10**3)
// * `M` mega (10**6)
// * `G` giga (10**9)
// * `T` tera (10**12)
// * `P` peta (10**15)
// * `E` exa (10**18)
// * `Z` zetta (10**21)
// * `Y` yotta (10**24)
// * `m` milli (10**-3)
// * `u` micro (10**-6)
// * `n` nano (10**-9)
// * `p` pico (10**-12)
// * `f` femto (10**-15)
// * `a` atto (10**-18)
// * `z` zepto (10**-21)
// * `y` yocto (10**-24)
// * `Ki` kibi (2**10)
// * `Mi` mebi (2**20)
// * `Gi` gibi (2**30)
// * `Ti` tebi (2**40)
//
// **Grammar**
//
// The grammar also includes these connectors:
//
// * `/` division (as an infix operator, e.g. `1/s`).
// * `.` multiplication (as an infix operator, e.g. `GBy.d`)
//
// The grammar for a unit is as follows:
//
// Expression = Component { "." Component } { "/" Component } ;
//
// Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
// | Annotation
// | "1"
// ;
//
// Annotation = "{" NAME "}" ;
//
// Notes:
//
// * `Annotation` is just a comment if it follows a `UNIT` and is
// equivalent to `1` if it is used alone. For examples,
// `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
// * `NAME` is a sequence of non-blank printable ASCII characters not
// containing '{' or '}'.
// * `1` represents dimensionless value 1, such as in `1/s`.
// * `%` represents dimensionless value 1/100, and annotates values
// giving
// a percentage.
Unit string `json:"unit,omitempty"`
// ValueType: Whether the measurement is an integer, a floating-point
// number, etc.
// Some combinations of `metric_kind` and `value_type` might not be
// supported.
//
// Possible values:
// "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
// "BOOL" - The value is a boolean.
// This value type can be used only if the metric kind is `GAUGE`.
// "INT64" - The value is a signed 64-bit integer.
// "DOUBLE" - The value is a double precision floating point number.
// "STRING" - The value is a text string.
// This value type can be used only if the metric kind is `GAUGE`.
// "DISTRIBUTION" - The value is a `Distribution`.
// "MONEY" - The value is money.
ValueType string `json:"valueType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
type NoMethod MetricDescriptor
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricDescriptorMetadata: Additional annotations that can be used to
// guide the usage of a metric.
type MetricDescriptorMetadata struct {
// IngestDelay: The delay of data points caused by ingestion. Data
// points older than this
// age are guaranteed to be ingested and available to be read,
// excluding
// data loss due to errors.
IngestDelay string `json:"ingestDelay,omitempty"`
// LaunchStage: The launch stage of the metric definition.
//
// Possible values:
// "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
// "EARLY_ACCESS" - Early Access features are limited to a closed
// group of testers. To use
// these features, you must sign up in advance and sign a Trusted
// Tester
// agreement (which includes confidentiality provisions). These features
// may
// be unstable, changed in backward-incompatible ways, and are
// not
// guaranteed to be released.
// "ALPHA" - Alpha is a limited availability test for releases before
// they are cleared
// for widespread use. By Alpha, all significant design issues are
// resolved
// and we are in the process of verifying functionality. Alpha
// customers
// need to apply for access, agree to applicable terms, and have
// their
// projects whitelisted. Alpha releases don’t have to be feature
// complete,
// no SLAs are provided, and there are no technical support obligations,
// but
// they will be far enough along that customers can actually use them
// in
// test environments or for limited-use tests -- just like they would
// in
// normal production cases.
// "BETA" - Beta is the point at which we are ready to open a release
// for any
// customer to use. There are no SLA or technical support obligations in
// a
// Beta release. Products will be complete from a feature perspective,
// but
// may have some open outstanding issues. Beta releases are suitable
// for
// limited production use cases.
// "GA" - GA features are open to all developers and are considered
// stable and
// fully qualified for production use.
// "DEPRECATED" - Deprecated features are scheduled to be shut down
// and removed. For more
// information, see the “Deprecation Policy” section of our [Terms
// of
// Service](https://cloud.google.com/terms/)
// and the [Google Cloud Platform Subject to the
// Deprecation
// Policy](https://cloud.google.com/terms/deprecation) documentation.
LaunchStage string `json:"launchStage,omitempty"`
// SamplePeriod: The sampling period of metric data points. For metrics
// which are written
// periodically, consecutive data points are stored at this time
// interval,
// excluding data loss due to errors. Metrics with a higher granularity
// have
// a smaller sampling period.
SamplePeriod string `json:"samplePeriod,omitempty"`
// ForceSendFields is a list of field names (e.g. "IngestDelay") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "IngestDelay") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) {
type NoMethod MetricDescriptorMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricRule: Bind API methods to metrics. Binding a method to a metric
// causes that
// metric's configured quota behaviors to apply to the method call.
type MetricRule struct {
// MetricCosts: Metrics to update when the selected methods are called,
// and the associated
// cost applied to each metric.
//
// The key of the map is the metric name, and the values are the
// amount
// increased for the metric against which the quota limits are
// defined.
// The value must not be negative.
MetricCosts map[string]string `json:"metricCosts,omitempty"`
// Selector: Selects the methods to which this rule applies.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g. "MetricCosts") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "MetricCosts") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MetricRule) MarshalJSON() ([]byte, error) {
type NoMethod MetricRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Mixin: Declares an API Interface to be included in this interface.
// The including
// interface must redeclare all the methods from the included interface,
// but
// documentation and options are inherited as follows:
//
// - If after comment and whitespace stripping, the documentation
// string of the redeclared method is empty, it will be inherited
// from the original method.
//
// - Each annotation belonging to the service config (http,
// visibility) which is not set in the redeclared method will be
// inherited.
//
// - If an http annotation is inherited, the path pattern will be
// modified as follows. Any version prefix will be replaced by the
// version of the including interface plus the root path if
// specified.
//
// Example of a simple mixin:
//
// package google.acl.v1;
// service AccessControl {
// // Get the underlying ACL object.
// rpc GetAcl(GetAclRequest) returns (Acl) {
// option (google.api.http).get = "/v1/{resource=**}:getAcl";
// }
// }
//
// package google.storage.v2;
// service Storage {
// // rpc GetAcl(GetAclRequest) returns (Acl);
//
// // Get a data record.
// rpc GetData(GetDataRequest) returns (Data) {
// option (google.api.http).get = "/v2/{resource=**}";
// }
// }
//
// Example of a mixin configuration:
//
// apis:
// - name: google.storage.v2.Storage
// mixins:
// - name: google.acl.v1.AccessControl
//
// The mixin construct implies that all methods in `AccessControl`
// are
// also declared with same name and request/response types in
// `Storage`. A documentation generator or annotation processor will
// see the effective `Storage.GetAcl` method after
// inherting
// documentation and annotations as follows:
//
// service Storage {
// // Get the underlying ACL object.
// rpc GetAcl(GetAclRequest) returns (Acl) {
// option (google.api.http).get = "/v2/{resource=**}:getAcl";
// }
// ...
// }
//
// Note how the version in the path pattern changed from `v1` to
// `v2`.
//
// If the `root` field in the mixin is specified, it should be
// a
// relative path under which inherited HTTP paths are placed. Example:
//
// apis:
// - name: google.storage.v2.Storage
// mixins:
// - name: google.acl.v1.AccessControl
// root: acls
//
// This implies the following inherited HTTP annotation:
//
// service Storage {
// // Get the underlying ACL object.
// rpc GetAcl(GetAclRequest) returns (Acl) {
// option (google.api.http).get =
// "/v2/acls/{resource=**}:getAcl";
// }
// ...
// }
type Mixin struct {
// Name: The fully qualified name of the interface which is included.
Name string `json:"name,omitempty"`
// Root: If non-empty specifies a path under which inherited HTTP
// paths
// are rooted.
Root string `json:"root,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Mixin) MarshalJSON() ([]byte, error) {
type NoMethod Mixin
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MonitoredResourceDescriptor: An object that describes the schema of a
// MonitoredResource object using a
// type name and a set of labels. For example, the monitored
// resource
// descriptor for Google Compute Engine VM instances has a type
// of
// "gce_instance" and specifies the use of the labels "instance_id"
// and
// "zone" to identify particular VM instances.
//
// Different APIs can support different monitored resource types. APIs
// generally
// provide a `list` method that returns the monitored resource
// descriptors used
// by the API.
type MonitoredResourceDescriptor struct {
// Description: Optional. A detailed description of the monitored
// resource type that might
// be used in documentation.
Description string `json:"description,omitempty"`
// DisplayName: Optional. A concise name for the monitored resource type
// that might be
// displayed in user interfaces. It should be a Title Cased Noun
// Phrase,
// without any article or other determiners. For example,
// "Google Cloud SQL Database".
DisplayName string `json:"displayName,omitempty"`
// Labels: Required. A set of labels used to describe instances of this
// monitored
// resource type. For example, an individual Google Cloud SQL database
// is
// identified by values for the labels "database_id" and "zone".
Labels []*LabelDescriptor `json:"labels,omitempty"`
// Name: Optional. The resource name of the monitored resource
// descriptor:
// "projects/{project_id}/monitoredResourceDescriptors/{type
// }" where
// {type} is the value of the `type` field in this object
// and
// {project_id} is a project ID that provides API-specific context
// for
// accessing the type. APIs that do not use project information can use
// the
// resource name format "monitoredResourceDescriptors/{type}".
Name string `json:"name,omitempty"`
// Type: Required. The monitored resource type. For example, the
// type
// "cloudsql_database" represents databases in Google Cloud SQL.
// The maximum length of this value is 256 characters.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
type NoMethod MonitoredResourceDescriptor
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Monitoring: Monitoring configuration of the service.
//
// The example below shows how to configure monitored resources and
// metrics
// for monitoring. In the example, a monitored resource and two metrics
// are
// defined. The `library.googleapis.com/book/returned_count` metric is
// sent
// to both producer and consumer projects, whereas
// the
// `library.googleapis.com/book/overdue_count` metric is only sent to
// the
// consumer project.
//
// monitored_resources:
// - type: library.googleapis.com/branch
// labels:
// - key: /city
// description: The city where the library branch is located
// in.
// - key: /name
// description: The name of the branch.
// metrics:
// - name: library.googleapis.com/book/returned_count
// metric_kind: DELTA
// value_type: INT64
// labels:
// - key: /customer_id
// - name: library.googleapis.com/book/overdue_count
// metric_kind: GAUGE
// value_type: INT64
// labels:
// - key: /customer_id
// monitoring:
// producer_destinations:
// - monitored_resource: library.googleapis.com/branch
// metrics:
// - library.googleapis.com/book/returned_count
// consumer_destinations:
// - monitored_resource: library.googleapis.com/branch
// metrics:
// - library.googleapis.com/book/returned_count
// - library.googleapis.com/book/overdue_count
type Monitoring struct {
// ConsumerDestinations: Monitoring configurations for sending metrics
// to the consumer project.
// There can be multiple consumer destinations, each one must have
// a
// different monitored resource type. A metric can be used in at
// most
// one consumer destination.
ConsumerDestinations []*MonitoringDestination `json:"consumerDestinations,omitempty"`
// ProducerDestinations: Monitoring configurations for sending metrics
// to the producer project.
// There can be multiple producer destinations, each one must have
// a
// different monitored resource type. A metric can be used in at
// most
// one producer destination.
ProducerDestinations []*MonitoringDestination `json:"producerDestinations,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ConsumerDestinations") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConsumerDestinations") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Monitoring) MarshalJSON() ([]byte, error) {
type NoMethod Monitoring
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MonitoringDestination: Configuration of a specific monitoring
// destination (the producer project
// or the consumer project).
type MonitoringDestination struct {
// Metrics: Names of the metrics to report to this monitoring
// destination.
// Each name must be defined in Service.metrics section.
Metrics []string `json:"metrics,omitempty"`
// MonitoredResource: The monitored resource type. The type must be
// defined in
// Service.monitored_resources section.
MonitoredResource string `json:"monitoredResource,omitempty"`
// ForceSendFields is a list of field names (e.g. "Metrics") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Metrics") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MonitoringDestination) MarshalJSON() ([]byte, error) {
type NoMethod MonitoringDestination
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OAuthRequirements: OAuth scopes are a way to define data and
// permissions on data. For example,
// there are scopes defined for "Read-only access to Google Calendar"
// and
// "Access to Cloud Platform". Users can consent to a scope for an
// application,
// giving it permission to access that data on their behalf.
//
// OAuth scope specifications should be fairly coarse grained; a user
// will need
// to see and understand the text description of what your scope
// means.
//
// In most cases: use one or at most two OAuth scopes for an entire
// family of
// products. If your product has multiple APIs, you should probably be
// sharing
// the OAuth scope across all of those APIs.
//
// When you need finer grained OAuth consent screens: talk with your
// product
// management about how developers will use them in practice.
//
// Please note that even though each of the canonical scopes is enough
// for a
// request to be accepted and passed to the backend, a request can still
// fail
// due to the backend requiring additional scopes or permissions.
type OAuthRequirements struct {
// CanonicalScopes: The list of publicly documented OAuth scopes that
// are allowed access. An
// OAuth token containing any of these scopes will be
// accepted.
//
// Example:
//
// canonical_scopes: https://www.googleapis.com/auth/calendar,
// https://www.googleapis.com/auth/calendar.read
CanonicalScopes string `json:"canonicalScopes,omitempty"`
// ForceSendFields is a list of field names (e.g. "CanonicalScopes") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CanonicalScopes") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *OAuthRequirements) MarshalJSON() ([]byte, error) {
type NoMethod OAuthRequirements
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Operation: This resource represents a long-running operation that is
// the result of a
// network API call.
type Operation struct {
// Done: If the value is `false`, it means the operation is still in
// progress.
// If `true`, the operation is completed, and either `error` or
// `response` is
// available.
Done bool `json:"done,omitempty"`
// Error: The error result of the operation in case of failure or
// cancellation.
Error *Status `json:"error,omitempty"`
// Metadata: Service-specific metadata associated with the operation.
// It typically
// contains progress information and common metadata such as create
// time.
// Some services might not provide such metadata. Any method that
// returns a
// long-running operation should document the metadata type, if any.
Metadata googleapi.RawMessage `json:"metadata,omitempty"`
// Name: The server-assigned name, which is only unique within the same
// service that
// originally returns it. If you use the default HTTP mapping,
// the
// `name` should have the format of `operations/some/unique/name`.
Name string `json:"name,omitempty"`
// Response: The normal response of the operation in case of success.
// If the original
// method returns no data on success, such as `Delete`, the response
// is
// `google.protobuf.Empty`. If the original method is
// standard
// `Get`/`Create`/`Update`, the response should be the resource. For
// other
// methods, the response should have the type `XxxResponse`, where
// `Xxx`
// is the original method name. For example, if the original method
// name
// is `TakeSnapshot()`, the inferred response type
// is
// `TakeSnapshotResponse`.
Response googleapi.RawMessage `json:"response,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Done") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Done") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Operation) MarshalJSON() ([]byte, error) {
type NoMethod Operation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Option: A protocol buffer option, which can be attached to a message,
// field,
// enumeration, etc.
type Option struct {
// Name: The option's name. For protobuf built-in options (options
// defined in
// descriptor.proto), this is the short name. For example,
// "map_entry".
// For custom options, it should be the fully-qualified name. For
// example,
// "google.api.http".
Name string `json:"name,omitempty"`
// Value: The option's value packed in an Any message. If the value is a
// primitive,
// the corresponding wrapper type defined in
// google/protobuf/wrappers.proto
// should be used. If the value is an enum, it should be stored as an
// int32
// value using the google.protobuf.Int32Value type.
Value googleapi.RawMessage `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Option) MarshalJSON() ([]byte, error) {
type NoMethod Option
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Page: Represents a documentation page. A page can contain subpages to
// represent
// nested documentation set structure.
type Page struct {
// Content: The Markdown content of the page. You can use <code>(==
// include {path} ==)</code>
// to include content from a Markdown file.
Content string `json:"content,omitempty"`
// Name: The name of the page. It will be used as an identity of the
// page to
// generate URI of the page, text of the link to this page in
// navigation,
// etc. The full page name (start from the root page name to this
// page
// concatenated with `.`) can be used as reference to the page in
// your
// documentation. For example:
// <pre><code>pages:
// - name: Tutorial
// content: (== include tutorial.md ==)
// subpages:
// - name: Java
// content: (== include tutorial_java.md
// ==)
// </code></pre>
// You can reference `Java` page using Markdown reference link
// syntax:
// `Java`.
Name string `json:"name,omitempty"`
// Subpages: Subpages of this page. The order of subpages specified here
// will be
// honored in the generated docset.
Subpages []*Page `json:"subpages,omitempty"`
// ForceSendFields is a list of field names (e.g. "Content") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Content") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Page) MarshalJSON() ([]byte, error) {
type NoMethod Page
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PolicyBinding: Translates to IAM Policy bindings (without auditing at
// this level)
type PolicyBinding struct {
// Members: Uses the same format as in IAM policy.
// `member` must include both prefix and ID. For example,
// `user:{emailId}`,
// `serviceAccount:{emailId}`, `group:{emailId}`.
Members []string `json:"members,omitempty"`
// Role: Role.
// (https://cloud.google.com/iam/docs/understanding-roles)
// For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Role string `json:"role,omitempty"`
// ForceSendFields is a list of field names (e.g. "Members") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Members") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *PolicyBinding) MarshalJSON() ([]byte, error) {
type NoMethod PolicyBinding
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Quota: Quota configuration helps to achieve fairness and budgeting in
// service
// usage.
//
// The quota configuration works this way:
// - The service configuration defines a set of metrics.
// - For API calls, the quota.metric_rules maps methods to metrics with
// corresponding costs.
// - The quota.limits defines limits on the metrics, which will be used
// for
// quota checks at runtime.
//
// An example quota configuration in yaml format:
//
// quota:
//
// - name: apiWriteQpsPerProject
// metric: library.googleapis.com/write_calls
// unit: "1/min/{project}" # rate limit for consumer projects
// values:
// STANDARD: 10000
//
//
// # The metric rules bind all methods to the read_calls metric,
// # except for the UpdateBook and DeleteBook methods. These two
// methods
// # are mapped to the write_calls metric, with the UpdateBook
// method
// # consuming at twice rate as the DeleteBook method.
// metric_rules:
// - selector: "*"
// metric_costs:
// library.googleapis.com/read_calls: 1
// - selector: google.example.library.v1.LibraryService.UpdateBook
// metric_costs:
// library.googleapis.com/write_calls: 2
// - selector: google.example.library.v1.LibraryService.DeleteBook
// metric_costs:
// library.googleapis.com/write_calls: 1
//
// Corresponding Metric definition:
//
// metrics:
// - name: library.googleapis.com/read_calls
// display_name: Read requests
// metric_kind: DELTA
// value_type: INT64
//
// - name: library.googleapis.com/write_calls
// display_name: Write requests
// metric_kind: DELTA
// value_type: INT64
type Quota struct {
// Limits: List of `QuotaLimit` definitions for the service.
Limits []*QuotaLimit `json:"limits,omitempty"`
// MetricRules: List of `MetricRule` definitions, each one mapping a
// selected method to one
// or more metrics.
MetricRules []*MetricRule `json:"metricRules,omitempty"`
// ForceSendFields is a list of field names (e.g. "Limits") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Limits") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Quota) MarshalJSON() ([]byte, error) {
type NoMethod Quota
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// QuotaLimit: `QuotaLimit` defines a specific limit that applies over a
// specified duration
// for a limit type. There can be at most one limit for a duration and
// limit
// type combination defined within a `QuotaGroup`.
type QuotaLimit struct {
// DefaultLimit: Default number of tokens that can be consumed during
// the specified
// duration. This is the number of tokens assigned when a
// client
// application developer activates the service for his/her
// project.
//
// Specifying a value of 0 will block all requests. This can be used if
// you
// are provisioning quota to selected consumers and blocking
// others.
// Similarly, a value of -1 will indicate an unlimited quota. No
// other
// negative values are allowed.
//
// Used by group-based quotas only.
DefaultLimit int64 `json:"defaultLimit,omitempty,string"`
// Description: Optional. User-visible, extended description for this
// quota limit.
// Should be used only when more context is needed to understand this
// limit
// than provided by the limit's display name (see: `display_name`).
Description string `json:"description,omitempty"`
// DisplayName: User-visible display name for this limit.
// Optional. If not set, the UI will provide a default display name
// based on
// the quota configuration. This field can be used to override the
// default
// display name generated from the configuration.
DisplayName string `json:"displayName,omitempty"`
// Duration: Duration of this limit in textual notation. Example:
// "100s", "24h", "1d".
// For duration longer than a day, only multiple of days is supported.
// We
// support only "100s" and "1d" for now. Additional support will be
// added in
// the future. "0" indicates indefinite duration.
//
// Used by group-based quotas only.
Duration string `json:"duration,omitempty"`
// FreeTier: Free tier value displayed in the Developers Console for
// this limit.
// The free tier is the number of tokens that will be subtracted from
// the
// billed amount when billing is enabled.
// This field can only be set on a limit with duration "1d", in a
// billable
// group; it is invalid on any other limit. If this field is not set,
// it
// defaults to 0, indicating that there is no free tier for this
// service.
//
// Used by group-based quotas only.
FreeTier int64 `json:"freeTier,omitempty,string"`
// MaxLimit: Maximum number of tokens that can be consumed during the
// specified
// duration. Client application developers can override the default
// limit up
// to this maximum. If specified, this value cannot be set to a value
// less
// than the default limit. If not specified, it is set to the default
// limit.
//
// To allow clients to apply overrides with no upper bound, set this to
// -1,
// indicating unlimited maximum quota.
//
// Used by group-based quotas only.
MaxLimit int64 `json:"maxLimit,omitempty,string"`
// Metric: The name of the metric this quota limit applies to. The quota
// limits with
// the same metric will be checked together during runtime. The metric
// must be
// defined within the service config.
Metric string `json:"metric,omitempty"`
// Name: Name of the quota limit.
//
// The name must be provided, and it must be unique within the service.
// The
// name can only include alphanumeric characters as well as '-'.
//
// The maximum length of the limit name is 64 characters.
Name string `json:"name,omitempty"`
// Unit: Specify the unit of the quota limit. It uses the same syntax
// as
// Metric.unit. The supported unit kinds are determined by the
// quota
// backend system.
//
// Here are some examples:
// * "1/min/{project}" for quota per minute per project.
//
// Note: the order of unit components is insignificant.
// The "1" at the beginning is required to follow the metric unit
// syntax.
Unit string `json:"unit,omitempty"`
// Values: Tiered limit values. You must specify this as a key:value
// pair, with an
// integer value that is the maximum number of requests allowed for
// the
// specified unit. Currently only STANDARD is supported.
Values map[string]string `json:"values,omitempty"`
// ForceSendFields is a list of field names (e.g. "DefaultLimit") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DefaultLimit") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *QuotaLimit) MarshalJSON() ([]byte, error) {
type NoMethod QuotaLimit
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RemoveTenantProjectRequest: Request message to remove tenant project
// resource from the tenancy unit.
type RemoveTenantProjectRequest struct {
// Tag: Tag of the resource within the tenancy unit.
Tag string `json:"tag,omitempty"`
// ForceSendFields is a list of field names (e.g. "Tag") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Tag") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *RemoveTenantProjectRequest) MarshalJSON() ([]byte, error) {
type NoMethod RemoveTenantProjectRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SearchTenancyUnitsResponse: Response for the search query.
type SearchTenancyUnitsResponse struct {
// NextPageToken: Pagination token for large results.
NextPageToken string `json:"nextPageToken,omitempty"`
// TenancyUnits: Tenancy Units matching the request.
TenancyUnits []*TenancyUnit `json:"tenancyUnits,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SearchTenancyUnitsResponse) MarshalJSON() ([]byte, error) {
type NoMethod SearchTenancyUnitsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Service: `Service` is the root object of Google service configuration
// schema. It
// describes basic information about a service, such as the name and
// the
// title, and delegates other aspects to sub-sections. Each sub-section
// is
// either a proto message or a repeated proto message that configures
// a
// specific aspect, such as auth. See each proto message definition for
// details.
//
// Example:
//
// type: google.api.Service
// config_version: 3
// name: calendar.googleapis.com
// title: Google Calendar API
// apis:
// - name: google.calendar.v3.Calendar
// authentication:
// providers:
// - id: google_calendar_auth
// jwks_uri: https://www.googleapis.com/oauth2/v1/certs
// issuer: https://securetoken.google.com
// rules:
// - selector: "*"
// requirements:
// provider_id: google_calendar_auth
type Service struct {
// Apis: A list of API interfaces exported by this service. Only the
// `name` field
// of the google.protobuf.Api needs to be provided by the
// configuration
// author, as the remaining fields will be derived from the IDL during
// the
// normalization process. It is an error to specify an API interface
// here
// which cannot be resolved against the associated IDL files.
Apis []*Api `json:"apis,omitempty"`
// Authentication: Auth configuration.
Authentication *Authentication `json:"authentication,omitempty"`
// Backend: API backend configuration.
Backend *Backend `json:"backend,omitempty"`
// Billing: Billing configuration.
Billing *Billing `json:"billing,omitempty"`
// ConfigVersion: The semantic version of the service configuration. The
// config version
// affects the interpretation of the service configuration. For
// example,
// certain features are enabled by default for certain config
// versions.
// The latest config version is `3`.
ConfigVersion int64 `json:"configVersion,omitempty"`
// Context: Context configuration.
Context *Context `json:"context,omitempty"`
// Control: Configuration for the service control plane.
Control *Control `json:"control,omitempty"`
// CustomError: Custom error configuration.
CustomError *CustomError `json:"customError,omitempty"`
// Documentation: Additional API documentation.
Documentation *Documentation `json:"documentation,omitempty"`
// Endpoints: Configuration for network endpoints. If this is empty,
// then an endpoint
// with the same name as the service is automatically generated to
// service all
// defined APIs.
Endpoints []*Endpoint `json:"endpoints,omitempty"`
// Enums: A list of all enum types included in this API service.
// Enums
// referenced directly or indirectly by the `apis` are
// automatically
// included. Enums which are not referenced but shall be
// included
// should be listed here by name. Example:
//
// enums:
// - name: google.someapi.v1.SomeEnum
Enums []*Enum `json:"enums,omitempty"`
// Experimental: Experimental configuration.
Experimental *Experimental `json:"experimental,omitempty"`
// Http: HTTP configuration.
Http *Http `json:"http,omitempty"`
// Id: A unique ID for a specific instance of this message, typically
// assigned
// by the client for tracking purpose. If empty, the server may choose
// to
// generate one instead.
Id string `json:"id,omitempty"`
// Logging: Logging configuration.
Logging *Logging `json:"logging,omitempty"`
// Logs: Defines the logs used by this service.
Logs []*LogDescriptor `json:"logs,omitempty"`
// Metrics: Defines the metrics used by this service.
Metrics []*MetricDescriptor `json:"metrics,omitempty"`
// MonitoredResources: Defines the monitored resources used by this
// service. This is required
// by the Service.monitoring and Service.logging configurations.
MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"`
// Monitoring: Monitoring configuration.
Monitoring *Monitoring `json:"monitoring,omitempty"`
// Name: The DNS address at which this service is available,
// e.g. `calendar.googleapis.com`.
Name string `json:"name,omitempty"`
// ProducerProjectId: The Google project that owns this service.
ProducerProjectId string `json:"producerProjectId,omitempty"`
// Quota: Quota configuration.
Quota *Quota `json:"quota,omitempty"`
// SourceInfo: Output only. The source information for this
// configuration if available.
SourceInfo *SourceInfo `json:"sourceInfo,omitempty"`
// SystemParameters: System parameter configuration.
SystemParameters *SystemParameters `json:"systemParameters,omitempty"`
// SystemTypes: A list of all proto message types included in this API
// service.
// It serves similar purpose as [google.api.Service.types], except
// that
// these types are not needed by user-defined APIs. Therefore, they will
// not
// show up in the generated discovery doc. This field should only be
// used
// to define system APIs in ESF.
SystemTypes []*Type `json:"systemTypes,omitempty"`
// Title: The product title for this service.
Title string `json:"title,omitempty"`
// Types: A list of all proto message types included in this API
// service.
// Types referenced directly or indirectly by the `apis`
// are
// automatically included. Messages which are not referenced but
// shall be included, such as types used by the `google.protobuf.Any`
// type,
// should be listed here by name. Example:
//
// types:
// - name: google.protobuf.Int32
Types []*Type `json:"types,omitempty"`
// Usage: Configuration controlling usage of this service.
Usage *Usage `json:"usage,omitempty"`
// ForceSendFields is a list of field names (e.g. "Apis") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Apis") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Service) MarshalJSON() ([]byte, error) {
type NoMethod Service
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ServiceAccountConfig: Describes service account configuration for the
// tenant project.
type ServiceAccountConfig struct {
// AccountId: ID of the IAM service account to be created in tenant
// project.
// The email format of the service account will
// be
// "<account-id>@<tenant-project-id>.iam.gserviceaccount.com".
// This account id has to be unique within tenant project and
// producers
// have to guarantee it. And it must be 6-30 characters long, and
// matches the
// regular expression `[a-z]([-a-z0-9]*[a-z0-9])`.
AccountId string `json:"accountId,omitempty"`
// TenantProjectRoles: Roles for the associated service account for the
// tenant project.
TenantProjectRoles []string `json:"tenantProjectRoles,omitempty"`
// ForceSendFields is a list of field names (e.g. "AccountId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AccountId") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ServiceAccountConfig) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAccountConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SourceContext: `SourceContext` represents information about the
// source of a
// protobuf element, like the file in which it is defined.
type SourceContext struct {
// FileName: The path-qualified name of the .proto file that contained
// the associated
// protobuf element. For example:
// "google/protobuf/source_context.proto".
FileName string `json:"fileName,omitempty"`
// ForceSendFields is a list of field names (e.g. "FileName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FileName") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SourceContext) MarshalJSON() ([]byte, error) {
type NoMethod SourceContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SourceInfo: Source information used to create a Service Config
type SourceInfo struct {
// SourceFiles: All files used during config generation.
SourceFiles []googleapi.RawMessage `json:"sourceFiles,omitempty"`
// ForceSendFields is a list of field names (e.g. "SourceFiles") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "SourceFiles") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SourceInfo) MarshalJSON() ([]byte, error) {
type NoMethod SourceInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Status: The `Status` type defines a logical error model that is
// suitable for different
// programming environments, including REST APIs and RPC APIs. It is
// used by
// [gRPC](https://github.com/grpc). The error model is designed to
// be:
//
// - Simple to use and understand for most users
// - Flexible enough to meet unexpected needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error
// message,
// and error details. The error code should be an enum value
// of
// google.rpc.Code, but it may accept additional error codes if needed.
// The
// error message should be a developer-facing English message that
// helps
// developers *understand* and *resolve* the error. If a localized
// user-facing
// error message is needed, put the localized message in the error
// details or
// localize it in the client. The optional error details may contain
// arbitrary
// information about the error. There is a predefined set of error
// detail types
// in the package `google.rpc` that can be used for common error
// conditions.
//
// # Language mapping
//
// The `Status` message is the logical representation of the error
// model, but it
// is not necessarily the actual wire format. When the `Status` message
// is
// exposed in different client libraries and different wire protocols,
// it can be
// mapped differently. For example, it will likely be mapped to some
// exceptions
// in Java, but more likely mapped to some error codes in C.
//
// # Other uses
//
// The error model and the `Status` message can be used in a variety
// of
// environments, either with or without APIs, to provide a
// consistent developer experience across different
// environments.
//
// Example uses of this error model include:
//
// - Partial errors. If a service needs to return partial errors to the
// client,
// it may embed the `Status` in the normal response to indicate the
// partial
// errors.
//
// - Workflow errors. A typical workflow has multiple steps. Each step
// may
// have a `Status` message for error reporting.
//
// - Batch operations. If a client uses batch request and batch
// response, the
// `Status` message should be used directly inside batch response,
// one for
// each error sub-response.
//
// - Asynchronous operations. If an API call embeds asynchronous
// operation
// results in its response, the status of those operations should
// be
// represented directly using the `Status` message.
//
// - Logging. If some API errors are stored in logs, the message
// `Status` could
// be used directly after any stripping needed for security/privacy
// reasons.
type Status struct {
// Code: The status code, which should be an enum value of
// google.rpc.Code.
Code int64 `json:"code,omitempty"`
// Details: A list of messages that carry the error details. There is a
// common set of
// message types for APIs to use.
Details []googleapi.RawMessage `json:"details,omitempty"`
// Message: A developer-facing error message, which should be in
// English. Any
// user-facing error message should be localized and sent in
// the
// google.rpc.Status.details field, or localized by the client.
Message string `json:"message,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Status) MarshalJSON() ([]byte, error) {
type NoMethod Status
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SystemParameter: Define a parameter's name and location. The
// parameter may be passed as either
// an HTTP header or a URL query parameter, and if both are passed the
// behavior
// is implementation-dependent.
type SystemParameter struct {
// HttpHeader: Define the HTTP header name to use for the parameter. It
// is case
// insensitive.
HttpHeader string `json:"httpHeader,omitempty"`
// Name: Define the name of the parameter, such as "api_key" . It is
// case sensitive.
Name string `json:"name,omitempty"`
// UrlQueryParameter: Define the URL query parameter name to use for the
// parameter. It is case
// sensitive.
UrlQueryParameter string `json:"urlQueryParameter,omitempty"`
// ForceSendFields is a list of field names (e.g. "HttpHeader") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "HttpHeader") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SystemParameter) MarshalJSON() ([]byte, error) {
type NoMethod SystemParameter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SystemParameterRule: Define a system parameter rule mapping system
// parameter definitions to
// methods.
type SystemParameterRule struct {
// Parameters: Define parameters. Multiple names may be defined for a
// parameter.
// For a given method call, only one of them should be used. If
// multiple
// names are used the behavior is implementation-dependent.
// If none of the specified names are present the behavior
// is
// parameter-dependent.
Parameters []*SystemParameter `json:"parameters,omitempty"`
// Selector: Selects the methods to which this rule applies. Use '*' to
// indicate all
// methods in all APIs.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// ForceSendFields is a list of field names (e.g. "Parameters") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Parameters") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SystemParameterRule) MarshalJSON() ([]byte, error) {
type NoMethod SystemParameterRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SystemParameters: ### System parameter configuration
//
// A system parameter is a special kind of parameter defined by the
// API
// system, not by an individual API. It is typically mapped to an HTTP
// header
// and/or a URL query parameter. This configuration specifies which
// methods
// change the names of the system parameters.
type SystemParameters struct {
// Rules: Define system parameters.
//
// The parameters defined here will override the default
// parameters
// implemented by the system. If this field is missing from the
// service
// config, default system parameters will be used. Default system
// parameters
// and names is implementation-dependent.
//
// Example: define api key for all methods
//
// system_parameters
// rules:
// - selector: "*"
// parameters:
// - name: api_key
// url_query_parameter: api_key
//
//
// Example: define 2 api key names for a specific method.
//
// system_parameters
// rules:
// - selector: "/ListShelves"
// parameters:
// - name: api_key
// http_header: Api-Key1
// - name: api_key
// http_header: Api-Key2
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*SystemParameterRule `json:"rules,omitempty"`
// ForceSendFields is a list of field names (e.g. "Rules") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Rules") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SystemParameters) MarshalJSON() ([]byte, error) {
type NoMethod SystemParameters
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TenancyUnit: Representation of a tenancy unit.
type TenancyUnit struct {
// Consumer: @OutputOnly Cloud resource name of the consumer of this
// service.
// For example 'projects/123456'.
Consumer string `json:"consumer,omitempty"`
// CreateTime: @OutputOnly The time this tenancy unit was created.
CreateTime string `json:"createTime,omitempty"`
// Name: Globally unique identifier of this tenancy
// unit
// "services/{service}/{collection id}/{resource
// id}/tenancyUnits/{unit}"
Name string `json:"name,omitempty"`
// Service: @OutputOnly Google Cloud API name of the service owning this
// tenancy unit.
// For example 'serviceconsumermanagement.googleapis.com'.
Service string `json:"service,omitempty"`
// TenantResources: Resources constituting the tenancy unit.
// There can be at most 512 tenant resources in a tenancy unit.
TenantResources []*TenantResource `json:"tenantResources,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Consumer") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Consumer") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TenancyUnit) MarshalJSON() ([]byte, error) {
type NoMethod TenancyUnit
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TenantProjectConfig: This structure defines a tenant project to be
// added to the specified tenancy
// unit and its initial configuration and properties. A project lien
// will be
// created for the tenant project to prevent the tenant project from
// being
// deleted accidentally. The lien will be deleted as part of tenant
// project
// removal.
type TenantProjectConfig struct {
// BillingConfig: Billing account properties. Billing account must be
// specified.
BillingConfig *BillingConfig `json:"billingConfig,omitempty"`
// Folder: Folder where project in this tenancy unit must be
// located
// This folder must have been previously created with proper
// permissions for the caller to create and configure a project in
// it.
// Valid folder resource names have the format
// `folders/{folder_number}`
// (for example, `folders/123456`).
Folder string `json:"folder,omitempty"`
// Labels: Labels that will be applied to this project.
Labels map[string]string `json:"labels,omitempty"`
// ServiceAccountConfig: Configuration for IAM service account on tenant
// project.
ServiceAccountConfig *ServiceAccountConfig `json:"serviceAccountConfig,omitempty"`
// Services: Google Cloud API names of services that will be activated
// on this project
// during provisioning. If any of these services can not be
// activated,
// request will fail.
// For example: 'compute.googleapis.com','cloudfunctions.googleapis.com'
Services []string `json:"services,omitempty"`
// TenantProjectPolicy: Describes ownership and policies for the new
// tenant project. Required.
TenantProjectPolicy *TenantProjectPolicy `json:"tenantProjectPolicy,omitempty"`
// ForceSendFields is a list of field names (e.g. "BillingConfig") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BillingConfig") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TenantProjectConfig) MarshalJSON() ([]byte, error) {
type NoMethod TenantProjectConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TenantProjectPolicy: Describes policy settings that need to be
// applied to a newly
// created tenant project.
type TenantProjectPolicy struct {
// PolicyBindings: Policy bindings to be applied to the tenant project,
// in addition to the
// 'roles/owner' role granted to the Service Consumer Management
// service
// account.
// At least one binding must have the role `roles/owner`. Among the list
// of
// members for `roles/owner`, at least one of them must be either `user`
// or
// `group` type.
PolicyBindings []*PolicyBinding `json:"policyBindings,omitempty"`
// ForceSendFields is a list of field names (e.g. "PolicyBindings") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "PolicyBindings") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *TenantProjectPolicy) MarshalJSON() ([]byte, error) {
type NoMethod TenantProjectPolicy
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TenantResource: Resource constituting the TenancyUnit.
type TenantResource struct {
// Resource: @OutputOnly Identifier of the tenant resource.
// For cloud projects, it is in the form 'projects/{number}'.
// For example 'projects/123456'.
Resource string `json:"resource,omitempty"`
// Status: Status of tenant resource.
//
// Possible values:
// "STATUS_UNSPECIFIED" - Unspecified status is the default unset
// value.
// "PENDING_CREATE" - Creation of the tenant resource is ongoing.
// "ACTIVE" - Active resource.
// "PENDING_DELETE" - Deletion of the resource is ongoing.
// "FAILED" - Tenant resource creation or deletion has failed.
Status string `json:"status,omitempty"`
// Tag: Unique per single tenancy unit.
Tag string `json:"tag,omitempty"`
// ForceSendFields is a list of field names (e.g. "Resource") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Resource") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TenantResource) MarshalJSON() ([]byte, error) {
type NoMethod TenantResource
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Type: A protocol buffer message type.
type Type struct {
// Fields: The list of fields.
Fields []*Field `json:"fields,omitempty"`
// Name: The fully qualified message name.
Name string `json:"name,omitempty"`
// Oneofs: The list of types appearing in `oneof` definitions in this
// type.
Oneofs []string `json:"oneofs,omitempty"`
// Options: The protocol buffer options.
Options []*Option `json:"options,omitempty"`
// SourceContext: The source context.
SourceContext *SourceContext `json:"sourceContext,omitempty"`
// Syntax: The source syntax.
//
// Possible values:
// "SYNTAX_PROTO2" - Syntax `proto2`.
// "SYNTAX_PROTO3" - Syntax `proto3`.
Syntax string `json:"syntax,omitempty"`
// ForceSendFields is a list of field names (e.g. "Fields") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Fields") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Type) MarshalJSON() ([]byte, error) {
type NoMethod Type
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Usage: Configuration controlling usage of a service.
type Usage struct {
// ProducerNotificationChannel: The full resource name of a channel used
// for sending notifications to the
// service producer.
//
// Google Service Management currently only supports
// [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a
// notification
// channel. To use Google Cloud Pub/Sub as the channel, this must be the
// name
// of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name
// format
// documented in https://cloud.google.com/pubsub/docs/overview.
ProducerNotificationChannel string `json:"producerNotificationChannel,omitempty"`
// Requirements: Requirements that must be satisfied before a consumer
// project can use the
// service. Each requirement is of the form
// <service.name>/<requirement-id>;
// for example 'serviceusage.googleapis.com/billing-enabled'.
Requirements []string `json:"requirements,omitempty"`
// Rules: A list of usage rules that apply to individual API
// methods.
//
// **NOTE:** All service configuration rules follow "last one wins"
// order.
Rules []*UsageRule `json:"rules,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "ProducerNotificationChannel") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "ProducerNotificationChannel") to include in API requests with the
// JSON null value. By default, fields with empty values are omitted
// from API requests. However, any field with an empty value appearing
// in NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Usage) MarshalJSON() ([]byte, error) {
type NoMethod Usage
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// UsageRule: Usage configuration rules for the service.
//
// NOTE: Under development.
//
//
// Use this rule to configure unregistered calls for the service.
// Unregistered
// calls are calls that do not contain consumer project
// identity.
// (Example: calls that do not contain an API key).
// By default, API methods do not allow unregistered calls, and each
// method call
// must be identified by a consumer project identity. Use this rule
// to
// allow/disallow unregistered calls.
//
// Example of an API that wants to allow unregistered calls for entire
// service.
//
// usage:
// rules:
// - selector: "*"
// allow_unregistered_calls: true
//
// Example of a method that wants to allow unregistered calls.
//
// usage:
// rules:
// - selector:
// "google.example.library.v1.LibraryService.CreateBook"
// allow_unregistered_calls: true
type UsageRule struct {
// AllowUnregisteredCalls: If true, the selected method allows
// unregistered calls, e.g. calls
// that don't identify any user or application.
AllowUnregisteredCalls bool `json:"allowUnregisteredCalls,omitempty"`
// Selector: Selects the methods to which this rule applies. Use '*' to
// indicate all
// methods in all APIs.
//
// Refer to selector for syntax details.
Selector string `json:"selector,omitempty"`
// SkipServiceControl: If true, the selected method should skip service
// control and the control
// plane features, such as quota and billing, will not be
// available.
// This flag is used by Google Cloud Endpoints to bypass checks for
// internal
// methods, such as service health check methods.
SkipServiceControl bool `json:"skipServiceControl,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AllowUnregisteredCalls") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AllowUnregisteredCalls")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *UsageRule) MarshalJSON() ([]byte, error) {
type NoMethod UsageRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "serviceconsumermanagement.operations.cancel":
type OperationsCancelCall struct {
s *APIService
name string
canceloperationrequest *CancelOperationRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Cancel: Starts asynchronous cancellation on a long-running operation.
// The server
// makes a best effort to cancel the operation, but success is
// not
// guaranteed. If the server doesn't support this method, it
// returns
// `google.rpc.Code.UNIMPLEMENTED`. Clients can
// use
// Operations.GetOperation or
// other methods to check whether the cancellation succeeded or whether
// the
// operation completed despite cancellation. On successful
// cancellation,
// the operation is not deleted; instead, it becomes an operation
// with
// an Operation.error value with a google.rpc.Status.code of
// 1,
// corresponding to `Code.CANCELLED`.
func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall {
c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.canceloperationrequest = canceloperationrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OperationsCancelCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.operations.cancel" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Empty.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Empty{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.",
// "flatPath": "v1/operations/{operationsId}:cancel",
// "httpMethod": "POST",
// "id": "serviceconsumermanagement.operations.cancel",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The name of the operation resource to be cancelled.",
// "location": "path",
// "pattern": "^operations/.+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}:cancel",
// "request": {
// "$ref": "CancelOperationRequest"
// },
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "serviceconsumermanagement.operations.delete":
type OperationsDeleteCall struct {
s *APIService
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a long-running operation. This method indicates that
// the client is
// no longer interested in the operation result. It does not cancel
// the
// operation. If the server doesn't support this method, it
// returns
// `google.rpc.Code.UNIMPLEMENTED`.
func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OperationsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.operations.delete" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Empty.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Empty{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
// "flatPath": "v1/operations/{operationsId}",
// "httpMethod": "DELETE",
// "id": "serviceconsumermanagement.operations.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The name of the operation resource to be deleted.",
// "location": "path",
// "pattern": "^operations/.+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "serviceconsumermanagement.operations.get":
type OperationsGetCall struct {
s *APIService
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the latest state of a long-running operation. Clients can
// use this
// method to poll the operation result at intervals as recommended by
// the API
// service.
func (r *OperationsService) Get(name string) *OperationsGetCall {
c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OperationsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.operations.get" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
// "flatPath": "v1/operations/{operationsId}",
// "httpMethod": "GET",
// "id": "serviceconsumermanagement.operations.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The name of the operation resource.",
// "location": "path",
// "pattern": "^operations/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "serviceconsumermanagement.operations.list":
type OperationsListCall struct {
s *APIService
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists operations that match the specified filter in the
// request. If the
// server doesn't support this method, it returns
// `UNIMPLEMENTED`.
//
// NOTE: the `name` binding allows API services to override the
// binding
// to use different resource name schemes, such as `users/*/operations`.
// To
// override the binding, API services can add a binding such
// as
// "/v1/{name=users/*}/operations" to their service configuration.
// For backwards compatibility, the default name includes the
// operations
// collection id, however overriding users must ensure the name
// binding
// is the parent resource, without the operations collection id.
func (r *OperationsService) List(name string) *OperationsListCall {
c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Filter sets the optional parameter "filter": The standard list
// filter.
func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
c.urlParams_.Set("filter", filter)
return c
}
// PageSize sets the optional parameter "pageSize": The standard list
// page size.
func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": The standard list
// page token.
func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OperationsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.operations.list" call.
// Exactly one of *ListOperationsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListOperationsResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListOperationsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
// "flatPath": "v1/operations",
// "httpMethod": "GET",
// "id": "serviceconsumermanagement.operations.list",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "filter": {
// "description": "The standard list filter.",
// "location": "query",
// "type": "string"
// },
// "name": {
// "description": "The name of the operation's parent resource.",
// "location": "path",
// "pattern": "^operations$",
// "required": true,
// "type": "string"
// },
// "pageSize": {
// "description": "The standard list page size.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "The standard list page token.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "ListOperationsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "serviceconsumermanagement.services.search":
type ServicesSearchCall struct {
s *APIService
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Search: Search tenancy units for a service.
func (r *ServicesService) Search(parent string) *ServicesSearchCall {
c := &ServicesSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of results returned by this request. Currently, the
// default maximum is set to 1000. If page_size is not provided or the
// size
// provided is a number larger than 1000, it will be automatically set
// to
// 1000.
func (c *ServicesSearchCall) PageSize(pageSize int64) *ServicesSearchCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": The continuation
// token, which is used to page through large result sets.
// To get the next page of results, set this parameter to the value
// of
// `nextPageToken` from the previous response.
func (c *ServicesSearchCall) PageToken(pageToken string) *ServicesSearchCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Query sets the optional parameter "query": Set a query `{expression}`
// for querying tenancy units. Your `{expression}`
// must be in the format: `field_name=literal_string`. The `field_name`
// is the
// name of the field you want to compare. Supported fields
// are
// `tenant_resources.tag` and `tenant_resources.resource`.
//
// For example, to search tenancy units that contain at least one
// tenant
// resource with given tag 'xyz', use query
// `tenant_resources.tag=xyz`.
// To search tenancy units that contain at least one tenant resource
// with
// given resource name 'projects/123456', use
// query
// `tenant_resources.resource=projects/123456`.
//
// Multiple expressions can be joined with `AND`s. Tenancy units must
// match
// all expressions to be included in the result set. For
// example,
// `tenant_resources.tag=xyz AND
// tenant_resources.resource=projects/123456`
func (c *ServicesSearchCall) Query(query string) *ServicesSearchCall {
c.urlParams_.Set("query", query)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ServicesSearchCall) Fields(s ...googleapi.Field) *ServicesSearchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ServicesSearchCall) IfNoneMatch(entityTag string) *ServicesSearchCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ServicesSearchCall) Context(ctx context.Context) *ServicesSearchCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ServicesSearchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ServicesSearchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:search")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.services.search" call.
// Exactly one of *SearchTenancyUnitsResponse or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *SearchTenancyUnitsResponse.ServerResponse.Header or (if a response
// was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ServicesSearchCall) Do(opts ...googleapi.CallOption) (*SearchTenancyUnitsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SearchTenancyUnitsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Search tenancy units for a service.",
// "flatPath": "v1/services/{servicesId}:search",
// "httpMethod": "GET",
// "id": "serviceconsumermanagement.services.search",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "The maximum number of results returned by this request. Currently, the\ndefault maximum is set to 1000. If page_size is not provided or the size\nprovided is a number larger than 1000, it will be automatically set to\n1000.\n\nOptional.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.\n\nOptional.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Service for which search is performed.\nservices/{service}\n{service} the name of a service, for example 'service.googleapis.com'.",
// "location": "path",
// "pattern": "^services/[^/]+$",
// "required": true,
// "type": "string"
// },
// "query": {
// "description": "Set a query `{expression}` for querying tenancy units. Your `{expression}`\nmust be in the format: `field_name=literal_string`. The `field_name` is the\nname of the field you want to compare. Supported fields are\n`tenant_resources.tag` and `tenant_resources.resource`.\n\nFor example, to search tenancy units that contain at least one tenant\nresource with given tag 'xyz', use query `tenant_resources.tag=xyz`.\nTo search tenancy units that contain at least one tenant resource with\ngiven resource name 'projects/123456', use query\n`tenant_resources.resource=projects/123456`.\n\nMultiple expressions can be joined with `AND`s. Tenancy units must match\nall expressions to be included in the result set. For example,\n`tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456`\n\nOptional.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1/{+parent}:search",
// "response": {
// "$ref": "SearchTenancyUnitsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ServicesSearchCall) Pages(ctx context.Context, f func(*SearchTenancyUnitsResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "serviceconsumermanagement.services.tenancyUnits.addProject":
type ServicesTenancyUnitsAddProjectCall struct {
s *APIService
parent string
addtenantprojectrequest *AddTenantProjectRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// AddProject: Add a new tenant project to the tenancy unit.
// There can be at most 512 tenant projects in a tenancy unit.
// If there are previously failed `AddTenantProject` calls, you might
// need to
// call `RemoveTenantProject` first to clean them before you can make
// another
// `AddTenantProject` with the same tag.
// Operation<response: Empty>.
func (r *ServicesTenancyUnitsService) AddProject(parent string, addtenantprojectrequest *AddTenantProjectRequest) *ServicesTenancyUnitsAddProjectCall {
c := &ServicesTenancyUnitsAddProjectCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.addtenantprojectrequest = addtenantprojectrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ServicesTenancyUnitsAddProjectCall) Fields(s ...googleapi.Field) *ServicesTenancyUnitsAddProjectCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ServicesTenancyUnitsAddProjectCall) Context(ctx context.Context) *ServicesTenancyUnitsAddProjectCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ServicesTenancyUnitsAddProjectCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ServicesTenancyUnitsAddProjectCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.addtenantprojectrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:addProject")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.services.tenancyUnits.addProject" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServicesTenancyUnitsAddProjectCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Add a new tenant project to the tenancy unit.\nThere can be at most 512 tenant projects in a tenancy unit.\nIf there are previously failed `AddTenantProject` calls, you might need to\ncall `RemoveTenantProject` first to clean them before you can make another\n`AddTenantProject` with the same tag.\nOperation\u003cresponse: Empty\u003e.",
// "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits/{tenancyUnitsId}:addProject",
// "httpMethod": "POST",
// "id": "serviceconsumermanagement.services.tenancyUnits.addProject",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Name of the tenancy unit.",
// "location": "path",
// "pattern": "^services/[^/]+/[^/]+/[^/]+/tenancyUnits/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+parent}:addProject",
// "request": {
// "$ref": "AddTenantProjectRequest"
// },
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "serviceconsumermanagement.services.tenancyUnits.create":
type ServicesTenancyUnitsCreateCall struct {
s *APIService
parent string
createtenancyunitrequest *CreateTenancyUnitRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a tenancy unit with no tenant resources.
func (r *ServicesTenancyUnitsService) Create(parent string, createtenancyunitrequest *CreateTenancyUnitRequest) *ServicesTenancyUnitsCreateCall {
c := &ServicesTenancyUnitsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.createtenancyunitrequest = createtenancyunitrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ServicesTenancyUnitsCreateCall) Fields(s ...googleapi.Field) *ServicesTenancyUnitsCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ServicesTenancyUnitsCreateCall) Context(ctx context.Context) *ServicesTenancyUnitsCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ServicesTenancyUnitsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ServicesTenancyUnitsCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtenancyunitrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tenancyUnits")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.services.tenancyUnits.create" call.
// Exactly one of *TenancyUnit or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *TenancyUnit.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServicesTenancyUnitsCreateCall) Do(opts ...googleapi.CallOption) (*TenancyUnit, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &TenancyUnit{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a tenancy unit with no tenant resources.",
// "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits",
// "httpMethod": "POST",
// "id": "serviceconsumermanagement.services.tenancyUnits.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "services/{service}/{collection id}/{resource id}\n{collection id} is the cloud resource collection type representing the\nservice consumer, for example 'projects', or 'organizations'.\n{resource id} is the consumer numeric id, such as project number: '123456'.\n{service} the name of a service, for example 'service.googleapis.com'.\nEnabled service binding using the new tenancy unit.",
// "location": "path",
// "pattern": "^services/[^/]+/[^/]+/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+parent}/tenancyUnits",
// "request": {
// "$ref": "CreateTenancyUnitRequest"
// },
// "response": {
// "$ref": "TenancyUnit"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "serviceconsumermanagement.services.tenancyUnits.delete":
type ServicesTenancyUnitsDeleteCall struct {
s *APIService
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Delete a tenancy unit. Before the tenancy unit is deleted,
// there should be
// no tenant resources in it.
// Operation<response: Empty>.
func (r *ServicesTenancyUnitsService) Delete(name string) *ServicesTenancyUnitsDeleteCall {
c := &ServicesTenancyUnitsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ServicesTenancyUnitsDeleteCall) Fields(s ...googleapi.Field) *ServicesTenancyUnitsDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ServicesTenancyUnitsDeleteCall) Context(ctx context.Context) *ServicesTenancyUnitsDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ServicesTenancyUnitsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ServicesTenancyUnitsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.services.tenancyUnits.delete" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServicesTenancyUnitsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Delete a tenancy unit. Before the tenancy unit is deleted, there should be\nno tenant resources in it.\nOperation\u003cresponse: Empty\u003e.",
// "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits/{tenancyUnitsId}",
// "httpMethod": "DELETE",
// "id": "serviceconsumermanagement.services.tenancyUnits.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Name of the tenancy unit to be deleted.",
// "location": "path",
// "pattern": "^services/[^/]+/[^/]+/[^/]+/tenancyUnits/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "serviceconsumermanagement.services.tenancyUnits.list":
type ServicesTenancyUnitsListCall struct {
s *APIService
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Find the tenancy unit for a service and consumer.
// This method should not be used in producers' runtime path, for
// example
// finding the tenant project number when creating VMs. Producers
// should
// persist the tenant project information after the project is created.
func (r *ServicesTenancyUnitsService) List(parent string) *ServicesTenancyUnitsListCall {
c := &ServicesTenancyUnitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Filter sets the optional parameter "filter": Filter expression over
// tenancy resources field.
func (c *ServicesTenancyUnitsListCall) Filter(filter string) *ServicesTenancyUnitsListCall {
c.urlParams_.Set("filter", filter)
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of results returned by this request.
func (c *ServicesTenancyUnitsListCall) PageSize(pageSize int64) *ServicesTenancyUnitsListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": The continuation
// token, which is used to page through large result sets.
// To get the next page of results, set this parameter to the value
// of
// `nextPageToken` from the previous response.
func (c *ServicesTenancyUnitsListCall) PageToken(pageToken string) *ServicesTenancyUnitsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ServicesTenancyUnitsListCall) Fields(s ...googleapi.Field) *ServicesTenancyUnitsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ServicesTenancyUnitsListCall) IfNoneMatch(entityTag string) *ServicesTenancyUnitsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ServicesTenancyUnitsListCall) Context(ctx context.Context) *ServicesTenancyUnitsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ServicesTenancyUnitsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ServicesTenancyUnitsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tenancyUnits")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.services.tenancyUnits.list" call.
// Exactly one of *ListTenancyUnitsResponse or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *ListTenancyUnitsResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ServicesTenancyUnitsListCall) Do(opts ...googleapi.CallOption) (*ListTenancyUnitsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListTenancyUnitsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Find the tenancy unit for a service and consumer.\nThis method should not be used in producers' runtime path, for example\nfinding the tenant project number when creating VMs. Producers should\npersist the tenant project information after the project is created.",
// "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits",
// "httpMethod": "GET",
// "id": "serviceconsumermanagement.services.tenancyUnits.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "filter": {
// "description": "Filter expression over tenancy resources field. Optional.",
// "location": "query",
// "type": "string"
// },
// "pageSize": {
// "description": "The maximum number of results returned by this request.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "The continuation token, which is used to page through large result sets.\nTo get the next page of results, set this parameter to the value of\n`nextPageToken` from the previous response.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Service and consumer. Required.\nservices/{service}/{collection id}/{resource id}\n{collection id} is the cloud resource collection type representing the\nservice consumer, for example 'projects', or 'organizations'.\n{resource id} is the consumer numeric id, such as project number: '123456'.\n{service} the name of a service, for example 'service.googleapis.com'.",
// "location": "path",
// "pattern": "^services/[^/]+/[^/]+/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+parent}/tenancyUnits",
// "response": {
// "$ref": "ListTenancyUnitsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ServicesTenancyUnitsListCall) Pages(ctx context.Context, f func(*ListTenancyUnitsResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "serviceconsumermanagement.services.tenancyUnits.removeProject":
type ServicesTenancyUnitsRemoveProjectCall struct {
s *APIService
name string
removetenantprojectrequest *RemoveTenantProjectRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// RemoveProject: Removes specified project resource identified by
// tenant resource tag.
// It will remove project lien with 'TenantManager' origin if that was
// added.
// It will then attempt to delete the project.
// If that operation fails, this method fails.
// Operation<response: Empty>.
func (r *ServicesTenancyUnitsService) RemoveProject(name string, removetenantprojectrequest *RemoveTenantProjectRequest) *ServicesTenancyUnitsRemoveProjectCall {
c := &ServicesTenancyUnitsRemoveProjectCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.removetenantprojectrequest = removetenantprojectrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ServicesTenancyUnitsRemoveProjectCall) Fields(s ...googleapi.Field) *ServicesTenancyUnitsRemoveProjectCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ServicesTenancyUnitsRemoveProjectCall) Context(ctx context.Context) *ServicesTenancyUnitsRemoveProjectCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ServicesTenancyUnitsRemoveProjectCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ServicesTenancyUnitsRemoveProjectCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.removetenantprojectrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:removeProject")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "serviceconsumermanagement.services.tenancyUnits.removeProject" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServicesTenancyUnitsRemoveProjectCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Removes specified project resource identified by tenant resource tag.\nIt will remove project lien with 'TenantManager' origin if that was added.\nIt will then attempt to delete the project.\nIf that operation fails, this method fails.\nOperation\u003cresponse: Empty\u003e.",
// "flatPath": "v1/services/{servicesId}/{servicesId1}/{servicesId2}/tenancyUnits/{tenancyUnitsId}:removeProject",
// "httpMethod": "POST",
// "id": "serviceconsumermanagement.services.tenancyUnits.removeProject",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Name of the tenancy unit.\nSuch as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'.",
// "location": "path",
// "pattern": "^services/[^/]+/[^/]+/[^/]+/tenancyUnits/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}:removeProject",
// "request": {
// "$ref": "RemoveTenantProjectRequest"
// },
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
| skuid/helm-value-store | vendor/google.golang.org/api/serviceconsumermanagement/v1/serviceconsumermanagement-gen.go | GO | mit | 236,387 | [
30522,
30524,
1013,
19184,
1013,
1013,
1013,
1013,
8192,
2742,
1024,
1013,
1013,
1013,
1013,
12324,
1000,
8224,
1012,
2175,
25023,
1012,
8917,
1013,
17928,
1013,
2326,
8663,
23545,
14515,
4270,
3672,
1013,
1058,
2487,
1000,
1013,
1013,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
* Copyright (c) 2008, Nationwide Health Information Network (NHIN) Connect. All rights reserved.
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* - Neither the name of the NHIN Connect Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* END OF TERMS AND CONDITIONS
*/
package gov.hhs.fha.nhinc.common.dda;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for GetDetailDataForUserRequestType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="GetDetailDataForUserRequestType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="userId" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="dataSource" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="itemId" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GetDetailDataForUserRequestType", propOrder = {
"userId",
"dataSource",
"itemId"
})
public class GetDetailDataForUserRequestType {
@XmlElement(required = true)
protected String userId;
@XmlElement(required = true)
protected String dataSource;
@XmlElement(required = true)
protected String itemId;
/**
* Gets the value of the userId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUserId() {
return userId;
}
/**
* Sets the value of the userId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUserId(String value) {
this.userId = value;
}
/**
* Gets the value of the dataSource property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDataSource() {
return dataSource;
}
/**
* Sets the value of the dataSource property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDataSource(String value) {
this.dataSource = value;
}
/**
* Gets the value of the itemId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getItemId() {
return itemId;
}
/**
* Sets the value of the itemId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setItemId(String value) {
this.itemId = value;
}
}
| TATRC/KMR2 | Services/Common/XDSCommonLib/src/main/java/gov/hhs/fha/nhinc/common/dda/GetDetailDataForUserRequestType.java | Java | bsd-3-clause | 4,397 | [
30522,
1013,
1008,
1008,
3408,
1998,
3785,
2005,
2224,
1010,
14627,
1010,
1998,
4353,
1008,
9385,
1006,
1039,
1007,
2263,
1010,
9053,
2740,
2592,
2897,
1006,
18699,
2378,
1007,
7532,
1012,
2035,
2916,
9235,
1012,
1008,
25707,
1998,
2224,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
layout: post
title: ! 'The Universal Second Language: Why Everyone Should Learn Coding'
category: Translation
tags: whycoding learn
keywords: whycoding learn
description: 本文翻译自在线远程教育网站sololearn,阐述了编程思想在这个时代的重要性。我们来分享这么几个理由,让你花费数分钟去思考编程与了解它是如何在工作中甚至是在你的工作之余所产生的积极影响。
---
## The Universal Second Language: Why Everyone Should Learn Coding
## 宇宙的第二语言:为什么每个人都应该学习写代码

>译者注:在阅读本文之前需要提示的是写代码与编程是不同的概念,编程是一个更为广义的概念,意为:为解决一个问题而去创造出抽象化的解决方案。
A couple of years ago, when someone asked why he or she should learn programming, the answer was simple: To get a good job with a high salary.
几年前,当有人问到为什么他(她)该学习编程,答案是简单的,为了找一份高薪的工作。
During the 21st century, coding has become a core job skill. Computer skills are now essential, even if you’ve already got a non-technical job.
在21世纪期间,编程已经变成一个工作中的核心技能。电脑知识已经变得至关重要,既是你的工作和电脑技术无关。
In this post, we'd like to share just a few reasons to consider taking a few minutes of your time to explore the positive effects knowing how to code can have on your career - and on your life outside of work, as well.
在本文当中,我们来分享这么几个理由,让你花费数分钟去思考编程与了解它是如何在工作中甚至是在你的工作之余所产生的积极影响。
Gaining programming and coding skills will qualify you for dozens of new job opportunities, but besides that, it will enable you to...
获得编程和写代码的能力将会使你有资格获得更多工作机会但除此之外,它还会让你......
######...Improve Problem-Solving Skills
#####...提升你解决问题的能力
Even if you never become a professional software developer, you will benefit from knowing how to consider questions or issues as a coder would. You'll have the ability to understand and master technologies of all sorts and solve problems in almost any discipline.
尽管你从未成为过一个专业的软件开发者,你将会从如何像程序员一样去考虑一个问题或者事情中受益。你将会有能力在各个方面去理解并科学地规划事情、解决问题。
######...Change Your Way of Thinking
#####...改变你思考的方式
Steve Jobs once said, "Everybody in this country should learn how to program a computer, because it teaches you how to think."
Programming is a component of computer science, which helps in the development of critical thinking skills. Having such skills is extremely useful when the need for processing and presenting information and thinking analytically arises.
乔布斯曾经说过,"在这个国家,每个人都应该学习如何去编程,因为它教会你如何去思考"。
编程是计算机科学的一部分,它有助于锻炼缜密的思维能力。
有这样的技能是非常有用的尤其是当处理和展示信息与具有分析性地思考(逻辑思考)的需求产生的时候。
######...Create or Change Things
#####...创造和改变事物
The act of programming almost feels like you're "acting God-like"! In other words, you're creating your own world, complete with all of the features you want. You can turn the blank text file into a working program, with nothing to limit you but your imagination. Doesn’t that sound completely amazing?
当你在编程的时候你甚至会觉得自己像神一样!换言之,你在创造一个属于你自己的世界,并为此完成所有你需要的功能。你可以把一个空文本文件变成一个可工作的程序,除了你的想象力以外没有任何东西可以限制你,这难道不是一件听起来完完全全令你觉得惊讶的事情吗?
It's also great fun to see someone using your creation. Your ability to improve your life and the lives of your friends and family is limited only by your ideas once you can take full control of your computer.
让别人看到你的创造成果是非常有趣的一件事情,你用你的能力去改变你的生活,并且,你的朋友,家庭的生活亦因此而被你的创造所影响,然而这一切仅发生在你的电脑前。
######...Stay Competitive
#####...保持竞争力
Whether you want to give your career a boost, or you just think it's important to keep pace with the rest of the world, learning to code has never been more important or more accessible.
无论你是否想让你的事业获得帮助,或者你只是想平静地要一份稳定生活并遣度余生,学习写代码已经变得如此重要,面向大众。
Today's world is full of web services, and being familiar with computer science will help you stay competitive in the fast-growing digital economy.
在满是Web服务应用的今天,熟悉计算机科学将会帮助你在快速增长的数字化经济中保持竞争力。
Programming hasn't grown this popular "just because". There is a growing realization that knowing how to program is essential for everyone, and especially for the younger generation.
编程从来没有发展得如此想当然地受大众欢迎。越来越多的人意识到编程对每个人都是至关重要的,尤其是对于年轻的一代来说。
Early in 2015, President Obama asserted that making computer programming education a requirement in the public schools makes sense, and went on to further endorse the idea:
2015年的早些时候,总统奥巴马就宣称编程教学如同识字一样,应成为基础教育的一部分,并进一步说到:
Learning computer skills will change the way we do just about everything. Don't just buy a new video game, make one. Don't just download the latest app, help design it. No one is born a computer scientist, but with a little hard work, just about anyone can become one. And don’t let anyone tell you that you can’t.
学习电脑技能将会改变我们做任何事的方式。我们能做的不只是购买一个新的电子游戏,而是做一个,不只是下载一个最新的应用,而是帮助并改进、设计它。没人是天生的计算机科学家,但是通过稍微的努力,每个人都将成为可能。切勿听旁人说你不能实现自己的目标。
The idea that everyone should learn coding, which is widely regarded as the new universal second language, is not about creating a nation of coders who will create the next Twitter or Facebook. It's about tapping into everyone’s creativity and developing the invaluable skill of being able to solve problems.
每个人都应该学习编程,它是公认的宇宙里新兴的第二语言,这并不是说,创造一个每个人都会创造出下一个Twitter或者Facebook的编程帝国. 这是在说,每个人的创造力与它培养出具有无可估量的价值的解决问题的技能
Even if you have no plans to become a software engineer, spend a few weeks or months learning to code. It will sharpen your ability to troubleshoot and solve all sorts of problems.
尽管你并不打算去称为一个软件工程师,花费数周或者数个月去学习写代码。它(适量学习写代码学习编程掌握编程思想)会提高你排错和解决所有问题的能力。
原文地址:[The Universal Second Language: Why Everyone Should Learn Coding](http://www.sololearn.com/Blog/15/the-universal-second-language-why-everyone-should-learn-coding/) ---From: Sololearn Translated by : Chrisheng | cygmris/cygmris.github.io | _posts/translation/2015-08-27-the_universal_second_language_why_everyone_should_learn_coding.md | Markdown | mit | 7,764 | [
30522,
1011,
1011,
1011,
9621,
1024,
2695,
2516,
1024,
999,
1005,
1996,
5415,
2117,
2653,
1024,
2339,
3071,
2323,
4553,
16861,
1005,
4696,
1024,
5449,
22073,
1024,
2339,
3597,
4667,
4553,
3145,
22104,
1024,
2339,
3597,
4667,
4553,
6412,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# 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.
# ==============================================================================
"""Tests for supervisor.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import os
import shutil
import time
import uuid
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
from tensorflow.core.protobuf import meta_graph_pb2
from tensorflow.python.framework import meta_graph
def _summary_iterator(test_dir):
"""Reads events from test_dir/events.
Args:
test_dir: Name of the test directory.
Returns:
A summary_iterator
"""
event_paths = sorted(glob.glob(os.path.join(test_dir, "event*")))
return tf.train.summary_iterator(event_paths[-1])
def _test_dir(test_name):
test_dir = os.path.join(tf.test.get_temp_dir(), test_name)
if os.path.exists(test_dir):
shutil.rmtree(test_dir)
return test_dir
class SupervisorTest(tf.test.TestCase):
def _wait_for_glob(self, pattern, timeout_secs, for_checkpoint=True):
"""Wait for a checkpoint file to appear.
Args:
pattern: A string.
timeout_secs: How long to wait for in seconds.
for_checkpoint: whether we're globbing for checkpoints.
"""
end_time = time.time() + timeout_secs
while time.time() < end_time:
if for_checkpoint:
if tf.train.checkpoint_exists(pattern):
return
else:
if len(tf.gfile.Glob(pattern)) >= 1:
return
time.sleep(0.05)
self.assertFalse(True, "Glob never matched any file: %s" % pattern)
# This test does not test much.
def testBasics(self):
logdir = _test_dir("basics")
with tf.Graph().as_default():
my_op = tf.constant(1.0)
sv = tf.train.Supervisor(logdir=logdir)
sess = sv.prepare_or_wait_for_session("")
for _ in xrange(10):
sess.run(my_op)
sess.close()
sv.stop()
def testManagedSession(self):
logdir = _test_dir("managed_session")
with tf.Graph().as_default():
my_op = tf.constant(1.0)
sv = tf.train.Supervisor(logdir=logdir)
with sv.managed_session("") as sess:
for _ in xrange(10):
sess.run(my_op)
# Supervisor has been stopped.
self.assertTrue(sv.should_stop())
def testManagedSessionUserError(self):
logdir = _test_dir("managed_user_error")
with tf.Graph().as_default():
my_op = tf.constant(1.0)
sv = tf.train.Supervisor(logdir=logdir)
last_step = None
with self.assertRaisesRegexp(RuntimeError, "failing here"):
with sv.managed_session("") as sess:
for step in xrange(10):
last_step = step
if step == 1:
raise RuntimeError("failing here")
else:
sess.run(my_op)
# Supervisor has been stopped.
self.assertTrue(sv.should_stop())
self.assertEqual(1, last_step)
def testManagedSessionIgnoreOutOfRangeError(self):
logdir = _test_dir("managed_out_of_range")
with tf.Graph().as_default():
my_op = tf.constant(1.0)
sv = tf.train.Supervisor(logdir=logdir)
last_step = None
with sv.managed_session("") as sess:
for step in xrange(10):
last_step = step
if step == 3:
raise tf.errors.OutOfRangeError(my_op.op.node_def, my_op.op,
"all done")
else:
sess.run(my_op)
# Supervisor has been stopped. OutOfRangeError was not thrown.
self.assertTrue(sv.should_stop())
self.assertEqual(3, last_step)
def testManagedSessionDoNotKeepSummaryWriter(self):
logdir = _test_dir("managed_not_keep_summary_writer")
with tf.Graph().as_default():
tf.summary.scalar("c1", tf.constant(1))
tf.summary.scalar("c2", tf.constant(2))
tf.summary.scalar("c3", tf.constant(3))
summ = tf.summary.merge_all()
sv = tf.train.Supervisor(logdir=logdir, summary_op=None)
with sv.managed_session("", close_summary_writer=True,
start_standard_services=False) as sess:
sv.summary_computed(sess, sess.run(summ))
# Sleep 1.2s to make sure that the next event file has a different name
# than the current one.
time.sleep(1.2)
with sv.managed_session("", close_summary_writer=True,
start_standard_services=False) as sess:
sv.summary_computed(sess, sess.run(summ))
event_paths = sorted(glob.glob(os.path.join(logdir, "event*")))
self.assertEquals(2, len(event_paths))
# The two event files should have the same contents.
for path in event_paths:
# The summary iterator should report the summary once as we closed the
# summary writer across the 2 sessions.
rr = tf.train.summary_iterator(path)
# The first event should list the file_version.
ev = next(rr)
self.assertEquals("brain.Event:2", ev.file_version)
# The next one has the graph and metagraph.
ev = next(rr)
self.assertTrue(ev.graph_def)
ev = next(rr)
self.assertTrue(ev.meta_graph_def)
# The next one should have the values from the summary.
# But only once.
ev = next(rr)
self.assertProtoEquals("""
value { tag: 'c1' simple_value: 1.0 }
value { tag: 'c2' simple_value: 2.0 }
value { tag: 'c3' simple_value: 3.0 }
""", ev.summary)
# The next one should be a stop message if we closed cleanly.
ev = next(rr)
self.assertEquals(tf.SessionLog.STOP, ev.session_log.status)
# We should be done.
with self.assertRaises(StopIteration):
next(rr)
def testManagedSessionKeepSummaryWriter(self):
logdir = _test_dir("managed_keep_summary_writer")
with tf.Graph().as_default():
tf.summary.scalar("c1", tf.constant(1))
tf.summary.scalar("c2", tf.constant(2))
tf.summary.scalar("c3", tf.constant(3))
summ = tf.summary.merge_all()
sv = tf.train.Supervisor(logdir=logdir)
with sv.managed_session("", close_summary_writer=False,
start_standard_services=False) as sess:
sv.summary_computed(sess, sess.run(summ))
with sv.managed_session("", close_summary_writer=False,
start_standard_services=False) as sess:
sv.summary_computed(sess, sess.run(summ))
# Now close the summary writer to flush the events.
sv.summary_writer.close()
# The summary iterator should report the summary twice as we reused
# the same summary writer across the 2 sessions.
rr = _summary_iterator(logdir)
# The first event should list the file_version.
ev = next(rr)
self.assertEquals("brain.Event:2", ev.file_version)
# The next one has the graph.
ev = next(rr)
self.assertTrue(ev.graph_def)
ev = next(rr)
self.assertTrue(ev.meta_graph_def)
# The next one should have the values from the summary.
ev = next(rr)
self.assertProtoEquals("""
value { tag: 'c1' simple_value: 1.0 }
value { tag: 'c2' simple_value: 2.0 }
value { tag: 'c3' simple_value: 3.0 }
""", ev.summary)
# The next one should also have the values from the summary.
ev = next(rr)
self.assertProtoEquals("""
value { tag: 'c1' simple_value: 1.0 }
value { tag: 'c2' simple_value: 2.0 }
value { tag: 'c3' simple_value: 3.0 }
""", ev.summary)
# We should be done.
self.assertRaises(StopIteration, lambda: next(rr))
def _csv_data(self, logdir):
# Create a small data file with 3 CSV records.
data_path = os.path.join(logdir, "data.csv")
with open(data_path, "w") as f:
f.write("1,2,3\n")
f.write("4,5,6\n")
f.write("7,8,9\n")
return data_path
def testManagedEndOfInputOneQueue(self):
# Tests that the supervisor finishes without an error when using
# a fixed number of epochs, reading from a single queue.
logdir = _test_dir("managed_end_of_input_one_queue")
os.makedirs(logdir)
data_path = self._csv_data(logdir)
with tf.Graph().as_default():
# Create an input pipeline that reads the file 3 times.
filename_queue = tf.train.string_input_producer([data_path], num_epochs=3)
reader = tf.TextLineReader()
_, csv = reader.read(filename_queue)
rec = tf.decode_csv(csv, record_defaults=[[1], [1], [1]])
sv = tf.train.Supervisor(logdir=logdir)
with sv.managed_session("") as sess:
while not sv.should_stop():
sess.run(rec)
def testManagedEndOfInputTwoQueues(self):
# Tests that the supervisor finishes without an error when using
# a fixed number of epochs, reading from two queues, the second
# one producing a batch from the first one.
logdir = _test_dir("managed_end_of_input_two_queues")
os.makedirs(logdir)
data_path = self._csv_data(logdir)
with tf.Graph().as_default():
# Create an input pipeline that reads the file 3 times.
filename_queue = tf.train.string_input_producer([data_path], num_epochs=3)
reader = tf.TextLineReader()
_, csv = reader.read(filename_queue)
rec = tf.decode_csv(csv, record_defaults=[[1], [1], [1]])
shuff_rec = tf.train.shuffle_batch(rec, 1, 6, 4)
sv = tf.train.Supervisor(logdir=logdir)
with sv.managed_session("") as sess:
while not sv.should_stop():
sess.run(shuff_rec)
def testManagedMainErrorTwoQueues(self):
# Tests that the supervisor correctly raises a main loop
# error even when using multiple queues for input.
logdir = _test_dir("managed_main_error_two_queues")
os.makedirs(logdir)
data_path = self._csv_data(logdir)
with self.assertRaisesRegexp(RuntimeError, "fail at step 3"):
with tf.Graph().as_default():
# Create an input pipeline that reads the file 3 times.
filename_queue = tf.train.string_input_producer([data_path],
num_epochs=3)
reader = tf.TextLineReader()
_, csv = reader.read(filename_queue)
rec = tf.decode_csv(csv, record_defaults=[[1], [1], [1]])
shuff_rec = tf.train.shuffle_batch(rec, 1, 6, 4)
sv = tf.train.Supervisor(logdir=logdir)
with sv.managed_session("") as sess:
for step in range(9):
if sv.should_stop():
break
elif step == 3:
raise RuntimeError("fail at step 3")
else:
sess.run(shuff_rec)
def testSessionConfig(self):
logdir = _test_dir("session_config")
with tf.Graph().as_default():
with tf.device("/cpu:1"):
my_op = tf.constant([1.0])
sv = tf.train.Supervisor(logdir=logdir)
sess = sv.prepare_or_wait_for_session(
"", config=tf.ConfigProto(device_count={"CPU": 2}))
for _ in xrange(10):
sess.run(my_op)
sess.close()
sv.stop()
def testChiefCanWriteEvents(self):
logdir = _test_dir("can_write")
with tf.Graph().as_default():
tf.summary.scalar("c1", tf.constant(1))
tf.summary.scalar("c2", tf.constant(2))
tf.summary.scalar("c3", tf.constant(3))
summ = tf.summary.merge_all()
sv = tf.train.Supervisor(is_chief=True, logdir=logdir, summary_op=None)
meta_graph_def = meta_graph.create_meta_graph_def()
sess = sv.prepare_or_wait_for_session("")
sv.summary_computed(sess, sess.run(summ))
sess.close()
# Wait to make sure everything is written to file before stopping.
time.sleep(1)
sv.stop()
rr = _summary_iterator(logdir)
# The first event should list the file_version.
ev = next(rr)
self.assertEquals("brain.Event:2", ev.file_version)
# The next one has the graph.
ev = next(rr)
ev_graph = tf.GraphDef()
ev_graph.ParseFromString(ev.graph_def)
self.assertProtoEquals(sess.graph.as_graph_def(add_shapes=True), ev_graph)
# Stored MetaGraphDef
ev = next(rr)
ev_meta_graph = meta_graph_pb2.MetaGraphDef()
ev_meta_graph.ParseFromString(ev.meta_graph_def)
self.assertProtoEquals(meta_graph_def, ev_meta_graph)
self.assertProtoEquals(
sess.graph.as_graph_def(add_shapes=True), ev_meta_graph.graph_def)
# The next one should have the values from the summary.
ev = next(rr)
self.assertProtoEquals("""
value { tag: 'c1' simple_value: 1.0 }
value { tag: 'c2' simple_value: 2.0 }
value { tag: 'c3' simple_value: 3.0 }
""", ev.summary)
# The next one should be a stop message if we closed cleanly.
ev = next(rr)
self.assertEquals(tf.SessionLog.STOP, ev.session_log.status)
# We should be done.
self.assertRaises(StopIteration, lambda: next(rr))
def testNonChiefCannotWriteEvents(self):
def _summary_computed():
with tf.Graph().as_default():
sv = tf.train.Supervisor(is_chief=False)
sess = sv.prepare_or_wait_for_session("")
tf.summary.scalar("c1", tf.constant(1))
tf.summary.scalar("c2", tf.constant(2))
summ = tf.summary.merge_all()
sv.summary_computed(sess, sess.run(summ))
def _start_standard_services():
with tf.Graph().as_default():
sv = tf.train.Supervisor(is_chief=False)
sess = sv.prepare_or_wait_for_session("")
sv.start_standard_services(sess)
self.assertRaises(RuntimeError, _summary_computed)
self.assertRaises(RuntimeError, _start_standard_services)
def testNoLogdirButWantSummary(self):
with tf.Graph().as_default():
tf.summary.scalar("c1", tf.constant(1))
tf.summary.scalar("c2", tf.constant(2))
tf.summary.scalar("c3", tf.constant(3))
summ = tf.summary.merge_all()
sv = tf.train.Supervisor(logdir="", summary_op=None)
sess = sv.prepare_or_wait_for_session("")
with self.assertRaisesRegexp(RuntimeError, "requires a summary writer"):
sv.summary_computed(sess, sess.run(summ))
def testLogdirButExplicitlyNoSummaryWriter(self):
logdir = _test_dir("explicit_no_summary_writer")
with tf.Graph().as_default():
tf.Variable([1.0], name="foo")
tf.summary.scalar("c1", tf.constant(1))
tf.summary.scalar("c2", tf.constant(2))
tf.summary.scalar("c3", tf.constant(3))
summ = tf.summary.merge_all()
sv = tf.train.Supervisor(logdir=logdir, summary_writer=None)
sess = sv.prepare_or_wait_for_session("")
# Check that a checkpoint is still be generated.
self._wait_for_glob(sv.save_path, 3.0)
# Check that we cannot write a summary
with self.assertRaisesRegexp(RuntimeError, "requires a summary writer"):
sv.summary_computed(sess, sess.run(summ))
def testNoLogdirButExplicitSummaryWriter(self):
logdir = _test_dir("explicit_summary_writer")
with tf.Graph().as_default():
tf.summary.scalar("c1", tf.constant(1))
tf.summary.scalar("c2", tf.constant(2))
tf.summary.scalar("c3", tf.constant(3))
summ = tf.summary.merge_all()
sw = tf.train.SummaryWriter(logdir)
sv = tf.train.Supervisor(logdir="", summary_op=None, summary_writer=sw)
meta_graph_def = meta_graph.create_meta_graph_def()
sess = sv.prepare_or_wait_for_session("")
sv.summary_computed(sess, sess.run(summ))
sess.close()
# Wait to make sure everything is written to file before stopping.
time.sleep(1)
sv.stop()
# Check the summary was written to 'logdir'
rr = _summary_iterator(logdir)
# The first event should list the file_version.
ev = next(rr)
self.assertEquals("brain.Event:2", ev.file_version)
# The next one has the graph.
ev = next(rr)
ev_graph = tf.GraphDef()
ev_graph.ParseFromString(ev.graph_def)
self.assertProtoEquals(sess.graph.as_graph_def(add_shapes=True), ev_graph)
# Stored MetaGraphDef
ev = next(rr)
ev_meta_graph = meta_graph_pb2.MetaGraphDef()
ev_meta_graph.ParseFromString(ev.meta_graph_def)
self.assertProtoEquals(meta_graph_def, ev_meta_graph)
self.assertProtoEquals(
sess.graph.as_graph_def(add_shapes=True), ev_meta_graph.graph_def)
# The next one should have the values from the summary.
ev = next(rr)
self.assertProtoEquals("""
value { tag: 'c1' simple_value: 1.0 }
value { tag: 'c2' simple_value: 2.0 }
value { tag: 'c3' simple_value: 3.0 }
""", ev.summary)
# The next one should be a stop message if we closed cleanly.
ev = next(rr)
self.assertEquals(tf.SessionLog.STOP, ev.session_log.status)
# We should be done.
self.assertRaises(StopIteration, lambda: next(rr))
def testNoLogdirSucceeds(self):
with tf.Graph().as_default():
tf.Variable([1.0, 2.0, 3.0])
sv = tf.train.Supervisor(logdir="", summary_op=None)
sess = sv.prepare_or_wait_for_session("")
sess.close()
sv.stop()
def testUseSessionManager(self):
with tf.Graph().as_default():
tf.Variable([1.0, 2.0, 3.0])
sm = tf.train.SessionManager()
# Pass in session_manager. The additional init_op is ignored.
sv = tf.train.Supervisor(logdir="", session_manager=sm)
sv.prepare_or_wait_for_session("")
def testInitOp(self):
logdir = _test_dir("default_init_op")
with tf.Graph().as_default():
v = tf.Variable([1.0, 2.0, 3.0])
sv = tf.train.Supervisor(logdir=logdir)
sess = sv.prepare_or_wait_for_session("")
self.assertAllClose([1.0, 2.0, 3.0], sess.run(v))
sv.stop()
def testInitFn(self):
logdir = _test_dir("default_init_op")
with tf.Graph().as_default():
v = tf.Variable([1.0, 2.0, 3.0])
def _init_fn(sess):
sess.run(v.initializer)
sv = tf.train.Supervisor(logdir=logdir, init_op=None, init_fn=_init_fn)
sess = sv.prepare_or_wait_for_session("")
self.assertAllClose([1.0, 2.0, 3.0], sess.run(v))
sv.stop()
def testInitOpWithFeedDict(self):
logdir = _test_dir("feed_dict_init_op")
with tf.Graph().as_default():
p = tf.placeholder(tf.float32, shape=(3,))
v = tf.Variable(p, name="v")
sv = tf.train.Supervisor(logdir=logdir,
init_op=tf.initialize_all_variables(),
init_feed_dict={p: [1.0, 2.0, 3.0]})
sess = sv.prepare_or_wait_for_session("")
self.assertAllClose([1.0, 2.0, 3.0], sess.run(v))
sv.stop()
def testReadyForLocalInitOp(self):
server = tf.train.Server.create_local_server()
logdir = _test_dir("default_ready_for_local_init_op")
uid = uuid.uuid4().hex
def get_session(is_chief):
g = tf.Graph()
with g.as_default():
with tf.device("/job:local"):
v = tf.Variable(
1, name="default_ready_for_local_init_op_v_" + str(uid))
vadd = v.assign_add(1)
w = tf.Variable(
v,
trainable=False,
collections=[tf.GraphKeys.LOCAL_VARIABLES],
name="default_ready_for_local_init_op_w_" + str(uid))
ready_for_local_init_op = tf.report_uninitialized_variables(
tf.all_variables())
sv = tf.train.Supervisor(
logdir=logdir,
is_chief=is_chief,
graph=g,
recovery_wait_secs=1,
init_op=v.initializer,
ready_for_local_init_op=ready_for_local_init_op)
sess = sv.prepare_or_wait_for_session(server.target)
return sv, sess, v, vadd, w
sv0, sess0, v0, _, w0 = get_session(True)
sv1, sess1, _, vadd1, w1 = get_session(False)
self.assertEqual(1, sess0.run(w0))
self.assertEqual(2, sess1.run(vadd1))
self.assertEqual(1, sess1.run(w1))
self.assertEqual(2, sess0.run(v0))
sv0.stop()
sv1.stop()
def testReadyForLocalInitOpRestoreFromCheckpoint(self):
server = tf.train.Server.create_local_server()
logdir = _test_dir("ready_for_local_init_op_restore")
uid = uuid.uuid4().hex
# Create a checkpoint.
with tf.Graph().as_default():
v = tf.Variable(
10.0, name="ready_for_local_init_op_restore_v_" + str(uid))
tf.summary.scalar("ready_for_local_init_op_restore_v_" + str(uid), v)
sv = tf.train.Supervisor(logdir=logdir)
sv.prepare_or_wait_for_session(server.target)
save_path = sv.save_path
self._wait_for_glob(save_path, 3.0)
self._wait_for_glob(
os.path.join(logdir, "*events*"), 3.0, for_checkpoint=False)
# Wait to make sure everything is written to file before stopping.
time.sleep(1)
sv.stop()
def get_session(is_chief):
g = tf.Graph()
with g.as_default():
with tf.device("/job:local"):
v = tf.Variable(
1.0, name="ready_for_local_init_op_restore_v_" + str(uid))
vadd = v.assign_add(1)
w = tf.Variable(
v,
trainable=False,
collections=[tf.GraphKeys.LOCAL_VARIABLES],
name="ready_for_local_init_op_restore_w_" + str(uid))
ready_for_local_init_op = tf.report_uninitialized_variables(
tf.all_variables())
sv = tf.train.Supervisor(
logdir=logdir,
is_chief=is_chief,
graph=g,
recovery_wait_secs=1,
ready_for_local_init_op=ready_for_local_init_op)
sess = sv.prepare_or_wait_for_session(server.target)
return sv, sess, v, vadd, w
sv0, sess0, v0, _, w0 = get_session(True)
sv1, sess1, _, vadd1, w1 = get_session(False)
self.assertEqual(10, sess0.run(w0))
self.assertEqual(11, sess1.run(vadd1))
self.assertEqual(10, sess1.run(w1))
self.assertEqual(11, sess0.run(v0))
sv0.stop()
sv1.stop()
def testLocalInitOp(self):
logdir = _test_dir("default_local_init_op")
with tf.Graph().as_default():
# A local variable.
v = tf.Variable([1.0, 2.0, 3.0],
trainable=False,
collections=[tf.GraphKeys.LOCAL_VARIABLES])
# An entity which is initialized through a TABLE_INITIALIZER.
w = tf.Variable([4, 5, 6], trainable=False, collections=[])
tf.add_to_collection(tf.GraphKeys.TABLE_INITIALIZERS, w.initializer)
# This shouldn't add a variable to the VARIABLES collection responsible
# for variables that are saved/restored from checkpoints.
self.assertEquals(len(tf.all_variables()), 0)
# Suppress normal variable inits to make sure the local one is
# initialized via local_init_op.
sv = tf.train.Supervisor(logdir=logdir, init_op=None)
sess = sv.prepare_or_wait_for_session("")
self.assertAllClose([1.0, 2.0, 3.0], sess.run(v))
self.assertAllClose([4, 5, 6], sess.run(w))
sv.stop()
def testLocalInitOpForNonChief(self):
logdir = _test_dir("default_local_init_op_non_chief")
with tf.Graph().as_default():
with tf.device("/job:localhost"):
# A local variable.
v = tf.Variable([1.0, 2.0, 3.0],
trainable=False,
collections=[tf.GraphKeys.LOCAL_VARIABLES])
# This shouldn't add a variable to the VARIABLES collection responsible
# for variables that are saved/restored from checkpoints.
self.assertEquals(len(tf.all_variables()), 0)
# Suppress normal variable inits to make sure the local one is
# initialized via local_init_op.
sv = tf.train.Supervisor(logdir=logdir, init_op=None, is_chief=False)
sess = sv.prepare_or_wait_for_session("")
self.assertAllClose([1.0, 2.0, 3.0], sess.run(v))
sv.stop()
def testInitOpFails(self):
server = tf.train.Server.create_local_server()
logdir = _test_dir("default_init_op_fails")
with tf.Graph().as_default():
v = tf.Variable([1.0, 2.0, 3.0], name="v")
tf.Variable([4.0, 5.0, 6.0], name="w")
# w will not be initialized.
sv = tf.train.Supervisor(logdir=logdir, init_op=v.initializer)
with self.assertRaisesRegexp(RuntimeError,
"Variables not initialized: w"):
sv.prepare_or_wait_for_session(server.target)
def testInitOpFailsForTransientVariable(self):
server = tf.train.Server.create_local_server()
logdir = _test_dir("default_init_op_fails_for_local_variable")
with tf.Graph().as_default():
v = tf.Variable([1.0, 2.0, 3.0], name="v",
collections=[tf.GraphKeys.LOCAL_VARIABLES])
tf.Variable([1.0, 2.0, 3.0], name="w",
collections=[tf.GraphKeys.LOCAL_VARIABLES])
# w will not be initialized.
sv = tf.train.Supervisor(logdir=logdir, local_init_op=v.initializer)
with self.assertRaisesRegexp(
RuntimeError, "Variables not initialized: w"):
sv.prepare_or_wait_for_session(server.target)
def testSetupFail(self):
logdir = _test_dir("setup_fail")
with tf.Graph().as_default():
tf.Variable([1.0, 2.0, 3.0], name="v")
with self.assertRaisesRegexp(ValueError, "must have their device set"):
tf.train.Supervisor(logdir=logdir, is_chief=False)
with tf.Graph().as_default(), tf.device("/job:ps"):
tf.Variable([1.0, 2.0, 3.0], name="v")
tf.train.Supervisor(logdir=logdir, is_chief=False)
def testDefaultGlobalStep(self):
logdir = _test_dir("default_global_step")
with tf.Graph().as_default():
tf.Variable(287, name="global_step")
sv = tf.train.Supervisor(logdir=logdir)
sess = sv.prepare_or_wait_for_session("")
self.assertEquals(287, sess.run(sv.global_step))
sv.stop()
def testRestoreFromMetaGraph(self):
logdir = _test_dir("restore_from_meta_graph")
with tf.Graph().as_default():
tf.Variable(1, name="v0")
sv = tf.train.Supervisor(logdir=logdir)
sess = sv.prepare_or_wait_for_session("")
filename = sv.saver.save(sess, sv.save_path)
sv.stop()
# Create a new Graph and Supervisor and recover.
with tf.Graph().as_default():
new_saver = tf.train.import_meta_graph(".".join([filename, "meta"]))
self.assertIsNotNone(new_saver)
sv2 = tf.train.Supervisor(logdir=logdir, saver=new_saver)
sess = sv2.prepare_or_wait_for_session("")
self.assertEquals(1, sess.run("v0:0"))
sv2.saver.save(sess, sv2.save_path)
sv2.stop()
# This test is based on the fact that the standard services start
# right away and get to run once before sv.stop() returns.
# We still sleep a bit to make the test robust.
def testStandardServicesWithoutGlobalStep(self):
logdir = _test_dir("standard_services_without_global_step")
# Create a checkpoint.
with tf.Graph().as_default():
v = tf.Variable([1.0], name="foo")
tf.summary.scalar("v", v[0])
sv = tf.train.Supervisor(logdir=logdir)
meta_graph_def = meta_graph.create_meta_graph_def(
saver_def=sv.saver.saver_def)
sess = sv.prepare_or_wait_for_session("")
save_path = sv.save_path
self._wait_for_glob(save_path, 3.0)
self._wait_for_glob(
os.path.join(logdir, "*events*"), 3.0, for_checkpoint=False)
# Wait to make sure everything is written to file before stopping.
time.sleep(1)
sv.stop()
# There should be an event file with a version number.
rr = _summary_iterator(logdir)
ev = next(rr)
self.assertEquals("brain.Event:2", ev.file_version)
ev = next(rr)
ev_graph = tf.GraphDef()
ev_graph.ParseFromString(ev.graph_def)
self.assertProtoEquals(sess.graph.as_graph_def(add_shapes=True), ev_graph)
# Stored MetaGraphDef
ev = next(rr)
ev_meta_graph = meta_graph_pb2.MetaGraphDef()
ev_meta_graph.ParseFromString(ev.meta_graph_def)
self.assertProtoEquals(meta_graph_def, ev_meta_graph)
self.assertProtoEquals(
sess.graph.as_graph_def(add_shapes=True), ev_meta_graph.graph_def)
ev = next(rr)
self.assertProtoEquals("value { tag: 'v' simple_value: 1.0 }", ev.summary)
ev = next(rr)
self.assertEquals(tf.SessionLog.STOP, ev.session_log.status)
self.assertRaises(StopIteration, lambda: next(rr))
# There should be a checkpoint file with the variable "foo"
with tf.Graph().as_default(), self.test_session() as sess:
v = tf.Variable([10.10], name="foo")
sav = tf.train.Saver([v])
sav.restore(sess, save_path)
self.assertEqual(1.0, v.eval()[0])
# Same as testStandardServicesNoGlobalStep but with a global step.
# We should get a summary about the step time.
def testStandardServicesWithGlobalStep(self):
logdir = _test_dir("standard_services_with_global_step")
# Create a checkpoint.
with tf.Graph().as_default():
v = tf.Variable([123], name="global_step")
sv = tf.train.Supervisor(logdir=logdir)
meta_graph_def = meta_graph.create_meta_graph_def(
saver_def=sv.saver.saver_def)
sess = sv.prepare_or_wait_for_session("")
# This is where the checkpoint will appear, with step number 123.
save_path = "%s-123" % sv.save_path
self._wait_for_glob(save_path, 3.0)
self._wait_for_glob(
os.path.join(logdir, "*events*"), 3.0, for_checkpoint=False)
# Wait to make sure everything is written to file before stopping.
time.sleep(1)
sv.stop()
# There should be an event file with a version number.
rr = _summary_iterator(logdir)
ev = next(rr)
self.assertEquals("brain.Event:2", ev.file_version)
ev = next(rr)
ev_graph = tf.GraphDef()
ev_graph.ParseFromString(ev.graph_def)
self.assertProtoEquals(sess.graph.as_graph_def(add_shapes=True), ev_graph)
ev = next(rr)
ev_meta_graph = meta_graph_pb2.MetaGraphDef()
ev_meta_graph.ParseFromString(ev.meta_graph_def)
self.assertProtoEquals(meta_graph_def, ev_meta_graph)
self.assertProtoEquals(
sess.graph.as_graph_def(add_shapes=True), ev_meta_graph.graph_def)
ev = next(rr)
# It is actually undeterministic whether SessionLog.START gets written
# before the summary or the checkpoint, but this works when run 10000 times.
self.assertEquals(123, ev.step)
self.assertEquals(tf.SessionLog.START, ev.session_log.status)
first = next(rr)
second = next(rr)
# It is undeterministic whether the value gets written before the checkpoint
# since they are on separate threads, so we check for both conditions.
if first.HasField("summary"):
self.assertProtoEquals("""value { tag: 'global_step/sec'
simple_value: 0.0 }""",
first.summary)
self.assertEquals(123, second.step)
self.assertEquals(tf.SessionLog.CHECKPOINT, second.session_log.status)
else:
self.assertEquals(123, first.step)
self.assertEquals(tf.SessionLog.CHECKPOINT, first.session_log.status)
self.assertProtoEquals("""value { tag: 'global_step/sec'
simple_value: 0.0 }""",
second.summary)
ev = next(rr)
self.assertEquals(tf.SessionLog.STOP, ev.session_log.status)
self.assertRaises(StopIteration, lambda: next(rr))
# There should be a checkpoint file with the variable "foo"
with tf.Graph().as_default(), self.test_session() as sess:
v = tf.Variable([-12], name="global_step")
sav = tf.train.Saver([v])
sav.restore(sess, save_path)
self.assertEqual(123, v.eval()[0])
def testNoQueueRunners(self):
with tf.Graph().as_default(), self.test_session() as sess:
sv = tf.train.Supervisor(logdir=_test_dir("no_queue_runners"))
self.assertEqual(0, len(sv.start_queue_runners(sess)))
sv.stop()
def testPrepareSessionAfterStopForChief(self):
logdir = _test_dir("prepare_after_stop_chief")
with tf.Graph().as_default():
sv = tf.train.Supervisor(logdir=logdir, is_chief=True)
# Create a first session and then stop.
sess = sv.prepare_or_wait_for_session("")
sv.stop()
sess.close()
self.assertTrue(sv.should_stop())
# Now create a second session and test that we don't stay stopped, until
# we ask to stop again.
sess2 = sv.prepare_or_wait_for_session("")
self.assertFalse(sv.should_stop())
sv.stop()
sess2.close()
self.assertTrue(sv.should_stop())
def testPrepareSessionAfterStopForNonChief(self):
logdir = _test_dir("prepare_after_stop_nonchief")
with tf.Graph().as_default():
sv = tf.train.Supervisor(logdir=logdir, is_chief=False)
# Create a first session and then stop.
sess = sv.prepare_or_wait_for_session("")
sv.stop()
sess.close()
self.assertTrue(sv.should_stop())
# Now create a second session and test that we don't stay stopped, until
# we ask to stop again.
sess2 = sv.prepare_or_wait_for_session("")
self.assertFalse(sv.should_stop())
sv.stop()
sess2.close()
self.assertTrue(sv.should_stop())
if __name__ == "__main__":
tf.test.main()
| kamcpp/tensorflow | tensorflow/python/training/supervisor_test.py | Python | apache-2.0 | 33,571 | [
30522,
1001,
9385,
2355,
1996,
23435,
12314,
6048,
1012,
2035,
2916,
9235,
1012,
1001,
1001,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1001,
2017,
2089,
2025,
2224,
2023,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Schnella hymenaeifolia (Hemsl.) Britton & Rose SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Bauhinia/Bauhinia hymenaeifolia/ Syn. Schnella hymenaeifolia/README.md | Markdown | apache-2.0 | 203 | [
30522,
1001,
8040,
7295,
8411,
1044,
25219,
17452,
29244,
1006,
19610,
14540,
1012,
1007,
28101,
2669,
1004,
3123,
2427,
1001,
1001,
1001,
1001,
3570,
10675,
1001,
1001,
1001,
1001,
2429,
2000,
1996,
10161,
1997,
2166,
1010,
3822,
2254,
224... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* 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 io.reactivex.rxjava3.internal.operators.observable;
import static org.junit.Assert.*;
import org.junit.Test;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.observers.TestObserver;
import io.reactivex.rxjava3.operators.QueueFuseable;
import io.reactivex.rxjava3.subjects.MaybeSubject;
import io.reactivex.rxjava3.testsupport.TestObserverEx;
public class ObservableFromMaybeTest extends RxJavaTest {
@Test
public void success() {
Observable.fromMaybe(Maybe.just(1).hide())
.test()
.assertResult(1);
}
@Test
public void empty() {
Observable.fromMaybe(Maybe.empty().hide())
.test()
.assertResult();
}
@Test
public void error() {
Observable.fromMaybe(Maybe.error(new TestException()).hide())
.test()
.assertFailure(TestException.class);
}
@Test
public void cancelComposes() {
MaybeSubject<Integer> ms = MaybeSubject.create();
TestObserver<Integer> to = Observable.fromMaybe(ms)
.test();
to.assertEmpty();
assertTrue(ms.hasObservers());
to.dispose();
assertFalse(ms.hasObservers());
}
@Test
public void asyncFusion() {
TestObserverEx<Integer> to = new TestObserverEx<>();
to.setInitialFusionMode(QueueFuseable.ASYNC);
Observable.fromMaybe(Maybe.just(1))
.subscribe(to);
to
.assertFuseable()
.assertFusionMode(QueueFuseable.ASYNC)
.assertResult(1);
}
@Test
public void syncFusionRejected() {
TestObserverEx<Integer> to = new TestObserverEx<>();
to.setInitialFusionMode(QueueFuseable.SYNC);
Observable.fromMaybe(Maybe.just(1))
.subscribe(to);
to
.assertFuseable()
.assertFusionMode(QueueFuseable.NONE)
.assertResult(1);
}
}
| ReactiveX/RxJava | src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableFromMaybeTest.java | Java | apache-2.0 | 2,547 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2355,
1011,
2556,
1010,
1054,
2595,
3900,
3567,
16884,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Develop based on 'TypeScript & AngularJS TodoMVC Example'
## available on Chrome
| deggs7/sign-in-board-stackeasy | README.md | Markdown | apache-2.0 | 84 | [
30522,
1001,
4503,
2241,
2006,
1005,
4127,
23235,
1004,
16108,
22578,
28681,
5358,
25465,
2742,
1005,
1001,
1001,
2800,
2006,
18546,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright [2016] [Subhabrata Ghosh]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
//
// Created by Subhabrata Ghosh on 31/08/16.
//
#ifndef WATERGATE_ENV_H
#define WATERGATE_ENV_H
#include <vector>
#include "config.h"
#include "file_utils.h"
#include "__app.h"
#include "log_utils.h"
#include "metrics.h"
#define CONFIG_ENV_PARAM_TEMPDIR "env.config.tempdir"
#define CONFIG_ENV_PARAM_WORKDIR "env.config.workdir"
#define CONST_DEFAULT_DIR "/tmp/watergate"
#define CONST_CONFIG_ENV_PARAM_APPNAME "app.name"
#define CONST_CONFIG_ENV_PATH "env"
#define CHECK_ENV_STATE(env) do { \
if (IS_NULL(env)) { \
throw runtime_error("Environment handle is NULL"); \
} \
CHECK_STATE_AVAILABLE(env->get_state()); \
} while(0)
using namespace com::wookler::reactfs::common;
REACTFS_NS_COMMON
class __env {
private:
__state__ state;
Config *config;
__app *app;
Path *work_dir = nullptr;
Path *temp_dir = nullptr;
void setup_defaults() {
this->app = new __app(CONST_CONFIG_ENV_PARAM_APPNAME);
CHECK_ALLOC(this->app, TYPE_NAME(__app));
this->work_dir = new Path(CONST_DEFAULT_DIR);
CHECK_ALLOC(this->work_dir, TYPE_NAME(string));
string appdir = this->app->get_app_directory();
if (!IS_EMPTY(appdir)) {
this->work_dir->append(appdir);
}
this->work_dir->append("work");
if (!this->work_dir->exists()) {
this->work_dir->create(0755);
}
this->temp_dir = new Path(CONST_DEFAULT_DIR);
CHECK_ALLOC(this->temp_dir, TYPE_NAME(string));
if (!IS_EMPTY(appdir)) {
this->temp_dir->append(appdir);
}
this->temp_dir->append("temp");
if (!this->temp_dir->exists()) {
this->temp_dir->create(0755);
}
}
public:
~__env();
void create(string filename) {
create(filename, common_consts::EMPTY_STRING);
}
void create(string filename, string app_name);
const __state__ get_state() const {
return state;
}
Config *get_config() const {
CHECK_STATE_AVAILABLE(this->state);
return this->config;
}
const Path *get_work_dir() const;
const Path *get_temp_dir() const;
const __app *get_app() const {
return app;
}
Path *get_work_dir(string name, mode_t mode) const;
Path *get_temp_dir(string name, mode_t mode) const;
};
REACTFS_NS_COMMON_END
#endif //WATERGATE_ENV_H
| subhagho/ReactFS | common/includes/__env.h | C | apache-2.0 | 3,837 | [
30522,
1013,
1008,
1008,
9385,
1031,
2355,
1033,
1031,
4942,
25459,
14660,
1043,
26643,
1033,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_class.java
// Do not modify
package org.projectfloodlight.openflow.protocol.ver14;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.stat.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.oxs.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import com.google.common.collect.ImmutableList;
import java.util.Set;
import io.netty.buffer.ByteBuf;
import com.google.common.hash.PrimitiveSink;
import com.google.common.hash.Funnel;
class OFBsnGenericCommandVer14 implements OFBsnGenericCommand {
private static final Logger logger = LoggerFactory.getLogger(OFBsnGenericCommandVer14.class);
// version: 1.4
final static byte WIRE_VERSION = 5;
final static int MINIMUM_LENGTH = 80;
private final static long DEFAULT_XID = 0x0L;
private final static String DEFAULT_NAME = "";
private final static List<OFBsnTlv> DEFAULT_TLVS = ImmutableList.<OFBsnTlv>of();
// OF message fields
private final long xid;
private final String name;
private final List<OFBsnTlv> tlvs;
//
// Immutable default instance
final static OFBsnGenericCommandVer14 DEFAULT = new OFBsnGenericCommandVer14(
DEFAULT_XID, DEFAULT_NAME, DEFAULT_TLVS
);
// package private constructor - used by readers, builders, and factory
OFBsnGenericCommandVer14(long xid, String name, List<OFBsnTlv> tlvs) {
if(name == null) {
throw new NullPointerException("OFBsnGenericCommandVer14: property name cannot be null");
}
if(tlvs == null) {
throw new NullPointerException("OFBsnGenericCommandVer14: property tlvs cannot be null");
}
this.xid = xid;
this.name = name;
this.tlvs = tlvs;
}
// Accessors for OF message fields
@Override
public OFVersion getVersion() {
return OFVersion.OF_14;
}
@Override
public OFType getType() {
return OFType.EXPERIMENTER;
}
@Override
public long getXid() {
return xid;
}
@Override
public long getExperimenter() {
return 0x5c16c7L;
}
@Override
public long getSubtype() {
return 0x47L;
}
@Override
public String getName() {
return name;
}
@Override
public List<OFBsnTlv> getTlvs() {
return tlvs;
}
public OFBsnGenericCommand.Builder createBuilder() {
return new BuilderWithParent(this);
}
static class BuilderWithParent implements OFBsnGenericCommand.Builder {
final OFBsnGenericCommandVer14 parentMessage;
// OF message fields
private boolean xidSet;
private long xid;
private boolean nameSet;
private String name;
private boolean tlvsSet;
private List<OFBsnTlv> tlvs;
BuilderWithParent(OFBsnGenericCommandVer14 parentMessage) {
this.parentMessage = parentMessage;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_14;
}
@Override
public OFType getType() {
return OFType.EXPERIMENTER;
}
@Override
public long getXid() {
return xid;
}
@Override
public OFBsnGenericCommand.Builder setXid(long xid) {
this.xid = xid;
this.xidSet = true;
return this;
}
@Override
public long getExperimenter() {
return 0x5c16c7L;
}
@Override
public long getSubtype() {
return 0x47L;
}
@Override
public String getName() {
return name;
}
@Override
public OFBsnGenericCommand.Builder setName(String name) {
this.name = name;
this.nameSet = true;
return this;
}
@Override
public List<OFBsnTlv> getTlvs() {
return tlvs;
}
@Override
public OFBsnGenericCommand.Builder setTlvs(List<OFBsnTlv> tlvs) {
this.tlvs = tlvs;
this.tlvsSet = true;
return this;
}
@Override
public OFBsnGenericCommand build() {
long xid = this.xidSet ? this.xid : parentMessage.xid;
String name = this.nameSet ? this.name : parentMessage.name;
if(name == null)
throw new NullPointerException("Property name must not be null");
List<OFBsnTlv> tlvs = this.tlvsSet ? this.tlvs : parentMessage.tlvs;
if(tlvs == null)
throw new NullPointerException("Property tlvs must not be null");
//
return new OFBsnGenericCommandVer14(
xid,
name,
tlvs
);
}
}
static class Builder implements OFBsnGenericCommand.Builder {
// OF message fields
private boolean xidSet;
private long xid;
private boolean nameSet;
private String name;
private boolean tlvsSet;
private List<OFBsnTlv> tlvs;
@Override
public OFVersion getVersion() {
return OFVersion.OF_14;
}
@Override
public OFType getType() {
return OFType.EXPERIMENTER;
}
@Override
public long getXid() {
return xid;
}
@Override
public OFBsnGenericCommand.Builder setXid(long xid) {
this.xid = xid;
this.xidSet = true;
return this;
}
@Override
public long getExperimenter() {
return 0x5c16c7L;
}
@Override
public long getSubtype() {
return 0x47L;
}
@Override
public String getName() {
return name;
}
@Override
public OFBsnGenericCommand.Builder setName(String name) {
this.name = name;
this.nameSet = true;
return this;
}
@Override
public List<OFBsnTlv> getTlvs() {
return tlvs;
}
@Override
public OFBsnGenericCommand.Builder setTlvs(List<OFBsnTlv> tlvs) {
this.tlvs = tlvs;
this.tlvsSet = true;
return this;
}
//
@Override
public OFBsnGenericCommand build() {
long xid = this.xidSet ? this.xid : DEFAULT_XID;
String name = this.nameSet ? this.name : DEFAULT_NAME;
if(name == null)
throw new NullPointerException("Property name must not be null");
List<OFBsnTlv> tlvs = this.tlvsSet ? this.tlvs : DEFAULT_TLVS;
if(tlvs == null)
throw new NullPointerException("Property tlvs must not be null");
return new OFBsnGenericCommandVer14(
xid,
name,
tlvs
);
}
}
final static Reader READER = new Reader();
static class Reader implements OFMessageReader<OFBsnGenericCommand> {
@Override
public OFBsnGenericCommand readFrom(ByteBuf bb) throws OFParseError {
int start = bb.readerIndex();
// fixed value property version == 5
byte version = bb.readByte();
if(version != (byte) 0x5)
throw new OFParseError("Wrong version: Expected=OFVersion.OF_14(5), got="+version);
// fixed value property type == 4
byte type = bb.readByte();
if(type != (byte) 0x4)
throw new OFParseError("Wrong type: Expected=OFType.EXPERIMENTER(4), got="+type);
int length = U16.f(bb.readShort());
if(length < MINIMUM_LENGTH)
throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length);
if(bb.readableBytes() + (bb.readerIndex() - start) < length) {
// Buffer does not have all data yet
bb.readerIndex(start);
return null;
}
if(logger.isTraceEnabled())
logger.trace("readFrom - length={}", length);
long xid = U32.f(bb.readInt());
// fixed value property experimenter == 0x5c16c7L
int experimenter = bb.readInt();
if(experimenter != 0x5c16c7)
throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter);
// fixed value property subtype == 0x47L
int subtype = bb.readInt();
if(subtype != 0x47)
throw new OFParseError("Wrong subtype: Expected=0x47L(0x47L), got="+subtype);
String name = ChannelUtils.readFixedLengthString(bb, 64);
List<OFBsnTlv> tlvs = ChannelUtils.readList(bb, length - (bb.readerIndex() - start), OFBsnTlvVer14.READER);
OFBsnGenericCommandVer14 bsnGenericCommandVer14 = new OFBsnGenericCommandVer14(
xid,
name,
tlvs
);
if(logger.isTraceEnabled())
logger.trace("readFrom - read={}", bsnGenericCommandVer14);
return bsnGenericCommandVer14;
}
}
public void putTo(PrimitiveSink sink) {
FUNNEL.funnel(this, sink);
}
final static OFBsnGenericCommandVer14Funnel FUNNEL = new OFBsnGenericCommandVer14Funnel();
static class OFBsnGenericCommandVer14Funnel implements Funnel<OFBsnGenericCommandVer14> {
private static final long serialVersionUID = 1L;
@Override
public void funnel(OFBsnGenericCommandVer14 message, PrimitiveSink sink) {
// fixed value property version = 5
sink.putByte((byte) 0x5);
// fixed value property type = 4
sink.putByte((byte) 0x4);
// FIXME: skip funnel of length
sink.putLong(message.xid);
// fixed value property experimenter = 0x5c16c7L
sink.putInt(0x5c16c7);
// fixed value property subtype = 0x47L
sink.putInt(0x47);
sink.putUnencodedChars(message.name);
FunnelUtils.putList(message.tlvs, sink);
}
}
public void writeTo(ByteBuf bb) {
WRITER.write(bb, this);
}
final static Writer WRITER = new Writer();
static class Writer implements OFMessageWriter<OFBsnGenericCommandVer14> {
@Override
public void write(ByteBuf bb, OFBsnGenericCommandVer14 message) {
int startIndex = bb.writerIndex();
// fixed value property version = 5
bb.writeByte((byte) 0x5);
// fixed value property type = 4
bb.writeByte((byte) 0x4);
// length is length of variable message, will be updated at the end
int lengthIndex = bb.writerIndex();
bb.writeShort(U16.t(0));
bb.writeInt(U32.t(message.xid));
// fixed value property experimenter = 0x5c16c7L
bb.writeInt(0x5c16c7);
// fixed value property subtype = 0x47L
bb.writeInt(0x47);
ChannelUtils.writeFixedLengthString(bb, message.name, 64);
ChannelUtils.writeList(bb, message.tlvs);
// update length field
int length = bb.writerIndex() - startIndex;
bb.setShort(lengthIndex, length);
}
}
@Override
public String toString() {
StringBuilder b = new StringBuilder("OFBsnGenericCommandVer14(");
b.append("xid=").append(xid);
b.append(", ");
b.append("name=").append(name);
b.append(", ");
b.append("tlvs=").append(tlvs);
b.append(")");
return b.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
OFBsnGenericCommandVer14 other = (OFBsnGenericCommandVer14) obj;
if( xid != other.xid)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (tlvs == null) {
if (other.tlvs != null)
return false;
} else if (!tlvs.equals(other.tlvs))
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * (int) (xid ^ (xid >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((tlvs == null) ? 0 : tlvs.hashCode());
return result;
}
}
| mehdi149/OF_COMPILER_0.1 | gen-src/main/java/org/projectfloodlight/openflow/protocol/ver14/OFBsnGenericCommandVer14.java | Java | apache-2.0 | 13,664 | [
30522,
1013,
1013,
9385,
1006,
1039,
1007,
2263,
1996,
2604,
1997,
9360,
1997,
1996,
27134,
8422,
3502,
2118,
1013,
1013,
9385,
1006,
1039,
1007,
2249,
1010,
2262,
2330,
14048,
3192,
1013,
1013,
9385,
1006,
1039,
1007,
2262,
1010,
2286,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
--TEST--
MongoDB\Driver\Manager::__construct() with duplicate read preference option
--FILE--
<?php
$manager = new MongoDB\Driver\Manager(null, ['readPreference' => 'primary', 'readpreference' => 'secondary']);
echo $manager->getReadPreference()->getMode(), "\n";
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
2
===DONE===
| jmikola/mongo-php-driver-prototype | tests/manager/manager-ctor-duplicate-option-001.phpt | PHP | apache-2.0 | 323 | [
30522,
1011,
1011,
3231,
1011,
1011,
12256,
3995,
18939,
1032,
4062,
1032,
3208,
1024,
1024,
1035,
1035,
9570,
1006,
1007,
2007,
24473,
3191,
12157,
5724,
1011,
1011,
5371,
1011,
1011,
1026,
1029,
25718,
1002,
3208,
1027,
2047,
12256,
3995,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright (C) 2007 The SpringLobby Team. All rights reserved. */
//
#ifndef NO_TORRENT_SYSTEM
#ifdef _MSC_VER
#ifndef NOMINMAX
#define NOMINMAX
#endif // NOMINMAX
#include <winsock2.h>
#endif // _MSC_VER
#include <wx/stattext.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/intl.h>
#include <wx/choice.h>
#include <wx/statbox.h>
#include <wx/event.h>
#include <wx/regex.h>
#include <wx/checkbox.h>
#include "filelistfilter.h"
#include "filelistctrl.h"
#include "filelistdialog.h"
#include "../uiutils.h"
#include "../utils/downloader.h"
#include "../torrentwrapper.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( FileListFilter, wxPanel )
EVT_CHOICE( FILE_FILTER_TYPE_CHOICE, FileListFilter::OnChangeType )
EVT_TEXT( FILE_FILTER_NAME_EDIT , FileListFilter::OnChangeName )
EVT_CHECKBOX( FILE_FILTER_ONDISK , FileListFilter::OnChangeOndisk )
END_EVENT_TABLE()
FileListFilter::FileListFilter( wxWindow* parent, wxWindowID id, FileListDialog* parentBattleListTab, const wxPoint& pos, const wxSize& size, long style )
: wxPanel( parent, id, pos, size, style ),
m_parent_filelistdialog( parentBattleListTab )
{
wxBoxSizer* m_filter_sizer;
m_filter_sizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* m_filter_body_sizer;
m_filter_body_sizer = new wxStaticBoxSizer( new wxStaticBox( this, -1, wxEmptyString ), wxVERTICAL );
wxBoxSizer* m_filter_body_row1_sizer;
m_filter_body_row1_sizer = new wxBoxSizer( wxHORIZONTAL );
m_filter_name_text = new wxStaticText( this, wxID_ANY, _( "Filename:" ), wxDefaultPosition, wxSize( -1,-1 ), 0 );
m_filter_name_text->Wrap( -1 );
m_filter_name_text->SetMinSize( wxSize( 90,-1 ) );
m_filter_body_row1_sizer->Add( m_filter_name_text, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_filter_name_edit = new wxTextCtrl( this, FILE_FILTER_NAME_EDIT, _T( "" ), wxDefaultPosition, wxSize( -1,-1 ), 0|wxSIMPLE_BORDER );
m_filter_name_edit->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) );
m_filter_name_edit->SetMinSize( wxSize( 220,-1 ) );
m_filter_name_expression = new wxRegEx( m_filter_name_edit->GetValue(),wxRE_ICASE );
m_filter_body_row1_sizer->Add( m_filter_name_edit, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* m_filter_type_sizer;
m_filter_type_sizer = new wxBoxSizer( wxHORIZONTAL );
m_filter_type_text = new wxStaticText( this, wxID_ANY, _( "Filetype:" ), wxDefaultPosition, wxDefaultSize, 0 );
m_filter_type_text->Wrap( -1 );
m_filter_type_sizer->Add( m_filter_type_text, 0, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* m_filter_ondisk_sizer;
m_filter_ondisk_sizer = new wxBoxSizer( wxHORIZONTAL );
m_filter_ondisk = new wxCheckBox( this, FILE_FILTER_ONDISK, _T( "Filter files already on disk" ) );
m_filter_ondisk_sizer->Add( m_filter_ondisk, 0, wxALIGN_CENTER_VERTICAL );
wxString firstChoice = _T( "Any" );
wxArrayString m_filter_type_choiceChoices;
m_filter_type_choiceChoices.Add( firstChoice );
m_filter_type_choiceChoices.Add( _( "Map" ) );
m_filter_type_choiceChoices.Add( _( "Game" ) );
m_filter_type_choice = new wxChoice( this, FILE_FILTER_TYPE_CHOICE, wxDefaultPosition, wxDefaultSize, m_filter_type_choiceChoices, wxSIMPLE_BORDER );
m_filter_type_sizer->Add( m_filter_type_choice, 0, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_filter_body_row1_sizer->Add( m_filter_type_sizer, 0, wxEXPAND, 5 );
m_filter_body_row1_sizer->Add( m_filter_ondisk_sizer, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_filter_body_sizer->Add( m_filter_body_row1_sizer, 1, wxEXPAND, 5 );
m_filter_sizer->Add( m_filter_body_sizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
this->SetSizer( m_filter_sizer );
this->Layout();
m_filter_sizer->Fit( this );
delete m_filter_name_expression;
m_filter_name_expression = new wxRegEx( m_filter_name_edit->GetValue(),wxRE_ICASE );
m_filter_type_choice_value = -1;
wxCommandEvent dummy;
OnChange( dummy );
}
bool FileListFilter::DoFilterResource( const PlasmaResourceInfo& /*info*/ )
{
// if(!data.ok())return false;
// if ( data->name.Upper().Find( m_filter_name_edit->GetValue().Upper() ) == wxNOT_FOUND
// && !m_filter_name_expression->Matches( data->name ) )
// return false;
// if ( m_filter_type_choice_value == 0 && data->type != SpringUnitSync::map ) return false;
//
// if ( m_filter_type_choice_value == 1 && data->type != SpringUnitSync::mod ) return false;
//
// if ( m_filter_ondisk->IsChecked() && data->HasFullFileLocal() )
// return false;
return false;
}
void FileListFilter::OnChange( wxCommandEvent& )
{
//needs dummy event data
m_parent_filelistdialog->UpdateList( GlobalEvents::GlobalEventData() );
}
void FileListFilter::OnChangeName( wxCommandEvent& event )
{
delete m_filter_name_expression;
m_filter_name_expression = new wxRegEx( m_filter_name_edit->GetValue(),wxRE_ICASE );
OnChange( event );
}
void FileListFilter::OnChangeType( wxCommandEvent& event )
{
m_filter_type_choice_value = m_filter_type_choice->GetSelection()-1;
OnChange( event );
}
void FileListFilter::OnChangeOndisk( wxCommandEvent& event )
{
OnChange( event );
}
#endif
| N2maniac/springlobby-join-fork | src/filelister/filelistfilter.cpp | C++ | gpl-2.0 | 5,177 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2289,
1996,
3500,
4135,
14075,
2136,
1012,
2035,
2916,
9235,
1012,
1008,
1013,
1013,
1013,
1001,
2065,
13629,
2546,
2053,
1035,
22047,
3372,
1035,
2291,
1001,
2065,
3207,
2546,
1035,
23794,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
FreeRTOS.org V4.1.3 - Copyright (C) 2003-2006 Richard Barry.
This file is part of the FreeRTOS.org distribution.
FreeRTOS.org is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
FreeRTOS.org is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FreeRTOS.org; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS.org, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Included Filenames changed to a .c extension to allow stepping through
code using F7.
Changes from V3.0.1
*/
#include <pic.h>
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
static bit uxSwitchRequested;
/*
* Vector for the ISR.
*/
void pointed Interrupt()
{
/*
* Save the context of the current task.
*/
portSAVE_CONTEXT( portINTERRUPTS_FORCED );
/*
* No contextswitch requested yet
*/
uxSwitchRequested = pdFALSE;
/*
* Was the interrupt the FreeRTOS SystemTick?
*/
#include <libFreeRTOS/Drivers/Tick/isrTick.c>
/*******************************************************************************
** DO NOT MODIFY ANYTHING ABOVE THIS LINE
********************************************************************************
** Enter the includes for the ISR-code of the FreeRTOS drivers below.
**
** You cannot use local variables. Alternatives are:
** - Use static variables (Global RAM usage increases)
** - Call a function (Additional cycles are needed)
** - Use unused SFR's (preferred, no additional overhead)
** See "../Serial/isrSerialTx.c" for an example of this last option
*******************************************************************************/
/*
* Was the interrupt a byte being received?
*/
#include "../Serial/isrSerialRx.c"
/*
* Was the interrupt the Tx register becoming empty?
*/
#include "../Serial/isrSerialTx.c"
/*******************************************************************************
** DO NOT MODIFY ANYTHING BELOW THIS LINE
*******************************************************************************/
/*
* Was a contextswitch requested by one of the
* interrupthandlers?
*/
if ( uxSwitchRequested )
{
vTaskSwitchContext();
}
/*
* Restore the context of the (possibly other) task.
*/
portRESTORE_CONTEXT();
#pragma asmline retfie 0
}
| Paolo-Maffei/nxstack | FreeRTOS/Demo/PIC18_WizC/Demo7/interrupt.c | C | gpl-2.0 | 3,660 | [
30522,
1013,
1008,
2489,
5339,
2891,
1012,
8917,
1058,
2549,
1012,
1015,
1012,
1017,
1011,
9385,
1006,
1039,
1007,
2494,
1011,
2294,
2957,
6287,
1012,
2023,
5371,
2003,
2112,
1997,
1996,
2489,
5339,
2891,
1012,
8917,
4353,
1012,
2489,
533... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
public class Read {
public static void main(String[] args) {
Main.getStaticLateinit();
}
} | jwren/intellij-community | plugins/kotlin/refIndex/tests/testData/compilerIndex/properties/fromObject/fromCompanion/staticLateinit/Read.java | Java | apache-2.0 | 106 | [
30522,
2270,
2465,
3191,
1063,
2270,
10763,
11675,
2364,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
1063,
2364,
1012,
4152,
29336,
2594,
13806,
5498,
2102,
1006,
1007,
1025,
1065,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var user = os.Getenv("USER")
func init() {
if user == "" {
panic("no value for $USER")
}
}
func throwsPanic(f func()) (b bool) {
defer func() {
if x := recover(); x!= nil {
b =true
}
}()
f()
return
}) | fred345/software-skill | go/exception.go | GO | mit | 250 | [
30522,
13075,
5310,
1027,
9808,
1012,
2131,
2368,
2615,
1006,
1000,
5310,
1000,
1007,
4569,
2278,
1999,
4183,
1006,
1007,
1063,
2065,
5310,
1027,
1027,
1000,
1000,
1063,
6634,
1006,
1000,
2053,
3643,
2005,
1002,
5310,
1000,
1007,
1065,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.uima.lucas.indexer.analysis;
import org.apache.lucene.analysis.LowerCaseFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.uima.lucas.indexer.test.util.DummyTokenStream;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertNotNull;
public class LowerCaseFilterFactoryTest {
private LowerCaseFilterFactory lowercaseFilterFactory;
private TokenStream tokenStream;
@Before
public void setUp() throws Exception {
this.lowercaseFilterFactory = new LowerCaseFilterFactory();
this.tokenStream = new DummyTokenStream("dummy", 1, 1, 0);
}
@Test
public void testCreateTokenFilter() throws IOException {
LowerCaseFilter lowercaseFilter = (LowerCaseFilter) lowercaseFilterFactory.createTokenFilter(tokenStream, null);
assertNotNull(lowercaseFilter);
}
}
| jgrivolla/uima-addons | Lucas/src/test/java/org/apache/uima/lucas/indexer/analysis/LowerCaseFilterFactoryTest.java | Java | apache-2.0 | 1,696 | [
30522,
1013,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
1008,
2030,
2062,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
1008,
5500,
2007,
2023,
2147,
2005,
3176,
2592,
1008,
4953,
9385,
6095,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* zClip :: jQuery ZeroClipboard v1.1.1
* http://steamdev.com/zclip
*
* Copyright 2011, SteamDev
* Released under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Date: Wed Jun 01, 2011
*/
(function ($) {
$.fn.zclip = function (params) {
if (typeof params == "object" && !params.length) {
var settings = $.extend({
path: 'ZeroClipboard.swf',
copy: null,
beforeCopy: null,
afterCopy: null,
clickAfter: true,
setHandCursor: true,
setCSSEffects: true
}, params);
return this.each(function () {
var o = $(this);
if (o.is(':visible') && (typeof settings.copy == 'string' || $.isFunction(settings.copy))) {
ZeroClipboard.setMoviePath(settings.path);
var clip = new ZeroClipboard.Client();
if($.isFunction(settings.copy)){
o.bind('zClip_copy',settings.copy);
}
if($.isFunction(settings.beforeCopy)){
o.bind('zClip_beforeCopy',settings.beforeCopy);
}
if($.isFunction(settings.afterCopy)){
o.bind('zClip_afterCopy',settings.afterCopy);
}
clip.setHandCursor(settings.setHandCursor);
clip.setCSSEffects(settings.setCSSEffects);
clip.addEventListener('mouseOver', function (client) {
o.trigger('mouseenter');
});
clip.addEventListener('mouseOut', function (client) {
o.trigger('mouseleave');
});
clip.addEventListener('mouseDown', function (client) {
o.trigger('mousedown');
if(!$.isFunction(settings.copy)){
clip.setText(settings.copy);
} else {
clip.setText(o.triggerHandler('zClip_copy'));
}
if ($.isFunction(settings.beforeCopy)) {
o.trigger('zClip_beforeCopy');
}
});
clip.addEventListener('complete', function (client, text) {
if ($.isFunction(settings.afterCopy)) {
o.trigger('zClip_afterCopy');
} else {
if (text.length > 500) {
text = text.substr(0, 500) + "...\n\n(" + (text.length - 500) + " characters not shown)";
}
o.removeClass('hover');
alert("Copied text to clipboard:\n\n " + text);
}
if (settings.clickAfter) {
o.trigger('click');
}
});
clip.glue(o[0], o.parent()[0]);
$(window).bind('load resize',function(){clip.reposition();});
}
});
} else if (typeof params == "string") {
return this.each(function () {
var o = $(this);
params = params.toLowerCase();
var zclipId = o.data('zclipId');
var clipElm = $('#' + zclipId + '.zclip');
if (params == "remove") {
clipElm.remove();
o.removeClass('active hover');
} else if (params == "hide") {
clipElm.hide();
o.removeClass('active hover');
} else if (params == "show") {
clipElm.show();
}
});
}
}
})(jQuery);
// ZeroClipboard
// Simple Set Clipboard System
// Author: Joseph Huckaby
var ZeroClipboard = {
version: "1.0.7",
clients: {},
// registered upload clients on page, indexed by id
moviePath: 'ZeroClipboard.swf',
// URL to movie
nextId: 1,
// ID of next movie
$: function (thingy) {
// simple DOM lookup utility function
if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
if (!thingy.addClass) {
// extend element with a few useful methods
thingy.hide = function () {
this.style.display = 'none';
};
thingy.show = function () {
this.style.display = '';
};
thingy.addClass = function (name) {
this.removeClass(name);
this.className += ' ' + name;
};
thingy.removeClass = function (name) {
var classes = this.className.split(/\s+/);
var idx = -1;
for (var k = 0; k < classes.length; k++) {
if (classes[k] == name) {
idx = k;
k = classes.length;
}
}
if (idx > -1) {
classes.splice(idx, 1);
this.className = classes.join(' ');
}
return this;
};
thingy.hasClass = function (name) {
return !!this.className.match(new RegExp("\\s*" + name + "\\s*"));
};
}
return thingy;
},
setMoviePath: function (path) {
// set path to ZeroClipboard.swf
this.moviePath = path;
},
dispatch: function (id, eventName, args) {
// receive event from flash movie, send to client
var client = this.clients[id];
if (client) {
client.receiveEvent(eventName, args);
}
},
register: function (id, client) {
// register new client to receive events
this.clients[id] = client;
},
getDOMObjectPosition: function (obj, stopObj) {
// get absolute coordinates for dom element
var info = {
left: 0,
top: 0,
width: obj.width ? obj.width : obj.offsetWidth,
height: obj.height ? obj.height : obj.offsetHeight
};
if (obj && (obj != stopObj)) {
info.left += obj.offsetLeft;
info.top += obj.offsetTop;
}
return info;
},
Client: function (elem) {
// constructor for new simple upload client
this.handlers = {};
// unique ID
this.id = ZeroClipboard.nextId++;
this.movieId = 'ZeroClipboardMovie_' + this.id;
// register client with singleton to receive flash events
ZeroClipboard.register(this.id, this);
// create movie
if (elem) this.glue(elem);
}
};
ZeroClipboard.Client.prototype = {
id: 0,
// unique ID for us
ready: false,
// whether movie is ready to receive events or not
movie: null,
// reference to movie object
clipText: '',
// text to copy to clipboard
handCursorEnabled: true,
// whether to show hand cursor, or default pointer cursor
cssEffects: true,
// enable CSS mouse effects on dom container
handlers: null,
// user event handlers
glue: function (elem, appendElem, stylesToAdd) {
// glue to DOM element
// elem can be ID or actual DOM element object
this.domElement = ZeroClipboard.$(elem);
// float just above object, or zIndex 99 if dom element isn't set
var zIndex = 99;
if (this.domElement.style.zIndex) {
zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
}
if (typeof(appendElem) == 'string') {
appendElem = ZeroClipboard.$(appendElem);
} else if (typeof(appendElem) == 'undefined') {
appendElem = document.getElementsByTagName('body')[0];
}
// find X/Y position of domElement
var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
// create floating DIV above element
this.div = document.createElement('div');
this.div.className = "zclip";
this.div.id = "zclip-" + this.movieId;
$(this.domElement).data('zclipId', 'zclip-' + this.movieId);
var style = this.div.style;
style.position = 'absolute';
style.left = '' + box.left + 'px';
style.top = '' + box.top + 'px';
style.width = '' + box.width + 'px';
style.height = '' + box.height + 'px';
style.zIndex = zIndex;
if (typeof(stylesToAdd) == 'object') {
for (addedStyle in stylesToAdd) {
style[addedStyle] = stylesToAdd[addedStyle];
}
}
// style.backgroundColor = '#f00'; // debug
appendElem.appendChild(this.div);
this.div.innerHTML = this.getHTML(box.width, box.height);
},
getHTML: function (width, height) {
// return HTML for movie
var html = '';
var flashvars = 'id=' + this.id + '&width=' + width + '&height=' + height;
if (navigator.userAgent.match(/MSIE/)) {
// IE gets an OBJECT tag
var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + protocol + 'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' + width + '" height="' + height + '" id="' + this.movieId + '" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="' + ZeroClipboard.moviePath + '" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="' + flashvars + '"/><param name="wmode" value="transparent"/></object>';
} else {
// all other browsers get an EMBED tag
html += '<embed id="' + this.movieId + '" src="' + ZeroClipboard.moviePath + '" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="' + width + '" height="' + height + '" name="' + this.movieId + '" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="' + flashvars + '" wmode="transparent" />';
}
return html;
},
hide: function () {
// temporarily hide floater offscreen
if (this.div) {
this.div.style.left = '-2000px';
}
},
show: function () {
// show ourselves after a call to hide()
this.reposition();
},
destroy: function () {
// destroy control and floater
if (this.domElement && this.div) {
this.hide();
this.div.innerHTML = '';
var body = document.getElementsByTagName('body')[0];
try {
body.removeChild(this.div);
} catch (e) {;
}
this.domElement = null;
this.div = null;
}
},
reposition: function (elem) {
// reposition our floating div, optionally to new container
// warning: container CANNOT change size, only position
if (elem) {
this.domElement = ZeroClipboard.$(elem);
if (!this.domElement) this.hide();
}
if (this.domElement && this.div) {
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
var style = this.div.style;
style.left = '' + box.left + 'px';
style.top = '' + box.top + 'px';
}
},
setText: function (newText) {
// set text to be copied to clipboard
this.clipText = newText;
if (this.ready) {
this.movie.setText(newText);
}
},
addEventListener: function (eventName, func) {
// add user event listener for event
// event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
if (!this.handlers[eventName]) {
this.handlers[eventName] = [];
}
this.handlers[eventName].push(func);
},
setHandCursor: function (enabled) {
// enable hand cursor (true), or default arrow cursor (false)
this.handCursorEnabled = enabled;
if (this.ready) {
this.movie.setHandCursor(enabled);
}
},
setCSSEffects: function (enabled) {
// enable or disable CSS effects on DOM container
this.cssEffects = !! enabled;
},
receiveEvent: function (eventName, args) {
// receive event from flash
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
// special behavior for certain events
switch (eventName) {
case 'load':
// movie claims it is ready, but in IE this isn't always the case...
// bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
this.movie = document.getElementById(this.movieId);
if (!this.movie) {
var self = this;
setTimeout(function () {
self.receiveEvent('load', null);
}, 1);
return;
}
// firefox on pc needs a "kick" in order to set these in certain cases
if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
var self = this;
setTimeout(function () {
self.receiveEvent('load', null);
}, 100);
this.ready = true;
return;
}
this.ready = true;
try {
this.movie.setText(this.clipText);
} catch (e) {}
try {
this.movie.setHandCursor(this.handCursorEnabled);
} catch (e) {}
break;
case 'mouseover':
if (this.domElement && this.cssEffects) {
this.domElement.addClass('hover');
if (this.recoverActive) {
this.domElement.addClass('active');
}
}
break;
case 'mouseout':
if (this.domElement && this.cssEffects) {
this.recoverActive = false;
if (this.domElement.hasClass('active')) {
this.domElement.removeClass('active');
this.recoverActive = true;
}
this.domElement.removeClass('hover');
}
break;
case 'mousedown':
if (this.domElement && this.cssEffects) {
this.domElement.addClass('active');
}
break;
case 'mouseup':
if (this.domElement && this.cssEffects) {
this.domElement.removeClass('active');
this.recoverActive = false;
}
break;
} // switch eventName
if (this.handlers[eventName]) {
for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
var func = this.handlers[eventName][idx];
if (typeof(func) == 'function') {
// actual function reference
func(this, args);
} else if ((typeof(func) == 'object') && (func.length == 2)) {
// PHP style object + method, i.e. [myObject, 'myMethod']
func[0][func[1]](this, args);
} else if (typeof(func) == 'string') {
// name of function
window[func](this, args);
}
} // foreach event handler defined
} // user defined handler for event
}
};
| xantage/code | vilya/static/js/lib/jquery.zclip.js | JavaScript | bsd-3-clause | 16,750 | [
30522,
1013,
1008,
1008,
1062,
20464,
11514,
1024,
1024,
1046,
4226,
2854,
5717,
20464,
11514,
6277,
1058,
2487,
1012,
1015,
1012,
1015,
1008,
8299,
1024,
1013,
1013,
5492,
24844,
1012,
4012,
1013,
1062,
20464,
11514,
1008,
1008,
9385,
2249... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*!
* angular-datatables - v0.4.1
* https://github.com/l-lin/angular-datatables
* License: MIT
*/
!function(a,b,c,d){"use strict";function e(a,b){function c(a){function c(a,c){function e(a){var c="T";return h.dom=h.dom?h.dom:b.dom,-1===h.dom.indexOf(c)&&(h.dom=c+h.dom),h.hasTableTools=!0,d.isString(a)&&h.withTableToolsOption("sSwfPath",a),h}function f(a,b){return d.isString(a)&&(h.oTableTools=h.oTableTools&&null!==h.oTableTools?h.oTableTools:{},h.oTableTools[a]=b),h}function g(a){return d.isArray(a)&&h.withTableToolsOption("aButtons",a),h}var h=a(c);return h.withTableTools=e,h.withTableToolsOption=f,h.withTableToolsButtons=g,h}var e=a.newOptions,f=a.fromSource,g=a.fromFnPromise;return a.newOptions=function(){return c(e)},a.fromSource=function(a){return c(f,a)},a.fromFnPromise=function(a){return c(g,a)},a}a.decorator("DTOptionsBuilder",c),c.$inject=["$delegate"]}d.module("datatables.tabletools",["datatables"]).config(e),e.$inject=["$provide","DT_DEFAULT_OPTIONS"]}(window,document,jQuery,angular); | Shohiek/weblims | assets/bower_components/angular-datatables/dist/plugins/tabletools/angular-datatables.tabletools.min.js | JavaScript | lgpl-3.0 | 1,014 | [
30522,
1013,
1008,
999,
1008,
16108,
1011,
2951,
10880,
2015,
1011,
1058,
2692,
1012,
1018,
1012,
1015,
1008,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
1048,
1011,
11409,
1013,
16108,
1011,
2951,
10880,
2015,
1008,
6105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_RENDERER_ATOM_AUTOFILL_AGENT_H_
#define ATOM_RENDERER_ATOM_AUTOFILL_AGENT_H_
#include <vector>
#include "base/memory/weak_ptr.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/WebKit/public/web/WebAutofillClient.h"
#include "third_party/WebKit/public/web/WebFormControlElement.h"
#include "third_party/WebKit/public/web/WebInputElement.h"
#include "third_party/WebKit/public/web/WebNode.h"
namespace atom {
class AutofillAgent : public content::RenderFrameObserver,
public blink::WebAutofillClient {
public:
explicit AutofillAgent(content::RenderFrame* frame);
// content::RenderFrameObserver:
void OnDestruct() override;
void DidChangeScrollOffset() override;
void FocusedNodeChanged(const blink::WebNode&) override;
void DidCompleteFocusChangeInFrame() override;
void DidReceiveLeftMouseDownOrGestureTapInNode(
const blink::WebNode&) override;
private:
struct ShowSuggestionsOptions {
ShowSuggestionsOptions();
bool autofill_on_empty_values;
bool requires_caret_at_end;
};
bool OnMessageReceived(const IPC::Message& message) override;
// blink::WebAutofillClient:
void TextFieldDidEndEditing(const blink::WebInputElement&) override;
void TextFieldDidChange(const blink::WebFormControlElement&) override;
void TextFieldDidChangeImpl(const blink::WebFormControlElement&);
void TextFieldDidReceiveKeyDown(const blink::WebInputElement&,
const blink::WebKeyboardEvent&) override;
void OpenTextDataListChooser(const blink::WebInputElement&) override;
void DataListOptionsChanged(const blink::WebInputElement&) override;
bool IsUserGesture() const;
void HidePopup();
void ShowPopup(const blink::WebFormControlElement&,
const std::vector<base::string16>&,
const std::vector<base::string16>&);
void ShowSuggestions(const blink::WebFormControlElement& element,
const ShowSuggestionsOptions& options);
void OnAcceptSuggestion(base::string16 suggestion);
void DoFocusChangeComplete();
// True when the last click was on the focused node.
bool focused_node_was_last_clicked_;
// This is set to false when the focus changes, then set back to true soon
// afterwards. This helps track whether an event happened after a node was
// already focused, or if it caused the focus to change.
bool was_focused_before_now_;
base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(AutofillAgent);
};
} // namespace atom
#endif // ATOM_RENDERER_ATOM_AUTOFILL_AGENT_H_
| thomsonreuters/electron | atom/renderer/atom_autofill_agent.h | C | mit | 2,823 | [
30522,
1013,
1013,
9385,
1006,
1039,
1007,
2418,
21025,
2705,
12083,
1010,
4297,
1012,
1013,
1013,
2224,
1997,
2023,
3120,
3642,
2003,
9950,
2011,
1996,
10210,
6105,
2008,
2064,
2022,
1013,
1013,
2179,
1999,
1996,
6105,
5371,
1012,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
@section('title')
Edit course {{$courseName}}
@stop
@include('includes.header')
{{ Form::open(array('url' => $url, 'method' => 'PUT')) }}
{{ Form::label('name', 'Course name') }}
{{ Form::text('name',$courseName) }}
{{ Form::submit('Save change!') }}
{{ Form::close() }}
@include('includes.footer') | VeeSot/yalms | app/views/pages/course/edit.blade.php | PHP | gpl-2.0 | 335 | [
30522,
1030,
2930,
1006,
1005,
2516,
1005,
1007,
10086,
2607,
1063,
1063,
1002,
2607,
18442,
1065,
1065,
1030,
2644,
1030,
2421,
1006,
1005,
2950,
1012,
20346,
1005,
1007,
1063,
1063,
2433,
1024,
1024,
2330,
1006,
9140,
1006,
1005,
24471,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2011 Simple Finance, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.banksimple.clipping.ManagementStrategies
import com.banksimple.clipping.{PersistentVar,PersistingStrategy,StateManagementStrategy, PersistenceError}
import java.util.concurrent._
import java.util.concurrent.locks.{ReentrantReadWriteLock,ReentrantLock}
trait SyncronousManagementStrategy[A] extends StateManagementStrategy[A] {
self: PersistentVar[A] with PersistingStrategy[A] =>
private val rwLock = new ReentrantReadWriteLock()
override def putIf(test: A => Boolean, produce: () => A): A = {
rwLock.writeLock().lock()
try {
val currentVal = get() // Get will get the readlock, but that's Okay
if (test(currentVal)) {
produce() match {
case v if (v != null) => {
storedValue = Some(v)
persist(v)
v
}
case _ => currentVal
}
} else {
currentVal
}
} catch {
case PersistenceError(cause) => {
log.error("Could not persist value because: %s. Continuing without persisting.".format(cause), cause)
get()
}
case x => throw x // We probably want to fail out aggressively here,
// it's almost certainly a code error.
} finally {
rwLock.writeLock().unlock()
}
}
override def get(): A = {
rwLock.readLock().lock()
try {
if (storedValue.isEmpty) { // Uninitialized case
storedValue = Some(
reify() match {
case Some(v) => v.asInstanceOf[A]
case _ => defaultValue
})
}
storedValue.get // What we actually want
} catch {
case PersistenceError(cause) => {
// This only occurs during the initial read, so populate with default
log.error("Problem attempting to reify var. Using default. Error: %s".format(cause))
if(storedValue.isEmpty) { storedValue = Some(defaultValue) }
storedValue.get
}
case e => {
// Almost certainly a code error we should pass to the user
log.error("Problem attempting to get() var. Error: %s".format(e), e)
throw e
}
} finally {
rwLock.readLock().unlock()
}
}
}
| KirinDave/Clipping | src/main/scala/com/banksimple/clipping/ManagementStrategies/SynchronousManagementStrategy.scala | Scala | apache-2.0 | 2,786 | [
30522,
1013,
1008,
1008,
9385,
2249,
3722,
5446,
1010,
11775,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
import java.io.*;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
// Referenced classes of package net.minecraft.src:
// NBTBase, NBTTagCompound
public class CompressedStreamTools
{
public CompressedStreamTools()
{
}
public static NBTTagCompound func_1138_a(InputStream p_1138_0_)
throws IOException
{
DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(p_1138_0_)));
try
{
NBTTagCompound nbttagcompound = func_1141_a(datainputstream);
return nbttagcompound;
}
finally
{
datainputstream.close();
}
}
public static void func_1143_a(NBTTagCompound p_1143_0_, OutputStream p_1143_1_)
throws IOException
{
DataOutputStream dataoutputstream = new DataOutputStream(new GZIPOutputStream(p_1143_1_));
try
{
func_1139_a(p_1143_0_, dataoutputstream);
}
finally
{
dataoutputstream.close();
}
}
public static NBTTagCompound func_40592_a(byte p_40592_0_[])
throws IOException
{
DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(p_40592_0_))));
try
{
NBTTagCompound nbttagcompound = func_1141_a(datainputstream);
return nbttagcompound;
}
finally
{
datainputstream.close();
}
}
public static byte[] func_40591_a(NBTTagCompound p_40591_0_)
throws IOException
{
ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
DataOutputStream dataoutputstream = new DataOutputStream(new GZIPOutputStream(bytearrayoutputstream));
try
{
func_1139_a(p_40591_0_, dataoutputstream);
}
finally
{
dataoutputstream.close();
}
return bytearrayoutputstream.toByteArray();
}
public static void func_35621_a(NBTTagCompound p_35621_0_, File p_35621_1_)
throws IOException
{
File file = new File((new StringBuilder()).append(p_35621_1_.getAbsolutePath()).append("_tmp").toString());
if(file.exists())
{
file.delete();
}
func_35620_b(p_35621_0_, file);
if(p_35621_1_.exists())
{
p_35621_1_.delete();
}
if(p_35621_1_.exists())
{
throw new IOException((new StringBuilder()).append("Failed to delete ").append(p_35621_1_).toString());
} else
{
file.renameTo(p_35621_1_);
return;
}
}
public static void func_35620_b(NBTTagCompound p_35620_0_, File p_35620_1_)
throws IOException
{
DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(p_35620_1_));
try
{
func_1139_a(p_35620_0_, dataoutputstream);
}
finally
{
dataoutputstream.close();
}
}
public static NBTTagCompound func_35622_a(File p_35622_0_)
throws IOException
{
if(!p_35622_0_.exists())
{
return null;
}
DataInputStream datainputstream = new DataInputStream(new FileInputStream(p_35622_0_));
try
{
NBTTagCompound nbttagcompound = func_1141_a(datainputstream);
return nbttagcompound;
}
finally
{
datainputstream.close();
}
}
public static NBTTagCompound func_1141_a(DataInput p_1141_0_)
throws IOException
{
NBTBase nbtbase = NBTBase.func_734_b(p_1141_0_);
if(nbtbase instanceof NBTTagCompound)
{
return (NBTTagCompound)nbtbase;
} else
{
throw new IOException("Root tag must be a named compound tag");
}
}
public static void func_1139_a(NBTTagCompound p_1139_0_, DataOutput p_1139_1_)
throws IOException
{
NBTBase.func_738_a(p_1139_0_, p_1139_1_);
}
}
| sethten/MoDesserts | mcp50/temp/src/minecraft/net/minecraft/src/CompressedStreamTools.java | Java | gpl-3.0 | 4,390 | [
30522,
1013,
1013,
21933,
8737,
18450,
2011,
14855,
2094,
1058,
2487,
1012,
1019,
1012,
1022,
2290,
1012,
9385,
2541,
18635,
12849,
17040,
22781,
4492,
1012,
1013,
1013,
14855,
2094,
2188,
3931,
1024,
8299,
1024,
1013,
1013,
7479,
1012,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# - Find LevelDB
#
# LEVELDB_INCLUDE_DIRS - List of LevelDB includes.
# LEVELDB_LIBRARIES - List of libraries when using LevelDB.
# LEVELDB_FOUND - True if LevelDB found
# Look for the header of file.
find_path(LEVELDB_INCLUDE NAMES leveldb/db.h
PATHS $ENV{LEVELDB_ROOT}/include /opt/local/include /usr/local/include /usr/include
DOC "Path in which the file leveldb/db.h is located.")
# Look for the library.
find_library(LEVELDB_LIBRARY NAMES leveldb
PATHS $ENV{LEVELDB_ROOT}/lib /usr/local/lib /usr/lib
DOC "Path to leveldb library.")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LevelDB DEFAULT_MSG LEVELDB_INCLUDE LEVELDB_LIBRARY)
if(LEVELDB_FOUND)
set(LEVELDB_INCLUDE_DIRS ${LEVELDB_INCLUDE})
set(LEVELDB_LIBRARIES ${LEVELDB_LIBRARY})
mark_as_advanced(LEVELDB_INCLUDE LEVELDB_LIBRARY)
message(STATUS "Found LevelDB (include: ${LEVELDB_INCLUDE_DIRS}, library: ${LEVELDB_LIBRARIES})")
endif()
| QiumingLu/saber | cmake/Modules/FindLevelDB.cmake | CMake | bsd-3-clause | 1,061 | [
30522,
1001,
1011,
2424,
2504,
18939,
1001,
1001,
2504,
18939,
1035,
2421,
1035,
16101,
2015,
1011,
2862,
1997,
2504,
18939,
2950,
1012,
1001,
2504,
18939,
1035,
8860,
1011,
2862,
1997,
8860,
2043,
2478,
2504,
18939,
1012,
1001,
2504,
18939... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_45) on Fri Aug 28 09:51:25 EDT 2015 -->
<title>Cassandra.describe_keyspace_args._Fields (apache-cassandra API)</title>
<meta name="date" content="2015-08-28">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Cassandra.describe_keyspace_args._Fields (apache-cassandra API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":10,"i4":10,"i5":9,"i6":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Cassandra.describe_keyspace_args._Fields.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args.html" title="class in org.apache.cassandra.thrift"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_result.html" title="class in org.apache.cassandra.thrift"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" target="_top">Frames</a></li>
<li><a href="Cassandra.describe_keyspace_args._Fields.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#enum.constant.summary">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#enum.constant.detail">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.cassandra.thrift</div>
<h2 title="Enum Cassandra.describe_keyspace_args._Fields" class="title">Enum Cassandra.describe_keyspace_args._Fields</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>java.lang.Enum<<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a>></li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.thrift.Cassandra.describe_keyspace_args._Fields</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, java.lang.Comparable<<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a>>, org.apache.thrift.TFieldIdEnum</dd>
</dl>
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args.html" title="class in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args</a></dd>
</dl>
<hr>
<br>
<pre>public static enum <span class="typeNameLabel">Cassandra.describe_keyspace_args._Fields</span>
extends java.lang.Enum<<a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a>>
implements org.apache.thrift.TFieldIdEnum</pre>
<div class="block">The set of fields this struct contains, along with convenience methods for finding and manipulating them.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="enum.constant.summary">
<!-- -->
</a>
<h3>Enum Constant Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation">
<caption><span>Enum Constants</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Enum Constant and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html#KEYSPACE">KEYSPACE</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html#findByName-java.lang.String-">findByName</a></span>(java.lang.String name)</code>
<div class="block">Find the _Fields constant that matches name, or null if its not found.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html#findByThriftId-int-">findByThriftId</a></span>(int fieldId)</code>
<div class="block">Find the _Fields constant that matches fieldId, or null if its not found.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html#findByThriftIdOrThrow-int-">findByThriftIdOrThrow</a></span>(int fieldId)</code>
<div class="block">Find the _Fields constant that matches fieldId, throwing an exception
if it is not found.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html#getFieldName--">getFieldName</a></span>()</code> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>short</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html#getThriftFieldId--">getThriftFieldId</a></span>()</code> </td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html#valueOf-java.lang.String-">valueOf</a></span>(java.lang.String name)</code>
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html#values--">values</a></span>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Enum">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Enum</h3>
<code>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>getClass, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ENUM CONSTANT DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="enum.constant.detail">
<!-- -->
</a>
<h3>Enum Constant Detail</h3>
<a name="KEYSPACE">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>KEYSPACE</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a> KEYSPACE</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="values--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>values</h4>
<pre>public static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a>[] values()</pre>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
<pre>
for (Cassandra.describe_keyspace_args._Fields c : Cassandra.describe_keyspace_args._Fields.values())
System.out.println(c);
</pre></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array containing the constants of this enum type, in the order they are declared</dd>
</dl>
</li>
</ul>
<a name="valueOf-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>valueOf</h4>
<pre>public static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a> valueOf(java.lang.String name)</pre>
<div class="block">Returns the enum constant of this type with the specified name.
The string must match <i>exactly</i> an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the enum constant to be returned.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the enum constant with the specified name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if this enum type has no constant with the specified name</dd>
<dd><code>java.lang.NullPointerException</code> - if the argument is null</dd>
</dl>
</li>
</ul>
<a name="findByThriftId-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>findByThriftId</h4>
<pre>public static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a> findByThriftId(int fieldId)</pre>
<div class="block">Find the _Fields constant that matches fieldId, or null if its not found.</div>
</li>
</ul>
<a name="findByThriftIdOrThrow-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>findByThriftIdOrThrow</h4>
<pre>public static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a> findByThriftIdOrThrow(int fieldId)</pre>
<div class="block">Find the _Fields constant that matches fieldId, throwing an exception
if it is not found.</div>
</li>
</ul>
<a name="findByName-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>findByName</h4>
<pre>public static <a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" title="enum in org.apache.cassandra.thrift">Cassandra.describe_keyspace_args._Fields</a> findByName(java.lang.String name)</pre>
<div class="block">Find the _Fields constant that matches name, or null if its not found.</div>
</li>
</ul>
<a name="getThriftFieldId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getThriftFieldId</h4>
<pre>public short getThriftFieldId()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getThriftFieldId</code> in interface <code>org.apache.thrift.TFieldIdEnum</code></dd>
</dl>
</li>
</ul>
<a name="getFieldName--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getFieldName</h4>
<pre>public java.lang.String getFieldName()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getFieldName</code> in interface <code>org.apache.thrift.TFieldIdEnum</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Cassandra.describe_keyspace_args._Fields.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_args.html" title="class in org.apache.cassandra.thrift"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/thrift/Cassandra.describe_keyspace_result.html" title="class in org.apache.cassandra.thrift"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html" target="_top">Frames</a></li>
<li><a href="Cassandra.describe_keyspace_args._Fields.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#enum.constant.summary">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#enum.constant.detail">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015 The Apache Software Foundation</small></p>
</body>
</html>
| mitch-kyle/message-board | support/apache-cassandra-2.2.1/javadoc/org/apache/cassandra/thrift/Cassandra.describe_keyspace_args._Fields.html | HTML | apache-2.0 | 18,916 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Copyright (c) 2019 PaddlePaddle 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.
from __future__ import print_function
import unittest
from parallel_executor_test_base import TestParallelExecutorBase, DeviceType
import seresnext_net
import paddle.fluid.core as core
class TestResnetWithReduceBase(TestParallelExecutorBase):
def _compare_reduce_and_allreduce(self, use_device, delta2=1e-5):
if use_device == DeviceType.CUDA and not core.is_compiled_with_cuda():
return
all_reduce_first_loss, all_reduce_last_loss = self.check_network_convergence(
seresnext_net.model,
feed_dict=seresnext_net.feed_dict(use_device),
iter=seresnext_net.iter(use_device),
batch_size=seresnext_net.batch_size(use_device),
use_device=use_device,
use_reduce=False,
optimizer=seresnext_net.optimizer)
reduce_first_loss, reduce_last_loss = self.check_network_convergence(
seresnext_net.model,
feed_dict=seresnext_net.feed_dict(use_device),
iter=seresnext_net.iter(use_device),
batch_size=seresnext_net.batch_size(use_device),
use_device=use_device,
use_reduce=True,
optimizer=seresnext_net.optimizer)
for loss in zip(all_reduce_first_loss, reduce_first_loss):
self.assertAlmostEquals(loss[0], loss[1], delta=1e-5)
for loss in zip(all_reduce_last_loss, reduce_last_loss):
self.assertAlmostEquals(loss[0], loss[1], delta=loss[0] * delta2)
if not use_device:
return
all_reduce_first_loss_seq, all_reduce_last_loss_seq = self.check_network_convergence(
seresnext_net.model,
feed_dict=seresnext_net.feed_dict(use_device),
iter=seresnext_net.iter(use_device),
batch_size=seresnext_net.batch_size(use_device),
use_device=use_device,
use_reduce=False,
optimizer=seresnext_net.optimizer,
enable_sequential_execution=True)
reduce_first_loss_seq, reduce_last_loss_seq = self.check_network_convergence(
seresnext_net.model,
feed_dict=seresnext_net.feed_dict(use_device),
iter=seresnext_net.iter(use_device),
batch_size=seresnext_net.batch_size(use_device),
use_device=use_device,
use_reduce=True,
optimizer=seresnext_net.optimizer,
enable_sequential_execution=True)
for loss in zip(all_reduce_first_loss, all_reduce_first_loss_seq):
self.assertAlmostEquals(loss[0], loss[1], delta=1e-5)
for loss in zip(all_reduce_last_loss, all_reduce_last_loss_seq):
self.assertAlmostEquals(loss[0], loss[1], delta=loss[0] * delta2)
for loss in zip(reduce_first_loss, reduce_first_loss_seq):
self.assertAlmostEquals(loss[0], loss[1], delta=1e-5)
for loss in zip(reduce_last_loss, reduce_last_loss_seq):
self.assertAlmostEquals(loss[0], loss[1], delta=loss[0] * delta2)
for loss in zip(all_reduce_first_loss_seq, reduce_first_loss_seq):
self.assertAlmostEquals(loss[0], loss[1], delta=1e-5)
for loss in zip(all_reduce_last_loss_seq, reduce_last_loss_seq):
self.assertAlmostEquals(loss[0], loss[1], delta=loss[0] * delta2)
class TestResnetWithReduceCPU(TestResnetWithReduceBase):
def test_seresnext_with_reduce(self):
self._compare_reduce_and_allreduce(
use_device=DeviceType.CPU, delta2=1e-3)
if __name__ == '__main__':
unittest.main()
| PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_parallel_executor_seresnext_with_reduce_cpu.py | Python | apache-2.0 | 4,150 | [
30522,
1001,
9385,
1006,
1039,
1007,
10476,
20890,
15455,
10362,
6048,
1012,
2035,
2916,
9235,
1012,
1001,
1001,
7000,
2104,
1996,
30524,
6105,
2012,
1001,
1001,
8299,
1024,
1013,
1013,
7479,
1012,
15895,
1012,
8917,
1013,
15943,
1013,
6105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
<title>Cordova Mobile Spec</title>
</head>
<body>
<video width=100% height=100% id="player">
<source src="http://m.comptoir-info.com/app/beta/sample.mp4">
<meta property="og:video:secure_url" content="http://m.comptoir-info.com/app/beta/sample.mp4">
<meta property="og:video:type" content="video/mp4">
</video>
<div>
<button onclick="document.getElementById('player').play()"> play </button>
<button onclick="document.getElementById('player').pause()"> pause </button>
</div>
</body>
</html>
| Ramanujakalyan/Inherit | ui/plugins/org.apache.cordova.inappbrowser/tests/resources/video.html | HTML | unlicense | 1,629 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
999,
1011,
1011,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
30524,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* soundeffects.c
* An example on how to use libmikmod to play sound effects.
*
* (C) 2004, Raphael Assenat (raph@raphnet.net)
*
* This example is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRENTY; without event the implied warrenty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <mikmod.h>
#if !defined _WIN32 && !defined _WIN64
#include <unistd.h> /* for usleep() */
#define MikMod_Sleep(ns) usleep(ns)
#else
#define MikMod_Sleep(ns) Sleep(ns / 1000)
#endif
SAMPLE *Load(const char *fn)
{
char *data_buf;
long data_len;
FILE *fptr;
/* open the file */
fptr = fopen(fn, "rb");
if (fptr == NULL) {
perror("fopen");
return 0;
}
/* calculate the file size */
fseek(fptr, 0, SEEK_END);
data_len = ftell(fptr);
fseek(fptr, 0, SEEK_SET);
/* allocate a buffer and load the file into it */
data_buf = (char *) malloc(data_len);
if (data_buf == NULL) {
perror("malloc");
fclose(fptr);
return 0;
}
if (fread(data_buf, data_len, 1, fptr) != 1) {
perror("fread");
fclose(fptr);
free(data_buf);
return 0;
}
fclose(fptr);
return Sample_LoadMem(data_buf, data_len);
}
int main(void)
{
/* sound effects */
SAMPLE *sfx1, *sfx2;
/* voices */
int v1, v2;
int i;
/* register all the drivers */
MikMod_RegisterAllDrivers();
/* initialize the library */
md_mode |= DMODE_SOFT_SNDFX;
if (MikMod_Init("")) {
fprintf(stderr, "Could not initialize sound, reason: %s\n",
MikMod_strerror(MikMod_errno));
return 1;
}
/* load samples */
sfx1 = Load("first.wav");
if (!sfx1) {
MikMod_Exit();
fprintf(stderr, "Could not load the first sound, reason: %s\n",
MikMod_strerror(MikMod_errno));
return 1;
}
sfx2 = Load("second.wav");
if (!sfx2) {
Sample_Free(sfx1);
MikMod_Exit();
fprintf(stderr, "Could not load the second sound, reason: %s\n",
MikMod_strerror(MikMod_errno));
return 1;
}
/* reserve 2 voices for sound effects */
MikMod_SetNumVoices(-1, 2);
/* get ready to play */
MikMod_EnableOutput();
/* play first sample */
v1 = Sample_Play(sfx1, 0, 0);
do {
MikMod_Update();
MikMod_Sleep(100000);
} while (!Voice_Stopped(v1));
for (i = 0; i < 10; i++) {
MikMod_Update();
MikMod_Sleep(100000);
}
/* half a second later, play second sample */
v2 = Sample_Play(sfx2, 0, 0);
do {
MikMod_Update();
MikMod_Sleep(100000);
} while (!Voice_Stopped(v2));
for (i = 0; i < 10; i++) {
MikMod_Update();
MikMod_Sleep(100000);
}
MikMod_DisableOutput();
Sample_Free(sfx2);
Sample_Free(sfx1);
MikMod_Exit();
return 0;
}
| gameblabla/methane | source/gcw/libmikmod-3.3.7/examples/soundeffects/soundeffects.c | C | gpl-2.0 | 2,980 | [
30522,
1013,
1008,
2614,
12879,
25969,
2015,
1012,
1039,
1008,
2019,
2742,
2006,
2129,
2000,
2224,
5622,
25526,
5480,
5302,
2094,
2000,
2377,
2614,
3896,
1012,
1008,
1008,
1006,
1039,
1007,
2432,
1010,
12551,
4632,
8189,
2102,
1006,
9680,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package seedu.tasklist.commons.core;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Objects;
import java.util.logging.Level;
import org.json.JSONException;
import org.json.simple.JSONObject;
import org.json.simple.parser.*;
/**
* Config values used by the app
*/
public class Config {
public static final String DEFAULT_CONFIG_FILE = "config.json";
// Config values customizable through config file
private String appTitle = "Lazyman's Friend";
private Level logLevel = Level.INFO;
private String userPrefsFilePath = "preferences.json";
private String taskListFilePath = "data/tasklist.xml";
private String taskListName = "MyTaskList";
public Config() {
}
public String getAppTitle() {
return appTitle;
}
public void setAppTitle(String appTitle) {
this.appTitle = appTitle;
}
public Level getLogLevel() {
return logLevel;
}
public void setLogLevel(Level logLevel) {
this.logLevel = logLevel;
}
public String getUserPrefsFilePath() {
return userPrefsFilePath;
}
public void setUserPrefsFilePath(String userPrefsFilePath) {
this.userPrefsFilePath = userPrefsFilePath;
}
/* @@author A0135769N */
public String getTaskListFilePath() {
return taskListFilePath;
}
// Method replaces the existing file path with the new file path specified by user.
public void setTaskListFilePath(String taskListFilePath) throws JSONException, IOException, ParseException {
JSONObject obj = new JSONObject();
obj.put("taskListFilePath", taskListFilePath);
obj.put("userPrefsFilePath", "preferences.json");
obj.put("appTitle", "Lazyman's Friend");
obj.put("logLevel", "INFO");
obj.put("taskListName", "MyTaskList");
try (FileWriter file = new FileWriter("config.json")) {
file.write(obj.toJSONString());
System.out.println("Successfully Copied JSON Object to File...");
System.out.println("\nJSON Object: " + obj);
}
this.taskListFilePath = taskListFilePath;
}
public String getTaskListName() {
return taskListName;
}
public void setTaskListName(String taskListName) {
this.taskListName = taskListName;
}
@Override
public boolean equals(Object other) {
if (other == this){
return true;
}
if (!(other instanceof Config)){ //this handles null as well.
return false;
}
Config o = (Config)other;
return Objects.equals(appTitle, o.appTitle)
&& Objects.equals(logLevel, o.logLevel)
&& Objects.equals(userPrefsFilePath, o.userPrefsFilePath)
&& Objects.equals(taskListFilePath, o.taskListFilePath)
&& Objects.equals(taskListName, o.taskListName);
}
@Override
public int hashCode() {
return Objects.hash(appTitle, logLevel, userPrefsFilePath, taskListFilePath, taskListName);
}
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append("App title : " + appTitle);
sb.append("\nCurrent log level : " + logLevel);
sb.append("\nPreference file Location : " + userPrefsFilePath);
sb.append("\nLocal data file location : " + taskListFilePath);
sb.append("\nTaskList name : " + taskListName);
return sb.toString();
}
}
| CS2103AUG2016-T11-C1/main | src/main/java/seedu/tasklist/commons/core/Config.java | Java | mit | 3,496 | [
30522,
7427,
6534,
2226,
1012,
4708,
9863,
1012,
7674,
1012,
4563,
1025,
12324,
9262,
1012,
22834,
1012,
5371,
15994,
1025,
12324,
9262,
1012,
22834,
1012,
22834,
10288,
24422,
1025,
12324,
9262,
1012,
21183,
4014,
1012,
5200,
1025,
12324,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var system = require('system');
var args = system.args;
var url = "http://"+args[1],
filename = args[2]+".png",
timeout = args[3],
savePath = args[4],
page = require('webpage').create();
//setTimeout(function(){phantom.exit();}, timeout)
page.viewportSize = { width: 1200, height: 700 };
page.clipRect = { top: 0, left: 0, width: 1200, height: 700 };
var f = false;
page.onLoadFinished = function(status) {
console.log('Status: ' + status);
setTimeout(function(){
render(page);
phantom.exit();
}, 15000)
};
page.onResourceReceived = function(response) {
if (response.url === url && !f) {
setTimeout(function(){
render(page);
phantom.exit();
}, 15000)
f = true
}
};
function render(page) {
var resPath
if (savePath == "") {
resPath = filename
} else {
resPath = savePath + "/" + filename
}
page.render(resPath)
}
console.log("start get " + url)
page.open(url, function() {
}); | zhuharev/shot | assets/rasterize.js | JavaScript | mit | 936 | [
30522,
13075,
2291,
1027,
5478,
1006,
1005,
2291,
1005,
1007,
1025,
13075,
12098,
5620,
1027,
2291,
1012,
12098,
5620,
1025,
13075,
24471,
2140,
1027,
1000,
8299,
1024,
1013,
1013,
1000,
1009,
12098,
5620,
1031,
1015,
1033,
1010,
5371,
1844... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<html><img border=0 src=779-03-3.txt alt=779-03-3.txt></img><body>
"x"
"1" "KAZIUS, J, MCGUIRE, R AND BURSI, R. DERIVATION AND VALIDATION OF TOXICOPHORES FOR MUTAGENICITY PREDICTION. J. MED. CHEM. 48: 312-320, 2005"
</body></html>
| andrewdefries/Ames_ToxBenchmark | 779-03-3.txt.html | HTML | mit | 231 | [
30522,
1026,
16129,
1028,
1026,
10047,
2290,
3675,
1027,
1014,
5034,
2278,
1027,
6255,
2683,
1011,
6021,
1011,
1017,
1012,
19067,
2102,
30524,
1026,
1013,
10047,
2290,
1028,
1026,
2303,
1028,
1000,
1060,
1000,
1000,
1015,
1000,
1000,
10556,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict';
// Production specific configuration
// =================================
module.exports = {
// Server IP
ip: process.env.OPENSHIFT_NODEJS_IP ||
process.env.IP ||
undefined,
// Server port
port: process.env.OPENSHIFT_NODEJS_PORT ||
process.env.PORT ||
8080,
// MongoDB connection options
mongo: {
uri: process.env.MONGOLAB_URI ||
process.env.MONGOHQ_URL ||
process.env.OPENSHIFT_MONGODB_DB_URL+process.env.OPENSHIFT_APP_NAME ||
'mongodb://localhost/spicyparty'
}
}; | johnttan/spicybattle | server/config/environment/production.js | JavaScript | mit | 597 | [
30522,
1005,
2224,
9384,
1005,
1025,
1013,
1013,
2537,
3563,
9563,
1013,
1013,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package org.demo.jdk.utilapis;
public class Bird implements Flyable {
private int speed = 15;
@Override
public void fly() {
System.out.println("I'm Bird, my speed is " + speed + ".");
}
}
| William-Hai/SimpleDemo | src/org/demo/jdk/utilapis/Bird.java | Java | agpl-3.0 | 220 | [
30522,
7427,
8917,
1012,
9703,
1012,
26219,
2243,
1012,
21183,
11733,
18136,
1025,
2270,
2465,
4743,
22164,
4875,
3085,
1063,
2797,
20014,
3177,
1027,
2321,
1025,
1030,
2058,
15637,
2270,
11675,
4875,
1006,
1007,
1063,
2291,
1012,
2041,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2011 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#include "OgreQuake3Shader.h"
#include "OgreSceneManager.h"
#include "OgreMaterial.h"
#include "OgreTechnique.h"
#include "OgrePass.h"
#include "OgreTextureUnitState.h"
#include "OgreMath.h"
#include "OgreLogManager.h"
#include "OgreTextureManager.h"
#include "OgreRoot.h"
#include "OgreMaterialManager.h"
namespace Ogre {
//-----------------------------------------------------------------------
Quake3Shader::Quake3Shader(const String& name)
{
mName = name;
numPasses = 0;
deformFunc = DEFORM_FUNC_NONE;
farbox = false;
skyDome = false;
flags = 0;
fog = false;
cullMode = MANUAL_CULL_BACK;
}
//-----------------------------------------------------------------------
Quake3Shader::~Quake3Shader()
{
}
//-----------------------------------------------------------------------
MaterialPtr Quake3Shader::createAsMaterial(int lightmapNumber)
{
String matName;
StringUtil::StrStreamType str;
String resourceGroup = ResourceGroupManager::getSingleton().getWorldResourceGroupName();
str << mName << "#" << lightmapNumber;
matName = str.str();
MaterialPtr mat = MaterialManager::getSingleton().create(matName,
resourceGroup);
Ogre::Pass* ogrePass = mat->getTechnique(0)->getPass(0);
LogManager::getSingleton().logMessage("Using Q3 shader " + mName, LML_CRITICAL);
for (int p = 0; p < numPasses; ++p)
{
TextureUnitState* t;
// Create basic texture
if (pass[p].textureName == "$lightmap")
{
StringUtil::StrStreamType str2;
str2 << "@lightmap" << lightmapNumber;
t = ogrePass->createTextureUnitState(str2.str());
}
// Animated texture support
else if (pass[p].animNumFrames > 0)
{
Real sequenceTime = pass[p].animNumFrames / pass[p].animFps;
/* Pre-load textures
We need to know if each one was loaded OK since extensions may change for each
Quake3 can still include alternate extension filenames e.g. jpg instead of tga
Pain in the arse - have to check for each frame as letters<n>.tga for example
is different per frame!
*/
for (unsigned int alt = 0; alt < pass[p].animNumFrames; ++alt)
{
if (!ResourceGroupManager::getSingleton().resourceExists(
resourceGroup, pass[p].frames[alt]))
{
// Try alternate extension
pass[p].frames[alt] = getAlternateName(pass[p].frames[alt]);
if (!ResourceGroupManager::getSingleton().resourceExists(
resourceGroup, pass[p].frames[alt]))
{
// stuffed - no texture
continue;
}
}
}
t = ogrePass->createTextureUnitState("");
t->setAnimatedTextureName(pass[p].frames, pass[p].animNumFrames, sequenceTime);
}
else
{
// Quake3 can still include alternate extension filenames e.g. jpg instead of tga
// Pain in the arse - have to check for failure
if (!ResourceGroupManager::getSingleton().resourceExists(
resourceGroup, pass[p].textureName))
{
// Try alternate extension
pass[p].textureName = getAlternateName(pass[p].textureName);
if (!ResourceGroupManager::getSingleton().resourceExists(
resourceGroup, pass[p].textureName))
{
// stuffed - no texture
continue;
}
}
t = ogrePass->createTextureUnitState(pass[p].textureName);
}
// Blending
if (p == 0)
{
// scene blend
mat->setSceneBlending(pass[p].blendSrc, pass[p].blendDest);
if (mat->isTransparent())
mat->setDepthWriteEnabled(false);
t->setColourOperation(LBO_REPLACE);
// Alpha mode
ogrePass->setAlphaRejectSettings(
pass[p].alphaFunc, pass[p].alphaVal);
}
else
{
if (pass[p].customBlend)
{
// Fallback for now
t->setColourOperation(LBO_MODULATE);
}
else
{
// simple layer blend
t->setColourOperation(pass[p].blend);
}
// Alpha mode, prefer 'most alphary'
CompareFunction currFunc = ogrePass->getAlphaRejectFunction();
unsigned char currVal = ogrePass->getAlphaRejectValue();
if (pass[p].alphaFunc > currFunc ||
(pass[p].alphaFunc == currFunc && pass[p].alphaVal < currVal))
{
ogrePass->setAlphaRejectSettings(
pass[p].alphaFunc, pass[p].alphaVal);
}
}
// Tex coords
if (pass[p].texGen == TEXGEN_BASE)
{
t->setTextureCoordSet(0);
}
else if (pass[p].texGen == TEXGEN_LIGHTMAP)
{
t->setTextureCoordSet(1);
}
else if (pass[p].texGen == TEXGEN_ENVIRONMENT)
{
t->setEnvironmentMap(true, TextureUnitState::ENV_PLANAR);
}
// Tex mod
// Scale
t->setTextureUScale(pass[p].tcModScale[0]);
t->setTextureVScale(pass[p].tcModScale[1]);
// Procedural mods
// Custom - don't use mod if generating environment
// Because I do env a different way it look horrible
if (pass[p].texGen != TEXGEN_ENVIRONMENT)
{
if (pass[p].tcModRotate)
{
t->setRotateAnimation(pass[p].tcModRotate);
}
if (pass[p].tcModScroll[0] || pass[p].tcModScroll[1])
{
if (pass[p].tcModTurbOn)
{
// Turbulent scroll
if (pass[p].tcModScroll[0])
{
t->setTransformAnimation(TextureUnitState::TT_TRANSLATE_U, WFT_SINE,
pass[p].tcModTurb[0], pass[p].tcModTurb[3], pass[p].tcModTurb[2], pass[p].tcModTurb[1]);
}
if (pass[p].tcModScroll[1])
{
t->setTransformAnimation(TextureUnitState::TT_TRANSLATE_V, WFT_SINE,
pass[p].tcModTurb[0], pass[p].tcModTurb[3], pass[p].tcModTurb[2], pass[p].tcModTurb[1]);
}
}
else
{
// Constant scroll
t->setScrollAnimation(pass[p].tcModScroll[0], pass[p].tcModScroll[1]);
}
}
if (pass[p].tcModStretchWave != SHADER_FUNC_NONE)
{
WaveformType wft = WFT_SINE;
switch(pass[p].tcModStretchWave)
{
case SHADER_FUNC_SIN:
wft = WFT_SINE;
break;
case SHADER_FUNC_TRIANGLE:
wft = WFT_TRIANGLE;
break;
case SHADER_FUNC_SQUARE:
wft = WFT_SQUARE;
break;
case SHADER_FUNC_SAWTOOTH:
wft = WFT_SAWTOOTH;
break;
case SHADER_FUNC_INVERSESAWTOOTH:
wft = WFT_INVERSE_SAWTOOTH;
break;
default:
break;
}
// Create wave-based stretcher
t->setTransformAnimation(TextureUnitState::TT_SCALE_U, wft, pass[p].tcModStretchParams[3],
pass[p].tcModStretchParams[0], pass[p].tcModStretchParams[2], pass[p].tcModStretchParams[1]);
t->setTransformAnimation(TextureUnitState::TT_SCALE_V, wft, pass[p].tcModStretchParams[3],
pass[p].tcModStretchParams[0], pass[p].tcModStretchParams[2], pass[p].tcModStretchParams[1]);
}
}
// Address mode
t->setTextureAddressingMode(pass[p].addressMode);
//assert(!t->isBlank());
}
// Do farbox (create new material)
// Set culling mode and lighting to defaults
mat->setCullingMode(CULL_NONE);
mat->setManualCullingMode(cullMode);
mat->setLightingEnabled(false);
mat->load();
return mat;
}
String Quake3Shader::getAlternateName(const String& texName)
{
// Get alternative JPG to TGA and vice versa
size_t pos;
String ext, base;
pos = texName.find_last_of(".");
ext = texName.substr(pos, 4);
StringUtil::toLowerCase(ext);
base = texName.substr(0,pos);
if (ext == ".jpg")
{
return base + ".tga";
}
else
{
return base + ".jpg";
}
}
}
| ruleless/ogre | PlugIns/BSPSceneManager/src/OgreQuake3Shader.cpp | C++ | mit | 11,012 | [
30522,
1013,
1008,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Threading;
namespace NoTaskUtility
{
/// <summary>
/// Provides extension methods for the <see cref="CancellationToken"/> class.
/// </summary>
public static class CancellationTokenExtensions
{
/// <summary>
/// Wait until the token is cancelled or timed out.
/// </summary>
/// <param name="token">The cancellation token.</param>
/// <param name="timeout">The time to wait.</param>
public static bool WaitCancellationRequested(
this CancellationToken token,
TimeSpan timeout)
{
return token.WaitHandle.WaitOne(timeout);
}
}
}
| CrazyTuna/no-task-utility | NoTaskUtility/CancellationTokenExtensions.cs | C# | mit | 682 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
11689,
2075,
1025,
3415,
15327,
2025,
19895,
21823,
18605,
1063,
1013,
1013,
1013,
1026,
12654,
1028,
1013,
1013,
1013,
3640,
5331,
4725,
2005,
1996,
1026,
2156,
13675,
12879,
1027,
1000,
16990,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.fasterxml.jackson.databind.deser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.util.AccessPattern;
/**
* Helper interface implemented by classes that are to be used as
* null providers during deserialization. Most importantly implemented by
* {@link com.fasterxml.jackson.databind.JsonDeserializer} (as a mix-in
* interface), but also by converters used to support more configurable
* null replacement.
*
* @since 2.9
*/
public interface NullValueProvider
{
/**
* Method called to possibly convert incoming `null` token (read via
* underlying streaming input source) into other value of type accessor
* supports. May return `null`, or value compatible with type binding.
*<p>
* NOTE: if {@link #getNullAccessPattern()} returns `ALWAYS_NULL` or
* `CONSTANT`, this method WILL NOT use provided `ctxt` and it may thus
* be passed as `null`.
*/
public Object getNullValue(DeserializationContext ctxt) throws JsonMappingException;
/**
* Accessor that may be used to determine if and when provider must be called to
* access null replacement value.
*/
public AccessPattern getNullAccessPattern();
}
| lamsfoundation/lams | 3rdParty_sources/jackson/com/fasterxml/jackson/databind/deser/NullValueProvider.java | Java | gpl-2.0 | 1,303 | [
30522,
7427,
4012,
1012,
5514,
2595,
19968,
1012,
4027,
1012,
2951,
8428,
2094,
1012,
4078,
2121,
1025,
12324,
4012,
1012,
5514,
2595,
19968,
1012,
4027,
1012,
2951,
8428,
2094,
1012,
4078,
11610,
22731,
8663,
18209,
1025,
12324,
4012,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Firmware Assisted dump header file.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Copyright 2011 IBM Corporation
* Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
*/
#ifndef __PPC64_FA_DUMP_H__
#define __PPC64_FA_DUMP_H__
#ifdef CONFIG_FA_DUMP
/*
* The RMA region will be saved for later dumping when kernel crashes.
* RMA is Real Mode Area, the first block of logical memory address owned
* by logical partition, containing the storage that may be accessed with
* translate off.
*/
#define RMA_START 0x0
#define RMA_END (ppc64_rma_size)
/*
* On some Power systems where RMO is 128MB, it still requires minimum of
* 256MB for kernel to boot successfully. When kdump infrastructure is
* configured to save vmcore over network, we run into OOM issue while
* loading modules related to network setup. Hence we need aditional 64M
* of memory to avoid OOM issue.
*/
#define MIN_BOOT_MEM (((RMA_END < (0x1UL << 28)) ? (0x1UL << 28) : RMA_END) \
+ (0x1UL << 26))
#define memblock_num_regions(memblock_type) (memblock.memblock_type.cnt)
/* Firmware provided dump sections */
#define FADUMP_CPU_STATE_DATA 0x0001
#define FADUMP_HPTE_REGION 0x0002
#define FADUMP_REAL_MODE_REGION 0x0011
/* Dump request flag */
#define FADUMP_REQUEST_FLAG 0x00000001
/* FAD commands */
#define FADUMP_REGISTER 1
#define FADUMP_UNREGISTER 2
#define FADUMP_INVALIDATE 3
/* Dump status flag */
#define FADUMP_ERROR_FLAG 0x2000
#define FADUMP_CPU_ID_MASK ((1UL << 32) - 1)
#define CPU_UNKNOWN (~((u32)0))
/* Utility macros */
#define SKIP_TO_NEXT_CPU(reg_entry) \
({ \
while (be64_to_cpu(reg_entry->reg_id) != REG_ID("CPUEND")) \
reg_entry++; \
reg_entry++; \
})
extern int crashing_cpu;
/* Kernel Dump section info */
struct fadump_section {
__be32 request_flag;
__be16 source_data_type;
__be16 error_flags;
__be64 source_address;
__be64 source_len;
__be64 bytes_dumped;
__be64 destination_address;
};
/* ibm,configure-kernel-dump header. */
struct fadump_section_header {
__be32 dump_format_version;
__be16 dump_num_sections;
__be16 dump_status_flag;
__be32 offset_first_dump_section;
/* Fields for disk dump option. */
__be32 dd_block_size;
__be64 dd_block_offset;
__be64 dd_num_blocks;
__be32 dd_offset_disk_path;
/* Maximum time allowed to prevent an automatic dump-reboot. */
__be32 max_time_auto;
};
/*
* Firmware Assisted dump memory structure. This structure is required for
* registering future kernel dump with power firmware through rtas call.
*
* No disk dump option. Hence disk dump path string section is not included.
*/
struct fadump_mem_struct {
struct fadump_section_header header;
/* Kernel dump sections */
struct fadump_section cpu_state_data;
struct fadump_section hpte_region;
struct fadump_section rmr_region;
};
/* Firmware-assisted dump configuration details. */
struct fw_dump {
unsigned long cpu_state_data_size;
unsigned long hpte_region_size;
unsigned long boot_memory_size;
unsigned long reserve_dump_area_start;
unsigned long reserve_dump_area_size;
/* cmd line option during boot */
unsigned long reserve_bootvar;
unsigned long fadumphdr_addr;
unsigned long cpu_notes_buf;
unsigned long cpu_notes_buf_size;
int ibm_configure_kernel_dump;
unsigned long fadump_enabled:1;
unsigned long fadump_supported:1;
unsigned long dump_active:1;
unsigned long dump_registered:1;
};
/*
* Copy the ascii values for first 8 characters from a string into u64
* variable at their respective indexes.
* e.g.
* The string "FADMPINF" will be converted into 0x4641444d50494e46
*/
static inline u64 str_to_u64(const char *str)
{
u64 val = 0;
int i;
for (i = 0; i < sizeof(val); i++)
val = (*str) ? (val << 8) | *str++ : val << 8;
return val;
}
#define STR_TO_HEX(x) str_to_u64(x)
#define REG_ID(x) str_to_u64(x)
#define FADUMP_CRASH_INFO_MAGIC STR_TO_HEX("FADMPINF")
#define REGSAVE_AREA_MAGIC STR_TO_HEX("REGSAVE")
/* The firmware-assisted dump format.
*
* The register save area is an area in the partition's memory used to preserve
* the register contents (CPU state data) for the active CPUs during a firmware
* assisted dump. The dump format contains register save area header followed
* by register entries. Each list of registers for a CPU starts with
* "CPUSTRT" and ends with "CPUEND".
*/
/* Register save area header. */
struct fadump_reg_save_area_header {
__be64 magic_number;
__be32 version;
__be32 num_cpu_offset;
};
/* Register entry. */
struct fadump_reg_entry {
__be64 reg_id;
__be64 reg_value;
};
/* fadump crash info structure */
struct fadump_crash_info_header {
u64 magic_number;
u64 elfcorehdr_addr;
u32 crashing_cpu;
struct pt_regs regs;
struct cpumask online_mask;
};
/* Crash memory ranges */
#define INIT_CRASHMEM_RANGES (INIT_MEMBLOCK_REGIONS + 2)
struct fad_crash_memory_ranges {
unsigned long long base;
unsigned long long size;
};
extern int early_init_dt_scan_fw_dump(unsigned long node,
const char *uname, int depth, void *data);
extern int fadump_reserve_mem(void);
extern int setup_fadump(void);
extern int is_fadump_active(void);
extern void crash_fadump(struct pt_regs *, const char *);
extern void fadump_cleanup(void);
#else /* CONFIG_FA_DUMP */
static inline int is_fadump_active(void) { return 0; }
static inline void crash_fadump(struct pt_regs *regs, const char *str) { }
#endif
#endif
| eabatalov/au-linux-kernel-autumn-2017 | linux/arch/powerpc/include/asm/fadump.h | C | gpl-3.0 | 6,067 | [
30522,
1013,
1008,
1008,
3813,
8059,
7197,
15653,
20346,
5371,
1012,
1008,
1008,
2023,
2565,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,
1008,
2009,
2104,
1996,
3408,
1997,
1996,
27004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# cvDetect : Simple OpenCV Image/Webcam Detections for R
Simple R package for OpenCV face/hand/finger detection demo, with the help of [ROpenCVLite](https://github.com/swarm-lab/ROpenCVLite) and Rcpp packages. Currently Windows only.
(Also check http://steve-chen.tw/?p=737 (Traditional Chinese page) )

## Related tool/package/library versions for creating this package
__Winodws 7 OS 64 bit__
__R__: 3.4.0
__Rtools__: Rtools34.exe
__Rcpp__: 0.12.10
__OpenCV__: 3.2.0
__ROpenCVLite__: 0.1.1
## Install cvDetect binary package (Windows only)
1. __Download ROpencv_x64.zip +/- ROpencv_x86_part.zip__
These are compiled OpenCV 3.2.0 binaries/libraries for Windows by Rtools34 mingw G++, using ROpenCVLite package.
ROpencv_x64.zip includes etc, include, and x64 sub-directories.
ROpencv_x86.zip only includes x87 sub-directory
2. __Uncompress zip file(s) in some directory, e.g., d:\ROpencv__
Under d:\ROpencv, there should be etc, include, x64, and/or x86 subdirectories.
__Note:__
If you feel uncomfortable to download binary files in 1. and 2. in this page, you can build them yourself by installing [ROpenCVLite](https://github.com/swarm-lab/ROpenCVLite) package and copy all the files and sub-directories under the compiled "opencv" directory it builds to a new directory (e.g. d:\ROpencv). The compiled "opencv" directory can be located in, e.g., d:\R\R-3.4.0\library\ROpenCVLite .
3. __Modify PATH environment variable via Windows Control Panel:__
add ROpencv binray directories to __PATH__ environment variable.
This ensures R to find related OpenCV dll files when running cvDetect.
e.g.
<pre>
d:\ROpencv\x64\mingw\bin;d:\ROpencv\x86\mingw\bin;...............
or only
d:\ROpencv\x64\mingw\bin;...............
</pre>
4. __Download cvDetect_0.1.1.zip:__
In R, install zip file via "Install package(s) from local files..." menu
## Compile and install cvDetect source package (Windows only)
We have to install [Rtools](https://cran.r-project.org/bin/windows/Rtools/) if we want to compile cvDetect from source.
1. __Follow Stepe 1 to Step 3 in above binary package installation procedure.__
2. __Add an OPENCV environment variable via Windows Control Panel:__
add, e.g., "d:\Ropencv" , to a new __OPENCV__ environment variable.
This OPENCV environment varible is used in Makevars.win inside src directory.
3. __Download cvDetect_0.1.1.tar.gz in this page.__
4. __In R:__
Suppose we save cvDetect_0.1.1.tar.gz under d:\temp directory:
<pre>
install.packages("d:/temp/cvDetect_0.1.1.tar.gz",repos=NULL,type="source")
</pre>
## Usage
Enter 'q' or 'Q' to stop these funcitons.
If cameraId = 0 does not work, try 1, 2,....
<pre>
library(cvDetect)
?face_detect
?hand_detect
?finger_detect
# face detection via webcam
face_detect(cameraId=0)
# face detection in Photo
face_detect(imgFile="d:/pic/somePeople.jpg")
# hand/palm detection via webcam
hand_detect(cameraId=0)
# finger detection via webcam
finger_detect(cameraId=0)
</pre>
## Original C++ detection source codes used in cvDetect
__Face detection:__ OpenCV library demo code
https://github.com/opencv/opencv_attic/blob/master/opencv/samples/cpp/multicascadeclassifier.cpp
__Hand/Palm detection:__ by Andol Li
https://www.andol.me/1830/detecting-hand-gestures-using-haarcascades-training/
__Finger detection:__ by Abner Matheus
https://picoledelimao.github.io/blog/2015/11/15/fingertip-detection-on-opencv/
| stevechctw/cvDetect | README.md | Markdown | gpl-3.0 | 3,576 | [
30522,
1001,
26226,
3207,
26557,
2102,
1024,
3722,
2330,
2278,
2615,
3746,
1013,
4773,
28727,
10788,
2015,
2005,
1054,
3722,
1054,
7427,
2005,
2330,
2278,
2615,
2227,
1013,
2192,
1013,
4344,
10788,
9703,
1010,
2007,
1996,
2393,
1997,
30524,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Waldo\OpenIdConnect\ProviderBundle\Tests\Services;
use Waldo\OpenIdConnect\ProviderBundle\Services\AuthorizationEndpoint;
use Symfony\Component\HttpFoundation\Request;
/**
* AuthorizationEndpointTest
*
* @group AuthorizationEndpoint
* @author valérian Girard <valerian.girard@educagri.fr>
*/
class AuthorizationEndpointTest extends \PHPUnit_Framework_TestCase
{
private $authenticationRequestValidator;
private $authenticationCodeFlow;
protected function tearDown()
{
parent::tearDown();
$this->authenticationCodeFlow = null;
$this->authenticationRequestValidator = null;
}
public function testHandleRequestShouldReturnRespons()
{
$authEndpoint = $this->getAuthorizationEndpoint();
$this->authenticationRequestValidator
->expects($this->once())
->method("validate")
/* @var $o Waldo\OpenIdConnect\ModelBundle\Entity\Request\Authentication; */
->with($this->callback(function($o) {
$test = true;
$test &= $o instanceof \Waldo\OpenIdConnect\ModelBundle\Entity\Request\Authentication;
$test &= count($o->getScope()) == 3;
$test &= in_array('openid', $o->getScope());
$test &= in_array('scope1', $o->getScope());
$test &= in_array('scope2', $o->getScope());
$test &= $o->getClientId() == "one_clientId";
$test &= $o->getRedirectUri() == "one_redirectUri";
$test &= $o->getState() == "one_state";
$test &= $o->getResponseMode() == "one_responseMode";
$test &= $o->getNonce() == "one_nonce";
$test &= $o->getPrompt() == "one_prompt";
$test &= $o->getMaxAge() == "36000";
$test &= $o->getUiLocales() == "one_uiLocales";
$test &= $o->getIdTokenHint() == "one_idTokenHint";
$test &= $o->getLoginHint() == "one_loginHint";
return $test;
}))
->will($this->returnValue(true));
$this->authenticationCodeFlow
->expects($this->once())
->method("handle")
->with($this->callback(function($o){
return $o instanceof \Waldo\OpenIdConnect\ModelBundle\Entity\Request\Authentication;
}))
->will($this->returnValue("good"));
$request = new Request();
$request->query->add(array(
"scope" => "openid scope1 scope2",
"response_type" => "code",
'client_id' => 'one_clientId',
'redirect_uri' => 'one_redirectUri',
'state' => 'one_state',
'response_mode' => 'one_responseMode',
'nonce' => 'one_nonce',
'display' => 'one_display',
'prompt' => 'one_prompt',
'max_age' => '36000',
'ui_locales' => 'one_uiLocales',
'id_token_hint' => 'one_idTokenHint',
'login_hint' => 'one_loginHint'
));
$result = $authEndpoint->handleRequest($request);
$this->assertEquals("good", $result);
}
/**
* @expectedException Waldo\OpenIdConnect\ProviderBundle\Exception\AuthenticationRequestException
* @expectedExceptionMessage authentication flow is not yet implemented
*/
public function testShouldFailForUnknowFlow()
{
$authEndpoint = $this->getAuthorizationEndpoint();
$request = new Request();
$request->query->add(array(
"response_type" => "id_token"
));
$authEndpoint->handleRequest($request);
}
/**
* @expectedException Waldo\OpenIdConnect\ProviderBundle\Exception\AuthenticationRequestException
* @expectedExceptionMessage authentication flow is not yet implemented
*/
public function testShouldFailForUnknowFlow2()
{
$authEndpoint = $this->getAuthorizationEndpoint();
$request = new Request();
$request->query->add(array(
"response_type" => "code id_token"
));
$authEndpoint->handleRequest($request);
}
/**
* @expectedException Waldo\OpenIdConnect\ProviderBundle\Exception\AuthenticationRequestException
* @expectedExceptionMessage unknow authentication flow
*/
public function testShouldFailForUnknowFlow3()
{
$authEndpoint = $this->getAuthorizationEndpoint();
$request = new Request();
$request->query->add(array(
"response_type" => "dumb"
));
$authEndpoint->handleRequest($request);
}
public function testShouldFailForUnknowFlowAndReturnRedirection()
{
$authEndpoint = $this->getAuthorizationEndpoint();
$request = new Request();
$request->query->add(array(
"response_type" => "dumb",
'redirect_uri' => 'one_redirectUri',
'state' => 'one_state'
));
$result = $authEndpoint->handleRequest($request);
$this->assertInstanceOf("Symfony\Component\HttpFoundation\RedirectResponse", $result);
$this->assertEquals(302, $result->getStatusCode());
$this->assertEquals("http://localhostone_redirectUri?error=invalid_request&error_description=unknow%20authentication%20flow&state=one_state", $result->headers->get("location"));
}
private function getAuthorizationEndpoint()
{
return new AuthorizationEndpoint($this->mockAuthenticationRequestValidator(), $this->mockAuthenticationCodeFlow());
}
private function mockAuthenticationRequestValidator()
{
return $this->authenticationRequestValidator = ( $this->authenticationRequestValidator === null )
? $this->getMockBuilder("Waldo\OpenIdConnect\ProviderBundle\Constraints\AuthenticationRequestValidator")
->disableOriginalConstructor()->getMock()
: $this->authenticationRequestValidator;
}
private function mockAuthenticationCodeFlow()
{
return $this->authenticationCodeFlow = ($this->authenticationCodeFlow === null)
? $this->getMockBuilder("Waldo\OpenIdConnect\ProviderBundle\AuthenticationFlows\AuthenticationCodeFlow")
->disableOriginalConstructor()->getMock()
: $this->authenticationCodeFlow;
}
}
| waldo2188/OpenIdConnectProvider | src/Waldo/OpenIdConnect/ProviderBundle/Tests/Services/AuthorizationEndpointTest.php | PHP | mit | 6,611 | [
30522,
1026,
1029,
25718,
3415,
15327,
28806,
1032,
2330,
3593,
8663,
2638,
6593,
1032,
10802,
27265,
2571,
1032,
5852,
1032,
2578,
1025,
2224,
28806,
1032,
2330,
3593,
8663,
2638,
6593,
1032,
10802,
27265,
2571,
1032,
2578,
1032,
20104,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using Malbec.Reactive;
using Malbec.Reactive.Patches;
using Malbec.Reactive.Subscribers;
namespace Example.HelloWorld
{
internal class Program
{
private static void Main()
{
var var1 = Composition.Variable("Hello");
var var2 = Composition.Variable("World");
// Prints "Hello World!" to console
using (Composition.F((str1, str2) => $"{str1} {str2}!", var1, var2).ToConsole())
{
// Prints "Goodbye World!"
var1.Assign("Goodbye").Apply();
}
}
}
} | rbec/malbec | source/Example.HelloWorld/Program.cs | C# | gpl-2.0 | 518 | [
30522,
2478,
15451,
4783,
2278,
1012,
22643,
1025,
2478,
15451,
4783,
2278,
1012,
22643,
1012,
13864,
1025,
2478,
15451,
4783,
2278,
1012,
22643,
1012,
17073,
1025,
3415,
15327,
2742,
1012,
7592,
11108,
1063,
4722,
2465,
2565,
1063,
2797,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?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_Gdata
* @subpackage Gdata
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: EntryLink.php,v 1.1.2.3 2011-05-30 08:30:46 root Exp $
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* @see Zend_Gdata_Entry
*/
require_once 'Zend/Gdata/Entry.php';
/**
* Represents the gd:entryLink element
*
* @category Zend
* @package Zend_Gdata
* @subpackage Gdata
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Extension_EntryLink extends Zend_Gdata_Extension
{
protected $_rootElement = 'entryLink';
protected $_href = null;
protected $_readOnly = null;
protected $_rel = null;
protected $_entry = null;
public function __construct($href = null, $rel = null,
$readOnly = null, $entry = null)
{
parent::__construct();
$this->_href = $href;
$this->_readOnly = $readOnly;
$this->_rel = $rel;
$this->_entry = $entry;
}
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_href !== null) {
$element->setAttribute('href', $this->_href);
}
if ($this->_readOnly !== null) {
$element->setAttribute('readOnly', ($this->_readOnly ? "true" : "false"));
}
if ($this->_rel !== null) {
$element->setAttribute('rel', $this->_rel);
}
if ($this->_entry !== null) {
$element->appendChild($this->_entry->getDOM($element->ownerDocument));
}
return $element;
}
protected function takeChildFromDOM($child)
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('atom') . ':' . 'entry';
$entry = new Zend_Gdata_Entry();
$entry->transferFromDOM($child);
$this->_entry = $entry;
break;
default:
parent::takeChildFromDOM($child);
break;
}
}
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'href':
$this->_href = $attribute->nodeValue;
break;
case 'readOnly':
if ($attribute->nodeValue == "true") {
$this->_readOnly = true;
}
else if ($attribute->nodeValue == "false") {
$this->_readOnly = false;
}
else {
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
}
break;
case 'rel':
$this->_rel = $attribute->nodeValue;
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* @return string
*/
public function getHref()
{
return $this->_href;
}
public function setHref($value)
{
$this->_href = $value;
return $this;
}
public function getReadOnly()
{
return $this->_readOnly;
}
public function setReadOnly($value)
{
$this->_readOnly = $value;
return $this;
}
public function getRel()
{
return $this->_rel;
}
public function setRel($value)
{
$this->_rel = $value;
return $this;
}
public function getEntry()
{
return $this->_entry;
}
public function setEntry($value)
{
$this->_entry = $value;
return $this;
}
}
| MailCleaner/MailCleaner | www/framework/Zend/Gdata/Extension/EntryLink.php | PHP | gpl-3.0 | 4,414 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
16729,
2094,
7705,
1008,
1008,
6105,
1008,
1008,
2023,
3120,
5371,
2003,
3395,
2000,
1996,
2047,
18667,
2094,
6105,
2008,
2003,
24378,
1008,
2007,
2023,
7427,
1999,
1996,
5371,
6105,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import numpy as np
import cv2
from scipy import interpolate
from random import randint
import IPython
from alan.rgbd.basic_imaging import cos,sin
from alan.synthetic.synthetic_util import rand_sign
from alan.core.points import Point
"""
generates rope using non-holonomic car model dynamics (moves with turn radius)
generates labels at ends of rope
parameters:
h, w of image matrix
l, w of rope
returns:
image matrix with rope drawn
[left label, right label]
"""
def get_rope_car(h = 420, w = 420, rope_l_pixels = 800 , rope_w_pixels = 8, pix_per_step = 10, steps_per_curve = 10, lo_turn_delta = 5, hi_turn_delta = 10):
#randomize start
init_pos = np.array([randint(0, w - 1), randint(0, h - 1), randint(0, 360)])
all_positions = np.array([init_pos])
#dependent parameter (use float division)
num_curves = int(rope_l_pixels/(steps_per_curve * pix_per_step * 1.0))
#point generation
for c in range(num_curves):
turn_delta = rand_sign() * randint(lo_turn_delta, hi_turn_delta)
for s in range(steps_per_curve):
curr_pos = all_positions[-1]
delta_pos = np.array([pix_per_step * cos(curr_pos[2]), pix_per_step * sin(curr_pos[2]), turn_delta])
all_positions = np.append(all_positions, [curr_pos + delta_pos], axis = 0)
#center the points (avoid leaving image bounds)
mid_x_points = (min(all_positions[:,0]) + max(all_positions[:,0]))/2.0
mid_y_points = (min(all_positions[:,1]) + max(all_positions[:,1]))/2.0
for pos in all_positions:
pos[0] -= (mid_x_points - w/2.0)
pos[1] -= (mid_y_points - h/2.0)
#draw rope
image = np.zeros((h, w))
prev_pos = all_positions[0]
for curr_pos in all_positions[1:]:
cv2.line(image, (int(prev_pos[0]), int(prev_pos[1])), (int(curr_pos[0]), int(curr_pos[1])), 255, rope_w_pixels)
prev_pos = curr_pos
#get endpoint labels, sorted by x
labels = [all_positions[0], all_positions[-1]]
if labels[0][0] > labels[1][0]:
labels = [labels[1], labels[0]]
#labels = [[l[0], l[1], l[2] + 90] for l in labels]
#Ignoring Rotation for Now
labels = [[l[0], l[1], 0] for l in labels]
#rejection sampling
for num_label in range(2):
c_label = labels[num_label]
#case 1- endpoints not in image
if check_bounds(c_label, [w, h]) == -1:
return image, labels, -1
#case 2- endpoint on top of other rope segment
if check_overlap(c_label, [w, h], image, rope_w_pixels) == -1:
return image, labels, -1
return image, labels, 1
def check_bounds(label, bounds):
bound_tolerance = 5
for dim in range(2):
if label[dim] < bound_tolerance or label[dim] > (bounds[dim] - 1 - bound_tolerance):
return -1
return 0
def check_overlap(label, bounds, image, rope_w_pixels):
lb = []
ub = []
for dim in range(2):
lb.append(int(max(0, label[dim] - rope_w_pixels)))
ub.append(int(min(bounds[dim] - 1, label[dim] + rope_w_pixels)))
pixel_sum = 0
for x in range(lb[0], ub[0]):
for y in range(lb[1], ub[1]):
pixel_sum += (image[y][x]/255.0)
#if more than 60% of adjacent (2 * rope_w x 2 * rope_w) pixels are white, endpoint is probably lying on rope
expected_sum = 0.6 * (ub[1] - lb[1]) * (ub[0] - lb[0])
if pixel_sum > expected_sum:
return -1
return 0
| mdlaskey/DeepLfD | src/deep_lfd/synthetic/synthetic_rope.py | Python | gpl-3.0 | 3,594 | [
30522,
12324,
16371,
8737,
2100,
2004,
27937,
12324,
26226,
2475,
2013,
16596,
7685,
12324,
6970,
18155,
3686,
2013,
6721,
12324,
14566,
18447,
12324,
12997,
22123,
8747,
2013,
5070,
1012,
1054,
18259,
2094,
1012,
3937,
1035,
12126,
12324,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "bigWig.h"
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <assert.h>
void bwPrintHdr(bigWigFile_t *bw) {
uint64_t i;
int64_t i64;
printf("Version: %"PRIu16"\n", bw->hdr->version);
printf("Levels: %"PRIu16"\n", bw->hdr->nLevels);
printf("ctOffset: 0x%"PRIx64"\n", bw->hdr->ctOffset);
printf("dataOffset: 0x%"PRIx64"\n", bw->hdr->dataOffset);
printf("indexOffset: 0x%"PRIx64"\n", bw->hdr->indexOffset);
printf("sqlOffset: 0x%"PRIx64"\n", bw->hdr->sqlOffset);
printf("summaryOffset: 0x%"PRIx64"\n", bw->hdr->summaryOffset);
printf("bufSize: %"PRIu32"\n", bw->hdr->bufSize);
printf("extensionOffset: 0x%"PRIx64"\n", bw->hdr->extensionOffset);
if(bw->hdr->nLevels) {
printf(" i level data index\n");
}
for(i=0; i<bw->hdr->nLevels; i++) {
printf("\t%"PRIu64"\t%"PRIu32"\t%"PRIx64"\t%"PRIx64"\n", i, bw->hdr->zoomHdrs->level[i], bw->hdr->zoomHdrs->dataOffset[i], bw->hdr->zoomHdrs->indexOffset[i]);
}
printf("nBasesCovered: %"PRIu64"\n", bw->hdr->nBasesCovered);
printf("minVal: %f\n", bw->hdr->minVal);
printf("maxVal: %f\n", bw->hdr->maxVal);
printf("sumData: %f\n", bw->hdr->sumData);
printf("sumSquared: %f\n", bw->hdr->sumSquared);
//Chromosome idx/name/length
if(bw->cl) {
printf("Chromosome List\n");
printf(" idx\tChrom\tLength (bases)\n");
for(i64=0; i64<bw->cl->nKeys; i64++) {
printf(" %"PRIu64"\t%s\t%"PRIu32"\n", i64, bw->cl->chrom[i64], bw->cl->len[i64]);
}
}
}
void bwPrintIndexNode(bwRTreeNode_t *node, int level) {
uint16_t i;
if(!node) return;
for(i=0; i<node->nChildren; i++) {
if(node->isLeaf) {
printf(" %i\t%"PRIu32"\t%"PRIu32"\t%"PRIu32"\t%"PRIu32"\t0x%"PRIx64"\t%"PRIu64"\n", level,\
node->chrIdxStart[i], \
node->baseStart[i], \
node->chrIdxEnd[i], \
node->baseEnd[i], \
node->dataOffset[i], \
node->x.size[i]);
} else {
printf(" %i\t%"PRIu32"\t%"PRIu32"\t%"PRIu32"\t%"PRIu32"\t0x%"PRIx64"\tNA\n", level,\
node->chrIdxStart[i], \
node->baseStart[i], \
node->chrIdxEnd[i], \
node->baseEnd[i], \
node->dataOffset[i]);
bwPrintIndexNode(node->x.child[i], level+1);
}
}
}
void bwPrintIndexTree(bigWigFile_t *fp) {
printf("\nIndex tree:\n");
printf("nItems:\t%"PRIu64"\n", fp->idx->nItems);
printf("chrIdxStart:\t%"PRIu32"\n", fp->idx->chrIdxStart);
printf("baseStart:\t%"PRIu32"\n", fp->idx->baseStart);
printf("chrIdxEnd:\t%"PRIu32"\n", fp->idx->chrIdxEnd);
printf("baseEnd:\t%"PRIu32"\n", fp->idx->baseEnd);
printf("idxSize:\t%"PRIu64"\n", fp->idx->idxSize);
printf(" level\tchrIdxStart\tbaseStart\tchrIdxEnd\tbaseEnd\tchild\tsize\n");
bwPrintIndexNode(fp->idx->root, 0);
}
void printIntervals(bwOverlappingIntervals_t *ints, uint32_t start) {
uint32_t i;
if(!ints) return;
for(i=0; i<ints->l; i++) {
if(ints->start && ints->end) {
printf("Interval %"PRIu32"\t%"PRIu32"-%"PRIu32": %f\n",i, ints->start[i], ints->end[i], ints->value[i]);
} else if(ints->start) {
printf("Interval %"PRIu32"\t%"PRIu32"-%"PRIu32": %f\n",i, ints->start[i], ints->start[i]+1, ints->value[i]);
} else {
printf("Interval %"PRIu32"\t%"PRIu32"-%"PRIu32": %f\n",i, start+i, start+i+1, ints->value[i]);
}
}
}
int main(int argc, char *argv[]) {
bigWigFile_t *fp = NULL;
bwOverlappingIntervals_t *intervals = NULL;
double *stats = NULL;
if(argc != 2) {
fprintf(stderr, "Usage: %s {file.bw|URL://path/file.bw}\n", argv[0]);
return 1;
}
if(bwInit(1<<17) != 0) {
fprintf(stderr, "Received an error in bwInit\n");
return 1;
}
assert(bwIsBigWig(argv[1], NULL) == 1);
assert(bbIsBigBed(argv[1], NULL) == 0);
fp = bwOpen(argv[1], NULL, "r");
if(!fp) {
fprintf(stderr, "An error occured while opening %s\n", argv[1]);
return 1;
}
bwPrintHdr(fp);
bwPrintIndexTree(fp);
//Try to get some blocks
printf("1:0-99\n");
intervals = bwGetValues(fp, "1", 0, 99, 0);
printIntervals(intervals,0);
bwDestroyOverlappingIntervals(intervals);
printf("1:99-1000\n");
intervals = bwGetValues(fp, "1", 99, 1000, 0);
printIntervals(intervals,0);
bwDestroyOverlappingIntervals(intervals);
printf("1:99-150\n");
intervals = bwGetValues(fp, "1", 99, 150, 1);
printIntervals(intervals,99);
bwDestroyOverlappingIntervals(intervals);
printf("1:99-100\n");
intervals = bwGetValues(fp, "1", 99, 100, 0);
printIntervals(intervals,0);
bwDestroyOverlappingIntervals(intervals);
printf("1:151-1000\n");
intervals = bwGetValues(fp, "1", 151, 1000, 0);
printIntervals(intervals,0);
bwDestroyOverlappingIntervals(intervals);
printf("chr1:0-100\n");
intervals = bwGetValues(fp, "chr1", 0, 100, 0);
printIntervals(intervals,0);
bwDestroyOverlappingIntervals(intervals);
stats = bwStats(fp, "1", 0, 200, 1, mean);
assert(stats);
printf("1:0-1000 mean: %f\n", *stats);
free(stats);
stats = bwStats(fp, "1", 0, 200, 2, mean);
assert(stats);
printf("1:0-1000 mean: %f %f\n", stats[0], stats[1]);
free(stats);
stats = bwStats(fp, "1", 0, 200, 1, dev);
assert(stats);
printf("1:0-1000 std. dev.: %f\n", *stats);
free(stats);
stats = bwStats(fp, "1", 0, 200, 2, dev);
assert(stats);
printf("1:0-1000 std. dev.: %f %f\n", stats[0], stats[1]);
free(stats);
stats = bwStats(fp, "1", 0, 200, 1, min);
assert(stats);
printf("1:0-1000 min: %f\n", *stats);
free(stats);
stats = bwStats(fp, "1", 0, 200, 2, min);
assert(stats);
printf("1:0-1000 min: %f %f\n", stats[0], stats[1]);
free(stats);
stats = bwStats(fp, "1", 0, 200, 1, max);
assert(stats);
printf("1:0-1000 max: %f\n", *stats);
free(stats);
stats = bwStats(fp, "1", 0, 200, 2, max);
assert(stats);
printf("1:0-1000 max: %f %f\n", stats[0], stats[1]);
free(stats);
stats = bwStats(fp, "1", 0, 200, 1, cov);
assert(stats);
printf("1:0-1000 coverage: %f\n", *stats);
free(stats);
stats = bwStats(fp, "1", 0, 200, 2, cov);
assert(stats);
printf("1:0-1000 coverage: %f %f\n", stats[0], stats[1]);
free(stats);
stats = bwStats(fp, "1", 0, 200, 1, sum);
assert(stats);
printf("1:0-200 sum: %f\n", *stats); //72.1
free(stats);
stats = bwStats(fp, "1", 100, 151, 2, sum);
assert(stats);
printf("1:0-200 sum: %f %f\n", stats[0], stats[1]); //35.0, 36.5
free(stats);
printf("1:0-200000000 intervals\n");
intervals = bwGetOverlappingIntervals(fp, "1", 0, 200000000);
printIntervals(intervals,0);
bwDestroyOverlappingIntervals(intervals);
printf("10:0-200000000 intervals\n");
intervals = bwGetOverlappingIntervals(fp, "10", 0, 200000000);
printIntervals(intervals,0);
bwDestroyOverlappingIntervals(intervals);
bwClose(fp);
bwCleanup();
return 0;
}
| dpryan79/libBigWig | test/testLocal.c | C | mit | 7,301 | [
30522,
1001,
2421,
1000,
2502,
16279,
1012,
1044,
1000,
1001,
2421,
1026,
2358,
20617,
1012,
1044,
1028,
1001,
2421,
1026,
20014,
13874,
2015,
1012,
1044,
1028,
1001,
2421,
1026,
2358,
19422,
12322,
1012,
1044,
1028,
1001,
2421,
1026,
20865... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Get gzip</title>
</head>
<body><div class="manualnavbar" style="text-align: center;">
<div class="prev" style="text-align: left; float: left;"><a href="httpresponse.getfile.html">HttpResponse::getFile</a></div>
<div class="next" style="text-align: right; float: right;"><a href="httpresponse.getheader.html">HttpResponse::getHeader</a></div>
<div class="up"><a href="class.httpresponse.html">HttpResponse</a></div>
<div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="httpresponse.getgzip" class="refentry">
<div class="refnamediv">
<h1 class="refname">HttpResponse::getGzip</h1>
<p class="verinfo">(PECL pecl_http >= 0.10.0)</p><p class="refpurpose"><span class="refname">HttpResponse::getGzip</span> — <span class="dc-title">Get gzip</span></p>
</div>
<div class="refsect1 description" id="refsect1-httpresponse.getgzip-description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="modifier">static</span>
<span class="type">bool</span> <span class="methodname"><strong>HttpResponse::getGzip</strong></span>
( <span class="methodparam">void</span>
)</div>
<p class="para rdfs-comment">
Get current gzip'ing setting.
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-httpresponse.getgzip-returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns <strong><code>TRUE</code></strong> if GZip compression is enabled, else <strong><code>FALSE</code></strong>.
</p>
</div>
<div class="refsect1 seealso" id="refsect1-httpresponse.getgzip-seealso">
<h3 class="title">See Also</h3>
<p class="para">
<ul class="simplelist">
<li class="member"> <span class="methodname"><a href="httpresponse.setgzip.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::setGzip()</a> - Set gzip</span></li>
</ul>
</p>
</div>
</div><hr /><div class="manualnavbar" style="text-align: center;">
<div class="prev" style="text-align: left; float: left;"><a href="httpresponse.getfile.html">HttpResponse::getFile</a></div>
<div class="next" style="text-align: right; float: right;"><a href="httpresponse.getheader.html">HttpResponse::getHeader</a></div>
<div class="up"><a href="class.httpresponse.html">HttpResponse</a></div>
<div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
| Sliim/sleemacs | php-manual/httpresponse.getgzip.html | HTML | gpl-3.0 | 2,584 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.consul.discovery;
import org.junit.jupiter.api.Test;
import org.springframework.cloud.commons.util.InetUtils;
import org.springframework.cloud.commons.util.InetUtilsProperties;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Spencer Gibb
*/
public class ConsulCatalogWatchTests {
@Test
public void isRunningReportsCorrectly() {
ConsulDiscoveryProperties properties = new ConsulDiscoveryProperties(new InetUtils(new InetUtilsProperties()));
ConsulCatalogWatch watch = new ConsulCatalogWatch(properties, null) {
@Override
public void catalogServicesWatch() {
// do nothing
}
};
assertThat(watch.isRunning()).isFalse();
watch.start();
assertThat(watch.isRunning()).isTrue();
watch.stop();
assertThat(watch.isRunning()).isFalse();
}
}
| spring-cloud/spring-cloud-consul | spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/ConsulCatalogWatchTests.java | Java | apache-2.0 | 1,452 | [
30522,
1013,
1008,
1008,
9385,
2286,
1011,
10476,
1996,
2434,
3166,
2030,
6048,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Dat.V1.Dto.Bom.Exceptions
{
public class TransportException : BomException
{
public TransportException() : base() { }
public TransportException(string message) : base(message) { }
public TransportException(string message, System.Exception ex) : base(message, ex) { }
}
}
| vybeonllc/dat_framework | V1/DataTransferObject/BaseObjectModels/Exceptions/TransportException.cs | C# | gpl-3.0 | 437 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
2291,
1012,
3793,
1025,
2478,
2291,
1012,
11689,
2075,
1012,
8518,
1025,
3415,
15327,
23755,
1012,
1058,
2487,
1012,
26718,
2080,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.