text
stringlengths 2
99.9k
| meta
dict |
|---|---|
Title: This Week in Rust 266
Number: 266
Date: 2018-12-25
Category: This Week in Rust
Hello and welcome to another issue of *This Week in Rust*!
[Rust](http://rust-lang.org) is a systems language pursuing the trifecta: safety, concurrency, and speed.
This is a weekly summary of its progress and community.
Want something mentioned? Tweet us at [@ThisWeekInRust](https://twitter.com/ThisWeekInRust) or [send us a pull request](https://github.com/cmr/this-week-in-rust).
Want to get involved? [We love contributions](https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md).
*This Week in Rust* is openly developed [on GitHub](https://github.com/cmr/this-week-in-rust).
If you find any errors in this week's issue, [please submit a PR](https://github.com/cmr/this-week-in-rust/pulls).
# Updates from Rust Community
## News & Blog Posts
* 🎈🎉 [Announcing Rust 1.31.1](https://blog.rust-lang.org/2018/12/20/Rust-1.31.1.html). 🎉🎈
* [Procedural macros in Rust 2018](https://blog.rust-lang.org/2018/12/21/Procedural-Macros-in-Rust-2018.html).
* [Tokio: A great 2018, an even better 2019](https://tokio.rs/blog/2018-12-recap-2018/).
* [Using C libraries in Rust: making a `*-sys` crate](https://kornel.ski/rust-sys-crate).
* [Rust asynchronous IO: from mio to coroutine](https://github.com/Hexilee/async-io-demo).
* [Methods for array initialization in Rust](https://www.joshmcguigan.com/blog/array-initialization-rust/).
* [Currying in rust Part 3 (The circle of life... aka why borrowchecker... why)](https://hashnode.com/post/currying-in-rust-part-3-the-circle-of-life-aka-why-borrowchecker-why-cjq3z1dd800dknds1sls4dqav)!?
* [How to get better at Rust: For beginners](https://hashnode.com/post/how-to-become-a-rust-super-developer-cjpv1ee7e000buhs2aqrdw2ym).
### #Rust2019
Find all #Rust2019 posts at [Read Rust](https://readrust.net/rust-2019/).
# Crate of the Week
This week's crate is [sandspiel](https://sandspiel.club), a WASM-powered online sandbox automaton game. Thanks to [Vikrant Chaudhary](https://users.rust-lang.org/t/crate-of-the-week/2704/473) for the suggestion!
[Submit your suggestions and votes for next week][submit_crate]!
[submit_crate]: https://users.rust-lang.org/t/crate-of-the-week/2704
# Call for Participation
Always wanted to contribute to open-source projects but didn't know where to start?
Every week we highlight some tasks from the Rust community for you to pick and get started!
Some of these tasks may also have mentors available, visit the task page for more information.
* [A call for Rust 2019 Roadmap blog posts](https://blog.rust-lang.org/2018/12/06/call-for-rust-2019-roadmap-blogposts.html).
* [PEACE: Implement loading functions from static linked libraries](https://github.com/playXE/PEACE/issues/1). PEACE is a simple JIT library.
If you are a Rust project owner and are looking for contributors, please submit tasks [here][guidelines].
[guidelines]: https://users.rust-lang.org/t/twir-call-for-participation/4821
# Updates from Rust Core
214 pull requests were [merged in the last week][merged]
[merged]: https://github.com/search?q=is%3Apr+org%3Arust-lang+is%3Amerged+merged%3A2018-12-17..2018-12-24
* [add targets thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf](https://github.com/rust-lang/rust/pull/56947)
* [less conservative uninhabitedness check](https://github.com/rust-lang/rust/pull/54125)
* [remove "visited" set from inhabitedness checking](https://github.com/rust-lang/rust/pull/57033)
* [short-circuit DefIdForest::intersection()](https://github.com/rust-lang/rust/pull/57060)
* [make the 'a lifetime on TyCtxt useless](https://github.com/rust-lang/rust/pull/56601)
* [trigger unsized coercions keyed on Sized bounds](https://github.com/rust-lang/rust/pull/56219)
* [fix various aspects around `let` bindings inside const functions](https://github.com/rust-lang/rust/pull/56160)
* [deny intra-doc link resolution failures in libstd](https://github.com/rust-lang/rust/pull/56941)
* [process nested obligations in autoderef](https://github.com/rust-lang/rust/pull/54252)
* [mark tuple structs as live if their constructors are used](https://github.com/rust-lang/rust/pull/56953)
* [fix alignment for array indexing](https://github.com/rust-lang/rust/pull/57053)
* [enable emission of alignment attrs for pointer params](https://github.com/rust-lang/rust/pull/57021)
* [enum type instead of variant suggestion unification](https://github.com/rust-lang/rust/pull/56188)
* [make basic CTFE tracing available on release builds](https://github.com/rust-lang/rust/pull/56973)
* [remove `TokenStream::JointTree`](https://github.com/rust-lang/rust/pull/56964)
* [miri: allocation is infallible](https://github.com/rust-lang/rust/pull/56981)
* [fix mutable references in `static mut`](https://github.com/rust-lang/rust/pull/56916)
* [simplify MIR generation for logical operations](https://github.com/rust-lang/rust/pull/56917)
* [static eval: do not ICE on layout size overflow](https://github.com/rust-lang/rust/pull/56909)
* [disable field reordering for repr(int)](https://github.com/rust-lang/rust/pull/56887)
* [always run rustc in a thread](https://github.com/rust-lang/rust/pull/56813)
* [version-gate the trailing semicolon change of return statements inside a match arm](https://github.com/rust-lang/rustfmt/pull/3250)
* [add `DoubleEndedIterator::nth_back`](https://github.com/rust-lang/rust/pull/56802)
* [mir-opt: make `SimplifyCfg` collapse goto chains starting from `bb0`](https://github.com/rust-lang/rust/pull/56764)
* [treat ref-to-raw cast like a reborrow: do a special kind of retag](https://github.com/rust-lang/rust/pull/56741)
* [MIR borrowck doesn't accept the example of iterating and updating a mutable reference](https://github.com/rust-lang/rust/pull/56649)
* [rework treatment of `$crate` in procedural macros](https://github.com/rust-lang/rust/pull/56647)
* [tweak query code for performance](https://github.com/rust-lang/rust/pull/56613)
* [implement `Eq`, `PartialEq` and `Hash` for `atomic::Ordering`](https://github.com/rust-lang/rust/pull/56881)
* [add unstable `VecDeque::rotate_`{`left`, `right`}](https://github.com/rust-lang/rust/pull/56842)
* [remove Cycle::try_fold override](https://github.com/rust-lang/rust/pull/56904)
* [short-circuit `Rc`/`Arc` equality checking on equal pointers where `T: Eq`](https://github.com/rust-lang/rust/pull/56550)
* [stabilize `Rc`, `Arc` and `Pin` as method receivers](https://github.com/rust-lang/rust/pull/56805)
* [stabilize `min_const_unsafe_fn` in 1.33](https://github.com/rust-lang/rust/pull/57067)
* [stabilize `Vec(Deque)::resize_with`](https://github.com/rust-lang/rust/pull/57002)
* [stabilize `Pin`](https://github.com/rust-lang/rust/pull/56939)
* [stabilize `underscore_imports`](https://github.com/rust-lang/rust/pull/56303)
* [bootstrap: Link LLVM as a dylib with ThinLTO](https://github.com/rust-lang/rust/pull/56944)
* [profiler: simplify total_duration, improve readability](https://github.com/rust-lang/rust/pull/56918)
* [cargo: warn on unused patches](https://github.com/rust-lang/cargo/pull/6470)
* [rustdoc: add new CLI flag to load static files from a different location](https://github.com/rust-lang/rust/pull/57011)
## Approved RFCs
Changes to Rust follow the Rust [RFC (request for comments)
process](https://github.com/rust-lang/rfcs#rust-rfcs). These
are the RFCs that were approved for implementation this week:
*No RFCs were approved this week.*
## Final Comment Period
Every week [the team](https://www.rust-lang.org/team.html) announces the
'final comment period' for RFCs and key PRs which are reaching a
decision. Express your opinions now.
### [RFCs](https://github.com/rust-lang/rfcs/labels/final-comment-period)
*No RFCs are currently in final comment period.*
### [Tracking Issues & PRs](https://github.com/rust-lang/rust/labels/final-comment-period)
* [disposition: merge] [Make the getter for NonZero types into a const fn](https://github.com/rust-lang/rust/pull/56739).
## New RFCs
* [Using enums like traits](https://github.com/rust-lang/rfcs/pull/2618).
* [Local `loop` bindings](https://github.com/rust-lang/rfcs/pull/2617).
# Upcoming Events
### Online
* [Jan 2. Rust Events Team Meeting on Telegram](https://t.me/joinchat/EkKINhHCgZ9llzvPidOssA).
* [Jan 9. Rust Community Team Meeting on Discord](https://discordapp.com/channels/442252698964721669/443773747350994945).
### Europe
* [Dec 27 - 30. Leipzig, DE - Rust assembly at 35c3](https://users.rust-lang.org/t/35c3-rust-assembly-at-ccc-leipzig/22288).
* [Jan 8. Rapperswil-Jona, CH - Rust Zürichsee meetup at Coredump - Looking for a speaker](https://www.meetup.com/Rust-Zurich/events/253608548/).
* [Jan 9. Berlin, DE - Berlin Rust Hack and Learn](https://www.meetup.com/opentechschool-berlin/events/rjgkhqyzcbmb/).
* [Jan 10. Brno, CZ - Rust meetup at Masaryk University](https://rust-brno.github.io/).
### North America
* [Dec 30. Mountain View, US - Rust Dev in Mountain View!](https://www.meetup.com/Rust-Dev-in-Mountain-View/events/glnfcpyxqbnc/).
* [Jan 2. Indianapolis, US - Indy.rs](https://www.meetup.com/indyrs/events/246726699/).
* [Jan 2. Atlanta, US - Rust Atlanta Meetup](https://www.meetup.com/Rust-ATL/events/cbcmbqyzcbdb/).
* [Jan 6. Mountain View, US - Rust Dev in Mountain View!](https://www.meetup.com/Rust-Dev-in-Mountain-View/events/glnfcpyzcbjb/).
* [Jan 9. Vancouver, CA - Vancouver Rust meetup](https://www.meetup.com/Vancouver-Rust/events/rzszlqyzcbmb/).
If you are running a Rust event please add it to the [calendar] to get
it mentioned here. Please remember to add a link to the event too.
Email the [Rust Community Team][community] for access.
[calendar]: https://www.google.com/calendar/embed?src=apd9vmbc22egenmtu5l6c5jbfc%40group.calendar.google.com
[community]: mailto:community-team@rust-lang.org
# Rust Jobs
* [Rust Developer at XAIN, Berlin, DE](https://www.linkedin.com/jobs/cap/view/948142464/?pathWildcard=948142464&trk=mcm).
* [Networking Engineer at MaidSafe, Ayr, GB (Remote)](https://maidsafe.net/careers/#networking_engineer).
* [Senior Backend/Blockchain Developer with Rust at BitFinex, Remote](https://bitfinex.recruitee.com/o/senior-backendblockchain-developer-with-rust-remote).
* [Rust Developer at Parity, Berlin, DE](https://paritytech.io/jobs/).
* [Sr. Software Engineer - Rust at Mersive, Denver, US](https://www.mersive.com/company/join-mersive-team/?gh_jid=4136286002).
* [Embedded operating system developer, Karlsruhe, DE](https://www.pse.kit.edu/karriere/joboffer.php?id=2093&language=en).
* [Student research assistant (embedded), Karlsruhe, DE](https://twitter.com/oli_obk/status/1064856324071178240).
*Tweet us at [@ThisWeekInRust](https://twitter.com/ThisWeekInRust) to get your job offers listed here!*
# Quote of the Week
> Using (traits) for Inheritance was like putting car wheels on a boat because I am used to driving a vehicle with wheels.
– Marco Alka [on Hashnode](https://hashnode.com/post/how-to-become-a-rust-super-developer-cjpv1ee7e000buhs2aqrdw2ym)
Thanks to [oberien](https://users.rust-lang.org/t/twir-quote-of-the-week/328/590) for the suggestion!
[Please submit your quotes for next week](http://users.rust-lang.org/t/twir-quote-of-the-week/328)!
*This Week in Rust is edited by: [nasa42](https://github.com/nasa42), [llogiq](https://github.com/llogiq), and [Flavsditz](https://github.com/Flavsditz).*
<small>[Discuss on r/rust](https://www.reddit.com/r/rust/comments/a9nw7t/this_week_in_rust_266/).</small>
|
{
"pile_set_name": "Github"
}
|
<hkobject name="#tudm$301" class="hkbBlenderGeneratorChild" signature="0xe2b384b0">
<hkparam name="variableBindingSet">null</hkparam>
<hkparam name="generator">#tudm$300</hkparam>
<hkparam name="boneWeights">null</hkparam>
<hkparam name="weight">104.724998</hkparam>
<hkparam name="worldFromModelWeight">1.000000</hkparam>
</hkobject>
|
{
"pile_set_name": "Github"
}
|
package schema
import (
"testing"
"gotest.tools/assert"
)
type dict map[string]interface{}
func TestValidate(t *testing.T) {
config := dict{
"version": "3.0",
"services": dict{
"foo": dict{
"image": "busybox",
},
},
}
assert.NilError(t, Validate(config, "3.0"))
}
func TestValidateUndefinedTopLevelOption(t *testing.T) {
config := dict{
"version": "3.0",
"helicopters": dict{
"foo": dict{
"image": "busybox",
},
},
}
err := Validate(config, "3.0")
assert.ErrorContains(t, err, "Additional property helicopters is not allowed")
}
func TestValidateAllowsXTopLevelFields(t *testing.T) {
config := dict{
"version": "3.4",
"x-extra-stuff": dict{},
}
err := Validate(config, "3.4")
assert.NilError(t, err)
}
func TestValidateAllowsXFields(t *testing.T) {
config := dict{
"version": "3.7",
"services": dict{
"bar": dict{
"x-extra-stuff": dict{},
},
},
"volumes": dict{
"bar": dict{
"x-extra-stuff": dict{},
},
},
"networks": dict{
"bar": dict{
"x-extra-stuff": dict{},
},
},
"configs": dict{
"bar": dict{
"x-extra-stuff": dict{},
},
},
"secrets": dict{
"bar": dict{
"x-extra-stuff": dict{},
},
},
}
err := Validate(config, "3.7")
assert.NilError(t, err)
}
func TestValidateSecretConfigNames(t *testing.T) {
config := dict{
"version": "3.5",
"configs": dict{
"bar": dict{
"name": "foobar",
},
},
"secrets": dict{
"baz": dict{
"name": "foobaz",
},
},
}
err := Validate(config, "3.5")
assert.NilError(t, err)
}
func TestValidateInvalidVersion(t *testing.T) {
config := dict{
"version": "2.1",
"services": dict{
"foo": dict{
"image": "busybox",
},
},
}
err := Validate(config, "2.1")
assert.ErrorContains(t, err, "unsupported Compose file version: 2.1")
}
type array []interface{}
func TestValidatePlacement(t *testing.T) {
config := dict{
"version": "3.3",
"services": dict{
"foo": dict{
"image": "busybox",
"deploy": dict{
"placement": dict{
"preferences": array{
dict{
"spread": "node.labels.az",
},
},
},
},
},
},
}
assert.NilError(t, Validate(config, "3.3"))
}
func TestValidateIsolation(t *testing.T) {
config := dict{
"version": "3.5",
"services": dict{
"foo": dict{
"image": "busybox",
"isolation": "some-isolation-value",
},
},
}
assert.NilError(t, Validate(config, "3.5"))
}
func TestValidateRollbackConfig(t *testing.T) {
config := dict{
"version": "3.4",
"services": dict{
"foo": dict{
"image": "busybox",
"deploy": dict{
"rollback_config": dict{
"parallelism": 1,
},
},
},
},
}
assert.NilError(t, Validate(config, "3.7"))
}
func TestValidateRollbackConfigWithOrder(t *testing.T) {
config := dict{
"version": "3.4",
"services": dict{
"foo": dict{
"image": "busybox",
"deploy": dict{
"rollback_config": dict{
"parallelism": 1,
"order": "start-first",
},
},
},
},
}
assert.NilError(t, Validate(config, "3.7"))
}
func TestValidateRollbackConfigWithUpdateConfig(t *testing.T) {
config := dict{
"version": "3.4",
"services": dict{
"foo": dict{
"image": "busybox",
"deploy": dict{
"update_config": dict{
"parallelism": 1,
"order": "start-first",
},
"rollback_config": dict{
"parallelism": 1,
"order": "start-first",
},
},
},
},
}
assert.NilError(t, Validate(config, "3.7"))
}
func TestValidateRollbackConfigWithUpdateConfigFull(t *testing.T) {
config := dict{
"version": "3.4",
"services": dict{
"foo": dict{
"image": "busybox",
"deploy": dict{
"update_config": dict{
"parallelism": 1,
"order": "start-first",
"delay": "10s",
"failure_action": "pause",
"monitor": "10s",
},
"rollback_config": dict{
"parallelism": 1,
"order": "start-first",
"delay": "10s",
"failure_action": "pause",
"monitor": "10s",
},
},
},
},
}
assert.NilError(t, Validate(config, "3.7"))
}
|
{
"pile_set_name": "Github"
}
|
array=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
array.reverse() #将数组翻转
print(array)
s = ''
for i in range(0,10):
array[i]=str(array[i])
string=s.join(array) #翻转后的数组拼接成字符串
print(string)
r1=string[2:8] #取出第三到第八个字符(包含第三和第八个字符)
print(r1)
number=int(r1[::-1])#将字符串进行反转,将结果转换为int类型
print(number)
print(bin(number))#转换成二进制并输出
print(oct(number))#转换成八进制并输出
print(hex(number))#转换成十六进制并输出
|
{
"pile_set_name": "Github"
}
|
" Vim filetype plugin file
" Language: SystemVerilog
" Maintainer: kocha <kocha.lsifrontend@gmail.com>
" Last Change: 12-Aug-2013.
if exists("b:did_ftplugin")
finish
endif
" Behaves just like Verilog
runtime! ftplugin/verilog.vim
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_margin="8dp"
android:layout_gravity="center_vertical"
app:cardElevation="5dp"
app:cardBackgroundColor="#EEEEEE">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<include layout="@layout/toolbar_light_dark"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/profilesList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v7.widget.CardView>
|
{
"pile_set_name": "Github"
}
|
ColorScale.prototype.vectorLength = function (vector) {
var result = 0;
for (var i = 0; i < vector.length; i++) {
result += vector[i] * vector[i];
}
return Math.sqrt(result);
};
|
{
"pile_set_name": "Github"
}
|
/**
* \file md5.h
*
* Copyright (C) 2006-2009, Paul Bakker <polarssl_maintainer at polarssl.org>
* All rights reserved.
*
* Joined copyright on original XySSL code with: Christophe Devine
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef POLARSSL_MD5_H
#define POLARSSL_MD5_H
/**
* \brief MD5 context structure
*/
typedef struct
{
unsigned long total[2]; /*!< number of bytes processed */
unsigned long state[4]; /*!< intermediate digest state */
unsigned char buffer[64]; /*!< data block being processed */
unsigned char ipad[64]; /*!< HMAC: inner padding */
unsigned char opad[64]; /*!< HMAC: outer padding */
}
md5_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief MD5 context setup
*
* \param ctx context to be initialized
*/
void md5_starts( md5_context *ctx );
/**
* \brief MD5 process buffer
*
* \param ctx MD5 context
* \param input buffer holding the data
* \param ilen length of the input data
*/
void md5_update( md5_context *ctx, unsigned char *input, int ilen );
/**
* \brief MD5 final digest
*
* \param ctx MD5 context
* \param output MD5 checksum result
*/
void md5_finish( md5_context *ctx, unsigned char output[16] );
/**
* \brief Output = MD5( input buffer )
*
* \param input buffer holding the data
* \param ilen length of the input data
* \param output MD5 checksum result
*/
void md5( unsigned char *input, int ilen, unsigned char output[16] );
/**
* \brief Output = MD5( file contents )
*
* \param path input file name
* \param output MD5 checksum result
*
* \return 0 if successful, 1 if fopen failed,
* or 2 if fread failed
*/
int md5_file( char *path, unsigned char output[16] );
/**
* \brief MD5 HMAC context setup
*
* \param ctx HMAC context to be initialized
* \param key HMAC secret key
* \param keylen length of the HMAC key
*/
void md5_hmac_starts( md5_context *ctx, unsigned char *key, int keylen );
/**
* \brief MD5 HMAC process buffer
*
* \param ctx HMAC context
* \param input buffer holding the data
* \param ilen length of the input data
*/
void md5_hmac_update( md5_context *ctx, unsigned char *input, int ilen );
/**
* \brief MD5 HMAC final digest
*
* \param ctx HMAC context
* \param output MD5 HMAC checksum result
*/
void md5_hmac_finish( md5_context *ctx, unsigned char output[16] );
/**
* \brief Output = HMAC-MD5( hmac key, input buffer )
*
* \param key HMAC secret key
* \param keylen length of the HMAC key
* \param input buffer holding the data
* \param ilen length of the input data
* \param output HMAC-MD5 result
*/
void md5_hmac( unsigned char *key, int keylen,
unsigned char *input, int ilen,
unsigned char output[16] );
/**
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
*/
int md5_self_test( int verbose );
#ifdef __cplusplus
}
#endif
#endif /* md5.h */
|
{
"pile_set_name": "Github"
}
|
langcode: en
status: true
dependencies:
module:
- node
id: test_node_revision_vid
label: null
module: views
description: ''
tag: ''
base_table: node_field_revision
base_field: nid
display:
default:
display_options:
relationships:
vid:
id: vid
table: node_field_revision
field: vid
required: true
plugin_id: standard
fields:
vid:
id: vid
table: node_field_revision
field: vid
plugin_id: field
entity_type: node
entity_field: vid
nid_1:
id: nid_1
table: node_field_revision
field: nid
plugin_id: field
entity_type: node
entity_field: nid
nid:
id: nid
table: node_field_data
field: nid
relationship: vid
plugin_id: field
entity_type: node
entity_field: nid
langcode:
id: langcode
table: node_field_revision
field: langcode
entity_type: node
entity_field: langcode
plugin_id: field
arguments:
nid:
id: nid
table: node_field_revision
field: nid
plugin_id: node_nid
entity_type: node
entity_field: nid
display_extenders: { }
sorts:
langcode:
id: langcode
table: node_field_revision
field: langcode
relationship: none
group_type: group
admin_label: ''
order: ASC
exposed: false
expose:
label: ''
entity_type: node
entity_field: langcode
plugin_id: standard
display_plugin: default
display_title: Master
id: default
position: 0
|
{
"pile_set_name": "Github"
}
|
{
"versionNumber" : "2.0.0",
"releasePackageData" : [ {
"tableName" : "METL_RELEASE_PACKAGE",
"tableData" : { }
}, {
"tableName" : "METL_RPPV",
"tableData" : { }
} ],
"projectVersionData" : [ {
"projectVersionId" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"projectData" : [ {
"tableName" : "METL_PROJECT",
"tableData" : {
"e06bf582-0b9b-45c9-8999-8e39fe0118ff" : {
"ID" : "e06bf582-0b9b-45c9-8999-8e39fe0118ff",
"NAME" : "JMS Tests",
"DESCRIPTION" : null,
"DELETED" : 0,
"WORKING_VERSION" : null
}
}
}, {
"tableName" : "METL_PROJECT_VERSION",
"tableData" : {
"ae4ae3cd-165a-4134-9b5e-797ca72ffcb7" : {
"ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"VERSION_LABEL" : "1.0.0",
"PROJECT_ID" : "e06bf582-0b9b-45c9-8999-8e39fe0118ff",
"ORIG_VERSION_ID" : null,
"DESCRIPTION" : "",
"RELEASED" : 0,
"ARCHIVED" : 0,
"DELETED" : 0
}
}
}, {
"tableName" : "METL_PROJECT_VERSION_PLUGIN",
"tableData" : {
"ae4ae3cd-165a-4134-9b5e-797ca72ffcb7null" : {
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DEFINITION_TYPE" : "Resource",
"DEFINITION_TYPE_ID" : "Sftp",
"DEFINITION_NAME" : "SFTP",
"ARTIFACT_NAME" : "resource-core",
"ARTIFACT_GROUP" : "org.jumpmind.metl",
"ARTIFACT_VERSION" : "2.0.0.dev201612291452",
"LATEST_ARTIFACT_VERSION" : "2.0.0.dev201612291452",
"ENABLED" : 1,
"PIN_VERSION" : 0
}
}
}, {
"tableName" : "METL_PROJECT_VERSION_DEPENDS",
"tableData" : { }
} ],
"resourceData" : [ {
"tableName" : "METL_RESOURCE",
"tableData" : {
"d691b84f-9d0b-475b-8948-99c138d7ca45" : {
"ID" : "d691b84f-9d0b-475b-8948-99c138d7ca45",
"ROW_ID" : "ecfd5d1b-7659-48de-b802-2d8e024032d9",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "JMS Flow Ack Queue",
"TYPE" : "JMS",
"FOLDER_ID" : null
},
"f48d9f53-2dab-4d11-b38b-078a68743629" : {
"ID" : "f48d9f53-2dab-4d11-b38b-078a68743629",
"ROW_ID" : "90dd08dd-20c1-40d8-ac94-08a8479949f3",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "JMS Queue",
"TYPE" : "JMS",
"FOLDER_ID" : null
},
"dac89447-e1b8-43e7-8776-7f36f2f8202b" : {
"ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b",
"ROW_ID" : "4eab5d07-2af3-403d-ab8d-eb93722d0169",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "JMS Topic 2",
"TYPE" : "JMS",
"FOLDER_ID" : null
},
"e0613da9-95ec-4e28-80ae-57fb4991c14a" : {
"ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a",
"ROW_ID" : "36e4ccbb-d6aa-43a0-879d-56766b106a17",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "JMS Topic 1",
"TYPE" : "JMS",
"FOLDER_ID" : null
},
"2c9e4661-9228-4430-920f-e0249a8ec54f" : {
"ID" : "2c9e4661-9228-4430-920f-e0249a8ec54f",
"ROW_ID" : "e5f437d0-b6d1-4721-a924-b3c9c102369b",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "JMS Topic Publisher",
"TYPE" : "JMS",
"FOLDER_ID" : null
}
}
}, {
"tableName" : "METL_RESOURCE_SETTING",
"tableData" : {
"f48d9f53-2dab-4d11-b38b-078a68743629jms.type" : {
"RESOURCE_ID" : "f48d9f53-2dab-4d11-b38b-078a68743629",
"NAME" : "jms.type",
"VALUE" : "Queue"
},
"d691b84f-9d0b-475b-8948-99c138d7ca45java.naming.security.credentials" : {
"RESOURCE_ID" : "d691b84f-9d0b-475b-8948-99c138d7ca45",
"NAME" : "java.naming.security.credentials",
"VALUE" : "admin"
},
"d691b84f-9d0b-475b-8948-99c138d7ca45java.naming.security.principal" : {
"RESOURCE_ID" : "d691b84f-9d0b-475b-8948-99c138d7ca45",
"NAME" : "java.naming.security.principal",
"VALUE" : "admin"
},
"f48d9f53-2dab-4d11-b38b-078a68743629java.naming.provider.url" : {
"RESOURCE_ID" : "f48d9f53-2dab-4d11-b38b-078a68743629",
"NAME" : "java.naming.provider.url",
"VALUE" : "vm://localhost?broker.persistent=false"
},
"e0613da9-95ec-4e28-80ae-57fb4991c14adurable.subscription.name" : {
"RESOURCE_ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a",
"NAME" : "durable.subscription.name",
"VALUE" : "1"
},
"dac89447-e1b8-43e7-8776-7f36f2f8202bjms.type" : {
"RESOURCE_ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b",
"NAME" : "jms.type",
"VALUE" : "Topic"
},
"2c9e4661-9228-4430-920f-e0249a8ec54fjava.naming.security.principal" : {
"RESOURCE_ID" : "2c9e4661-9228-4430-920f-e0249a8ec54f",
"NAME" : "java.naming.security.principal",
"VALUE" : ""
},
"2c9e4661-9228-4430-920f-e0249a8ec54ftopic.name" : {
"RESOURCE_ID" : "2c9e4661-9228-4430-920f-e0249a8ec54f",
"NAME" : "topic.name",
"VALUE" : "dynamicTopics/exampleTopic"
},
"dac89447-e1b8-43e7-8776-7f36f2f8202bjava.naming.security.credentials" : {
"RESOURCE_ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b",
"NAME" : "java.naming.security.credentials",
"VALUE" : "admin"
},
"dac89447-e1b8-43e7-8776-7f36f2f8202bmsg.type" : {
"RESOURCE_ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b",
"NAME" : "msg.type",
"VALUE" : "Map"
},
"e0613da9-95ec-4e28-80ae-57fb4991c14amsg.type" : {
"RESOURCE_ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a",
"NAME" : "msg.type",
"VALUE" : "Map"
},
"e0613da9-95ec-4e28-80ae-57fb4991c14ajava.naming.security.credentials" : {
"RESOURCE_ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a",
"NAME" : "java.naming.security.credentials",
"VALUE" : "admin"
},
"e0613da9-95ec-4e28-80ae-57fb4991c14ajms.type" : {
"RESOURCE_ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a",
"NAME" : "jms.type",
"VALUE" : "Topic"
},
"e0613da9-95ec-4e28-80ae-57fb4991c14aclient.id" : {
"RESOURCE_ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a",
"NAME" : "client.id",
"VALUE" : "1"
},
"2c9e4661-9228-4430-920f-e0249a8ec54fjava.naming.security.credentials" : {
"RESOURCE_ID" : "2c9e4661-9228-4430-920f-e0249a8ec54f",
"NAME" : "java.naming.security.credentials",
"VALUE" : "admin"
},
"dac89447-e1b8-43e7-8776-7f36f2f8202btopic.name" : {
"RESOURCE_ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b",
"NAME" : "topic.name",
"VALUE" : "dynamicTopics/exampleTopic"
},
"f48d9f53-2dab-4d11-b38b-078a68743629queue.name" : {
"RESOURCE_ID" : "f48d9f53-2dab-4d11-b38b-078a68743629",
"NAME" : "queue.name",
"VALUE" : "dynamicQueues/unittest"
},
"f48d9f53-2dab-4d11-b38b-078a68743629java.naming.security.credentials" : {
"RESOURCE_ID" : "f48d9f53-2dab-4d11-b38b-078a68743629",
"NAME" : "java.naming.security.credentials",
"VALUE" : "admin"
},
"f48d9f53-2dab-4d11-b38b-078a68743629java.naming.security.principal" : {
"RESOURCE_ID" : "f48d9f53-2dab-4d11-b38b-078a68743629",
"NAME" : "java.naming.security.principal",
"VALUE" : "admin"
},
"d691b84f-9d0b-475b-8948-99c138d7ca45jms.type" : {
"RESOURCE_ID" : "d691b84f-9d0b-475b-8948-99c138d7ca45",
"NAME" : "jms.type",
"VALUE" : "Queue"
},
"dac89447-e1b8-43e7-8776-7f36f2f8202bclient.id" : {
"RESOURCE_ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b",
"NAME" : "client.id",
"VALUE" : "2"
},
"e0613da9-95ec-4e28-80ae-57fb4991c14atopic.name" : {
"RESOURCE_ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a",
"NAME" : "topic.name",
"VALUE" : "dynamicTopics/exampleTopic"
},
"d691b84f-9d0b-475b-8948-99c138d7ca45ack.type" : {
"RESOURCE_ID" : "d691b84f-9d0b-475b-8948-99c138d7ca45",
"NAME" : "ack.type",
"VALUE" : "On Flow Complete"
},
"d691b84f-9d0b-475b-8948-99c138d7ca45queue.name" : {
"RESOURCE_ID" : "d691b84f-9d0b-475b-8948-99c138d7ca45",
"NAME" : "queue.name",
"VALUE" : "dynamicQueues/flowAck"
},
"dac89447-e1b8-43e7-8776-7f36f2f8202bdurable.subscription.name" : {
"RESOURCE_ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b",
"NAME" : "durable.subscription.name",
"VALUE" : "2"
},
"e0613da9-95ec-4e28-80ae-57fb4991c14ajava.naming.security.principal" : {
"RESOURCE_ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a",
"NAME" : "java.naming.security.principal",
"VALUE" : "admin"
},
"2c9e4661-9228-4430-920f-e0249a8ec54fdurable.subscription.name" : {
"RESOURCE_ID" : "2c9e4661-9228-4430-920f-e0249a8ec54f",
"NAME" : "durable.subscription.name",
"VALUE" : "3"
},
"dac89447-e1b8-43e7-8776-7f36f2f8202bjava.naming.security.principal" : {
"RESOURCE_ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b",
"NAME" : "java.naming.security.principal",
"VALUE" : "admin"
},
"2c9e4661-9228-4430-920f-e0249a8ec54fclient.id" : {
"RESOURCE_ID" : "2c9e4661-9228-4430-920f-e0249a8ec54f",
"NAME" : "client.id",
"VALUE" : "3"
}
}
} ],
"modelData" : [ {
"tableName" : "METL_RELATIONAL_MODEL",
"tableData" : { }
}, {
"tableName" : "METL_MODEL_ENTITY",
"tableData" : { }
}, {
"tableName" : "METL_MODEL_ATTRIB",
"tableData" : { }
} ],
"flowData" : [ {
"tableName" : "METL_COMPONENT",
"tableData" : {
"f196cb7a-af64-4bd2-9cfc-78256eff56e6" : {
"ID" : "f196cb7a-af64-4bd2-9cfc-78256eff56e6",
"ROW_ID" : "721512ec-1e2e-4db6-a216-ff46ed2b5377",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Read Topic 2",
"TYPE" : "Text File Reader",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : "dac89447-e1b8-43e7-8776-7f36f2f8202b"
},
"56aaeee3-929c-42ae-aead-1dbc65a9acc8" : {
"ID" : "56aaeee3-929c-42ae-aead-1dbc65a9acc8",
"ROW_ID" : "56518086-8541-4a86-9bc2-7521a145dea2",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Assert 1",
"TYPE" : "Assert",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : null
},
"d3562ebd-857e-4f46-b878-50f43a3bbf6a" : {
"ID" : "d3562ebd-857e-4f46-b878-50f43a3bbf6a",
"ROW_ID" : "46da5450-b661-40a1-afee-2d5617542eb6",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Assert 2",
"TYPE" : "Assert",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : null
},
"6a70b5f1-a695-4a26-a053-d6ee00935b2d" : {
"ID" : "6a70b5f1-a695-4a26-a053-d6ee00935b2d",
"ROW_ID" : "19fc3f33-14c7-4cfb-86aa-19f9f87dc019",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Assert 1",
"TYPE" : "Assert",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : null
},
"5f356fd1-979e-4e6a-a4e0-00bc85593ac1" : {
"ID" : "5f356fd1-979e-4e6a-a4e0-00bc85593ac1",
"ROW_ID" : "42a3740f-7796-4a60-9593-b0a4ea527411",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Publish to Topic",
"TYPE" : "Text File Writer",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : "2c9e4661-9228-4430-920f-e0249a8ec54f"
},
"82fb5333-494b-4bb9-9c10-8902c0007c4c" : {
"ID" : "82fb5333-494b-4bb9-9c10-8902c0007c4c",
"ROW_ID" : "8bae7e1f-0f26-49cc-a57e-25499a1d3e26",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Message",
"TYPE" : "Text Constant",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : null
},
"c9a951da-df66-4af5-97cd-136ea39cd68c" : {
"ID" : "c9a951da-df66-4af5-97cd-136ea39cd68c",
"ROW_ID" : "1f3eedf2-3a8e-4c01-a1f4-5e1ed5419229",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Wait for Finish",
"TYPE" : "Last Unit of Work",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : null
},
"c861e393-cd37-4194-8734-8bc451f9b653" : {
"ID" : "c861e393-cd37-4194-8734-8bc451f9b653",
"ROW_ID" : "19d05839-a297-4f75-a885-446f6e2e4d1a",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Message",
"TYPE" : "Text Constant",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : null
},
"34249f0f-f14f-4e17-b38f-198d36fe6481" : {
"ID" : "34249f0f-f14f-4e17-b38f-198d36fe6481",
"ROW_ID" : "5efcfcd4-935f-494a-b565-3c6289185a8b",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Read from Queue",
"TYPE" : "Text File Reader",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : "f48d9f53-2dab-4d11-b38b-078a68743629"
},
"311a11d3-1cda-465c-b6f4-2d6848764ff0" : {
"ID" : "311a11d3-1cda-465c-b6f4-2d6848764ff0",
"ROW_ID" : "df7bf6ca-c620-49c8-9316-eeec2a7f8aa9",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Seed Messages",
"TYPE" : "Text Constant",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : null
},
"b7fec1af-fe22-45ba-9c78-d5a2d96dfbdb" : {
"ID" : "b7fec1af-fe22-45ba-9c78-d5a2d96dfbdb",
"ROW_ID" : "cb8850c2-3707-46d7-9544-603ecab3ca4d",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Check for 4 Messages",
"TYPE" : "Assert",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : null
},
"8c8c96f4-2cfe-4ce5-b23b-1c661c7a22ba" : {
"ID" : "8c8c96f4-2cfe-4ce5-b23b-1c661c7a22ba",
"ROW_ID" : "75ed88ad-5c20-40a1-8330-486009112a19",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Write Message",
"TYPE" : "Text File Writer",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : "d691b84f-9d0b-475b-8948-99c138d7ca45"
},
"fde40010-ba3f-4de5-a033-561312afac96" : {
"ID" : "fde40010-ba3f-4de5-a033-561312afac96",
"ROW_ID" : "03a0f54a-729c-4d80-b825-417553821d98",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Read Topic 1",
"TYPE" : "Text File Reader",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : "e0613da9-95ec-4e28-80ae-57fb4991c14a"
},
"86e25bbb-05f9-4372-9cf9-c21f18e7a581" : {
"ID" : "86e25bbb-05f9-4372-9cf9-c21f18e7a581",
"ROW_ID" : "01b15838-b4a4-4179-b426-27e18e9f7a3f",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Read Message",
"TYPE" : "Text File Reader",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : "d691b84f-9d0b-475b-8948-99c138d7ca45"
},
"61942052-0695-4b1c-b056-b8e3bab8cf33" : {
"ID" : "61942052-0695-4b1c-b056-b8e3bab8cf33",
"ROW_ID" : "a1a872d7-d121-4626-af9f-486a97d6f0e6",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"NAME" : "Write to Queue",
"TYPE" : "Text File Writer",
"FOLDER_ID" : null,
"SHARED" : 0,
"INPUT_MODEL_ID" : null,
"OUTPUT_MODEL_ID" : null,
"RESOURCE_ID" : "f48d9f53-2dab-4d11-b38b-078a68743629"
}
}
}, {
"tableName" : "METL_COMPONENT_SETTING",
"tableData" : {
"046ba2a5-d9e6-429b-bc26-a51ae9b82474" : {
"ID" : "046ba2a5-d9e6-429b-bc26-a51ae9b82474",
"COMPONENT_ID" : "6a70b5f1-a695-4a26-a053-d6ee00935b2d",
"NAME" : "expected.text.messages.count",
"VALUE" : "1"
},
"7a406553-c1ed-433f-bfee-3378540bd4f4" : {
"ID" : "7a406553-c1ed-433f-bfee-3378540bd4f4",
"COMPONENT_ID" : "82fb5333-494b-4bb9-9c10-8902c0007c4c",
"NAME" : "text",
"VALUE" : "<One>\n <Note>This is an xml message</Note>\n</One>"
},
"ee6f22ff-8c2e-453c-94a2-52c9de9caede" : {
"ID" : "ee6f22ff-8c2e-453c-94a2-52c9de9caede",
"COMPONENT_ID" : "c861e393-cd37-4194-8734-8bc451f9b653",
"NAME" : "split.on.line.feed",
"VALUE" : "false"
},
"9ce95e64-9f9a-48ef-ad37-4d9ecc20d428" : {
"ID" : "9ce95e64-9f9a-48ef-ad37-4d9ecc20d428",
"COMPONENT_ID" : "56aaeee3-929c-42ae-aead-1dbc65a9acc8",
"NAME" : "expected.text.messages.count",
"VALUE" : "1"
},
"aa1350c1-8041-457a-a538-a90c85e5831a" : {
"ID" : "aa1350c1-8041-457a-a538-a90c85e5831a",
"COMPONENT_ID" : "b7fec1af-fe22-45ba-9c78-d5a2d96dfbdb",
"NAME" : "expected.text.payload",
"VALUE" : "Message 1\nMessage 2\nMessage 3\nMessage 4"
},
"9d5b78d4-fe09-40d6-9f8c-664de9012487" : {
"ID" : "9d5b78d4-fe09-40d6-9f8c-664de9012487",
"COMPONENT_ID" : "56aaeee3-929c-42ae-aead-1dbc65a9acc8",
"NAME" : "expected.control.messages.count",
"VALUE" : "1"
},
"c540b757-8f2c-44ab-9483-3a3947f17322" : {
"ID" : "c540b757-8f2c-44ab-9483-3a3947f17322",
"COMPONENT_ID" : "82fb5333-494b-4bb9-9c10-8902c0007c4c",
"NAME" : "split.on.line.feed",
"VALUE" : "false"
},
"3e709722-2754-42c1-9f4e-4ac0a83728cd" : {
"ID" : "3e709722-2754-42c1-9f4e-4ac0a83728cd",
"COMPONENT_ID" : "fde40010-ba3f-4de5-a033-561312afac96",
"NAME" : "logOutput",
"VALUE" : "true"
},
"798a1782-5f53-402c-a8b9-4ebdf696dd7c" : {
"ID" : "798a1782-5f53-402c-a8b9-4ebdf696dd7c",
"COMPONENT_ID" : "6a70b5f1-a695-4a26-a053-d6ee00935b2d",
"NAME" : "expected.text.payload",
"VALUE" : "<One>\n <Note>This is an xml message</Note>\n</One>"
},
"0125e119-4bb3-4ea3-ae43-7350a04d0bc3" : {
"ID" : "0125e119-4bb3-4ea3-ae43-7350a04d0bc3",
"COMPONENT_ID" : "8c8c96f4-2cfe-4ce5-b23b-1c661c7a22ba",
"NAME" : "close.on",
"VALUE" : "MESSAGE"
},
"344eeb1e-a3d5-4e20-806d-e9a833667089" : {
"ID" : "344eeb1e-a3d5-4e20-806d-e9a833667089",
"COMPONENT_ID" : "d3562ebd-857e-4f46-b878-50f43a3bbf6a",
"NAME" : "expected.text.payload",
"VALUE" : "<One>\n <Note>This is an xml message</Note>\n</One>"
},
"b0869ea9-d44a-4d51-a49b-841c2c7d4900" : {
"ID" : "b0869ea9-d44a-4d51-a49b-841c2c7d4900",
"COMPONENT_ID" : "34249f0f-f14f-4e17-b38f-198d36fe6481",
"NAME" : "number.of.times.to.read.file",
"VALUE" : "100"
},
"0301c7fc-720b-4483-85a2-b404b552ba77" : {
"ID" : "0301c7fc-720b-4483-85a2-b404b552ba77",
"COMPONENT_ID" : "b7fec1af-fe22-45ba-9c78-d5a2d96dfbdb",
"NAME" : "expected.text.messages.count",
"VALUE" : "4"
},
"12e78159-6889-46b0-a96c-16d98d344a03" : {
"ID" : "12e78159-6889-46b0-a96c-16d98d344a03",
"COMPONENT_ID" : "86e25bbb-05f9-4372-9cf9-c21f18e7a581",
"NAME" : "split.on.line.feed",
"VALUE" : "false"
},
"2e145147-95c5-4384-98e6-e0c877d56571" : {
"ID" : "2e145147-95c5-4384-98e6-e0c877d56571",
"COMPONENT_ID" : "6a70b5f1-a695-4a26-a053-d6ee00935b2d",
"NAME" : "expected.control.messages.count",
"VALUE" : "1"
},
"61227d1e-33fa-4f6e-af78-ab93f4d70fc1" : {
"ID" : "61227d1e-33fa-4f6e-af78-ab93f4d70fc1",
"COMPONENT_ID" : "d3562ebd-857e-4f46-b878-50f43a3bbf6a",
"NAME" : "expected.control.messages.count",
"VALUE" : "1"
},
"8301f960-5c15-4816-8b6c-320ab23dce39" : {
"ID" : "8301f960-5c15-4816-8b6c-320ab23dce39",
"COMPONENT_ID" : "311a11d3-1cda-465c-b6f4-2d6848764ff0",
"NAME" : "text",
"VALUE" : "Message 1\nMessage 2\nMessage 3\nMessage 4"
},
"c2498c09-ff45-4f68-a014-7e10e04c0fc7" : {
"ID" : "c2498c09-ff45-4f68-a014-7e10e04c0fc7",
"COMPONENT_ID" : "fde40010-ba3f-4de5-a033-561312afac96",
"NAME" : "split.on.line.feed",
"VALUE" : "true"
},
"09c384a3-5647-4f04-aab5-3fbfa6f2cc6f" : {
"ID" : "09c384a3-5647-4f04-aab5-3fbfa6f2cc6f",
"COMPONENT_ID" : "b7fec1af-fe22-45ba-9c78-d5a2d96dfbdb",
"NAME" : "expected.control.messages.count",
"VALUE" : "1"
},
"eed67324-36f2-406a-a649-23d1fa973605" : {
"ID" : "eed67324-36f2-406a-a649-23d1fa973605",
"COMPONENT_ID" : "c861e393-cd37-4194-8734-8bc451f9b653",
"NAME" : "text",
"VALUE" : "This\nis \na\nsingle\nmessage"
},
"e0049147-23df-4870-90fc-d177168b8462" : {
"ID" : "e0049147-23df-4870-90fc-d177168b8462",
"COMPONENT_ID" : "d3562ebd-857e-4f46-b878-50f43a3bbf6a",
"NAME" : "expected.text.messages.count",
"VALUE" : "1"
},
"6e47eacd-bec1-4fe7-80a0-0a26051790cd" : {
"ID" : "6e47eacd-bec1-4fe7-80a0-0a26051790cd",
"COMPONENT_ID" : "61942052-0695-4b1c-b056-b8e3bab8cf33",
"NAME" : "close.on",
"VALUE" : "MESSAGE"
},
"2be05869-37de-4fcc-9e65-73abf9dc2fcf" : {
"ID" : "2be05869-37de-4fcc-9e65-73abf9dc2fcf",
"COMPONENT_ID" : "f196cb7a-af64-4bd2-9cfc-78256eff56e6",
"NAME" : "logOutput",
"VALUE" : "true"
},
"4e327658-6fd8-4dd3-a8cf-2b0870004e10" : {
"ID" : "4e327658-6fd8-4dd3-a8cf-2b0870004e10",
"COMPONENT_ID" : "311a11d3-1cda-465c-b6f4-2d6848764ff0",
"NAME" : "rows.per.message",
"VALUE" : "1"
}
}
}, {
"tableName" : "METL_COMPONENT_ENTITY_SETTING",
"tableData" : { }
}, {
"tableName" : "METL_component_model_setting",
"tableData" : { }
}, {
"tableName" : "METL_COMPONENT_ATTRIB_SETTING",
"tableData" : { }
}, {
"tableName" : "METL_FLOW",
"tableData" : {
"748000cd-2831-450b-8f1f-77de31bf4886" : {
"ID" : "748000cd-2831-450b-8f1f-77de31bf4886",
"ROW_ID" : "76073412-7614-40b4-bb02-e4d60e14875a",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"TEST" : 1,
"WEB_SERVICE" : 0,
"NAME" : "Acknowledge On Flow Finish",
"NOTES" : null,
"FOLDER_ID" : null
},
"de0544a3-2f6e-4d3a-a9b6-d9106b3eeeab" : {
"ID" : "de0544a3-2f6e-4d3a-a9b6-d9106b3eeeab",
"ROW_ID" : "20513d00-3513-4b05-97d9-2b08ac350583",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"TEST" : 1,
"WEB_SERVICE" : 0,
"NAME" : "Simple Topic Publish & Subscribe",
"NOTES" : null,
"FOLDER_ID" : null
},
"ed6e888b-b65c-4689-87e9-03661eebd852" : {
"ID" : "ed6e888b-b65c-4689-87e9-03661eebd852",
"ROW_ID" : "f829da07-9822-46fe-9f2b-72f5341423ea",
"PROJECT_VERSION_ID" : "ae4ae3cd-165a-4134-9b5e-797ca72ffcb7",
"DELETED" : 0,
"TEST" : 1,
"WEB_SERVICE" : 0,
"NAME" : "Simple Queue Publish & Subscribe",
"NOTES" : null,
"FOLDER_ID" : null
}
}
}, {
"tableName" : "METL_FLOW_PARAMETER",
"tableData" : { }
}, {
"tableName" : "METL_FLOW_STEP",
"tableData" : {
"20a2b532-4e60-4f18-a24b-38b9001c3968" : {
"ID" : "20a2b532-4e60-4f18-a24b-38b9001c3968",
"FLOW_ID" : "748000cd-2831-450b-8f1f-77de31bf4886",
"COMPONENT_ID" : "56aaeee3-929c-42ae-aead-1dbc65a9acc8",
"X" : 480,
"Y" : 20,
"APPROXIMATE_ORDER" : 3
},
"e0629434-3fbe-464a-9c27-dd17881c26bd" : {
"ID" : "e0629434-3fbe-464a-9c27-dd17881c26bd",
"FLOW_ID" : "748000cd-2831-450b-8f1f-77de31bf4886",
"COMPONENT_ID" : "86e25bbb-05f9-4372-9cf9-c21f18e7a581",
"X" : 330,
"Y" : 20,
"APPROXIMATE_ORDER" : 2
},
"309e9914-7aaa-45a0-b0e6-6f8aa8389bd3" : {
"ID" : "309e9914-7aaa-45a0-b0e6-6f8aa8389bd3",
"FLOW_ID" : "ed6e888b-b65c-4689-87e9-03661eebd852",
"COMPONENT_ID" : "311a11d3-1cda-465c-b6f4-2d6848764ff0",
"X" : 40,
"Y" : 30,
"APPROXIMATE_ORDER" : 0
},
"4a6f5ea4-d1e2-45e3-9717-7f8c8dedea7b" : {
"ID" : "4a6f5ea4-d1e2-45e3-9717-7f8c8dedea7b",
"FLOW_ID" : "de0544a3-2f6e-4d3a-a9b6-d9106b3eeeab",
"COMPONENT_ID" : "6a70b5f1-a695-4a26-a053-d6ee00935b2d",
"X" : 510,
"Y" : 20,
"APPROXIMATE_ORDER" : 3
},
"8422512f-5782-437e-9222-5b5595987091" : {
"ID" : "8422512f-5782-437e-9222-5b5595987091",
"FLOW_ID" : "ed6e888b-b65c-4689-87e9-03661eebd852",
"COMPONENT_ID" : "34249f0f-f14f-4e17-b38f-198d36fe6481",
"X" : 430,
"Y" : 30,
"APPROXIMATE_ORDER" : 3
},
"dbd95a6e-c6e9-4430-b758-d43f2a921fcc" : {
"ID" : "dbd95a6e-c6e9-4430-b758-d43f2a921fcc",
"FLOW_ID" : "de0544a3-2f6e-4d3a-a9b6-d9106b3eeeab",
"COMPONENT_ID" : "d3562ebd-857e-4f46-b878-50f43a3bbf6a",
"X" : 510,
"Y" : 140,
"APPROXIMATE_ORDER" : 5
},
"3e0f1764-0fdf-4116-9988-b8bd7fdd9a4b" : {
"ID" : "3e0f1764-0fdf-4116-9988-b8bd7fdd9a4b",
"FLOW_ID" : "748000cd-2831-450b-8f1f-77de31bf4886",
"COMPONENT_ID" : "c861e393-cd37-4194-8734-8bc451f9b653",
"X" : 30,
"Y" : 20,
"APPROXIMATE_ORDER" : 0
},
"437023d4-05db-4cd4-a9d9-4a8c161107b4" : {
"ID" : "437023d4-05db-4cd4-a9d9-4a8c161107b4",
"FLOW_ID" : "ed6e888b-b65c-4689-87e9-03661eebd852",
"COMPONENT_ID" : "61942052-0695-4b1c-b056-b8e3bab8cf33",
"X" : 170,
"Y" : 30,
"APPROXIMATE_ORDER" : 1
},
"fcaa0b5a-540a-4912-b683-1b1e07718aa1" : {
"ID" : "fcaa0b5a-540a-4912-b683-1b1e07718aa1",
"FLOW_ID" : "de0544a3-2f6e-4d3a-a9b6-d9106b3eeeab",
"COMPONENT_ID" : "f196cb7a-af64-4bd2-9cfc-78256eff56e6",
"X" : 370,
"Y" : 140,
"APPROXIMATE_ORDER" : 4
},
"dbb9a110-4e30-47b8-9c9a-976e99cb95a2" : {
"ID" : "dbb9a110-4e30-47b8-9c9a-976e99cb95a2",
"FLOW_ID" : "de0544a3-2f6e-4d3a-a9b6-d9106b3eeeab",
"COMPONENT_ID" : "fde40010-ba3f-4de5-a033-561312afac96",
"X" : 370,
"Y" : 20,
"APPROXIMATE_ORDER" : 2
},
"c639aaa6-668f-40ff-8e5c-7a61e2fdd041" : {
"ID" : "c639aaa6-668f-40ff-8e5c-7a61e2fdd041",
"FLOW_ID" : "748000cd-2831-450b-8f1f-77de31bf4886",
"COMPONENT_ID" : "8c8c96f4-2cfe-4ce5-b23b-1c661c7a22ba",
"X" : 180,
"Y" : 20,
"APPROXIMATE_ORDER" : 1
},
"4bd1dfd7-61ce-4bcf-be46-902ad432d117" : {
"ID" : "4bd1dfd7-61ce-4bcf-be46-902ad432d117",
"FLOW_ID" : "ed6e888b-b65c-4689-87e9-03661eebd852",
"COMPONENT_ID" : "b7fec1af-fe22-45ba-9c78-d5a2d96dfbdb",
"X" : 570,
"Y" : 30,
"APPROXIMATE_ORDER" : 4
},
"e0e8fb98-e866-4e01-b2e8-df7ed8318d1f" : {
"ID" : "e0e8fb98-e866-4e01-b2e8-df7ed8318d1f",
"FLOW_ID" : "ed6e888b-b65c-4689-87e9-03661eebd852",
"COMPONENT_ID" : "c9a951da-df66-4af5-97cd-136ea39cd68c",
"X" : 300,
"Y" : 30,
"APPROXIMATE_ORDER" : 2
},
"23449976-6dde-424d-abb2-19688ab96875" : {
"ID" : "23449976-6dde-424d-abb2-19688ab96875",
"FLOW_ID" : "de0544a3-2f6e-4d3a-a9b6-d9106b3eeeab",
"COMPONENT_ID" : "82fb5333-494b-4bb9-9c10-8902c0007c4c",
"X" : 30,
"Y" : 80,
"APPROXIMATE_ORDER" : 0
},
"5613c433-5739-4c1e-a149-330c916f9ae3" : {
"ID" : "5613c433-5739-4c1e-a149-330c916f9ae3",
"FLOW_ID" : "de0544a3-2f6e-4d3a-a9b6-d9106b3eeeab",
"COMPONENT_ID" : "5f356fd1-979e-4e6a-a4e0-00bc85593ac1",
"X" : 180,
"Y" : 80,
"APPROXIMATE_ORDER" : 1
}
}
}, {
"tableName" : "METL_FLOW_STEP_LINK",
"tableData" : {
"e0629434-3fbe-464a-9c27-dd17881c26bd20a2b532-4e60-4f18-a24b-38b9001c3968" : {
"SOURCE_STEP_ID" : "e0629434-3fbe-464a-9c27-dd17881c26bd",
"TARGET_STEP_ID" : "20a2b532-4e60-4f18-a24b-38b9001c3968"
},
"5613c433-5739-4c1e-a149-330c916f9ae3dbb9a110-4e30-47b8-9c9a-976e99cb95a2" : {
"SOURCE_STEP_ID" : "5613c433-5739-4c1e-a149-330c916f9ae3",
"TARGET_STEP_ID" : "dbb9a110-4e30-47b8-9c9a-976e99cb95a2"
},
"e0e8fb98-e866-4e01-b2e8-df7ed8318d1f8422512f-5782-437e-9222-5b5595987091" : {
"SOURCE_STEP_ID" : "e0e8fb98-e866-4e01-b2e8-df7ed8318d1f",
"TARGET_STEP_ID" : "8422512f-5782-437e-9222-5b5595987091"
},
"3e0f1764-0fdf-4116-9988-b8bd7fdd9a4bc639aaa6-668f-40ff-8e5c-7a61e2fdd041" : {
"SOURCE_STEP_ID" : "3e0f1764-0fdf-4116-9988-b8bd7fdd9a4b",
"TARGET_STEP_ID" : "c639aaa6-668f-40ff-8e5c-7a61e2fdd041"
},
"c639aaa6-668f-40ff-8e5c-7a61e2fdd041e0629434-3fbe-464a-9c27-dd17881c26bd" : {
"SOURCE_STEP_ID" : "c639aaa6-668f-40ff-8e5c-7a61e2fdd041",
"TARGET_STEP_ID" : "e0629434-3fbe-464a-9c27-dd17881c26bd"
},
"8422512f-5782-437e-9222-5b55959870914bd1dfd7-61ce-4bcf-be46-902ad432d117" : {
"SOURCE_STEP_ID" : "8422512f-5782-437e-9222-5b5595987091",
"TARGET_STEP_ID" : "4bd1dfd7-61ce-4bcf-be46-902ad432d117"
},
"fcaa0b5a-540a-4912-b683-1b1e07718aa1dbd95a6e-c6e9-4430-b758-d43f2a921fcc" : {
"SOURCE_STEP_ID" : "fcaa0b5a-540a-4912-b683-1b1e07718aa1",
"TARGET_STEP_ID" : "dbd95a6e-c6e9-4430-b758-d43f2a921fcc"
},
"309e9914-7aaa-45a0-b0e6-6f8aa8389bd3437023d4-05db-4cd4-a9d9-4a8c161107b4" : {
"SOURCE_STEP_ID" : "309e9914-7aaa-45a0-b0e6-6f8aa8389bd3",
"TARGET_STEP_ID" : "437023d4-05db-4cd4-a9d9-4a8c161107b4"
},
"dbb9a110-4e30-47b8-9c9a-976e99cb95a24a6f5ea4-d1e2-45e3-9717-7f8c8dedea7b" : {
"SOURCE_STEP_ID" : "dbb9a110-4e30-47b8-9c9a-976e99cb95a2",
"TARGET_STEP_ID" : "4a6f5ea4-d1e2-45e3-9717-7f8c8dedea7b"
},
"437023d4-05db-4cd4-a9d9-4a8c161107b4e0e8fb98-e866-4e01-b2e8-df7ed8318d1f" : {
"SOURCE_STEP_ID" : "437023d4-05db-4cd4-a9d9-4a8c161107b4",
"TARGET_STEP_ID" : "e0e8fb98-e866-4e01-b2e8-df7ed8318d1f"
},
"23449976-6dde-424d-abb2-19688ab968755613c433-5739-4c1e-a149-330c916f9ae3" : {
"SOURCE_STEP_ID" : "23449976-6dde-424d-abb2-19688ab96875",
"TARGET_STEP_ID" : "5613c433-5739-4c1e-a149-330c916f9ae3"
},
"5613c433-5739-4c1e-a149-330c916f9ae3fcaa0b5a-540a-4912-b683-1b1e07718aa1" : {
"SOURCE_STEP_ID" : "5613c433-5739-4c1e-a149-330c916f9ae3",
"TARGET_STEP_ID" : "fcaa0b5a-540a-4912-b683-1b1e07718aa1"
}
}
} ]
} ]
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:color="@color/carbon_red_400" app:guide_state_invalid="true" />
<item android:color="?attr/colorAccent" />
</selector>
|
{
"pile_set_name": "Github"
}
|
<?php
function hello() {
/** @var \Symfony\Component\Console\Descriptor\JsonDescriptor $extension */
}
|
{
"pile_set_name": "Github"
}
|
require('../modules/core.string.escape-html');
require('../modules/core.string.unescape-html');
module.exports = require('../modules/_core').String;
|
{
"pile_set_name": "Github"
}
|
--- modsecurity-2.9.0.orig/apache2/msc_lua.c 2015-03-06 01:35:06.458699865 +0800
+++ modsecurity-2.9.0/apache2/msc_lua.c 2015-03-06 01:34:48.719647454 +0800
@@ -111,7 +111,7 @@
dump.pool = pool;
dump.parts = apr_array_make(pool, 128, sizeof(msc_script_part *));
- lua_dump(L, dump_writer, &dump);
+ lua_dump(L, dump_writer, &dump, 1);
(*script) = apr_pcalloc(pool, sizeof(msc_script));
(*script)->name = filename;
|
{
"pile_set_name": "Github"
}
|
from abc import ABCMeta, abstractmethod
from ..hook import Hook
class LoggerHook(Hook):
"""Base class for logger hooks
Args:
interval (int)
ignore_last (bool)
reset_flag (bool)
"""
__metaclass__ = ABCMeta
def __init__(self, interval=10, ignore_last=True, reset_flag=False):
self.interval = interval
self.ignore_last = ignore_last
self.reset_flag = reset_flag
@abstractmethod
def log(self, trainer):
pass
def before_run(self, trainer):
for hook in trainer.hooks[::-1]:
if isinstance(hook, LoggerHook):
hook.reset_flag = True
break
def before_epoch(self, trainer):
trainer.log_buffer.clear()
def after_train_iter(self, trainer):
if self.every_n_inner_iters(trainer, self.interval):
trainer.log_buffer.average(self.interval)
elif self.end_of_epoch(trainer) and not self.ignore_last:
# not precise but more stable
trainer.log_buffer.average(self.interval)
if trainer.log_buffer.ready:
self.log(trainer)
if self.reset_flag:
trainer.log_buffer.clear_output()
def after_train_epoch(self, trainer):
if trainer.log_buffer.ready:
self.log(trainer)
if self.reset_flag:
trainer.log_buffer.clear_output()
def after_val_epoch(self, trainer):
trainer.log_buffer.average()
self.log(trainer)
if self.reset_flag:
trainer.log_buffer.clear_output()
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package source
import (
"context"
"fmt"
"sync"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/util/workqueue"
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/handler"
logf "sigs.k8s.io/controller-runtime/pkg/internal/log"
"sigs.k8s.io/controller-runtime/pkg/runtime/inject"
"sigs.k8s.io/controller-runtime/pkg/source/internal"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/predicate"
)
var log = logf.RuntimeLog.WithName("source")
const (
// defaultBufferSize is the default number of event notifications that can be buffered.
defaultBufferSize = 1024
)
// Source is a source of events (eh.g. Create, Update, Delete operations on Kubernetes Objects, Webhook callbacks, etc)
// which should be processed by event.EventHandlers to enqueue reconcile.Requests.
//
// * Use Kind for events originating in the cluster (e.g. Pod Create, Pod Update, Deployment Update).
//
// * Use Channel for events originating outside the cluster (eh.g. GitHub Webhook callback, Polling external urls).
//
// Users may build their own Source implementations. If their implementations implement any of the inject package
// interfaces, the dependencies will be injected by the Controller when Watch is called.
type Source interface {
// Start is internal and should be called only by the Controller to register an EventHandler with the Informer
// to enqueue reconcile.Requests.
Start(handler.EventHandler, workqueue.RateLimitingInterface, ...predicate.Predicate) error
}
// NewKindWithCache creates a Source without InjectCache, so that it is assured that the given cache is used
// and not overwritten. It can be used to watch objects in a different cluster by passing the cache
// from that other cluster
func NewKindWithCache(object runtime.Object, cache cache.Cache) Source {
return &kindWithCache{kind: Kind{Type: object, cache: cache}}
}
type kindWithCache struct {
kind Kind
}
func (ks *kindWithCache) Start(handler handler.EventHandler, queue workqueue.RateLimitingInterface,
prct ...predicate.Predicate) error {
return ks.kind.Start(handler, queue, prct...)
}
// Kind is used to provide a source of events originating inside the cluster from Watches (e.g. Pod Create)
type Kind struct {
// Type is the type of object to watch. e.g. &v1.Pod{}
Type runtime.Object
// cache used to watch APIs
cache cache.Cache
}
var _ Source = &Kind{}
// Start is internal and should be called only by the Controller to register an EventHandler with the Informer
// to enqueue reconcile.Requests.
func (ks *Kind) Start(handler handler.EventHandler, queue workqueue.RateLimitingInterface,
prct ...predicate.Predicate) error {
// Type should have been specified by the user.
if ks.Type == nil {
return fmt.Errorf("must specify Kind.Type")
}
// cache should have been injected before Start was called
if ks.cache == nil {
return fmt.Errorf("must call CacheInto on Kind before calling Start")
}
// Lookup the Informer from the Cache and add an EventHandler which populates the Queue
i, err := ks.cache.GetInformer(context.TODO(), ks.Type)
if err != nil {
if kindMatchErr, ok := err.(*meta.NoKindMatchError); ok {
log.Error(err, "if kind is a CRD, it should be installed before calling Start",
"kind", kindMatchErr.GroupKind)
}
return err
}
i.AddEventHandler(internal.EventHandler{Queue: queue, EventHandler: handler, Predicates: prct})
return nil
}
func (ks *Kind) String() string {
if ks.Type != nil && ks.Type.GetObjectKind() != nil {
return fmt.Sprintf("kind source: %v", ks.Type.GetObjectKind().GroupVersionKind().String())
}
return fmt.Sprintf("kind source: unknown GVK")
}
var _ inject.Cache = &Kind{}
// InjectCache is internal should be called only by the Controller. InjectCache is used to inject
// the Cache dependency initialized by the ControllerManager.
func (ks *Kind) InjectCache(c cache.Cache) error {
if ks.cache == nil {
ks.cache = c
}
return nil
}
var _ Source = &Channel{}
// Channel is used to provide a source of events originating outside the cluster
// (e.g. GitHub Webhook callback). Channel requires the user to wire the external
// source (eh.g. http handler) to write GenericEvents to the underlying channel.
type Channel struct {
// once ensures the event distribution goroutine will be performed only once
once sync.Once
// Source is the source channel to fetch GenericEvents
Source <-chan event.GenericEvent
// stop is to end ongoing goroutine, and close the channels
stop <-chan struct{}
// dest is the destination channels of the added event handlers
dest []chan event.GenericEvent
// DestBufferSize is the specified buffer size of dest channels.
// Default to 1024 if not specified.
DestBufferSize int
// destLock is to ensure the destination channels are safely added/removed
destLock sync.Mutex
}
func (cs *Channel) String() string {
return fmt.Sprintf("channel source: %p", cs)
}
var _ inject.Stoppable = &Channel{}
// InjectStopChannel is internal should be called only by the Controller.
// It is used to inject the stop channel initialized by the ControllerManager.
func (cs *Channel) InjectStopChannel(stop <-chan struct{}) error {
if cs.stop == nil {
cs.stop = stop
}
return nil
}
// Start implements Source and should only be called by the Controller.
func (cs *Channel) Start(
handler handler.EventHandler,
queue workqueue.RateLimitingInterface,
prct ...predicate.Predicate) error {
// Source should have been specified by the user.
if cs.Source == nil {
return fmt.Errorf("must specify Channel.Source")
}
// stop should have been injected before Start was called
if cs.stop == nil {
return fmt.Errorf("must call InjectStop on Channel before calling Start")
}
// use default value if DestBufferSize not specified
if cs.DestBufferSize == 0 {
cs.DestBufferSize = defaultBufferSize
}
cs.once.Do(func() {
// Distribute GenericEvents to all EventHandler / Queue pairs Watching this source
go cs.syncLoop()
})
dst := make(chan event.GenericEvent, cs.DestBufferSize)
go func() {
for evt := range dst {
shouldHandle := true
for _, p := range prct {
if !p.Generic(evt) {
shouldHandle = false
break
}
}
if shouldHandle {
handler.Generic(evt, queue)
}
}
}()
cs.destLock.Lock()
defer cs.destLock.Unlock()
cs.dest = append(cs.dest, dst)
return nil
}
func (cs *Channel) doStop() {
cs.destLock.Lock()
defer cs.destLock.Unlock()
for _, dst := range cs.dest {
close(dst)
}
}
func (cs *Channel) distribute(evt event.GenericEvent) {
cs.destLock.Lock()
defer cs.destLock.Unlock()
for _, dst := range cs.dest {
// We cannot make it under goroutine here, or we'll meet the
// race condition of writing message to closed channels.
// To avoid blocking, the dest channels are expected to be of
// proper buffer size. If we still see it blocked, then
// the controller is thought to be in an abnormal state.
dst <- evt
}
}
func (cs *Channel) syncLoop() {
for {
select {
case <-cs.stop:
// Close destination channels
cs.doStop()
return
case evt := <-cs.Source:
cs.distribute(evt)
}
}
}
// Informer is used to provide a source of events originating inside the cluster from Watches (e.g. Pod Create)
type Informer struct {
// Informer is the controller-runtime Informer
Informer cache.Informer
}
var _ Source = &Informer{}
// Start is internal and should be called only by the Controller to register an EventHandler with the Informer
// to enqueue reconcile.Requests.
func (is *Informer) Start(handler handler.EventHandler, queue workqueue.RateLimitingInterface,
prct ...predicate.Predicate) error {
// Informer should have been specified by the user.
if is.Informer == nil {
return fmt.Errorf("must specify Informer.Informer")
}
is.Informer.AddEventHandler(internal.EventHandler{Queue: queue, EventHandler: handler, Predicates: prct})
return nil
}
func (is *Informer) String() string {
return fmt.Sprintf("informer source: %p", is.Informer)
}
// Func is a function that implements Source
type Func func(handler.EventHandler, workqueue.RateLimitingInterface, ...predicate.Predicate) error
// Start implements Source
func (f Func) Start(evt handler.EventHandler, queue workqueue.RateLimitingInterface,
pr ...predicate.Predicate) error {
return f(evt, queue, pr...)
}
func (f Func) String() string {
return fmt.Sprintf("func source: %p", f)
}
|
{
"pile_set_name": "Github"
}
|
# Test generation of a WPS request from input arguments.
# The specific request involves a "helloworld" process submitted to the Emu WPS service
# (https://github.com/bird-house/emu).
from tests.utils import resource_file, compare_xml
from owslib.wps import WebProcessingService, WPSExecution, ComplexDataInput
from owslib.etree import etree
def test_wps_request9():
# Process input/output arguments
processid = "helloworld"
inputs = [("user", 'Pingu')]
# Build XML request for WPS process execution
execution = WPSExecution()
requestElement = execution.buildRequest(processid, inputs)
request = etree.tostring(requestElement)
# Compare to cached XML request
_request = open(resource_file('wps_EmuExecuteRequest9.xml'), 'rb').read()
assert compare_xml(request, _request) is True
|
{
"pile_set_name": "Github"
}
|
# frozen_string_literal: true
require_relative "../lib/tty-markdown"
markdown =<<-TEXT
## Image

## Image Source Location

TEXT
print TTY::Markdown.parse(markdown)
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>alexxy@gentoo.org</email>
<name>Alexey Shvetsov</name>
</maintainer>
<maintainer type="project">
<email>cluster@gentoo.org</email>
<name>Gentoo Cluster Project</name>
</maintainer>
</pkgmetadata>
|
{
"pile_set_name": "Github"
}
|
# $Id: nl.po,v 1.1.2.1 2009/06/06 15:42:46 libeco Exp $
#
# Dutch translation of Drupal (general)
# Copyright YEAR NAME <EMAIL@ADDRESS>
# Generated from files:
# votingapi.admin.inc,v 1.1.2.2 2008/10/01 15:47:46 eaton
# votingapi.module,v 1.46.2.15 2008/10/09 21:12:35 eaton
# votingapi.info,v 1.4 2007/07/06 03:02:34 eaton
# votingapi.views.inc,v 1.1.2.11 2008/12/04 18:34:39 eaton
# votingapi_views_handler_relationship.inc,v 1.1.2.3 2008/10/01 15:47:47 eaton
# votingapi_views_handler_field_value.inc,v 1.1.2.2 2008/10/01 15:47:47 eaton
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2009-06-04 16:11+0200\n"
"PO-Revision-Date: 2009-06-04 16:28+0100\n"
"Last-Translator: L.B. Cohn <lichai@999games.nl>\n"
"Language-Team: Dutch <EMAIL@ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: votingapi.admin.inc:13
msgid "Immediately"
msgstr "Meteen"
#: votingapi.admin.inc:13
msgid "Never"
msgstr "Nooit"
#: votingapi.admin.inc:17
msgid "Anonymous vote rollover"
msgstr "Anonieme stem-rollover"
#: votingapi.admin.inc:18
msgid "The amount of time that must pass before two anonymous votes from the same computer are considered unique. Setting this to 'never' will eliminate most double-voting, but will make it impossible for multiple anonymous on the same computer (like internet cafe customers) from casting votes."
msgstr "De tijd die moet verstrijken voordat twee anonieme stemmen van dezelfde computer als uniek worden beschouwd. Dit op 'nooit' instellen zal de meeste dubbele stemmen elimineren, maar zal meerdere anonieme stemmen op dezelfde computer (bijvoorbeeld in een internetcafé) niet toestaan."
#: votingapi.admin.inc:25
msgid "Vote tallying"
msgstr "Stembalans opmaken"
#: votingapi.admin.inc:26
msgid "On high-traffic sites, administrators can use this setting to postpone the calculation of vote results."
msgstr "Op drukbezochte sites kunnen beheerders deze instelling gebruiken om het berekenen van de resultaten uit te stellen."
#: votingapi.admin.inc:29
msgid "Tally results whenever a vote is cast"
msgstr "Maak de balans op nadat een stem is uitgebracht"
#: votingapi.admin.inc:30
msgid "Tally results at cron-time"
msgstr "Maak de balans op bij een cron run"
#: votingapi.admin.inc:31
msgid "Do not tally results automatically: I am using a module that manages its own vote results."
msgstr "Maak geen automatische balans op, ik gebruik een module die zijn eigen resultaten bijhoudt."
#: votingapi.admin.inc:49
msgid "Which node types should receive votes?"
msgstr "Welke nodetypes moeten stemmen ontvangen?"
#: votingapi.admin.inc:56
msgid "What type of votes should be generated?"
msgstr "Welk type stemmen moet worden gegenereerd?"
#: votingapi.admin.inc:58
msgid "Fivestar style"
msgstr "Vijfsterstijl"
#: votingapi.admin.inc:59
msgid "Digg style"
msgstr "Diggstijl"
#: votingapi.admin.inc:60
msgid "Reddit style"
msgstr "Redditstijl"
#: votingapi.admin.inc:67
msgid "Delete existing votes before generating new ones."
msgstr "Verwijder bestaande stemmen voor je nieuwe maakt."
#: votingapi.admin.inc:72
msgid "Do it!"
msgstr "Doe het!"
#: votingapi.module:48
msgid "administer voting api"
msgstr "beheer stemmen api"
#: votingapi.module:20
#: votingapi.info:0
msgid "Voting API"
msgstr "Stemmen API"
#: votingapi.module:21
msgid "Global settings for the Voting API."
msgstr "Globale instellingen voor de Stemmen API."
#: votingapi.module:32
msgid "Generate votes"
msgstr "Genereer stemmen"
#: votingapi.module:33
msgid "Generate a given number of votes on site content. Optionally delete existing votes."
msgstr "Genereer een aantal stemmen op site-inhoud. Optioneel kun je bestaande stemmen verwijderen."
#: votingapi.module:0
msgid "votingapi"
msgstr "stemmenapi"
#: votingapi.info:0
msgid "Provides a shared voting API for other modules."
msgstr "Levert een gedeelde stemmen API voor andere modules"
#: votingapi.info:0
msgid "Voting"
msgstr "Stemmen"
#: views/votingapi.views.inc:43
msgid "Voting API votes"
msgstr "Stemmen API stemmen"
#: views/votingapi.views.inc:44
msgid "Voting API results"
msgstr "Stemmen API resultaten"
#: views/votingapi.views.inc:51;171
msgid "Value"
msgstr "Waarde"
#: views/votingapi.views.inc:52;172
msgid "The value of an individual cast vote."
msgstr "De waarde van een individuele uitgebrachte stem."
#: views/votingapi.views.inc:69;188
#: views/votingapi_views_handler_relationship.inc:62
msgid "Value type"
msgstr "Waardetype"
#: views/votingapi.views.inc:70
msgid "The nature of the vote being cast (points, percentage, etc)."
msgstr "Het type stem dat werd uitgebracht (punten, percentage, etc.)."
#: views/votingapi.views.inc:86;205
msgid "Tag"
msgstr "Tag"
#: views/votingapi.views.inc:87
msgid "An optional tag to group multi-criteria votes."
msgstr "Een optionele tag om multi-criteria stemmen te groeperen."
#: views/votingapi.views.inc:103
msgid "User"
msgstr "Gebruiker"
#: views/votingapi.views.inc:104
msgid "The user who cast the vote."
msgstr "De gebruiker die de stem uitbracht."
#: views/votingapi.views.inc:123
msgid "Current user"
msgstr "Huidige gebruiker"
#: views/votingapi.views.inc:124
msgid "Restrict votes to those cast by the current user."
msgstr "Beperk stemmen tot diegene uitgebracht door de huidige gebruiker."
#: views/votingapi.views.inc:133
msgid "IP Address"
msgstr "IP-adres"
#: views/votingapi.views.inc:134
msgid "The IP address of the user who cast the vote."
msgstr "Het IP-adres van de gebruiker die de stem uitbracht."
#: views/votingapi.views.inc:151;241
msgid "Timestamp"
msgstr "Tijdstip"
#: views/votingapi.views.inc:152
msgid "The time the vote was cast."
msgstr "De tijd dat een stem werd uitgebracht."
#: views/votingapi.views.inc:189
msgid "The nature of the results in question (points, percentage, etc)."
msgstr "Het type resultaat (punten, percentage, etc.)."
#: views/votingapi.views.inc:206
msgid "An optional tag to group multi-criteria results."
msgstr "Een optionele tag om multi-criteria resultaten te groeperen."
#: views/votingapi.views.inc:223
msgid "Function"
msgstr "Functie"
#: views/votingapi.views.inc:224
msgid "The aggregate function used to calculate the result."
msgstr "De aggregatiefunctie die wordt gebruikt om de resultaten te berekenen."
#: views/votingapi.views.inc:242
msgid "The time the results were calculated."
msgstr "De tijd dat resultaten werden berekend."
#: views/votingapi.views.inc:266
msgid "Percent"
msgstr "Procent"
#: views/votingapi.views.inc:267
msgid "Points"
msgstr "Punten"
#: views/votingapi.views.inc:273;288;305
msgid "No filtering"
msgstr "Geen filtering"
#: views/votingapi.views.inc:282
msgid "Default vote"
msgstr "Standaard stem"
#: views/votingapi.views.inc:297
msgid "Sum"
msgstr "Som"
#: views/votingapi.views.inc:298
msgid "Count"
msgstr "Aantal"
#: views/votingapi.views.inc:299
msgid "Average"
msgstr "Gemiddelde"
#: views/votingapi.views.inc:322
msgid "nodes"
msgstr "nodes"
#: views/votingapi.views.inc:403
msgid "Display %display defines a VotingAPI vote relationship, but does not restrict the relationship data. This may result in duplicate entries in the resulting view."
msgstr "Weergave %display levert een Stemmen API stemmenrelatie, maar beperkt de relatiedata niet. Dit kan resulteren in gedupliceerde resultaten."
#: views/votingapi.views.inc:410
msgid "Display %display defines a VotingAPI results relationship, but does not restrict the relationship data. This may result in duplicate entries in the resulting view."
msgstr "Weergave %display levert een Stemmen API resultatenrelatie, maar beperkt de relatiedata niet. Dit kan resulteren in gedupliceerde resultaten."
#: views/votingapi_views_handler_field_value.inc:20
msgid "Default appearance"
msgstr "Standaard verschijning"
#: views/votingapi_views_handler_field_value.inc:26
msgid "Appearance"
msgstr "Verschijning"
#: views/votingapi_views_handler_relationship.inc:57
msgid "Data filters"
msgstr "Datafilters"
#: views/votingapi_views_handler_relationship.inc:58
msgid "For each piece of content, many pieces of voting data may be saved. Use these options to specify exactly which types should be available via this relationship. <strong>Warning!</strong> Leaving any of these filters empty may result in multiple copies of each piece of content being displayed in listings."
msgstr "Voor elk stuk inhoud kunnen veel stukken stemdata worden opgeslagen. Gebruik deze opties om aan te geven welke types beschikbaar moeten zijn via deze relatie. <strong>Waarschuwing!</strong> één van deze filters leeglaten kan resulteren in het weergeven van meerdere kopieën van elk stuk inhoud in lijsten."
#: views/votingapi_views_handler_relationship.inc:68
msgid "Vote tag"
msgstr "Stemtag"
#: views/votingapi_views_handler_relationship.inc:76
msgid "Aggregation function"
msgstr "Aggregatiefunctie"
#: views/votingapi_views_handler_relationship.inc:84
msgid "Restrict to current user"
msgstr "Beperk tot huidige gebruiker"
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_HTTP_HTTP_STREAM_FACTORY_H_
#define NET_HTTP_HTTP_STREAM_FACTORY_H_
#include <list>
#include <string>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "net/base/completion_callback.h"
#include "net/base/load_states.h"
#include "net/base/net_export.h"
#include "net/base/request_priority.h"
#include "net/http/http_server_properties.h"
#include "net/socket/connection_attempts.h"
// This file can be included from net/http even though
// it is in net/websockets because it doesn't
// introduce any link dependency to net/websockets.
#include "net/websockets/websocket_handshake_stream_base.h"
class GURL;
namespace base {
class Value;
}
namespace net {
class AuthCredentials;
class BoundNetLog;
class BidirectionalStreamImpl;
class HostMappingRules;
class HostPortPair;
class HttpAuthController;
class HttpNetworkSession;
class HttpResponseHeaders;
class HttpResponseInfo;
class HttpServerProperties;
class HttpStream;
class ProxyInfo;
class SSLCertRequestInfo;
class SSLInfo;
struct HttpRequestInfo;
struct SSLConfig;
// The HttpStreamRequest is the client's handle to the worker object which
// handles the creation of an HttpStream. While the HttpStream is being
// created, this object is the creator's handle for interacting with the
// HttpStream creation process. The request is cancelled by deleting it, after
// which no callbacks will be invoked.
class NET_EXPORT_PRIVATE HttpStreamRequest {
public:
// Indicates which type of stream is requested.
enum StreamType {
BIDIRECTIONAL_STREAM,
HTTP_STREAM,
};
// The HttpStreamRequest::Delegate is a set of callback methods for a
// HttpStreamRequestJob. Generally, only one of these methods will be
// called as a result of a stream request.
class NET_EXPORT_PRIVATE Delegate {
public:
virtual ~Delegate() {}
// This is the success case for RequestStream.
// |stream| is now owned by the delegate.
// |used_ssl_config| indicates the actual SSL configuration used for this
// stream, since the HttpStreamRequest may have modified the configuration
// during stream processing.
// |used_proxy_info| indicates the actual ProxyInfo used for this stream,
// since the HttpStreamRequest performs the proxy resolution.
virtual void OnStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
HttpStream* stream) = 0;
// This is the success case for RequestWebSocketHandshakeStream.
// |stream| is now owned by the delegate.
// |used_ssl_config| indicates the actual SSL configuration used for this
// stream, since the HttpStreamRequest may have modified the configuration
// during stream processing.
// |used_proxy_info| indicates the actual ProxyInfo used for this stream,
// since the HttpStreamRequest performs the proxy resolution.
virtual void OnWebSocketHandshakeStreamReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
WebSocketHandshakeStreamBase* stream) = 0;
virtual void OnBidirectionalStreamImplReady(
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
BidirectionalStreamImpl* stream) = 0;
// This is the failure to create a stream case.
// |used_ssl_config| indicates the actual SSL configuration used for this
// stream, since the HttpStreamRequest may have modified the configuration
// during stream processing.
virtual void OnStreamFailed(int status,
const SSLConfig& used_ssl_config) = 0;
// Called when we have a certificate error for the request.
// |used_ssl_config| indicates the actual SSL configuration used for this
// stream, since the HttpStreamRequest may have modified the configuration
// during stream processing.
virtual void OnCertificateError(int status,
const SSLConfig& used_ssl_config,
const SSLInfo& ssl_info) = 0;
// This is the failure case where we need proxy authentication during
// proxy tunnel establishment. For the tunnel case, we were unable to
// create the HttpStream, so the caller provides the auth and then resumes
// the HttpStreamRequest.
//
// For the non-tunnel case, the caller will discover the authentication
// failure when reading response headers. At that point, it will handle the
// authentication failure and restart the HttpStreamRequest entirely.
//
// Ownership of |auth_controller| and |proxy_response| are owned
// by the HttpStreamRequest. |proxy_response| is not guaranteed to be usable
// after the lifetime of this callback. The delegate may take a reference
// to |auth_controller| if it is needed beyond the lifetime of this
// callback.
//
// |used_ssl_config| indicates the actual SSL configuration used for this
// stream, since the HttpStreamRequest may have modified the configuration
// during stream processing.
virtual void OnNeedsProxyAuth(const HttpResponseInfo& proxy_response,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
HttpAuthController* auth_controller) = 0;
// This is the failure for SSL Client Auth
// Ownership of |cert_info| is retained by the HttpStreamRequest. The
// delegate may take a reference if it needs the cert_info beyond the
// lifetime of this callback.
virtual void OnNeedsClientAuth(const SSLConfig& used_ssl_config,
SSLCertRequestInfo* cert_info) = 0;
// This is the failure of the CONNECT request through an HTTPS proxy.
// Headers can be read from |response_info|, while the body can be read
// from |stream|.
//
// |used_ssl_config| indicates the actual SSL configuration used for this
// stream, since the HttpStreamRequest may have modified the configuration
// during stream processing.
//
// |used_proxy_info| indicates the actual ProxyInfo used for this stream,
// since the HttpStreamRequest performs the proxy resolution.
//
// Ownership of |stream| is transferred to the delegate.
virtual void OnHttpsProxyTunnelResponse(
const HttpResponseInfo& response_info,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
HttpStream* stream) = 0;
// Called when finding all QUIC alternative services are marked broken for
// the origin in this request which advertises supporting QUIC.
virtual void OnQuicBroken() = 0;
};
virtual ~HttpStreamRequest() {}
// When a HttpStream creation process is stalled due to necessity
// of Proxy authentication credentials, the delegate OnNeedsProxyAuth
// will have been called. It now becomes the delegate's responsibility
// to collect the necessary credentials, and then call this method to
// resume the HttpStream creation process.
virtual int RestartTunnelWithProxyAuth(
const AuthCredentials& credentials) = 0;
// Called when the priority of the parent transaction changes.
virtual void SetPriority(RequestPriority priority) = 0;
// Returns the LoadState for the request.
virtual LoadState GetLoadState() const = 0;
// Returns true if TLS/NPN was negotiated for this stream.
virtual bool was_npn_negotiated() const = 0;
// Protocol negotiated with the server.
virtual NextProto protocol_negotiated() const = 0;
// Returns true if this stream is being fetched over SPDY.
virtual bool using_spdy() const = 0;
// Returns socket-layer connection attempts made for this stream request.
virtual const ConnectionAttempts& connection_attempts() const = 0;
};
// The HttpStreamFactory defines an interface for creating usable HttpStreams.
class NET_EXPORT HttpStreamFactory {
public:
virtual ~HttpStreamFactory();
void ProcessAlternativeServices(HttpNetworkSession* session,
const HttpResponseHeaders* headers,
const url::SchemeHostPort& http_server);
// Virtual interface methods.
// Request a stream.
// Will call delegate->OnStreamReady on successful completion.
virtual HttpStreamRequest* RequestStream(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HttpStreamRequest::Delegate* delegate,
const BoundNetLog& net_log) = 0;
// Request a WebSocket handshake stream.
// Will call delegate->OnWebSocketHandshakeStreamReady on successful
// completion.
virtual HttpStreamRequest* RequestWebSocketHandshakeStream(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HttpStreamRequest::Delegate* delegate,
WebSocketHandshakeStreamBase::CreateHelper* create_helper,
const BoundNetLog& net_log) = 0;
// Request a BidirectionalStreamImpl.
// Will call delegate->OnBidirectionalStreamImplReady on successful
// completion.
virtual HttpStreamRequest* RequestBidirectionalStreamImpl(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HttpStreamRequest::Delegate* delegate,
const BoundNetLog& net_log) = 0;
// Requests that enough connections for |num_streams| be opened.
virtual void PreconnectStreams(int num_streams,
const HttpRequestInfo& info) = 0;
virtual const HostMappingRules* GetHostMappingRules() const = 0;
// Static settings
// Reset all static settings to initialized values. Used to init test suite.
static void ResetStaticSettingsToInit();
// Turns spdy on or off.
// TODO(mmenke): Figure out if this can be made a property of the
// HttpNetworkSession.
static void set_spdy_enabled(bool value) {
spdy_enabled_ = value;
}
static bool spdy_enabled() { return spdy_enabled_; }
protected:
HttpStreamFactory();
private:
static bool spdy_enabled_;
url::SchemeHostPort RewriteHost(const url::SchemeHostPort& server);
DISALLOW_COPY_AND_ASSIGN(HttpStreamFactory);
};
} // namespace net
#endif // NET_HTTP_HTTP_STREAM_FACTORY_H_
|
{
"pile_set_name": "Github"
}
|
#include "toolhelper_version.h"
#include "branding.h"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 0,0,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", PRODUCT_NAME " Helper Exe"
VALUE "FileVersion", VERSION_PRODUCTSTR
VALUE "InternalName", "Tool Helper"
VALUE "LegalCopyright", COPYRIGHT
VALUE "OriginalFilename", "toolhelper.exe"
VALUE "ProductName", PRODUCT_NAME
VALUE "ProductVersion", VERSION_PRODUCTSTR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
|
{
"pile_set_name": "Github"
}
|
;;;; local-projects.lisp
;;;
;;; Local project support.
;;;
;;; Local projects can be placed in <quicklisp>/local-projects/. New
;;; entries in that directory are automatically scanned for system
;;; files for use with QL:QUICKLOAD.
;;;
;;; This works by keeping a cache of system file pathnames in
;;; <quicklisp>/local-projects/system-index.txt. Whenever the
;;; timestamp on the local projects directory is newer than the
;;; timestamp on the system index file, the entire tree is re-scanned
;;; and cached.
;;;
;;; This will pick up system files that are created as a result of
;;; creating new project directory in <quicklisp>/local-projects/,
;;; e.g. unpacking a tarball or zip file, checking out a project from
;;; version control, etc. It will NOT pick up a system file that is
;;; added sometime later in a subdirectory; for that, the
;;; REGISTER-LOCAL-PROJECTS function is needed to rebuild the system
;;; file index.
;;;
;;; In the event there are multiple systems of the same name in the
;;; directory tree, the one with the shortest pathname namestring is
;;; used. This is intended to ignore stuff like _darcs pristine
;;; directories.
;;;
;;; Work in progress!
;;;
(in-package #:quicklisp-client)
(defparameter *local-project-directories*
(list (qmerge "local-projects/"))
"The default local projects directory.")
(defun system-index-file (pathname)
"Return the system index file for the directory PATHNAME."
(merge-pathnames "system-index.txt" pathname))
(defun matching-directory-files (directory fun)
(let ((result '()))
(map-directory-tree directory
(lambda (file)
(when (funcall fun file)
(push file result))))
result))
(defun local-project-system-files (pathname)
"Return a list of system files under PATHNAME."
(let* ((files (matching-directory-files pathname
(lambda (file)
(equalp (pathname-type file)
"asd")))))
(setf files (sort files
#'string<
:key #'namestring))
(stable-sort files
#'<
:key (lambda (file)
(length (namestring file))))))
(defun make-system-index (pathname)
"Create a system index file for all system files under
PATHNAME. Current format is one native namestring per line."
(setf pathname (truename pathname))
(with-open-file (stream (system-index-file pathname)
:direction :output
:if-exists :rename-and-delete)
(dolist (system-file (local-project-system-files pathname))
(let ((system-path (enough-namestring system-file pathname)))
(write-line (native-namestring system-path) stream)))
(probe-file stream)))
(defun find-valid-system-index (pathname)
"Find a valid system index file for PATHNAME; one that both exists
and has a newer timestamp than PATHNAME."
(let* ((file (system-index-file pathname))
(probed (probe-file file)))
(when (and probed
(<= (directory-write-date pathname)
(file-write-date probed)))
probed)))
(defun ensure-system-index (pathname)
"Find or create a system index file for PATHNAME."
(or (find-valid-system-index pathname)
(make-system-index pathname)))
(defun find-system-in-index (system index-file)
"If any system pathname in INDEX-FILE has a pathname-name matching
SYSTEM, return its full pathname."
(with-open-file (stream index-file)
(loop for namestring = (read-line stream nil)
while namestring
when (string= system (pathname-name namestring))
return (or (probe-file (merge-pathnames namestring index-file))
;; If the indexed .asd file doesn't exist anymore
;; then regenerate the index and restart the search.
(find-system-in-index system (make-system-index (directory-namestring index-file)))))))
(defun local-projects-searcher (system-name)
"This function is added to ASDF:*SYSTEM-DEFINITION-SEARCH-FUNCTIONS*
to use the local project directory and cache to find systems."
(dolist (directory *local-project-directories*)
(when (probe-directory directory)
(let ((system-index (ensure-system-index directory)))
(when system-index
(let ((system (find-system-in-index system-name system-index)))
(when system
(return system))))))))
(defun list-local-projects ()
"Return a list of pathnames to local project system files."
(let ((result (make-array 16 :fill-pointer 0 :adjustable t))
(seen (make-hash-table :test 'equal)))
(dolist (directory *local-project-directories*
(coerce result 'list))
(let ((index (ensure-system-index directory)))
(when index
(with-open-file (stream index)
(loop for line = (read-line stream nil)
while line do
(let ((pathname (merge-pathnames line index)))
(unless (gethash (pathname-name pathname) seen)
(setf (gethash (pathname-name pathname) seen) t)
(vector-push-extend (merge-pathnames line index)
result))))))))))
(defun register-local-projects ()
"Force a scan of the local projects directory to create the system
file index."
(map nil 'make-system-index *local-project-directories*))
(defun list-local-systems ()
"Return a list of local project system names."
(mapcar #'pathname-name (list-local-projects)))
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python3
#
# Copyright 2011-2015 Jeff Bush
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import os
import subprocess
import sys
sys.path.insert(0, '..')
import test_harness
HOST_EXE_FILE = os.path.join(test_harness.WORK_DIR, 'a.out')
def run_compiler_test(source_file, target):
if target == 'host':
subprocess.check_call(['cc', source_file, '-o', HOST_EXE_FILE],
stderr=subprocess.STDOUT)
result = subprocess.check_output(HOST_EXE_FILE)
test_harness.check_result(source_file, result.decode())
else:
hex_file = test_harness.build_program([source_file])
result = test_harness.run_program(hex_file, target)
test_harness.check_result(source_file, result)
test_list = [fname for fname in test_harness.find_files(
('.c', '.cpp')) if not fname.startswith('_')]
all_targets = [fname for fname in test_list if 'noverilator' not in fname]
test_harness.register_tests(run_compiler_test, all_targets, [
'emulator', 'verilator', 'host', 'fpga'])
noverilator_targets = [fname for fname in test_list if 'noverilator' in fname]
test_harness.register_tests(
run_compiler_test, noverilator_targets, ['emulator', 'host', 'fpga'])
test_harness.execute_tests()
|
{
"pile_set_name": "Github"
}
|
.settings-modal {
.modal-container .modal {
margin: 100px auto;
}
ng-include.flex {
display: flex;
flex-direction: column;
}
.theme-metadata {
padding-left: 20px;
font-size: 15px;
.theme-description {
margin-top: 4px;
max-width: 400px;
}
}
.syntax-theme-preview {
.CodeMirror {
height: 200px;
}
}
}
.setting {
display: flex;
margin: 5px 0;
.input-label {
min-width: 225px;
margin: 0;
}
input[type="text"] {
flex-grow: 1;
margin-right: 6px;
}
select {
min-width: 150px;
}
}
|
{
"pile_set_name": "Github"
}
|
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>View/Status Bar</title>
<link rel="stylesheet" type="text/css" href="../explorer++.css">
<script language="javascript" src="../rollover.js"> </script>
</head>
<body onload="javascript:attachdiv()">
<h2 class="Heading_2_no_table"><a name="top"></a><a href="../nav/mnu-view.htm">
View</a>/Status Bar</h2>
<p><b>Click</b> or <b><i>Hover</i></b> on an item for more ...<br>
<map name="FPMap0">
<area coords="4, 1, 235, 22" shape="rect" onmouseover="javascript:rollovr(this,'{7}/232x22.gif','#items','Items or {2}helper{2} text{0}')">
<area coords="237, 1, 352, 22" shape="rect" onmouseover="javascript:rollovr(this,'{7}/116x22.gif','#size','Size{0}')">
<area coords="354, 1, 455, 22" shape="rect" onmouseover="javascript:rollovr(this,'{7}/102x22.gif','#free','Free space{0}')">
<area coords="456, 1, 472, 22" shape="rect" onmouseover="javascript:rollovr(this,'{7}/17x22_grip.gif','#x','{9}')">
</map>
<img id="MAINimg" border="0" src="../images/mnu_view/status_bar.png" usemap="#FPMap0" width="477" height="27"></p>
<p>The status bar presents some quick information and may be toggled on/off from
the <b>View</b> menu.</p>
<p> </p>
<h3><a name="items"></a>Items/text</h3>
<p>This area shows either</p>
<ul>
<li>the number of <i>items</i> (files and/or folders) and displays one of the
following:<ul>
<li>if no selection exists - total <b>item count</b> (eg. <i>24 items</i>),
a count of items in the folders pane (current folder)</li>
<li>if a selection exists - total <b>selection count</b>, the number of
items selected, or</li>
</ul>
</li>
<li>the <i>helper text</i> of a menu item when the mouse is hovered over that
item.<br>
Example: hovering over the File/<a href="../mnu_file/new_tab.htm">New Tab</a>
menu item displays "Creates a new tab".</li>
</ul>
<p> </p>
<h3><a name="size"></a>Size</h3>
<p>This area shows the actual item (files and/or folders) size and displays one
of the following:</p>
<ul>
<li>if no selection exists - total <b>file size</b>, the combined size of all
files in the folder. Note that folder items are not included in this
size, even if the <a href="../mnu_tools/files_folders/show_folder_sizes.htm">
Show folder sizes</a> option is enabled.</li>
<li>if a selection exists - total <b>selected file size</b>, the combined size
of all selected files (not folders)</li>
<li>if the current tab is a <i>virtual</i> folder (ie. special Windows folder)
- the words <b>Virtual Folder</b>. Selecting items has no effect.</li>
</ul>
<p>If a real size is shown (not a virtual folder), then the size is affected by
the <a href="../mnu_tools/files_folders/file_sizes_in.htm">Show all file sizes
in:...</a> setting.</p>
<p> </p>
<h3><a name="free"></a>Free space</h3>
<p>This area shows free disk space for the volume which houses the currently
active folder (files pane). Free space is shown in bytes (rounded to MB,
GB, etc., regardless of any options settings) and in percentage of the entire
volume.</p>
<p><a title="Top of page" href="#top" style="background-color:transparent">
<img border="0" src="../images/common/arrow_top.gif" width="23" height="23"></a></p>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
module.exports = (f) => (...args) => f(...args)
|
{
"pile_set_name": "Github"
}
|
/*================================================================================
code generated by: java2cpp
author: Zoran Angelov, mailto://baldzar@gmail.com
class: android.os.PatternMatcher
================================================================================*/
#ifndef J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_ANDROID_OS_PATTERNMATCHER_HPP_DECL
#define J2CPP_ANDROID_OS_PATTERNMATCHER_HPP_DECL
namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace android { namespace os { class Parcelable; } } }
namespace j2cpp { namespace android { namespace os { class Parcel; } } }
namespace j2cpp { namespace android { namespace os { namespace Parcelable_ { class Creator; } } } }
#include <android/os/Parcel.hpp>
#include <android/os/Parcelable.hpp>
#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>
namespace j2cpp {
namespace android { namespace os {
class PatternMatcher;
class PatternMatcher
: public object<PatternMatcher>
{
public:
J2CPP_DECLARE_CLASS
J2CPP_DECLARE_METHOD(0)
J2CPP_DECLARE_METHOD(1)
J2CPP_DECLARE_METHOD(2)
J2CPP_DECLARE_METHOD(3)
J2CPP_DECLARE_METHOD(4)
J2CPP_DECLARE_METHOD(5)
J2CPP_DECLARE_METHOD(6)
J2CPP_DECLARE_METHOD(7)
J2CPP_DECLARE_METHOD(8)
J2CPP_DECLARE_FIELD(0)
J2CPP_DECLARE_FIELD(1)
J2CPP_DECLARE_FIELD(2)
J2CPP_DECLARE_FIELD(3)
explicit PatternMatcher(jobject jobj)
: object<PatternMatcher>(jobj)
{
}
operator local_ref<java::lang::Object>() const;
operator local_ref<android::os::Parcelable>() const;
PatternMatcher(local_ref< java::lang::String > const&, jint);
PatternMatcher(local_ref< android::os::Parcel > const&);
local_ref< java::lang::String > getPath();
jint getType();
jboolean match(local_ref< java::lang::String > const&);
local_ref< java::lang::String > toString();
jint describeContents();
void writeToParcel(local_ref< android::os::Parcel > const&, jint);
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(0), J2CPP_FIELD_SIGNATURE(0), jint > PATTERN_LITERAL;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(1), J2CPP_FIELD_SIGNATURE(1), jint > PATTERN_PREFIX;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(2), J2CPP_FIELD_SIGNATURE(2), jint > PATTERN_SIMPLE_GLOB;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(3), J2CPP_FIELD_SIGNATURE(3), local_ref< android::os::Parcelable_::Creator > > CREATOR;
}; //class PatternMatcher
} //namespace os
} //namespace android
} //namespace j2cpp
#endif //J2CPP_ANDROID_OS_PATTERNMATCHER_HPP_DECL
#else //J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_ANDROID_OS_PATTERNMATCHER_HPP_IMPL
#define J2CPP_ANDROID_OS_PATTERNMATCHER_HPP_IMPL
namespace j2cpp {
android::os::PatternMatcher::operator local_ref<java::lang::Object>() const
{
return local_ref<java::lang::Object>(get_jobject());
}
android::os::PatternMatcher::operator local_ref<android::os::Parcelable>() const
{
return local_ref<android::os::Parcelable>(get_jobject());
}
android::os::PatternMatcher::PatternMatcher(local_ref< java::lang::String > const &a0, jint a1)
: object<android::os::PatternMatcher>(
call_new_object<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_METHOD_NAME(0),
android::os::PatternMatcher::J2CPP_METHOD_SIGNATURE(0)
>(a0, a1)
)
{
}
android::os::PatternMatcher::PatternMatcher(local_ref< android::os::Parcel > const &a0)
: object<android::os::PatternMatcher>(
call_new_object<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_METHOD_NAME(1),
android::os::PatternMatcher::J2CPP_METHOD_SIGNATURE(1)
>(a0)
)
{
}
local_ref< java::lang::String > android::os::PatternMatcher::getPath()
{
return call_method<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_METHOD_NAME(2),
android::os::PatternMatcher::J2CPP_METHOD_SIGNATURE(2),
local_ref< java::lang::String >
>(get_jobject());
}
jint android::os::PatternMatcher::getType()
{
return call_method<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_METHOD_NAME(3),
android::os::PatternMatcher::J2CPP_METHOD_SIGNATURE(3),
jint
>(get_jobject());
}
jboolean android::os::PatternMatcher::match(local_ref< java::lang::String > const &a0)
{
return call_method<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_METHOD_NAME(4),
android::os::PatternMatcher::J2CPP_METHOD_SIGNATURE(4),
jboolean
>(get_jobject(), a0);
}
local_ref< java::lang::String > android::os::PatternMatcher::toString()
{
return call_method<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_METHOD_NAME(5),
android::os::PatternMatcher::J2CPP_METHOD_SIGNATURE(5),
local_ref< java::lang::String >
>(get_jobject());
}
jint android::os::PatternMatcher::describeContents()
{
return call_method<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_METHOD_NAME(6),
android::os::PatternMatcher::J2CPP_METHOD_SIGNATURE(6),
jint
>(get_jobject());
}
void android::os::PatternMatcher::writeToParcel(local_ref< android::os::Parcel > const &a0, jint a1)
{
return call_method<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_METHOD_NAME(7),
android::os::PatternMatcher::J2CPP_METHOD_SIGNATURE(7),
void
>(get_jobject(), a0, a1);
}
static_field<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_FIELD_NAME(0),
android::os::PatternMatcher::J2CPP_FIELD_SIGNATURE(0),
jint
> android::os::PatternMatcher::PATTERN_LITERAL;
static_field<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_FIELD_NAME(1),
android::os::PatternMatcher::J2CPP_FIELD_SIGNATURE(1),
jint
> android::os::PatternMatcher::PATTERN_PREFIX;
static_field<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_FIELD_NAME(2),
android::os::PatternMatcher::J2CPP_FIELD_SIGNATURE(2),
jint
> android::os::PatternMatcher::PATTERN_SIMPLE_GLOB;
static_field<
android::os::PatternMatcher::J2CPP_CLASS_NAME,
android::os::PatternMatcher::J2CPP_FIELD_NAME(3),
android::os::PatternMatcher::J2CPP_FIELD_SIGNATURE(3),
local_ref< android::os::Parcelable_::Creator >
> android::os::PatternMatcher::CREATOR;
J2CPP_DEFINE_CLASS(android::os::PatternMatcher,"android/os/PatternMatcher")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,0,"<init>","(Ljava/lang/String;I)V")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,1,"<init>","(Landroid/os/Parcel;)V")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,2,"getPath","()Ljava/lang/String;")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,3,"getType","()I")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,4,"match","(Ljava/lang/String;)Z")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,5,"toString","()Ljava/lang/String;")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,6,"describeContents","()I")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,7,"writeToParcel","(Landroid/os/Parcel;I)V")
J2CPP_DEFINE_METHOD(android::os::PatternMatcher,8,"<clinit>","()V")
J2CPP_DEFINE_FIELD(android::os::PatternMatcher,0,"PATTERN_LITERAL","I")
J2CPP_DEFINE_FIELD(android::os::PatternMatcher,1,"PATTERN_PREFIX","I")
J2CPP_DEFINE_FIELD(android::os::PatternMatcher,2,"PATTERN_SIMPLE_GLOB","I")
J2CPP_DEFINE_FIELD(android::os::PatternMatcher,3,"CREATOR","Landroid/os/Parcelable$Creator;")
} //namespace j2cpp
#endif //J2CPP_ANDROID_OS_PATTERNMATCHER_HPP_IMPL
#endif //J2CPP_INCLUDE_IMPLEMENTATION
|
{
"pile_set_name": "Github"
}
|
<?php
namespace GuzzleHttp\Tests\Stream;
use GuzzleHttp\Stream\LimitStream;
use GuzzleHttp\Stream\PumpStream;
use GuzzleHttp\Stream\Stream;
class PumpStreamTest extends \PHPUnit_Framework_TestCase
{
public function testHasMetadataAndSize()
{
$p = new PumpStream(function () {}, [
'metadata' => ['foo' => 'bar'],
'size' => 100
]);
$this->assertEquals('bar', $p->getMetadata('foo'));
$this->assertEquals(['foo' => 'bar'], $p->getMetadata());
$this->assertEquals(100, $p->getSize());
}
public function testCanReadFromCallable()
{
$p = Stream::factory(function ($size) {
return 'a';
});
$this->assertEquals('a', $p->read(1));
$this->assertEquals(1, $p->tell());
$this->assertEquals('aaaaa', $p->read(5));
$this->assertEquals(6, $p->tell());
}
public function testStoresExcessDataInBuffer()
{
$called = [];
$p = Stream::factory(function ($size) use (&$called) {
$called[] = $size;
return 'abcdef';
});
$this->assertEquals('a', $p->read(1));
$this->assertEquals('b', $p->read(1));
$this->assertEquals('cdef', $p->read(4));
$this->assertEquals('abcdefabc', $p->read(9));
$this->assertEquals([1, 9, 3], $called);
}
public function testInifiniteStreamWrappedInLimitStream()
{
$p = Stream::factory(function () { return 'a'; });
$s = new LimitStream($p, 5);
$this->assertEquals('aaaaa', (string) $s);
}
public function testDescribesCapabilities()
{
$p = Stream::factory(function () {});
$this->assertTrue($p->isReadable());
$this->assertFalse($p->isSeekable());
$this->assertFalse($p->isWritable());
$this->assertNull($p->getSize());
$this->assertFalse($p->write('aa'));
$this->assertEquals('', $p->getContents());
$this->assertEquals('', (string) $p);
$p->close();
$this->assertEquals('', $p->read(10));
$this->assertTrue($p->eof());
}
/**
* @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException
*/
public function testCannotAttach()
{
$p = Stream::factory(function () {});
$p->attach('a');
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Sonar Objective-C Plugin
* Copyright (C) 2012 OCTO Technology
* dev@sonar.codehaus.org
*
* This program 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 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
package org.sonar.plugins.objectivec.violations;
import java.io.File;
import java.util.Collection;
import org.slf4j.LoggerFactory;
import org.sonar.api.batch.Sensor;
import org.sonar.api.batch.SensorContext;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Project;
import org.sonar.api.rules.Violation;
import org.sonar.plugins.objectivec.ObjectiveCPlugin;
import org.sonar.plugins.objectivec.core.ObjectiveC;
public final class OCLintSensor implements Sensor {
public static final String REPORT_PATH_KEY = ObjectiveCPlugin.PROPERTY_PREFIX
+ ".oclint.report";
public static final String DEFAULT_REPORT_PATH = "sonar-reports/oclint.xml";
private final Settings conf;
private final FileSystem fileSystem;
public OCLintSensor(final FileSystem moduleFileSystem, final Settings config) {
this.conf = config;
this.fileSystem = moduleFileSystem;
}
public boolean shouldExecuteOnProject(final Project project) {
return project.isRoot() && fileSystem.languages().contains(ObjectiveC.KEY);
}
public void analyse(final Project project, final SensorContext context) {
final String projectBaseDir = project.getFileSystem().getBasedir()
.getPath();
final OCLintParser parser = new OCLintParser(project, context);
saveViolations(parseReportIn(projectBaseDir, parser), context);
}
private void saveViolations(final Collection<Violation> violations,
final SensorContext context) {
for (final Violation violation : violations) {
context.saveViolation(violation);
}
}
private Collection<Violation> parseReportIn(final String baseDir,
final OCLintParser parser) {
final StringBuilder reportFileName = new StringBuilder(baseDir);
reportFileName.append("/").append(reportPath());
LoggerFactory.getLogger(getClass()).info("Processing OCLint report {}",
reportFileName);
return parser.parseReport(new File(reportFileName.toString()));
}
private String reportPath() {
String reportPath = conf.getString(REPORT_PATH_KEY);
if (reportPath == null) {
reportPath = DEFAULT_REPORT_PATH;
}
return reportPath;
}
}
|
{
"pile_set_name": "Github"
}
|
{
"extends": "./tsconfig.json",
"files": ["src/main/webapp/app/app.main.ts"]
}
|
{
"pile_set_name": "Github"
}
|
&GLOBAL
PRINT_LEVEL LOW
PROJECT Li2
RUN_TYPE ENERGY
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
&DFT
BASIS_SET_FILE_NAME BASIS_SET
POTENTIAL_FILE_NAME POTENTIAL
&MGRID
CUTOFF 240
&END MGRID
&PRINT
&DFT_CONTROL_PARAMETERS
&END DFT_CONTROL_PARAMETERS
&MO
&EACH
QS_SCF 0
&END EACH
EIGENVALUES TRUE
EIGENVECTORS TRUE
OCCUPATION_NUMBERS TRUE
NDIGITS 12
FILENAME __STD_OUT__
&END MO
&END PRINT
&QS
&END QS
&SCF
ADDED_MOS 10
EPS_SCF 1.0e-10
EPS_DIIS 1.E-6
MAX_SCF 1
SCF_GUESS RESTART
&PRINT
&RESTART OFF
&EACH
QS_SCF -1
&END
BACKUP_COPIES 0
&END
&RESTART_HISTORY OFF
&EACH
QS_SCF -1
&END
BACKUP_COPIES 0
&END
&END PRINT
&END SCF
&XC
&XC_FUNCTIONAL
&XGGA
FUNCTIONAL EV93
&END XGGA
&END XC_FUNCTIONAL
&END XC
&END DFT
&SUBSYS
&CELL
ABC [bohr] 10 10 20
&END CELL
&COORD
UNIT bohr
Li 0.0 0.0 -2.67732437187761072041
Li 0.0 0.0 2.67732437187761072041
&END COORD
&KIND Li
BASIS_SET DZVP-GTH-PADE
POTENTIAL GTH-PBE-q3
&END KIND
&PRINT
&CELL
&END CELL
&KINDS
&END KINDS
&END PRINT
&END SUBSYS
&END FORCE_EVAL
|
{
"pile_set_name": "Github"
}
|
# set of questions for Materials Engineering (Dr. Gabrielle Lam)
##DESCRIPTION
##
## Created by the UBC Department of Mechanical Engineering. Project led by Agnes d'Entremont.
##
## Contact: agnes.dentremont@mech.ubc.ca
##
## This work is licensed under the Creative Commons
## Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
## <https://creativecommons.org/licenses/by-sa/4.0/>
##
## We gratefully acknowledge the financial support for this
## project provided by UBC Vancouver students via the Teaching
## and Learning Enhancement Fund. We also gratefully acknowledge
## additional funding support from BCcampus, the UBC Department of
## Mechanical Engineering, and the UBC Applied Science Dean’s Office.
##
## This work was completed on the traditional, ancestral, and unceded
## territory of the Musqueam people.
##
##ENDDESCRIPTION
## DBsubject(Materials Engineering)
## DBchapter()
## DBsection()
## Date()
## Author()
## Level()
## KEYWORDS('')
## RESOURCES('')
## Institution('UBC')
## TitleText('')
## EditionText('')
## AuthorText('')
## Section('')
## Problem('')
##############################################################
DOCUMENT();
# #image scale
# $imgScale = .5;
# #image aspect ratio
# $width = $imgScale*586;
# $height = $imgScale*649;
loadMacros(
"PGstandard.pl", # Standard macros for PG language
"MathObjects.pl",
"PGML.pl",
"parserPopUp.pl",
"parserMultiAnswer.pl",
"parserRadioButtons.pl",
"parserFunction.pl",
"PGauxiliaryFunctions.pl",
"PGchoicemacros.pl",
#"source.pl", # allows code to be displayed on certain sites.
#"PGcourse.pl", # Customization file for the course
);
TEXT(beginproblem());
###########################
# Setup
$mc2 = new_multiple_choice();
$mc2->qa(
"Which of the following statements about recrystallization and grain growth is incorrect?",
"Annealing heat treatment can increase the ductility and yield strength of a strain hardened material to its original state"
);
$mc2->extra(
"Strain hardening increases the internal energy within a material, thereby increasing the driving force for recovery and recrystallization",
"At elevated temperatures of annealing heat treatment, dislocations are reconfigured such that stored energy in the material is released ",
"Increasing the annealing temperature decreases the time required for recrystallization to be complete",
);
###########################
# Main text
BEGIN_PGML
[@ $mc2 -> print_q() @]***
[@ $mc2 -> print_a() @]***
END_PGML
$showPartialCorrectAnswers = 0;
ANS( radio_cmp( $mc2->correct_ans() ) );
##############################################################
ENDDOCUMENT();
|
{
"pile_set_name": "Github"
}
|
static unsigned char neoVehicle_VS_cso[] = {
0x00, 0x02, 0xfe, 0xff, 0xfe, 0xff, 0xab, 0x00, 0x43, 0x54, 0x41, 0x42,
0x1c, 0x00, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0x00, 0x02, 0xfe, 0xff,
0x0d, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x6f, 0x02, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0f, 0x00,
0x01, 0x00, 0x3e, 0x00, 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x40, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00,
0x4c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00,
0x02, 0x00, 0x29, 0x00, 0x01, 0x00, 0xa6, 0x00, 0x60, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00,
0x01, 0x00, 0x42, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x8c, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x3a, 0x00,
0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00,
0x02, 0x00, 0x11, 0x00, 0x18, 0x00, 0x46, 0x00, 0xe0, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x00,
0x01, 0x00, 0x32, 0x00, 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf7, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x03, 0x00, 0x22, 0x00,
0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x24, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x02, 0x00, 0x2a, 0x00,
0x01, 0x00, 0xaa, 0x00, 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x3e, 0x02, 0x00, 0x00, 0x02, 0x00, 0x2b, 0x00, 0x0f, 0x00, 0xae, 0x00,
0x4c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x02, 0x00, 0x00,
0x02, 0x00, 0x0d, 0x00, 0x01, 0x00, 0x36, 0x00, 0x30, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x66, 0x02, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00,
0x04, 0x00, 0x12, 0x00, 0x4c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x67, 0x68, 0x74,
0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6d, 0x62,
0x69, 0x6e, 0x65, 0x64, 0x4d, 0x61, 0x74, 0x00, 0x03, 0x00, 0x03, 0x00,
0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x65, 0x79, 0x65, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x03, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x69, 0x72, 0x73,
0x74, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x00, 0xab, 0x01, 0x00, 0x02, 0x00,
0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x66, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x00, 0x6c, 0x69, 0x67, 0x68,
0x74, 0x73, 0x00, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab,
0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e,
0x00, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0xab,
0x9b, 0x01, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00,
0xa4, 0x01, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x03, 0x00,
0xc8, 0x01, 0x00, 0x00, 0x6d, 0x61, 0x74, 0x43, 0x6f, 0x6c, 0x00, 0x6e,
0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x00, 0xab, 0xab, 0xab,
0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x6e, 0x75, 0x6d, 0x44, 0x69, 0x72, 0x4c, 0x69,
0x67, 0x68, 0x74, 0x73, 0x00, 0xab, 0xab, 0xab, 0x00, 0x00, 0x02, 0x00,
0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x72, 0x65, 0x66, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x00, 0x73, 0x70,
0x65, 0x63, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0xab, 0xab, 0xab,
0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x05, 0x00, 0x03, 0x00,
0xc8, 0x01, 0x00, 0x00, 0x73, 0x75, 0x72, 0x66, 0x50, 0x72, 0x6f, 0x70,
0x73, 0x00, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x4d, 0x61, 0x74, 0x00, 0x76,
0x73, 0x5f, 0x32, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73,
0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c,
0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70,
0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35,
0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05,
0x0b, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40,
0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x51, 0x00, 0x00, 0x05,
0x3a, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x05,
0x01, 0x00, 0x0f, 0xf0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02,
0x0a, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x05, 0x00, 0x00, 0x03,
0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0xe4, 0xa0,
0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0,
0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04,
0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90,
0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80,
0x03, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x90, 0x00, 0x00, 0xe4, 0x80,
0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0xe4, 0x80,
0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0x55, 0x90,
0x09, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80,
0x08, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80,
0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x0a, 0x00, 0xe4, 0xa0,
0x01, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02,
0x01, 0x00, 0x01, 0x80, 0x0d, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03,
0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0x00, 0x80, 0x0f, 0x00, 0xe4, 0xa0,
0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80,
0x2a, 0x00, 0x55, 0xa0, 0x03, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02,
0x02, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02,
0x01, 0x00, 0x08, 0x80, 0x0b, 0x00, 0x00, 0xa0, 0x26, 0x00, 0x00, 0x01,
0x00, 0x00, 0xe4, 0xf0, 0x02, 0x00, 0x00, 0x03, 0x03, 0x00, 0x01, 0x80,
0x01, 0x00, 0xff, 0x80, 0x10, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03,
0x03, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x55, 0xa0,
0x2e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0xb0, 0x03, 0x00, 0x00, 0x80,
0x08, 0x00, 0x00, 0x04, 0x03, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x80,
0x13, 0x20, 0xe4, 0xa1, 0x00, 0x00, 0x00, 0xb0, 0x0b, 0x00, 0x00, 0x03,
0x03, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0xa0,
0x05, 0x00, 0x00, 0x04, 0x03, 0x00, 0x07, 0x80, 0x03, 0x00, 0x00, 0x80,
0x11, 0x20, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x05, 0x00, 0x00, 0x03,
0x03, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x0d, 0x00, 0xaa, 0xa0,
0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x80,
0x2a, 0x00, 0x55, 0xa0, 0x02, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03,
0x01, 0x00, 0x08, 0x80, 0x01, 0x00, 0xff, 0x80, 0x0b, 0x00, 0xaa, 0xa0,
0x27, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x08, 0x80,
0x03, 0x00, 0xff, 0x90, 0x0b, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0f, 0x80,
0x02, 0x00, 0xe4, 0x80, 0x0b, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x03,
0x01, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x0b, 0x00, 0xaa, 0xa0,
0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xd0, 0x01, 0x00, 0xe4, 0x80,
0x0c, 0x00, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80,
0x00, 0x00, 0x55, 0x90, 0x05, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04,
0x01, 0x00, 0x07, 0x80, 0x04, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90,
0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80,
0x06, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, 0x01, 0x00, 0xe4, 0x80,
0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x07, 0x00, 0xe4, 0xa0,
0x00, 0x00, 0xff, 0x90, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03,
0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x81, 0x29, 0x00, 0xe4, 0xa0,
0x24, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x80,
0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x02, 0x00, 0xe4, 0x80,
0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x06, 0x80,
0x00, 0x00, 0xd0, 0x80, 0x01, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x04,
0x01, 0x00, 0x06, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x0b, 0x00, 0xff, 0xa0,
0x02, 0x00, 0xd0, 0x81, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x03, 0xe0,
0x01, 0x00, 0xe9, 0x80, 0x3a, 0x00, 0x00, 0xa0, 0x3a, 0x00, 0x00, 0xa0,
0x0b, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80,
0x0b, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80,
0x01, 0x00, 0x00, 0x80, 0x0b, 0x00, 0xaa, 0xa0, 0x02, 0x00, 0x00, 0x03,
0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x81, 0x0b, 0x00, 0xaa, 0xa0,
0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80, 0x01, 0x00, 0x00, 0x80,
0x01, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x02, 0x80,
0x01, 0x00, 0x55, 0x80, 0x01, 0x00, 0x55, 0x80, 0x04, 0x00, 0x00, 0x04,
0x01, 0x00, 0x04, 0x80, 0x01, 0x00, 0x55, 0x80, 0x01, 0x00, 0x00, 0x81,
0x0b, 0x00, 0xaa, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80,
0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0x80, 0x04, 0x00, 0x00, 0x04,
0x01, 0x00, 0x01, 0x80, 0x2a, 0x00, 0x00, 0xa0, 0x01, 0x00, 0xaa, 0x80,
0x01, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, 0x08, 0xd0,
0x01, 0x00, 0x00, 0x80, 0x2a, 0x00, 0xaa, 0xa0, 0x01, 0x00, 0x00, 0x02,
0x01, 0x00, 0x0f, 0x80, 0x0b, 0x00, 0x00, 0xa0, 0x26, 0x00, 0x00, 0x01,
0x01, 0x00, 0xe4, 0xf0, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x08, 0x80,
0x01, 0x00, 0xff, 0x80, 0x0b, 0x00, 0x55, 0xa0, 0x2e, 0x00, 0x00, 0x02,
0x00, 0x00, 0x01, 0xb0, 0x02, 0x00, 0xff, 0x80, 0x02, 0x00, 0x00, 0x04,
0x03, 0x00, 0x07, 0x80, 0x02, 0x00, 0xe4, 0x80, 0x2d, 0x20, 0xe4, 0xa1,
0x00, 0x00, 0x00, 0xb0, 0x24, 0x00, 0x00, 0x02, 0x04, 0x00, 0x07, 0x80,
0x03, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x08, 0x80,
0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0xe4, 0x80, 0x0b, 0x00, 0x00, 0x03,
0x02, 0x00, 0x08, 0x80, 0x02, 0x00, 0xff, 0x80, 0x0b, 0x00, 0x00, 0xa0,
0x0a, 0x00, 0x00, 0x03, 0x02, 0x00, 0x08, 0x80, 0x02, 0x00, 0xff, 0x80,
0x0b, 0x00, 0xaa, 0xa0, 0x20, 0x00, 0x00, 0x04, 0x03, 0x00, 0x01, 0x80,
0x02, 0x00, 0xff, 0x80, 0x2d, 0x20, 0xff, 0xa0, 0x00, 0x00, 0x00, 0xb0,
0x05, 0x00, 0x00, 0x04, 0x03, 0x00, 0x07, 0x80, 0x03, 0x00, 0x00, 0x80,
0x2b, 0x20, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x05, 0x00, 0x00, 0x03,
0x03, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x80, 0x2a, 0x00, 0xff, 0xa0,
0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0x80,
0x2a, 0x00, 0x55, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03,
0x01, 0x00, 0x08, 0x80, 0x01, 0x00, 0xff, 0x80, 0x0b, 0x00, 0xaa, 0xa0,
0x27, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0xd0,
0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80,
0x00, 0x00, 0xff, 0x80, 0x0e, 0x00, 0x55, 0xa1, 0x05, 0x00, 0x00, 0x03,
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0xaa, 0xa0,
0x0b, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80,
0x0e, 0x00, 0xff, 0xa0, 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0xe0,
0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0xaa, 0xa0, 0x01, 0x00, 0x00, 0x02,
0x00, 0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00
};
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2014, The Android Open Source Project
**
** 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.
*/
-->
<merge xmlns:latin="http://schemas.android.com/apk/res-auto">
<!-- U+0993: "ও" BENGALI LETTER O
U+09CB: "ো" BENGALI VOWEL SIGN O -->
<Key
latin:keySpec="ও"
latin:moreKeys="ো" />
<!-- U+098F: "এ" BENGALI LETTER E
U+09C7: "ে" BENGALI VOWEL SIGN E -->
<Key
latin:keySpec="এ"
latin:moreKeys="ে" />
<!-- U+0985: "অ" BENGALI LETTER A
U+09CD: "্" BENGALI SIGN VIRAMA -->
<Key
latin:keySpec="অ"
latin:moreKeys="্" />
<!-- U+0987: "ই" BENGALI LETTER I
U+09BF: "ি" BENGALI VOWEL SIGN I -->
<Key
latin:keySpec="ই"
latin:moreKeys="ি" />
<!-- U+0989: "উ" BENGALI LETTER U
U+09C1: "ু" BENGALI VOWEL SIGN U -->
<Key
latin:keySpec="উ"
latin:moreKeys="ু" />
<!-- U+09AA: "প" BENGALI LETTER PA
U+09AB: "ফ" BENGALI LETTER PHA -->
<Key
latin:keySpec="প"
latin:moreKeys="ফ" />
<!-- U+09B0: "র" BENGALI LETTER RA
U+09C3: "ৃ" BENGALI VOWEL SIGN VOCALIC R
U+098B: "ঋ" BENGALI LETTER VOCALIC R
U+09A4/U+09CD/U+09B0: "ত্র" BENGALI LETTER TA/BENGALI SIGN VIRAMA/BENGALI LETTER RA -->
<Key
latin:keySpec="র"
latin:moreKeys="ৃ,ঋ,ত্র" />
<!-- U+0995: "ক" BENGALI LETTER KA
U+0996: "খ" BENGALI LETTER KHA -->
<Key
latin:keySpec="ক"
latin:moreKeys="খ" />
<!-- U+09A4: "ত" BENGALI LETTER TA
U+09CE: "ৎ" BENGALI LETTER KHANDA TA
U+09A5: "থ" BENGALI LETTER THA
U+09A4/U+09CD/U+09A4: "ত্ত" BENGALI LETTER TA/BENGALI SIGN VIRAMA/BENGALI LETTER TA -->
<Key
latin:keySpec="ত"
latin:moreKeys="ৎ,থ,ত্ত" />
<!-- U+099A: "চ" BENGALI LETTER CA
U+099B: "ছ" BENGALI LETTER CHA -->
<Key
latin:keySpec="চ"
latin:moreKeys="ছ" />
<!-- U+099F: "ট" BENGALI LETTER TTA
U+09A0: "ঠ" BENGALI LETTER TTHA -->
<Key
latin:keySpec="ট"
latin:moreKeys="ঠ" />
</merge>
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: 697dbf8a770840d439b6014f4afc1f82
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2019 The Android Open Source Project
*
* 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.android.keyguard.clock;
import android.app.WallpaperManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Paint.Style;
import android.util.MathUtils;
import android.view.LayoutInflater;
import android.view.View;
import com.android.internal.colorextraction.ColorExtractor;
import com.android.systemui.R;
import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.plugins.ClockPlugin;
import java.util.TimeZone;
import static android.view.View.TEXT_ALIGNMENT_CENTER;
/**
* Plugin for a custom Typographic clock face that displays the time in words.
*/
public class TypeClockAltAccentController implements ClockPlugin {
/**
* Resources used to get title and thumbnail.
*/
private final Resources mResources;
/**
* LayoutInflater used to inflate custom clock views.
*/
private final LayoutInflater mLayoutInflater;
/**
* Extracts accent color from wallpaper.
*/
private final SysuiColorExtractor mColorExtractor;
/**
* Computes preferred position of clock.
*/
private float mDarkAmount;
private final int mStatusBarHeight;
private final int mKeyguardLockPadding;
private final int mKeyguardLockHeight;
private final int mBurnInOffsetY;
/**
* Renders preview from clock view.
*/
private final ViewPreviewer mRenderer = new ViewPreviewer();
/**
* Custom clock shown on AOD screen and behind stack scroller on lock.
*/
private TypographicClock mTypeClock;
private ClockLayout mBigClockView;
private int mAccentColor;
/**
* Controller for transition into dark state.
*/
private CrossFadeDarkController mDarkController;
/**
* Create a TypeClockAltAccentController instance.
*
* @param res Resources contains title and thumbnail.
* @param inflater Inflater used to inflate custom clock views.
* @param colorExtractor Extracts accent color from wallpaper.
*/
TypeClockAltAccentController(Resources res, LayoutInflater inflater,
SysuiColorExtractor colorExtractor) {
mResources = res;
mLayoutInflater = inflater;
mColorExtractor = colorExtractor;
mStatusBarHeight = res.getDimensionPixelSize(R.dimen.status_bar_height);
mKeyguardLockPadding = res.getDimensionPixelSize(R.dimen.keyguard_lock_padding);
mKeyguardLockHeight = res.getDimensionPixelSize(R.dimen.keyguard_lock_height);
mBurnInOffsetY = res.getDimensionPixelSize(R.dimen.burn_in_prevention_offset_y);
}
private void createViews() {
mBigClockView = (ClockLayout) mLayoutInflater.inflate(R.layout.type_clock_alt, null);
mTypeClock = mBigClockView.findViewById(R.id.type_clock);
}
@Override
public void onDestroyView() {
mBigClockView = null;
mTypeClock = null;
mDarkController = null;
}
@Override
public String getName() {
return "type_alt";
}
@Override
public String getTitle() {
return mResources.getString(R.string.clock_title_type_alt_accent);
}
@Override
public Bitmap getThumbnail() {
return BitmapFactory.decodeResource(mResources, R.drawable.type_thumbnail);
}
@Override
public Bitmap getPreview(int width, int height) {
// Use the big clock view for the preview
View view = getBigClockView();
// Initialize state of plugin before generating preview.
setDarkAmount(1f);
setTextColor(Color.WHITE);
ColorExtractor.GradientColors colors = mColorExtractor.getColors(
WallpaperManager.FLAG_LOCK);
setColorPalette(colors.supportsDarkText(), colors.getColorPalette());
mAccentColor = mResources.getColor(R.color.accent_device_default_light);
onTimeTick();
return mRenderer.createPreview(view, width, height);
}
@Override
public View getView() {
if (mBigClockView == null) {
createViews();
}
return mBigClockView;
}
@Override
public View getBigClockView() {
if (mBigClockView == null) {
createViews();
}
return mBigClockView ;
}
@Override
public int getPreferredY(int totalHeight) {
// On AOD, clock needs to appear below the status bar with enough room for pixel shifting
int aodY = mStatusBarHeight + mKeyguardLockHeight + 2 * mKeyguardLockPadding
+ mBurnInOffsetY + mTypeClock.getHeight() + (mTypeClock.getHeight() / 2);
// On lock screen, clock needs to appear below the lock icon
int lockY = mStatusBarHeight + mKeyguardLockHeight + 2 * mKeyguardLockPadding + (mTypeClock.getHeight() / 2);
return (int) MathUtils.lerp(lockY, aodY, mDarkAmount);
}
@Override
public void setTextColor(int color) {
mTypeClock.setTextColor(color);
}
@Override
public void setColorPalette(boolean supportsDarkText, int[] colorPalette) {
if (colorPalette == null || colorPalette.length == 0) {
return;
}
mAccentColor = mResources.getColor(R.color.accent_device_default_light);
mTypeClock.setClockColor(mAccentColor);
}
@Override
public void onTimeTick() {
mTypeClock.onTimeChanged();
}
@Override
public void setDarkAmount(float darkAmount) {
mDarkAmount = darkAmount;
if (mDarkController != null) {
mDarkController.setDarkAmount(darkAmount);
}
}
@Override
public void onTimeZoneChanged(TimeZone timeZone) {
mTypeClock.onTimeZoneChanged(timeZone);
}
@Override
public boolean shouldShowStatusArea() {
return true;
}
}
|
{
"pile_set_name": "Github"
}
|
// (C) Copyright Edward Diener 2011-2015
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
#if !defined(BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP)
#define BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP
#include <boost/vmd/detail/setup.hpp>
#if BOOST_PP_VARIADICS
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/** \def BOOST_VMD_ASSERT_IS_IDENTIFIER(...)
\brief Asserts that the sequence is an identifier.
The macro checks that the sequence is an identifier.
If it is not an identifier, it forces a compiler error.
The macro normally checks for an identifier only in
debug mode. However an end-user can force the macro
to check or not check by defining the macro
BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.
... = variadic parameters
The variadic parameters are:
sequence = A sequence to test as an identifier.
ids (optional) = The data may take one of two forms:
it is either one or more single identifiers
or a single Boost PP tuple of identifiers.
returns = Normally the macro returns nothing.
If the sequence is an identifier, nothing is
output. If optional ids are specified, for the
sequence to be an identifier it must be an
identifier that matches one of the optional
ids.
For VC++, because there is no sure way of forcing
a compiler error from within a macro without producing
output, if the sequence is not an identifier the
macro forces a compiler error by outputting invalid C++.
For all other compilers a compiler error is forced
without producing output if the sequence is not an
identifier.
Identifiers are registered in VMD with:
#define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier.
The identifier must be registered to be found.
Identifiers are pre-detected in VMD with:
#define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier.
If you specify optional ids and have not specified the detection
of an optional id, that id will never match an identifier.
*/
/** \def BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...)
\brief Asserts that the sequence is an identifier. Re-entrant version.
The macro checks that the sequence is an identifier.
If it is not an identifier, it forces a compiler error.
The macro normally checks for an identifier only in
debug mode. However an end-user can force the macro
to check or not check by defining the macro
BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.
d = The next available BOOST_PP_WHILE iteration.
... = variadic parameters
The variadic parameters are:
sequence = A sequence to test as an identifier.
ids (optional) = The data may take one of two forms:
it is either one or more single identifiers
or a single Boost PP tuple of identifiers.
returns = Normally the macro returns nothing.
If the sequence is an identifier, nothing is
output. If optional ids are specified, for the
sequence to be an identifier it must be an
identifier that matches one of the optional
ids.
For VC++, because there is no sure way of forcing
a compiler error from within a macro without producing
output, if the sequence is not an identifier the
macro forces a compiler error by outputting invalid C++.
For all other compilers a compiler error is forced
without producing output if the sequence is not an
identifier.
Identifiers are registered in VMD with:
#define BOOST_VMD_REG_XXX (XXX) where XXX is a v-identifier.
The identifier must be registered to be found.
Identifiers are pre-detected in VMD with:
#define BOOST_VMD_DETECT_XXX_XXX where XXX is an identifier.
If you specify optional ids and have not specified the detection
of an optional id, that id will never match an identifier.
*/
#if !BOOST_VMD_ASSERT_DATA
#define BOOST_VMD_ASSERT_IS_IDENTIFIER(...)
#define BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...)
#else
#include <boost/vmd/assert.hpp>
#include <boost/vmd/is_identifier.hpp>
#define BOOST_VMD_ASSERT_IS_IDENTIFIER(...) \
BOOST_VMD_ASSERT \
( \
BOOST_VMD_IS_IDENTIFIER(__VA_ARGS__), \
BOOST_VMD_IDENTIFIER_ASSERT_ERROR \
) \
/**/
#define BOOST_VMD_ASSERT_IS_IDENTIFIER_D(d,...) \
BOOST_VMD_ASSERT \
( \
BOOST_VMD_IS_IDENTIFIER_D(d,__VA_ARGS__), \
BOOST_VMD_IDENTIFIER_ASSERT_ERROR \
) \
/**/
#endif // !BOOST_VMD_ASSERT_DATA
#endif /* BOOST_PP_VARIADICS */
#endif /* BOOST_VMD_ASSERT_IS_IDENTIFIER_HPP */
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!-- If runtime tag is absent -->
<runtime xdt:Transform="InsertIfMissing">
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
</assemblyBinding>
</runtime>
<!-- If runtime tag is present, but assembly binding tag is absent -->
<runtime>
<assemblyBinding xdt:Transform="InsertIfMissing" xmlns="urn:schemas-microsoft-com:asm.v1">
</assemblyBinding>
</runtime>
<!-- If the binding redirect is already present, the existing entry needs to be removed before inserting the new entry-->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="Remove"
xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Web.Mvc')" >
</dependentAssembly>
</assemblyBinding>
</runtime>
<!-- Inserting the new binding redirect -->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
|
{
"pile_set_name": "Github"
}
|
/*
frame: Central data structures and opmitization hooks.
copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
*/
#ifndef MPG123_FRAME_H
#define MPG123_FRAME_H
#include <stdio.h>
#include "config.h"
#include "mpg123.h"
#include "optimize.h"
#include "id3.h"
#include "icy.h"
#include "reader.h"
#ifdef FRAME_INDEX
#include "index.h"
#endif
#include "synths.h"
#ifdef OPT_DITHER
#include "dither.h"
int frame_dither_init(mpg123_handle *fr);
#endif
/* max = 1728 */
#define MAXFRAMESIZE 3456
struct al_table
{
short bits;
short d;
};
/* the output buffer, used to be pcm_sample, pcm_point and audiobufsize */
struct outbuffer
{
unsigned char *data; /* main data pointer, aligned */
unsigned char *p; /* read pointer */
size_t fill; /* fill from read pointer */
size_t size;
unsigned char *rdata; /* unaligned base pointer */
};
struct audioformat
{
int encoding;
int encsize; /* Size of one sample in bytes, plain int should be fine here... */
int channels;
long rate;
};
void invalidate_format(struct audioformat *af);
struct mpg123_pars_struct
{
int verbose; /* verbose level */
long flags; /* combination of above */
#ifndef NO_NTOM
long force_rate;
#endif
int down_sample;
int rva; /* (which) rva to do: 0: nothing, 1: radio/mix/track 2: album/audiophile */
long halfspeed;
long doublespeed;
long timeout;
#define NUM_CHANNELS 2
char audio_caps[NUM_CHANNELS][MPG123_RATES+1][MPG123_ENCODINGS];
/* long start_frame; */ /* frame offset to begin with */
/* long frame_number;*/ /* number of frames to decode */
#ifndef NO_ICY
long icy_interval;
#endif
double outscale;
long resync_limit;
long index_size; /* Long, because: negative values have a meaning. */
long preframes;
#ifndef NO_FEEDER
long feedpool;
long feedbuffer;
#endif
};
enum frame_state_flags
{
FRAME_ACCURATE = 0x1 /**< 0001 Positions are considered accurate. */
,FRAME_FRANKENSTEIN = 0x2 /**< 0010 This stream is concatenated. */
};
/* There is a lot to condense here... many ints can be merged as flags; though the main space is still consumed by buffers. */
struct mpg123_handle_struct
{
int fresh; /* to be moved into flags */
int new_format;
real hybrid_block[2][2][SBLIMIT*SSLIMIT];
int hybrid_blc[2];
/* the scratch vars for the decoders, sometimes real, sometimes short... sometimes int/long */
short *short_buffs[2][2];
real *real_buffs[2][2];
unsigned char *rawbuffs;
int rawbuffss;
#ifdef OPT_I486
int i486bo[2];
#endif
int bo; /* Just have it always here. */
#ifdef OPT_DITHER
int ditherindex;
float *dithernoise;
#endif
unsigned char* rawdecwin; /* the block with all decwins */
int rawdecwins; /* size of rawdecwin memory */
real *decwin; /* _the_ decode table */
#ifdef OPT_MMXORSSE
/* I am not really sure that I need both of them... used in assembler */
float *decwin_mmx;
float *decwins;
#endif
int have_eq_settings;
real equalizer[2][32];
/* for halfspeed mode */
unsigned char ssave[34];
int halfphase;
#ifndef NO_8BIT
/* a raw buffer and a pointer into the middle for signed short conversion, only allocated on demand */
unsigned char *conv16to8_buf;
unsigned char *conv16to8;
#endif
/* There's some possible memory saving for stuff that is not _really_ dynamic. */
/* layer3 */
int longLimit[9][23];
int shortLimit[9][14];
real gainpow2[256+118+4]; /* not really dynamic, just different for mmx */
/* layer2 */
real muls[27][64]; /* also used by layer 1 */
#ifndef NO_NTOM
/* decode_ntom */
unsigned long ntom_val[2];
unsigned long ntom_step;
#endif
/* special i486 fun */
#ifdef OPT_I486
int *int_buffs[2][2];
#endif
/* special altivec... */
#ifdef OPT_ALTIVEC
real *areal_buffs[4][4];
#endif
struct synth_s synths;
struct
{
#ifdef OPT_MULTI
#ifndef NO_LAYER3
#if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX)
void (*the_dct36)(real *,real *,real *,real *,real *);
#endif
#endif
#endif
enum optdec type;
enum optcla class;
} cpu_opts;
int verbose; /* 0: nothing, 1: just print chosen decoder, 2: be verbose */
const struct al_table *alloc;
/* The runtime-chosen decoding, based on input and output format. */
func_synth synth;
func_synth_stereo synth_stereo;
func_synth_mono synth_mono;
/* Yes, this function is runtime-switched, too. */
void (*make_decode_tables)(mpg123_handle *fr); /* That is the volume control. */
int stereo; /* I _think_ 1 for mono and 2 for stereo */
int jsbound;
#define SINGLE_STEREO -1
#define SINGLE_LEFT 0
#define SINGLE_RIGHT 1
#define SINGLE_MIX 3
int single;
int II_sblimit;
int down_sample_sblimit;
int lsf; /* 0: MPEG 1.0; 1: MPEG 2.0/2.5 -- both used as bool and array index! */
/* Many flags in disguise as integers... wasting bytes. */
int mpeg25;
int down_sample;
int header_change;
int lay;
int (*do_layer)(mpg123_handle *);
int error_protection;
int bitrate_index;
int sampling_frequency;
int padding;
int extension;
int mode;
int mode_ext;
int copyright;
int original;
int emphasis;
int framesize; /* computed framesize */
int freesize; /* free format frame size */
enum mpg123_vbr vbr; /* 1 if variable bitrate was detected */
off_t num; /* frame offset ... */
off_t input_offset; /* byte offset of this frame in input stream */
off_t playnum; /* playback offset... includes repetitions, reset at seeks */
off_t audio_start; /* The byte offset in the file where audio data begins. */
int state_flags;
char silent_resync; /* Do not complain for the next n resyncs. */
unsigned char* xing_toc; /* The seek TOC from Xing header. */
int freeformat;
long freeformat_framesize;
/* bitstream info; bsi */
int bitindex;
unsigned char *wordpointer;
/* temporary storage for getbits stuff */
unsigned long ultmp;
unsigned char uctmp;
/* rva data, used in common.c, set in id3.c */
double maxoutburst; /* The maximum amplitude in current sample represenation. */
double lastscale;
struct
{
int level[2];
float gain[2];
float peak[2];
} rva;
/* input data */
off_t track_frames;
off_t track_samples;
double mean_framesize;
off_t mean_frames;
int fsizeold;
int ssize;
unsigned int bitreservoir;
unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */
unsigned char *bsbuf;
unsigned char *bsbufold;
int bsnum;
/* That is the header matching the last read frame body. */
unsigned long oldhead;
/* That is the header that is supposedly the first of the stream. */
unsigned long firsthead;
int abr_rate;
#ifdef FRAME_INDEX
struct frame_index index;
#endif
/* output data */
struct outbuffer buffer;
struct audioformat af;
int own_buffer;
size_t outblock; /* number of bytes that this frame produces (upper bound) */
int to_decode; /* this frame holds data to be decoded */
int to_ignore; /* the same, somehow */
off_t firstframe; /* start decoding from here */
off_t lastframe; /* last frame to decode (for gapless or num_frames limit) */
off_t ignoreframe; /* frames to decode but discard before firstframe */
#ifdef GAPLESS
off_t gapless_frames; /* frame count for the gapless part */
off_t firstoff; /* number of samples to ignore from firstframe */
off_t lastoff; /* number of samples to use from lastframe */
off_t begin_s; /* overall begin offset in samples */
off_t begin_os;
off_t end_s; /* overall end offset in samples */
off_t end_os;
off_t fullend_os; /* gapless_frames translated to output samples */
#endif
unsigned int crc; /* Well, I need a safe 16bit type, actually. But wider doesn't hurt. */
struct reader *rd; /* pointer to the reading functions */
struct reader_data rdat; /* reader data and state info */
struct mpg123_pars_struct p;
int err;
int decoder_change;
int delayed_change;
long clip;
/* the meta crap */
int metaflags;
unsigned char id3buf[128];
#ifndef NO_ID3V2
mpg123_id3v2 id3v2;
#endif
#ifndef NO_ICY
struct icy_meta icy;
#endif
/*
More variables needed for decoders, layerX.c.
This time it is not about static variables but about the need for alignment which cannot be guaranteed on the stack by certain compilers (Sun Studio).
We do not require the compiler to align stuff for our hand-written assembly. We only hope that it's able to align stuff for SSE and similar ops it generates itself.
*/
/*
Those layer-specific structs could actually share memory, as they are not in use simultaneously. One might allocate on decoder switch, too.
They all reside in one lump of memory (after each other), allocated to layerscratch.
*/
real *layerscratch;
#ifndef NO_LAYER1
struct
{
real (*fraction)[SBLIMIT]; /* ALIGNED(16) real fraction[2][SBLIMIT]; */
} layer1;
#endif
#ifndef NO_LAYER2
struct
{
real (*fraction)[4][SBLIMIT]; /* ALIGNED(16) real fraction[2][4][SBLIMIT] */
} layer2;
#endif
#ifndef NO_LAYER3
/* These are significant chunks of memory already... */
struct
{
real (*hybrid_in)[SBLIMIT][SSLIMIT]; /* ALIGNED(16) real hybridIn[2][SBLIMIT][SSLIMIT]; */
real (*hybrid_out)[SSLIMIT][SBLIMIT]; /* ALIGNED(16) real hybridOut[2][SSLIMIT][SBLIMIT]; */
} layer3;
#endif
/* A place for storing additional data for the large file wrapper.
This is cruft! */
void *wrapperdata;
/* A callback used to properly destruct the wrapper data. */
void (*wrapperclean)(void*);
};
/* generic init, does not include dynamic buffers */
void frame_init(mpg123_handle *fr);
void frame_init_par(mpg123_handle *fr, mpg123_pars *mp);
/* output buffer and format */
int frame_outbuffer(mpg123_handle *fr);
int frame_output_format(mpg123_handle *fr);
int frame_buffers(mpg123_handle *fr); /* various decoder buffers, needed once */
int frame_reset(mpg123_handle* fr); /* reset for next track */
int frame_buffers_reset(mpg123_handle *fr);
void frame_exit(mpg123_handle *fr); /* end, free all buffers */
/* Index functions... */
/* Well... print it... */
int mpg123_print_index(mpg123_handle *fr, FILE* out);
/* Find a seek position in index. */
off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame);
/* Apply index_size setting. */
int frame_index_setup(mpg123_handle *fr);
void do_volume(mpg123_handle *fr, double factor);
void do_rva(mpg123_handle *fr);
/* samples per frame ...
Layer I
Layer II
Layer III
MPEG-1
384
1152
1152
MPEG-2 LSF
384
1152
576
MPEG 2.5
384
1152
576
*/
#define spf(fr) ((fr)->lay == 1 ? 384 : ((fr)->lay==2 ? 1152 : ((fr)->lsf || (fr)->mpeg25 ? 576 : 1152)))
#ifdef GAPLESS
/* well, I take that one for granted... at least layer3 */
#define GAPLESS_DELAY 529
void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip);
void frame_gapless_realinit(mpg123_handle *fr);
void frame_gapless_update(mpg123_handle *mh, off_t total_samples);
/*void frame_gapless_position(mpg123_handle* fr);
void frame_gapless_bytify(mpg123_handle *fr);
void frame_gapless_ignore(mpg123_handle *fr, off_t frames);*/
/* void frame_gapless_buffercheck(mpg123_handle *fr); */
#endif
/* Number of samples the decoding of the current frame should yield. */
off_t frame_expect_outsamples(mpg123_handle *fr);
/* Skip this frame... do some fake action to get away without actually decoding it. */
void frame_skip(mpg123_handle *fr);
/*
Seeking core functions:
- convert input sample offset to output sample offset
- convert frame offset to output sample offset
- get leading frame offset for output sample offset
The offsets are "unadjusted"/internal; resampling is being taken care of.
*/
off_t frame_ins2outs(mpg123_handle *fr, off_t ins);
off_t frame_outs(mpg123_handle *fr, off_t num);
/* This one just computes the expected sample count for _this_ frame. */
off_t frame_expect_outsampels(mpg123_handle *fr);
off_t frame_offset(mpg123_handle *fr, off_t outs);
void frame_set_frameseek(mpg123_handle *fr, off_t fe);
void frame_set_seek(mpg123_handle *fr, off_t sp);
off_t frame_tell_seek(mpg123_handle *fr);
/* Take a copy of the Xing VBR TOC for fuzzy seeking. */
int frame_fill_toc(mpg123_handle *fr, unsigned char* in);
#endif
|
{
"pile_set_name": "Github"
}
|
//
// Basic print styles
// --------------------------------------------------
// Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css
@media print {
* {
text-shadow: none !important;
color: #000 !important; // Black prints faster: h5bp.com/s
background: transparent !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
// Don't show links for images, or javascript/internal links
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group; // h5bp.com/t
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
// Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245
// Once fixed, we can just straight up remove this.
select {
background: #fff !important;
}
// Bootstrap components
.navbar {
display: none;
}
.table {
td,
th {
background-color: #fff !important;
}
}
.btn,
.dropup > .btn {
> .caret {
border-top-color: #000 !important;
}
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table-bordered {
th,
td {
border: 1px solid #ddd !important;
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* [PUBLISH] ブログ最近の投稿
*
* baserCMS : Based Website Development Project <http://basercms.net>
* Copyright (c) baserCMS Users Community <http://basercms.net/community/>
*
* @copyright Copyright (c) baserCMS Users Community
* @link http://basercms.net baserCMS Project
* @package Blog.View
* @since baserCMS v 0.1.0
* @license http://basercms.net/license/index.html
*/
if (!isset($count)) {
$count = 5;
}
if (isset($blogContent)) {
$id = $blogContent['BlogContent']['id'];
} else {
$id = $blog_content_id;
}
$data = $this->requestAction('/blog/blog/get_recent_entries/' . $id . '/' . $count, ['entityId' => $id]);
$recentEntries = $data['recentEntries'];
$blogContent = $data['blogContent'];
$baseCurrentUrl = $this->request->params['Content']['name'] . '/archives/';
?>
<div class="widget widget-blog-recent-entries widget-blog-recent-entries-<?php echo $id ?> blog-widget">
<?php if ($name && $use_title): ?>
<h2><?php echo $name ?></h2>
<?php endif ?>
<?php if ($recentEntries): ?>
<ul>
<?php foreach ($recentEntries as $recentEntry): ?>
<?php if ($this->request->url == $baseCurrentUrl . $recentEntry['BlogPost']['no']): ?>
<?php $class = ' class="current"' ?>
<?php else: ?>
<?php $class = '' ?>
<?php endif ?>
<li<?php echo $class ?>>
<?php $this->Blog->postTitle($recentEntry) ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
|
{
"pile_set_name": "Github"
}
|
{% extends "base.html" %}
{% block title %}{{ username }}: {{ artist }}{% endblock %}
{% block tagline %}This is {{ username }}'s history for <em>{{ artist }}</em>.{% endblock %}
{% block content %}
<img class="resizeable_graph" src="/graph/{{ username }}/artist/{{ artist }}/" />
<div class="export">
Export:
<!-- <a href="../../export/artist/{{ artist }}.xls" title="This data in XLS">
<img src="/static/images/page_excel.png" alt="This data in XLS" />
</a> -->
<a href="../../export/artist/{{ artist }}.csv" title="This data in CSV">
<img src="/static/images/page_white_text.png" alt="This data in CSV" />
</a>
<a href="../../export/artist/{{ artist }}.json" title="This data in JSON">
<img src="/static/images/page.png" alt="This data in JSON" />
</a>
</div>
{% endblock %}
|
{
"pile_set_name": "Github"
}
|
/*
* GStreamer
* Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* Copyright (C) 2010 Luis de Bethencourt <luis@debethencourt.com>
*
* 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.
*
* Alternatively, the contents of this file may be used under the
* GNU Lesser General Public License Version 2.1 (the "LGPL"), in
* which case the following provisions apply instead of the ones
* mentioned above:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gst/gst.h>
#include "gstplugin.h"
/* PACKAGE: this is usually set by autotools depending on some _INIT macro
* in configure.ac and then written into and defined in config.h, but we can
* just set it ourselves here in case someone doesn't use autotools to
* compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
*/
#ifndef PACKAGE
#define PACKAGE "gaudieffects"
#endif
static gboolean
plugin_init (GstPlugin * plugin)
{
gboolean ret = TRUE;
ret &= gst_burn_plugin_init (plugin);
ret &= gst_chromium_plugin_init (plugin);
ret &= gst_dilate_plugin_init (plugin);
ret &= gst_dodge_plugin_init (plugin);
ret &= gst_exclusion_plugin_init (plugin);
ret &= gst_solarize_plugin_init (plugin);
ret &= gst_gauss_blur_plugin_init (plugin);
return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
gaudieffects,
"Gaudi video effects.",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|
{
"pile_set_name": "Github"
}
|
config {
name: "envoy.filters.network.local_ratelimit"
typed_config {
type_url: "type.googleapis.com/envoy.extensions.filters.network.local_ratelimit.v3.LocalRateLimit"
value: "\nVtype.googleapis.com/envoy.extensions.filters.network.local_ratelimit.v3.LocalRateLimit\022\013\010\001\032\007\010\200^\020\200\306\001"
}
}
actions {
on_new_connection {
}
}
actions {
on_data {
data: "\000\000"
}
}
actions {
on_data {
data: "\000\000"
}
}
actions {
on_new_connection {
}
}
actions {
advance_time {
milliseconds: 12035000
}
}
actions {
on_data {
data: "\000\000"
}
}
actions {
on_new_connection {
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <rs@dailymotion.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#import "SDWebImageCompat.h"
#import "SDWebImageOperation.h"
#import "SDWebImageDownloader.h"
#import "SDImageCache.h"
typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {
/**
* By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying.
* This flag disable this blacklisting.
*/
SDWebImageRetryFailed = 1 << 0,
/**
* By default, image downloads are started during UI interactions, this flags disable this feature,
* leading to delayed download on UIScrollView deceleration for instance.
*/
SDWebImageLowPriority = 1 << 1,
/**
* This flag disables on-disk caching
*/
SDWebImageCacheMemoryOnly = 1 << 2,
/**
* This flag enables progressive download, the image is displayed progressively during download as a browser would do.
* By default, the image is only displayed once completely downloaded.
*/
SDWebImageProgressiveDownload = 1 << 3,
/**
* Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed.
* The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation.
* This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics.
* If a cached image is refreshed, the completion block is called once with the cached image and again with the final image.
*
* Use this flag only if you can't make your URLs static with embedded cache busting parameter.
*/
SDWebImageRefreshCached = 1 << 4,
/**
* In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for
* extra time in background to let the request finish. If the background task expires the operation will be cancelled.
*/
SDWebImageContinueInBackground = 1 << 5,
/**
* Handles cookies stored in NSHTTPCookieStore by setting
* NSMutableURLRequest.HTTPShouldHandleCookies = YES;
*/
SDWebImageHandleCookies = 1 << 6,
/**
* Enable to allow untrusted SSL certificates.
* Useful for testing purposes. Use with caution in production.
*/
SDWebImageAllowInvalidSSLCertificates = 1 << 7,
/**
* By default, image are loaded in the order they were queued. This flag move them to
* the front of the queue and is loaded immediately instead of waiting for the current queue to be loaded (which
* could take a while).
*/
SDWebImageHighPriority = 1 << 8,
/**
* By default, placeholder images are loaded while the image is loading. This flag will delay the loading
* of the placeholder image until after the image has finished loading.
*/
SDWebImageDelayPlaceholder = 1 << 9,
/**
* We usually don't call transformDownloadedImage delegate method on animated images,
* as most transformation code would mangle it.
* Use this flag to transform them anyway.
*/
SDWebImageTransformAnimatedImage = 1 << 10,
/**
* By default, image is added to the imageView after download. But in some cases, we want to
* have the hand before setting the image (apply a filter or add it with cross-fade animation for instance)
* Use this flag if you want to manually set the image in the completion when success
*/
SDWebImageAvoidAutoSetImage = 1 << 11
};
typedef void(^SDWebImageCompletionBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL);
typedef void(^SDWebImageCompletionWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL);
typedef NSString *(^SDWebImageCacheKeyFilterBlock)(NSURL *url);
@class SDWebImageManager;
@protocol SDWebImageManagerDelegate <NSObject>
@optional
/**
* Controls which image should be downloaded when the image is not found in the cache.
*
* @param imageManager The current `SDWebImageManager`
* @param imageURL The url of the image to be downloaded
*
* @return Return NO to prevent the downloading of the image on cache misses. If not implemented, YES is implied.
*/
- (BOOL)imageManager:(SDWebImageManager *)imageManager shouldDownloadImageForURL:(NSURL *)imageURL;
/**
* Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory.
* NOTE: This method is called from a global queue in order to not to block the main thread.
*
* @param imageManager The current `SDWebImageManager`
* @param image The image to transform
* @param imageURL The url of the image to transform
*
* @return The transformed image object.
*/
- (UIImage *)imageManager:(SDWebImageManager *)imageManager transformDownloadedImage:(UIImage *)image withURL:(NSURL *)imageURL;
@end
/**
* The SDWebImageManager is the class behind the UIImageView+WebCache category and likes.
* It ties the asynchronous downloader (SDWebImageDownloader) with the image cache store (SDImageCache).
* You can use this class directly to benefit from web image downloading with caching in another context than
* a UIView.
*
* Here is a simple example of how to use SDWebImageManager:
*
* @code
SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadImageWithURL:imageURL
options:0
progress:nil
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
if (image) {
// do something with image
}
}];
* @endcode
*/
@interface SDWebImageManager : NSObject
@property (weak, nonatomic) id <SDWebImageManagerDelegate> delegate;
@property (strong, nonatomic, readonly) SDImageCache *imageCache;
@property (strong, nonatomic, readonly) SDWebImageDownloader *imageDownloader;
/**
* The cache filter is a block used each time SDWebImageManager need to convert an URL into a cache key. This can
* be used to remove dynamic part of an image URL.
*
* The following example sets a filter in the application delegate that will remove any query-string from the
* URL before to use it as a cache key:
*
* @code
[[SDWebImageManager sharedManager] setCacheKeyFilter:^(NSURL *url) {
url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path];
return [url absoluteString];
}];
* @endcode
*/
@property (nonatomic, copy) SDWebImageCacheKeyFilterBlock cacheKeyFilter;
/**
* Returns global SDWebImageManager instance.
*
* @return SDWebImageManager shared instance
*/
+ (SDWebImageManager *)sharedManager;
/**
* Downloads the image at the given URL if not present in cache or return the cached version otherwise.
*
* @param url The URL to the image
* @param options A mask to specify options to use for this request
* @param progressBlock A block called while image is downloading
* @param completedBlock A block called when operation has been completed.
*
* This parameter is required.
*
* This block has no return value and takes the requested UIImage as first parameter.
* In case of error the image parameter is nil and the second parameter may contain an NSError.
*
* The third parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache
* or from the memory cache or from the network.
*
* The last parameter is set to NO when the SDWebImageProgressiveDownload option is used and the image is
* downloading. This block is thus called repeatedly with a partial image. When image is fully downloaded, the
* block is called a last time with the full image and the last parameter set to YES.
*
* @return Returns an NSObject conforming to SDWebImageOperation. Should be an instance of SDWebImageDownloaderOperation
*/
- (id <SDWebImageOperation>)downloadImageWithURL:(NSURL *)url
options:(SDWebImageOptions)options
progress:(SDWebImageDownloaderProgressBlock)progressBlock
completed:(SDWebImageCompletionWithFinishedBlock)completedBlock;
/**
* Saves image to cache for given URL
*
* @param image The image to cache
* @param url The URL to the image
*
*/
- (void)saveImageToCache:(UIImage *)image forURL:(NSURL *)url;
/**
* Cancel all current operations
*/
- (void)cancelAll;
/**
* Check one or more operations running
*/
- (BOOL)isRunning;
/**
* Check if image has already been cached
*
* @param url image url
*
* @return if the image was already cached
*/
- (BOOL)cachedImageExistsForURL:(NSURL *)url;
/**
* Check if image has already been cached on disk only
*
* @param url image url
*
* @return if the image was already cached (disk only)
*/
- (BOOL)diskImageExistsForURL:(NSURL *)url;
/**
* Async check if image has already been cached
*
* @param url image url
* @param completionBlock the block to be executed when the check is finished
*
* @note the completion block is always executed on the main queue
*/
- (void)cachedImageExistsForURL:(NSURL *)url
completion:(SDWebImageCheckCacheCompletionBlock)completionBlock;
/**
* Async check if image has already been cached on disk only
*
* @param url image url
* @param completionBlock the block to be executed when the check is finished
*
* @note the completion block is always executed on the main queue
*/
- (void)diskImageExistsForURL:(NSURL *)url
completion:(SDWebImageCheckCacheCompletionBlock)completionBlock;
/**
*Return the cache key for a given URL
*/
- (NSString *)cacheKeyForURL:(NSURL *)url;
@end
#pragma mark - Deprecated
typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType) __deprecated_msg("Block type deprecated. Use `SDWebImageCompletionBlock`");
typedef void(^SDWebImageCompletedWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) __deprecated_msg("Block type deprecated. Use `SDWebImageCompletionWithFinishedBlock`");
@interface SDWebImageManager (Deprecated)
/**
* Downloads the image at the given URL if not present in cache or return the cached version otherwise.
*
* @deprecated This method has been deprecated. Use `downloadImageWithURL:options:progress:completed:`
*/
- (id <SDWebImageOperation>)downloadWithURL:(NSURL *)url
options:(SDWebImageOptions)options
progress:(SDWebImageDownloaderProgressBlock)progressBlock
completed:(SDWebImageCompletedWithFinishedBlock)completedBlock __deprecated_msg("Method deprecated. Use `downloadImageWithURL:options:progress:completed:`");
@end
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<doc>
<assembly>
<name>OpenTK.GLControl</name>
</assembly>
<members>
<member name="T:OpenTK.GLControl">
<summary>
Defines a UserControl with OpenGL rendering capabilities.
</summary>
</member>
<member name="F:OpenTK.GLControl.components">
<summary>
Required designer variable.
</summary>
</member>
<member name="M:OpenTK.GLControl.Dispose(System.Boolean)">
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
</member>
<member name="M:OpenTK.GLControl.InitializeComponent">
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
</member>
<member name="M:OpenTK.GLControl.#ctor">
<summary>
Constructs a new GLControl.
</summary>
</member>
<member name="M:OpenTK.GLControl.#ctor(OpenTK.Graphics.GraphicsMode)">
<summary>
Constructs a new GLControl with the specified GraphicsMode.
</summary>
<param name="mode">The OpenTK.Graphics.GraphicsMode of the control.</param>
</member>
<member name="M:OpenTK.GLControl.#ctor(OpenTK.Graphics.GraphicsMode,System.Int32,System.Int32,OpenTK.Graphics.GraphicsContextFlags)">
<summary>
Constructs a new GLControl with the specified GraphicsMode.
</summary>
<param name="mode">The OpenTK.Graphics.GraphicsMode of the control.</param>
<param name="major">The major version for the OpenGL GraphicsContext.</param>
<param name="minor">The minor version for the OpenGL GraphicsContext.</param>
<param name="flags">The GraphicsContextFlags for the OpenGL GraphicsContext.</param>
</member>
<member name="M:OpenTK.GLControl.OnHandleCreated(System.EventArgs)">
<summary>Raises the HandleCreated event.</summary>
<param name="e">Not used.</param>
</member>
<member name="M:OpenTK.GLControl.OnHandleDestroyed(System.EventArgs)">
<summary>Raises the HandleDestroyed event.</summary>
<param name="e">Not used.</param>
</member>
<member name="M:OpenTK.GLControl.OnPaint(System.Windows.Forms.PaintEventArgs)">
<summary>
Raises the System.Windows.Forms.Control.Paint event.
</summary>
<param name="e">A System.Windows.Forms.PaintEventArgs that contains the event data.</param>
</member>
<member name="M:OpenTK.GLControl.OnResize(System.EventArgs)">
<summary>
Raises the Resize event.
Note: this method may be called before the OpenGL context is ready.
Check that IsHandleCreated is true before using any OpenGL methods.
</summary>
<param name="e">A System.EventArgs that contains the event data.</param>
</member>
<member name="M:OpenTK.GLControl.OnParentChanged(System.EventArgs)">
<summary>
Raises the ParentChanged event.
</summary>
<param name="e">A System.EventArgs that contains the event data.</param>
</member>
<member name="M:OpenTK.GLControl.SwapBuffers">
<summary>
Swaps the front and back buffers, presenting the rendered scene to the screen.
</summary>
</member>
<member name="M:OpenTK.GLControl.MakeCurrent">
<summary>
Makes the underlying this GLControl current in the calling thread.
All OpenGL commands issued are hereafter interpreted by this GLControl.
</summary>
</member>
<member name="M:OpenTK.GLControl.GrabScreenshot">
<summary>Grabs a screenshot of the frontbuffer contents.</summary>
<returns>A System.Drawing.Bitmap, containing the contents of the frontbuffer.</returns>
<exception cref="T:OpenTK.Graphics.GraphicsContextException">
Occurs when no OpenTK.Graphics.GraphicsContext is current in the calling thread.
</exception>
</member>
<member name="P:OpenTK.GLControl.IsIdle">
<summary>
Gets a value indicating whether the current thread contains pending system messages.
</summary>
</member>
<member name="P:OpenTK.GLControl.Context">
<summary>
Gets an interface to the underlying GraphicsContext used by this GLControl.
</summary>
</member>
<member name="P:OpenTK.GLControl.AspectRatio">
<summary>
Gets the aspect ratio of this GLControl.
</summary>
</member>
<member name="P:OpenTK.GLControl.VSync">
<summary>
Gets or sets a value indicating whether vsync is active for this GLControl.
</summary>
</member>
<member name="P:OpenTK.GLControl.GraphicsMode">
<summary>
Gets the GraphicsMode of the GraphicsContext attached to this GLControl.
</summary>
<remarks>
To change the GraphicsMode, you must destroy and recreate the GLControl.
</remarks>
</member>
<member name="P:OpenTK.GLControl.WindowInfo">
<summary>
Gets the <see cref="T:OpenTK.Platform.IWindowInfo"/> for this instance.
</summary>
</member>
</members>
</doc>
|
{
"pile_set_name": "Github"
}
|
<div class="thumb discoverLogo flexNoShrink"></div>
<div class="providersHeader flexNoShrink">
<div class="flexVCent">
<div>
<div class="tx4 rowTn">OpenBazaar</div>
<div class="tx6"><%= ob.polyT('search.title') %></div>
</div>
</div>
</div>
<div class="providersBar flexExpand">
<div class="providerWrapper gutterH <% if(!ob.showSelectDefault) print('margR') %> js-providerWrapper">
<% if (ob.showSelectDefault) { %>
<div class="selectingBox confirmBox arrowBoxTop clrP clrBr clrSh1">
<h2><%= ob.polyT('search.chooseDefaultTitle') %></h2>
<p class="tx5"><%= ob.polyT('search.chooseDefaultMsg') %></p>
</div>
<% } %>
</div>
<div class="posR flexVCent addWrapper js-addWrapper <% if(!ob.showAdd) print('hide') %>">
<button class="thumb clrP clrBr clrSh2 addBtn js-openAddBtn"><i class="ion-ios-plus-empty"></i></button>
</div>
</div>
<div>
<div class="flexVCent gutterHSm">
<a class="btn barBtn flexNoShrink tx6 clrP clrBr clrSh2" href="#transactions/sales"><%= ob.polyT('search.providers.transactions') %></a>
<a class="btn barBtn flexNoShrink tx6 clrP clrBr clrSh2" href="#<%= ob.peerID %>"><%= ob.polyT('search.providers.myPage') %></a>
</div>
</div>
|
{
"pile_set_name": "Github"
}
|
/*
* 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.wicket.util.time;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
/**
* An immutable <code>Time</code> class that represents a specific point in time. The underlying
* representation is a <code>long</code> value which holds a number of milliseconds since January 1,
* 1970, 0:00 GMT. To represent a duration of time, such as "6 seconds", use the
* <code>Duration</code> class. To represent a time period with a start and end time, use the
* <code>TimeFrame</code> class. To represent a time of day, use the <code>TimeOfDay</code> class.
*
* @author Jonathan Locke
* @since 1.2.6
*
* @deprecated Since Wicket 9 this class is obsolete and no more used. It will be removed in Wicket 10. Use {@link java.time.Instant} instead
*/
@Deprecated
public final class Time extends AbstractTime
{
private static final long serialVersionUID = 1L;
/** the beginning of UNIX time: January 1, 1970, 0:00 GMT. */
public static final Time START_OF_UNIX_TIME = millis(0);
/** parser in 'yyyy.MM.dd' format. */
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd",
Locale.ENGLISH);
/** parser in 'yyyy.MM.dd-h.mma' format. */
private static final SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy.MM.dd-h.mma",
Locale.ENGLISH);
/** required for rfc1123 date format */
private static final String[] DAYS =
{"Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
/** required for rfc1123 date format */
private static final String[] MONTHS =
{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan"};
/** time zone for greenwich mean time */
public static final TimeZone GMT = TimeZone.getTimeZone("GMT");
/**
* Retrieves a <code>Time</code> instance based on the current time.
*
* @return the current <code>Time</code>
*/
public static Time now()
{
return millis(System.currentTimeMillis());
}
/**
* Retrieves a <code>Time</code> instance based on the given milliseconds.
*
* @param time
* the <code>Time</code> value in milliseconds since START_OF_UNIX_TIME
* @return a corresponding immutable <code>Time</code> object
*/
public static Time millis(final long time)
{
return new Time(time);
}
/**
* Retrieves a <code>Time</code> instance by parsing 'yyyy.MM.dd' format.
*
* @param calendar
* the <code>Calendar</code> to use when parsing date <code>String</code>
* @param string
* the <code>String</code> to parse
* @return the time
* @throws ParseException
*/
public static Time parseDate(final Calendar calendar, final String string)
throws ParseException
{
synchronized (dateFormat)
{
synchronized (calendar)
{
dateFormat.setCalendar(calendar);
return valueOf(dateFormat.parse(string));
}
}
}
/**
* Retrieves a <code>Time</code> instance by parsing 'yyyy.MM.dd' format using a local time
* <code>Calendar</code>.
*
* @param string
* the <code>String</code> to parse
* @return the time
* @throws ParseException
*/
public static Time parseDate(final String string) throws ParseException
{
return parseDate(localtime, string);
}
/**
* Retrieves a <code>Time</code> instance by parsing 'yyyy.MM.dd-h.mma' format.
*
* @param calendar
* the <code>Calendar</code> to use when parsing the <code>String</code>
* @param string
* the <code>String</code> to parse
* @return an immutable UNIX <code>Time</code> value
* @throws ParseException
*/
public static Time valueOf(final Calendar calendar, final String string) throws ParseException
{
synchronized (dateTimeFormat)
{
synchronized (calendar)
{
dateTimeFormat.setCalendar(calendar);
return valueOf(dateTimeFormat.parse(string));
}
}
}
/**
* Retrieves a <code>Time</code> instance based on the given <code>Calendar</code> and
* {@link TimeOfDay} objects.
*
* @param calendar
* the <code>Calendar</code> to use
* @param timeOfDay
* the time of day
* @return a <code>Time</code> value for the time of day today
*/
public static Time valueOf(final Calendar calendar, final TimeOfDay timeOfDay)
{
synchronized (calendar)
{
// Set time to midnight today
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, 0); // WICKET-2349
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0); // WICKET-1670
// Add time of day milliseconds to midnight
return millis(calendar.getTimeInMillis() + timeOfDay.getMilliseconds());
}
}
/**
* Retrieves a <code>Time</code> instance based on the given <code>Date</code> object.
*
* @param date
* a <code>java.util.Date</code> object
* @return a corresponding immutable <code>Time</code> object
*/
public static Time valueOf(final Date date)
{
return new Time(date.getTime());
}
/**
* Retrieves a <code>Time</code> instance by parsing 'yyyy.MM.dd-h.mma' format.
*
* @param string
* the <code>String</code> to parse
* @return the <code>Time</code> instance
* @throws ParseException
*/
public static Time valueOf(final String string) throws ParseException
{
return valueOf(localtime, string);
}
/**
* Retrieves a <code>Time</code> instance by parsing 'pattern' format.
*
* @param string
* input
* @param pattern
* the pattern to parse
* @return a <code>Time</code> instance that resulted from parsing the given <code>String</code>
* @throws ParseException
*/
public static Time valueOf(final String string, final String pattern) throws ParseException
{
final SimpleDateFormat dateTimeFormat = new SimpleDateFormat(pattern, Locale.ENGLISH);
dateTimeFormat.setCalendar(localtime);
return valueOf(dateTimeFormat.parse(string));
}
/**
* Retrieves a <code>Time</code> instance based on the given {@link TimeOfDay} object.
*
* @param timeOfDay
* the time of day in local time
* @return a <code>Time</code> value for the time of day today
*/
public static Time valueOf(final TimeOfDay timeOfDay)
{
return valueOf(localtime, timeOfDay);
}
/**
* Private constructor forces use of static factory methods.
*
* @param time
* the <code>Time</code> value in milliseconds since START_OF_UNIX_TIME
*/
private Time(final long time)
{
super(time);
}
/**
* Adds the given <code>Duration</code> to this <code>Time</code> object, moving the time into
* the future.
*
* @param duration
* the <code>Duration</code> to add
* @return this <code>Time</code> + <code>Duration</code>
*/
public Time add(final Duration duration)
{
return millis(getMilliseconds() + duration.getMilliseconds());
}
/**
* Calculates the amount of time that has elapsed since this <code>Time</code> value.
*
* @return the amount of time that has elapsed since this <code>Time</code> value
* @throws IllegalStateException
* thrown if this <code>Time</code> value is in the future
*/
public Duration elapsedSince()
{
final Time now = now();
if (this.greaterThan(now))
{
throw new IllegalStateException("This time is in the future");
}
return now.subtract(this);
}
/**
* Retrieves the <code>Duration</code> from now to this <code>Time</code> value. If this
* <code>Time</code> value is in the past, then the <code>Duration</code> returned will be
* negative. Otherwise, it will be the number of milliseconds from now to this <code>Time</code>
* .
*
* @return the <code>Duration</code> from now to this <code>Time</code> value
*/
public Duration fromNow()
{
return subtract(now());
}
/**
* Retrieves the value of a field from the given <code>Calendar</code>.
*
* @param calendar
* the <code>Calendar</code> to use
* @param field
* the <code>Calendar</code> field to get
* @return the field's value for this point in time on the given <code>Calendar</code>
*/
public int get(final Calendar calendar, final int field)
{
synchronized (calendar)
{
calendar.setTimeInMillis(getMilliseconds());
return calendar.get(field);
}
}
/**
* Retrieves the value of a field.
*
* @param field
* the <code>Calendar</code> field to get
* @return the field's value (in local time)
*/
public int get(final int field)
{
return get(localtime, field);
}
/**
* Retrieves the day of month field of the current <code>Calendar</code>.
*
* @return the day of month field value
*/
public int getDayOfMonth()
{
return getDayOfMonth(localtime);
}
/**
* Retrieves the day of month field of the given <code>Calendar</code>.
*
* @param calendar
* the <code>Calendar</code> to get the field value from
* @return the day of month field value
*/
public int getDayOfMonth(final Calendar calendar)
{
return get(calendar, Calendar.DAY_OF_MONTH);
}
/**
* Retrieves the hour field of the current <code>Calendar</code>.
*
* @return the hour field value
*/
public int getHour()
{
return getHour(localtime);
}
/**
* Retrieves the hour field of the given <code>Calendar</code>.
*
* @param calendar
* the <code>Calendar</code> to get the field value from
* @return the hour field value
*/
public int getHour(final Calendar calendar)
{
return get(calendar, Calendar.HOUR_OF_DAY);
}
/**
* Retrieves the minute field of the current <code>Calendar</code>.
*
* @return the minute field value
*/
public int getMinute()
{
return getMinute(localtime);
}
/**
* Retrieves the minute field of the given <code>Calendar</code>.
*
* @param calendar
* the <code>Calendar</code> from which to get the field value
* @return the minute field value
*/
public int getMinute(final Calendar calendar)
{
return get(calendar, Calendar.MINUTE);
}
/**
* Retrieves the month field of the current <code>Calendar</code>.
*
* @return the month field value
*/
public int getMonth()
{
return getMonth(localtime);
}
/**
* Retrieves the month field of the given <code>Calendar</code>.
*
* @param calendar
* the <code>Calendar</code> from which to get the field value
* @return the month field value
*/
public int getMonth(final Calendar calendar)
{
return get(calendar, Calendar.MONTH);
}
/**
* Retrieves the seconds field of the current <code>Calendar</code>.
*
* @return the seconds field value
*/
public int getSecond()
{
return getSecond(localtime);
}
/**
* Retrieves the seconds field of the given <code>Calendar</code>.
*
* @param calendar
* the <code>Calendar</code> from which to get the field value
* @return the seconds field value
*/
public int getSecond(final Calendar calendar)
{
return get(calendar, Calendar.SECOND);
}
/**
* Retrieves the year field of the current <code>Calendar</code>.
*
* @return the year field value
*/
public int getYear()
{
return getYear(localtime);
}
/**
* Retrieves the year field of the given <code>Calendar</code>.
*
* @param calendar
* the <code>Calendar</code> from which to get the field value
* @return the year field value
*/
public int getYear(final Calendar calendar)
{
return get(calendar, Calendar.YEAR);
}
/**
* Subtracts the given <code>Duration</code> from this <code>Time</code> object, moving the time
* into the past.
*
* @param duration
* the <code>Duration</code> to subtract
* @return this duration of time
*/
public Time subtract(final Duration duration)
{
return millis(getMilliseconds() - duration.getMilliseconds());
}
/**
* Subtract time from this and returns the difference as a <code>Duration</code> object.
*
* @param that
* the time to subtract
* @return the <code>Duration</code> between this and that time
*/
public Duration subtract(final Time that)
{
return Duration.milliseconds(getMilliseconds() - that.getMilliseconds());
}
/**
* Retrieves a <code>Date</code> object for this <code>Time</code> object. A new
* <code>Date</code> object is always returned rather than attempting to cache a date since
* <code>Date</code> is mutable.
*
* @return this immutable <code>Time</code> object as a mutable <code>java.util.Date</code>
* object
*/
public Date toDate()
{
return new Date(getMilliseconds());
}
/**
* Converts this <code>Time</code> value to a date <code>String</code> using the date formatter
* 'yyyy.MM.dd'.
*
* @return the date string
*/
public String toDateString()
{
return toDateString(localtime);
}
/**
* Converts this <code>Time</code> value to a date <code>String</code> using the formatter
* 'yyyy.MM.dd'.
*
* @param calendar
* the <code>Calendar</code> to use in the conversion
* @return the date <code>String</code>
*/
public String toDateString(final Calendar calendar)
{
synchronized (dateFormat)
{
synchronized (calendar)
{
dateFormat.setCalendar(calendar);
return dateFormat.format(new Date(getMilliseconds())).toLowerCase(Locale.ROOT);
}
}
}
/**
* Converts this <code>Time</code> value to a <code>String</code> suitable for use in a file
* system name.
*
* @return this <code>Time</code> value as a formatted <code>String</code>
*/
@Override
public String toString()
{
return toDateString() + "-" + toTimeString();
}
/**
* Converts this <code>Time</code> object to a <code>String</code> using the given
* <code>Calendar</code> and format.
*
* @param calendar
* the <code>Calendar</code> to use in the conversion
* @param format
* the format to use
* @return this <code>Time</code> value as a formatted <code>String</code>
*/
public String toString(final Calendar calendar, final String format)
{
final SimpleDateFormat dateTimeFormat = new SimpleDateFormat(format, Locale.ENGLISH);
dateTimeFormat.setCalendar(calendar == null ? localtime : calendar);
return dateTimeFormat.format(new Date(getMilliseconds()));
}
/**
* Converts this <code>Time</code> value to a <code>String</code> using the given format.
*
* @param format
* the format to use
* @return this <code>Time</code> value as a formatted string
*/
public String toString(final String format)
{
return toString(null, format);
}
/**
* Returns this time stamp in RFC1123 string format. Contrary to
* {@link java.text.SimpleDateFormat} this is thread-safe. Taken from the source code of jetty
* 7.3.0, credits + thanks to Greg Wilkins!
*
* @return timestamp string in RFC1123 format
*/
public String toRfc1123TimestampString()
{
final Calendar cal = GregorianCalendar.getInstance(GMT);
final StringBuilder buf = new StringBuilder(32);
cal.setTimeInMillis(getMilliseconds());
int day_of_week = cal.get(Calendar.DAY_OF_WEEK);
int day_of_month = cal.get(Calendar.DAY_OF_MONTH);
int month = cal.get(Calendar.MONTH);
int year = cal.get(Calendar.YEAR);
int century = year / 100;
year = year % 100;
int hours = cal.get(Calendar.HOUR_OF_DAY);
int minutes = cal.get(Calendar.MINUTE);
int seconds = cal.get(Calendar.SECOND);
buf.append(DAYS[day_of_week]);
buf.append(',');
buf.append(' ');
appendTwoDigits(buf, day_of_month);
buf.append(' ');
buf.append(MONTHS[month]);
buf.append(' ');
appendTwoDigits(buf, century);
appendTwoDigits(buf, year);
buf.append(' ');
appendTwoDigits(buf, hours);
buf.append(':');
appendTwoDigits(buf, minutes);
buf.append(':');
appendTwoDigits(buf, seconds);
buf.append(" GMT");
return buf.toString();
}
/**
* helper method for {@link #toRfc1123TimestampString()}
*
* @param str
* @param number
*/
private static void appendTwoDigits(StringBuilder str, int number)
{
str.append((char)(number / 10 + '0'));
str.append((char)(number % 10 + '0'));
}
}
|
{
"pile_set_name": "Github"
}
|
package com.vladmihalcea.flexypool.metric;
import com.vladmihalcea.flexypool.common.ConfigurationProperties;
import org.mockito.Mockito;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.when;
/**
* MockMetricsFactoryService - Mock MetricsFactoryService
*
* @author Vlad Mihalcea
*/
public class MockMetricsFactoryService implements MetricsFactoryService {
public static class MockMetrics extends AbstractMetrics {
private Histogram histogram = Mockito.mock(Histogram.class);
private Timer timer = Mockito.mock(Timer.class);
/**
* Create {@link AbstractMetrics} from the given {@link ConfigurationProperties}
*/
protected MockMetrics() {
super(null);
}
@Override
public Histogram histogram(String name) {
return histogram;
}
@Override
public Timer timer(String name) {
return timer;
}
@Override
public void start() {
}
@Override
public void stop() {
}
}
/**
* Load the Mock MetricsFactory
*
* @return Mock MetricsFactory
*/
@Override
public MetricsFactory load() {
MetricsFactory metricsFactory = Mockito.mock(MetricsFactory.class);
Metrics metrics = new MockMetrics();
when(metricsFactory.newInstance(any(ConfigurationProperties.class))).thenReturn(metrics);
return metricsFactory;
}
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
const Stream = require('stream');
const internals = {};
exports.NotConstructor = {};
exports.NotStream = function () { };
exports.Incrementer = class extends Stream.Transform {
constructor(starting) {
super({ objectMode: true });
this.starting = starting;
this.once('end', () => {
this._finalized = true;
});
}
_transform(value, encoding, callback) {
value.number = value.number + this.starting;
callback(null, value);
}
};
exports.Stringify = class extends Stream.Transform {
constructor() {
super({ objectMode: true });
this.once('end', () => {
this._finalized = true;
});
}
_transform(value, encoding, callback) {
callback(null, JSON.stringify(value) + '\n');
}
};
exports.Namer = class extends Stream.Transform {
constructor(name) {
super({ objectMode: true });
this.name = name || '';
}
_transform(value, encoding, callback) {
value.name = this.name;
callback(null, value);
}
};
exports.Writer = class extends Stream.Writable {
constructor(objectMode) {
super({ objectMode });
this.data = [];
this.once('finish', () => {
this._finalized = true;
});
}
_write(chunk, end, callback) {
this.data.push(chunk);
callback(null);
}
};
exports.Cleaner = class extends Stream.Transform {
constructor(remove) {
super({ objectMode: true });
this.remove = [].concat(remove);
}
_transform(value, encoding, callback) {
for (let i = 0; i < this.remove.length; ++i) {
const key = this.remove[i];
delete value[key];
}
callback(null, value);
}
};
|
{
"pile_set_name": "Github"
}
|
// Check frontend and linker invocations on the MTI MIPS toolchain.
// -EB -mhard-float -mabi=32
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -mabi=32 \
// RUN: | FileCheck --check-prefix=EB-HARD-O32 %s
// EB-HARD-O32: "-internal-isystem"
// EB-HARD-O32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EB-HARD-O32: "-internal-isystem"
// EB-HARD-O32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mips-r2-hard/lib"
// EB-HARD-O32: "-internal-isystem"
// EB-HARD-O32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EB-HARD-O32: "-internal-externc-isystem"
// EB-HARD-O32: "[[TC]]/../../../../sysroot/mips-r2-hard/lib/../usr/include"
// EB-HARD-O32: "{{.*}}ld{{(.exe)?}}"
// EB-HARD-O32: "--sysroot=[[TC]]/../../../../sysroot/mips-r2-hard"
// EB-HARD-O32: "-dynamic-linker" "/lib/ld.so.1"
// EB-HARD-O32: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib{{/|\\\\}}crt1.o"
// EB-HARD-O32: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib{{/|\\\\}}crti.o"
// EB-HARD-O32: "[[TC]]/mips-r2-hard/lib{{/|\\\\}}crtbegin.o"
// EB-HARD-O32: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mips-r2-hard/lib"
// EB-HARD-O32: "-L[[TC]]/mips-r2-hard/lib"
// EB-HARD-O32: "-L[[TC]]/../../../../sysroot/mips-r2-hard/lib/../lib"
// EB-HARD-O32: "-L[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib"
// EB-HARD-O32: "[[TC]]/mips-r2-hard/lib{{/|\\\\}}crtend.o"
// EB-HARD-O32: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EB -mhard-float -mabi=n32
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -mabi=n32 \
// RUN: | FileCheck --check-prefix=EB-HARD-N32 %s
// EB-HARD-N32: "-internal-isystem"
// EB-HARD-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EB-HARD-N32: "-internal-isystem"
// EB-HARD-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mips-r2-hard/lib32"
// EB-HARD-N32: "-internal-isystem"
// EB-HARD-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EB-HARD-N32: "-internal-externc-isystem"
// EB-HARD-N32: "[[TC]]/../../../../sysroot/mips-r2-hard/lib32/../usr/include"
// EB-HARD-N32: "{{.*}}ld{{(.exe)?}}"
// EB-HARD-N32: "--sysroot=[[TC]]/../../../../sysroot/mips-r2-hard"
// EB-HARD-N32: "-dynamic-linker" "/lib32/ld.so.1"
// EB-HARD-N32: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib32{{/|\\\\}}crt1.o"
// EB-HARD-N32: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib32{{/|\\\\}}crti.o"
// EB-HARD-N32: "[[TC]]/mips-r2-hard/lib32{{/|\\\\}}crtbegin.o"
// EB-HARD-N32: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mips-r2-hard/lib32"
// EB-HARD-N32: "-L[[TC]]/mips-r2-hard/lib32"
// EB-HARD-N32: "-L[[TC]]/../../../../sysroot/mips-r2-hard/lib/../lib32"
// EB-HARD-N32: "-L[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib32"
// EB-HARD-N32: "[[TC]]/mips-r2-hard/lib32{{/|\\\\}}crtend.o"
// EB-HARD-N32: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib32{{/|\\\\}}crtn.o"
// -EB -mhard-float -mabi=64
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -mabi=64 \
// RUN: | FileCheck --check-prefix=EB-HARD-N64 %s
// EB-HARD-N64: "-internal-isystem"
// EB-HARD-N64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EB-HARD-N64: "-internal-isystem"
// EB-HARD-N64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mips-r2-hard/lib64"
// EB-HARD-N64: "-internal-isystem"
// EB-HARD-N64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EB-HARD-N64: "-internal-externc-isystem"
// EB-HARD-N64: "[[TC]]/../../../../sysroot/mips-r2-hard/lib64/../usr/include"
// EB-HARD-N64: "{{.*}}ld{{(.exe)?}}"
// EB-HARD-N64: "--sysroot=[[TC]]/../../../../sysroot/mips-r2-hard"
// EB-HARD-N64: "-dynamic-linker" "/lib64/ld.so.1"
// EB-HARD-N64: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib64{{/|\\\\}}crt1.o"
// EB-HARD-N64: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib64{{/|\\\\}}crti.o"
// EB-HARD-N64: "[[TC]]/mips-r2-hard/lib64{{/|\\\\}}crtbegin.o"
// EB-HARD-N64: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mips-r2-hard/lib64"
// EB-HARD-N64: "-L[[TC]]/mips-r2-hard/lib64"
// EB-HARD-N64: "-L[[TC]]/../../../../sysroot/mips-r2-hard/lib/../lib64"
// EB-HARD-N64: "-L[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib64"
// EB-HARD-N64: "[[TC]]/mips-r2-hard/lib64{{/|\\\\}}crtend.o"
// EB-HARD-N64: "[[TC]]/../../../../sysroot/mips-r2-hard/usr/lib/../lib64{{/|\\\\}}crtn.o"
// -EL -mhard-float -mabi=32
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mabi=32 \
// RUN: | FileCheck --check-prefix=EL-HARD-O32 %s
// EL-HARD-O32: "-internal-isystem"
// EL-HARD-O32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-HARD-O32: "-internal-isystem"
// EL-HARD-O32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mipsel-r2-hard/lib"
// EL-HARD-O32: "-internal-isystem"
// EL-HARD-O32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-HARD-O32: "-internal-externc-isystem"
// EL-HARD-O32: "[[TC]]/../../../../sysroot/mipsel-r2-hard/lib/../usr/include"
// EL-HARD-O32: "{{.*}}ld{{(.exe)?}}"
// EL-HARD-O32: "--sysroot=[[TC]]/../../../../sysroot/mipsel-r2-hard"
// EL-HARD-O32: "-dynamic-linker" "/lib/ld.so.1"
// EL-HARD-O32: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib{{/|\\\\}}crt1.o"
// EL-HARD-O32: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib{{/|\\\\}}crti.o"
// EL-HARD-O32: "[[TC]]/mipsel-r2-hard/lib{{/|\\\\}}crtbegin.o"
// EL-HARD-O32: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mipsel-r2-hard/lib"
// EL-HARD-O32: "-L[[TC]]/mipsel-r2-hard/lib"
// EL-HARD-O32: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard/lib/../lib"
// EL-HARD-O32: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib"
// EL-HARD-O32: "[[TC]]/mipsel-r2-hard/lib{{/|\\\\}}crtend.o"
// EL-HARD-O32: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EL -mhard-float -mabi=n32
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mabi=n32 \
// RUN: | FileCheck --check-prefix=EL-HARD-N32 %s
// EL-HARD-N32: "-internal-isystem"
// EL-HARD-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-HARD-N32: "-internal-isystem"
// EL-HARD-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mipsel-r2-hard/lib32"
// EL-HARD-N32: "-internal-isystem"
// EL-HARD-N32: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-HARD-N32: "-internal-externc-isystem"
// EL-HARD-N32: "[[TC]]/../../../../sysroot/mipsel-r2-hard/lib32/../usr/include"
// EL-HARD-N32: "{{.*}}ld{{(.exe)?}}"
// EL-HARD-N32: "--sysroot=[[TC]]/../../../../sysroot/mipsel-r2-hard"
// EL-HARD-N32: "-dynamic-linker" "/lib32/ld.so.1"
// EL-HARD-N32: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib32{{/|\\\\}}crt1.o"
// EL-HARD-N32: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib32{{/|\\\\}}crti.o"
// EL-HARD-N32: "[[TC]]/mipsel-r2-hard/lib32{{/|\\\\}}crtbegin.o"
// EL-HARD-N32: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mipsel-r2-hard/lib32"
// EL-HARD-N32: "-L[[TC]]/mipsel-r2-hard/lib32"
// EL-HARD-N32: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard/lib/../lib32"
// EL-HARD-N32: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib32"
// EL-HARD-N32: "[[TC]]/mipsel-r2-hard/lib32{{/|\\\\}}crtend.o"
// EL-HARD-N32: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib32{{/|\\\\}}crtn.o"
// -EL -mhard-float -mabi=64
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mabi=64 \
// RUN: | FileCheck --check-prefix=EL-HARD-N64 %s
// EL-HARD-N64: "-internal-isystem"
// EL-HARD-N64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-HARD-N64: "-internal-isystem"
// EL-HARD-N64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mipsel-r2-hard/lib64"
// EL-HARD-N64: "-internal-isystem"
// EL-HARD-N64: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-HARD-N64: "-internal-externc-isystem"
// EL-HARD-N64: "[[TC]]/../../../../sysroot/mipsel-r2-hard/lib64/../usr/include"
// EL-HARD-N64: "{{.*}}ld{{(.exe)?}}"
// EL-HARD-N64: "--sysroot=[[TC]]/../../../../sysroot/mipsel-r2-hard"
// EL-HARD-N64: "-dynamic-linker" "/lib64/ld.so.1"
// EL-HARD-N64: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib64{{/|\\\\}}crt1.o"
// EL-HARD-N64: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib64{{/|\\\\}}crti.o"
// EL-HARD-N64: "[[TC]]/mipsel-r2-hard/lib64{{/|\\\\}}crtbegin.o"
// EL-HARD-N64: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mipsel-r2-hard/lib64"
// EL-HARD-N64: "-L[[TC]]/mipsel-r2-hard/lib64"
// EL-HARD-N64: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard/lib/../lib64"
// EL-HARD-N64: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib64"
// EL-HARD-N64: "[[TC]]/mipsel-r2-hard/lib64{{/|\\\\}}crtend.o"
// EL-HARD-N64: "[[TC]]/../../../../sysroot/mipsel-r2-hard/usr/lib/../lib64{{/|\\\\}}crtn.o"
// -EB -msoft-float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -msoft-float \
// RUN: | FileCheck --check-prefix=EB-SOFT %s
// EB-SOFT: "-internal-isystem"
// EB-SOFT: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EB-SOFT: "-internal-isystem"
// EB-SOFT: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mips-r2-soft/lib"
// EB-SOFT: "-internal-isystem"
// EB-SOFT: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EB-SOFT: "-internal-externc-isystem"
// EB-SOFT: "[[TC]]/../../../../sysroot/mips-r2-soft/lib/../usr/include"
// EB-SOFT: "{{.*}}ld{{(.exe)?}}"
// EB-SOFT: "--sysroot=[[TC]]/../../../../sysroot/mips-r2-soft"
// EB-SOFT: "-dynamic-linker" "/lib/ld.so.1"
// EB-SOFT: "[[TC]]/../../../../sysroot/mips-r2-soft/usr/lib/../lib{{/|\\\\}}crt1.o"
// EB-SOFT: "[[TC]]/../../../../sysroot/mips-r2-soft/usr/lib/../lib{{/|\\\\}}crti.o"
// EB-SOFT: "[[TC]]/mips-r2-soft/lib{{/|\\\\}}crtbegin.o"
// EB-SOFT: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mips-r2-soft/lib"
// EB-SOFT: "-L[[TC]]/mips-r2-soft/lib"
// EB-SOFT: "-L[[TC]]/../../../../sysroot/mips-r2-soft/lib/../lib"
// EB-SOFT: "-L[[TC]]/../../../../sysroot/mips-r2-soft/usr/lib/../lib"
// EB-SOFT: "[[TC]]/mips-r2-soft/lib{{/|\\\\}}crtend.o"
// EB-SOFT: "[[TC]]/../../../../sysroot/mips-r2-soft/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EL -msoft-float
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -msoft-float \
// RUN: | FileCheck --check-prefix=EL-SOFT %s
// EL-SOFT: "-internal-isystem"
// EL-SOFT: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-SOFT: "-internal-isystem"
// EL-SOFT: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mipsel-r2-soft/lib"
// EL-SOFT: "-internal-isystem"
// EL-SOFT: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-SOFT: "-internal-externc-isystem"
// EL-SOFT: "[[TC]]/../../../../sysroot/mipsel-r2-soft/lib/../usr/include"
// EL-SOFT: "{{.*}}ld{{(.exe)?}}"
// EL-SOFT: "--sysroot=[[TC]]/../../../../sysroot/mipsel-r2-soft"
// EL-SOFT: "-dynamic-linker" "/lib/ld.so.1"
// EL-SOFT: "[[TC]]/../../../../sysroot/mipsel-r2-soft/usr/lib/../lib{{/|\\\\}}crt1.o"
// EL-SOFT: "[[TC]]/../../../../sysroot/mipsel-r2-soft/usr/lib/../lib{{/|\\\\}}crti.o"
// EL-SOFT: "[[TC]]/mipsel-r2-soft/lib{{/|\\\\}}crtbegin.o"
// EL-SOFT: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mipsel-r2-soft/lib"
// EL-SOFT: "-L[[TC]]/mipsel-r2-soft/lib"
// EL-SOFT: "-L[[TC]]/../../../../sysroot/mipsel-r2-soft/lib/../lib"
// EL-SOFT: "-L[[TC]]/../../../../sysroot/mipsel-r2-soft/usr/lib/../lib"
// EL-SOFT: "[[TC]]/mipsel-r2-soft/lib{{/|\\\\}}crtend.o"
// EL-SOFT: "[[TC]]/../../../../sysroot/mipsel-r2-soft/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EB -mhard-float -muclibc
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -muclibc \
// RUN: | FileCheck --check-prefix=EB-HARD-UCLIBC %s
// EB-HARD-UCLIBC: "-internal-isystem"
// EB-HARD-UCLIBC: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EB-HARD-UCLIBC: "-internal-isystem"
// EB-HARD-UCLIBC: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mips-r2-hard-uclibc/lib"
// EB-HARD-UCLIBC: "-internal-isystem"
// EB-HARD-UCLIBC: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EB-HARD-UCLIBC: "-internal-externc-isystem"
// EB-HARD-UCLIBC: "[[TC]]/../../../../sysroot/mips-r2-hard-uclibc/lib/../usr/include"
// EB-HARD-UCLIBC: "{{.*}}ld{{(.exe)?}}"
// EB-HARD-UCLIBC: "--sysroot=[[TC]]/../../../../sysroot/mips-r2-hard-uclibc"
// EB-HARD-UCLIBC: "-dynamic-linker" "/lib/ld-uClibc.so.0"
// EB-HARD-UCLIBC: "[[TC]]/../../../../sysroot/mips-r2-hard-uclibc/usr/lib/../lib{{/|\\\\}}crt1.o"
// EB-HARD-UCLIBC: "[[TC]]/../../../../sysroot/mips-r2-hard-uclibc/usr/lib/../lib{{/|\\\\}}crti.o"
// EB-HARD-UCLIBC: "[[TC]]/mips-r2-hard-uclibc/lib{{/|\\\\}}crtbegin.o"
// EB-HARD-UCLIBC: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mips-r2-hard-uclibc/lib"
// EB-HARD-UCLIBC: "-L[[TC]]/mips-r2-hard-uclibc/lib"
// EB-HARD-UCLIBC: "-L[[TC]]/../../../../sysroot/mips-r2-hard-uclibc/lib/../lib"
// EB-HARD-UCLIBC: "-L[[TC]]/../../../../sysroot/mips-r2-hard-uclibc/usr/lib/../lib"
// EB-HARD-UCLIBC: "[[TC]]/mips-r2-hard-uclibc/lib{{/|\\\\}}crtend.o"
// EB-HARD-UCLIBC: "[[TC]]/../../../../sysroot/mips-r2-hard-uclibc/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EL -mhard-float -muclibc
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -muclibc \
// RUN: | FileCheck --check-prefix=EL-HARD-UCLIBC %s
// EL-HARD-UCLIBC: "-internal-isystem"
// EL-HARD-UCLIBC: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-HARD-UCLIBC: "-internal-isystem"
// EL-HARD-UCLIBC: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mipsel-r2-hard-uclibc/lib"
// EL-HARD-UCLIBC: "-internal-isystem"
// EL-HARD-UCLIBC: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-HARD-UCLIBC: "-internal-externc-isystem"
// EL-HARD-UCLIBC: "[[TC]]/../../../../sysroot/mipsel-r2-hard-uclibc/lib/../usr/include"
// EL-HARD-UCLIBC: "{{.*}}ld{{(.exe)?}}"
// EL-HARD-UCLIBC: "--sysroot=[[TC]]/../../../../sysroot/mipsel-r2-hard-uclibc"
// EL-HARD-UCLIBC: "-dynamic-linker" "/lib/ld-uClibc.so.0"
// EL-HARD-UCLIBC: "[[TC]]/../../../../sysroot/mipsel-r2-hard-uclibc/usr/lib/../lib{{/|\\\\}}crt1.o"
// EL-HARD-UCLIBC: "[[TC]]/../../../../sysroot/mipsel-r2-hard-uclibc/usr/lib/../lib{{/|\\\\}}crti.o"
// EL-HARD-UCLIBC: "[[TC]]/mipsel-r2-hard-uclibc/lib{{/|\\\\}}crtbegin.o"
// EL-HARD-UCLIBC: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mipsel-r2-hard-uclibc/lib"
// EL-HARD-UCLIBC: "-L[[TC]]/mipsel-r2-hard-uclibc/lib"
// EL-HARD-UCLIBC: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard-uclibc/lib/../lib"
// EL-HARD-UCLIBC: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard-uclibc/usr/lib/../lib"
// EL-HARD-UCLIBC: "[[TC]]/mipsel-r2-hard-uclibc/lib{{/|\\\\}}crtend.o"
// EL-HARD-UCLIBC: "[[TC]]/../../../../sysroot/mipsel-r2-hard-uclibc/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EB -mhard-float -mnan=2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -mnan=2008 \
// RUN: | FileCheck --check-prefix=EB-HARD-NAN2008 %s
// EB-HARD-NAN2008: "-internal-isystem"
// EB-HARD-NAN2008: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EB-HARD-NAN2008: "-internal-isystem"
// EB-HARD-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mips-r2-hard-nan2008/lib"
// EB-HARD-NAN2008: "-internal-isystem"
// EB-HARD-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EB-HARD-NAN2008: "-internal-externc-isystem"
// EB-HARD-NAN2008: "[[TC]]/../../../../sysroot/mips-r2-hard-nan2008/lib/../usr/include"
// EB-HARD-NAN2008: "{{.*}}ld{{(.exe)?}}"
// EB-HARD-NAN2008: "--sysroot=[[TC]]/../../../../sysroot/mips-r2-hard-nan2008"
// EB-HARD-NAN2008: "-dynamic-linker" "/lib/ld-linux-mipsn8.so.1"
// EB-HARD-NAN2008: "[[TC]]/../../../../sysroot/mips-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
// EB-HARD-NAN2008: "[[TC]]/../../../../sysroot/mips-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
// EB-HARD-NAN2008: "[[TC]]/mips-r2-hard-nan2008/lib{{/|\\\\}}crtbegin.o"
// EB-HARD-NAN2008: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mips-r2-hard-nan2008/lib"
// EB-HARD-NAN2008: "-L[[TC]]/mips-r2-hard-nan2008/lib"
// EB-HARD-NAN2008: "-L[[TC]]/../../../../sysroot/mips-r2-hard-nan2008/lib/../lib"
// EB-HARD-NAN2008: "-L[[TC]]/../../../../sysroot/mips-r2-hard-nan2008/usr/lib/../lib"
// EB-HARD-NAN2008: "[[TC]]/mips-r2-hard-nan2008/lib{{/|\\\\}}crtend.o"
// EB-HARD-NAN2008: "[[TC]]/../../../../sysroot/mips-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EL -mhard-float -mnan=2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mnan=2008 \
// RUN: | FileCheck --check-prefix=EL-HARD-NAN2008 %s
// EL-HARD-NAN2008: "-internal-isystem"
// EL-HARD-NAN2008: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-HARD-NAN2008: "-internal-isystem"
// EL-HARD-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mipsel-r2-hard-nan2008/lib"
// EL-HARD-NAN2008: "-internal-isystem"
// EL-HARD-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-HARD-NAN2008: "-internal-externc-isystem"
// EL-HARD-NAN2008: "[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008/lib/../usr/include"
// EL-HARD-NAN2008: "{{.*}}ld{{(.exe)?}}"
// EL-HARD-NAN2008: "--sysroot=[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008"
// EL-HARD-NAN2008: "-dynamic-linker" "/lib/ld-linux-mipsn8.so.1"
// EL-HARD-NAN2008: "[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
// EL-HARD-NAN2008: "[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
// EL-HARD-NAN2008: "[[TC]]/mipsel-r2-hard-nan2008/lib{{/|\\\\}}crtbegin.o"
// EL-HARD-NAN2008: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mipsel-r2-hard-nan2008/lib"
// EL-HARD-NAN2008: "-L[[TC]]/mipsel-r2-hard-nan2008/lib"
// EL-HARD-NAN2008: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008/lib/../lib"
// EL-HARD-NAN2008: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008/usr/lib/../lib"
// EL-HARD-NAN2008: "[[TC]]/mipsel-r2-hard-nan2008/lib{{/|\\\\}}crtend.o"
// EL-HARD-NAN2008: "[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EB -mhard-float -muclibc -mnan=2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -muclibc -mnan=2008 \
// RUN: | FileCheck --check-prefix=EB-HARD-UCLIBC-NAN2008 %s
// EB-HARD-UCLIBC-NAN2008: "-internal-isystem"
// EB-HARD-UCLIBC-NAN2008: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EB-HARD-UCLIBC-NAN2008: "-internal-isystem"
// EB-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mips-r2-hard-nan2008-uclibc/lib"
// EB-HARD-UCLIBC-NAN2008: "-internal-isystem"
// EB-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EB-HARD-UCLIBC-NAN2008: "-internal-externc-isystem"
// EB-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../sysroot/mips-r2-hard-nan2008-uclibc/lib/../usr/include"
// EB-HARD-UCLIBC-NAN2008: "{{.*}}ld{{(.exe)?}}"
// EB-HARD-UCLIBC-NAN2008: "--sysroot=[[TC]]/../../../../sysroot/mips-r2-hard-nan2008-uclibc"
// EB-HARD-UCLIBC-NAN2008: "-dynamic-linker" "/lib/ld-uClibc-mipsn8.so.0"
// EB-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../sysroot/mips-r2-hard-nan2008-uclibc/usr/lib/../lib{{/|\\\\}}crt1.o"
// EB-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../sysroot/mips-r2-hard-nan2008-uclibc/usr/lib/../lib{{/|\\\\}}crti.o"
// EB-HARD-UCLIBC-NAN2008: "[[TC]]/mips-r2-hard-nan2008-uclibc/lib{{/|\\\\}}crtbegin.o"
// EB-HARD-UCLIBC-NAN2008: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mips-r2-hard-nan2008-uclibc/lib"
// EB-HARD-UCLIBC-NAN2008: "-L[[TC]]/mips-r2-hard-nan2008-uclibc/lib"
// EB-HARD-UCLIBC-NAN2008: "-L[[TC]]/../../../../sysroot/mips-r2-hard-nan2008-uclibc/lib/../lib"
// EB-HARD-UCLIBC-NAN2008: "-L[[TC]]/../../../../sysroot/mips-r2-hard-nan2008-uclibc/usr/lib/../lib"
// EB-HARD-UCLIBC-NAN2008: "[[TC]]/mips-r2-hard-nan2008-uclibc/lib{{/|\\\\}}crtend.o"
// EB-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../sysroot/mips-r2-hard-nan2008-uclibc/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EL -mhard-float -muclibc -mnan=2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -muclibc -mnan=2008 \
// RUN: | FileCheck --check-prefix=EL-HARD-UCLIBC-NAN2008 %s
// EL-HARD-UCLIBC-NAN2008: "-internal-isystem"
// EL-HARD-UCLIBC-NAN2008: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-HARD-UCLIBC-NAN2008: "-internal-isystem"
// EL-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/mipsel-r2-hard-nan2008-uclibc/lib"
// EL-HARD-UCLIBC-NAN2008: "-internal-isystem"
// EL-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-HARD-UCLIBC-NAN2008: "-internal-externc-isystem"
// EL-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008-uclibc/lib/../usr/include"
// EL-HARD-UCLIBC-NAN2008: "{{.*}}ld{{(.exe)?}}"
// EL-HARD-UCLIBC-NAN2008: "--sysroot=[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008-uclibc"
// EL-HARD-UCLIBC-NAN2008: "-dynamic-linker" "/lib/ld-uClibc-mipsn8.so.0"
// EL-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008-uclibc/usr/lib/../lib{{/|\\\\}}crt1.o"
// EL-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008-uclibc/usr/lib/../lib{{/|\\\\}}crti.o"
// EL-HARD-UCLIBC-NAN2008: "[[TC]]/mipsel-r2-hard-nan2008-uclibc/lib{{/|\\\\}}crtbegin.o"
// EL-HARD-UCLIBC-NAN2008: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/mipsel-r2-hard-nan2008-uclibc/lib"
// EL-HARD-UCLIBC-NAN2008: "-L[[TC]]/mipsel-r2-hard-nan2008-uclibc/lib"
// EL-HARD-UCLIBC-NAN2008: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008-uclibc/lib/../lib"
// EL-HARD-UCLIBC-NAN2008: "-L[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008-uclibc/usr/lib/../lib"
// EL-HARD-UCLIBC-NAN2008: "[[TC]]/mipsel-r2-hard-nan2008-uclibc/lib{{/|\\\\}}crtend.o"
// EL-HARD-UCLIBC-NAN2008: "[[TC]]/../../../../sysroot/mipsel-r2-hard-nan2008-uclibc/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EL -msoft-float -mmicromips
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -msoft-float -mmicromips \
// RUN: | FileCheck --check-prefix=EL-SOFT-MICRO %s
// EL-SOFT-MICRO: "-internal-isystem"
// EL-SOFT-MICRO: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-SOFT-MICRO: "-internal-isystem"
// EL-SOFT-MICRO: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/micromipsel-r2-soft/lib"
// EL-SOFT-MICRO: "-internal-isystem"
// EL-SOFT-MICRO: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-SOFT-MICRO: "-internal-externc-isystem"
// EL-SOFT-MICRO: "[[TC]]/../../../../sysroot/micromipsel-r2-soft/lib/../usr/include"
// EL-SOFT-MICRO: "{{.*}}ld{{(.exe)?}}"
// EL-SOFT-MICRO: "--sysroot=[[TC]]/../../../../sysroot/micromipsel-r2-soft"
// EL-SOFT-MICRO: "-dynamic-linker" "/lib/ld.so.1"
// EL-SOFT-MICRO: "[[TC]]/../../../../sysroot/micromipsel-r2-soft/usr/lib/../lib{{/|\\\\}}crt1.o"
// EL-SOFT-MICRO: "[[TC]]/../../../../sysroot/micromipsel-r2-soft/usr/lib/../lib{{/|\\\\}}crti.o"
// EL-SOFT-MICRO: "[[TC]]/micromipsel-r2-soft/lib{{/|\\\\}}crtbegin.o"
// EL-SOFT-MICRO: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/micromipsel-r2-soft/lib"
// EL-SOFT-MICRO: "-L[[TC]]/micromipsel-r2-soft/lib"
// EL-SOFT-MICRO: "-L[[TC]]/../../../../sysroot/micromipsel-r2-soft/lib/../lib"
// EL-SOFT-MICRO: "-L[[TC]]/../../../../sysroot/micromipsel-r2-soft/usr/lib/../lib"
// EL-SOFT-MICRO: "[[TC]]/micromipsel-r2-soft/lib{{/|\\\\}}crtend.o"
// EL-SOFT-MICRO: "[[TC]]/../../../../sysroot/micromipsel-r2-soft/usr/lib/../lib{{/|\\\\}}crtn.o"
// -EL -mhard-float -mmicromips -mnan=2008
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mmicromips -mnan=2008 \
// RUN: | FileCheck --check-prefix=EL-SOFT-MICRO-NAN2008 %s
// EL-SOFT-MICRO-NAN2008: "-internal-isystem"
// EL-SOFT-MICRO-NAN2008: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.2]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2"
// EL-SOFT-MICRO-NAN2008: "-internal-isystem"
// EL-SOFT-MICRO-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/mips-mti-linux-gnu/micromipsel-r2-hard-nan2008/lib"
// EL-SOFT-MICRO-NAN2008: "-internal-isystem"
// EL-SOFT-MICRO-NAN2008: "[[TC]]/../../../../mips-mti-linux-gnu/include/c++/4.9.2/backward"
// EL-SOFT-MICRO-NAN2008: "-internal-externc-isystem"
// EL-SOFT-MICRO-NAN2008: "[[TC]]/../../../../sysroot/micromipsel-r2-hard-nan2008/lib/../usr/include"
// EL-SOFT-MICRO-NAN2008: "{{.*}}ld{{(.exe)?}}"
// EL-SOFT-MICRO-NAN2008: "--sysroot=[[TC]]/../../../../sysroot/micromipsel-r2-hard-nan2008"
// EL-SOFT-MICRO-NAN2008: "-dynamic-linker" "/lib/ld-linux-mipsn8.so.1"
// EL-SOFT-MICRO-NAN2008: "[[TC]]/../../../../sysroot/micromipsel-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crt1.o"
// EL-SOFT-MICRO-NAN2008: "[[TC]]/../../../../sysroot/micromipsel-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crti.o"
// EL-SOFT-MICRO-NAN2008: "[[TC]]/micromipsel-r2-hard-nan2008/lib{{/|\\\\}}crtbegin.o"
// EL-SOFT-MICRO-NAN2008: "-L[[TC]]/../../../../mips-mti-linux-gnu/lib/micromipsel-r2-hard-nan2008/lib"
// EL-SOFT-MICRO-NAN2008: "-L[[TC]]/micromipsel-r2-hard-nan2008/lib"
// EL-SOFT-MICRO-NAN2008: "-L[[TC]]/../../../../sysroot/micromipsel-r2-hard-nan2008/lib/../lib"
// EL-SOFT-MICRO-NAN2008: "-L[[TC]]/../../../../sysroot/micromipsel-r2-hard-nan2008/usr/lib/../lib"
// EL-SOFT-MICRO-NAN2008: "[[TC]]/micromipsel-r2-hard-nan2008/lib{{/|\\\\}}crtend.o"
// EL-SOFT-MICRO-NAN2008: "[[TC]]/../../../../sysroot/micromipsel-r2-hard-nan2008/usr/lib/../lib{{/|\\\\}}crtn.o"
|
{
"pile_set_name": "Github"
}
|
1113
1002
1335
1224
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
from .compat import OrderedDict, Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``MutableMapping`` as well as dict's ``copy``. Also
provides ``lower_items``.
All keys are expected to be strings. The structure remembers the
case of the last key to be set, and ``iter(instance)``,
``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()``
will contain case-sensitive keys. However, querying and contains
testing is case insensitive::
cid = CaseInsensitiveDict()
cid['Accept'] = 'application/json'
cid['aCCEPT'] == 'application/json' # True
list(cid) == ['Accept'] # True
For example, ``headers['content-encoding']`` will return the
value of a ``'Content-Encoding'`` response header, regardless
of how the header name was originally stored.
If the constructor, ``.update``, or equality comparison
operations are given keys that have equal ``.lower()``s, the
behavior is undefined.
"""
def __init__(self, data=None, **kwargs):
self._store = OrderedDict()
if data is None:
data = {}
self.update(data, **kwargs)
def __setitem__(self, key, value):
# Use the lowercased key for lookups, but store the actual
# key alongside the value.
self._store[key.lower()] = (key, value)
def __getitem__(self, key):
return self._store[key.lower()][1]
def __delitem__(self, key):
del self._store[key.lower()]
def __iter__(self):
return (casedkey for casedkey, mappedvalue in self._store.values())
def __len__(self):
return len(self._store)
def lower_items(self):
"""Like iteritems(), but with all lowercase keys."""
return (
(lowerkey, keyval[1])
for (lowerkey, keyval)
in self._store.items()
)
def __eq__(self, other):
if isinstance(other, Mapping):
other = CaseInsensitiveDict(other)
else:
return NotImplemented
# Compare insensitively
return dict(self.lower_items()) == dict(other.lower_items())
# Copy is required
def copy(self):
return CaseInsensitiveDict(self._store.values())
def __repr__(self):
return str(dict(self.items()))
class LookupDict(dict):
"""Dictionary lookup object."""
def __init__(self, name=None):
self.name = name
super(LookupDict, self).__init__()
def __repr__(self):
return '<lookup \'%s\'>' % (self.name)
def __getitem__(self, key):
# We allow fall-through here, so values default to None
return self.__dict__.get(key, None)
def get(self, key, default=None):
return self.__dict__.get(key, default)
|
{
"pile_set_name": "Github"
}
|
<iframe id="i"></iframe>
<video id="v"></video>
<script>
var doc = i.contentDocument;
i.remove();
doc.importNode(v);
</script>
|
{
"pile_set_name": "Github"
}
|
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/tips.css">
</head>
<body>
<h1>CreateTestIntentionAction(创建测试意图动作) <a href='https://www.pingfangx.com/xx/translation/feedback?from=tips'>[汉化反馈]</a></h1>
<p><span class="product">&productName;</span> 可以直接从类声明创建测试用例。将插入符号放到编辑器中的类名处,按下 <span class="shortcut">&shortcut:ShowIntentionActions;</span>,从建议列表中选择 <span class="control">Create Test</span> 。</p>
<p class="image"><img src="images/createTest.png" alt="createTest"></p>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
<html><head>
<meta http-equiv="refresh" content="0;url=http://packetstormsecurity.org/1102-exploits/"></head>
<body>This page has moved here: <a href="http://packetstormsecurity.org/1102-exploits/">http://packetstormsecurity.org/1102-exploits/</a></body></html>
|
{
"pile_set_name": "Github"
}
|
import { NetworkProtocol } from '../../network-rule.model';
import { NetworkRuleType } from '../../sg.model';
export interface FirewallRule {
type: NetworkRuleType;
protocol: NetworkProtocol;
cidr: string;
icmpType?: number;
icmpCode?: number;
startPort?: number;
endPort?: number;
}
|
{
"pile_set_name": "Github"
}
|
<!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_23) on Fri Nov 23 14:03:49 GMT 2012 -->
<TITLE>
GZIPUtils (apache-nutch 1.6 API)
</TITLE>
<META NAME="date" CONTENT="2012-11-23">
<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="GZIPUtils (apache-nutch 1.6 API)";
}
}
</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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GZIPUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-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-all.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">
<A HREF="../../../../org/apache/nutch/util/GenericWritableConfigurable.html" title="class in org.apache.nutch.util"><B>PREV CLASS</B></A>
<A HREF="../../../../org/apache/nutch/util/HadoopFSUtil.html" title="class in org.apache.nutch.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/nutch/util/GZIPUtils.html" target="_top"><B>FRAMES</B></A>
<A HREF="GZIPUtils.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.nutch.util</FONT>
<BR>
Class GZIPUtils</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.nutch.util.GZIPUtils</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>GZIPUtils</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
A collection of utility methods for working on GZIPed data.
<P>
<P>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/nutch/util/GZIPUtils.html#GZIPUtils()">GZIPUtils</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/nutch/util/GZIPUtils.html#unzip(byte[])">unzip</A></B>(byte[] in)</CODE>
<BR>
Returns an gunzipped copy of the input array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/nutch/util/GZIPUtils.html#unzipBestEffort(byte[])">unzipBestEffort</A></B>(byte[] in)</CODE>
<BR>
Returns an gunzipped copy of the input array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/nutch/util/GZIPUtils.html#unzipBestEffort(byte[], int)">unzipBestEffort</A></B>(byte[] in,
int sizeLimit)</CODE>
<BR>
Returns an gunzipped copy of the input array, truncated to
<code>sizeLimit</code> bytes, if necessary.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/nutch/util/GZIPUtils.html#zip(byte[])">zip</A></B>(byte[] in)</CODE>
<BR>
Returns an gzipped copy of the input array.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="GZIPUtils()"><!-- --></A><H3>
GZIPUtils</H3>
<PRE>
public <B>GZIPUtils</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="unzipBestEffort(byte[])"><!-- --></A><H3>
unzipBestEffort</H3>
<PRE>
public static final byte[] <B>unzipBestEffort</B>(byte[] in)</PRE>
<DL>
<DD>Returns an gunzipped copy of the input array. If the gzipped
input has been truncated or corrupted, a best-effort attempt is
made to unzip as much as possible. If no data can be extracted
<code>null</code> is returned.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="unzipBestEffort(byte[], int)"><!-- --></A><H3>
unzipBestEffort</H3>
<PRE>
public static final byte[] <B>unzipBestEffort</B>(byte[] in,
int sizeLimit)</PRE>
<DL>
<DD>Returns an gunzipped copy of the input array, truncated to
<code>sizeLimit</code> bytes, if necessary. If the gzipped input
has been truncated or corrupted, a best-effort attempt is made to
unzip as much as possible. If no data can be extracted
<code>null</code> is returned.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="unzip(byte[])"><!-- --></A><H3>
unzip</H3>
<PRE>
public static final byte[] <B>unzip</B>(byte[] in)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Returns an gunzipped copy of the input array.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - if the input cannot be properly decompressed</DL>
</DD>
</DL>
<HR>
<A NAME="zip(byte[])"><!-- --></A><H3>
zip</H3>
<PRE>
public static final byte[] <B>zip</B>(byte[] in)</PRE>
<DL>
<DD>Returns an gzipped copy of the input array.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GZIPUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-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-all.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">
<A HREF="../../../../org/apache/nutch/util/GenericWritableConfigurable.html" title="class in org.apache.nutch.util"><B>PREV CLASS</B></A>
<A HREF="../../../../org/apache/nutch/util/HadoopFSUtil.html" title="class in org.apache.nutch.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/nutch/util/GZIPUtils.html" target="_top"><B>FRAMES</B></A>
<A HREF="GZIPUtils.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2012 The Apache Software Foundation
</BODY>
</HTML>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2010-2020 Mark Allen, Norbert Bartels.
*
* 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.
*/
package com.restfb.util;
import static com.restfb.util.StringUtils.isBlank;
import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import java.util.function.Supplier;
public class ObjectUtil {
private ObjectUtil() {
// prevent instantiation
}
/**
* Ensures that {@code obj} isn't {@code null} or an empty string.
*
* @param obj
* The parameter to check.
* @param errorText
* The exception message.
* @throws IllegalArgumentException
* If {@code obj} is {@code null} or an empty string.
*/
public static String requireNotEmpty(String obj, String errorText) {
if (isBlank(obj)) {
throw new IllegalArgumentException(errorText);
}
return obj;
}
/**
* Ensures that {@code obj} isn't {@code null}.
*
* @param obj
* The parameter to check.
* @param exceptionSupplier
* The supplier for the exception that is thrown if obj is null.
* @throws T
* If {@code obj} is {@code null}.
*/
public static <T extends Exception> void requireNotNull(Object obj, Supplier<T> exceptionSupplier) throws T {
if (obj == null) {
throw exceptionSupplier.get();
}
}
/**
* Checks is the object is a empty 'collection' or 'map'.
*
* @param obj
* the object that is checked
* @return {@code true} if the given object is a empty collection or an empty map, {@code false} otherwise
*/
public static boolean isEmptyCollectionOrMap(Object obj) {
if (obj instanceof Collection) {
return ((Collection) obj).isEmpty();
}
return (obj instanceof Map && ((Map) obj).isEmpty());
}
/**
* Ensures that {@code parameter} isn't {@code null} or an empty string.
*
* @param parameterName
* The name of the parameter (to be used in exception message).
* @param parameter
* The parameter to check.
* @throws IllegalArgumentException
* If {@code parameter} is {@code null} or an empty string.
*/
public static void verifyParameterPresence(String parameterName, String parameter) {
verifyParameterPresence(parameterName, (Object) parameter);
requireNotEmpty(parameter, "The '" + parameterName + "' parameter cannot be an empty string.");
}
/**
* Ensures that {@code parameter} isn't {@code null}.
*
* @param parameterName
* The name of the parameter (to be used in exception message).
* @param parameter
* The parameter to check.
* @throws NullPointerException
* If {@code parameter} is {@code null}.
*/
public static void verifyParameterPresence(String parameterName, Object parameter) {
Objects.requireNonNull(parameter, "The '" + parameterName + "' parameter cannot be null.");
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.comp;
import com.sun.tools.javac.tree.*;
import java.util.Iterator;
import java.util.NoSuchElementException;
/** A class for environments, instances of which are passed as
* arguments to tree visitors. Environments refer to important ancestors
* of the subtree that's currently visited, such as the enclosing method,
* the enclosing class, or the enclosing toplevel node. They also contain
* a generic component, represented as a type parameter, to carry further
* information specific to individual passes.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public class Env<A> implements Iterable<Env<A>> {
/** The next enclosing environment.
*/
public Env<A> next;
/** The environment enclosing the current class.
*/
public Env<A> outer;
/** The tree with which this environment is associated.
*/
public JCTree tree;
/** The enclosing toplevel tree.
*/
public JCTree.JCCompilationUnit toplevel;
/** The next enclosing class definition.
*/
public JCTree.JCClassDecl enclClass;
/** The next enclosing method definition.
*/
public JCTree.JCMethodDecl enclMethod;
/** A generic field for further information.
*/
public A info;
/** Is this an environment for evaluating a base clause?
*/
public boolean baseClause = false;
/** Create an outermost environment for a given (toplevel)tree,
* with a given info field.
*/
public Env(JCTree tree, A info) {
this.next = null;
this.outer = null;
this.tree = tree;
this.toplevel = null;
this.enclClass = null;
this.enclMethod = null;
this.info = info;
}
/** Duplicate this environment, updating with given tree and info,
* and copying all other fields.
*/
public Env<A> dup(JCTree tree, A info) {
return dupto(new Env<A>(tree, info));
}
/** Duplicate this environment into a given Environment,
* using its tree and info, and copying all other fields.
*/
public Env<A> dupto(Env<A> that) {
that.next = this;
that.outer = this.outer;
that.toplevel = this.toplevel;
that.enclClass = this.enclClass;
that.enclMethod = this.enclMethod;
return that;
}
/** Duplicate this environment, updating with given tree,
* and copying all other fields.
*/
public Env<A> dup(JCTree tree) {
return dup(tree, this.info);
}
/** Return closest enclosing environment which points to a tree with given tag.
*/
public Env<A> enclosing(JCTree.Tag tag) {
Env<A> env1 = this;
while (env1 != null && !env1.tree.hasTag(tag)) env1 = env1.next;
return env1;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Env[").append(info);
// if (enclMethod != null)
// sb.append(",enclMethod=").append(Pretty.toSimpleString(enclMethod));
// if (enclClass != null)
// sb.append(",enclClass=").append(Pretty.toSimpleString(enclClass));
if (outer != null)
sb.append(",outer=").append(outer);
sb.append("]");
return sb.toString();
}
public Iterator<Env<A>> iterator() {
return new Iterator<Env<A>>() {
Env<A> next = Env.this;
public boolean hasNext() {
return next.outer != null;
}
public Env<A> next() {
if (hasNext()) {
Env<A> current = next;
next = current.outer;
return current;
}
throw new NoSuchElementException();
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
}
|
{
"pile_set_name": "Github"
}
|
---
title: buttons element
description: The required buttons element specifies one or more buttons that are displayed in the event notification message box on the client computer.
ms.assetid: bf3718c0-37d9-4b73-a015-8a5a95535381
keywords: ["buttons element Print Devices"]
topic_type:
- apiref
api_name:
- buttons
api_type:
- Schema
ms.date: 11/28/2017
ms.localizationpriority: medium
---
# buttons element
The required **buttons** element specifies one or more buttons that are displayed in the event notification message box on the client computer.
The **buttons** element is defined in the *asyncui* namespace at this URI: [https://schemas.microsoft.com/2003/print/asyncui/v1/request](https://schemas.microsoft.com/2003/print/asyncui/v1/request). (This resource may not be available in some languages and countries.)
Usage
-----
```xml
<buttons>
child elements
</buttons>
```
Attributes
----------
There are no attributes.
## Child elements
<table>
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead>
<tr class="header">
<th>Element</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p><a href="button.md" data-raw-source="[<strong>button</strong>](button.md)"><strong>button</strong></a></p></td>
<td><p></p>
<p>A required element that specifies the characteristics of a button in a message box that is displayed on the client computer.</p></td>
</tr>
</tbody>
</table>
## Parent elements
<table>
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<thead>
<tr class="header">
<th>Element</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p><a href="messageboxui.md" data-raw-source="[<strong>messageBoxUI</strong>](messageboxui.md)"><strong>messageBoxUI</strong></a></p></td>
<td><p></p>
<p>An optional element that is used to display a message box on the client computer.</p></td>
</tr>
</tbody>
</table>
Remarks
-------
See [**button**](button.md) for a code example that shows how to use the **buttons** element to enclose two **button** elements that display an **OK** and a **CANCEL** button.
## See also
[button](button.md)
[messageBoxUI](messageboxui.md)
|
{
"pile_set_name": "Github"
}
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Mike Pinkerton (pinkerton@netscape.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/******
This file contains the list of all Widget nsIAtoms and their values
It is designed to be used as inline input to nsWidgetAtoms.cpp *only*
through the magic of C preprocessing.
All entires must be enclosed in the macro WIDGET_ATOM which will have cruel
and unusual things done to it
It is recommended (but not strictly necessary) to keep all entries
in alphabetical order
The first argument to WIDGET_ATOM is the C++ identifier of the atom
The second argument is the string value of the atom
******/
WIDGET_ATOM(collapsed, "collapsed")
WIDGET_ATOM(menuseparator, "menuseparator") // Divider between menu items
WIDGET_ATOM(modifiers, "modifiers") // The modifiers attribute
WIDGET_ATOM(key, "key") // The key element / attribute
WIDGET_ATOM(command, "command")
WIDGET_ATOM(menu, "menu") // Represents an XP menu
WIDGET_ATOM(menuitem, "menuitem") // Represents an XP menu item
WIDGET_ATOM(open, "open") // Whether or not a menu, tree, etc. is open
WIDGET_ATOM(menupopup, "menupopup") // The XP menu's children.
WIDGET_ATOM(id, "id")
WIDGET_ATOM(accesskey, "accesskey") // The shortcut key for a menu or menu item
WIDGET_ATOM(name, "name")
WIDGET_ATOM(type, "type")
WIDGET_ATOM(autocheck, "autocheck")
WIDGET_ATOM(checked, "checked")
WIDGET_ATOM(disabled, "disabled")
WIDGET_ATOM(label, "label")
WIDGET_ATOM(hidden, "hidden")
WIDGET_ATOM(image, "image")
WIDGET_ATOM(curpos, "curpos")
WIDGET_ATOM(maxpos, "maxpos")
WIDGET_ATOM(increment, "increment")
WIDGET_ATOM(pageincrement, "pageincrement")
WIDGET_ATOM(orient, "orient")
|
{
"pile_set_name": "Github"
}
|
// go-qrcode
// Copyright 2014 Tom Harwood
/*
Package qrcode implements a QR Code encoder.
A QR Code is a matrix (two-dimensional) barcode. Arbitrary content may be
encoded.
A QR Code contains error recovery information to aid reading damaged or
obscured codes. There are four levels of error recovery: qrcode.{Low, Medium,
High, Highest}. QR Codes with a higher recovery level are more robust to damage,
at the cost of being physically larger.
Three functions cover most use cases:
- Create a PNG image:
var png []byte
png, err := qrcode.Encode("https://example.org", qrcode.Medium, 256)
- Create a PNG image and write to a file:
err := qrcode.WriteFile("https://example.org", qrcode.Medium, 256, "qr.png")
- Create a PNG image with custom colors and write to file:
err := qrcode.WriteColorFile("https://example.org", qrcode.Medium, 256, color.Black, color.White, "qr.png")
All examples use the qrcode.Medium error Recovery Level and create a fixed
256x256px size QR Code. The last function creates a white on black instead of black
on white QR Code.
To generate a variable sized image instead, specify a negative size (in place of
the 256 above), such as -4 or -5. Larger negative numbers create larger images:
A size of -5 sets each module (QR Code "pixel") to be 5px wide/high.
- Create a PNG image (variable size, with minimum white padding) and write to a file:
err := qrcode.WriteFile("https://example.org", qrcode.Medium, -5, "qr.png")
The maximum capacity of a QR Code varies according to the content encoded and
the error recovery level. The maximum capacity is 2,953 bytes, 4,296
alphanumeric characters, 7,089 numeric digits, or a combination of these.
This package implements a subset of QR Code 2005, as defined in ISO/IEC
18004:2006.
*/
package qrcode
import (
"bytes"
"errors"
"image"
"image/color"
"image/png"
"io"
"io/ioutil"
"log"
"os"
bitset "github.com/skip2/go-qrcode/bitset"
reedsolomon "github.com/skip2/go-qrcode/reedsolomon"
)
// Encode a QR Code and return a raw PNG image.
//
// size is both the image width and height in pixels. If size is too small then
// a larger image is silently returned. Negative values for size cause a
// variable sized image to be returned: See the documentation for Image().
//
// To serve over HTTP, remember to send a Content-Type: image/png header.
func Encode(content string, level RecoveryLevel, size int) ([]byte, error) {
var q *QRCode
q, err := New(content, level)
if err != nil {
return nil, err
}
return q.PNG(size)
}
// WriteFile encodes, then writes a QR Code to the given filename in PNG format.
//
// size is both the image width and height in pixels. If size is too small then
// a larger image is silently written. Negative values for size cause a variable
// sized image to be written: See the documentation for Image().
func WriteFile(content string, level RecoveryLevel, size int, filename string) error {
var q *QRCode
q, err := New(content, level)
if err != nil {
return err
}
return q.WriteFile(size, filename)
}
// WriteColorFile encodes, then writes a QR Code to the given filename in PNG format.
// With WriteColorFile you can also specify the colors you want to use.
//
// size is both the image width and height in pixels. If size is too small then
// a larger image is silently written. Negative values for size cause a variable
// sized image to be written: See the documentation for Image().
func WriteColorFile(content string, level RecoveryLevel, size int, background,
foreground color.Color, filename string) error {
var q *QRCode
q, err := New(content, level)
q.BackgroundColor = background
q.ForegroundColor = foreground
if err != nil {
return err
}
return q.WriteFile(size, filename)
}
// A QRCode represents a valid encoded QRCode.
type QRCode struct {
// Original content encoded.
Content string
// QR Code type.
Level RecoveryLevel
VersionNumber int
// User settable drawing options.
ForegroundColor color.Color
BackgroundColor color.Color
// Disable the QR Code border.
DisableBorder bool
encoder *dataEncoder
version qrCodeVersion
data *bitset.Bitset
symbol *symbol
mask int
}
// New constructs a QRCode.
//
// var q *qrcode.QRCode
// q, err := qrcode.New("my content", qrcode.Medium)
//
// An error occurs if the content is too long.
func New(content string, level RecoveryLevel) (*QRCode, error) {
encoders := []dataEncoderType{dataEncoderType1To9, dataEncoderType10To26,
dataEncoderType27To40}
var encoder *dataEncoder
var encoded *bitset.Bitset
var chosenVersion *qrCodeVersion
var err error
for _, t := range encoders {
encoder = newDataEncoder(t)
encoded, err = encoder.encode([]byte(content))
if err != nil {
continue
}
chosenVersion = chooseQRCodeVersion(level, encoder, encoded.Len())
if chosenVersion != nil {
break
}
}
if err != nil {
return nil, err
} else if chosenVersion == nil {
return nil, errors.New("content too long to encode")
}
q := &QRCode{
Content: content,
Level: level,
VersionNumber: chosenVersion.version,
ForegroundColor: color.Black,
BackgroundColor: color.White,
encoder: encoder,
data: encoded,
version: *chosenVersion,
}
return q, nil
}
func newWithForcedVersion(content string, version int, level RecoveryLevel) (*QRCode, error) {
var encoder *dataEncoder
switch {
case version >= 1 && version <= 9:
encoder = newDataEncoder(dataEncoderType1To9)
case version >= 10 && version <= 26:
encoder = newDataEncoder(dataEncoderType10To26)
case version >= 27 && version <= 40:
encoder = newDataEncoder(dataEncoderType27To40)
default:
log.Fatalf("Invalid version %d (expected 1-40 inclusive)", version)
}
var encoded *bitset.Bitset
encoded, err := encoder.encode([]byte(content))
if err != nil {
return nil, err
}
chosenVersion := getQRCodeVersion(level, version)
if chosenVersion == nil {
return nil, errors.New("cannot find QR Code version")
}
q := &QRCode{
Content: content,
Level: level,
VersionNumber: chosenVersion.version,
ForegroundColor: color.Black,
BackgroundColor: color.White,
encoder: encoder,
data: encoded,
version: *chosenVersion,
}
return q, nil
}
// Bitmap returns the QR Code as a 2D array of 1-bit pixels.
//
// bitmap[y][x] is true if the pixel at (x, y) is set.
//
// The bitmap includes the required "quiet zone" around the QR Code to aid
// decoding.
func (q *QRCode) Bitmap() [][]bool {
// Build QR code.
q.encode()
return q.symbol.bitmap()
}
// Image returns the QR Code as an image.Image.
//
// A positive size sets a fixed image width and height (e.g. 256 yields an
// 256x256px image).
//
// Depending on the amount of data encoded, fixed size images can have different
// amounts of padding (white space around the QR Code). As an alternative, a
// variable sized image can be generated instead:
//
// A negative size causes a variable sized image to be returned. The image
// returned is the minimum size required for the QR Code. Choose a larger
// negative number to increase the scale of the image. e.g. a size of -5 causes
// each module (QR Code "pixel") to be 5px in size.
func (q *QRCode) Image(size int) image.Image {
// Build QR code.
q.encode()
// Minimum pixels (both width and height) required.
realSize := q.symbol.size
// Variable size support.
if size < 0 {
size = size * -1 * realSize
}
// Actual pixels available to draw the symbol. Automatically increase the
// image size if it's not large enough.
if size < realSize {
size = realSize
}
// Output image.
rect := image.Rectangle{Min: image.Point{0, 0}, Max: image.Point{size, size}}
// Saves a few bytes to have them in this order
p := color.Palette([]color.Color{q.BackgroundColor, q.ForegroundColor})
img := image.NewPaletted(rect, p)
fgClr := uint8(img.Palette.Index(q.ForegroundColor))
// QR code bitmap.
bitmap := q.symbol.bitmap()
// Map each image pixel to the nearest QR code module.
modulesPerPixel := float64(realSize) / float64(size)
for y := 0; y < size; y++ {
y2 := int(float64(y) * modulesPerPixel)
for x := 0; x < size; x++ {
x2 := int(float64(x) * modulesPerPixel)
v := bitmap[y2][x2]
if v {
pos := img.PixOffset(x, y)
img.Pix[pos] = fgClr
}
}
}
return img
}
// PNG returns the QR Code as a PNG image.
//
// size is both the image width and height in pixels. If size is too small then
// a larger image is silently returned. Negative values for size cause a
// variable sized image to be returned: See the documentation for Image().
func (q *QRCode) PNG(size int) ([]byte, error) {
img := q.Image(size)
encoder := png.Encoder{CompressionLevel: png.BestCompression}
var b bytes.Buffer
err := encoder.Encode(&b, img)
if err != nil {
return nil, err
}
return b.Bytes(), nil
}
// Write writes the QR Code as a PNG image to io.Writer.
//
// size is both the image width and height in pixels. If size is too small then
// a larger image is silently written. Negative values for size cause a
// variable sized image to be written: See the documentation for Image().
func (q *QRCode) Write(size int, out io.Writer) error {
var png []byte
png, err := q.PNG(size)
if err != nil {
return err
}
_, err = out.Write(png)
return err
}
// WriteFile writes the QR Code as a PNG image to the specified file.
//
// size is both the image width and height in pixels. If size is too small then
// a larger image is silently written. Negative values for size cause a
// variable sized image to be written: See the documentation for Image().
func (q *QRCode) WriteFile(size int, filename string) error {
var png []byte
png, err := q.PNG(size)
if err != nil {
return err
}
return ioutil.WriteFile(filename, png, os.FileMode(0644))
}
// encode completes the steps required to encode the QR Code. These include
// adding the terminator bits and padding, splitting the data into blocks and
// applying the error correction, and selecting the best data mask.
func (q *QRCode) encode() {
numTerminatorBits := q.version.numTerminatorBitsRequired(q.data.Len())
q.addTerminatorBits(numTerminatorBits)
q.addPadding()
encoded := q.encodeBlocks()
const numMasks int = 8
penalty := 0
for mask := 0; mask < numMasks; mask++ {
var s *symbol
var err error
s, err = buildRegularSymbol(q.version, mask, encoded, !q.DisableBorder)
if err != nil {
log.Panic(err.Error())
}
numEmptyModules := s.numEmptyModules()
if numEmptyModules != 0 {
log.Panicf("bug: numEmptyModules is %d (expected 0) (version=%d)",
numEmptyModules, q.VersionNumber)
}
p := s.penaltyScore()
//log.Printf("mask=%d p=%3d p1=%3d p2=%3d p3=%3d p4=%d\n", mask, p, s.penalty1(), s.penalty2(), s.penalty3(), s.penalty4())
if q.symbol == nil || p < penalty {
q.symbol = s
q.mask = mask
penalty = p
}
}
}
// addTerminatorBits adds final terminator bits to the encoded data.
//
// The number of terminator bits required is determined when the QR Code version
// is chosen (which itself depends on the length of the data encoded). The
// terminator bits are thus added after the QR Code version
// is chosen, rather than at the data encoding stage.
func (q *QRCode) addTerminatorBits(numTerminatorBits int) {
q.data.AppendNumBools(numTerminatorBits, false)
}
// encodeBlocks takes the completed (terminated & padded) encoded data, splits
// the data into blocks (as specified by the QR Code version), applies error
// correction to each block, then interleaves the blocks together.
//
// The QR Code's final data sequence is returned.
func (q *QRCode) encodeBlocks() *bitset.Bitset {
// Split into blocks.
type dataBlock struct {
data *bitset.Bitset
ecStartOffset int
}
block := make([]dataBlock, q.version.numBlocks())
start := 0
end := 0
blockID := 0
for _, b := range q.version.block {
for j := 0; j < b.numBlocks; j++ {
start = end
end = start + b.numDataCodewords*8
// Apply error correction to each block.
numErrorCodewords := b.numCodewords - b.numDataCodewords
block[blockID].data = reedsolomon.Encode(q.data.Substr(start, end), numErrorCodewords)
block[blockID].ecStartOffset = end - start
blockID++
}
}
// Interleave the blocks.
result := bitset.New()
// Combine data blocks.
working := true
for i := 0; working; i += 8 {
working = false
for j, b := range block {
if i >= block[j].ecStartOffset {
continue
}
result.Append(b.data.Substr(i, i+8))
working = true
}
}
// Combine error correction blocks.
working = true
for i := 0; working; i += 8 {
working = false
for j, b := range block {
offset := i + block[j].ecStartOffset
if offset >= block[j].data.Len() {
continue
}
result.Append(b.data.Substr(offset, offset+8))
working = true
}
}
// Append remainder bits.
result.AppendNumBools(q.version.numRemainderBits, false)
return result
}
// max returns the maximum of a and b.
func max(a int, b int) int {
if a > b {
return a
}
return b
}
// addPadding pads the encoded data upto the full length required.
func (q *QRCode) addPadding() {
numDataBits := q.version.numDataBits()
if q.data.Len() == numDataBits {
return
}
// Pad to the nearest codeword boundary.
q.data.AppendNumBools(q.version.numBitsToPadToCodeword(q.data.Len()), false)
// Pad codewords 0b11101100 and 0b00010001.
padding := [2]*bitset.Bitset{
bitset.New(true, true, true, false, true, true, false, false),
bitset.New(false, false, false, true, false, false, false, true),
}
// Insert pad codewords alternately.
i := 0
for numDataBits-q.data.Len() >= 8 {
q.data.Append(padding[i])
i = 1 - i // Alternate between 0 and 1.
}
if q.data.Len() != numDataBits {
log.Panicf("BUG: got len %d, expected %d", q.data.Len(), numDataBits)
}
}
// ToString produces a multi-line string that forms a QR-code image.
func (q *QRCode) ToString(inverseColor bool) string {
bits := q.Bitmap()
var buf bytes.Buffer
for y := range bits {
for x := range bits[y] {
if bits[y][x] != inverseColor {
buf.WriteString(" ")
} else {
buf.WriteString("██")
}
}
buf.WriteString("\n")
}
return buf.String()
}
// ToSmallString produces a multi-line string that forms a QR-code image, a
// factor two smaller in x and y then ToString.
func (q *QRCode) ToSmallString(inverseColor bool) string {
bits := q.Bitmap()
var buf bytes.Buffer
// if there is an odd number of rows, the last one needs special treatment
for y := 0; y < len(bits)-1; y += 2 {
for x := range bits[y] {
if bits[y][x] == bits[y+1][x] {
if bits[y][x] != inverseColor {
buf.WriteString(" ")
} else {
buf.WriteString("█")
}
} else {
if bits[y][x] != inverseColor {
buf.WriteString("▄")
} else {
buf.WriteString("▀")
}
}
}
buf.WriteString("\n")
}
// special treatment for the last row if odd
if len(bits)%2 == 1 {
y := len(bits) - 1
for x := range bits[y] {
if bits[y][x] != inverseColor {
buf.WriteString(" ")
} else {
buf.WriteString("▀")
}
}
buf.WriteString("\n")
}
return buf.String()
}
|
{
"pile_set_name": "Github"
}
|
<template>
<div class="uk-padding">
<vk-spinner></vk-spinner>
<vk-spinner ratio="2"></vk-spinner>
</div>
</template>
|
{
"pile_set_name": "Github"
}
|
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/*
Copyright (c) 2012-2016 ymnk, JCraft,Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 JCRAFT,
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE 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.
*/
package com.jcraft.jsch;
import java.util.Vector;
class LocalIdentityRepository implements IdentityRepository {
private static final String name = "Local Identity Repository";
private Vector identities = new Vector();
private JSch jsch;
LocalIdentityRepository(JSch jsch){
this.jsch = jsch;
}
public String getName(){
return name;
}
public int getStatus(){
return RUNNING;
}
public synchronized Vector getIdentities() {
removeDupulicates();
Vector v = new Vector();
for(int i=0; i<identities.size(); i++){
v.addElement(identities.elementAt(i));
}
return v;
}
public synchronized void add(Identity identity) {
if(!identities.contains(identity)) {
byte[] blob1 = identity.getPublicKeyBlob();
if(blob1 == null) {
identities.addElement(identity);
return;
}
for(int i = 0; i<identities.size(); i++){
byte[] blob2 = ((Identity)identities.elementAt(i)).getPublicKeyBlob();
if(blob2 != null && Util.array_equals(blob1, blob2)){
if(!identity.isEncrypted() &&
((Identity)identities.elementAt(i)).isEncrypted()){
remove(blob2);
}
else {
return;
}
}
}
identities.addElement(identity);
}
}
public synchronized boolean add(byte[] identity) {
try{
Identity _identity =
IdentityFile.newInstance("from remote:", identity, null, jsch);
add(_identity);
return true;
}
catch(JSchException e){
return false;
}
}
synchronized void remove(Identity identity) {
if(identities.contains(identity)) {
identities.removeElement(identity);
identity.clear();
}
else {
remove(identity.getPublicKeyBlob());
}
}
public synchronized boolean remove(byte[] blob) {
if(blob == null) return false;
for(int i=0; i<identities.size(); i++) {
Identity _identity = (Identity)(identities.elementAt(i));
byte[] _blob = _identity.getPublicKeyBlob();
if(_blob == null || !Util.array_equals(blob, _blob))
continue;
identities.removeElement(_identity);
_identity.clear();
return true;
}
return false;
}
public synchronized void removeAll() {
for(int i=0; i<identities.size(); i++) {
Identity identity=(Identity)(identities.elementAt(i));
identity.clear();
}
identities.removeAllElements();
}
private void removeDupulicates(){
Vector v = new Vector();
int len = identities.size();
if(len == 0) return;
for(int i=0; i<len; i++){
Identity foo = (Identity)identities.elementAt(i);
byte[] foo_blob = foo.getPublicKeyBlob();
if(foo_blob == null) continue;
for(int j=i+1; j<len; j++){
Identity bar = (Identity)identities.elementAt(j);
byte[] bar_blob = bar.getPublicKeyBlob();
if(bar_blob == null) continue;
if(Util.array_equals(foo_blob, bar_blob) &&
foo.isEncrypted() == bar.isEncrypted()){
v.addElement(foo_blob);
break;
}
}
}
for(int i=0; i<v.size(); i++){
remove((byte[])v.elementAt(i));
}
}
}
|
{
"pile_set_name": "Github"
}
|
+ ld obj/kern/kernel
+ mk obj/kern/kernel.img
Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied
Back to tcg accelerator.
6828 decimal is 15254 octal!
Physical memory: 66556K available, base = 640K, extended = 65532K
boot_alloc memory at f0268000
Next memory at f0269000
boot_alloc memory at f0269000
Next memory at f028a000
npages: 16639
npages_basemem: 160
pages: f0269000
boot_alloc memory at f028a000
Next memory at f02a9000
MPENTRY_PADDR: 7000
npages_basemem: a0
med: 2a9
boot_alloc memory at f02a9000
Next memory at f02a9000
check_page_free_list done
alocccccccccccccc pa: 3ff000
alocccccccccccccc pa: 3fe000
alocccccccccccccc pa: 3fd000
freeeeeeeeeee pa: 3ff000
freeeeeeeeeee pa: 3fe000
freeeeeeeeeee pa: 3fd000
alocccccccccccccc pa: 3fd000
alocccccccccccccc pa: 3fe000
alocccccccccccccc pa: 3ff000
freeeeeeeeeee pa: 3fd000
alocccccccccccccc pa: 3fd000
freeeeeeeeeee pa: 3fd000
freeeeeeeeeee pa: 3fe000
freeeeeeeeeee pa: 3ff000
check_page_alloc() succeeded!
so far so good
alocccccccccccccc pa: 3ff000
alocccccccccccccc pa: 3fe000
alocccccccccccccc pa: 3fd000
freeeeeeeeeee pa: 3ff000
alocccccccccccccc pa: 3ff000
pp2 f026afe8
kern_pgdir f0268000
kern_pgdir[0] is 3ff007
freeeeeeeeeee pa: 3fd000
alocccccccccccccc pa: 3fd000
freeeeeeeeeee pa: 3fe000
alocccccccccccccc pa: 3fe000
freeeeeeeeeee pa: 3ff000
alocccccccccccccc pa: 3ff000
freeeeeeeeeee pa: 3ff000
alocccccccccccccc pa: 3ff000
freeeeeeeeeee pa: 3ff000
freeeeeeeeeee pa: 3fe000
freeeeeeeeeee pa: 3fd000
thiscpu: f0226020
Virtual Address ef800000 mapped to Physical Address 0
alocccccccccccccc pa: 3fd000
thiscpu: f0226020
Virtual Address ef802000 mapped to Physical Address 0
check_page() succeeded!
thiscpu: f0226020
Virtual Address ef000000 mapped to Physical Address 269000
alocccccccccccccc pa: 3fe000
PADDR(pages) 269000
thiscpu: f0226020
Virtual Address eec00000 mapped to Physical Address 28a000
alocccccccccccccc pa: 3ff000
thiscpu: f0226020
Virtual Address efff8000 mapped to Physical Address 118000
alocccccccccccccc pa: 3fc000
PADDR(bootstack) 118000
thiscpu: f0226020
Virtual Address f0000000 mapped to Physical Address 0
alocccccccccccccc pa: 3fb000
alocccccccccccccc pa: 3fa000
alocccccccccccccc pa: 3f9000
alocccccccccccccc pa: 3f8000
alocccccccccccccc pa: 3f7000
alocccccccccccccc pa: 3f6000
alocccccccccccccc pa: 3f5000
alocccccccccccccc pa: 3f4000
alocccccccccccccc pa: 3f3000
alocccccccccccccc pa: 3f2000
alocccccccccccccc pa: 3f1000
alocccccccccccccc pa: 3f0000
alocccccccccccccc pa: 3ef000
alocccccccccccccc pa: 3ee000
alocccccccccccccc pa: 3ed000
alocccccccccccccc pa: 3ec000
alocccccccccccccc pa: 3eb000
alocccccccccccccc pa: 3ea000
alocccccccccccccc pa: 3e9000
alocccccccccccccc pa: 3e8000
alocccccccccccccc pa: 3e7000
alocccccccccccccc pa: 3e6000
alocccccccccccccc pa: 3e5000
alocccccccccccccc pa: 3e4000
alocccccccccccccc pa: 3e3000
alocccccccccccccc pa: 3e2000
alocccccccccccccc pa: 3e1000
alocccccccccccccc pa: 3e0000
alocccccccccccccc pa: 3df000
alocccccccccccccc pa: 3de000
alocccccccccccccc pa: 3dd000
alocccccccccccccc pa: 3dc000
alocccccccccccccc pa: 3db000
alocccccccccccccc pa: 3da000
alocccccccccccccc pa: 3d9000
alocccccccccccccc pa: 3d8000
alocccccccccccccc pa: 3d7000
alocccccccccccccc pa: 3d6000
alocccccccccccccc pa: 3d5000
alocccccccccccccc pa: 3d4000
alocccccccccccccc pa: 3d3000
alocccccccccccccc pa: 3d2000
alocccccccccccccc pa: 3d1000
alocccccccccccccc pa: 3d0000
alocccccccccccccc pa: 3cf000
alocccccccccccccc pa: 3ce000
alocccccccccccccc pa: 3cd000
alocccccccccccccc pa: 3cc000
alocccccccccccccc pa: 3cb000
alocccccccccccccc pa: 3ca000
alocccccccccccccc pa: 3c9000
alocccccccccccccc pa: 3c8000
alocccccccccccccc pa: 3c7000
alocccccccccccccc pa: 3c6000
alocccccccccccccc pa: 3c5000
alocccccccccccccc pa: 3c4000
alocccccccccccccc pa: 3c3000
alocccccccccccccc pa: 3c2000
alocccccccccccccc pa: 3c1000
alocccccccccccccc pa: 3c0000
alocccccccccccccc pa: 3bf000
alocccccccccccccc pa: 3be000
alocccccccccccccc pa: 3bd000
alocccccccccccccc pa: 3bc000
percpu_kstacks[0]: f0227000
thiscpu: f0226020
Virtual Address efff8000 mapped to Physical Address 227000
percpu_kstacks[1]: f022f000
thiscpu: f0226020
Virtual Address effe8000 mapped to Physical Address 22f000
percpu_kstacks[2]: f0237000
thiscpu: f0226020
Virtual Address effd8000 mapped to Physical Address 237000
percpu_kstacks[3]: f023f000
thiscpu: f0226020
Virtual Address effc8000 mapped to Physical Address 23f000
percpu_kstacks[4]: f0247000
thiscpu: f0226020
Virtual Address effb8000 mapped to Physical Address 247000
percpu_kstacks[5]: f024f000
thiscpu: f0226020
Virtual Address effa8000 mapped to Physical Address 24f000
percpu_kstacks[6]: f0257000
thiscpu: f0226020
Virtual Address eff98000 mapped to Physical Address 257000
percpu_kstacks[7]: f025f000
thiscpu: f0226020
Virtual Address eff88000 mapped to Physical Address 25f000
check_kern_pgdir() succeeded!
boot_alloc memory at f02a9000
Next memory at f02a9000
check_page_free_list done
alocccccccccccccc pa: 3bb000
alocccccccccccccc pa: 3ba000
alocccccccccccccc pa: 3b9000
freeeeeeeeeee pa: 3bb000
alocccccccccccccc pa: 3bb000
freeeeeeeeeee pa: 3ba000
freeeeeeeeeee pa: 3b9000
freeeeeeeeeee pa: 3bb000
check_page_installed_pgdir() succeeded!
funs f012239c
funs[0] f0104b28
funs[48] f0104b76
SMP: CPU 0 found 1 CPU(s)
thiscpu: f0226020
Virtual Address ef803000 mapped to Physical Address fee00000
enabled interrupts: 1 2
code addr: f0007000, mpentry_start addr: f01060d4
boot_aps:cpus: f0226020
ncpu: 1, CpuInfo size: 74
c: 0
alocccccccccccccc pa: 3bb000
envs: f028a000, e: f028a000, e->env_id: 1000
env_id, 1000
[00000000] new env 00001000
alocccccccccccccc pa: 3b9000
alocccccccccccccc pa: 3ba000
alocccccccccccccc pa: 3b8000
alocccccccccccccc pa: 3b7000
alocccccccccccccc pa: 3b6000
alocccccccccccccc pa: 3b5000
alocccccccccccccc pa: 3b4000
alocccccccccccccc pa: 3b3000
alocccccccccccccc pa: 3b2000
alocccccccccccccc pa: 3b1000
alocccccccccccccc pa: 3b0000
alocccccccccccccc pa: 3af000
envs[0].env_status: 2
[00001000] user panic in <unknown> at lib/pgfault.c:32: set_pgfault_handler not implemented
BREAK POINT
Welcome to the JOS kernel monitor!
Type 'help' for a list of commands.
blue
green
red
TRAP frame at 0xf028a000 from CPU 0
edi 0x00000000
esi 0xeebfdfa4
ebp 0xeebfdf90
oesp 0xefffffdc
ebx 0x0080125c
edx 0xeebfde38
ecx 0x00000001
eax 0x00000001
es 0x----0023
ds 0x----0023
trap 0x00000003 Breakpoint
err 0x00000000
eip 0x00800fc8
cs 0x----001b
flag 0x00000092
esp 0xeebfdf68
ss 0x----0023
QEMU: Terminated via GDBstub
|
{
"pile_set_name": "Github"
}
|
{% set version = "1.4.0" %}
{% set name = "BSgenome.Dmelanogaster.UCSC.dm2" %}
{% set bioc = "3.11" %}
package:
name: 'bioconductor-{{ name|lower }}'
version: '{{ version }}'
source:
url:
- 'https://bioconductor.org/packages/{{ bioc }}/data/annotation/src/contrib/{{ name }}_{{ version }}.tar.gz'
- 'https://bioarchive.galaxyproject.org/{{ name }}_{{ version }}.tar.gz'
- 'https://depot.galaxyproject.org/software/bioconductor-{{ name|lower }}/bioconductor-{{ name|lower }}_{{ version }}_src_all.tar.gz'
md5: ebc88df5595fc7aad588b8f3f7de4784
build:
number: 5
rpaths:
- lib/R/lib/
- lib/
noarch: generic
# Suggests: GenomicFeatures
requirements:
host:
- 'bioconductor-bsgenome >=1.56.0,<1.57.0'
- r-base
run:
- 'bioconductor-bsgenome >=1.56.0,<1.57.0'
- r-base
- curl
test:
commands:
- '$R -e "library(''{{ name }}'')"'
about:
home: 'https://bioconductor.org/packages/{{ bioc }}/data/annotation/html/{{ name }}.html'
license: Artistic-2.0
summary: 'Full genome sequences for Drosophila melanogaster (UCSC version dm2)'
description: 'Full genome sequences for Drosophila melanogaster (Fly) as provided by UCSC (dm2, Apr. 2004) and stored in Biostrings objects.'
|
{
"pile_set_name": "Github"
}
|
// Copyright 2019 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License.
package safedetails
import (
"context"
"fmt"
"net"
"os"
"runtime"
"strings"
"syscall"
"github.com/cockroachdb/errors/errbase"
"github.com/cockroachdb/errors/markers"
"github.com/cockroachdb/errors/withstack"
)
// Redact returns a redacted version of the supplied item that is safe to use in
// anonymized reporting.
func Redact(r interface{}) string {
var buf strings.Builder
switch t := r.(type) {
case SafeMessager:
buf.WriteString(t.SafeMessage())
case error:
redactErr(&buf, t)
default:
typAnd(&buf, r, "")
}
return buf.String()
}
func redactErr(buf *strings.Builder, err error) {
if c := errbase.UnwrapOnce(err); c == nil {
// This is a leaf error. Decode the leaf and return.
if file, line, _, ok := withstack.GetOneLineSource(err); ok {
fmt.Fprintf(buf, "%s:%d: ", file, line)
}
redactLeafErr(buf, err)
} else /* c != nil */ {
// Print the inner error before the outer error.
redactErr(buf, c)
redactWrapper(buf, err)
}
// Add any additional safe strings from the wrapper, if present.
if payload := errbase.GetSafeDetails(err); len(payload.SafeDetails) > 0 {
buf.WriteString("\n(more details:)")
for _, sd := range payload.SafeDetails {
buf.WriteByte('\n')
buf.WriteString(strings.TrimSpace(sd))
}
}
}
func redactWrapper(buf *strings.Builder, err error) {
buf.WriteString("\nwrapper: ")
switch t := err.(type) {
case *os.SyscallError:
typAnd(buf, t, t.Syscall)
case *os.PathError:
typAnd(buf, t, t.Op)
case *os.LinkError:
fmt.Fprintf(buf, "%T: %s %s %s", t, t.Op, t.Old, t.New)
case *net.OpError:
typAnd(buf, t, t.Op)
if t.Net != "" {
fmt.Fprintf(buf, " %s", t.Net)
}
if t.Source != nil {
buf.WriteString("<redacted>")
}
if t.Addr != nil {
if t.Source != nil {
buf.WriteString("->")
}
buf.WriteString("<redacted>")
}
default:
typAnd(buf, err, "")
}
}
func redactLeafErr(buf *strings.Builder, err error) {
// Is it a sentinel error? These are safe.
if markers.IsAny(err,
context.DeadlineExceeded,
context.Canceled,
os.ErrInvalid,
os.ErrPermission,
os.ErrExist,
os.ErrNotExist,
os.ErrClosed,
os.ErrNoDeadline,
) {
typAnd(buf, err, err.Error())
return
}
if redactPre113Wrappers(buf, err) {
return
}
// The following two types are safe too.
switch t := err.(type) {
case runtime.Error:
typAnd(buf, t, t.Error())
case syscall.Errno:
typAnd(buf, t, t.Error())
default:
// No further information about this error, simply report its type.
typAnd(buf, err, "")
}
}
func typAnd(buf *strings.Builder, r interface{}, msg string) {
if msg == "" {
fmt.Fprintf(buf, "<%T>", r)
} else {
fmt.Fprintf(buf, "%T: %s", r, msg)
}
}
|
{
"pile_set_name": "Github"
}
|
import "hash"
rule n3ed_51996b64dbd31932
{
meta:
copyright="Copyright (c) 2014-2017 Support Intelligence Inc, All Rights Reserved."
engine="saphire/1.2.2 divinorum/0.99 icewater/0.3.01"
viz_url="http://icewater.io/en/cluster/query?h64=n3ed.51996b64dbd31932"
cluster="n3ed.51996b64dbd31932"
cluster_size="14 samples"
filetype = "pe"
tlp = "amber"
version = "icewater foxtail"
author = "Rick Wesson (@wessorh) rick@support-intelligence.com"
date = "20171009"
license = "RIL v1.0 see https://raw.githubusercontent.com/SupportIntelligence/Icewater/master/LICENSE"
family="ramnit nimnul bmnup"
md5_hashes="['bd336801f569743f5245ce859c1e24ea', 'c5be356051639fd2683c5750a14e116d', 'b49d38804633c911837891bd9dfcbcf3']"
condition:
filesize > 262144 and filesize < 1048576
and hash.md5(340992,1024) == "dd91d06741e0bcecc34711b0e573b5c3"
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="dispy.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dispy.js"></script>
<script type="text/javascript">
//<![CDATA[
jQuery.ajaxSettings.traditional = true;
var cluster_nodes = {};
var cur_cluster_name = null;
var new_node_count = 5;
function show_nodes() {
var nodes = cluster_nodes[cur_cluster_name];
if (nodes.length > 0) {
var ip_size = Math.max($('input[type="text"][name="host_1"]').attr('size'),
Math.max.apply(null, $.map(nodes, function(node, name) {
return node.ip_addr.length;
})));
$('input[type="text"][name^="host_"]').each(function() {
$(this).attr('size', ip_size);
});
var rows = '';
$.each(nodes, function(i, node) {
rows += '<tr><td>' + (i + 1) + '</td><td><a href="node.html?host=' +
node.ip_addr + '" title="View jobs on ' + node.ip_addr + '">' +
node.ip_addr + '</a></td>' + '<td>' + node.name + '</td><td>' +
node.avail_cpus + '</td>' + '<td><input style="width:4em" maxlength="6" ' +
'type="text" name="cpus_' + node.ip_addr + '" value="' + node.cpus + '" /></td></tr>';
});
$('#cur-nodes > tbody').html(rows);
if ($('#cur-nodes-div').is(':hidden')) {
$('#cur-nodes-div').show();
}
} else {
$('#cur-nodes-div').hide();
}
}
function desc_cmp_nodes(node1, node2) {
return node1.ip_addr < node2.ip_addr ? 1 : (node1.ip_addr > node2.ip_addr ? -1 : 0);
}
function get_nodes() {
$.ajax({
url: '/nodes',
method: 'GET',
dataType: 'json',
timeout: 5000
})
.done(function(clusters) {
cluster_nodes = {'': []};
var cluster_names = '<strong>Cluster : </strong>';
cluster_names += '<select name="cluster-names" style="margin-left:5px;">';
$.each(clusters, function(i, cluster) {
cluster_nodes[cluster.name] = cluster.nodes.sort(desc_cmp_nodes);
cluster_nodes[''] = merge_sorted_uniq(cluster_nodes[''], cluster_nodes[cluster.name],
desc_cmp_nodes);
cluster_names += '<option ' +
(cur_cluster_name == cluster.name ? 'selected="selected" ' : '') +
' value="' + cluster.name + '">' + cluster.name + '</option>';
});
if (clusters.length > 1) {
cluster_names += '<option ' +
(cur_cluster_name == '* Combined' ? 'selected="selected" ' : '') +
' value="">* Combined</option>';
}
cluster_names += '</select>';
$('#cluster-names-container').html(cluster_names);
if (cur_cluster_name == null) {
cur_cluster_name = clusters[0].name;
}
show_nodes();
})
.fail(function() {
$('#messages').append('<li style="color:red">Failed to get nodes in cluster.</li>');
});
}
$(document).ready(function() {
var rows = '';
for (var i = 1; i <= new_node_count; i++) {
rows += '<tr><td>' + i + '</td>' +
'<td><input style="min-width:8em;" size="8" type="text" name="host_' + i + '" /></td>' +
'<td><input style="width:3em;" maxlength="6" type="text" name="cpus_' + i + '" /></td>' +
'<td><input style="width:4em;" maxlength="6" type="text" name="port_' + i + '" /></td>' +
'</tr>';
}
$('#new-nodes > tbody').html(rows);
get_nodes();
$('#update-cpus').click(function() {
var cpus = {};
$.each(cluster_nodes[cur_cluster_name], function(i, node) {
var n = parseInt($('input[type="text"][name="cpus_' + node.ip_addr + '"]').val());
if (n == node.cpus) {
return true;
}
if ($.isNumeric(n) && (Math.abs(n) <= node.avail_cpus)) {
cpus[node.ip_addr] = n;
} else {
$('input[type="text"][name="cpus_' + node.ip_addr + '"]').val(node.cpus);
$('#messages').append('<li style="color:red">Invalid CPUs ' + n + ' for ' +
node.ip_addr + ' ignored.</li>');
}
});
if (Object.keys(cpus).length == 0) {
$('#messages').append('<li>No changes made to cpus.</li>');
return;
}
$.ajax({
url: '/set_cpus',
method: 'POST',
data: cpus,
dataType: 'json',
timeout: 5000
})
.done(function(data) {
$.each(data, function(ip_addr, n) {
$('input[type="text"][name="cpus_' + ip_addr + '"]').val(n);
var loc = bin_desc_search(cluster_nodes[cur_cluster_name], ip_addr,
function(node1, node2) {
return node1.ip_addr < node2.ip_addr ? 1 :
(node1.ip_addr > node2.ip_addr ? -1 : 0);
});
cluster_nodes[cur_cluster_name][loc].cpus = n;
$('#messages').html('<li>CPUs for ' + ip_addr + ' changed to ' + n + '.</li>');
});
})
.fail(function() {
$('#messages').html('<li style="color:red">Changing CPUs failed.</li>');
});
});
$('#add-node').click(function() {
$('#messages').html('');
for (var i = 1; i <= new_node_count; i++) {
var node = {};
$('input[type="text"][name$="_' + i + '"]').each(function(i) {
var name = $(this).prop('name');
name = name.substring(0, name.lastIndexOf('_'));
node[name] = $(this).val().trim();
});
if (node.host == '') {
continue;
}
node.id = i;
node.cluster = cur_cluster_name;
$.ajax({
url: '/add_node',
method: 'POST',
data: node,
dataType: 'json',
timeout: 1000
})
.done(function(node) {
$('#messages').append('<li>Node ' + node.id + ' "' + node.host + '"' +
' requested.</li>');
})
.fail(function(jqXHR, textStatus, errorThrown) {
$('#messages').append('<li style="color:red">Node ' + i + ' is invalid.</li>');
})
}
});
$('#cluster-names-container').on('change', 'select[name="cluster-names"]', function() {
cur_cluster_name = $(this).val();
show_nodes();
});
});
//]]>
</script>
<title>dispy: Manage Nodes in Cluster</title>
</head>
<body>
<div id="page">
<nav style="margin:0 auto;" id="navigation" role="navigation">
<ul>
<li><a href="monitor.html">Monitor</a></li>
<li class="active"><a href="manage.html">Manage</a></li>
<li><a href="node.html">Node</a></li>
</ul>
</nav>
<h1 style="margin:2em 0;"><span class="title">dispy: Manage Nodes in Cluster</span></h1>
<div id="cluster-names-container" class="border" style="padding:10px;display:inline-block;">
</div>
<div id="cur-nodes-div">
<table id="cur-nodes" class="fancy shadow alt" style="text-align:right;margin:20px auto;">
<caption>
<span class="border" style="display:inline-block;">Nodes in Cluster</span>
</caption>
<thead>
<tr><th></th><th>IP Address</th><th>Host Name</th>
<th>Available CPUs</th><th>dispy CPUs</th></tr>
</thead>
<tbody>
</tbody>
</table>
<div style="margin:20px auto;">
<button type="button" id="update-cpus">Update</button>
</div>
<hr style="margin:10px;" />
</div>
<table id="new-nodes" class="fancy shadow" style="text-align:right;margin:20px auto;">
<caption>
<span class="border" style="display:inline-block;">Add Nodes to Cluster</span>
</caption>
<thead>
<tr><th></th><th>Host Name or IP</th><th>CPUs</th><th>Port</th></tr>
</thead>
<tbody>
</tbody>
</table>
<div style="margin:20px auto;">
<button type="button" id="add-node">Add Nodes</button>
</div>
<hr style="margin:10px;" />
<div>
<ul id="messages" style="margin:1em auto;display:inline-block;text-align:left;"></ul>
</div>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
<?php
/*!
* Hybridauth
* https://hybridauth.github.io | https://github.com/hybridauth/hybridauth
* (c) 2017 Hybridauth authors | https://hybridauth.github.io/license.html
*/
namespace Hybridauth\Provider;
use Hybridauth\Adapter\OAuth2;
use Hybridauth\Data;
use Hybridauth\Exception\UnexpectedApiResponseException;
use Hybridauth\User;
/**
* Microsoft Graph OAuth2 provider adapter.
*
* Create an "Azure Active Directory" resource at https://portal.azure.com/
* (not from the Visual Studio site).
*
* The "Supported account types" choice maps to the 'tenant' setting, see "Authority" @
* https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-client-application-configuration
*
* Example:
*
* $config = [
* 'callback' => Hybridauth\HttpClient\Util::getCurrentUrl(),
* 'keys' => [ 'id' => '', 'secret' => '' ],
* 'tenant' => 'user',
* // ^ May be 'common', 'organizations' or 'consumers' or a specific tenant ID or a domain
* ];
*
* $adapter = new Hybridauth\Provider\MicrosoftGraph( $config );
*
* try {
* $adapter->authenticate();
*
* $userProfile = $adapter->getUserProfile();
* $tokens = $adapter->getAccessToken();
* }
* catch( Exception $e ){
* echo $e->getMessage() ;
* }
*/
class MicrosoftGraph extends OAuth2
{
/**
* {@inheritdoc}
*/
protected $scope = 'openid user.read contacts.read';
/**
* {@inheritdoc}
*/
protected $apiBaseUrl = 'https://graph.microsoft.com/v1.0/';
/**
* {@inheritdoc}
*/
protected $authorizeUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize';
/**
* {@inheritdoc}
*/
protected $accessTokenUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/token';
/**
* {@inheritdoc}
*/
protected $apiDocumentation = 'https://developer.microsoft.com/en-us/graph/docs/concepts/php';
/**
* {@inheritdoc}
*/
protected function initialize()
{
parent::initialize();
$tenant = $this->config->get('tenant');
if (!empty($tenant)) {
$adjustedEndpoints = [
'authorize_url' => str_replace('/common/', '/'. $tenant .'/', $this->authorizeUrl),
'access_token_url' => str_replace('/common/', '/'. $tenant .'/', $this->accessTokenUrl),
];
$this->setApiEndpoints($adjustedEndpoints);
}
}
/**
* {@inheritdoc}
*/
public function getUserProfile()
{
$response = $this->apiRequest('me');
$data = new Data\Collection($response);
if (!$data->exists('id')) {
throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
}
$userProfile = new User\Profile();
$userProfile->identifier = $data->get('id');
$userProfile->displayName = $data->get('displayName');
$userProfile->firstName = $data->get('givenName');
$userProfile->lastName = $data->get('surname');
$userProfile->language = $data->get('preferredLanguage');
$userProfile->phone = $data->get('mobilePhone');
if (empty($userProfile->phone)) {
$businessPhones = $data->get('businessPhones');
if (isset($businessPhones[0])) {
$userProfile->phone = $businessPhones[0];
}
}
$userProfile->email = $data->get('mail');
if (empty($userProfile->email)) {
$email = $data->get('userPrincipalName');
if (strpos($email, '@') !== false) {
$userProfile->email = $email;
}
}
return $userProfile;
}
/**
* {@inheritdoc}
*/
public function getUserContacts()
{
$apiUrl = 'me/contacts?$top=50';
$contacts = [];
do {
$response = $this->apiRequest($apiUrl);
$data = new Data\Collection($response);
if (!$data->exists('value')) {
throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
}
foreach ($data->filter('value')->toArray() as $entry) {
$entry = new Data\Collection($entry);
$userContact = new User\Contact();
$userContact->identifier = $entry->get('id');
$userContact->displayName = $entry->get('displayName');
if (!empty($entry->get('emailAddresses'))) {
$userContact->email = $entry->get('emailAddresses')[0]->address;
}
// only add to collection if we have usefull data
if (!empty($userContact->displayName) || !empty($userContact->email)) {
$contacts[] = $userContact;
}
}
if ($data->exists('@odata.nextLink')) {
$apiUrl = $data->get('@odata.nextLink');
$pagedList = true;
} else {
$pagedList = false;
}
} while ($pagedList);
return $contacts;
}
}
|
{
"pile_set_name": "Github"
}
|
<?php return array (
'ALK' => 'Albanian Lek (1946–1965)',
'ARM' => 'Argentine Peso (1881–1970)',
'ARL' => 'Argentine Peso Ley (1970–1983)',
'BOL' => 'Bolivian Boliviano (1863–1963)',
'BAN' => 'Bosnia-Herzegovina New Dinar (1994–1997)',
'BRZ' => 'Brazilian Cruzeiro (1942–1967)',
'BGO' => 'Bulgarian Lev (1879–1952)',
'BGM' => 'Bulgarian Socialist Lev',
'CLE' => 'Chilean Escudo',
'CNX' => 'Chinese People’s Bank Dollar',
'ISJ' => 'Icelandic Króna (1918–1981)',
'ILR' => 'Israeli Shekel (1980–1985)',
'BOV' => 'MVDOL boliviano',
'MKN' => 'Macedonian Denar (1992–1993)',
'MVP' => 'Maldivian Rupee (1947–1981)',
'MDC' => 'Moldovan Cupon',
'MCF' => 'Monegasque Franc',
'KRH' => 'South Korean Hwan (1953–1962)',
'KRO' => 'South Korean Won (1945–1953)',
'VNN' => 'Vietnamese Dong (1978–1985)',
'YUR' => 'Yugoslavian Reformed Dinar (1992–1993)',
'ZWR' => 'Zimbabwean Dollar (2008)',
'AFN' => 'afgani',
'AFA' => 'afgani (1927–2002)',
'CSD' => 'antiguo dinar serbio',
'ROL' => 'antiguo leu rumano',
'MZM' => 'antiguo metical mozambiqueño',
'MGA' => 'ariari',
'ARA' => 'austral argentino',
'PAB' => 'balboa panameño',
'THB' => 'bat',
'ETB' => 'bir',
'BOB' => 'boliviano',
'VEF' => 'bolívar venezolano',
'VEB' => 'bolívar venezolano (1871–2008)',
'GHS' => 'cedi',
'GHC' => 'cedi ghanés (1979–2007)',
'ATS' => 'chelín austriaco',
'KES' => 'chelín keniano',
'SOS' => 'chelín somalí',
'TZS' => 'chelín tanzano',
'UGX' => 'chelín ugandés',
'UGS' => 'chelín ugandés (1966–1987)',
'CRC' => 'colón costarricense',
'SVC' => 'colón salvadoreño',
'CZK' => 'corona checa',
'DKK' => 'corona danesa',
'SKK' => 'corona eslovaca',
'EEK' => 'corona estonia',
'CSK' => 'corona fuerte checoslovaca',
'ISK' => 'corona islandesa',
'NOK' => 'corona noruega',
'SEK' => 'corona sueca',
'BRR' => 'cruceiro brasileño',
'BRE' => 'cruceiro brasileño (1990–1993)',
'BRC' => 'cruzado brasileño',
'NIO' => 'córdoba nicaragüense',
'NIC' => 'córdoba nicaragüense (1988–1991)',
'GMD' => 'dalasi',
'DZD' => 'dinar argelino',
'BHD' => 'dinar bahreiní',
'BAD' => 'dinar bosnio',
'YUN' => 'dinar convertible yugoslavo',
'HRD' => 'dinar croata',
'YUD' => 'dinar fuerte yugoslavo',
'IQD' => 'dinar iraquí',
'JOD' => 'dinar jordano',
'KWD' => 'dinar kuwaití',
'LYD' => 'dinar libio',
'MKD' => 'dinar macedonio',
'RSD' => 'dinar serbio',
'SDD' => 'dinar sudanés',
'TND' => 'dinar tunecino',
'YDD' => 'dinar yemení',
'STD' => 'dobra',
'VND' => 'dong',
'GRD' => 'dracma griego',
'AMD' => 'dram',
'AED' => 'dírham de los Emiratos Árabes Unidos',
'MAD' => 'dírham marroquí',
'AUD' => 'dólar australiano',
'BSD' => 'dólar bahameño',
'BBD' => 'dólar barbadense',
'BZD' => 'dólar beliceño',
'BND' => 'dólar bruneano',
'CAD' => 'dólar canadiense',
'BMD' => 'dólar de Bermudas',
'TTD' => 'dólar de Trinidad y Tobago',
'ZWD' => 'dólar de Zimbabue',
'KYD' => 'dólar de las Islas Caimán',
'XCD' => 'dólar del Caribe Oriental',
'USD' => 'dólar estadounidense',
'USN' => 'dólar estadounidense (día siguiente)',
'USS' => 'dólar estadounidense (mismo día)',
'FJD' => 'dólar fiyiano',
'GYD' => 'dólar guyanés',
'HKD' => 'dólar hongkonés',
'JMD' => 'dólar jamaicano',
'LRD' => 'dólar liberiano',
'NAD' => 'dólar namibio',
'NZD' => 'dólar neozelandés',
'RHD' => 'dólar rodesiano',
'SBD' => 'dólar salomonense',
'SGD' => 'dólar singapurense',
'SRD' => 'dólar surinamés',
'ZWL' => 'dólar zimbabuense',
'GQE' => 'ekuele de Guinea Ecuatorial',
'CVE' => 'escudo de Cabo Verde',
'GWE' => 'escudo de Guinea Portuguesa',
'MZE' => 'escudo mozambiqueño',
'PTE' => 'escudo portugués',
'TPE' => 'escudo timorense',
'PLN' => 'esloti',
'EUR' => 'euro',
'CHE' => 'euro WIR',
'AWG' => 'florín arubeño',
'ANG' => 'florín de las Antillas Neerlandesas',
'NLG' => 'florín neerlandés',
'SRG' => 'florín surinamés',
'XRE' => 'fondos RINET',
'HUF' => 'forinto húngaro',
'XOF' => 'franco CFA BCEAO',
'XAF' => 'franco CFA BEAC',
'XPF' => 'franco CFP',
'XFU' => 'franco UIC francés',
'CHW' => 'franco WIR',
'BEF' => 'franco belga',
'BEC' => 'franco belga (convertible)',
'BEL' => 'franco belga (financiero)',
'BIF' => 'franco burundés',
'KMF' => 'franco comorense',
'CDF' => 'franco congoleño',
'LUC' => 'franco convertible luxemburgués',
'LUL' => 'franco financiero luxemburgués',
'FRF' => 'franco francés',
'GNF' => 'franco guineano',
'LUF' => 'franco luxemburgués',
'MGF' => 'franco malgache',
'MLF' => 'franco malí',
'MAF' => 'franco marroquí',
'XFO' => 'franco oro francés',
'RWF' => 'franco ruandés',
'CHF' => 'franco suizo',
'DJF' => 'franco yibutiano',
'HTG' => 'gourde haitiano',
'UAH' => 'grivna',
'PYG' => 'guaraní paraguayo',
'BTN' => 'gultrum',
'PEI' => 'inti peruano',
'UAK' => 'karbovanet ucraniano',
'MMK' => 'kiat',
'PGK' => 'kina',
'LAK' => 'kip',
'ZMW' => 'kuacha zambiano',
'AOA' => 'kuanza',
'HRK' => 'kuna',
'GEK' => 'kupon larit georgiano',
'MWK' => 'kwacha malauí',
'ZMK' => 'kwacha zambiano (1968–2012)',
'AOK' => 'kwanza angoleño (1977–1990)',
'AOR' => 'kwanza reajustado angoleño (1995–1999)',
'BUK' => 'kyat birmano',
'GEL' => 'lari',
'LVL' => 'lats letón',
'ALL' => 'lek',
'HNL' => 'lempira hondureño',
'SLL' => 'leona',
'MDL' => 'leu moldavo',
'RON' => 'leu rumano',
'BGN' => 'lev búlgaro',
'BGL' => 'lev fuerte búlgaro',
'GBP' => 'libra británica',
'CYP' => 'libra chipriota',
'SHP' => 'libra de Santa Elena',
'EGP' => 'libra egipcia',
'GIP' => 'libra gibraltareña',
'IEP' => 'libra irlandesa',
'ILP' => 'libra israelí',
'LBP' => 'libra libanesa',
'MTP' => 'libra maltesa',
'FKP' => 'libra malvinense',
'SYP' => 'libra siria',
'SDG' => 'libra sudanesa',
'SDP' => 'libra sudanesa antigua',
'SSP' => 'libra sursudanesa',
'SZL' => 'lilangeni',
'ITL' => 'lira italiana',
'MTL' => 'lira maltesa',
'TRY' => 'lira turca',
'TRL' => 'lira turca (1922–2005)',
'LTL' => 'litas lituano',
'LSL' => 'loti lesothense',
'AZN' => 'manat azerí',
'AZM' => 'manat azerí (1993–2006)',
'TMT' => 'manat turcomano',
'TMM' => 'manat turcomano (1993–2009)',
'DEM' => 'marco alemán',
'BAM' => 'marco convertible de Bosnia-Herzegovina',
'FIM' => 'marco finlandés',
'MZN' => 'metical',
'NGN' => 'naira',
'ERN' => 'nakfa',
'BRB' => 'nuevo cruceiro brasileño (1967–1986)',
'BRN' => 'nuevo cruzado brasileño',
'TWD' => 'nuevo dólar taiwanés',
'AON' => 'nuevo kwanza angoleño (1990–2000)',
'BYB' => 'nuevo rublo bielorruso (1994–1999)',
'ILS' => 'nuevo séquel israelí',
'ZRN' => 'nuevo zaire zaireño',
'DDM' => 'ostmark de Alemania del Este',
'TOP' => 'paanga',
'MOP' => 'pataca de Macao',
'ADP' => 'peseta andorrana',
'ESP' => 'peseta española',
'ESA' => 'peseta española (cuenta A)',
'ESB' => 'peseta española (cuenta convertible)',
'ARS' => 'peso argentino',
'ARP' => 'peso argentino (1983–1985)',
'BOP' => 'peso boliviano',
'CLP' => 'peso chileno',
'COP' => 'peso colombiano',
'CUP' => 'peso cubano',
'CUC' => 'peso cubano convertible',
'GWP' => 'peso de Guinea-Bissáu',
'MXP' => 'peso de plata mexicano (1861–1992)',
'DOP' => 'peso dominicano',
'PHP' => 'peso filipino',
'MXN' => 'peso mexicano',
'UYU' => 'peso uruguayo',
'UYP' => 'peso uruguayo (1975–1993)',
'UYI' => 'peso uruguayo en unidades indexadas',
'BWP' => 'pula',
'GTQ' => 'quetzal guatemalteco',
'ZAR' => 'rand',
'ZAL' => 'rand sudafricano (financiero)',
'BRL' => 'real brasileño',
'QAR' => 'rial catarí',
'IRR' => 'rial iraní',
'OMR' => 'rial omaní',
'SAR' => 'rial saudí',
'YER' => 'rial yemení',
'KHR' => 'riel',
'MYR' => 'ringit',
'BYN' => 'rublo bielorruso',
'BYR' => 'rublo bielorruso (2000–2016)',
'LVR' => 'rublo letón',
'RUB' => 'rublo ruso',
'RUR' => 'rublo ruso (1991–1998)',
'SUR' => 'rublo soviético',
'TJR' => 'rublo tayiko',
'MVR' => 'rufiya',
'LKR' => 'rupia esrilanquesa',
'INR' => 'rupia india',
'IDR' => 'rupia indonesia',
'MUR' => 'rupia mauriciana',
'NPR' => 'rupia nepalí',
'PKR' => 'rupia pakistaní',
'SCR' => 'rupia seychellense',
'PEN' => 'sol peruano',
'PES' => 'sol peruano (1863–1965)',
'KGS' => 'som',
'TJS' => 'somoni tayiko',
'ECS' => 'sucre ecuatoriano',
'UZS' => 'sum',
'YUM' => 'super dinar yugoslavo',
'GNS' => 'syli guineano',
'BDT' => 'taka',
'WST' => 'tala',
'LTT' => 'talonas lituano',
'KZT' => 'tenge kazako',
'MNT' => 'tugrik',
'SIT' => 'tólar esloveno',
'MRO' => 'uguiya',
'CLF' => 'unidad de fomento chilena',
'MXV' => 'unidad de inversión (UDI) mexicana',
'XEU' => 'unidad de moneda europea',
'ECV' => 'unidad de valor constante (UVC) ecuatoriana',
'COU' => 'unidad de valor real colombiana',
'VUV' => 'vatu',
'KPW' => 'won norcoreano',
'KRW' => 'won surcoreano',
'JPY' => 'yen',
'CNY' => 'yuan',
'ZRZ' => 'zaire zaireño',
'PLZ' => 'zloty polaco (1950–1995)',
);
|
{
"pile_set_name": "Github"
}
|
#include "perf_precomp.hpp"
namespace opencv_test
{
using namespace perf;
PERF_TEST_P(Size_MatType, sum, TYPICAL_MATS)
{
Size sz = get<0>(GetParam());
int type = get<1>(GetParam());
Mat arr(sz, type);
Scalar s;
declare.in(arr, WARMUP_RNG).out(s);
TEST_CYCLE() s = sum(arr);
SANITY_CHECK(s, 1e-6, ERROR_RELATIVE);
}
PERF_TEST_P(Size_MatType, mean, TYPICAL_MATS)
{
Size sz = get<0>(GetParam());
int type = get<1>(GetParam());
Mat src(sz, type);
Scalar s;
declare.in(src, WARMUP_RNG).out(s);
TEST_CYCLE() s = mean(src);
SANITY_CHECK(s, 1e-5);
}
PERF_TEST_P(Size_MatType, mean_mask, TYPICAL_MATS)
{
Size sz = get<0>(GetParam());
int type = get<1>(GetParam());
Mat src(sz, type);
Mat mask = Mat::ones(src.size(), CV_8U);
Scalar s;
declare.in(src, WARMUP_RNG).in(mask).out(s);
TEST_CYCLE() s = mean(src, mask);
SANITY_CHECK(s, 5e-5);
}
PERF_TEST_P(Size_MatType, meanStdDev, TYPICAL_MATS)
{
Size sz = get<0>(GetParam());
int matType = get<1>(GetParam());
Mat src(sz, matType);
Scalar mean;
Scalar dev;
declare.in(src, WARMUP_RNG).out(mean, dev);
TEST_CYCLE() meanStdDev(src, mean, dev);
SANITY_CHECK(mean, 1e-5, ERROR_RELATIVE);
SANITY_CHECK(dev, 1e-5, ERROR_RELATIVE);
}
PERF_TEST_P(Size_MatType, meanStdDev_mask, TYPICAL_MATS)
{
Size sz = get<0>(GetParam());
int matType = get<1>(GetParam());
Mat src(sz, matType);
Mat mask = Mat::ones(sz, CV_8U);
Scalar mean;
Scalar dev;
declare.in(src, WARMUP_RNG).in(mask).out(mean, dev);
TEST_CYCLE() meanStdDev(src, mean, dev, mask);
SANITY_CHECK(mean, 1e-5);
SANITY_CHECK(dev, 1e-5);
}
PERF_TEST_P(Size_MatType, countNonZero, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( CV_8UC1, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1 ) ))
{
Size sz = get<0>(GetParam());
int matType = get<1>(GetParam());
Mat src(sz, matType);
int cnt = 0;
declare.in(src, WARMUP_RNG);
int runs = (sz.width <= 640) ? 8 : 1;
TEST_CYCLE_MULTIRUN(runs) cnt = countNonZero(src);
SANITY_CHECK(cnt);
}
} // namespace
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<rules>
<rule dir="IN" name="WEBHCAT/webhcat/root/inbound" pattern="*://*:*/**/templeton/v1/?{**}">
<rewrite template="{$serviceUrl[WEBHCAT]}/v1/?{**}"/>
</rule>
<rule dir="IN" name="WEBHCAT/webhcat/path/inbound" pattern="*://*:*/**/templeton/v1/{path=**}?{**}">
<rewrite template="{$serviceUrl[WEBHCAT]}/v1/{path=**}?{**}"/>
</rule>
</rules>
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// f32test/group/t_dircache.mmp
//
//
target t_dircache.exe
targettype exe
sourcepath ../server
source t_main.cpp t_dircache.cpp
sourcepath ../fileutils/src
source t_chlffs.cpp f32_test_utils.cpp fat_utils.cpp
library euser.lib efsrv.lib hal.lib efile.lib
OS_LAYER_SYSTEMINCLUDE_SYMBIAN
USERINCLUDE ../server
userinclude ../fileutils/inc
epocstacksize 0x4000
capability tcb diskadmin allfiles
vendorid 0x70000001
SMPSAFE
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* This file is part of the OpenPNE package.
* (c) OpenPNE Project (http://www.openpne.jp/)
*
* For the full copyright and license information, please view the LICENSE
* file and the NOTICE file that were distributed with this source code.
*/
/**
* opStandardRouteCollection
*
* @package OpenPNE
* @subpackage routing
* @author Kousuke Ebihara <ebihara@tejimaya.com>
*/
class opStandardRouteCollection extends sfDoctrineRouteCollection
{
public function __construct(array $options)
{
if (!empty($options['is_acl']))
{
$options['route_class'] = 'opDynamicAclRoute';
}
parent::__construct($options);
}
protected function getRouteForCollection($action, $methods)
{
return new $this->routeClass(
sprintf('%s/%s', $this->options['prefix_path'], $action),
array('module' => $this->options['module'], 'action' => $action, 'sf_format' => 'html'),
array_merge($this->options['requirements'], array('sf_method' => $methods)),
array('model' => $this->options['model'], 'type' => 'list', 'method' => $this->options['model_methods']['list'], 'privilege' => $this->getPrivilege($action))
);
}
protected function getRouteForObject($action, $methods)
{
return new $this->routeClass(
sprintf('%s/:%s/%s', $this->options['prefix_path'], $this->options['column'], $action),
array('module' => $this->options['module'], 'action' => $action, 'sf_format' => 'html'),
array_merge($this->options['requirements'], array('sf_method' => $methods)),
array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'], 'privilege' => $this->getPrivilege($action))
);
}
protected function getRouteForList()
{
return new $this->routeClass(
sprintf('%s', $this->options['prefix_path']),
array('module' => $this->options['module'], 'action' => $this->getActionMethod('list'), 'sf_format' => 'html'),
array_merge($this->options['requirements'], array('sf_method' => 'get')),
array('model' => $this->options['model'], 'type' => 'list', 'method' => $this->options['model_methods']['list'], 'privilege' => $this->getPrivilege('list'))
);
}
protected function getRouteForNew()
{
return new $this->routeClass(
sprintf('%s/%s', $this->options['prefix_path'], $this->options['segment_names']['new']),
array('module' => $this->options['module'], 'action' => $this->getActionMethod('new'), 'sf_format' => 'html'),
array_merge($this->options['requirements'], array('sf_method' => 'get')),
array('model' => $this->options['model'], 'type' => 'object', 'privilege' => $this->getPrivilege('create'))
);
}
protected function getRouteForCreate()
{
return new $this->routeClass(
sprintf('%s', $this->options['prefix_path']),
array('module' => $this->options['module'], 'action' => $this->getActionMethod('create'), 'sf_format' => 'html'),
array_merge($this->options['requirements'], array('sf_method' => 'post')),
array('model' => $this->options['model'], 'type' => 'object', 'privilege' => $this->getPrivilege('create'))
);
}
protected function getRouteForShow()
{
return new $this->routeClass(
sprintf('%s/:%s', $this->options['prefix_path'], $this->options['column']),
array('module' => $this->options['module'], 'action' => $this->getActionMethod('show'), 'sf_format' => 'html'),
array_merge($this->options['requirements'], array('sf_method' => 'get')),
array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'], 'privilege' => $this->getPrivilege('show'))
);
}
protected function getRouteForEdit()
{
return new $this->routeClass(
sprintf('%s/:%s/%s', $this->options['prefix_path'], $this->options['column'], $this->options['segment_names']['edit']),
array('module' => $this->options['module'], 'action' => $this->getActionMethod('edit'), 'sf_format' => 'html'),
array_merge($this->options['requirements'], array('sf_method' => 'get')),
array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'], 'privilege' => $this->getPrivilege('edit'))
);
}
protected function getRouteForUpdate()
{
return new $this->routeClass(
sprintf('%s/:%s', $this->options['prefix_path'], $this->options['column']),
array('module' => $this->options['module'], 'action' => $this->getActionMethod('update'), 'sf_format' => 'html'),
array_merge($this->options['requirements'], array('sf_method' => array('put', 'post'))),
array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'], 'privilege' => $this->getPrivilege('edit'))
);
}
protected function getRouteForDelete()
{
return new $this->routeClass(
sprintf('%s/:%s/delete', $this->options['prefix_path'], $this->options['column']),
array('module' => $this->options['module'], 'action' => $this->getActionMethod('delete'), 'sf_format' => 'html'),
array('sf_method' => array('post', 'delete')),
array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'], 'privilege' => $this->getPrivilege('delete'))
);
}
protected function getRouteForDeleteConfirm()
{
return new $this->routeClass(
sprintf('%s/:%s/%s', $this->options['prefix_path'], $this->options['column'], 'delete'),
array('module' => $this->options['module'], 'action' => $this->getActionMethod('deleteConfirm'), 'sf_format' => 'html'),
array('sf_method' => array('get')),
array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'], 'privilege' => $this->getPrivilege('delete'))
);
}
protected function getPrivilege($action)
{
$privileges = array(
'list' => 'view',
'show' => 'view',
'new' => 'create',
'create' => 'create',
'edit' => 'edit',
'update' => 'edit',
'delete' => 'delete',
'deleteConfirm' => 'delete',
);
if (isset($this->options['privileges']))
{
$privileges = array_merge($privileges, (array)$this->options['privileges']);
}
if (isset($privileges[$action]))
{
return $privileges[$action];
}
return null;
}
protected function getDefaultActions()
{
$actions = parent::getDefaultActions();
$actions[] = 'deleteConfirm';
return $actions;
}
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE, y MMMM dd",
"longDate": "y MMMM d",
"medium": "y MMM d HH:mm:ss",
"mediumDate": "y MMM d",
"mediumTime": "HH:mm:ss",
"short": "yyyy-MM-dd HH:mm",
"shortDate": "yyyy-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-iso",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
{
"pile_set_name": "Github"
}
|
/*
*
* Copyright 2014 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package credentials
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net"
"google.golang.org/grpc/credentials/internal"
)
// TLSInfo contains the auth information for a TLS authenticated connection.
// It implements the AuthInfo interface.
type TLSInfo struct {
State tls.ConnectionState
CommonAuthInfo
}
// AuthType returns the type of TLSInfo as a string.
func (t TLSInfo) AuthType() string {
return "tls"
}
// GetSecurityValue returns security info requested by channelz.
func (t TLSInfo) GetSecurityValue() ChannelzSecurityValue {
v := &TLSChannelzSecurityValue{
StandardName: cipherSuiteLookup[t.State.CipherSuite],
}
// Currently there's no way to get LocalCertificate info from tls package.
if len(t.State.PeerCertificates) > 0 {
v.RemoteCertificate = t.State.PeerCertificates[0].Raw
}
return v
}
// tlsCreds is the credentials required for authenticating a connection using TLS.
type tlsCreds struct {
// TLS configuration
config *tls.Config
}
func (c tlsCreds) Info() ProtocolInfo {
return ProtocolInfo{
SecurityProtocol: "tls",
SecurityVersion: "1.2",
ServerName: c.config.ServerName,
}
}
func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (_ net.Conn, _ AuthInfo, err error) {
// use local cfg to avoid clobbering ServerName if using multiple endpoints
cfg := cloneTLSConfig(c.config)
if cfg.ServerName == "" {
serverName, _, err := net.SplitHostPort(authority)
if err != nil {
// If the authority had no host port or if the authority cannot be parsed, use it as-is.
serverName = authority
}
cfg.ServerName = serverName
}
conn := tls.Client(rawConn, cfg)
errChannel := make(chan error, 1)
go func() {
errChannel <- conn.Handshake()
close(errChannel)
}()
select {
case err := <-errChannel:
if err != nil {
conn.Close()
return nil, nil, err
}
case <-ctx.Done():
conn.Close()
return nil, nil, ctx.Err()
}
return internal.WrapSyscallConn(rawConn, conn), TLSInfo{conn.ConnectionState(), CommonAuthInfo{PrivacyAndIntegrity}}, nil
}
func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) {
conn := tls.Server(rawConn, c.config)
if err := conn.Handshake(); err != nil {
conn.Close()
return nil, nil, err
}
return internal.WrapSyscallConn(rawConn, conn), TLSInfo{conn.ConnectionState(), CommonAuthInfo{PrivacyAndIntegrity}}, nil
}
func (c *tlsCreds) Clone() TransportCredentials {
return NewTLS(c.config)
}
func (c *tlsCreds) OverrideServerName(serverNameOverride string) error {
c.config.ServerName = serverNameOverride
return nil
}
const alpnProtoStrH2 = "h2"
func appendH2ToNextProtos(ps []string) []string {
for _, p := range ps {
if p == alpnProtoStrH2 {
return ps
}
}
ret := make([]string, 0, len(ps)+1)
ret = append(ret, ps...)
return append(ret, alpnProtoStrH2)
}
// NewTLS uses c to construct a TransportCredentials based on TLS.
func NewTLS(c *tls.Config) TransportCredentials {
tc := &tlsCreds{cloneTLSConfig(c)}
tc.config.NextProtos = appendH2ToNextProtos(tc.config.NextProtos)
return tc
}
// NewClientTLSFromCert constructs TLS credentials from the provided root
// certificate authority certificate(s) to validate server connections. If
// certificates to establish the identity of the client need to be included in
// the credentials (eg: for mTLS), use NewTLS instead, where a complete
// tls.Config can be specified.
// serverNameOverride is for testing only. If set to a non empty string,
// it will override the virtual host name of authority (e.g. :authority header
// field) in requests.
func NewClientTLSFromCert(cp *x509.CertPool, serverNameOverride string) TransportCredentials {
return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp})
}
// NewClientTLSFromFile constructs TLS credentials from the provided root
// certificate authority certificate file(s) to validate server connections. If
// certificates to establish the identity of the client need to be included in
// the credentials (eg: for mTLS), use NewTLS instead, where a complete
// tls.Config can be specified.
// serverNameOverride is for testing only. If set to a non empty string,
// it will override the virtual host name of authority (e.g. :authority header
// field) in requests.
func NewClientTLSFromFile(certFile, serverNameOverride string) (TransportCredentials, error) {
b, err := ioutil.ReadFile(certFile)
if err != nil {
return nil, err
}
cp := x509.NewCertPool()
if !cp.AppendCertsFromPEM(b) {
return nil, fmt.Errorf("credentials: failed to append certificates")
}
return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}), nil
}
// NewServerTLSFromCert constructs TLS credentials from the input certificate for server.
func NewServerTLSFromCert(cert *tls.Certificate) TransportCredentials {
return NewTLS(&tls.Config{Certificates: []tls.Certificate{*cert}})
}
// NewServerTLSFromFile constructs TLS credentials from the input certificate file and key
// file for server.
func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error) {
cert, err := tls.LoadX509KeyPair(certFile, keyFile)
if err != nil {
return nil, err
}
return NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}), nil
}
// TLSChannelzSecurityValue defines the struct that TLS protocol should return
// from GetSecurityValue(), containing security info like cipher and certificate used.
//
// This API is EXPERIMENTAL.
type TLSChannelzSecurityValue struct {
ChannelzSecurityValue
StandardName string
LocalCertificate []byte
RemoteCertificate []byte
}
var cipherSuiteLookup = map[uint16]string{
tls.TLS_RSA_WITH_RC4_128_SHA: "TLS_RSA_WITH_RC4_128_SHA",
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_RSA_WITH_3DES_EDE_CBC_SHA",
tls.TLS_RSA_WITH_AES_128_CBC_SHA: "TLS_RSA_WITH_AES_128_CBC_SHA",
tls.TLS_RSA_WITH_AES_256_CBC_SHA: "TLS_RSA_WITH_AES_256_CBC_SHA",
tls.TLS_RSA_WITH_AES_128_GCM_SHA256: "TLS_RSA_WITH_AES_128_GCM_SHA256",
tls.TLS_RSA_WITH_AES_256_GCM_SHA384: "TLS_RSA_WITH_AES_256_GCM_SHA384",
tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA: "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
tls.TLS_FALLBACK_SCSV: "TLS_FALLBACK_SCSV",
tls.TLS_RSA_WITH_AES_128_CBC_SHA256: "TLS_RSA_WITH_AES_128_CBC_SHA256",
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305",
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305",
}
// cloneTLSConfig returns a shallow clone of the exported
// fields of cfg, ignoring the unexported sync.Once, which
// contains a mutex and must not be copied.
//
// If cfg is nil, a new zero tls.Config is returned.
//
// TODO: inline this function if possible.
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
if cfg == nil {
return &tls.Config{}
}
return cfg.Clone()
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Database tools in PHP
*/
// 1. Create a new variable $query which holds the "SELECT * FROM person" query.
// Make sure to manually type the query and note the autocompletion support (use Ctrl+Space right after FROM).
$query = "";
// 2. Make the query a bit more complicated. Remember the JOIN smart completion? Use Ctrl+Shift+Space after the ON.
$query = "SELECT person.name, city.name as city, country.name as nationality
FROM person
INNER JOIN city ON person.city_id = city.city_id
INNER JOIN country ON ";
// 3. Alt+Enter on the above query and Run it in the Console.
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Waher.Persistence;
using Waher.Persistence.Files;
using Waher.Persistence.Serialization;
using Waher.Runtime.Inventory;
using Waher.Script.Objects.Matrices;
using Waher.Script.Objects.VectorSpaces;
using Waher.Script.Xml;
namespace Waher.Script.Test
{
[TestClass]
public class ScriptSqlTests
{
private static FilesProvider filesProvider = null;
[AssemblyInitialize]
public static async Task AssemblyInitialize(TestContext _)
{
Types.Initialize(typeof(Expression).Assembly,
typeof(Graphs.Graph).Assembly,
typeof(XmlParser).Assembly,
typeof(System.Text.RegularExpressions.Regex).Assembly,
typeof(Persistence.SQL.Select).Assembly,
typeof(ScriptSqlTests).Assembly,
typeof(Database).Assembly,
typeof(FilesProvider).Assembly,
typeof(ObjectSerializer).Assembly);
filesProvider = new FilesProvider("Data", "Default", 8192, 10000, 8192, Encoding.UTF8, 10000);
Database.Register(filesProvider);
await Database.Clear("Orders");
await Database.Clear("WebUsers");
await Database.Insert(new Data.Order()
{
OrderID = 1,
CustomerID = 2,
OrderDate = new DateTime(2020, 04, 30)
});
await Database.Insert(new Data.Order()
{
OrderID = 2,
CustomerID = 3,
OrderDate = new DateTime(2020, 05, 1)
});
await Database.Insert(new Data.Order()
{
OrderID = 3,
CustomerID = 4,
OrderDate = new DateTime(2020, 05, 2)
});
await Database.Clear("Customers");
await Database.Insert(new Data.Customer()
{
CustomerID = 1,
CustomerName = "P1",
ContactName = "CP1",
Country = "C1"
});
await Database.Insert(new Data.Customer()
{
CustomerID = 2,
CustomerName = "P2",
ContactName = "CP2",
Country = "C2"
});
await Database.Insert(new Data.Customer()
{
CustomerID = 3,
CustomerName = "P3",
ContactName = "CP3",
Country = "C2"
});
}
[AssemblyCleanup]
public static void AssemblyCleanup()
{
filesProvider?.Dispose();
filesProvider = null;
}
private void Test(string Script, object[][] ExpectedOutput)
{
Variables v = new Variables();
Expression Exp = new Expression(Script);
object Obj = Exp.Evaluate(v);
Console.Out.WriteLine(Expression.ToString(Obj));
ObjectMatrix M = Obj as ObjectMatrix;
int NrRows, RowIndex;
int NrColumns, ColumnIndex;
Assert.IsNotNull(M, "Object matrix expected.");
Assert.AreEqual(NrRows = ExpectedOutput.Length, M.Rows, "Number of rows in response incorrect.");
for (RowIndex = 0; RowIndex < NrRows; RowIndex++)
{
object[] ExpectedRow = ExpectedOutput[RowIndex];
ObjectVector Row = M.GetRow(RowIndex) as ObjectVector;
Assert.IsNotNull(Row, "Object row vector expected.");
Assert.AreEqual(NrColumns = ExpectedRow.Length, Row.Dimension, "Number of columns in response incorrect.");
for (ColumnIndex = 0; ColumnIndex < NrColumns; ColumnIndex++)
Assert.AreEqual(ExpectedRow[ColumnIndex], Row.GetElement(ColumnIndex).AssociatedObjectValue);
}
}
[TestMethod]
public void SELECT_Test_01_Orders()
{
this.Test("Select OrderID, CustomerID, OrderDate from Orders",
new object[][]
{
new object[] { 1d, 2d, new DateTime(2020, 4, 30) },
new object[] { 2d, 3d, new DateTime(2020, 5, 1) },
new object[] { 3d, 4d, new DateTime(2020, 5, 2) }
});
}
[TestMethod]
public void SELECT_Test_02_Orders_Typed()
{
this.Test("Select OrderID, CustomerID, OrderDate from Waher.Script.Test.Data.Order",
new object[][]
{
new object[] { 1d, 2d, new DateTime(2020, 4, 30) },
new object[] { 2d, 3d, new DateTime(2020, 5, 1) },
new object[] { 3d, 4d, new DateTime(2020, 5, 2) }
});
}
[TestMethod]
public void SELECT_Test_03_Customers()
{
this.Test("Select CustomerID, CustomerName, ContactName, Country from Customers",
new object[][]
{
new object[] { 1d, "P1", "CP1", "C1" },
new object[] { 2d, "P2", "CP2", "C2" },
new object[] { 3d, "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_04_Customers_Typed()
{
this.Test("Select CustomerID, CustomerName, ContactName, Country from Waher.Script.Test.Data.Customer as Customers",
new object[][]
{
new object[] { 1d, "P1", "CP1", "C1" },
new object[] { 2d, "P2", "CP2", "C2" },
new object[] { 3d, "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_05_INNER_JOIN()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders inner join Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_06_INNER_JOIN_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders inner join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_07_LEFT_OUTER_JOIN()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders left outer join Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null }
});
}
[TestMethod]
public void SELECT_Test_08_LEFT_OUTER_JOIN_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders left join Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null }
});
}
[TestMethod]
public void SELECT_Test_09_LEFT_OUTER_JOIN_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders left outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null }
});
}
[TestMethod]
public void SELECT_Test_10_LEFT_OUTER_JOIN_Typed_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders left join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null }
});
}
[TestMethod]
public void SELECT_Test_11_RIGHT_OUTER_JOIN()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders right outer join Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { null, null, "P1", "CP1", "C1" },
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_12_RIGHT_OUTER_JOIN_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders right join Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { null, null, "P1", "CP1", "C1" },
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_13_RIGHT_OUTER_JOIN_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders right outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { null, null, "P1", "CP1", "C1" },
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_14_RIGHT_OUTER_JOIN_Typed_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders right join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { null, null, "P1", "CP1", "C1" },
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_15_FULL_OUTER_JOIN()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders full outer join Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null },
new object[] { null, null, "P1", "CP1", "C1" }
});
}
[TestMethod]
public void SELECT_Test_16_FULL_OUTER_JOIN_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders full join Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null },
new object[] { null, null, "P1", "CP1", "C1" }
});
}
[TestMethod]
public void SELECT_Test_17_FULL_OUTER_JOIN_3()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null },
new object[] { null, null, "P1", "CP1", "C1" }
});
}
[TestMethod]
public void SELECT_Test_18_FULL_OUTER_JOIN_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders full outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null },
new object[] { null, null, "P1", "CP1", "C1" }
});
}
[TestMethod]
public void SELECT_Test_19_FULL_OUTER_JOIN_Typed_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders full join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null },
new object[] { null, null, "P1", "CP1", "C1" }
});
}
[TestMethod]
public void SELECT_Test_20_FULL_OUTER_JOIN_Typed_3()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 02), null, null, null },
new object[] { null, null, "P1", "CP1", "C1" }
});
}
[TestMethod]
public void SELECT_Test_21_CROSS_JOIN()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders, Customers where Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_22_CROSS_JOIN_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders, Customers",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P1", "CP1", "C1" },
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 1d, new DateTime(2020, 4, 30), "P3", "CP3", "C2" },
new object[] { 2d, new DateTime(2020, 5, 1), "P1", "CP1", "C1" },
new object[] { 2d, new DateTime(2020, 5, 1), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 1), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 2), "P1", "CP1", "C1" },
new object[] { 3d, new DateTime(2020, 5, 2), "P2", "CP2", "C2" },
new object[] { 3d, new DateTime(2020, 5, 2), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_23_CROSS_JOIN_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders, Waher.Script.Test.Data.Customer as Customers where Orders.CustomerID=Customers.CustomerID",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_24_CROSS_JOIN_Typed_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders, Waher.Script.Test.Data.Customer as Customers",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P1", "CP1", "C1" },
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" },
new object[] { 1d, new DateTime(2020, 4, 30), "P3", "CP3", "C2" },
new object[] { 2d, new DateTime(2020, 5, 1), "P1", "CP1", "C1" },
new object[] { 2d, new DateTime(2020, 5, 1), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 1), "P3", "CP3", "C2" },
new object[] { 3d, new DateTime(2020, 5, 2), "P1", "CP1", "C1" },
new object[] { 3d, new DateTime(2020, 5, 2), "P2", "CP2", "C2" },
new object[] { 3d, new DateTime(2020, 5, 2), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_25_Orders_WHERE()
{
this.Test("Select OrderID, CustomerID, OrderDate from Orders where OrderID=2",
new object[][]
{
new object[] { 2d, 3d, new DateTime(2020, 5, 1) }
});
}
[TestMethod]
public void SELECT_Test_26_Orders_WHERE_Typed()
{
this.Test("Select OrderID, CustomerID, OrderDate from Waher.Script.Test.Data.Order as Orders where OrderID=2",
new object[][]
{
new object[] { 2d, 3d, new DateTime(2020, 5, 1) }
});
}
[TestMethod]
public void SELECT_Test_27_Customers_WHERE()
{
this.Test("Select CustomerID, CustomerName, ContactName, Country from Customers where CustomerID=2",
new object[][]
{
new object[] { 2d, "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_28_Customers_WHERE_Typed()
{
this.Test("Select CustomerID, CustomerName, ContactName, Country from Waher.Script.Test.Data.Customer as Customers where CustomerID=2",
new object[][]
{
new object[] { 2d, "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_29_INNER_JOIN_WHERE()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders inner join Customers on Orders.CustomerID=Customers.CustomerID where OrderID=2",
new object[][]
{
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_30_INNER_JOIN_WHERE_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders inner join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID where OrderID=2",
new object[][]
{
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_31_LEFT_OUTER_JOIN_WHERE()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders left outer join Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_32_LEFT_OUTER_JOIN_WHERE_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders left join Customers on Orders.CustomerID=Customers.CustomerID where Orders.CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_33_LEFT_OUTER_JOIN_WHERE_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders left outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_34_LEFT_OUTER_JOIN_WHERE_Typed_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders left join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID where Orders.CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_35_RIGHT_OUTER_JOIN_WHERE()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders right outer join Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_36_RIGHT_OUTER_JOIN_WHERE_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders right join Customers on Orders.CustomerID=Customers.CustomerID where Customers.CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_37_RIGHT_OUTER_JOIN_WHERE_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders right outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_38_RIGHT_OUTER_JOIN_WHERE_Typed_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders right join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID where Customers.CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_39_FULL_OUTER_JOIN_WHERE()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders full outer join Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_40_FULL_OUTER_JOIN_WHERE_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders full join Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_41_FULL_OUTER_JOIN_3_WHERE()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders outer join Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_42_FULL_OUTER_JOIN_WHERE_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders full outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_43_FULL_OUTER_JOIN_WHERE_Typed_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders full join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_44_FULL_OUTER_JOIN_3_WHERE_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders outer join Waher.Script.Test.Data.Customer as Customers on Orders.CustomerID=Customers.CustomerID where CustomerID=2",
new object[][]
{
new object[] { 1d, new DateTime(2020, 4, 30), "P2", "CP2", "C2" }
});
}
[TestMethod]
public void SELECT_Test_45_CROSS_JOIN_WHERE()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders, Customers where Orders.CustomerID=Customers.CustomerID and OrderID=2",
new object[][]
{
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_46_CROSS_JOIN_WHERE_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Orders, Customers where Orders.OrderID=2",
new object[][]
{
new object[] { 2d, new DateTime(2020, 5, 1), "P1", "CP1", "C1" },
new object[] { 2d, new DateTime(2020, 5, 1), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 1), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_47_CROSS_JOIN_WHERE_Typed()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders, Waher.Script.Test.Data.Customer as Customers where Orders.CustomerID=Customers.CustomerID and OrderID=2",
new object[][]
{
new object[] { 2d, new DateTime(2020, 5, 01), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_48_CROSS_JOIN_WHERE_Typed_2()
{
this.Test("Select Orders.OrderID, Orders.OrderDate, Customers.CustomerName, Customers.ContactName, Customers.Country from Waher.Script.Test.Data.Order as Orders, Waher.Script.Test.Data.Customer as Customers where Orders.OrderID=2",
new object[][]
{
new object[] { 2d, new DateTime(2020, 5, 1), "P1", "CP1", "C1" },
new object[] { 2d, new DateTime(2020, 5, 1), "P2", "CP2", "C2" },
new object[] { 2d, new DateTime(2020, 5, 1), "P3", "CP3", "C2" }
});
}
[TestMethod]
public void SELECT_Test_49_SELF_JOIN()
{
this.Test("Select o1.OrderID, o1.CustomerID, o1.OrderDate, o2.OrderID, o2.CustomerID, o2.OrderDate from Orders o1 inner join Orders o2 on o1.OrderID=o2.CustomerID",
new object[][]
{
new object[] { 2d, 3d, new DateTime(2020, 5, 1), 1d, 2d, new DateTime(2020, 4, 30) },
new object[] { 3d, 4d, new DateTime(2020, 5, 2), 2d, 3d, new DateTime(2020, 5, 1) }
});
}
[TestMethod]
public void SELECT_Test_50_SELF_JOIN_2()
{
this.Test("Select o1.OrderID, o1.CustomerID, o1.OrderDate, o2.OrderID, o2.CustomerID, o2.OrderDate from Orders o1, Orders o2 where o1.OrderID=o2.CustomerID",
new object[][]
{
new object[] { 2d, 3d, new DateTime(2020, 5, 1), 1d, 2d, new DateTime(2020, 4, 30) },
new object[] { 3d, 4d, new DateTime(2020, 5, 2), 2d, 3d, new DateTime(2020, 5, 1) }
});
}
[TestMethod]
public void SELECT_Test_51_SELF_JOIN_Typed()
{
this.Test("Select o1.OrderID, o1.CustomerID, o1.OrderDate, o2.OrderID, o2.CustomerID, o2.OrderDate from Waher.Script.Test.Data.Order o1 inner join Waher.Script.Test.Data.Order o2 on o1.OrderID=o2.CustomerID",
new object[][]
{
new object[] { 2d, 3d, new DateTime(2020, 5, 1), 1d, 2d, new DateTime(2020, 4, 30) },
new object[] { 3d, 4d, new DateTime(2020, 5, 2), 2d, 3d, new DateTime(2020, 5, 1) }
});
}
[TestMethod]
public void SELECT_Test_52_SELF_JOIN_Typed_2()
{
this.Test("Select o1.OrderID, o1.CustomerID, o1.OrderDate, o2.OrderID, o2.CustomerID, o2.OrderDate from Waher.Script.Test.Data.Order o1, Waher.Script.Test.Data.Order o2 where o1.OrderID=o2.CustomerID",
new object[][]
{
new object[] { 2d, 3d, new DateTime(2020, 5, 1), 1d, 2d, new DateTime(2020, 4, 30) },
new object[] { 3d, 4d, new DateTime(2020, 5, 2), 2d, 3d, new DateTime(2020, 5, 1) }
});
}
[TestMethod]
public void SELECT_Test_53_JOIN_3_SOURCES()
{
this.Test("Select o1.OrderID, o1.CustomerID, o1.OrderDate, o2.OrderID, o2.CustomerID, o2.OrderDate, o3.OrderID, o3.CustomerID, o3.OrderDate from Orders o1 inner join Orders o2 on o1.OrderID=o2.CustomerID inner join Orders o3 on o2.OrderID=o3.CustomerID",
new object[][]
{
new object[] { 3d, 4d, new DateTime(2020, 5, 2), 2d, 3d, new DateTime(2020, 5, 1), 1d, 2d, new DateTime(2020, 4, 30) }
});
}
[TestMethod]
public void SELECT_Test_54_JOIN_3_SOURCES_2()
{
this.Test("Select o1.OrderID, o1.CustomerID, o1.OrderDate, o2.OrderID, o2.CustomerID, o2.OrderDate, o3.OrderID, o3.CustomerID, o3.OrderDate from Orders o1, Orders o2, Orders o3 where o1.OrderID=o2.CustomerID and o2.OrderID=o3.CustomerID",
new object[][]
{
new object[] { 3d, 4d, new DateTime(2020, 5, 2), 2d, 3d, new DateTime(2020, 5, 1), 1d, 2d, new DateTime(2020, 4, 30) }
});
}
[TestMethod]
public void SELECT_Test_55_JOIN_3_SOURCES_Typed()
{
this.Test("Select o1.OrderID, o1.CustomerID, o1.OrderDate, o2.OrderID, o2.CustomerID, o2.OrderDate, o3.OrderID, o3.CustomerID, o3.OrderDate from Waher.Script.Test.Data.Order o1 inner join Waher.Script.Test.Data.Order o2 on o1.OrderID=o2.CustomerID inner join Waher.Script.Test.Data.Order o3 on o2.OrderID=o3.CustomerID",
new object[][]
{
new object[] { 3d, 4d, new DateTime(2020, 5, 2), 2d, 3d, new DateTime(2020, 5, 1), 1d, 2d, new DateTime(2020, 4, 30) }
});
}
[TestMethod]
public void SELECT_Test_56_JOIN_3_SOURCES_Typed_2()
{
this.Test("Select o1.OrderID, o1.CustomerID, o1.OrderDate, o2.OrderID, o2.CustomerID, o2.OrderDate, o3.OrderID, o3.CustomerID, o3.OrderDate from Waher.Script.Test.Data.Order o1, Waher.Script.Test.Data.Order o2, Waher.Script.Test.Data.Order o3 where o1.OrderID=o2.CustomerID and o2.OrderID=o3.CustomerID",
new object[][]
{
new object[] { 3d, 4d, new DateTime(2020, 5, 2), 2d, 3d, new DateTime(2020, 5, 1), 1d, 2d, new DateTime(2020, 4, 30) }
});
}
[TestMethod]
public void SELECT_Test_57_Custom_Filters()
{
this.Test("Select OrderID, CustomerID, OrderDate from Orders where (OrderID & 1)=1",
new object[][]
{
new object[] { 1d, 2d, new DateTime(2020, 4, 30) },
new object[] { 3d, 4d, new DateTime(2020, 5, 2) }
});
}
[TestMethod]
public void SELECT_Test_58_Custom_Filters_Typed()
{
this.Test("Select OrderID, CustomerID, OrderDate from Waher.Script.Test.Data.Order where (OrderID & 1)=1",
new object[][]
{
new object[] { 1d, 2d, new DateTime(2020, 4, 30) },
new object[] { 3d, 4d, new DateTime(2020, 5, 2) }
});
}
[TestMethod]
public void INSERT_Test_01_INSERT_VALUES()
{
this.Test(
"insert into WebUsers (UserName, Password) values (\"User01\", \"Pwd01\");"+
"select UserName, Password from WebUsers where UserName=\"User01\" order by UserName",
new object[][]
{
new object[] { "User01", "Pwd01" }
});
}
[TestMethod]
public void INSERT_Test_02_INSERT_SELECT_Columns()
{
this.Test(
"ToStr(i):=i<10?\"0\"+i:i;" +
"insert into WebUsers select UserName, Password from [foreach i in 2..10 do {UserName:\"User\"+ToStr(i),Password:\"Pwd\"+ToStr(i)}];" +
"select UserName, Password from WebUsers where UserName>=\"User02\" and UserName<=\"User10\" order by UserName",
new object[][]
{
new object[] { "User02", "Pwd02" },
new object[] { "User03", "Pwd03" },
new object[] { "User04", "Pwd04" },
new object[] { "User05", "Pwd05" },
new object[] { "User06", "Pwd06" },
new object[] { "User07", "Pwd07" },
new object[] { "User08", "Pwd08" },
new object[] { "User09", "Pwd09" },
new object[] { "User10", "Pwd10" }
});
}
[TestMethod]
public void INSERT_Test_03_INSERT_SELECT_Objects()
{
this.Test(
"insert into WebUsers select * from [foreach i in 11..20 do {UserName:\"User\"+i,Password:\"Pwd\"+i}];" +
"select UserName, Password from WebUsers where UserName>=\"User11\" and UserName<=\"User20\" order by UserName",
new object[][]
{
new object[] { "User11", "Pwd11" },
new object[] { "User12", "Pwd12" },
new object[] { "User13", "Pwd13" },
new object[] { "User14", "Pwd14" },
new object[] { "User15", "Pwd15" },
new object[] { "User16", "Pwd16" },
new object[] { "User17", "Pwd17" },
new object[] { "User18", "Pwd18" },
new object[] { "User19", "Pwd19" },
new object[] { "User20", "Pwd20" }
});
}
[TestMethod]
public void INSERT_Test_04_INSERT_OBJECT()
{
this.Test(
"insert into WebUsers object {UserName:\"User21\",Password:\"Pwd21\"};" +
"select UserName, Password from WebUsers where UserName=\"User21\" order by UserName",
new object[][]
{
new object[] { "User21", "Pwd21" }
});
}
[TestMethod]
public void INSERT_Test_05_INSERT_OBJECTS_1()
{
this.Test(
"insert into WebUsers objects "+
"{UserName:\"User22\",Password:\"Pwd22\"}," +
"{UserName:\"User23\",Password:\"Pwd23\"}," +
"{UserName:\"User24\",Password:\"Pwd24\"};" +
"select UserName, Password from WebUsers where UserName>=\"User22\" and UserName<=\"User24\" order by UserName",
new object[][]
{
new object[] { "User22", "Pwd22" },
new object[] { "User23", "Pwd23" },
new object[] { "User24", "Pwd24" }
});
}
[TestMethod]
public void INSERT_Test_06_INSERT_OBJECTS_2()
{
this.Test(
"insert into WebUsers objects [foreach i in 25..27 do {UserName:\"User\"+i,Password:\"Pwd\"+i}];" +
"select UserName, Password from WebUsers where UserName>=\"User25\" and UserName<=\"User27\" order by UserName",
new object[][]
{
new object[] { "User25", "Pwd25" },
new object[] { "User26", "Pwd26" },
new object[] { "User27", "Pwd27" }
});
}
[TestMethod]
public void INSERT_Test_07_INSERT_OBJECTS_3()
{
this.Test(
"insert into WebUsers objects {foreach i in 28..30 do {UserName:\"User\"+i,Password:\"Pwd\"+i}};" +
"select UserName, Password from WebUsers where UserName>=\"User28\" and UserName<=\"User30\" order by UserName",
new object[][]
{
new object[] { "User28", "Pwd28" },
new object[] { "User29", "Pwd29" },
new object[] { "User30", "Pwd30" }
});
}
/* TODO:
* SELECT
* UNION
* GROUP BY
* HAVING
* ORDER BY
* TOP
* DISTINCT
* OFFSET
*/
}
}
|
{
"pile_set_name": "Github"
}
|
# This test is broken for cygwin. There is a future for it
CHPL_HOST_PLATFORM <= cygwin
|
{
"pile_set_name": "Github"
}
|
### Speaking proposal for Nordic Ruby 2016
*by Reginald Braithwaite*
# Optimism
I live with depression. In this talk I will share Dr. Martin Seligman's three techniques for reprogramming our brains to think optimistically, and explain how they have helped me feel better, accomplish more, and be a better member of the Ruby community. Whether you have ever struggled with your mood or not, they just might help you change your life.
(based on a talk I never gave, http://braythwayt.com/homoiconic/2009/05/01/optimism.html)
---
Comments? Suggestions? Please [file an issue](https://github.com/raganwald/presentations/issues/new). Thanks!
|
{
"pile_set_name": "Github"
}
|
// Binary Tree Postorder Traversal
// Morris后序遍历,时间复杂度O(n),空间复杂度O(1)
class Solution {
public:
vector<int> postorderTraversal(TreeNode *root) {
vector<int> result;
TreeNode dummy(-1);
TreeNode *cur, *prev = nullptr;
std::function < void(const TreeNode*)> visit =
[&result](const TreeNode *node){
result.push_back(node->val);
};
dummy.left = root;
cur = &dummy;
while (cur != nullptr) {
if (cur->left == nullptr) {
prev = cur; /* 必须要有 */
cur = cur->right;
} else {
TreeNode *node = cur->left;
while (node->right != nullptr && node->right != cur)
node = node->right;
if (node->right == nullptr) { /* 还没线索化,则建立线索 */
node->right = cur;
prev = cur; /* 必须要有 */
cur = cur->left;
} else { /* 已经线索化,则访问节点,并删除线索 */
visit_reverse(cur->left, prev, visit);
prev->right = nullptr;
prev = cur; /* 必须要有 */
cur = cur->right;
}
}
}
return result;
}
private:
// 逆转路径
static void reverse(TreeNode *from, TreeNode *to) {
TreeNode *x = from, *y = from->right, *z;
if (from == to) return;
while (x != to) {
z = y->right;
y->right = x;
x = y;
y = z;
}
}
// 访问逆转后的路径上的所有结点
static void visit_reverse(TreeNode* from, TreeNode *to,
std::function< void(const TreeNode*) >& visit) {
TreeNode *p = to;
reverse(from, to);
while (true) {
visit(p);
if (p == from)
break;
p = p->right;
}
reverse(to, from);
}
};
|
{
"pile_set_name": "Github"
}
|
/************************************************************************
* *
* XVI Olimpiada Informatyczna *
* *
* Zadanie: Kodowanie (KOD) *
* Plik: kods5.pas *
* Autor: Piotr Niedzwiedz *
* Opis: Rozwiazanie wolne O(n*L). Nie korzysta z faktu, ze *
* kody maja wspolne prefiksy. *
* *
*************************************************************************/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
#define FOR(I,A,B) for(int I=(A);I<=(B);++I)
#define FORD(I,A,B) for(int I=(A);I>=(B);--I)
#define REP(I,N) for(int I=0;I<(N);++I)
const int nmx=1500000;
int n,l,wh,lok;
int S[2][nmx],P[nmx],L[nmx],W[nmx];
bool wazny[nmx],synch[nmx];
int go(int v,int leaf,int lim=nmx){
static int Q[nmx];
int qh=0;
int w=L[leaf];
while(P[w] != -1 && lim>0){
lim--;
Q[qh++]=(S[0][P[w]]==w)?0:1;
w=P[w];
}
if (lim) lok=0;
while(qh--){
if(S[0][v]==0) v=0;
v=S[Q[qh]][v];
}
return v;
}
int main()
{
static char buf[3000002];
static int stos[nmx];
int m,h=1,z;
n=1;
P[0]=-1;
scanf("%d%s",&m,buf);
REP(i,m) switch(buf[i]){
case 'B':
h--;
break;
case 'X':
L[l++]=stos[h-1];
break;
default:
z=buf[i]-'0';
S[z][stos[h-1]]=n;
P[n]=stos[h-1];
stos[h++]=n++;
break;
}
REP(j,l){
int t;
int l=1;
lok=1;
for(;;){
t=go(0,j,l);
if(!lok) break;
l++;
if(!wazny[t]){
wazny[t]=1;
W[wh++]=t;
}
}
}
for(int i=0;i<wh;++i){
REP(j,l){
int t=go(W[i],j);
if(!wazny[t]){
wazny[t]=1;
W[wh++]=t;
}
}
}
REP(i,l) synch[L[i]]=1;
REP(i,n) if (wazny[i]) {
REP(j,l){
int t=go(i,j);
if (S[0][t]) synch[L[j]]=0;
}
}
int wynik=0;
REP(i,l) if(synch[L[i]]) wynik++;
printf("%d\n",wynik);
REP(i,l) if(synch[L[i]]) printf("%d\n",i+1);
return 0;
}
|
{
"pile_set_name": "Github"
}
|
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler">
<st:include page="/hudson/plugins/selenium/configuration/browser/AbstractSeleniumBrowser/config.jelly"
it="${it ?: d}"/>
<f:advanced>
<f:entry title="${%Firefox browser path}" field="binaryPath">
<f:textbox/>
</f:entry>
</f:advanced>
</j:jelly>
|
{
"pile_set_name": "Github"
}
|
<?php
/*********************************************************************************
* This file is part of Sentrifugo.
* Copyright (C) 2014 Sapplica
*
* Sentrifugo is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Sentrifugo 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 Sentrifugo. If not, see <http://www.gnu.org/licenses/>.
*
* Sentrifugo Support <support@sentrifugo.com>
********************************************************************************/
class Default_Model_Holidaydates extends Zend_Db_Table_Abstract
{
protected $_name = 'main_holidaydates';
protected $_primary = 'id';
public function getHolidayDatesData($sort, $by, $pageNo, $perPage,$searchQuery,$groupid='')
{
$where = "h.isactive = 1 AND hg.isactive=1";
if($groupid)
$where .= " AND h.groupid = ".$groupid." AND h.holidayyear between year(now())-1 and year(now())+1 ";
if($searchQuery)
$where .= " AND ".$searchQuery;
$db = Zend_Db_Table::getDefaultAdapter();
$groupData = $this->select()
->setIntegrityCheck(false)
->from(array('h'=>'main_holidaydates'),array('h.*','holidaydate'=>'DATE_FORMAT(holidaydate,"'.DATEFORMAT_MYSQL.'")'))
->joinLeft(array('hg'=>'main_holidaygroups'), 'hg.id=h.groupid',array('hg.groupname'))
->where($where)
->order("$by $sort")
->limitPage($pageNo, $perPage);
//echo $groupData ; exit;
return $groupData;
}
/* This function is common to manage holiday dates, My holiday calender , Employee holidays
Here differentiation is done based on objname.
*/
public function getGrid($sort,$by,$perPage,$pageNo,$searchData,$call,$dashboardcall,$objName,$unitId='',$userid='',$conText='')
{
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity()){
$loginUserId = $auth->getStorage()->read()->id;
}
$searchQuery = '';
$searchArray = array();
$data = array();
$dataTmp = array();
if($objName == 'holidaydates')
{
if($searchData != '' && $searchData!='undefined')
{
$searchValues = json_decode($searchData);
foreach($searchValues as $key => $val)
{
if($key == "description")
$searchQuery .= " h.".$key." like '%".$val."%' AND ";
else if($key == 'holidaydate')
$searchQuery .= " ".$key." like '%". sapp_Global::change_date($val,'database')."%' AND ";
else
$searchQuery .= " ".$key." like '%".$val."%' AND ";
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery," AND");
}
$tableFields = array('action'=>'Action','holidayname' => 'Holiday','groupname' => 'Holiday Group','holidaydate' => 'Date','description' => 'Description');
$tablecontent = $this->getHolidayDatesData($sort, $by, $pageNo, $perPage,$searchQuery,$unitId);
if(isset($unitId) && $unitId != '')
$formgrid = 'true';
else
$formgrid = '';
$dataTmp = array(
'sort' => $sort,
'by' => $by,
'pageNo' => $pageNo,
'perPage' => $perPage,
'tablecontent' => $tablecontent,
'objectname' => $objName,
'extra' => array(),
'tableheader' => $tableFields,
'jsGridFnName' => 'getAjaxgridData',
'jsFillFnName' => '',
'searchArray' => $searchArray,
'add' =>'add',
'formgrid' => $formgrid,
'unitId'=>$unitId,
'menuName'=>'Manage Holidays',
'call'=>$call,
'dashboardcall'=>$dashboardcall,
'search_filters' => array(
'holidaydate' => array('type' => 'datepicker'),
),
);
}
else if($objName == 'myholidaycalendar')
{
if($unitId == '' )
{
$employeesModel = new Default_Model_Employees();
$empholidaygroup = $employeesModel->getHolidayGroupForEmployee($loginUserId);
if(isset($empholidaygroup[0]['holiday_group']) && $empholidaygroup[0]['holiday_group'] != '')
{
$unitId = $empholidaygroup[0]['holiday_group'];
}
}
if($searchData != '' && $searchData!='undefined')
{
$searchValues = json_decode($searchData);
foreach($searchValues as $key => $val)
{
if($key == "description")
$searchQuery .= " h.".$key." like '%".$val."%' AND ";
else if($key == 'holidaydate')
$searchQuery .= " ".$key." like '%". sapp_Global::change_date($val,'database')."%' AND ";
else
$searchQuery .= " ".$key." like '%".$val."%' AND ";
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery," AND");
}
$tableFields = array('action'=>'Action','holidayname' => 'Holiday','holidaydate' => 'Date','description' => 'Description');
$tablecontent = $this->getHolidayDatesData($sort, $by, $pageNo, $perPage,$searchQuery,$unitId);
$dataTmp = array(
'sort' => $sort,
'by' => $by,
'pageNo' => $pageNo,
'perPage' => $perPage,
'tablecontent' => $tablecontent,
'objectname' => $objName,
'extra' => array(),
'tableheader' => $tableFields,
'jsGridFnName' => 'getAjaxgridData',
'jsFillFnName' => '',
'searchArray' => $searchArray,
'menuName'=>'My Holiday Calendar',
'add' =>'add',
'call'=>$call,
'dashboardcall'=>$dashboardcall,
'search_filters' => array(
'holidaydate' => array('type' => 'datepicker'),
),
);
}else if($objName == 'empholidays')
{
$groupname = '';
if($searchData != '' && $searchData!='undefined')
{
$searchValues = json_decode($searchData);
foreach($searchValues as $key => $val)
{
if($key == 'holidaydate')
{
$searchQuery .= " ".$key." like '%". sapp_Global::change_date($val,'database')."%' AND ";
}else if($key == "description")
$searchQuery .= " h.".$key." like '%".$val."%' AND ";
else
$searchQuery .= " ".$key." like '%".$val."%' AND ";
$searchArray[$key] = $val;
}
$searchQuery = rtrim($searchQuery," AND");
}
$tableFields = array('action'=>'Action','groupname' =>'Holiday Group','holidayname' => 'Holiday','holidaydate' => 'Date','description' => 'Description');
$tablecontent = $this->getHolidayDatesData($sort, $by, $pageNo, $perPage,$searchQuery,$unitId);
$holidaygroupModel = new Default_Model_Holidaygroups();
$groupnameArr = $holidaygroupModel->getParticularGroupData($unitId);
if(!empty($groupnameArr))
$groupname = $groupnameArr[0]['groupname'].' - Holidays';
else
$groupname = 'Holidays';
$dataTmp = array('userid'=>$userid,
'sort' => $sort,
'by' => $by,
'pageNo' => $pageNo,
'perPage' => $perPage,
'tablecontent' => $tablecontent,
'objectname' => $objName,
'extra' => array(),
'tableheader' => $tableFields,
'jsGridFnName' => 'getEmployeeAjaxgridData',
'jsFillFnName' => '',
'searchArray' => $searchArray,
'add'=>'add',
'menuName'=> $groupname,
'formgrid'=>'true',
'unitId'=>$userid,
'dashboardcall'=>$dashboardcall,
'call'=>$call,
'context'=>$conText,
'search_filters' => array(
'holidaydate' =>array('type'=>'datepicker')
)
);
}
return $dataTmp;
}
public function getsingleHolidayDatesData($id)
{
$db = Zend_Db_Table::getDefaultAdapter();
$query = "select * from main_holidaydates where id = ".$id." AND isactive = 1";
$result = $db->query($query)->fetch();
return $result;
}
public function SaveorUpdateHolidayDates($data, $where)
{
if($where != ''){
$this->update($data, $where);
return 'update';
} else {
$this->insert($data);
$id=$this->getAdapter()->lastInsertId('main_holidaydates');
return $id;
}
}
public function getParticularHolidayDateData($id)
{
$select = $this->select()
->setIntegrityCheck(false)
->from(array('h'=>'main_holidaydates'),array('h.*'))
->where('h.isactive = 1 AND h.id='.$id.' ');
return $this->fetchAll($select)->toArray();
}
public function getTotalGroupDataWithId($id)
{
$select = $this->select()
->setIntegrityCheck(false)
->from(array('d'=>'main_holidaydates'),array('count'=>'count(*)'))
->where('d.groupid = '.$id.' AND d.isactive = 1 '); //AND d.holidayyear = year(now())
return $this->fetchAll($select)->toArray();
}
//To get all holidays as list....
public function getHolidayDatesList()
{
$select = $this->select()
->setIntegrityCheck(false)
->from(array('h'=>'main_holidaydates'),array('h.holidaydate'))
->where('h.isactive = 1');
$holidayDates = $this->fetchAll($select)->toArray();
return $holidayDates;
}
public function getHolidayDatesListForGroup($groupid)
{
$select = $this->select()
->setIntegrityCheck(false)
->from(array('h'=>'main_holidaydates'),array('h.holidaydate','h.holidayname'))
->where('h.groupid = '.$groupid.' AND h.isactive = 1');
$holidayDates = $this->fetchAll($select)->toArray();
return $holidayDates;
}
public function getDuplicateHolidayName($holidayname,$groupid,$holidaydate)
{
$db = Zend_Db_Table::getDefaultAdapter();
$rows = $db->query("select count(*) as count from main_holidaydates where lower(holidayname) = lower('".$holidayname."') and groupid = ".$groupid." and holidaydate = '".$holidaydate."' and isactive = 1 ");
return $rows->fetchAll();
}
public function checkholidayname($holidayname,$groupid,$id='',$holidayyear ='')
{
$db = Zend_Db_Table::getDefaultAdapter();
if($id == '')
$rows = $db->query("select count(*) as count from main_holidaydates where lower(holidayname) = lower('".$holidayname."') and groupid = ".$groupid." and holidayyear=".$holidayyear." and isactive = 1 ");
else
$rows = $db->query("select count(*) as count from main_holidaydates where lower(holidayname) = lower('".$holidayname."') and groupid = ".$groupid." and holidayyear=".$holidayyear." and isactive = 1 and id != ".$id);
return $rows->fetchAll();
}
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Javadoc API documentation for Fresco." />
<link rel="shortcut icon" type="image/x-icon" href="../../../../../../favicon.ico" />
<title>
com.facebook.fresco.animation.drawable.animator - Fresco API
| Fresco
</title>
<link href="../../../../../../../assets/doclava-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../../../../../../../assets/customizations.css" rel="stylesheet" type="text/css" />
<script src="../../../../../../../assets/search_autocomplete.js" type="text/javascript"></script>
<script src="../../../../../../../assets/jquery-resizable.min.js" type="text/javascript"></script>
<script src="../../../../../../../assets/doclava-developer-docs.js" type="text/javascript"></script>
<script src="../../../../../../../assets/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
setToRoot("../../../../../../", "../../../../../../../assets/");
</script>
<script src="../../../../../../../assets/doclava-developer-reference.js" type="text/javascript"></script>
<script src="../../../../../../../assets/navtree_data.js" type="text/javascript"></script>
<script src="../../../../../../../assets/customizations.js" type="text/javascript"></script>
<noscript>
<style type="text/css">
html,body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
</head>
<body class="">
<div id="header">
<div id="headerLeft">
<span id="masthead-title"><a href="../../../../../../packages.html">Fresco</a></span>
</div>
<div id="headerRight">
<div id="search" >
<div id="searchForm">
<form accept-charset="utf-8" class="gsc-search-box"
onsubmit="return submit_search()">
<table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
<tr>
<td class="gsc-input">
<input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
title="search developer docs" name="q"
value="search developer docs"
onFocus="search_focus_changed(this, true)"
onBlur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../../../../')"
onkeyup="return search_changed(event, false, '../../../../../../')" />
<div id="search_filtered_div" class="no-display">
<table id="search_filtered" cellspacing=0>
</table>
</div>
</td>
<!-- <td class="gsc-search-button">
<input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
</td>
<td class="gsc-clear-button">
<div title="clear results" class="gsc-clear-button"> </div>
</td> -->
</tr></tbody>
</table>
</form>
</div><!-- searchForm -->
</div><!-- search -->
</div>
</div><!-- header -->
<div class="g-section g-tpl-240" id="body-content">
<div class="g-unit g-first side-nav-resizable" id="side-nav">
<div id="swapper">
<div id="nav-panels">
<div id="resize-packages-nav">
<div id="packages-nav">
<div id="index-links">
<a href="../../../../../../packages.html" >Packages</a> |
<a href="../../../../../../classes.html" >Classes</a>
</div>
<ul>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/animated/gif/package-summary.html">com.facebook.animated.gif</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/animated/giflite/package-summary.html">com.facebook.animated.giflite</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/animated/giflite/decoder/package-summary.html">com.facebook.animated.giflite.decoder</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/animated/giflite/draw/package-summary.html">com.facebook.animated.giflite.draw</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/animated/giflite/drawable/package-summary.html">com.facebook.animated.giflite.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/animated/webp/package-summary.html">com.facebook.animated.webp</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/animated/webpdrawable/package-summary.html">com.facebook.animated.webpdrawable</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/binaryresource/package-summary.html">com.facebook.binaryresource</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/cache/common/package-summary.html">com.facebook.cache.common</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/cache/disk/package-summary.html">com.facebook.cache.disk</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/callercontext/package-summary.html">com.facebook.callercontext</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/activitylistener/package-summary.html">com.facebook.common.activitylistener</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/disk/package-summary.html">com.facebook.common.disk</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/executors/package-summary.html">com.facebook.common.executors</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/file/package-summary.html">com.facebook.common.file</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/internal/package-summary.html">com.facebook.common.internal</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/lifecycle/package-summary.html">com.facebook.common.lifecycle</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/logging/package-summary.html">com.facebook.common.logging</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/media/package-summary.html">com.facebook.common.media</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/memory/package-summary.html">com.facebook.common.memory</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/references/package-summary.html">com.facebook.common.references</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/statfs/package-summary.html">com.facebook.common.statfs</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/streams/package-summary.html">com.facebook.common.streams</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/time/package-summary.html">com.facebook.common.time</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/util/package-summary.html">com.facebook.common.util</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/common/webp/package-summary.html">com.facebook.common.webp</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/datasource/package-summary.html">com.facebook.datasource</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawable/base/package-summary.html">com.facebook.drawable.base</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/backends/pipeline/package-summary.html">com.facebook.drawee.backends.pipeline</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/backends/pipeline/debug/package-summary.html">com.facebook.drawee.backends.pipeline.debug</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/backends/pipeline/info/package-summary.html">com.facebook.drawee.backends.pipeline.info</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/backends/pipeline/info/internal/package-summary.html">com.facebook.drawee.backends.pipeline.info.internal</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/components/package-summary.html">com.facebook.drawee.components</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/controller/package-summary.html">com.facebook.drawee.controller</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/debug/package-summary.html">com.facebook.drawee.debug</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/debug/listener/package-summary.html">com.facebook.drawee.debug.listener</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/drawable/package-summary.html">com.facebook.drawee.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/generic/package-summary.html">com.facebook.drawee.generic</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/gestures/package-summary.html">com.facebook.drawee.gestures</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/interfaces/package-summary.html">com.facebook.drawee.interfaces</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/span/package-summary.html">com.facebook.drawee.span</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/drawee/view/package-summary.html">com.facebook.drawee.view</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/backend/package-summary.html">com.facebook.fresco.animation.backend</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/bitmap/package-summary.html">com.facebook.fresco.animation.bitmap</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/bitmap/cache/package-summary.html">com.facebook.fresco.animation.bitmap.cache</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/bitmap/preparation/package-summary.html">com.facebook.fresco.animation.bitmap.preparation</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/bitmap/wrapper/package-summary.html">com.facebook.fresco.animation.bitmap.wrapper</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/drawable/package-summary.html">com.facebook.fresco.animation.drawable</a></li>
<li class="selected api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/drawable/animator/package-summary.html">com.facebook.fresco.animation.drawable.animator</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/factory/package-summary.html">com.facebook.fresco.animation.factory</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/animation/frame/package-summary.html">com.facebook.fresco.animation.frame</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/middleware/package-summary.html">com.facebook.fresco.middleware</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/fresco/ui/common/package-summary.html">com.facebook.fresco.ui.common</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imageformat/package-summary.html">com.facebook.imageformat</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/animated/base/package-summary.html">com.facebook.imagepipeline.animated.base</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/animated/factory/package-summary.html">com.facebook.imagepipeline.animated.factory</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/animated/impl/package-summary.html">com.facebook.imagepipeline.animated.impl</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/animated/util/package-summary.html">com.facebook.imagepipeline.animated.util</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/backends/okhttp3/package-summary.html">com.facebook.imagepipeline.backends.okhttp3</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/backends/volley/package-summary.html">com.facebook.imagepipeline.backends.volley</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/bitmaps/package-summary.html">com.facebook.imagepipeline.bitmaps</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/cache/package-summary.html">com.facebook.imagepipeline.cache</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/common/package-summary.html">com.facebook.imagepipeline.common</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/core/package-summary.html">com.facebook.imagepipeline.core</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/datasource/package-summary.html">com.facebook.imagepipeline.datasource</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/debug/package-summary.html">com.facebook.imagepipeline.debug</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/decoder/package-summary.html">com.facebook.imagepipeline.decoder</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/drawable/package-summary.html">com.facebook.imagepipeline.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/filter/package-summary.html">com.facebook.imagepipeline.filter</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/image/package-summary.html">com.facebook.imagepipeline.image</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/instrumentation/package-summary.html">com.facebook.imagepipeline.instrumentation</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/listener/package-summary.html">com.facebook.imagepipeline.listener</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/memory/package-summary.html">com.facebook.imagepipeline.memory</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/multiuri/package-summary.html">com.facebook.imagepipeline.multiuri</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/nativecode/package-summary.html">com.facebook.imagepipeline.nativecode</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/platform/package-summary.html">com.facebook.imagepipeline.platform</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/postprocessors/package-summary.html">com.facebook.imagepipeline.postprocessors</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/producers/package-summary.html">com.facebook.imagepipeline.producers</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/request/package-summary.html">com.facebook.imagepipeline.request</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/systrace/package-summary.html">com.facebook.imagepipeline.systrace</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/transcoder/package-summary.html">com.facebook.imagepipeline.transcoder</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imagepipeline/transformation/package-summary.html">com.facebook.imagepipeline.transformation</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/imageutils/package-summary.html">com.facebook.imageutils</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/webpsupport/package-summary.html">com.facebook.webpsupport</a></li>
<li class="api apilevel-">
<a href="../../../../../../com/facebook/widget/text/span/package-summary.html">com.facebook.widget.text.span</a></li>
</ul><br/>
</div> <!-- end packages -->
</div> <!-- end resize-packages -->
<div id="classes-nav">
<ul>
<li><h2>Classes</h2>
<ul>
<li class="api apilevel-"><a href="../../../../../../com/facebook/fresco/animation/drawable/animator/AnimatedDrawable2ValueAnimatorHelper.html">AnimatedDrawable2ValueAnimatorHelper</a></li>
<li class="api apilevel-"><a href="../../../../../../com/facebook/fresco/animation/drawable/animator/AnimatedDrawableValueAnimatorHelper.html">AnimatedDrawableValueAnimatorHelper</a></li>
</ul>
</li>
</ul><br/>
</div><!-- end classes -->
</div><!-- end nav-panels -->
<div id="nav-tree" style="display:none">
<div id="index-links">
<a href="../../../../../../packages.html" >Packages</a> |
<a href="../../../../../../classes.html" >Classes</a>
</div>
</div><!-- end nav-tree -->
</div><!-- end swapper -->
</div> <!-- end side-nav -->
<script>
if (!isMobile) {
//$("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav");
chooseDefaultNav();
if ($("#nav-tree").is(':visible')) {
init_default_navtree("../../../../../../");
} else {
addLoadEvent(function() {
scrollIntoView("packages-nav");
scrollIntoView("classes-nav");
});
}
//$("#swapper").css({borderBottom:"2px solid #aaa"});
} else {
swapNav(); // tree view should be used on mobile
}
</script>
<div class="g-unit" id="doc-content">
<div id="api-info-block">
<div class="api-level">
</div>
</div>
<div id="jd-header">
package
<h1>com.facebook.fresco.animation.drawable.animator</h1>
</div><!-- end header -->
<div id="naMessage"></div>
<div id="jd-content" class="api apilevel-">
<h2>Classes</h2>
<div class="jd-sumtable">
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../../../com/facebook/fresco/animation/drawable/animator/AnimatedDrawable2ValueAnimatorHelper.html">AnimatedDrawable2ValueAnimatorHelper</a></td>
<td class="jd-descrcol" width="100%">Helper class to create ValueAnimators for <code><a href="../../../../../../com/facebook/fresco/animation/drawable/AnimatedDrawable2.html">AnimatedDrawable2</a></code>. </td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol"><a href="../../../../../../com/facebook/fresco/animation/drawable/animator/AnimatedDrawableValueAnimatorHelper.html">AnimatedDrawableValueAnimatorHelper</a></td>
<td class="jd-descrcol" width="100%">Helper class to create ValueAnimators for animated drawables. </td>
</tr>
</table>
</div>
<div id="footer">
+Generated by <a href="http://code.google.com/p/doclava/">Doclava</a>.
+</div> <!-- end footer - @generated -->
</div><!-- end jd-content -->
</div><!-- doc-content -->
</div> <!-- end body-content -->
<script type="text/javascript">
init(); /* initialize doclava-developer-docs.js */
</script>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Aws.ApiGatewayV2
{
/// <summary>
/// Manages an Amazon API Gateway Version 2 route response.
/// More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html).
///
/// ## Example Usage
/// ### Basic
///
/// ```csharp
/// using Pulumi;
/// using Aws = Pulumi.Aws;
///
/// class MyStack : Stack
/// {
/// public MyStack()
/// {
/// var example = new Aws.ApiGatewayV2.RouteResponse("example", new Aws.ApiGatewayV2.RouteResponseArgs
/// {
/// ApiId = aws_apigatewayv2_api.Example.Id,
/// RouteId = aws_apigatewayv2_route.Example.Id,
/// RouteResponseKey = "$default",
/// });
/// }
///
/// }
/// ```
/// </summary>
public partial class RouteResponse : Pulumi.CustomResource
{
/// <summary>
/// The API identifier.
/// </summary>
[Output("apiId")]
public Output<string> ApiId { get; private set; } = null!;
/// <summary>
/// The [model selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-model-selection-expressions) for the route response.
/// </summary>
[Output("modelSelectionExpression")]
public Output<string?> ModelSelectionExpression { get; private set; } = null!;
/// <summary>
/// The response models for the route response.
/// </summary>
[Output("responseModels")]
public Output<ImmutableDictionary<string, string>?> ResponseModels { get; private set; } = null!;
/// <summary>
/// The identifier of the `aws.apigatewayv2.Route`.
/// </summary>
[Output("routeId")]
public Output<string> RouteId { get; private set; } = null!;
/// <summary>
/// The route response key.
/// </summary>
[Output("routeResponseKey")]
public Output<string> RouteResponseKey { get; private set; } = null!;
/// <summary>
/// Create a RouteResponse resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public RouteResponse(string name, RouteResponseArgs args, CustomResourceOptions? options = null)
: base("aws:apigatewayv2/routeResponse:RouteResponse", name, args ?? new RouteResponseArgs(), MakeResourceOptions(options, ""))
{
}
private RouteResponse(string name, Input<string> id, RouteResponseState? state = null, CustomResourceOptions? options = null)
: base("aws:apigatewayv2/routeResponse:RouteResponse", name, state, MakeResourceOptions(options, id))
{
}
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
/// <summary>
/// Get an existing RouteResponse resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
/// </summary>
///
/// <param name="name">The unique name of the resulting resource.</param>
/// <param name="id">The unique provider ID of the resource to lookup.</param>
/// <param name="state">Any extra arguments used during the lookup.</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public static RouteResponse Get(string name, Input<string> id, RouteResponseState? state = null, CustomResourceOptions? options = null)
{
return new RouteResponse(name, id, state, options);
}
}
public sealed class RouteResponseArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The API identifier.
/// </summary>
[Input("apiId", required: true)]
public Input<string> ApiId { get; set; } = null!;
/// <summary>
/// The [model selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-model-selection-expressions) for the route response.
/// </summary>
[Input("modelSelectionExpression")]
public Input<string>? ModelSelectionExpression { get; set; }
[Input("responseModels")]
private InputMap<string>? _responseModels;
/// <summary>
/// The response models for the route response.
/// </summary>
public InputMap<string> ResponseModels
{
get => _responseModels ?? (_responseModels = new InputMap<string>());
set => _responseModels = value;
}
/// <summary>
/// The identifier of the `aws.apigatewayv2.Route`.
/// </summary>
[Input("routeId", required: true)]
public Input<string> RouteId { get; set; } = null!;
/// <summary>
/// The route response key.
/// </summary>
[Input("routeResponseKey", required: true)]
public Input<string> RouteResponseKey { get; set; } = null!;
public RouteResponseArgs()
{
}
}
public sealed class RouteResponseState : Pulumi.ResourceArgs
{
/// <summary>
/// The API identifier.
/// </summary>
[Input("apiId")]
public Input<string>? ApiId { get; set; }
/// <summary>
/// The [model selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-model-selection-expressions) for the route response.
/// </summary>
[Input("modelSelectionExpression")]
public Input<string>? ModelSelectionExpression { get; set; }
[Input("responseModels")]
private InputMap<string>? _responseModels;
/// <summary>
/// The response models for the route response.
/// </summary>
public InputMap<string> ResponseModels
{
get => _responseModels ?? (_responseModels = new InputMap<string>());
set => _responseModels = value;
}
/// <summary>
/// The identifier of the `aws.apigatewayv2.Route`.
/// </summary>
[Input("routeId")]
public Input<string>? RouteId { get; set; }
/// <summary>
/// The route response key.
/// </summary>
[Input("routeResponseKey")]
public Input<string>? RouteResponseKey { get; set; }
public RouteResponseState()
{
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Copyright (C) 2018 Spring Signage Ltd
*
* This file is part of Xibo.
*
* Xibo 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
* any later version.
*
* Xibo 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 Xibo. If not, see <http://www.gnu.org/licenses/>.
*/
use Phinx\Migration\AbstractMigration;
/**
* Class AddWidgetSyncTaskMigration
*/
class AddWidgetSyncTaskMigration extends AbstractMigration
{
/** @inheritdoc */
public function change()
{
// Check to see if the mail_from_name setting exists
if (!$this->fetchRow('SELECT * FROM `task` WHERE name = \'Widget Sync\'')) {
$this->execute('INSERT INTO `task` SET `name`=\'Widget Sync\', `class`=\'\\\\Xibo\\\\XTR\\\\WidgetSyncTask\', `status`=2, `isActive`=1, `configFile`=\'/tasks/widget-sync.task\', `options`=\'{}\', `schedule`=\'*/3 * * * *\';');
}
}
}
|
{
"pile_set_name": "Github"
}
|
/* $OpenBSD: rsa.h,v 1.51 2019/11/04 12:30:56 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_RSA_H
#define HEADER_RSA_H
#include <openssl/opensslconf.h>
#include <openssl/asn1.h>
#ifndef OPENSSL_NO_BIO
#include <openssl/bio.h>
#endif
#include <openssl/crypto.h>
#include <openssl/ossl_typ.h>
#ifndef OPENSSL_NO_DEPRECATED
#include <openssl/bn.h>
#endif
#ifdef OPENSSL_NO_RSA
#error RSA is disabled.
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Declared already in ossl_typ.h */
/* typedef struct rsa_st RSA; */
/* typedef struct rsa_meth_st RSA_METHOD; */
typedef struct rsa_pss_params_st {
X509_ALGOR *hashAlgorithm;
X509_ALGOR *maskGenAlgorithm;
ASN1_INTEGER *saltLength;
ASN1_INTEGER *trailerField;
/* Hash algorithm decoded from maskGenAlgorithm. */
X509_ALGOR *maskHash;
} RSA_PSS_PARAMS;
typedef struct rsa_oaep_params_st {
X509_ALGOR *hashFunc;
X509_ALGOR *maskGenFunc;
X509_ALGOR *pSourceFunc;
/* Hash algorithm decoded from maskGenFunc. */
X509_ALGOR *maskHash;
} RSA_OAEP_PARAMS;
struct rsa_meth_st {
const char *name;
int (*rsa_pub_enc)(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
int (*rsa_pub_dec)(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
int (*rsa_priv_enc)(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
int (*rsa_priv_dec)(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
int (*rsa_mod_exp)(BIGNUM *r0, const BIGNUM *I, RSA *rsa,
BN_CTX *ctx); /* Can be null */
int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); /* Can be null */
int (*init)(RSA *rsa); /* called at new */
int (*finish)(RSA *rsa); /* called at free */
int flags; /* RSA_METHOD_FLAG_* things */
char *app_data; /* may be needed! */
/* New sign and verify functions: some libraries don't allow arbitrary data
* to be signed/verified: this allows them to be used. Note: for this to work
* the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used
* RSA_sign(), RSA_verify() should be used instead. Note: for backwards
* compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER
* option is set in 'flags'.
*/
int (*rsa_sign)(int type, const unsigned char *m, unsigned int m_length,
unsigned char *sigret, unsigned int *siglen, const RSA *rsa);
int (*rsa_verify)(int dtype, const unsigned char *m,
unsigned int m_length, const unsigned char *sigbuf,
unsigned int siglen, const RSA *rsa);
/* If this callback is NULL, the builtin software RSA key-gen will be used. This
* is for behavioural compatibility whilst the code gets rewired, but one day
* it would be nice to assume there are no such things as "builtin software"
* implementations. */
int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
};
struct rsa_st {
/* The first parameter is used to pickup errors where
* this is passed instead of aEVP_PKEY, it is set to 0 */
int pad;
long version;
const RSA_METHOD *meth;
/* functional reference if 'meth' is ENGINE-provided */
ENGINE *engine;
BIGNUM *n;
BIGNUM *e;
BIGNUM *d;
BIGNUM *p;
BIGNUM *q;
BIGNUM *dmp1;
BIGNUM *dmq1;
BIGNUM *iqmp;
/* Parameter restrictions for PSS only keys. */
RSA_PSS_PARAMS *pss;
/* be careful using this if the RSA structure is shared */
CRYPTO_EX_DATA ex_data;
int references;
int flags;
/* Used to cache montgomery values */
BN_MONT_CTX *_method_mod_n;
BN_MONT_CTX *_method_mod_p;
BN_MONT_CTX *_method_mod_q;
/* all BIGNUM values are actually in the following data, if it is not
* NULL */
BN_BLINDING *blinding;
BN_BLINDING *mt_blinding;
};
#ifndef OPENSSL_RSA_MAX_MODULUS_BITS
# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
#endif
#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
#endif
#ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
# define OPENSSL_RSA_MAX_PUBEXP_BITS 64 /* exponent limit enforced for "large" modulus only */
#endif
#define RSA_3 0x3L
#define RSA_F4 0x10001L
/* Don't check pub/private match. */
#define RSA_METHOD_FLAG_NO_CHECK 0x0001
#define RSA_FLAG_CACHE_PUBLIC 0x0002
#define RSA_FLAG_CACHE_PRIVATE 0x0004
#define RSA_FLAG_BLINDING 0x0008
#define RSA_FLAG_THREAD_SAFE 0x0010
/*
* This flag means the private key operations will be handled by rsa_mod_exp
* and that they do not depend on the private key components being present:
* for example a key stored in external hardware. Without this flag bn_mod_exp
* gets called when private key components are absent.
*/
#define RSA_FLAG_EXT_PKEY 0x0020
/*
* This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify functions.
*/
#define RSA_FLAG_SIGN_VER 0x0040
/*
* The built-in RSA implementation uses blinding by default, but other engines
* might not need it.
*/
#define RSA_FLAG_NO_BLINDING 0x0080
/* Salt length matches digest */
#define RSA_PSS_SALTLEN_DIGEST -1
/* Verify only: auto detect salt length */
#define RSA_PSS_SALTLEN_AUTO -2
/* Set salt length to maximum possible */
#define RSA_PSS_SALTLEN_MAX -3
#define EVP_PKEY_CTX_set_rsa_padding(ctx, pad) \
RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_RSA_PADDING, pad, NULL)
#define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \
RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad)
#define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \
RSA_pkey_ctx_ctrl(ctx, (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \
EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL)
#define EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(ctx, len) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, \
EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL)
#define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \
RSA_pkey_ctx_ctrl(ctx, (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \
EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, 0, plen)
#define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \
RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, \
EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL)
#define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp) \
RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, \
EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp)
#define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \
RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \
EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md))
#define EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(ctx, md) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, \
EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md))
#define EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)(md))
#define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \
RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \
EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)(pmd))
#define EVP_PKEY_CTX_get_rsa_oaep_md(ctx, pmd) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void *)(pmd))
#define EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, l, llen) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
EVP_PKEY_CTRL_RSA_OAEP_LABEL, llen, (void *)(l))
#define EVP_PKEY_CTX_get0_rsa_oaep_label(ctx, l) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, (void *)(l))
#define EVP_PKEY_CTX_set_rsa_pss_keygen_md(ctx, md) \
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, \
EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_MD, 0, (void *)(md))
#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1)
#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2)
#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3)
#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)
#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5)
#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6)
#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7)
#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8)
#define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9)
#define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10)
#define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11)
#define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12)
#define RSA_PKCS1_PADDING 1
#define RSA_SSLV23_PADDING 2
#define RSA_NO_PADDING 3
#define RSA_PKCS1_OAEP_PADDING 4
#define RSA_X931_PADDING 5
/* EVP_PKEY_ only */
#define RSA_PKCS1_PSS_PADDING 6
#define RSA_PKCS1_PADDING_SIZE 11
#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
#define RSA_get_app_data(s) RSA_get_ex_data(s,0)
RSA *RSA_new(void);
RSA *RSA_new_method(ENGINE *engine);
int RSA_bits(const RSA *rsa);
int RSA_size(const RSA *rsa);
/* Deprecated version */
#ifndef OPENSSL_NO_DEPRECATED
RSA *RSA_generate_key(int bits, unsigned long e,
void (*callback)(int, int, void *), void *cb_arg);
#endif /* !defined(OPENSSL_NO_DEPRECATED) */
/* New version */
int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
int RSA_check_key(const RSA *);
/* next 4 return -1 on error */
int RSA_public_encrypt(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
int RSA_private_encrypt(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
int RSA_public_decrypt(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
int RSA_private_decrypt(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
void RSA_free(RSA *r);
/* "up" the RSA object's reference count */
int RSA_up_ref(RSA *r);
int RSA_flags(const RSA *r);
void RSA_set_default_method(const RSA_METHOD *meth);
const RSA_METHOD *RSA_get_default_method(void);
const RSA_METHOD *RSA_get_method(const RSA *rsa);
int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
const RSA_METHOD *RSA_PKCS1_OpenSSL(void);
const RSA_METHOD *RSA_PKCS1_SSLeay(void);
const RSA_METHOD *RSA_null_method(void);
int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2);
RSA *d2i_RSAPublicKey(RSA **a, const unsigned char **in, long len);
int i2d_RSAPublicKey(const RSA *a, unsigned char **out);
extern const ASN1_ITEM RSAPublicKey_it;
RSA *d2i_RSAPrivateKey(RSA **a, const unsigned char **in, long len);
int i2d_RSAPrivateKey(const RSA *a, unsigned char **out);
extern const ASN1_ITEM RSAPrivateKey_it;
RSA_PSS_PARAMS *RSA_PSS_PARAMS_new(void);
void RSA_PSS_PARAMS_free(RSA_PSS_PARAMS *a);
RSA_PSS_PARAMS *d2i_RSA_PSS_PARAMS(RSA_PSS_PARAMS **a, const unsigned char **in, long len);
int i2d_RSA_PSS_PARAMS(RSA_PSS_PARAMS *a, unsigned char **out);
extern const ASN1_ITEM RSA_PSS_PARAMS_it;
RSA_OAEP_PARAMS *RSA_OAEP_PARAMS_new(void);
void RSA_OAEP_PARAMS_free(RSA_OAEP_PARAMS *a);
RSA_OAEP_PARAMS *d2i_RSA_OAEP_PARAMS(RSA_OAEP_PARAMS **a, const unsigned char **in, long len);
int i2d_RSA_OAEP_PARAMS(RSA_OAEP_PARAMS *a, unsigned char **out);
extern const ASN1_ITEM RSA_OAEP_PARAMS_it;
int RSA_print_fp(FILE *fp, const RSA *r, int offset);
#ifndef OPENSSL_NO_BIO
int RSA_print(BIO *bp, const RSA *r, int offset);
#endif
#ifndef OPENSSL_NO_RC4
int i2d_RSA_NET(const RSA *a, unsigned char **pp,
int (*cb)(char *buf, int len, const char *prompt, int verify), int sgckey);
RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
int (*cb)(char *buf, int len, const char *prompt, int verify), int sgckey);
int i2d_Netscape_RSA(const RSA *a, unsigned char **pp,
int (*cb)(char *buf, int len, const char *prompt, int verify));
RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length,
int (*cb)(char *buf, int len, const char *prompt, int verify));
#endif
/* The following 2 functions sign and verify a X509_SIG ASN1 object
* inside PKCS#1 padded RSA encryption */
int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
int RSA_verify(int type, const unsigned char *m, unsigned int m_length,
const unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
/* The following 2 function sign and verify a ASN1_OCTET_STRING
* object inside PKCS#1 padded RSA encryption */
int RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m,
unsigned int m_length, unsigned char *sigret, unsigned int *siglen,
RSA *rsa);
int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m,
unsigned int m_length, unsigned char *sigbuf, unsigned int siglen,
RSA *rsa);
int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
void RSA_blinding_off(RSA *rsa);
BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
const unsigned char *f, int fl);
int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
const unsigned char *f, int fl, int rsa_len);
int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
const unsigned char *f, int fl);
int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
const unsigned char *f, int fl, int rsa_len);
int PKCS1_MGF1(unsigned char *mask, long len,
const unsigned char *seed, long seedlen, const EVP_MD *dgst);
int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
const unsigned char *f, int fl,
const unsigned char *p, int pl);
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
const unsigned char *f, int fl, int rsa_len,
const unsigned char *p, int pl);
int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
const unsigned char *from, int flen, const unsigned char *param, int plen,
const EVP_MD *md, const EVP_MD *mgf1md);
int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
const unsigned char *from, int flen, int num, const unsigned char *param,
int plen, const EVP_MD *md, const EVP_MD *mgf1md);
int RSA_padding_add_none(unsigned char *to, int tlen,
const unsigned char *f, int fl);
int RSA_padding_check_none(unsigned char *to, int tlen,
const unsigned char *f, int fl, int rsa_len);
int RSA_padding_add_X931(unsigned char *to, int tlen,
const unsigned char *f, int fl);
int RSA_padding_check_X931(unsigned char *to, int tlen,
const unsigned char *f, int fl, int rsa_len);
int RSA_X931_hash_id(int nid);
int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
const EVP_MD *Hash, const unsigned char *EM, int sLen);
int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
const unsigned char *mHash, const EVP_MD *Hash, int sLen);
int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
const EVP_MD *Hash, const EVP_MD *mgf1Hash, const unsigned char *EM,
int sLen);
int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
const unsigned char *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash,
int sLen);
int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int RSA_set_ex_data(RSA *r, int idx, void *arg);
void *RSA_get_ex_data(const RSA *r, int idx);
void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e,
const BIGNUM **d);
int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1,
const BIGNUM **iqmp);
int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q);
int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
void RSA_clear_flags(RSA *r, int flags);
int RSA_test_flags(const RSA *r, int flags);
void RSA_set_flags(RSA *r, int flags);
RSA *RSAPublicKey_dup(RSA *rsa);
RSA *RSAPrivateKey_dup(RSA *rsa);
/* If this flag is set the RSA method is FIPS compliant and can be used
* in FIPS mode. This is set in the validated module method. If an
* application sets this flag in its own methods it is its responsibility
* to ensure the result is compliant.
*/
#define RSA_FLAG_FIPS_METHOD 0x0400
/* If this flag is set the operations normally disabled in FIPS mode are
* permitted it is then the applications responsibility to ensure that the
* usage is compliant.
*/
#define RSA_FLAG_NON_FIPS_ALLOW 0x0400
/* Application has decided PRNG is good enough to generate a key: don't
* check.
*/
#define RSA_FLAG_CHECKED 0x0800
RSA_METHOD *RSA_meth_new(const char *name, int flags);
void RSA_meth_free(RSA_METHOD *meth);
RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth);
int RSA_meth_set1_name(RSA_METHOD *meth, const char *name);
int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen,
const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen,
const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa);
int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa));
int RSA_meth_set_pub_enc(RSA_METHOD *meth, int (*pub_enc)(int flen,
const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
int RSA_meth_set_pub_dec(RSA_METHOD *meth, int (*pub_dec)(int flen,
const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
int RSA_meth_set_mod_exp(RSA_METHOD *meth, int (*mod_exp)(BIGNUM *r0,
const BIGNUM *i, RSA *rsa, BN_CTX *ctx));
int RSA_meth_set_bn_mod_exp(RSA_METHOD *meth, int (*bn_mod_exp)(BIGNUM *r,
const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
BN_MONT_CTX *m_ctx));
int RSA_meth_set_init(RSA_METHOD *meth, int (*init)(RSA *rsa));
int RSA_meth_set_keygen(RSA_METHOD *meth, int (*keygen)(RSA *rsa, int bits,
BIGNUM *e, BN_GENCB *cb));
int RSA_meth_set_flags(RSA_METHOD *meth, int flags);
int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data);
const char *RSA_meth_get0_name(const RSA_METHOD *);
int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth))(int flen,
const unsigned char *from, unsigned char *to, RSA *rsa, int padding);
int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth))(int flen,
const unsigned char *from, unsigned char *to, RSA *rsa, int padding);
int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))(int flen,
const unsigned char *from, unsigned char *to, RSA *rsa, int padding);
int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth))(int flen,
const unsigned char *from, unsigned char *to, RSA *rsa, int padding);
int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth))(BIGNUM *r0, const BIGNUM *i,
RSA *rsa, BN_CTX *ctx);
int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))(BIGNUM *r,
const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
BN_MONT_CTX *m_ctx);
int (*RSA_meth_get_init(const RSA_METHOD *meth))(RSA *rsa);
int (*RSA_meth_get_keygen(const RSA_METHOD *meth))(RSA *rsa, int bits, BIGNUM *e,
BN_GENCB *cb);
int RSA_meth_get_flags(const RSA_METHOD *meth);
void *RSA_meth_get0_app_data(const RSA_METHOD *meth);
int (*RSA_meth_get_sign(const RSA_METHOD *meth))(int type,
const unsigned char *m, unsigned int m_length,
unsigned char *sigret, unsigned int *siglen,
const RSA *rsa);
int RSA_meth_set_sign(RSA_METHOD *rsa, int (*sign)(int type,
const unsigned char *m, unsigned int m_length, unsigned char *sigret,
unsigned int *siglen, const RSA *rsa));
int (*RSA_meth_get_verify(const RSA_METHOD *meth))(int dtype,
const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf,
unsigned int siglen, const RSA *rsa);
int RSA_meth_set_verify(RSA_METHOD *rsa, int (*verify)(int dtype,
const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf,
unsigned int siglen, const RSA *rsa));
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_RSA_strings(void);
/* Error codes for the RSA functions. */
/* Function codes. */
#define RSA_F_CHECK_PADDING_MD 140
#define RSA_F_DO_RSA_PRINT 146
#define RSA_F_INT_RSA_VERIFY 145
#define RSA_F_MEMORY_LOCK 100
#define RSA_F_OLD_RSA_PRIV_DECODE 147
#define RSA_F_PKEY_RSA_CTRL 143
#define RSA_F_PKEY_RSA_CTRL_STR 144
#define RSA_F_PKEY_RSA_SIGN 142
#define RSA_F_PKEY_RSA_VERIFY 154
#define RSA_F_PKEY_RSA_VERIFYRECOVER 141
#define RSA_F_RSA_BUILTIN_KEYGEN 129
#define RSA_F_RSA_CHECK_KEY 123
#define RSA_F_RSA_EAY_MOD_EXP 157
#define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101
#define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102
#define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103
#define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104
#define RSA_F_RSA_GENERATE_KEY 105
#define RSA_F_RSA_GENERATE_KEY_EX 155
#define RSA_F_RSA_ITEM_VERIFY 156
#define RSA_F_RSA_MEMORY_LOCK 130
#define RSA_F_RSA_NEW_METHOD 106
#define RSA_F_RSA_NULL 124
#define RSA_F_RSA_NULL_MOD_EXP 131
#define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132
#define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133
#define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134
#define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135
#define RSA_F_RSA_PADDING_ADD_NONE 107
#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121
#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125
#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148
#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108
#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109
#define RSA_F_RSA_PADDING_ADD_X931 127
#define RSA_F_RSA_PADDING_CHECK_NONE 111
#define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122
#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112
#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113
#define RSA_F_RSA_PADDING_CHECK_X931 128
#define RSA_F_RSA_PRINT 115
#define RSA_F_RSA_PRINT_FP 116
#define RSA_F_RSA_PRIVATE_DECRYPT 150
#define RSA_F_RSA_PRIVATE_ENCRYPT 151
#define RSA_F_RSA_PRIV_DECODE 137
#define RSA_F_RSA_PRIV_ENCODE 138
#define RSA_F_RSA_PUBLIC_DECRYPT 152
#define RSA_F_RSA_PUBLIC_ENCRYPT 153
#define RSA_F_RSA_PUB_DECODE 139
#define RSA_F_RSA_SETUP_BLINDING 136
#define RSA_F_RSA_SIGN 117
#define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118
#define RSA_F_RSA_VERIFY 119
#define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120
#define RSA_F_RSA_VERIFY_PKCS1_PSS 126
#define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149
/* Reason codes. */
#define RSA_R_ALGORITHM_MISMATCH 100
#define RSA_R_BAD_E_VALUE 101
#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
#define RSA_R_BAD_PAD_BYTE_COUNT 103
#define RSA_R_BAD_SIGNATURE 104
#define RSA_R_BLOCK_TYPE_IS_NOT_01 106
#define RSA_R_BLOCK_TYPE_IS_NOT_02 107
#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
#define RSA_R_DATA_TOO_LARGE 109
#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
#define RSA_R_DATA_TOO_SMALL 111
#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
#define RSA_R_DIGEST_DOES_NOT_MATCH 158
#define RSA_R_DIGEST_NOT_ALLOWED 145
#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
#define RSA_R_FIRST_OCTET_INVALID 133
#define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144
#define RSA_R_INVALID_DIGEST 157
#define RSA_R_INVALID_DIGEST_LENGTH 143
#define RSA_R_INVALID_HEADER 137
#define RSA_R_INVALID_KEYBITS 145
#define RSA_R_INVALID_LABEL 160
#define RSA_R_INVALID_MESSAGE_LENGTH 131
#define RSA_R_INVALID_MGF1_MD 156
#define RSA_R_INVALID_OAEP_PARAMETERS 161
#define RSA_R_INVALID_PADDING 138
#define RSA_R_INVALID_PADDING_MODE 141
#define RSA_R_INVALID_PSS_PARAMETERS 149
#define RSA_R_INVALID_PSS_SALTLEN 146
#define RSA_R_INVALID_SALT_LENGTH 150
#define RSA_R_INVALID_TRAILER 139
#define RSA_R_INVALID_X931_DIGEST 142
#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
#define RSA_R_KEY_SIZE_TOO_SMALL 120
#define RSA_R_LAST_OCTET_INVALID 134
#define RSA_R_MODULUS_TOO_LARGE 105
#define RSA_R_MGF1_DIGEST_NOT_ALLOWED 152
#define RSA_R_NON_FIPS_RSA_METHOD 157
#define RSA_R_NO_PUBLIC_EXPONENT 140
#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
#define RSA_R_OAEP_DECODING_ERROR 121
#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158
#define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
#define RSA_R_PADDING_CHECK_FAILED 114
#define RSA_R_PSS_SALTLEN_TOO_SMALL 164
#define RSA_R_P_NOT_PRIME 128
#define RSA_R_Q_NOT_PRIME 129
#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
#define RSA_R_SLEN_CHECK_FAILED 136
#define RSA_R_SLEN_RECOVERY_FAILED 135
#define RSA_R_SSLV3_ROLLBACK_ATTACK 115
#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
#define RSA_R_UNKNOWN_DIGEST 166
#define RSA_R_UNKNOWN_MASK_DIGEST 151
#define RSA_R_UNKNOWN_PADDING_TYPE 118
#define RSA_R_UNKNOWN_PSS_DIGEST 152
#define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 162
#define RSA_R_UNSUPPORTED_LABEL_SOURCE 163
#define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153
#define RSA_R_UNSUPPORTED_MASK_PARAMETER 154
#define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155
#define RSA_R_VALUE_MISSING 147
#define RSA_R_WRONG_SIGNATURE_LENGTH 119
#ifdef __cplusplus
}
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
package orderedmerge_test
import (
"bytes"
"context"
"strconv"
"strings"
"testing"
"github.com/brimsec/zq/pkg/test"
"github.com/brimsec/zq/proc"
"github.com/brimsec/zq/proc/orderedmerge"
"github.com/brimsec/zq/proc/proctest"
"github.com/brimsec/zq/zbuf"
"github.com/brimsec/zq/zio"
"github.com/brimsec/zq/zio/tzngio"
"github.com/brimsec/zq/zng/resolver"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var omTestInputs = []string{
`
#0:record[v:int32,ts:time]
0:[10;1;]
0:[20;2;]
0:[30;3;]`,
`
#0:record[v:int32,ts:time]
0:[15;4;]
0:[25;5;]
0:[35;6;]`,
}
var omTestInputRev = []string{
`
#0:record[v:int32,ts:time]
0:[30;3;]
0:[20;2;]
0:[10;1;]
`,
`
#0:record[v:int32,ts:time]
0:[35;6;]
0:[25;5;]
0:[15;4;]
`,
}
func TestParallelOrder(t *testing.T) {
cases := []struct {
field string
reversed bool
inputs []string
exp string
}{
{
field: "ts",
reversed: false,
inputs: omTestInputs,
exp: `
#0:record[v:int32,ts:time]
0:[10;1;]
0:[20;2;]
0:[30;3;]
0:[15;4;]
0:[25;5;]
0:[35;6;]
`,
},
{
field: "v",
reversed: false,
inputs: omTestInputs,
exp: `
#0:record[v:int32,ts:time]
0:[10;1;]
0:[15;4;]
0:[20;2;]
0:[25;5;]
0:[30;3;]
0:[35;6;]
`,
},
{
field: "ts",
reversed: true,
inputs: omTestInputRev,
exp: `
#0:record[v:int32,ts:time]
0:[35;6;]
0:[25;5;]
0:[15;4;]
0:[30;3;]
0:[20;2;]
0:[10;1;]
`,
},
}
for i, c := range cases {
t.Run(strconv.Itoa(i), func(t *testing.T) {
zctx := resolver.NewContext()
pctx := &proc.Context{Context: context.Background(), TypeContext: zctx}
var parents []proc.Interface
for _, s := range c.inputs {
r := tzngio.NewReader(bytes.NewReader([]byte(s)), zctx)
parents = append(parents, &proctest.RecordPuller{R: r})
}
om := orderedmerge.New(pctx, parents, c.field, c.reversed)
var sb strings.Builder
err := zbuf.CopyPuller(tzngio.NewWriter(zio.NopCloser(&sb)), om)
require.NoError(t, err)
assert.Equal(t, test.Trim(c.exp), sb.String())
})
}
}
|
{
"pile_set_name": "Github"
}
|
package org.stagemonitor;
import org.junit.Test;
import org.mockito.Mockito;
import org.stagemonitor.configuration.ConfigurationOption;
import org.stagemonitor.web.servlet.filter.AbstractExclusionFilter;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class AbstractExclusionFilterTest {
private AbstractExclusionFilter testFilter;
private HttpServletRequest mockRequest = mock(HttpServletRequest.class);
private static class TestExclusionFilter extends AbstractExclusionFilter {
TestExclusionFilter(ConfigurationOption<Collection<String>> excludedPaths, ConfigurationOption<Collection<String>> excludedPathsAntPattern) {
super(excludedPaths, excludedPathsAntPattern);
}
@Override
public void doFilterInternal(HttpServletRequest servletRequest, HttpServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
}
}
@Test
public void testExclude() throws Exception {
testFilter = Mockito.spy(new TestExclusionFilter(
ConfigurationOption.stringsOption().buildWithDefault(Arrays.asList("/exclude1", "/exclude2", "/exclude3/")),
ConfigurationOption.stringsOption().buildWithDefault(Collections.singletonList("/foo/**"))
));
assertExcludes("/exclude1");
assertExcludes("/exclude2/bla/blubb");
assertExcludes("/exclude3/");
assertExcludes("/exclude2bla");
assertIncludes("/exclude3");
assertIncludes("/included");
assertIncludes("/included/exclude1");
}
@Test
public void testExcludeAntPath() throws Exception {
testFilter = Mockito.spy(new TestExclusionFilter(
ConfigurationOption.stringsOption().buildWithDefault(Collections.singletonList("/foo")),
ConfigurationOption.stringsOption().buildWithDefault(Arrays.asList("/**/*.js", "/exclude/**"))
));
assertExcludes("/bar.js");
assertExcludes("/exclude/bla/blubb");
assertExcludes("/exclude");
}
@Test
public void testNotExclude() throws Exception {
testFilter = Mockito.spy(new TestExclusionFilter(
ConfigurationOption.stringsOption().buildWithDefault(Collections.emptyList()),
ConfigurationOption.stringsOption().buildWithDefault(Collections.emptyList())
));
assertIncludes("/exclude3");
}
private void assertIncludes(String url) throws Exception {
assertExcludes(url, false);
}
private void assertExcludes(String url) throws Exception {
assertExcludes(url, true);
}
private int notExclutedCount = 0;
private void assertExcludes(String url, boolean excluded) throws Exception {
if (!excluded)
notExclutedCount++;
when(mockRequest.getRequestURI()).thenReturn(url);
when(mockRequest.getServletPath()).thenReturn(url);
when(mockRequest.getContextPath()).thenReturn("/context-path");
testFilter.doFilter(mockRequest, mock(HttpServletResponse.class), mock(FilterChain.class));
verify(testFilter, times(notExclutedCount)).doFilterInternal(any(), any(), any());
}
}
|
{
"pile_set_name": "Github"
}
|
# core-util-is
The `util.is*` functions introduced in Node v0.12.
|
{
"pile_set_name": "Github"
}
|
--TEST--
DOMDocument::relaxNGValidate() should fail on invalid RelaxNG file source
--CREDITS--
Knut Urdalen <knut@php.net>
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
$rng = __DIR__.'/foo.rng';
$xml = <<< XML
<?xml version="1.0"?>
<apple>
<pear>Pear</pear>
<pear>Pear</pear>
</apple>
XML;
$doc = new DOMDocument();
$doc->loadXML($xml);
$result = $doc->relaxNGValidate($rng);
var_dump($result);
?>
--EXPECTF--
Warning: DOMDocument::relaxNGValidate(): I/O warning : failed to load external entity "%s/foo.rng" in %s on line %d
Warning: DOMDocument::relaxNGValidate(): xmlRelaxNGParse: could not load %s/foo.rng in %s on line %d
Warning: DOMDocument::relaxNGValidate(): Invalid RelaxNG in %s on line %d
bool(false)
|
{
"pile_set_name": "Github"
}
|
module github.com/microcosm-cc/bluemonday
go 1.9
require (
github.com/aymerick/douceur v0.2.0 // indirect
github.com/chris-ramon/douceur v0.2.0
github.com/gorilla/css v1.0.0 // indirect
golang.org/x/net v0.0.0-20181220203305-927f97764cc3
)
|
{
"pile_set_name": "Github"
}
|
# Current working directory should be that of WorkerProcess -- which is the
# same directory as the currently executing playbook, i.e. integration/local/
#
# https://github.com/ansible/ansible/issues/14489
- name: integration/local/cwd_preserved.yml
any_errors_fatal: true
hosts: test-targets
tasks:
- connection: local
command: pwd
register: pwd
- connection: local
stat:
path: "{{pwd.stdout}}/cwd_preserved.yml"
register: stat
- assert:
that: stat.stat.exists
|
{
"pile_set_name": "Github"
}
|
package org.opentripplanner.ext.transmodelapi.mapping;
import org.opentripplanner.model.FeedScopedId;
import org.opentripplanner.model.TransitEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class TransitIdMapper {
private static final Logger LOG = LoggerFactory.getLogger(TransmodelMappingUtil.class);
private static String fixedFeedId = null;
public static String mapEntityIDToApi(TransitEntity<FeedScopedId> entity) {
return mapIDToApi(entity.getId());
}
public static String mapIDToApi(FeedScopedId id) {
if (fixedFeedId != null) {
return id.getId();
}
// It is safe to use the toString(), se the JavaDoc on it
return id.toString();
}
public static List<FeedScopedId> mapIDsToDomainNullSafe(Collection<String> ids) {
return (ids == null) ? List.of() : mapIDsToDomain(ids);
}
public static List<FeedScopedId> mapIDsToDomain(Collection<String> ids) {
if (ids == null) { return null; }
List<FeedScopedId> list = new ArrayList<>();
for (String id : ids) {
list.add(mapIDToDomain(id));
}
return list;
}
public static FeedScopedId mapIDToDomain(String id) {
if (id == null) {
return null;
}
if (fixedFeedId != null) {
return new FeedScopedId(fixedFeedId, id);
}
return FeedScopedId.parseId(id);
}
/**
* This initialize the 'fixedFeedId', before this is done the GraphQL API will use the full id
* including the feedId.
* <p>
* THIS CODE IS NOT THREAD SAFE!
* <p>
* Make sure to call this method BEFORE the server is stating-up/handling client requests.
*
* @param entities The entities to pick the feedId from, if more than one feedID exist, the feedId
* with the most occurrences will be used. This is done to prevent a few "cases"
* of wrongly set feedIds to block the entire API from working.
* @return the fixedFeedId - used to unit test this method.
*/
public static String setupFixedFeedId(Collection<? extends TransitEntity<FeedScopedId>> entities) {
fixedFeedId = "UNKNOWN_FEED";
// Count each feedId
Map<String, Integer> feedIds = entities
.stream()
.map(a -> a.getId().getFeedId())
.collect(Collectors.groupingBy(it -> it, Collectors.reducing(0, i -> 1, Integer::sum)));
if (feedIds.isEmpty()) {
LOG.warn("No data, unable to resolve fixedFeedScope to use in the Transmodel GraphQL API.");
}
else if (feedIds.size() == 1) {
fixedFeedId = feedIds.keySet().iterator().next();
}
else {
//noinspection OptionalGetWithoutIsPresent
fixedFeedId = feedIds.entrySet().stream().max(Map.Entry.comparingByValue()).get().getKey();
LOG.warn(
"More than one feedId exist in the list of agencies. The feed-id used by"
+ "most agencies will be picked."
);
}
LOG.info(
"Starting Transmodel GraphQL Schema with fixed FeedId: '" + fixedFeedId
+ "'. All FeedScopedIds in API will be assumed to belong to this agency."
);
return fixedFeedId;
}
}
|
{
"pile_set_name": "Github"
}
|
// Navigation
// Mobile menu toggles
.menu-button-container {
display: none;
justify-content: space-between;
left: 0;
position: absolute;
top: 0;
width: 100%;
#primary-open-menu {
margin-left: auto;
padding: calc(var(--button--padding-vertical) - (0.25 * var(--global--spacing-unit))) calc(var(--button--padding-horizontal) - (0.25 * var(--global--spacing-unit)));
margin-top: calc(0.25 * var(--global--spacing-unit));
margin-right: calc(0.25 * var(--global--spacing-unit));
}
@include media(mobile-only){
display: flex;
}
.admin-bar:not(.primary-navigation-open) & {
top: 46px;
}
}
.menu-button-container,
.primary-navigation,
.woo-navigation {
.button {
font-size: var(--primary-nav--font-size);
background-color: transparent;
color: var(--primary-nav--color-link);
z-index: 500;
&.open {
display: flex;
}
&.close {
display: none;
z-index: 501;
}
&#woo-open-menu {
padding: calc(var(--button--padding-vertical) - (0.25 * var(--global--spacing-unit))) calc(var(--button--padding-horizontal) - (0.25 * var(--global--spacing-unit)));
margin-top: calc(0.25 * var(--global--spacing-unit));
margin-left: calc(0.25 * var(--global--spacing-unit));
.svg-icon {
margin-left: 0;
margin-right: calc(0.25 * var(--global--spacing-unit));
vertical-align: middle;
}
}
.dropdown-icon {
display: flex;
align-items: center;
.svg-icon {
margin-left: calc(0.25 * var(--global--spacing-unit));
}
// Menu icon is off-center vertically to prevent blurry pixels.
&.open .svg-icon {
position: relative;
top: -1px;
}
}
.hide-visually {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
padding:0 !important;
border:0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
}
.primary-navigation-open & {
#primary-open-menu {
display: none;
}
#primary-close-menu {
display: flex;
padding: calc(var(--button--padding-vertical) - (0.25 * var(--global--spacing-unit))) calc(var(--button--padding-horizontal) - (0.25 * var(--global--spacing-unit)));
margin-top: calc(0.25 * var(--global--spacing-unit));
margin-right: calc(0.25 * var(--global--spacing-unit));
}
}
.woo-navigation-open & {
#woo-open-menu {
display: none;
}
#woo-close-menu {
display: flex;
padding: calc(var(--button--padding-vertical) - (0.25 * var(--global--spacing-unit))) calc(var(--button--padding-horizontal) - (0.25 * var(--global--spacing-unit)));
margin-top: calc(0.25 * var(--global--spacing-unit));
margin-right: calc(0.25 * var(--global--spacing-unit));
}
}
}
.primary-navigation,
.woo-navigation {
position: absolute;
top: 0;
right: 0;
color: var(--primary-nav--color-text);
font-size: var(--primary-nav--font-size);
margin-top: 0;
margin-bottom: 0;
@include media(mobile-only) {
width: 100%;
}
// Mobile menu closed
& > div {
visibility: hidden;
opacity: 0;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: calc(4* var(--global--spacing-unit)) var(--global--spacing-unit) var(--global--spacing-horizontal);
background-color: var(--global--color-background);
overflow-x: hidden;
overflow-y: scroll;
transition: all .15s ease-in-out;
transform: translateY(var(--global--spacing-vertical));
@include media(mobile-only) {
z-index: 499;
}
}
// Mobile menu open
.primary-navigation-open & {
> .primary-menu-container {
visibility: visible;
opacity: 1;
transform: translateY(0);
}
}
// Adjust button postion when scrolling is locked
.lock-scrolling & > .button {
position: fixed;
top: 0;
right: 0;
}
// Adjust positions when logged-in
.admin-bar &,
.admin-bar & > div,
.admin-bar.lock-scrolling & > .button {
top: 46px;
}
@include media(mobile) {
position: relative;
display: flex;
justify-content: var(--primary-nav--justify-content);
margin-top: calc( var(--global--spacing-vertical) * 1.5 );
// Mobile menu on desktop
& > div {
visibility: visible;
opacity: 1;
position: relative;
padding: 0;
background-color: transparent;
overflow: initial;
transform: none;
}
// Hide mobile menu toggle
#toggle-menu {
display: none;
}
// Hide sub-sub-menus
& > div > ul > li > ul {
display: none;
}
// Don't adjust position when logged-in
.admin-bar & {
top: initial;
& > div {
top: initial;
}
}
}
// Menu list wrapper
& > div > ul {
display: flex;
justify-content: var(--primary-nav--justify-content);
flex-wrap: wrap;
list-style: none;
margin: 0;
max-width: none;
padding-left: 0;
position: relative;
ul {
padding-left: 0;
}
li {
display: block;
position: relative;
width: 100%;
z-index: 1;
&:hover,
&:focus-within {
cursor: pointer;
z-index: 99999;
}
@include media(mobile) {
display: inherit;
width: inherit;
/* Submenu display */
&:hover > ul,
&:focus-within > ul,
& ul:hover,
& ul:focus {
visibility: visible;
opacity: 1;
display: block;
}
}
}
/* Sub-menus Flyout */
& > li > .sub-menu {
position: relative;
@include media(mobile) {
margin: 0;
background: var(--global--color-background);
box-shadow: var(--global--elevation);
left: 0;
top: calc(100% - (0.5 * var(--primary-nav--padding)));
min-width: max-content;
opacity: 0;
position: absolute;
transition: all 0.5s ease;
visibility: hidden;
}
.sub-menu {
width: 100%;
}
}
}
// Top-level Item Link Colors
.primary-menu > .menu-item:hover > a {
color: var(--primary-nav--color-link-hover);
}
// Top-level Menu Item
.primary-menu-container > ul > .menu-item {
padding: calc(0.5 * var(--primary-nav--padding)) 0;
@include media(mobile) {
display: flex;
align-items: center;
padding: var(--primary-nav--padding);
}
}
// Menu Item Link Colors
.menu-item > a {
color: var(--primary-nav--color-link);
&:hover {
color: var(--primary-nav--color-link-hover);
border-color: var(--global--color-secondary);
}
&:focus {
color: var(--global--color-secondary);
}
&:active {
color: var(--primary-nav--color-link);
}
}
// Menu Item Link
a {
color: currentColor;
display: inline;
font-family: var(--primary-nav--font-family-mobile);
font-size: var(--primary-nav--font-size-mobile);
font-weight: var(--primary-nav--font-weight);
@include media(mobile) {
display: block;
font-family: var(--primary-nav--font-family);
font-size: var(--primary-nav--font-size);
font-weight: var(--primary-nav--font-weight);
}
& + svg {
fill: currentColor;
}
&:hover,
&:link,
&:visited {
color: currentColor;
}
}
// Sub-menu depth indicators + text styles
.sub-menu {
list-style: none;
margin-left: var(--primary-nav--padding);
@include media(mobile) {
padding: calc(0.5 * var(--primary-nav--padding)) var(--primary-nav--padding);
> .menu-item > .sub-menu {
padding: 0;
}
> .menu-item.menu-item-has-children {
padding: calc(0.5 * var(--primary-nav--padding)) var(--primary-nav--padding) 0 0;
}
}
.menu-item {
padding-top: calc(0.5 * var(--primary-nav--padding));
padding-bottom: calc(0.5 * var(--primary-nav--padding));
@include media(mobile) {
padding-top: calc(0.5 * var(--primary-nav--padding));
padding-bottom: calc(0.5 * var(--primary-nav--padding));
}
a {
display: inline;
font-size: var(--primary-nav--font-size-sub-menu-mobile);
font-style: var(--primary-nav--font-style-sub-menu-mobile);
@include media(mobile) {
font-size: var(--primary-nav--font-size);
font-style: var(--primary-nav--font-style);
}
}
}
}
// Show top-level sub-menu indicators above mobile-breakpoint-only
.menu-item-has-children {
> .svg-icon {
display: none;
}
@include media(mobile) {
> .svg-icon {
display: inline-block;
height: 100%;
}
}
}
.hide-visually {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
padding:0 !important;
border:0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
}
// Keep the menu pinned to the top when the menu is open.
@include media(mobile-only) {
.lock-scrolling .site {
position: fixed;
max-width: 100%;
}
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Linux network utilities.
Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/ by Ricardo Pascal
"""
import sys
import socket
import struct
import array
import os
from binascii import unhexlify, hexlify
# STATE_ESTABLISHED = '01'
# STATE_SYN_SENT = '02'
# STATE_SYN_RECV = '03'
# STATE_FIN_WAIT1 = '04'
# STATE_FIN_WAIT2 = '05'
# STATE_TIME_WAIT = '06'
# STATE_CLOSE = '07'
# STATE_CLOSE_WAIT = '08'
# STATE_LAST_ACK = '09'
STATE_LISTEN = '0A'
# STATE_CLOSING = '0B'
def get_socket_inodes(pid):
'''
Get list of socket inodes for process pid.
'''
base = '/proc/%i/fd' % pid
inodes = []
for item in os.listdir(base):
target = os.readlink(os.path.join(base, item))
if target.startswith('socket:'):
inodes.append(int(target[8:-1]))
return inodes
def _remove_empty(array):
return [x for x in array if x !='']
def _convert_ip_port(array):
host,port = array.split(':')
# convert host from mangled-per-four-bytes form as used by kernel
host = unhexlify(host)
host_out = ''
for x in range(0, len(host) // 4):
(val,) = struct.unpack('=I', host[x*4:(x+1)*4])
host_out += '%08x' % val
return host_out,int(port,16)
def netstat(typ='tcp'):
'''
Function to return a list with status of tcp connections at linux systems
To get pid of all network process running on system, you must run this script
as superuser
'''
with open('/proc/net/'+typ,'r',encoding='utf8') as f:
content = f.readlines()
content.pop(0)
result = []
for line in content:
line_array = _remove_empty(line.split(' ')) # Split lines and remove empty spaces.
tcp_id = line_array[0]
l_addr = _convert_ip_port(line_array[1])
r_addr = _convert_ip_port(line_array[2])
state = line_array[3]
inode = int(line_array[9]) # Need the inode to match with process pid.
nline = [tcp_id, l_addr, r_addr, state, inode]
result.append(nline)
return result
def get_bind_addrs(pid):
'''
Get bind addresses as (host,port) tuples for process pid.
'''
inodes = get_socket_inodes(pid)
bind_addrs = []
for conn in netstat('tcp') + netstat('tcp6'):
if conn[3] == STATE_LISTEN and conn[4] in inodes:
bind_addrs.append(conn[1])
return bind_addrs
# from: http://code.activestate.com/recipes/439093/
def all_interfaces():
'''
Return all interfaces that are up
'''
import fcntl # Linux only, so only import when required
is_64bits = sys.maxsize > 2**32
struct_size = 40 if is_64bits else 32
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
max_possible = 8 # initial value
while True:
bytes = max_possible * struct_size
names = array.array('B', b'\0' * bytes)
outbytes = struct.unpack('iL', fcntl.ioctl(
s.fileno(),
0x8912, # SIOCGIFCONF
struct.pack('iL', bytes, names.buffer_info()[0])
))[0]
if outbytes == bytes:
max_possible *= 2
else:
break
namestr = names.tostring()
return [(namestr[i:i+16].split(b'\0', 1)[0],
socket.inet_ntoa(namestr[i+20:i+24]))
for i in range(0, outbytes, struct_size)]
def addr_to_hex(addr):
'''
Convert string IPv4 or IPv6 address to binary address as returned by
get_bind_addrs.
Very naive implementation that certainly doesn't work for all IPv6 variants.
'''
if '.' in addr: # IPv4
addr = [int(x) for x in addr.split('.')]
elif ':' in addr: # IPv6
sub = [[], []] # prefix, suffix
x = 0
addr = addr.split(':')
for i,comp in enumerate(addr):
if comp == '':
if i == 0 or i == (len(addr)-1): # skip empty component at beginning or end
continue
x += 1 # :: skips to suffix
assert(x < 2)
else: # two bytes per component
val = int(comp, 16)
sub[x].append(val >> 8)
sub[x].append(val & 0xff)
nullbytes = 16 - len(sub[0]) - len(sub[1])
assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0))
addr = sub[0] + ([0] * nullbytes) + sub[1]
else:
raise ValueError('Could not parse address %s' % addr)
return hexlify(bytearray(addr)).decode('ascii')
def test_ipv6_local():
'''
Check for (local) IPv6 support.
'''
import socket
# By using SOCK_DGRAM this will not actually make a connection, but it will
# fail if there is no route to IPv6 localhost.
have_ipv6 = True
try:
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
s.connect(('::1', 0))
except socket.error:
have_ipv6 = False
return have_ipv6
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.