text
stringlengths 2
9.78k
| meta
dict |
|---|---|
### Solution for "Download of Code Without Integrity Check" challenge
This challenge showcases a situation common to software deployments where an update server is being used but integrity checks are no in place in order to validate the software has not been tampered with.
Only thing required to do in order to pass is changing the update server to `evil.bad`.
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (C) 2014-2016 Leosac
This file is part of Leosac.
Leosac is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Leosac is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "modules/smtp/SMTPServerInfoSerializer.hpp"
#include "modules/smtp/SMTPConfig.hpp"
#include "tools/JSONUtils.hpp"
using namespace Leosac;
using namespace Leosac::Module;
using namespace Leosac::Module::SMTP;
json SMTPServerInfoJSONSerializer::serialize(const SMTPServerInfo &in,
const SecurityContext &)
{
json server_desc;
server_desc["url"] = in.url;
server_desc["from"] = in.from;
server_desc["username"] = in.username;
server_desc["password"] = in.password;
server_desc["timeout"] = in.ms_timeout;
server_desc["verify_host"] = in.verify_host;
server_desc["verify_peer"] = in.verify_peer;
server_desc["enabled"] = in.enabled;
return server_desc;
}
void SMTPServerInfoJSONSerializer::unserialize(SMTPServerInfo &out, const json &in,
const SecurityContext &)
{
using namespace JSONUtil;
out.url = extract_with_default(in, "url", out.url);
out.from = extract_with_default(in, "from", out.from);
out.username = extract_with_default(in, "username", out.username);
out.password = extract_with_default(in, "password", out.password);
out.ms_timeout = extract_with_default(in, "timeout", out.ms_timeout);
out.verify_peer = extract_with_default(in, "verify_peer", out.verify_peer);
out.verify_host = extract_with_default(in, "verify_host", out.verify_host);
out.enabled = extract_with_default(in, "enabled", out.enabled);
}
std::string SMTPServerInfoJSONStringSerializer::serialize(const SMTPServerInfo &in,
const SecurityContext &sc)
{
return SMTPServerInfoJSONSerializer::serialize(in, sc).dump(4);
}
void SMTPServerInfoJSONStringSerializer::unserialize(SMTPServerInfo &out,
const std::string &in,
const SecurityContext &sc)
{
return SMTPServerInfoJSONSerializer::unserialize(out, json::parse(in), sc);
}
|
{
"pile_set_name": "Github"
}
|
<at-dialog title="vm.title" on-close="vm.onClose">
<at-form state="vm.form" autocomplete="off" id="external_test_form">
<at-input-group col="12" tab="20" state="vm.form.inputs" form-id="external_test"></at-input-group>
<at-action-group col="12" pos="right">
<at-action-button
variant="tertiary"
ng-click="vm.onClose()"
>
{{::vm.strings.get('CLOSE')}}
</at-action-button>
<at-action-button
variant="primary"
ng-click="vm.onSubmit()"
ng-disabled="!vm.form.isValid || vm.form.disabled"
>
{{::vm.strings.get('RUN')}}
</at-action-button>
</at-action-group>
</at-form>
</at-dialog>
|
{
"pile_set_name": "Github"
}
|
<bx_include_base:../modules/base/profile/template/cover.html />
|
{
"pile_set_name": "Github"
}
|
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/golang/protobuf/ptypes/any/any.proto
package any
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
reflect "reflect"
)
// Symbols defined in public import of google/protobuf/any.proto.
type Any = anypb.Any
var File_github_com_golang_protobuf_ptypes_any_any_proto protoreflect.FileDescriptor
var file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc = []byte{
0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2f, 0x61, 0x6e, 0x79, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x2b, 0x5a, 0x29,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e,
0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2f, 0x61, 0x6e, 0x79, 0x3b, 0x61, 0x6e, 0x79, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes = []interface{}{}
var file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_github_com_golang_protobuf_ptypes_any_any_proto_init() }
func file_github_com_golang_protobuf_ptypes_any_any_proto_init() {
if File_github_com_golang_protobuf_ptypes_any_any_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes,
DependencyIndexes: file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs,
}.Build()
File_github_com_golang_protobuf_ptypes_any_any_proto = out.File
file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc = nil
file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes = nil
file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs = nil
}
|
{
"pile_set_name": "Github"
}
|
<html><head>
<title>struct::skiplist - Tcl Data Structures</title>
<style type="text/css"><!--
HTML {
background: #FFFFFF;
color: black;
}
BODY {
background: #FFFFFF;
color: black;
}
DIV.doctools {
margin-left: 10%;
margin-right: 10%;
}
DIV.doctools H1,DIV.doctools H2 {
margin-left: -5%;
}
H1, H2, H3, H4 {
margin-top: 1em;
font-family: sans-serif;
font-size: large;
color: #005A9C;
background: transparent;
text-align: left;
}
H1.doctools_title {
text-align: center;
}
UL,OL {
margin-right: 0em;
margin-top: 3pt;
margin-bottom: 3pt;
}
UL LI {
list-style: disc;
}
OL LI {
list-style: decimal;
}
DT {
padding-top: 1ex;
}
UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
font: normal 12pt/14pt sans-serif;
list-style: none;
}
LI.doctools_section, LI.doctools_subsection {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
PRE {
display: block;
font-family: monospace;
white-space: pre;
margin: 0%;
padding-top: 0.5ex;
padding-bottom: 0.5ex;
padding-left: 1ex;
padding-right: 1ex;
width: 100%;
}
PRE.doctools_example {
color: black;
background: #f5dcb3;
border: 1px solid black;
}
UL.doctools_requirements LI, UL.doctools_syntax LI {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
DIV.doctools_synopsis {
color: black;
background: #80ffff;
border: 1px solid black;
font-family: serif;
margin-top: 1em;
margin-bottom: 1em;
}
UL.doctools_syntax {
margin-top: 1em;
border-top: 1px solid black;
}
UL.doctools_requirements {
margin-bottom: 1em;
border-bottom: 1px solid black;
}
--></style>
</head>
<! -- Generated from file 'skiplist.man' by tcllib/doctools with format 'html'
-->
<! -- Copyright © 2000 Keith Vetter
-->
<! -- struct::skiplist.n
-->
<body><hr> [
<a href="../../../../../../../../home">Tcllib Home</a>
| <a href="../../../../toc.html">Main Table Of Contents</a>
| <a href="../../../toc.html">Table Of Contents</a>
| <a href="../../../../index.html">Keyword Index</a>
| <a href="../../../../toc0.html">Categories</a>
| <a href="../../../../toc1.html">Modules</a>
| <a href="../../../../toc2.html">Applications</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">struct::skiplist(n) 1.3 tcllib "Tcl Data Structures"</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>struct::skiplist - Create and manipulate skiplists</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Bugs, Ideas, Feedback</a></li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
<li class="doctools_section"><a href="#category">Category</a></li>
<li class="doctools_section"><a href="#copyright">Copyright</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="doctools_requirements">
<li>package require <b class="pkgname">Tcl 8.2</b></li>
<li>package require <b class="pkgname">struct::skiplist <span class="opt">?1.3?</span></b></li>
</ul>
<ul class="doctools_syntax">
<li><a href="#1"><b class="cmd">skiplistName</b> <i class="arg">option</i> <span class="opt">?<i class="arg">arg arg ...</i>?</span></a></li>
<li><a href="#2"><i class="arg">skiplistName</i> <b class="method">delete</b> <i class="arg">node</i> <span class="opt">?<i class="arg">node</i>...?</span></a></li>
<li><a href="#3"><i class="arg">skiplistName</i> <b class="method">destroy</b></a></li>
<li><a href="#4"><i class="arg">skiplistName</i> <b class="method">insert</b> <i class="arg">key value</i></a></li>
<li><a href="#5"><i class="arg">skiplistName</i> <b class="method">search</b> <i class="arg">node</i> <span class="opt">?<b class="const">-key</b> <i class="arg">key</i>?</span></a></li>
<li><a href="#6"><i class="arg">skiplistName</i> <b class="method">size</b></a></li>
<li><a href="#7"><i class="arg">skiplistName</i> <b class="method">walk</b> <i class="arg">cmd</i></a></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>The <b class="cmd">::struct::skiplist</b> command creates a new skiplist object
with an associated global Tcl command whose name is
<i class="arg">skiplistName</i>. This command may be used to invoke various
operations on the skiplist. It has the following general form:</p>
<dl class="doctools_definitions">
<dt><a name="1"><b class="cmd">skiplistName</b> <i class="arg">option</i> <span class="opt">?<i class="arg">arg arg ...</i>?</span></a></dt>
<dd><p><i class="arg">Option</i> and the <i class="arg">arg</i>s determine the exact behavior of the
command.</p></dd>
</dl>
<p>Skip lists are
|
{
"pile_set_name": "Github"
}
|
THE_URL:file://localhost/Users/hubery/Public/ucar/Document/Functions/Contributed/zonalAve.shtml
THE_TITLE:zonalAve
NCL Home > Documentation > Functions > General applied math
zonalAve
Computes a zonal average of the input array.
Prototype
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
function zonalAve (
x : numeric
)
return_val : typeof(x)
Arguments
x
An array of any size and type.
Return value
The results are returned in an array of the same type and one dimension smaller than x. Metadata are preserved.
Description
This function computes a zonal average of the input array x. If the input array has a "long_name" or "short_name"
attribute, it will be updated.
©2015 UCAR | Privacy Policy | Terms of Use | Contact the Webmaster | Sponsored by NSF
|
{
"pile_set_name": "Github"
}
|
{{/*
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
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.
*/}}
{{- $serviceName := print .Release.Name "-controller" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $serviceName }}
labels:
app.kubernetes.io/component: controller
{{ include "labels" . | indent 4 }}
spec:
replicas: {{ .Values.controller.replicas }}
selector:
matchLabels:
app.kubernetes.io/component: controller
{{ include "selector-labels" . | indent 6 }}
template:
metadata:
labels:
app.kubernetes.io/component: controller
{{ include "selector-labels" . | indent 8 }}
annotations:
{{- with .Values.controller.podAnnotations }}
{{ toYaml . | indent 8 }}
{{- end }}
spec:
{{- with .Values.controller.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.controller.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.controller.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml . | trimSuffix "\n" | indent 8 }}
{{- end }}
volumes:
- name: certs
secret:
secretName: {{ required "secret.certs must be provided" .Values.secret.certs }}
- name: envdir
secret:
secretName: {{ required "secret.envdir must be provided" .Values.secret.envdir }}
{{- if .Values.secret.configs }}
{{- range $module, $secretName := .Values.secret.configs }}
- name: {{ $secretName }}-{{ $module }}
secret:
secretName: {{ $secretName }}
{{- end }}
{{- else }}
- name: "empty-configs"
emptyDir: {}
{{- end }}
containers:
- name: {{ $serviceName }}
image: {{ required "controller.image.repository must be provided" .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
volumeMounts:
{{- range tuple "certs" "envdir" }}
- name: {{ . }}
mountPath: /var/opt/magma/{{ . }}
readOnly: true
{{- end }}
{{- if .Values.secret.configs }}
{{- range $module, $secretName := .Values.secret.configs }}
- name: {{ $secretName }}-{{ $module }}
mountPath: {{ print "/var/opt/magma/configs/" $module }}
readOnly: true
{{- end }}
{{- else }}
- name: "empty-configs"
mountPath: /var/opt/magma/configs
readOnly: true
{{- end }}
ports:
{{- with .Values.controller.service }}
- containerPort: {{ .targetPort }}
{{- range $_, $port := untilStep (.portStart | int) (.portEnd | add1 | int) 1 }}
- containerPort: {{ $port }}
{{- end }}
{{- end }}
env:
- name: DATABASE_SOURCE
valueFrom:
secretKeyRef:
name: {{ $serviceName }}
key: {{ .Values.controller.spec.database.driver }}.connstr
- name: SQL_DRIVER
value: {{ .Values.controller.spec.database.driver }}
- name: SQL_DIALECT
value: {{ .Values.controller.spec.database.sql_dialect }}
# Hostname override for dispatcher
- name: SERVICE_HOST_NAME
valueFrom:
fieldRef:
fieldPath: status.podIP
# Hostname override for metricsd
- name: HOST_NAME
valueFrom:
fieldRef:
fieldPath: status.podIP
livenessProbe:
tcpSocket:
port: 9081
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
tcpSocket:
port: 9081
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{ toYaml .Values.controller.resources | indent 12 }}
|
{
"pile_set_name": "Github"
}
|
liTest run started
liTest scala.scalanative.junit.MethodNameDecodeTest.abcd$u0020$u2206ƒ$u0020$uD83D$uDE00$u0020$times$u0020$hash$amp$ started
ldTest scala.scalanative.junit.MethodNameDecodeTest.abcd$u0020$u2206ƒ$u0020$uD83D$uDE00$u0020$times$u0020$hash$amp$ finished, took <TIME>
e01abcd$u0020$u2206ƒ$u0020$uD83D$uDE00$u0020$times$u0020$hash$amp$
liTest run finished: 0 failed, 0 ignored, 1 total, <TIME>
d
|
{
"pile_set_name": "Github"
}
|
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package spdy
// headerDictionary is the dictionary sent to the zlib compressor/decompressor.
var headerDictionary = []byte{
0x00, 0x00, 0x00, 0x07, 0x6f, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x00, 0x00, 0x00, 0x04, 0x68,
0x65, 0x61, 0x64, 0x00, 0x00, 0x00, 0x04, 0x70,
0x6f, 0x73, 0x74, 0x00, 0x00, 0x00, 0x03, 0x70,
0x75, 0x74, 0x00, 0x00, 0x00, 0x06, 0x64, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x00, 0x00, 0x00, 0x05,
0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x00, 0x00,
0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x00,
0x00, 0x00, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x70,
0x74, 0x2d, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65,
0x74, 0x00, 0x00, 0x00, 0x0f, 0x61, 0x63, 0x63,
0x65, 0x70, 0x74, 0x2d, 0x65, 0x6e, 0x63, 0x6f,
0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x0f,
0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x6c,
0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00,
0x00, 0x00, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x70,
0x74, 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73,
0x00, 0x00, 0x00, 0x03, 0x61, 0x67, 0x65, 0x00,
0x00, 0x00, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
0x00, 0x00, 0x00, 0x0d, 0x61, 0x75, 0x74, 0x68,
0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x00, 0x00, 0x00, 0x0d, 0x63, 0x61, 0x63,
0x68, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72,
0x6f, 0x6c, 0x00, 0x00, 0x00, 0x0a, 0x63, 0x6f,
0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x00, 0x00, 0x00, 0x0c, 0x63, 0x6f, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x2d, 0x62, 0x61, 0x73, 0x65,
0x00, 0x00, 0x00, 0x10, 0x63, 0x6f, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x2d, 0x65, 0x6e, 0x63, 0x6f,
0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x10,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d,
0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
0x00, 0x00, 0x00, 0x0e, 0x63, 0x6f, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x65, 0x6e, 0x67,
0x74, 0x68, 0x00, 0x00, 0x00, 0x10, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x6f,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00,
0x00, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x2d, 0x6d, 0x64, 0x35, 0x00, 0x00, 0x00,
0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x2d, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x00,
0x00, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x00, 0x00,
0x00, 0x04, 0x64, 0x61, 0x74, 0x65, 0x00, 0x00,
0x00, 0x04, 0x65, 0x74, 0x61, 0x67, 0x00, 0x00,
0x00, 0x06, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,
0x00, 0x00, 0x00, 0x07, 0x65, 0x78, 0x70, 0x69,
0x72, 0x65, 0x73, 0x00, 0x00, 0x00, 0x04, 0x66,
0x72, 0x6f, 0x6d, 0x00, 0x00, 0x00, 0x04, 0x68,
0x6f, 0x73, 0x74, 0x00, 0x00, 0x00, 0x08, 0x69,
0x66, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x00,
0x00, 0x00, 0x11, 0x69, 0x66, 0x2d, 0x6d, 0x6f,
0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2d, 0x73,
0x69, 0x6e, 0x63, 0x65, 0x00, 0x00, 0x00, 0x0d,
0x69, 0x66, 0x2d, 0x6e, 0x6f, 0x6e, 0x65, 0x2d,
0x
|
{
"pile_set_name": "Github"
}
|
{
"_from": "isstream@~0.1.2",
"_id": "isstream@0.1.2",
"_inBundle": false,
"_integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
"_location": "/isstream",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "isstream@~0.1.2",
"name": "isstream",
"escapedName": "isstream",
"rawSpec": "~0.1.2",
"saveSpec": null,
"fetchSpec": "~0.1.2"
},
"_requiredBy": [
"/request"
],
"_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a",
"_spec": "isstream@~0.1.2",
"_where": "/Users/rhwood/Developer/JMRI/JMRI/rhwood/JMRI/web/app/node_modules/request",
"author": {
"name": "Rod Vagg",
"email": "rod@vagg.org"
},
"bugs": {
"url": "https://github.com/rvagg/isstream/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Determine if an object is a Stream",
"devDependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "~0.10.x",
"tape": "~2.12.3"
},
"homepage": "https://github.com/rvagg/isstream",
"keywords": [
"stream",
"type",
"streams",
"readable-stream",
"hippo"
],
"license": "MIT",
"main": "isstream.js",
"name": "isstream",
"repository": {
"type": "git",
"url": "git+https://github.com/rvagg/isstream.git"
},
"scripts": {
"test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/"
},
"version": "0.1.2"
}
|
{
"pile_set_name": "Github"
}
|
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "../../headers/tomcrypt.h"
/**
@file der_decode_integer.c
ASN.1 DER, decode an integer, Tom St Denis
*/
#ifdef LTC_DER
/**
Read a mp_int integer
@param in The DER encoded data
@param inlen Size of DER encoded data
@param num The first mp_int to decode
@return CRYPT_OK if successful
*/
int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num)
{
unsigned long x, y, z;
int err;
LTC_ARGCHK(num != NULL);
LTC_ARGCHK(in != NULL);
/* min DER INTEGER is 0x02 01 00 == 0 */
if (inlen < (1 + 1 + 1)) {
return CRYPT_INVALID_PACKET;
}
/* ok expect 0x02 when we AND with 0001 1111 [1F] */
x = 0;
if ((in[x++] & 0x1F) != 0x02) {
return CRYPT_INVALID_PACKET;
}
/* now decode the len stuff */
z = in[x++];
if ((z & 0x80) == 0x00) {
/* short form */
/* will it overflow? */
if (x + z > inlen) {
return CRYPT_INVALID_PACKET;
}
/* no so read it */
if ((err = mp_read_unsigned_bin(num, (unsigned char *)in + x, z)) != CRYPT_OK) {
return err;
}
} else {
/* long form */
z &= 0x7F;
/* will number of length bytes overflow? (or > 4) */
if (((x + z) > inlen) || (z > 4) || (z == 0)) {
return CRYPT_INVALID_PACKET;
}
/* now read it in */
y = 0;
while (z--) {
y = ((unsigned long)(in[x++])) | (y << 8);
}
/* now will reading y bytes overrun? */
if ((x + y) > inlen) {
return CRYPT_INVALID_PACKET;
}
/* no so read it */
if ((err = mp_read_unsigned_bin(num, (unsigned char *)in + x, y)) != CRYPT_OK) {
return err;
}
}
/* see if it's negative */
if (in[x] & 0x80) {
void *tmp;
if (mp_init(&tmp) != CRYPT_OK) {
return CRYPT_MEM;
}
if (mp_2expt(tmp, mp_count_bits(num)) != CRYPT_OK || mp_sub(num, tmp, num) != CRYPT_OK) {
mp_clear(tmp);
return CRYPT_MEM;
}
mp_clear(tmp);
}
return CRYPT_OK;
}
#endif
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/integer/der_decode_integer.c,v $ */
/* $Revision: 1.5 $ */
/* $Date: 2006/12/28 01:27:24 $ */
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/request'
|
{
"pile_set_name": "Github"
}
|
/**
* Created by martin on 19.02.2017.
*/
import * as path from 'path';
let pkg = null;
try {
pkg = require(path.resolve(__dirname, '..', 'package.json'));
} catch (e) {
try {
pkg = require(path.resolve(__dirname, '..', '..', 'package.json'));
} catch (e) {
pkg = null;
}
}
export const VERSION = (pkg ? pkg.version : 'unknown');
|
{
"pile_set_name": "Github"
}
|
'use strict';
var Promise = require('sporks/scripts/promise'),
sporks = require('sporks');
var Config = function (slouch) {
this._slouch = slouch;
};
Config.prototype._couchDB2Request = function (node, path, opts, parseBody) {
opts.uri = this._slouch._url + '/_node/' + node + '/_config/' + path;
opts.parseBody = parseBody;
return this._slouch._req(opts);
};
// Warning: as per https://github.com/klaemo/docker-couchdb/issues/42#issuecomment-169610897, this
// isn't really the best approach as a more complete solution would implement some rollback
// mechanism when a node fails after several attempts. (Retries are already attempted by the
// request).
Config.prototype._couchDB2Requests = function (path, opts, parseBody, maxNumNodes) {
var self = this,
promises = [],
i = 0;
return self._slouch.membership.get().then(function (members) {
members.cluster_nodes.forEach(function (node) {
if (typeof maxNumNodes === 'undefined' || i++ < maxNumNodes) {
// Clone the opts as we need a separate copy per node
var clonedOpts = sporks.clone(opts);
promises.push(self._couchDB2Request(node, path, clonedOpts, parseBody));
}
});
// Only return a single promise when there is a single promise so that the return value
// is consistent for a single node.
return promises.length > 1 ? Promise.all(promises) : promises[0];
});
};
Config.prototype._couchDB1Request = function (path, opts, parseBody) {
opts.uri = this._slouch._url + '/_config/' + path;
opts.parseBody = parseBody;
return this._slouch._req(opts);
};
Config.prototype._request = function (path, opts, parseBody, maxNumNodes) {
var self = this;
return self._slouch.system.isCouchDB1().then(function (isCouchDB1) {
if (isCouchDB1) {
return self._couchDB1Request(path, opts, parseBody);
} else {
return self._couchDB2Requests(path, opts, parseBody, maxNumNodes);
}
});
};
Config.prototype.get = function (path) {
return this._request(path, {
method: 'GET'
}, true);
};
Config.prototype.set = function (path, value) {
return this._request(path, {
method: 'PUT',
body: JSON.stringify(this._toString(value))
});
};
Config.prototype.unset = function (path) {
return this._request(path, {
method: 'DELETE'
});
};
Config.prototype.unsetIgnoreMissing = function (path) {
var self = this;
return self._slouch.doc.ignoreMissing(function () {
return self.unset(path);
});
};
Config.prototype.setCouchHttpdAuthTimeout = function (timeoutSecs) {
// Convert timeout value to a string
return this.set('couch_httpd_auth/timeout', timeoutSecs + '');
};
Config.prototype._toString = function (value) {
if (typeof value === 'boolean') {
return value ? 'true' : 'false';
} else if (typeof value === 'string') {
return value;
} else {
return value + ''; // convert to string
}
};
Config.prototype.setCouchHttpdAuthAllowPersistentCookies = function (allow) {
return this.set('couch_httpd_auth/allow_persistent_cookies', allow);
};
Config.prototype.setLogLevel = function (level) {
return this.set('log/level', level);
};
Config.prototype.setCompactionRule = function (dbName, rule) {
return this.set('compactions/' + encodeURIComponent(dbName), rule);
};
Config.prototype.setCouchDBMaxDBsOpen = function (maxDBsOpen) {
return this.set('couchdb/max_dbs_open', maxDBsOpen);
};
Config.prototype.setHttpdMaxConnections = function (maxConnections) {
return this.set('httpd/max_connections', maxConnections);
};
module.exports = Config;
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2009 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.xyoye.player.danmaku.danmaku.model.objectpool;
public interface PoolableManager<T extends Poolable<T>> {
T newInstance();
void onAcquired(T element);
void onReleased(T element);
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\DB\Sql;
/**
* Class LimitExpression
*/
class LimitExpression extends Expression
{
/**
* @var string
*/
protected $sql;
/**
* @var int
*/
protected $count;
/**
* @var int
*/
protected $offset;
/**
* @param string $sql
* @param int $count
* @param int $offset
*/
public function __construct(
$sql,
$count,
$offset = 0
) {
$this->sql = $sql;
$this->count = $count;
$this->offset = $offset;
}
/**
* @inheritdoc
*/
public function __toString()
{
$sql = $this->sql;
$count = (int)$this->count;
if ($count <= 0) {
/** @see Zend_Db_Adapter_Exception */
#require_once 'Zend/Db/Adapter/Exception.php';
throw new \Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
}
$offset = (int)$this->offset;
if ($offset < 0) {
/** @see Zend_Db_Adapter_Exception */
#require_once 'Zend/Db/Adapter/Exception.php';
throw new \Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
}
$sql .= " LIMIT $count";
if ($offset > 0) {
$sql .= " OFFSET $offset";
}
return trim($sql);
}
}
|
{
"pile_set_name": "Github"
}
|
Ethereum入門
=============
[Ethereum入門](http://book.ethereum-jp.net)は、分散アプリケーションプラットフォーム「Ethereum(イーサリアム)」の技術入門書です。
Ethereumがどのように動作するのか、Ethereumを用いてどのように分散アプリケーションを開発していくか、について解説していきます。
Ethereumプロジェクトは最初の安定版(Homestead)リリースがされましたが、今後仕様が変更になる場合があります。仕様変更に伴い本書も逐次内容を変更していきます。
また本ドキュメントは**2018/3/10 現在、制作中です。**
本ドキュメントはオープンなプロジェクトであり、そのため協力者を広く求めています。本書のソースコードは[GitHub上](https://github.com/a-mitani/mastering-ethereum)で公開されています。
本書への追記や修正などありましたら、上記[GitHub](https://github.com/a-mitani/mastering-ethereum)にてIssueの発行、またはPull requestをお願いいたします。
本ドキュメントは <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a> のもとで公開されています。
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />
|
{
"pile_set_name": "Github"
}
|
### 更新时间Updated
Updated可以让您在记录插入或每次记录更新时自动更新数据库中的标记字段为当前时间,需要在xorm标记中使用updated标记,如下所示进行标记,对应的字段可以为time.Time或者自定义的time.Time或者int,int64等int类型。
```Go
type User struct {
Id int64
Name string
UpdatedAt time.Time `xorm:"updated"`
}
```
在Insert(), InsertOne(), Update()方法被调用时,updated标记的字段将会被自动更新为当前时间,如下所示:
```Go
var user User
engine.Id(1).Get(&user)
// SELECT * FROM user WHERE id = ?
engine.Id(1).Update(&user)
// UPDATE user SET ..., updaetd_at = ? WHERE id = ?
```
如果你希望临时不自动插入时间,则可以组合NoAutoTime()方法:
```Go
engine.NoAutoTime().Insert(&user)
```
这个在从一张表拷贝字段到另一张表时比较有用。
|
{
"pile_set_name": "Github"
}
|
#ifndef __PMU_H
#define __PMU_H
#include <linux/bitops.h>
#include "../../../include/linux/perf_event.h"
enum {
PERF_PMU_FORMAT_VALUE_CONFIG,
PERF_PMU_FORMAT_VALUE_CONFIG1,
PERF_PMU_FORMAT_VALUE_CONFIG2,
};
#define PERF_PMU_FORMAT_BITS 64
struct perf_pmu__format {
char *name;
int value;
DECLARE_BITMAP(bits, PERF_PMU_FORMAT_BITS);
struct list_head list;
};
struct perf_pmu {
char *name;
__u32 type;
struct list_head format;
struct list_head list;
};
struct perf_pmu *perf_pmu__find(char *name);
int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
struct list_head *head_terms);
int perf_pmu_wrap(void);
void perf_pmu_error(struct list_head *list, char *name, char const *msg);
int perf_pmu__new_format(struct list_head *list, char *name,
int config, unsigned long *bits);
void perf_pmu__set_format(unsigned long *bits, long from, long to);
int perf_pmu__test(void);
#endif /* __PMU_H */
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# coding: utf-8
"""
Polyaxon SDKs and REST API specification.
Polyaxon SDKs and REST API specification. # noqa: E501
The version of the OpenAPI document: 1.1.9-rc4
Contact: contact@polyaxon.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from polyaxon_sdk.configuration import Configuration
class V1Queue(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
"uuid": "str",
"agent": "str",
"name": "str",
"description": "str",
"tags": "list[str]",
"priority": "int",
"concurrency": "int",
"created_at": "datetime",
"updated_at": "datetime",
}
attribute_map = {
"uuid": "uuid",
"agent": "agent",
"name": "name",
"description": "description",
"tags": "tags",
"priority": "priority",
"concurrency": "concurrency",
"created_at": "created_at",
"updated_at": "updated_at",
}
def __init__(
self,
uuid=None,
agent=None,
name=None,
description=None,
tags=None,
priority=None,
concurrency=None,
created_at=None,
updated_at=None,
local_vars_configuration=None,
): # noqa: E501
"""V1Queue - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._uuid = None
self._agent = None
self._name = None
self._description = None
self._tags = None
self._priority = None
self._concurrency = None
self._created_at = None
self._updated_at = None
self.discriminator = None
if uuid is not None:
self.uuid = uuid
if agent is not None:
self.agent = agent
if name is not None:
self.name = name
if description is not None:
self.description = description
if tags is not None:
self.tags = tags
if priority is not None:
self.priority = priority
if concurrency is not None:
self.concurrency = concurrency
if created_at is not None:
self.created_at = created_at
if updated_at is not None:
self.updated_at = updated_at
@property
def uuid(self):
"""Gets the uuid of this V1Queue. # noqa: E501
:return: The uuid of this V1Queue. # noqa: E501
:rtype: str
"""
return self._uuid
@uuid.setter
def uuid(self, uuid):
"""Sets the uuid of this V1Queue.
:param uuid: The uuid of this V1Queue. # noqa: E501
:type: str
"""
self._uuid = uuid
@property
def agent(self):
"""Gets the agent of this V1Queue. # noqa: E501
:return: The agent of this V1Queue. # noqa: E501
:rtype: str
"""
return self._agent
@agent.setter
def agent(self, agent):
"""Sets the agent of this V1Queue.
:param agent: The agent of this V1Queue. # noqa: E501
:type: str
"""
self._agent = agent
@property
def name(self):
"""Gets the name of this V1Queue. # noqa: E501
:return: The name of this V1Queue. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this V1Queue.
:param name: The name of this V1Queue. # noqa: E501
:type: str
"""
self._name = name
@property
def description(self):
"""Gets the description of this V1Queue. # noqa: E501
:return: The description of this V1Queue. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this V1Queue.
:param description: The description of this V1Queue. # noqa: E501
:type: str
"""
self._description = description
@property
def tags(self):
"""Gets the tags of this V1Queue. # noqa: E501
:return: The tags of this V1Queue. # noqa: E501
:rtype: list[str]
"""
return self._tags
@tags.setter
def tags(self, tags):
"""Sets the tags of this V1Queue.
:param tags: The tags of this V1Queue. # noqa: E501
:type: list[str]
"""
self._tags = tags
@property
def priority(self):
"""Gets the priority of this V1Queue. # noqa: E501
:return: The priority of this V1Queue. # noqa: E501
:rtype: int
"""
return self._priority
@priority.setter
def priority(self, priority):
"""Sets the priority of this V1Queue.
:param priority: The priority of this V1Queue. # noqa: E501
:type: int
"""
self._priority = priority
@property
def concurrency(self):
"""Gets the concurrency of this V1Queue. # noqa: E501
:return: The concurrency of this V1Queue. # noqa: E501
:rtype: int
"""
return self._concurrency
@concurrency.setter
def concurrency(self, concurrency):
"""Sets the concurrency of this V1Queue.
:param concurrency: The concurrency of this V1Queue. # noqa: E501
:type: int
"""
self._concurrency = concurrency
@property
def created_at(self):
"""Gets the created_at of this V1Queue. # noqa: E501
:return: The created_at of this V1Queue. # noqa: E501
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""Sets the created_at of this V1Queue.
:param created_at: The created_at of this V1Queue. # noqa: E501
:type: datetime
"""
self._created_at = created_at
@property
def updated_at(self
|
{
"pile_set_name": "Github"
}
|
package webrtc
const (
// Unknown defines default public constant to use for "enum" like struct
// comparisons when no value was defined.
Unknown = iota
unknownStr = "unknown"
ssrcStr = "ssrc"
receiveMTU = 8192
)
|
{
"pile_set_name": "Github"
}
|
<!-- YAML
added: v0.1.97
changes:
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/12562
description: 参数 `callback` 不再是可选的。
如果不传入,则在运行时会抛出 `TypeError`。
- version: v7.6.0
pr-url: https://github.com/nodejs/node/pull/10739
description: 参数 `path` 可以是 WHATWG `URL` 对象(使用 `file:` 协议)。
该支持目前仍是实验的。
- version: v7.0.0
pr-url: https://github.com/nodejs/node/pull/7897
description: 参数 `callback` 不再是可选的。
如果不传入,则会触发弃用警告(id 为 DEP0013)。
-->
* `path` {string|Buffer|URL}
* `uid` {integer}
* `gid` {integer}
* `callback` {Function}
* `err` {Error}
异步地更改文件的所有者和群组。
除了可能的异常,完成回调没有其他参数。
也可参见 chown(2)。
|
{
"pile_set_name": "Github"
}
|
box: yosssi/golang-latest@1.0.9
# Build definition
build:
# The steps that will be executed on build
steps:
# Sets the go workspace and places you package
# at the right place in the workspace tree
- setup-go-workspace
# Gets the dependencies
- script:
name: go get
code: |
cd $WERCKER_SOURCE_DIR
go version
go get -t ./...
# Build the project
- script:
name: go build
code: |
go build ./...
# Test the project
- script:
name: go test
code: |
packages=(cmd/gmq-cli mqtt mqtt/client mqtt/packet)
for package in ${packages[@]}; do go test -v -cover -race ./$package; done
# Invoke goveralls
- script:
name: goveralls
code: |
go get github.com/axw/gocov/gocov
go get github.com/mattn/goveralls
echo "mode: count" > all.cov
for package in ${packages[@]}; do go test --covermode=count -coverprofile=$package.cov ./$package; sed -e "1d" $package.cov >> all.cov; done
GIT_BRANCH=$WERCKER_GIT_BRANCH goveralls -coverprofile=all.cov -service=wercker.com -repotoken $COVERALLS_REPO_TOKEN
|
{
"pile_set_name": "Github"
}
|
/*
* Driver for audio on multifunction CS5535/6 companion device
* Copyright (C) Jaya Kumar
*
* Based on Jaroslav Kysela and Takashi Iwai's examples.
* This work was sponsored by CIS(M) Sdn Bhd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/io.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
#include <sound/rawmidi.h>
#include <sound/ac97_codec.h>
#include <sound/initval.h>
#include <sound/asoundef.h>
#include "cs5535audio.h"
#define DRIVER_NAME "cs5535audio"
static char *ac97_quirk;
module_param(ac97_quirk, charp, 0444);
MODULE_PARM_DESC(ac97_quirk, "AC'97 board specific workarounds.");
static const struct ac97_quirk ac97_quirks[] = {
#if 0 /* Not yet confirmed if all 5536 boards are HP only */
{
.subvendor = PCI_VENDOR_ID_AMD,
.subdevice = PCI_DEVICE_ID_AMD_CS5536_AUDIO,
.name = "AMD RDK",
.type = AC97_TUNE_HP_ONLY
},
#endif
{}
};
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for " DRIVER_NAME);
module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for " DRIVER_NAME);
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable " DRIVER_NAME);
static const struct pci_device_id snd_cs5535audio_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO) },
{}
};
MODULE_DEVICE_TABLE(pci, snd_cs5535audio_ids);
static void wait_till_cmd_acked(struct cs5535audio *cs5535au, unsigned long timeout)
{
unsigned int tmp;
do {
tmp = cs_readl(cs5535au, ACC_CODEC_CNTL);
if (!(tmp & CMD_NEW))
break;
udelay(1);
} while (--timeout);
if (!timeout)
dev_err(cs5535au->card->dev,
"Failure writing to cs5535 codec\n");
}
static unsigned short snd_cs5535audio_codec_read(struct cs5535audio *cs5535au,
unsigned short reg)
{
unsigned int regdata;
unsigned int timeout;
unsigned int val;
regdata = ((unsigned int) reg) << 24;
regdata |= ACC_CODEC_CNTL_RD_CMD;
regdata |= CMD_NEW;
cs_writel(cs5535au, ACC_CODEC_CNTL, regdata);
wait_till_cmd_acked(cs5535au, 50);
timeout = 50;
do {
val = cs_readl(cs5535au, ACC_CODEC_STATUS);
if ((val & STS_NEW) && reg == (val >> 24))
break;
udelay(1);
} while (--timeout);
if (!timeout)
dev_err(cs5535au->card->dev,
"Failure reading codec reg 0x%x, Last value=0x%x\n",
reg, val);
return (unsigned short) val;
}
static void snd_cs5535audio_codec_write(struct cs5535audio *cs5535au,
unsigned short reg, unsigned short val)
{
unsigned int regdata;
regdata = ((unsigned int) reg) << 24;
regdata |= val;
regdata &= CMD_MASK;
regdata |= CMD_NEW;
regdata &= ACC_CODEC_CNTL_WR_CMD;
cs_writel(cs5535au, ACC_CODEC_CNTL, regdata);
wait_till_cmd_acked(cs5535au, 50);
}
static void snd_cs5535audio_ac97_codec_write(struct snd_ac97 *ac97,
unsigned short reg, unsigned short val)
{
struct cs5535audio *cs5535au = ac97->private_data;
snd_cs5535audio_codec_write(cs5535au, reg, val);
}
static unsigned short snd_cs5535audio_ac97_codec_read(struct snd_ac97 *ac97,
unsigned short reg)
{
struct cs5535audio *cs5535au = ac97->private_data;
return snd_cs5535audio_codec_read(cs5535au, reg);
}
static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
{
struct snd_card *card = cs5535au->card;
struct snd_ac97_bus *pbus;
struct snd_ac97_template ac97;
int err;
static struct snd_ac97_bus_ops ops = {
.write = snd_cs5535audio_ac97_codec_write,
.read = snd_cs5535audio_ac97_codec_read,
};
if ((err = snd_ac97_bus(card, 0, &ops, NULL, &pbus)) < 0)
return err;
memset(&ac97, 0, sizeof(ac97));
ac97.scaps = AC97_SCAP_AUDIO | AC97_SCAP_SKIP_MODEM
| AC97_SCAP_POWER_SAVE;
ac97.private_data = cs5535au;
ac97.pci = cs5535au->pci;
/* set any OLPC-specific scaps */
olpc_prequirks(card, &ac97);
if ((err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97)) < 0) {
dev_err(card->dev, "mixer failed\n");
return err;
}
snd_ac97_tune_hardware(cs5535au->ac97, ac97_quirks, ac97_quirk);
err = olpc_quirks(card, cs5535au->ac97);
if (err < 0) {
dev_err(card->dev, "olpc quirks failed\n");
return err;
}
return 0;
}
static void process_bm0_irq(struct cs5535audio *cs5535au)
{
u8 bm_stat;
spin_lock(&cs5535au->reg_lock);
bm_stat = cs_readb(cs55
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
|
{
"pile_set_name": "Github"
}
|
#!/bin/bash -e
export URL="http://localhost:3000"
echo "Bulk loading"
./populate.py -d 8 --destination=$URL --domain="mydomain" --bulk
echo "The home page"
wrk -c 10 -d5 -t5 $URL | grep Requests
echo "Single word search 'p'"
wrk -c 10 -d5 -t5 "$URL/v1?q=p&d=mydomain" | grep Requests
echo "Single word search 'python'"
wrk -c 10 -d5 -t5 "$URL/v1?q=python&d=mydomain" | grep Requests
echo "Single word search 'xxxxxx'"
wrk -c 10 -d5 -t5 "$URL/v1?q=xxxxx&d=mydomain" | grep Requests
echo "Double word search 'python', 'te'"
wrk -c 10 -d5 -t5 "$URL/v1?q=python%20te&d=mydomain" | grep Requests
echo "Double word search 'xxxxxxxx', 'yyyyyyy'"
wrk -c 10 -d5 -t5 "$URL/v1?q=xxxxxxxx%20yyyyyy&d=mydomain" | grep Requests
|
{
"pile_set_name": "Github"
}
|
/*
* /MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscSymbols.js
*
* Copyright (c) 2012 Design Science, Inc.
*
* Part of the MathJax library.
* See http://www.mathjax.org for details.
*
* Licensed under the Apache License, Version 2.0;
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.MathJax_AMS,{9733:[694,111,944,49,895]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/AMS/Regular/MiscSymbols.js");
|
{
"pile_set_name": "Github"
}
|
<http://example/s> <http://example/p> <http://example/o> .
|
{
"pile_set_name": "Github"
}
|
""" Two1 command to send bitcoin to another address """
# standart python imports
import logging
# 3rd party imports
import click
# two1 imports
from two1.blockchain.exceptions import DataProviderError
from two1.wallet.exceptions import WalletBalanceError
from two1.commands.util import decorators
from two1.commands.util import uxstring
from two1.commands.util import exceptions
from two1.commands.util import currency
from two1.commands.util.bitcoin_computer import has_mining_chip
# Creates a ClickLogger
logger = logging.getLogger(__name__)
@click.command("send")
@click.argument('address', type=click.STRING)
@click.argument('amount', type=click.FLOAT)
@click.argument('denomination', default='', type=click.STRING)
@click.option('--use-unconfirmed', '-u',
is_flag=True,
default=False,
show_default=True,
help="Use unconfirmed transactions/UTXOs")
@click.option('--verbose', '-v', is_flag=True, default=False,
help="Show all transaction inputs and outputs.")
@click.pass_context
@decorators.catch_all
def send(ctx, address, amount, denomination, use_unconfirmed, verbose):
"""Send a specified address some satoshis.
\b
Usage
-----
Send 5000 satoshi from your on-chain balance to the Apache Foundation.
$ 21 send 1BtjAzWGLyAavUkbw3QsyzzNDKdtPXk95D 5000 satoshis
You can use the following denominations: satoshis, bitcoins, and USD.
By default, this command uses only confirmed transactions and
UTXOs to send coins. To use unconfirmed transactions, use the
--use-unconfirmed flag.
"""
if denomination == '':
confirmed = click.confirm(uxstring.UxString.default_price_denomination, default=True)
if not confirmed:
raise exceptions.Two1Error(uxstring.UxString.cancel_command)
denomination = currency.Price.SAT
price = currency.Price(amount, denomination)
return _send(ctx.obj['wallet'], address, price.satoshis, verbose, use_unconfirmed)
def _send(wallet, address, satoshis, verbose, use_unconfirmed=False):
"""Send bitcoin to the specified address"""
txids = []
try:
txids = wallet.send_to(address=address, amount=satoshis, use_unconfirmed=use_unconfirmed)
# For now there is only a single txn created, so assume it's 0
txid, txn = txids[0]["txid"], txids[0]["txn"]
if verbose:
logger.info(uxstring.UxString.send_success_verbose.format(satoshis, address, txid, txn))
else:
logger.info(uxstring.UxString.send_success.format(satoshis, address, txid))
except ValueError as e:
# This will trigger if there's a below dust-limit output.
raise exceptions.Two1Error(str(e))
except WalletBalanceError as e:
if wallet.unconfirmed_balance() > satoshis:
raise exceptions.Two1Error(uxstring.UxString.send_insufficient_confirmed + str(e))
else:
balance = min(wallet.confirmed_balance(), wallet.unconfirmed_balance())
if has_mining_chip():
raise exceptions.Two1Error(uxstring.UxString.send_insufficient_blockchain_21bc.format(
balance, satoshis, address, str(e)))
else:
raise exceptions.Two1Error(uxstring.UxString.send_insufficient_blockchain_free.format(
balance, satoshis, address, str(e)))
except DataProviderError as e:
if "rejected" in str(e):
raise exceptions.Two1Error(uxstring.UxString.send_rejected)
else:
raise exceptions.Two1Error(str(e))
return txids
|
{
"pile_set_name": "Github"
}
|
/***************************************************************************/
/* */
/* ftcsbits.c */
/* */
/* FreeType sbits manager (body). */
/* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_CACHE_H
#include "ftcsbits.h"
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include FT_ERRORS_H
#include "ftccback.h"
#include "ftcerror.h"
#undef FT_COMPONENT
#define FT_COMPONENT trace_cache
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** SBIT CACHE NODES *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
static FT_Error
ftc_sbit_copy_bitmap( FTC_SBit sbit,
FT_Bitmap* bitmap,
FT_Memory memory )
{
FT_Error error;
FT_Int pitch = bitmap->pitch;
FT_ULong size;
if ( pitch < 0 )
pitch = -pitch;
size = (FT_ULong)( pitch * bitmap->rows );
if ( !FT_ALLOC( sbit->buffer, size ) )
FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );
return error;
}
FT_LOCAL_DEF( void )
ftc_snode_free( FTC_Node ftcsnode,
FTC_Cache cache )
{
FTC_SNode snode = (FTC_SNode)ftcsnode;
FTC_SBit sbit = snode->sbits;
FT_UInt count = snode->count;
FT_Memory memory = cache->memory;
for ( ; count > 0; sbit++, count-- )
FT_FREE( sbit->buffer );
FTC_GNode_Done( FTC_GNODE( snode ), cache );
FT_FREE( snode );
}
FT_LOCAL_DEF( void )
FTC_SNode_Free( FTC_SNode snode,
FTC_Cache cache )
{
ftc_snode_free( FTC_NODE( snode ), cache );
}
/*
* This function tries to load a small bitmap within a given FTC_SNode.
* Note that it returns a non-zero error code _only_ in the case of
* out-of-memory condition. For all other errors (e.g., corresponding
* to a bad font file), this function will mark the sbit as `unavailable'
* and return a value of 0.
*
* You should also read the comment within the @ftc_snode_compare
* function below to see how out-of-memory is handled during a lookup.
*/
static FT_Error
ftc_snode_load( FTC_SNode snode,
FTC_Manager manager,
FT_UInt gindex,
FT_ULong *asize )
{
FT_Error error;
FTC_GNode gnode = FTC_GNODE( snode );
FTC_Family family = gnode->family;
FT_Memory memory = manager->memory;
FT_Face face;
FTC_SBit sbit;
FTC_SFamilyClass clazz;
if ( (FT_UInt)(gindex - gnode->gindex) >= snode->count )
{
FT_ERROR(( "ftc_snode_load: invalid glyph index" ));
return FTC_Err_Invalid_Argument;
}
sbit = snode->sbits + ( gindex - gnode->gindex );
clazz = (FTC_SFamilyClass)family->clazz;
sbit->buffer = 0;
error = clazz->family_load_glyph( family, gindex, manager, &face );
if ( error )
goto BadGlyph;
{
FT_Int temp;
FT_GlyphSlot slot = face->glyph;
FT_Bitmap* bitmap = &slot->bitmap;
FT_Pos xadvance, yadvance; /* FT_GlyphSlot->advance.{x|y} */
if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
{
FT_TRACE0(( "ftc_snode_load:"
" glyph loaded didn't return a bitmap\n" ));
goto BadGlyph;
}
/* Check that our values fit into 8-bit containers! */
/* If this is not the case, our bitmap is too large */
/* and we will leave it as `missing' with sbit.buffer = 0 */
#define CHECK_CHAR( d ) ( temp = (FT_Char)d, temp == d )
#define CHECK_BYTE( d ) ( temp = (FT_Byte)d, temp == d )
/* horizontal advance in pixels */
xadvance = ( slot->advance.x + 32 ) >> 6;
yadvance = ( slot->advance.y + 32 ) >> 6;
if ( !CHECK_BYTE( bitmap->rows ) ||
!CHECK_BYTE( bitmap->width ) ||
!CHECK_CHAR( bitmap->pitch ) ||
!CHECK_CHAR( slot->bitmap_left ) ||
!CHECK_CHAR( slot->bitmap_top ) ||
!CHECK_CHAR( xadvance ) ||
!CHECK_CHAR( yadvance ) )
goto BadGlyph;
sbit->width = (FT_Byte)bitmap->width;
sbit->height = (FT_Byte)bitmap->rows;
sbit->pitch = (FT_Char)bitmap->pitch;
sbit->left = (FT_Char)slot->bitmap_left;
sbit->top = (FT_Char)slot->bitmap_top;
sbit->xadvance = (FT_Char)xadvance;
sbit->yadvance = (FT_Char)yadvance;
sbit->format = (FT_Byte)bitmap->pixel_mode;
sbit->max_grays = (FT_Byte)(bitmap->num_grays - 1);
/* copy the bitmap into a new buffer -- ignore error */
error = ftc_sbit_copy_bitmap( sbit, bitmap, memory );
/* now, compute size */
if ( asize )
*asize = FT_ABS( sbit->pitch ) * sbit->height;
} /* glyph loading successful */
/* ignore the errors that might have occurred -- */
/* we mark unloaded glyphs with `sbit.buffer == 0' */
/* and `width == 255', `height == 0' */
/* */
if ( error && error != FTC_Err_Out_Of_Memory )
{
BadGlyph:
sbit->width = 255;
sbit->height = 0;
sbit->buffer = NULL;
error = 0;
if ( asize )
*asize = 0;
}
return error;
}
FT_LOCAL_DEF( FT_Error )
FTC_SNode_New( FTC_SNode *psnode,
FTC_GQuery gquery,
FTC_Cache cache )
{
FT_Memory memory = cache->memory;
FT_Error error;
FTC_SNode snode = NULL
|
{
"pile_set_name": "Github"
}
|
debian/tmp/usr/bin/ansible-test usr/bin
debian/tmp/usr/lib/python3/dist-packages/ansible_test usr/lib/python3/dist-packages
|
{
"pile_set_name": "Github"
}
|
files
{
0 1 1 test_job test_namespace strings1.xml 0
1 2 6 test_job test_namespace strings2.xml 0
2 3 13 test_job test_namespace strings3.xml 0
3 4 20 test_job test_namespace strings4.xml 0
4 5 28 test_job test_namespace strings5.xml 0
}
|
{
"pile_set_name": "Github"
}
|
# Firejail profile for meld
# Description: Graphical tool to diff and merge files
# This file is overwritten after every install/update
# Persistent local customizations
include meld.local
# Persistent global definitions
include globals.local
# If you want to use meld as git-mergetool (and maybe some other VCS integrations) you need
# to bypass firejail, you can do this by removing the symlink or calling it by its absolute path
# Removing the symlink:
# sudo rm /usr/local/bin/meld
# Calling by its absolute path (example for git-mergetool):
# git config --global mergetool.meld.cmd /usr/bin/meld
noblacklist ${HOME}/.config/meld
noblacklist ${HOME}/.config/git
noblacklist ${HOME}/.gitconfig
noblacklist ${HOME}/.git-credentials
noblacklist ${HOME}/.local/share/meld
noblacklist ${HOME}/.ssh
noblacklist ${HOME}/.subversion
# Allow python (blacklisted by disable-interpreters.inc)
include allow-python3.inc
# Python 2 is EOL (see #3164). Uncomment the next line (or put it into your meld.local) if you understand the risks but want python 2 support for older meld versions.
#include allow-python2.inc
# Uncomment the next line (or put it into your meld.local) if you don't need to compare files in disable-common.inc.
#include disable-common.inc
include disable-devel.inc
include disable-exec.inc
include disable-interpreters.inc
include disable-passwdmgr.inc
# Uncomment the next line (or put it into your meld.local) if you don't need to compare files in disable-programs.inc.
#include disable-programs.inc
include disable-shell.inc
include whitelist-runuser-common.inc
# Uncomment the next lines (or put it into your meld.local) if you don't need to compare files in /usr/share.
#whitelist /usr/share/meld
#include whitelist-usr-share-common.inc
# Uncomment the next line (or put it into your meld.local) if you don't need to compare files in /var.
#include whitelist-var-common.inc
apparmor
caps.drop all
ipc-namespace
machine-id
netfilter
no3d
nodvd
nogroups
nonewprivs
noroot
nosound
notv
nou2f
novideo
protocol unix,inet,inet6
seccomp
shell none
tracelog
private-bin bzr,cvs,git,hg,meld,python*,svn
private-cache
private-dev
# Uncomment the next line (or put it into your meld.local) if you don't need to compare in /etc.
#private-etc alternatives,ca-certificates,crypto-policies,fonts,hostname,hosts,pki,resolv.conf,ssl,subversion
# Comment the next line (or add 'ignore private-tmp to your meld.local') if you want to use it as a difftool (#3551)
private-tmp
read-only ${HOME}/.ssh
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" default-locale="en-US">
<!-- Generated with https://github.com/citation-style-language/utilities/tree/master/generate_dependent_styles/data/mdpi -->
<info>
<title>Processes</title>
<id>http://www.zotero.org/styles/processes</id>
<link href="http://www.zotero.org/styles/processes" rel="self"/>
<link href="http://www.zotero.org/styles/multidisciplinary-digital-publishing-institute" rel="independent-parent"/>
<link href="http://www.mdpi.com/authors/references" rel="documentation"/>
<category citation-format="numeric"/>
<category field="science"/>
<eissn>2227-9717</eissn>
<updated>2014-05-15T12:00:00+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
</style>
|
{
"pile_set_name": "Github"
}
|
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/BBBold.js
*
* Copyright (c) 2009-2018 The MathJax Consortium
*
* 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.
*
*/
MathJax.Hub.Insert(
MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['STIXGeneral-bold'],
{
0x1D538: [676,0,787,50,737], // MATHEMATICAL DOUBLE-STRUCK CAPITAL A
0x1D539: [676,0,729,75,669], // MATHEMATICAL DOUBLE-STRUCK CAPITAL B
0x1D53B: [676,0,748,75,703], // MATHEMATICAL DOUBLE-STRUCK CAPITAL D
0x1D53C: [676,0,650,75,595], // MATHEMATICAL DOUBLE-STRUCK CAPITAL E
0x1D53D: [676,0,474,75,595], // MATHEMATICAL DOUBLE-STRUCK CAPITAL F
0x1D53E: [691,19,751,45,686], // MATHEMATICAL DOUBLE-STRUCK CAPITAL G
0x1D540: [676,0,380,80,300], // MATHEMATICAL DOUBLE-STRUCK CAPITAL I
0x1D541: [676,19,618,50,548], // MATHEMATICAL DOUBLE-STRUCK CAPITAL J
0x1D542: [676,0,792,75,767], // MATHEMATICAL DOUBLE-STRUCK CAPITAL K
0x1D543: [676,0,662,70,607], // MATHEMATICAL DOUBLE-STRUCK CAPITAL L
0x1D544: [676,0,914,75,839], // MATHEMATICAL DOUBLE-STRUCK CAPITAL M
0x1D546: [691,19,787,45,742], // MATHEMATICAL DOUBLE-STRUCK CAPITAL O
0x1D54A: [692,19,702,45,657], // MATHEMATICAL DOUBLE-STRUCK CAPITAL S
0x1D54B: [676,0,556,25,645], // MATHEMATICAL DOUBLE-STRUCK CAPITAL T
0x1D54C: [676,19,738,70,668], // MATHEMATICAL DOUBLE-STRUCK CAPITAL U
0x1D54D: [676,0,627,17,704], // MATHEMATICAL DOUBLE-STRUCK CAPITAL V
0x1D54E: [676,0,996,17,1015], // MATHEMATICAL DOUBLE-STRUCK CAPITAL W
0x1D54F: [676,0,794,20,769], // MATHEMATICAL DOUBLE-STRUCK CAPITAL X
0x1D550: [676,0,652,23,739], // MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
0x1D552: [473,14,623,50,563], // MATHEMATICAL DOUBLE-STRUCK SMALL A
0x1D553: [676,14,643,60,593], // MATHEMATICAL DOUBLE-STRUCK SMALL B
0x1D554: [473,14,574,50,524], // MATHEMATICAL DOUBLE-STRUCK SMALL C
0x1D555: [676,14,643,50,583], // MATHEMATICAL DOUBLE-STRUCK SMALL D
0x1D556: [473,14,573,50,523], // MATHEMATICAL DOUBLE-STRUCK SMALL E
0x1D557: [676,0,474,25,536], // MATHEMATICAL DOUBLE-STRUCK SMALL F
0x1D558: [473,205,643,50,583], // MATHEMATICAL DOUBLE-STRUCK SMALL G
0x1D559: [676,0,624,60,564], // MATHEMATICAL DOUBLE-STRUCK SMALL H
0x1D55A: [691,0,330,65,265], // MATHEMATICAL DOUBLE-STRUCK SMALL I
0x1D55B: [691,205,371,-20,311], // MATHEMATICAL DOUBLE-STRUCK SMALL J
0x1D55C: [676,0,646,60,621], // MATHEMATICAL DOUBLE-STRUCK SMALL K
0x1D55D: [676,0,325,60,265], // MATHEMATICAL DOUBLE-STRUCK SMALL L
0x1D55E: [473,0,908,60,848], // MATHEMATICAL DOUBLE-STRUCK SMALL M
0x1D55F: [473,0,624,60,564], // MATHEMATICAL DOUBLE-STRUCK SMALL N
0x1D560: [473,14,598,45,553], // MATHEMATICAL DOUBLE-STRUCK SMALL O
0x1D561: [473,205,643,60,593], // MATHEMATICAL DOUBLE-STRUCK SMALL P
0x1D562: [473,205,643,50,583], // MATHEMATICAL DOUBLE-STRUCK SMALL Q
0x1D563: [473,0,339,60,445], // MATHEMATICAL DOUBLE-STRUCK SMALL R
0x1D564: [473,14,549,52,497], // MATHEMATICAL DOUBLE-STRUCK SMALL S
0x1D565: [676,14,446,25,411], // MATHEMATICAL DOUBLE-STRUCK SMALL T
0x1D566: [461,16,619,55,559], // MATHEMATICAL DOUBLE-STRUCK SMALL U
0x1D567: [461,0,494,6,544], // MATHEMATICAL DOUBLE-STRUCK SMALL V
0x1D568: [461,0,786,22,789], // MATHEMATICAL DOUBLE-STRUCK SMALL W
0x1D569: [461,0,660,25,635], // MATHEMATICAL DOUBLE-STRUCK SMALL X
0x1D56A: [461,205,471,-9,537], // MATHEMATICAL DOUBLE-STRUCK SMALL Y
0x1D56B: [461,0,513,40,473] // MATHEMATICAL DOUBLE-STRUCK SMALL Z
}
);
MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir + "/General/Bold/BBBold.js");
|
{
"pile_set_name": "Github"
}
|
import { FocusZoneDirection } from '@fluentui/accessibility';
import { FocusTrapZone, FocusZone, FocusTrapZoneProps } from '@fluentui/react-bindings';
import * as React from 'react';
import * as ReactTestUtils from 'react-dom/test-utils';
import { keyboardKey } from '@fluentui/keyboard-key';
// rAF does not exist in node - let's mock it
window.requestAnimationFrame = (callback: FrameRequestCallback) => {
const r = window.setTimeout(callback, 0);
jest.runAllTimers();
return r;
};
jest.useFakeTimers();
class FocusTrapZoneTestComponent extends React.Component<{}, { isShowingFirst: boolean; isShowingSecond: boolean }> {
constructor(props: {}) {
super(props);
this.state = { isShowingFirst: true, isShowingSecond: false };
}
render() {
return (
<div>
<FocusTrapZone forceFocusInsideTrapOnOutsideFocus isClickableOutsideFocusTrap={false}>
<button className={'a'} onClick={this._toggleFirst}>
a
</button>
<button className={'b'} onClick={this._toggleSecond}>
b
</button>
</FocusTrapZone>
{this.state.isShowingFirst && (
<FocusTrapZone forceFocusInsideTrapOnOutsideFocus={false} isClickableOutsideFocusTrap={false}>
<FocusZone data-is-visible={true}>First</FocusZone>
</FocusTrapZone>
)}
{this.state.isShowingSecond && (
<FocusTrapZone forceFocusInsideTrapOnOutsideFocus={false} isClickableOutsideFocusTrap={true}>
<FocusZone data-is-visible={true}>First</FocusZone>
</FocusTrapZone>
)}
</div>
);
}
_toggleFirst = () => this.setState({ isShowingFirst: !this.state.isShowingFirst });
_toggleSecond = () => this.setState({ isShowingSecond: !this.state.isShowingSecond });
}
describe('FocusTrapZone', () => {
// document.activeElement can be used to detect activeElement after component mount, but it does not
// update based on focus events due to limitations of ReactDOM. Use lastFocusedElement to detect focus
// change events.
let lastFocusedElement: HTMLElement | undefined;
const ftzClassname = 'ftzTestClassname';
const _onFocus = (ev: any): void => (lastFocusedElement = ev.target);
const setupElement = (
element: HTMLElement,
{
clientRect,
isVisible = true,
}: {
clientRect: {
top: number;
left: number;
bottom: number;
right: number;
};
isVisible?: boolean;
},
): void => {
// @ts-ignore
element.getBoundingClientRect = () => ({
top: clientRect.top,
left: clientRect.left,
bottom: clientRect.bottom,
right: clientRect.right,
width: clientRect.right - clientRect.left,
height: clientRect.bottom - clientRect.top,
});
element.setAttribute('data-is-visible', String(isVisible));
element.focus = () => ReactTestUtils.Simulate.focus(element);
};
/**
* Helper to get FocusTrapZone bumpers. Requires classname attribute of
* 'ftzClassname' on FTZ.
*/
function getFtzBumpers(
element: HTMLElement,
): {
firstBumper: Element;
lastBumper: Element;
} {
const ftz = element.querySelector(`.${ftzClassname}`) as HTMLElement;
const ftzNodes = ftz.children;
const firstBumper = ftzNodes[0];
const lastBumper = ftzNodes[ftzNodes.length - 1];
return { firstBumper, lastBumper };
}
beforeEach(() => {
lastFocusedElement = undefined;
});
describe('Tab and shift-tab wrap at extreme ends of the FTZ', () => {
it('can tab across FocusZones with different button structures', async () => {
expect.assertions(3);
const topLevelDiv = ReactTestUtils.renderIntoDocument<{}>(
<div onFocusCapture={_onFocus}>
<FocusTrapZone forceFocusInsideTrapOnOutsideFocus={false} className={ftzClassname}>
<FocusZone direction={FocusZoneDirection.horizontal} data-is-visible={true}>
<div data-is-visible={true}>
<button className="a">a</button>
</div>
<div data-is-visible={true}>
<button className="b">b</button>
</div>
<div data-is-visible={true}>
<button className="c">c</button>
</div>
</FocusZone>
<FocusZone direction={FocusZoneDirection.horizontal} data-is-visible={true}>
<div data-is-visible={true}>
<div data-is-visible={true}>
<button className="d">d</button>
<button className="e">e</button>
<button className="f">f</button>
</div>
</div>
</FocusZone>
</FocusTrapZone>
</div>,
) as HTMLElement;
const buttonA = topLevelDiv.querySelector('.a') as HTMLElement;
const buttonB = topLevelDiv.querySelector('.b') as HTMLElement;
const buttonC = topLevelDiv.querySelector('.c') as HTMLElement;
const buttonD = topLevelDiv.querySelector('.d') as HTMLElement;
const buttonE = topLevelDiv.querySelector('.e') as HTMLElement;
const buttonF = topLevelDiv.querySelector('.f') as HTMLElement;
// Assign bounding locations to buttons.
setupElement(buttonA, { clientRect: { top: 0, bottom: 30, left: 0, right: 30 } });
setupElement(buttonB, { clientRect: { top: 0, bottom: 30, left: 30, right: 60 } });
setupElement(buttonC, { clientRect: { top: 0, bottom: 30, left: 60, right: 90 } });
setupElement(buttonD, { clientRect: { top: 30, bottom: 60, left: 0, right: 30 } });
setupElement(buttonE, { clientRect: { top: 30, bottom: 60, left: 30, right: 60 } });
setupElement(buttonF, { clientRect: { top: 30, bottom: 60, left: 60, right: 90 } });
const { firstBumper, lastBumper } = getFtzBumpers(topLevelDiv);
ReactTestUtils.Simulate.focus(buttonA);
expect(lastFocusedElement).toBe(buttonA);
// Simulate shift+tab event which would focus first bumper
ReactTestUtils.Simulate.focus(firstBumper);
expect(lastFocusedElement).toBe(buttonD);
// Simulate tab event which would focus last bumper
ReactTestUtils.Simulate.focus(lastBumper);
expect(lastFocusedElement).toBe(buttonA);
});
it('can tab across a FocusZone with different button structures', async () => {
expect.assertions(3);
const topLevelDiv = ReactTestUtils.renderIntoDocument<{}>(
<div onFocusCapture={_onFocus}>
<FocusTrapZone forceFocusInsideTrapOnOutsideFocus={false} className={ftzClassname}>
<div data-is-visible={true}>
<button className="x">x</button>
</div>
<FocusZone direction={FocusZoneDirection.horizontal} data-is-visible={true}>
<div data-is-visible={true}>
<button className="a">a</button>
</div>
<div data-is-visible={true}>
<div data-is-visible={true}>
<button className="b">b</button>
<button className="c">c</button
|
{
"pile_set_name": "Github"
}
|
# Created by: Sean Farley <sean-freebsd@farley.org>
# $FreeBSD$
PORTNAME= Mknod
PORTVERSION= 0.02
PORTREVISION= 1
CATEGORIES= devel perl5
MASTER_SITES= CPAN
MASTER_SITE_SUBDIR= CPAN:RLZWART
PKGNAMEPREFIX= p5-
MAINTAINER= sean-freebsd@farley.org
COMMENT= Perl module interface to the mknod(2) system call
USES= perl5
USE_PERL5= configure
MANPREFIX= ${PREFIX}/${SITE_PERL_REL}
.include <bsd.port.mk>
|
{
"pile_set_name": "Github"
}
|
<?php
/*
Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland
All rights reserved.
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
http://www.opensolutions.ie/
This file is part of the OSS_SNMP package.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Open Source Solutions Limited nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
namespace OSS_SNMP\MIBS;
/**
* A class for performing SNMP V2 queries on generic devices
*
* @copyright Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland
* @author Barry O'Donovan <barry@opensolutions.ie>
*/
class Iface extends \OSS_SNMP\MIB
{
const OID_IF_NUMBER = '.1.3.6.1.2.1.2.1.0';
const OID_IF_INDEX = '.1.3.6.1.2.1.2.2.1.1';
const OID_IF_DESCRIPTION = '.1.3.6.1.2.1.2.2.1.2';
const OID_IF_TYPE = '.1.3.6.1.2.1.2.2.1.3';
const OID_IF_MTU = '.1.3.6.1.2.1.2.2.1.4';
const OID_IF_SPEED = '.1.3.6.1.2.1.2.2.1.5';
const OID_IF_PHYS_ADDRESS = '.1.3.6.1.2.1.2.2.1.6';
const OID_IF_ADMIN_STATUS = '.1.3.6.1.2.1.2.2.1.7';
const OID_IF_OPER_STATUS = '.1.3.6.1.2.1.2.2.1.8';
const OID_IF_LAST_CHANGE = '.1.3.6.1.2.1.2.2.1.9';
const OID_IF_IN_OCTETS = '.1.3.6.1.2.1.2.2.1.10';
const OID_IF_IN_UNICAST_PACKETS = '.1.3.6.1.2.1.2.2.1.11';
const OID_IF_IN_NON_UNICAST_PACKETS = '.1.3.6.1.2.1.2.2.1.12';
const OID_IF_IN_DISCARDS = '.1.3.6.1.2.1.2.2.1.13';
const OID_IF_IN_ERRORS = '.1.3.6.1.2.1.2.2.1.14';
const OID_IF_IN_UNKNOWN_PROTOCOLS = '.1.3.6.1.2.1.2.2.1.15';
const OID_IF_OUT_OCTETS = '.1.3.6.1.2.1.2.2.1.16';
const OID_IF_OUT_UNICAST_PACKETS = '.1.3.6.1.2.1.2.2.1.17';
const OID_IF_OUT_NON_UNICAST_PACKETS = '.1.3.6.1.2.1.2.2.1.18';
const OID_IF_OUT_DISCARDS = '.1.3.6.1.2.1.2.2.1.19';
const OID_IF_OUT_ERRORS = '.1.3.6.1.2.1.2.2.1.20';
const OID_IF_OUT_QUEUE_LENGTH = '.1.3.6.1.2.1.2.2.1.21';
const OID_IF_NAME = '.1.3.6.1.2.1.31.1.1.1.1';
const OID_IF_HIGH_SPEED = '.1.3.6.1.2.1.31.1.1.1.15';
const OID_IF_ALIAS = '.1.3.6.1.2.1.31.1.1.1.18';
/**
* Get the number of network interfaces (regardless of
* their current state) present on this system.
*
* @return int The number of network interfaces on the system
*/
public function numberOfInterfaces()
{
return $this->getSNMP()->get( self::OID_IF_NUMBER );
}
/**
* Get an array of device MTUs
*
* @return array An array of device MTUs
*/
public function mtus()
{
return $this->getSNMP()->walk1d( self::OID_IF_MTU );
}
/**
* Get an array of the interfaces' physical addresses
*
* "The interface's address at the protocol layer
* immediately `below' the network layer in the
* protocol stack. For interfaces which do not have
* such an address (e.g., a serial line), this object
* should contain an octet string of zero length."
*
* @return array An array of device physical addresses
*/
public function physAddresses()
{
$pa = $this->getSNMP()->walk1d( self::OID_IF_PHYS_ADDRESS );
// some switches return leading '00:' as '0:' - we correct this here:
foreach( $pa as $i => $a )
if( strpos( $a, ':' ) == 1 )
$pa[ $i ] = '0' . $a;
return $pa;
}
/**
* Constant for possible value of interface admin status.
* @see adminStates()
*/
const IF_ADMIN_STATUS_UP = 1;
/**
* Constant for possible value of interface admin status.
* @see adminStates()
*/
const IF_ADMIN_STATUS_DOWN = 2;
/**
* Constant for possible value of interface admin status.
* @see adminStates()
*/
const IF_ADMIN_STATUS_TESTING = 3;
/**
* Text representation of interface admin status.
*
* @see adminStates()
* @var array Text representations of interface admin status.
*/
public static $IF_ADMIN_STATES = array(
self::IF_ADMIN_STATUS_UP => 'up',
self::IF_ADMIN_STATUS_DOWN => 'down',
self::IF_ADMIN_STATUS_TESTING => 'testing'
);
/**
* Get an array of device interface admin status (up / down)
*
* E.g. the follow SNMP output yields the shown array:
*
* .1.3.6.1.2.1.2.2.1.7.10128 = INTEGER: up(1)
* .1.3.
|
{
"pile_set_name": "Github"
}
|
angular.module('uiRouterSample.contacts.service', [
])
// A RESTful factory for retrieving contacts from 'contacts.json'
.factory('contacts', ['$http', 'utils', function ($http, utils) {
var path = 'assets/contacts.json';
var contacts = $http.get(path).then(function (resp) {
return resp.data.contacts;
});
var factory = {};
factory.all = function () {
return contacts;
};
factory.get = function (id) {
return contacts.then(function(){
return utils.findById(contacts, id);
})
};
return factory;
}]);
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html id="top">
<head>
<meta charset="utf-8">
<title>The Crosswalk Project</title>
<link rel="shorcut icon" href="/assets/favicon.ico" type="image/x-icon" />
<link rel="icon" href="/assets/favicon.ico" type="image/x-icon" />
<script>
WebFontConfig = {
custom: {
families: ['Clear Sans'],
urls: ['/css/fonts.css']
},
google: {
families: ['Source Code Pro:n4,n6']
},
timeout: 2000
};
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script async defer src="//ajax.googleapis.com/ajax/libs/webfont/1.5.3/webfont.js"></script>
<link rel="stylesheet" href="/css/main.css">
<meta name="description" content="Enable the most advanced web innovations with the Crosswalk Project web runtime to develop powerful Android and Cordova apps." />
<meta name="author" content="Crosswalk" />
<meta name="handheldfriendly" content="true" />
<meta name="mobileoptimized" content="320" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta http-equiv="cleartype" content="on" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- Facebook -->
<meta property="og:side_name" content="Crosswalk" />
<meta property="og:title" content="Crosswalk" />
<meta property="og:url" content="http://crosswalk-project.org/documentation/tutorials/screens" />
<meta property="og:description" content="Enable the most advanced web innovations with the Crosswalk Project web runtime to develop powerful Android and Cordova apps." />
<meta property="og:image" content="/assets/crosswalk-og-banner.jpg" />
<!-- Twitter -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:url" content="http://crosswalk-project.org/documentation/tutorials/screens" />
<meta name="twitter:title" content="Crosswalk" />
<meta name="twitter:description" content="Enable the most advanced web innovations with the Crosswalk Project web runtime to develop powerful Android and Cordova apps." />
<meta name="twitter:site" content="@xwalk_project" />
<!-- Relevant original Crosswalk Project JS -->
<script src="/js/utils.js"></script>
<script src="/js/xwalk.js"></script>
<script src="/js/versions.js"></script>
<script src="/js/demos.js"></script>
<script src="/js/testimonials.js"></script>
<script src="/js/tools.js"></script>
<script src="/js/qualityindicators.js"></script>
<script src="/js/i18n.js"></script>
<script src="/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script language="javascript" type="text/javascript">
var style = document.createElement('style');
style.type = "text/css";
style.id = "antiClickjack";
style.innerHTML = "body{display:none !important;}";
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
</head>
<body>
<!-- If curr page named 'index' and less than 2 dirs deep,
do custom layouts. (home screen, blog, app-mgmt page)
Else, provide doc header and nav. -->
<div class="container">
<div class="doc-header">
<div class="doc-logo-div">
<a href="/" class="doc-logo-link">
<img src="/assets/identity/crosswalkproject-logo-horizontal-dark.png" class="doc-logo-img">
</a>
</div>
<div class="doc-nav-div">
<ul class="doc-nav-list">
<li class="doc-nav-item">
<a href="/documentation/getting_started.html" class="doc-nav-link">Documentation</a>
</li>
<li class="doc-nav-item">
<a href="/blog" class="doc-nav-link">Blog</a>
</li>
<li class="doc-nav-item hide-on-small">
<a href="/contribute" class="doc-nav-link">Contribute</a>
</li>
<li class="doc-nav-item hide-on-small">
<a href="https://github.com/crosswalk-project/crosswalk-website/wiki" class="doc-nav-link">Wiki</a>
</li>
<li class="doc-nav-item hide-on-small">
<a href="/documentation/about/faq.html" class="doc-nav-link">FAQ</a>
</li>
<li class="doc-nav-item">
<span class="i18n-label" id="i18n-label">
<span id="i18n-inner">
<img src="/assets/i18n-globe.png" class="i18n-globe" />
English
<img src="/assets/i18n-arrow.png" class="i18n-arrow"/>
</span>
<div id="i18n-menu" class="i18n-menu i18n-menu-light">
<a onclick="switchLanguage('English')">English</a>
<a onclick="switchLanguage('Chinese')">中文版</a>
</div>
</span>
</li>
</ul>
</div>
</div>
<br />
<div class="doc-main">
<div class="row">
<div id="translation-missing-toaster">
<p style="padding:10px"> 抱歉,该网页目前还不存在中文版本,请继续浏览其他网页! </p>
</div>
<nav id="contents" class="article-toc nav-toggleContainer">
<a href="#contents" id="contents-toggle" class="button button--small button--tertiary nav-toggle">Table of Contents</a>
<a href="./#contents-toggle" class="button button--small button--tertiary nav-toggle--dummy">Table of Contents</a>
<ul class="article-list nav-toggleHide">
<li class="article-item ">
<a class="article-link" href="/documentation/about.html">About</a>
</li>
<li class="article-item ">
<a class="article-link" href="/documentation/getting_started.html">Getting Started</a>
</li>
<li class="article-item ">
<a class="article-link" href="/documentation/crosswalk-app-tools.html">Crosswalk App Tools</a>
</li>
<li class="article-item ">
<a class="article-link" href="/documentation/android.html">Android</a>
</li>
<li class="article-item ">
<a class="article-link" href="/documentation/ios.html">iOS</a>
</li>
<li class="article-item ">
<a class="article-link" href="/documentation/windows.html">Windows</a>
</li>
<li class="article-item ">
<a class="article-link" href="/documentation/linux.html">Linux</a>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation source="http://www.phpunit.de/manual/3.7/en/appendixes.configuration.html">
This Schema file defines the rules by which the XML configuration file of PHPUnit 3.7 may be structured.
</xs:documentation>
<xs:appinfo source="http://www.phpunit.de/manual/current/en/appendixes.configuration.html"/>
</xs:annotation>
<xs:element name="phpunit" type="phpUnitType">
<xs:annotation>
<xs:documentation>Root Element</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="filtersType">
<xs:choice>
<xs:sequence>
<xs:element name="blacklist" type="filterType"/>
<xs:element name="whitelist" type="whiteListType" minOccurs="0"/>
</xs:sequence>
<xs:sequence>
<xs:element name="whitelist" type="whiteListType"/>
</xs:sequence>
</xs:choice>
</xs:complexType>
<xs:complexType name="filterType">
<xs:sequence>
<xs:group ref="pathGroup"/>
<xs:element name="exclude" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:group ref="pathGroup"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="whiteListType">
<xs:complexContent>
<xs:extension base="filterType">
<xs:attribute name="processUncoveredFilesFromWhitelist" default="true" type="xs:boolean"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="groupsType">
<xs:choice>
<xs:sequence>
<xs:element name="include" type="groupType"/>
<xs:element name="exclude" type="groupType" minOccurs="0"/>
</xs:sequence>
<xs:sequence>
<xs:element name="exclude" type="groupType"/>
</xs:sequence>
</xs:choice>
</xs:complexType>
<xs:complexType name="groupType">
<xs:sequence>
<xs:element name="group" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="listenersType">
<xs:sequence>
<xs:element name="listener" type="objectType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="objectType">
<xs:sequence>
<xs:element name="arguments" minOccurs="0">
<xs:complexType>
<xs:group ref="argumentsGroup"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="class" type="xs:string" use="required"/>
<xs:attribute name="file" type="xs:anyURI"/>
</xs:complexType>
<xs:complexType name="arrayType">
<xs:sequence>
<xs:element name="element" type="argumentType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="argumentType">
<xs:group ref="argumentChoice"/>
<xs:attribute name="key" use="required"/>
</xs:complexType>
<xs:group name="argumentsGroup">
<xs:sequence>
<xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="null" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
<xs:group name="argumentChoice">
<xs:choice>
<xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="null" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
</xs:group>
<xs:complexType name="loggersType">
<xs:sequence>
<xs:element name="log" type="loggerType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="loggerType">
<xs:attribute name="type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="coverage-html"/>
<xs:enumeration value="coverage-clover"/>
<xs:enumeration value="json"/>
<xs:enumeration value="plain"/>
<xs:enumeration value="tap"/>
<xs:enumeration value="junit"/>
<xs:enumeration value="testdox-html"/>
<xs:enumeration value="testdox-text"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="target" type="xs:anyURI"/>
<xs:attribute name="title" type="xs:string"/>
<xs:attribute name="charset" type="xs:string" default="UTF-8"/>
<xs:attribute name="yui" type="xs:boolean" default="true"/>
<xs:attribute name="highlight" type="xs:boolean" default="false"/>
<xs:attribute name="lowUpperBound" type="xs:nonNegativeInteger" default="35"/>
<xs:attribute name="highLowerBound" type="xs:nonNegativeInteger" default="70"/>
<xs:attribute name="logIncompleteSkipped" type="xs:boolean" default="false"/>
</xs:complexType>
<xs:group name="pathGroup">
<xs:sequence>
<xs:element name="directory" type="directoryFilterType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="file" type="fileFilterType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
<xs:complexType name="directoryFilterType">
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute type="xs:string" name="suffix" default="Test.php"/>
<xs:attributeGroup ref="phpVersionGroup"/>
</xs:extension>
</xs:simpleContent>
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.Shared.Tagging;
using Microsoft.CodeAnalysis.Shared.Collections;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Tagging;
namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics
{
internal abstract partial class AbstractAggregatedDiagnosticsTagSource<TTag> : TagSource<TTag> where TTag : ITag
{
private readonly DiagnosticService _service;
private readonly Mode _mode;
protected AbstractAggregatedDiagnosticsTagSource(
ITextBuffer subjectBuffer,
IForegroundNotificationService notificationService,
DiagnosticService service,
IAsynchronousOperationListener asyncListener) :
base(subjectBuffer, notificationService, asyncListener)
{
_service = service;
_mode = GetMode(subjectBuffer);
}
private Mode GetMode(ITextBuffer subjectBuffer)
{
Workspace workspace;
if (Workspace.TryGetWorkspace(subjectBuffer.AsTextContainer(), out workspace) && workspace.Kind == WorkspaceKind.Preview)
{
return new ReadOnlyMode(this);
}
return new InteractiveMode(this);
}
protected override void Disconnect()
{
base.Disconnect();
_mode.Disconnect();
}
protected abstract int MinimumLength { get; }
protected abstract bool ShouldInclude(DiagnosticData diagnostic);
protected abstract TagSpan<TTag> CreateTagSpan(SnapshotSpan span, DiagnosticData diagnostic);
public override ITagSpanIntervalTree<TTag> GetTagIntervalTreeForBuffer(ITextBuffer buffer)
{
if (buffer == this.SubjectBuffer)
{
return _mode;
}
return null;
}
private static SnapshotSpan AdjustSnapshotSpan(SnapshotSpan span, int minimumLength)
{
var snapshot = span.Snapshot;
// new length
var length = Math.Max(span.Length, minimumLength);
// make sure start + length is smaller than snapshot.Length and start is >= 0
var start = Math.Max(0, Math.Min(span.Start, snapshot.Length - length));
// make sure length is smaller than snapshot.Length which can happen if start == 0
return new SnapshotSpan(snapshot, start, Math.Min(start + length, snapshot.Length) - start);
}
protected override void RecomputeTagsForeground()
{
// do nothing, we don't use this.
}
private class IntervalIntrospector : IIntervalIntrospector<Data>
{
public readonly ITextSnapshot Snapshot;
public IntervalIntrospector(ITextSnapshot snapshot)
{
this.Snapshot = snapshot;
}
public int GetStart(Data value)
{
return value.TrackingSpan.GetStartPoint(this.Snapshot);
}
public int GetLength(Data value)
{
return value.TrackingSpan.GetSpan(this.Snapshot).Length;
}
}
private struct Data
{
public readonly DiagnosticData Diagnostic;
public readonly ITrackingSpan TrackingSpan;
public Data(DiagnosticData diagnostic, ITrackingSpan trackingSpan)
{
this.Diagnostic = diagnostic;
this.TrackingSpan = trackingSpan;
}
public bool IsDefault
{
get { return this.Diagnostic == null; }
}
public SnapshotSpan GetSnapshotSpan(ITextSnapshot snapshot, int minimumLength)
{
var span = this.TrackingSpan.GetSpan(snapshot);
return AdjustSnapshotSpan(span, minimumLength);
}
}
private abstract class Mode : ITagSpanIntervalTree<TTag>
{
protected readonly AbstractAggregatedDiagnosticsTagSource<TTag> Owner;
public Mode(AbstractAggregatedDiagnosticsTagSource<TTag> owner)
{
this.Owner = owner;
}
public abstract void Disconnect();
public abstract IList<ITagSpan<TTag>> GetIntersectingSpans(SnapshotSpan snapshotSpan);
protected DiagnosticService DiagnosticService
{
get { return this.Owner._service; }
}
protected ITextBuffer SubjectBuffer
{
get { return this.Owner.SubjectBuffer; }
}
protected IAsynchronousOperationListener Listener
{
get { return this.Owner.Listener; }
}
protected void RefreshEntireBuffer()
{
var snapshot = this.SubjectBuffer.CurrentSnapshot;
this.Owner.RaiseTagsChanged(this.SubjectBuffer, new NormalizedSnapshotSpanCollection(snapshot, new Span(0, snapshot.Length)));
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
/* @flow */
/**
* context
*/
context('desc', () => {});
// $FlowExpectedError number. This type is incompatible with function type.
context('desc', 12);
// $FlowExpectedError number. This type is incompatible with undefined.
context('desc', () => 1);
// $FlowExpectedError number. This type is incompatible with string.
context(12, () => {});
/**
* context.skip
*/
context.skip('desc', () => {});
// $FlowExpectedError number. This type is incompatible with function type.
context.skip('desc', 12);
// $FlowExpectedError number. This type is incompatible with undefined.
context.skip('desc', () => 1);
// $FlowExpectedError number. This type is incompatible with string.
context.skip(12, () => {});
/**
* context.only
*/
context.only('desc', () => {});
// $FlowExpectedError number. This type is incompatible with function type.
context.only('desc', 12);
// $FlowExpectedError number. This type is incompatible with undefined.
context.only('desc', () => 1);
// $FlowExpectedError number. This type is incompatible with string.
context.only(12, () => {});
/**
* context.timeout
*/
context.timeout(1000);
// $FlowExpectedError string. This type is incompatible with number.
context.timeout('1000');
|
{
"pile_set_name": "Github"
}
|
from __future__ import division, absolute_import, print_function
import os
from numpy.distutils.fcompiler import FCompiler
compilers = ['LaheyFCompiler']
class LaheyFCompiler(FCompiler):
compiler_type = 'lahey'
description = 'Lahey/Fujitsu Fortran 95 Compiler'
version_pattern = r'Lahey/Fujitsu Fortran 95 Compiler Release (?P<version>[^\s*]*)'
executables = {
'version_cmd' : ["<F90>", "--version"],
'compiler_f77' : ["lf95", "--fix"],
'compiler_fix' : ["lf95", "--fix"],
'compiler_f90' : ["lf95"],
'linker_so' : ["lf95", "-shared"],
'archiver' : ["ar", "-cr"],
'ranlib' : ["ranlib"]
}
module_dir_switch = None #XXX Fix me
module_include_switch = None #XXX Fix me
def get_flags_opt(self):
return ['-O']
def get_flags_debug(self):
return ['-g', '--chk', '--chkglobal']
def get_library_dirs(self):
opt = []
d = os.environ.get('LAHEY')
if d:
opt.append(os.path.join(d, 'lib'))
return opt
def get_libraries(self):
opt = []
opt.extend(['fj9f6', 'fj9i6', 'fj9ipp', 'fj9e6'])
return opt
if __name__ == '__main__':
from distutils import log
log.set_verbosity(2)
from numpy.distutils import customized_fcompiler
print(customized_fcompiler(compiler='lahey').get_version())
|
{
"pile_set_name": "Github"
}
|
function! asyncomplete#sources#ale#get_source_options(...) abort
let l:default = extend({
\ 'name': 'ale',
\ 'completor': function('asyncomplete#sources#ale#completor'),
\ 'whitelist': ['*'],
\ 'triggers': asyncomplete#sources#ale#get_triggers(),
\ }, a:0 >= 1 ? a:1 : {})
return extend(l:default, {'refresh_pattern': '\k\+$'})
endfunction
function! asyncomplete#sources#ale#get_triggers() abort
let l:triggers = ale#completion#GetAllTriggers()
let l:triggers['*'] = l:triggers['<default>']
return l:triggers
endfunction
function! asyncomplete#sources#ale#completor(options, context) abort
let l:keyword = matchstr(a:context.typed, '\w\+$')
let l:startcol = a:context.col - len(l:keyword)
call ale#completion#GetCompletions('ale-callback', { 'callback': {completions ->
\ asyncomplete#complete(a:options.name, a:context, l:startcol, completions)
\ }})
endfunction
|
{
"pile_set_name": "Github"
}
|
/* eslint-env jest */
import filterReduce from './filter-reduce'
const add = (a, b) => a + b
const data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
const isEven = x => !(x & 1)
it('filterReduce', () => {
// Returns all elements not matching the predicate and the result of
// a reduction over those who do.
expect(filterReduce(data, isEven, add)).toEqual([1, 3, 5, 7, 9, 20])
// The default reducer is the identity.
expect(filterReduce(data, isEven)).toEqual([1, 3, 5, 7, 9, 0])
// If an initial value is passed it is used.
expect(filterReduce(data, isEven, add, 22)).toEqual([1, 3, 5, 7, 9, 42])
})
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef INCLUDE_LIBYUV_SCALE_H_ // NOLINT
#define INCLUDE_LIBYUV_SCALE_H_
#include "basic_types.h"
#ifdef __cplusplus
namespace libyuv {
extern "C" {
#endif
// Supported filtering.
typedef enum FilterMode {
kFilterNone = 0, // Point sample; Fastest.
kFilterLinear = 1, // Filter horizontally only.
kFilterBilinear = 2, // Faster than box, but lower quality scaling down.
kFilterBox = 3 // Highest quality.
} FilterModeEnum;
// Scale a YUV plane.
LIBYUV_API
void ScalePlane(const uint8* src, int src_stride,
int src_width, int src_height,
uint8* dst, int dst_stride,
int dst_width, int dst_height,
enum FilterMode filtering);
LIBYUV_API
void ScalePlane_16(const uint16* src, int src_stride,
int src_width, int src_height,
uint16* dst, int dst_stride,
int dst_width, int dst_height,
enum FilterMode filtering);
// Scales a YUV 4:2:0 image from the src width and height to the
// dst width and height.
// If filtering is kFilterNone, a simple nearest-neighbor algorithm is
// used. This produces basic (blocky) quality at the fastest speed.
// If filtering is kFilterBilinear, interpolation is used to produce a better
// quality image, at the expense of speed.
// If filtering is kFilterBox, averaging is used to produce ever better
// quality image, at further expense of speed.
// Returns 0 if successful.
LIBYUV_API
int I420Scale(const uint8* src_y, int src_stride_y,
const uint8* src_u, int src_stride_u,
const uint8* src_v, int src_stride_v,
int src_width, int src_height,
uint8* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int dst_width, int dst_height,
enum FilterMode filtering);
LIBYUV_API
int I420Scale_16(const uint16* src_y, int src_stride_y,
const uint16* src_u, int src_stride_u,
const uint16* src_v, int src_stride_v,
int src_width, int src_height,
uint16* dst_y, int dst_stride_y,
uint16* dst_u, int dst_stride_u,
uint16* dst_v, int dst_stride_v,
int dst_width, int dst_height,
enum FilterMode filtering);
#ifdef __cplusplus
// Legacy API. Deprecated.
LIBYUV_API
int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v,
int src_stride_y, int src_stride_u, int src_stride_v,
int src_width, int src_height,
uint8* dst_y, uint8* dst_u, uint8* dst_v,
int dst_stride_y, int dst_stride_u, int dst_stride_v,
int dst_width, int dst_height,
LIBYUV_BOOL interpolate);
// Legacy API. Deprecated.
LIBYUV_API
int ScaleOffset(const uint8* src_i420, int src_width, int src_height,
uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset,
LIBYUV_BOOL interpolate);
// For testing, allow disabling of specialized scalers.
LIBYUV_API
void SetUseReferenceImpl(LIBYUV_BOOL use);
#endif // __cplusplus
#ifdef __cplusplus
} // extern "C"
} // namespace libyuv
#endif
#endif // INCLUDE_LIBYUV_SCALE_H_ NOLINT
|
{
"pile_set_name": "Github"
}
|
//
// DetectedIssueTests.swift
// SwiftFHIR
//
// Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-21.
// 2019, SMART Health IT.
//
import XCTest
#if !NO_MODEL_IMPORT
import Models
typealias SwiftFHIRDetectedIssue = Models.DetectedIssue
#else
import SwiftFHIR
typealias SwiftFHIRDetectedIssue = SwiftFHIR.DetectedIssue
#endif
class DetectedIssueTests: XCTestCase {
func instantiateFrom(filename: String) throws -> SwiftFHIRDetectedIssue {
return try instantiateFrom(json: try readJSONFile(filename))
}
func instantiateFrom(json: FHIRJSON) throws -> SwiftFHIRDetectedIssue {
return try SwiftFHIRDetectedIssue(json: json)
}
func testDetectedIssue1() {
do {
let instance = try runDetectedIssue1()
try runDetectedIssue1(instance.asJSON())
}
catch let error {
XCTAssertTrue(false, "Must instantiate and test DetectedIssue successfully, but threw:\n---\n\(error)\n---")
}
}
@discardableResult
func runDetectedIssue1(_ json: FHIRJSON? = nil) throws -> SwiftFHIRDetectedIssue {
let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "detectedissue-example-allergy.json")
XCTAssertEqual(inst.id, "allergy")
XCTAssertEqual(inst.meta?.tag?[0].code, "HTEST")
XCTAssertEqual(inst.meta?.tag?[0].display, "test health data")
XCTAssertEqual(inst.meta?.tag?[0].system?.absoluteString, "http://terminology.hl7.org/CodeSystem/v3-ActReason")
XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!)
XCTAssertEqual(inst.text?.div, "<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering here]</div>")
XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!)
return inst
}
func testDetectedIssue2() {
do {
let instance = try runDetectedIssue2()
try runDetectedIssue2(instance.asJSON())
}
catch let error {
XCTAssertTrue(false, "Must instantiate and test DetectedIssue successfully, but threw:\n---\n\(error)\n---")
}
}
@discardableResult
func runDetectedIssue2(_ json: FHIRJSON? = nil) throws -> SwiftFHIRDetectedIssue {
let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "detectedissue-example-dup.json")
XCTAssertEqual(inst.author?.reference, "Device/software")
XCTAssertEqual(inst.code?.coding?[0].code, "DUPTHPY")
XCTAssertEqual(inst.code?.coding?[0].display, "Duplicate Therapy Alert")
XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://terminology.hl7.org/CodeSystem/v3-ActCode")
XCTAssertEqual(inst.detail, "Similar test was performed within the past 14 days")
XCTAssertEqual(inst.id, "duplicate")
XCTAssertEqual(inst.identifiedDateTime?.description, "2013-05-08")
XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://example.org")
XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!)
XCTAssertEqual(inst.identifier?[0].value, "12345")
XCTAssertEqual(inst.implicated?[0].display, "Chest CT - ordered May 8, 2013 by Dr. Adam Careful")
XCTAssertEqual(inst.implicated?[0].reference, "ServiceRequest/di")
XCTAssertEqual(inst.implicated?[1].display, "Image 1 from Series 3: CT Images on Patient MINT (MINT1234) taken at 1-Jan 2011 01:20 AM")
XCTAssertEqual(inst.implicated?[1].reference, "ImagingStudy/example")
XCTAssertEqual(inst.meta?.tag?[0].code, "HTEST")
XCTAssertEqual(inst.meta?.tag?[0].display, "test health data")
XCTAssertEqual(inst.meta?.tag?[0].system?.absoluteString, "http://terminology.hl7.org/CodeSystem/v3-ActReason")
XCTAssertEqual(inst.patient?.reference, "Patient/dicom")
XCTAssertEqual(inst.reference?.absoluteString, "http://www.tmhp.com/RadiologyClinicalDecisionSupport/2011/CHEST%20IMAGING%20GUIDELINES%202011.pdf")
XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!)
XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!)
return inst
}
func testDetectedIssue3() {
do {
let instance = try runDetectedIssue3()
try runDetectedIssue3(instance.asJSON())
}
catch let error {
XCTAssertTrue(false, "Must instantiate and test DetectedIssue successfully, but threw:\n---\n\(error)\n---")
}
}
@discardableResult
func runDetectedIssue3(_ json: FHIRJSON? = nil) throws -> SwiftFHIRDetectedIssue {
let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "detectedissue-example.json")
XCTAssertEqual(inst.author?.reference, "Device/software")
XCTAssertEqual(inst.code?.coding?[0].code, "DRG")
XCTAssertEqual(inst.code?.coding?[0].display, "Drug Interaction Alert")
XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://terminology.hl7.org/CodeSystem/v3-ActCode")
XCTAssertEqual(inst.id, "ddi")
XCTAssertEqual(inst.identifiedDateTime?.description, "2014-01-05")
XCTAssertEqual(inst.implicated?[0].display, "500 mg Acetaminophen tablet 1/day, PRN since 2010")
XCTAssertEqual(inst.implicated?[0].reference, "MedicationStatement/example001")
XCTAssertEqual(inst.implicated?[1].display, "Warfarin 1 MG TAB prescribed Jan. 15, 2015")
XCTAssertEqual(inst.implicated?[1].reference, "MedicationRequest/medrx0331")
XCTAssertEqual(inst.meta?.tag?[0].code, "HTEST")
XCTAssertEqual(inst.meta?.tag?[0].display, "test health data")
XCTAssertEqual(inst.meta?.tag?[0].system?.absoluteString, "http://terminology.hl7.org/CodeSystem/v3-ActReason")
XCTAssertEqual(inst.mitigation?[0].action?.coding?[0].code, "13")
XCTAssertEqual(inst.mitigation?[0].action?.coding?[0].display, "Stopped Concurrent Therapy")
XCTAssertEqual(inst.mitigation?[0].action?.coding?[0].system?.absoluteString, "http://terminology.hl7.org/CodeSystem/v3-ActCode")
XCTAssertEqual(inst.mitigation?[0].action?.text, "Asked patient to discontinue regular use of Tylenol and to consult with clinician if they need to resume to allow appropriate INR monitoring")
XCTAssertEqual(inst.mitigation?[0].author?.display, "Dr. Adam Careful")
XCTAssertEqual(inst.mitigation?[0].author?.reference, "Practitioner/example")
XCTAssertEqual(inst.mitigation?[0].date?.description, "2014-01-05")
XCT
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
br_load_config()
{
local arg1 arg2 line
while read line
do
arg1=`echo $line | cut -d " " -f 1`
arg2=`echo $line | cut -d " " -f 2`
case $arg1 in
"HIDE_PORT")
br_hide_port=$arg2;;
"HIDE_FILE")
br_hide_file=$arg2;;
"HIDE_PROC")
br_hide_proc=$arg2;;
"REMOTE_HOST")
br_remote_host=$arg2;;
"REMOTE_PORT")
br_remote_port=$arg2;;
"SLEEP_TIME")
br_sleep_time=$arg2;;
esac
done < $1
}
br_display_config()
{
echo -e "HIDE_PORT:"
echo $br_hide_port
echo -e "HIDE_FILE:"
echo $br_hide_file
echo -e "HIDE_PROC:"
echo $br_hide_proc
echo -e "REMOTE_HOST:"
echo $br_remote_host
echo -e "REMOTE_PORT:"
echo $br_remote_port
echo -e "SLEEP_TIME:"
echo $br_sleep_time
}
br_load_config "/home/$USER/.../brsh.conf"
#br_display_config
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.gradle.plugins.ide.tooling.r214
import org.gradle.integtests.tooling.fixture.TargetGradleVersion
import org.gradle.integtests.tooling.fixture.ToolingApiSpecification
import org.gradle.test.fixtures.maven.MavenFileModule
import org.gradle.test.fixtures.maven.MavenFileRepository
import org.gradle.tooling.model.eclipse.EclipseExternalDependency
import org.gradle.tooling.model.eclipse.EclipseProject
import org.gradle.tooling.model.eclipse.EclipseProjectDependency
@TargetGradleVersion('>=2.14')
class ToolingApiEclipseModelWtpClasspathAttributesCrossVersionSpec extends ToolingApiSpecification {
String localMaven
def setup() {
MavenFileRepository mavenRepo = new MavenFileRepository(file("maven-repo"))
MavenFileModule exampleApi = mavenRepo.module("org.example", "example-api", "1.0")
MavenFileModule exampleLib = mavenRepo.module("org.example", "example-lib", "1.0")
exampleLib.dependsOn(exampleApi)
exampleApi.publish()
exampleLib.publish()
localMaven = "maven { url '${mavenRepo.uri}' }"
}
def "Dependencies of a non-wtp project have no wtp deployment attributes"() {
given:
settingsFile << "include 'sub'"
buildFile <<
"""apply plugin: 'java'
repositories { $localMaven }
dependencies {
compile 'org.example:example-api:1.0'
compile project(':sub')
}
project(':sub') { apply plugin : 'java' }
"""
when:
EclipseProject eclipseProject = loadToolingModel(EclipseProject)
Collection<EclipseExternalDependency> externalDependencies = eclipseProject.getClasspath()
Collection<EclipseProjectDependency> projectDependencies = eclipseProject.getProjectDependencies()
then:
externalDependencies.size() == 1
entryHasNoDeploymentInfo(externalDependencies[0])
projectDependencies.size() == 1
entryHasNoDeploymentInfo(projectDependencies[0])
}
def "Web project dependencies have wtp deployment attributes"() {
given:
String pluginDeclaration = appliedPlugins.collect { "apply plugin: '$it'" }.join('\n')
buildFile <<
"""apply plugin: 'java'
$pluginDeclaration
repositories { $localMaven }
dependencies { compile 'org.example:example-api:1.0' }
"""
when:
EclipseProject eclipseProject = loadToolingModel(EclipseProject)
Collection<EclipseExternalDependency> classpath = eclipseProject.getClasspath()
then:
classpath.size() == 1
entryHasDeploymentInfo(classpath[0])
where:
appliedPlugins | _
['war'] | _
['war', 'eclipse-wtp'] | _
['ear'] | _
['ear', 'eclipse-wtp'] | _
}
def "Wtp utility projects do not deploy any dependencies"() {
given:
buildFile <<
"""apply plugin: 'java'
apply plugin: 'eclipse-wtp'
repositories { $localMaven }
dependencies { compile 'org.example:example-lib:1.0' }
"""
when:
EclipseProject eclipseProject = loadToolingModel(EclipseProject)
Collection<EclipseExternalDependency> classpath = eclipseProject.getClasspath()
then:
classpath.size() == 2
entryNotDeployed(classpath[0])
entryNotDeployed(classpath[1])
}
def "Root wtp dependencies and their transitives are deployed to '/'"() {
given:
buildFile <<
"""apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
repositories { $localMaven }
dependencies { compile 'org.example:example-lib:1.0' }
eclipse.wtp.component.rootConfigurations += [ configurations.compile ]
"""
when:
EclipseProject eclipseProject = loadToolingModel(EclipseProject)
Collection<EclipseExternalDependency> classpath = eclipseProject.getClasspath()
then:
classpath.size() == 2
entryIsDeployed(classpath[0], '/')
entryIsDeployed(classpath[1], '/')
}
def "Root wtp dependencies present in minusConfigurations are excluded from deployment"() {
given:
buildFile <<
"""apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
repositories { $localMaven }
dependencies {
providedRuntime 'org.example:example-api:1.0'
compile 'org.example:example-lib:1.0'
}
eclipse.wtp.component.rootConfigurations += [ configurations.compile ]
"""
when:
EclipseProject eclipseProject = loadToolingModel(EclipseProject)
Collection<EclipseExternalDependency> classpath = eclipseProject.getClasspath()
then:
entryNotDeployed(classpath.find { it.file.absolutePath.contains 'example-api' })
entryIsDeployed(classpath.find { it.file.absolutePath.contains 'example-lib' }, '/')
}
def "Library wtp dependencies and their transitives are deployed to '/WEB-INF/lib'"() {
buildFile <<
"""apply plugin: 'java'
apply plugin: 'war'
repositories { $localMaven }
dependencies { compile 'org.example:example-lib:1.0' }
"""
when:
EclipseProject eclipseProject = loadToolingModel(EclipseProject)
Collection<EclipseExternalDependency> classpath = eclipseProject.getClasspath()
then:
classpath.size() == 2
entryIsDeployed(classpath[0], '/WEB-INF/lib')
entryIsDeployed(classpath[1], '/WEB-INF/lib')
}
def "Lib wtp dependencies present in minusConfigurations are excluded from deployment"() {
given:
buildFile <<
"""apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
repositories { $localMaven }
dependencies {
providedRuntime 'org.example:example-api:1.0'
compile 'org.example:example-lib:1.0'
}
"""
when:
EclipseProject eclipseProject = loadToolingModel(EclipseProject)
Collection<EclipseExternalDependency> classpath = eclipseProject.getClasspath()
then:
entryNotDeployed(classpath.find { it.file.absolutePath.contains 'example-api' })
entryIsDeployed(classpath.find { it.file.absolutePath.contains 'example-lib' }, '/WEB-INF/lib')
}
def "Deployment folder follows ear app dir name configuration"() {
buildFile <<
"""apply plugin: 'ear'
apply plugin: 'java'
apply plugin: 'eclipse'
repositories { $localMaven }
dependencies { earlib 'org.example:example-api:1.0' }
eclipse.classpath.plusConfigurations << configurations.earlib
ear { libDirName = '/custom/lib/dir' }
"""
when:
EclipseProject eclipseProject = loadToolingModel(EclipseProject)
Collection<EclipseExternalDependency> classpath = eclipseProject.getClasspath()
then:
classpath.size() == 1
|
{
"pile_set_name": "Github"
}
|
// +build !windows,!plan9
// Copyright 2015 go-termios Author. All Rights Reserved.
// https://github.com/go-termios/termios
// Author: John Lenton <chipaca@github.com>
package sys
import (
"unsafe"
"golang.org/x/sys/unix"
)
// Termios represents terminal attributes.
type Termios unix.Termios
// NewTermiosFromFd extracts the terminal attribute of the given file
// descriptor.
func NewTermiosFromFd(fd int) (*Termios, error) {
var term Termios
if err := Ioctl(fd, getAttrIOCTL, uintptr(unsafe.Pointer(&term))); err != nil {
return nil, err
}
return &term, nil
}
// ApplyToFd applies term to the given file descriptor.
func (term *Termios) ApplyToFd(fd int) error {
return Ioctl(fd, setAttrNowIOCTL, uintptr(unsafe.Pointer(term)))
}
// Copy returns a copy of term.
func (term *Termios) Copy() *Termios {
v := *term
return &v
}
// SetVTime sets the timeout in deciseconds for noncanonical read.
func (term *Termios) SetVTime(v uint8) {
term.Cc[unix.VTIME] = v
}
// SetVMin sets the minimal number of characters for noncanonical read.
func (term *Termios) SetVMin(v uint8) {
term.Cc[unix.VMIN] = v
}
// SetICanon sets the canonical flag.
func (term *Termios) SetICanon(v bool) {
setFlag(&term.Lflag, unix.ICANON, v)
}
// SetEcho sets the echo flag.
func (term *Termios) SetEcho(v bool) {
setFlag(&term.Lflag, unix.ECHO, v)
}
// SetICRNL sets the CRNL iflag bit
func (term *Termios) SetICRNL(v bool) {
setFlag(&term.Iflag, unix.ICRNL, v)
}
// FlushInput discards data written to a file descriptor but not read.
func FlushInput(fd int) error {
return Ioctl(fd, flushIOCTL, uintptr(unix.TCIFLUSH))
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* @file
* Lagoon Drupal 8 development environment configuration file.
*
* This file will only be included on development environments.
*
* It contains some defaults that the Lagoon team suggests, please edit them as required.
*/
// Show all error messages on the site.
$config['system.logging']['error_level'] = 'all';
// Disable Google Analytics from sending dev GA data.
$config['google_analytics.settings']['account'] = 'UA-XXXXXXXX-YY';
// Expiration of cached pages to 0.
$config['system.performance']['cache']['page']['max_age'] = 0;
// Aggregate CSS files off.
$config['system.performance']['css']['preprocess'] = 0;
// Aggregate JavaScript files off.
$config['system.performance']['js']['preprocess'] = 0;
// Stage file proxy URL from production URL.
if (getenv('LAGOON_PRODUCTION_URL')) {
$config['stage_file_proxy.settings']['origin'] = getenv('LAGOON_PRODUCTION_URL');
}
|
{
"pile_set_name": "Github"
}
|
module mod11 {
prefix abc;
namespace "urn:cesnet:mod11";
typedef my_type {
type uint8;
}
leaf l1 {
type "my_type" {
range "5 .. max | 10 .. 20";
}
}
}
|
{
"pile_set_name": "Github"
}
|
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListViewTest", "SEImageListView\ListViewTest.csproj", "{0C74DAD0-CA29-48E0-8EEC-385308368A0C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0C74DAD0-CA29-48E0-8EEC-385308368A0C}.Debug|x86.ActiveCfg = Debug|x86
{0C74DAD0-CA29-48E0-8EEC-385308368A0C}.Debug|x86.Build.0 = Debug|x86
{0C74DAD0-CA29-48E0-8EEC-385308368A0C}.Release|x86.ActiveCfg = Release|x86
{0C74DAD0-CA29-48E0-8EEC-385308368A0C}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
|
{
"pile_set_name": "Github"
}
|
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/* global document */
import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
import EditorUIView from '../../src/editorui/editoruiview';
import ViewCollection from '../../src/viewcollection';
import Locale from '@ckeditor/ckeditor5-utils/src/locale';
describe( 'EditorUIView', () => {
let view, locale;
testUtils.createSinonSandbox();
beforeEach( () => {
locale = new Locale();
view = new EditorUIView( locale );
view.render();
} );
afterEach( () => {
view.destroy();
} );
describe( 'constructor()', () => {
it( 'accepts locale', () => {
expect( view.locale ).to.equal( locale );
} );
it( 'sets all the properties', () => {
expect( view.body ).to.be.instanceof( ViewCollection );
} );
} );
describe( 'render()', () => {
it( 'attach the body collection', () => {
expect( view.body._bodyCollectionContainer.parentNode.classList.contains( 'ck-body-wrapper' ) ).to.be.true;
expect( view.body._bodyCollectionContainer.parentNode.parentNode ).to.equal( document.body );
} );
} );
describe( 'destroy()', () => {
it( 'detach the body collection', () => {
const el = view.body._bodyCollectionContainer;
view.destroy();
expect( el.parentNode ).to.be.null;
} );
it( 'can be called multiple times', () => {
expect( () => {
view.destroy();
view.destroy();
} ).to.not.throw();
} );
} );
} );
|
{
"pile_set_name": "Github"
}
|
namespace ClassLib095
{
public class Class045
{
public static string Property => "ClassLib095";
}
}
|
{
"pile_set_name": "Github"
}
|
#
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# 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.
#
Ohai.plugin(:Network) do
require_relative "../../mixin/network_helper"
provides "network", "counters/network", "macaddress"
include Ohai::Mixin::NetworkHelper
collect_data(:aix) do
require "ipaddr" unless defined?(IPAddr)
# Loads following information.
# :default_interface, :default_gateway - route -n get 0
# :interfaces
# => routes(netstat -nr | grep en0)
# => addresses (ifconfig en0 or lsattr -El en0), macaddress (entstat -d en0 = Hardware Address: be:42:80:00:b0:05)
# => flags (ifconfig en0)
# => state up/down (ifconfig/lsattr)
# => arp (arp -an)
iface = Mash.new
network Mash.new unless network
network[:interfaces] ||= Mash.new
# We unfortunately have to do things a bit different here, if ohai is running
# within a WPAR. For instance, the WPAR isn't aware of some of its own networking
# minutia such as default gateway/route.
unless shell_out("uname -W").stdout.to_i > 0
# :default_interface, :default_gateway - route -n get 0
so = shell_out("netstat -rn |grep default")
so.stdout.lines.each do |line|
items = line.split(" ")
if items[0] == "default"
network[:default_gateway] = items[1]
network[:default_interface] = items[5]
end
end
end
# Splits the ifconfig output to 1 line per interface
if_so = shell_out("ifconfig -a")
if_so.stdout.gsub(/\n(\w+\d+)/, '___\1').split("___").each do |intraface|
splat = intraface.split(":")
interface = splat[0]
line = splat[1..-1][0]
iface[interface] = Mash.new
iface[interface][:state] = (line.include?("<UP,") ? "up" : "down")
intraface.lines.each do |lin|
case lin
when /flags=\S+<(\S+)>/
iface[interface][:flags] = $1.split(",")
iface[interface][:metric] = $1 if lin =~ /metric\s(\S+)/
else
# We have key value pairs.
if lin =~ %r{inet (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(/(\d{1,2}))?}
tmp_addr, tmp_prefix = $1, $3
if tmp_prefix.nil?
netmask = hex_to_dec_netmask($1) if lin =~ /netmask\s0x(\S+)\s/
unless netmask
tmp_prefix ||= "32"
netmask = IPAddr.new("255.255.255.255").mask(tmp_prefix.to_i).to_s
end
else
netmask = IPAddr.new("255.255.255.255").mask(tmp_prefix.to_i).to_s
end
iface[interface][:addresses] ||= Mash.new
iface[interface][:addresses][tmp_addr] = { "family" => "inet", "prefixlen" => tmp_prefix }
iface[interface][:addresses][tmp_addr][:netmask] = netmask
if lin =~ /broadcast\s(\S+)\s/
iface[interface][:addresses][tmp_addr][:broadcast] = $1
end
elsif lin =~ %r{inet6 ([a-f0-9\:]+)%?([\d]*)/?(\d*)?}
# TODO do we have more properties on inet6 in aix? broadcast
iface[interface][:addresses] ||= Mash.new
iface[interface][:addresses][$1] = { "family" => "inet6", "zone_index" => $2, "prefixlen" => $3 }
else
# load all key-values, example "tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1"
properties = lin.split
n = properties.length / 2 - 1
(0..n).each do |i|
iface[interface][properties[i * 2]] = properties[(i * 2 + 1)]
end
end
end
end
# Query macaddress
e_so = shell_out("entstat -d #{interface} | grep \"Hardware Address\"")
iface[interface][:addresses] ||= Mash.new
e_so.stdout.lines.each do |l|
if l =~ /Hardware Address: (\S+)/
iface[interface][:addresses][$1.upcase] = { "family" => "lladdr" }
macaddress $1.upcase unless shell_out("uname -W").stdout.to_i > 0
end
end
end # ifconfig stdout
# Query routes information
%w{inet inet6}.each do |family|
so_n = shell_out("netstat -nrf #{family}")
so_n.stdout.lines.each do |line|
if line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\d+)\s+(\S+)/
interface = $6
iface[interface][:routes] = [] unless iface[interface][:routes]
iface[interface][:routes] << Mash.new( destination: $1, family: family,
via: $2, flags: $3)
end
end
end
# List the arp entries in system.
so = shell_out("arp -an")
count = 0
so.stdout.lines.each do |line|
network[:arp] ||= Mash.new
if line =~ /\s*(\S+) \((\S+)\) at ([a-fA-F0-9\:]+) \[(\w+)\] stored in bucket/
network[:arp][count] ||= Mash.new
network[:arp][count][:remote_host] = $1
network[:arp][count][:remote_ip] = $2
network[:arp][count][:remote_mac] = $3.downcase
count += 1
end
end
network["interfaces"] = iface
end
end
|
{
"pile_set_name": "Github"
}
|
package pagination
import (
"encoding/json"
"io/ioutil"
"net/http"
"net/url"
"strings"
"github.com/gophercloud/gophercloud"
)
// PageResult stores the HTTP response that returned the current page of results.
type PageResult struct {
gophercloud.Result
url.URL
}
// PageResultFrom parses an HTTP response as JSON and returns a PageResult containing the
// results, interpreting it as JSON if the content type indicates.
func PageResultFrom(resp *http.Response) (PageResult, error) {
var parsedBody interface{}
defer resp.Body.Close()
rawBody, err := ioutil.ReadAll(resp.Body)
if err != nil {
return PageResult{}, err
}
if strings.HasPrefix(resp.Header.Get("Content-Type"), "application/json") {
err = json.Unmarshal(rawBody, &parsedBody)
if err != nil {
return PageResult{}, err
}
} else {
parsedBody = rawBody
}
return PageResultFromParsed(resp, parsedBody), err
}
// PageResultFromParsed constructs a PageResult from an HTTP response that has already had its
// body parsed as JSON (and closed).
func PageResultFromParsed(resp *http.Response, body interface{}) PageResult {
return PageResult{
Result: gophercloud.Result{
Body: body,
Header: resp.Header,
},
URL: *resp.Request.URL,
}
}
// Request performs an HTTP request and extracts the http.Response from the result.
func Request(client *gophercloud.ServiceClient, headers map[string]string, url string) (*http.Response, error) {
return client.Get(url, nil, &gophercloud.RequestOpts{
MoreHeaders: headers,
OkCodes: []int{200, 204, 300},
})
}
|
{
"pile_set_name": "Github"
}
|
/**
* Prefixer (tools/_prefixer.scss)
*/
/* ----- Box sizing ----- */
@mixin box-sizing ($value) {
-webkit-box-sizing: $value;
-moz-box-sizing: $value;
box-sizing: $value;
}
/* ----- Transform ----- */
// Rotate
@mixin rotate ($deg) {
-webkit-transform: rotate(#{$deg}deg);
-moz-transform: rotate(#{$deg}deg);
-ms-transform: rotate(#{$deg}deg);
transform: rotate(#{$deg}deg);
}
// Translate
@mixin translate ($x, $y) {
-webkit-transform: translate($x, $y);
-moz-transform: translate($x, $y);
-ms-transform: translate($x, $y);
transform: translate($x, $y);
}
// Translate 3D
@mixin translate3d ($x, $y, $z) {
-webkit-transform: translate3d($x, $y, $z);
-moz-transform: translate3d($x, $y, $z);
transform: translate3d($x, $y, $z);
}
|
{
"pile_set_name": "Github"
}
|
package com.aphidmobile.flip.demo.data;
import java.util.ArrayList;
import java.util.List;
/*
Copyright 2012 Aphid Mobile
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
public class Travels {
public static final List<Data> IMG_DESCRIPTIONS = new ArrayList<Data>();
static {
Travels.IMG_DESCRIPTIONS.add(new Travels.Data("Potala Palace", "potala_palace.jpg",
"The <b>Potala Palace</b> is located in Lhasa, Tibet Autonomous Region, China. It is named after Mount Potalaka, the mythical abode of Chenresig or Avalokitesvara.",
"China", "Lhasa",
"http://en.wikipedia.org/wiki/Potala_Palace"));
Travels.IMG_DESCRIPTIONS.add(new Travels.Data("Drepung Monastery", "drepung_monastery.jpg",
"<b>Drepung Monastery</b>, located at the foot of Mount Gephel, is one of the \"great three\" Gelukpa university monasteries of Tibet.",
"China", "Lhasa",
"http://en.wikipedia.org/wiki/Drepung"));
Travels.IMG_DESCRIPTIONS.add(new Travels.Data("Sera Monastery", "sera_monastery.jpg",
"<b>Sera Monastery</b> is one of the 'great three' Gelukpa university monasteries of Tibet, located 1.25 miles (2.01 km) north of Lhasa.",
"China", "Lhasa",
"http://en.wikipedia.org/wiki/Sera_Monastery"));
Travels.IMG_DESCRIPTIONS.add(new Travels.Data("Samye Monastery", "samye_monastery.jpg",
"<b>Samye Monastery</b> is the first Buddhist monastery built in Tibet, was most probably first constructed between 775 and 779 CE.",
"China", "Samye",
"http://en.wikipedia.org/wiki/Samye"));
Travels.IMG_DESCRIPTIONS.add(
new Travels.Data("Tashilunpo Monastery", "tashilunpo_monastery.jpg",
"<b>Tashilhunpo Monastery</b>, founded in 1447 by Gendun Drup, the First Dalai Lama, is a historic and culturally important monastery next to Shigatse, the second-largest city in Tibet.",
"China", "Shigatse",
"http://en.wikipedia.org/wiki/Tashilhunpo_Monastery"));
Travels.IMG_DESCRIPTIONS.add(new Travels.Data("Zhangmu Port", "zhangmu_port.jpg",
"<b>Zhangmu/Dram</b> is a customs town and port of entry located in Nyalam County on the Nepal-China border, just uphill and across the Bhote Koshi River from the Nepalese town of Kodari.",
"China", "Zhangmu",
"http://en.wikipedia.org/wiki/Zhangmu"));
Travels.IMG_DESCRIPTIONS.add(new Travels.Data("Kathmandu", "kathmandu.jpg",
"<b>Kathmandu</b> is the capital and, with more than one million inhabitants, the largest metropolitan city of Nepal.",
"Nepal", "Kathmandu",
"http://en.wikipedia.org/wiki/Kathmandu"));
Travels.IMG_DESCRIPTIONS.add(new Travels.Data("Pokhara", "pokhara.jpg",
"<b>Pokhara Sub-Metropolitan City</b> is the second largest city of Nepal with approximately 250,000 inhabitants and is situated about 200 km west of the capital Kathmandu.",
"Nepal", "Pokhara",
"http://en.wikipedia.org/wiki/Pokhara"));
Travels.IMG_DESCRIPTIONS.add(new Travels.Data("Patan", "patan.jpg",
"<b>Patan</b>, officially Lalitpur Sub-Metropolitan City, is one of the major cities of Nepal located in the south-central part of Kathmandu Valley.",
"Nepal", "Patan",
"http://en.wikipedia.org/wiki/Patan,_Nepal"));
}
public static final class Data {
public final String title;
public final String imageFilename;
public final String description;
public final String country;
public final String city;
public final String link;
private Data(String title, String imageFilename, String description, String country,
String city, String link) {
this.title = title;
this.imageFilename = imageFilename;
this.description = description;
this.country = country;
this.city = city;
this.link = link;
}
}
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/bash -e
#
# This script rebuilds the generated code for the protocol buffers.
# To run this you will need protoc and goprotobuf installed;
# see https://github.com/golang/protobuf for instructions.
PKG=google.golang.org/appengine
function die() {
echo 1>&2 $*
exit 1
}
# Sanity check that the right tools are accessible.
for tool in go protoc protoc-gen-go; do
q=$(which $tool) || die "didn't find $tool"
echo 1>&2 "$tool: $q"
done
echo -n 1>&2 "finding package dir... "
pkgdir=$(go list -f '{{.Dir}}' $PKG)
echo 1>&2 $pkgdir
base=$(echo $pkgdir | sed "s,/$PKG\$,,")
echo 1>&2 "base: $base"
cd $base
# Run protoc once per package.
for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do
echo 1>&2 "* $dir"
protoc --go_out=. $dir/*.proto
done
for f in $(find $PKG/internal -name '*.pb.go'); do
# Remove proto.RegisterEnum calls.
# These cause duplicate registration panics when these packages
# are used on classic App Engine. proto.RegisterEnum only affects
# parsing the text format; we don't care about that.
# https://code.google.com/p/googleappengine/issues/detail?id=11670#c17
sed -i '/proto.RegisterEnum/d' $f
done
|
{
"pile_set_name": "Github"
}
|
<Map>
<Bangs></Bangs>
<Switches></Switches>
<SliderCurves>
<Mapping>
<Widget>
<WidgetName>color_hue</WidgetName>
<WidgetID>25</WidgetID>
<WidgetCanvasParent>SystemSettings</WidgetCanvasParent>
</Widget>
<Track></Track>
</Mapping>
</SliderCurves>
<NumberDialerCurves></NumberDialerCurves>
</Map>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ADP2,1</key>
<string>Developer Transition Kit</string>
<key>MacBook1,1</key>
<string>MacBook (Core Duo)</string>
<key>MacBook2,1</key>
<string>MacBook (Core 2 Duo)</string>
<key>MacBook4,1</key>
<string>MacBook (Core 2 Duo Feb 2008)</string>
<key>MacBookAir1,1</key>
<string>MacBook Air (January 2008)</string>
<key>MacBookPro1,1</key>
<string>MacBook Pro Core Duo (15-inch)</string>
<key>MacBookPro1,2</key>
<string>MacBook Pro Core Duo (17-inch)</string>
<key>MacBookPro2,1</key>
<string>MacBook Pro Core 2 Duo (17-inch)</string>
<key>MacBookPro2,2</key>
<string>MacBook Pro Core 2 Duo (15-inch)</string>
<key>MacBookPro3,1</key>
<string>MacBook Pro Core 2 Duo (15-inch LED, Core 2 Duo)</string>
<key>MacBookPro3,2</key>
<string>MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo)</string>
<key>MacBookPro4,1</key>
<string>MacBook Pro (Core 2 Duo Feb 2008)</string>
<key>MacPro1,1</key>
<string>Mac Pro (four-core)</string>
<key>MacPro2,1</key>
<string>Mac Pro (eight-core)</string>
<key>MacPro3,1</key>
<string>Mac Pro (January 2008 4- or 8- core "Harpertown")</string>
<key>Macmini1,1</key>
<string>Mac Mini (Core Solo/Duo)</string>
<key>PowerBook1,1</key>
<string>PowerBook G3</string>
<key>PowerBook2,1</key>
<string>iBook G3</string>
<key>PowerBook2,2</key>
<string>iBook G3 (FireWire)</string>
<key>PowerBook2,3</key>
<string>iBook G3</string>
<key>PowerBook2,4</key>
<string>iBook G3</string>
<key>PowerBook3,1</key>
<string>PowerBook G3 (FireWire)</string>
<key>PowerBook3,2</key>
<string>PowerBook G4</string>
<key>PowerBook3,3</key>
<string>PowerBook G4 (Gigabit Ethernet)</string>
<key>PowerBook3,4</key>
<string>PowerBook G4 (DVI)</string>
<key>PowerBook3,5</key>
<string>PowerBook G4 (1GHz / 867MHz)</string>
<key>PowerBook4,1</key>
<string>iBook G3 (Dual USB, Late 2001)</string>
<key>PowerBook4,2</key>
<string>iBook G3 (16MB VRAM)</string>
<key>PowerBook4,3</key>
<string>iBook G3 Opaque 16MB VRAM, 32MB VRAM, Early 2003)</string>
<key>PowerBook5,1</key>
<string>PowerBook G4 (17 inch)</string>
<key>PowerBook5,2</key>
<string>PowerBook G4 (15 inch FW 800)</string>
<key>PowerBook5,3</key>
<string>PowerBook G4 (17-inch 1.33GHz)</string>
<key>PowerBook5,4</key>
<string>PowerBook G4 (15 inch 1.5/1.33GHz)</string>
<key>PowerBook5,5</key>
<string>PowerBook G4 (17-inch 1.5GHz)</string>
<key>PowerBook5,6</key>
<string>PowerBook G4 (15 inch 1.67GHz/1.5GHz)</string>
<key>PowerBook5,7</key>
<string>PowerBook G4 (17-inch 1.67GHz)</string>
<key>PowerBook5,8</key>
<string>PowerBook G4 (Double layer SD, 15 inch)</string>
<key>PowerBook5,9</key>
<string>PowerBook G4 (Double layer SD, 17 inch)</string>
<key>PowerBook6,1</key>
<string>PowerBook G4 (12 inch)</string>
<key>PowerBook6,2</key>
<string>PowerBook G4 (12 inch, DVI)</string>
<key>PowerBook6,3</key>
<string>iBook G4</string>
<key>PowerBook6,4</key>
<string>PowerBook G4 (12 inch 1.33GHz)</string>
<key>PowerBook6,5</key>
<string>iBook G4 (Early-Late 2004)</string>
<key>PowerBook6,7</key>
<string>iBook G4 (Mid 2005)</string>
<key>PowerBook6,8</key>
<string>PowerBook G4 (12 inch 1.5GHz)</string>
<key>PowerMac1,1</key>
<string>Power Macintosh G3 (Blue & White)</string>
<key>PowerMac1,2</key>
<string>Power Macintosh G4 (PCI Graphics)</string>
<key>PowerMac10,1</key>
<string>Mac Mini G4</string>
<key>PowerMac10,2</key>
<string>Mac Mini (Late 2005)</string>
<key>PowerMac11,2</key>
<string>Power Macintosh G5 (Late 2005)</string>
<key>PowerMac12,1</key>
<string>iMac G5 (iSight)</string>
<key>PowerMac2,1</key>
<string>iMac G3 (Slot-loading CD-ROM)</string>
<key>PowerMac2,2</key>
<string>iMac G3 (Summer 2000)</string>
<key>PowerMac3,1</key>
<string>Power Macintosh G4 (AGP Graphics)</string>
<key>PowerMac3,2</key>
<string>Power Macintosh G4 (AGP Graphics)</string>
<key>PowerMac3,3</key>
<string>Power Macintosh G4 (Gigabit Ethernet)</string>
<key>PowerMac3,4</key>
<string>Power Macintosh G4 (Digital Audio)</string>
<key>PowerMac3,5</key>
<string>Power Macintosh G4 (Quick Silver)</string>
<key>PowerMac3,6</key>
<string>Power Macintosh G4 (Mirrored Drive Door)</string>
<key>PowerMac4,1</key>
<string>iMac G3 (Early/Summer 2001)</string>
<key>PowerMac4,2</key>
<string>iMac G4 (Flat Panel)</string>
<key>PowerMac4,4</key>
<string>eMac</string>
<key>PowerMac4,5</key>
<string>iMac G4 (17-inch Flat Panel)</string>
<key>PowerMac5,1</key>
<string>Power Macintosh G4 Cube</string>
<key>PowerMac6,1</key>
<string>iMac G4 (USB 2.0)</string>
<key>PowerMac6,3</key>
<string>iMac
|
{
"pile_set_name": "Github"
}
|
%% [B] = tensor_tucker_prod(A,M)
%
function [B] = tensor_tucker_prod(A,M)
B = A;
for k = 1:length(A.size)
B = ttm(B, M{k}, k);
end
end
|
{
"pile_set_name": "Github"
}
|
// c.js
export const foo = {}
export const yack = {}
export { wolf as default } from './b'
|
{
"pile_set_name": "Github"
}
|
{-# LANGUAGE TemplateHaskell #-}
module Rattletrap.Type.Float32le
( Float32le(..)
)
where
import Rattletrap.Type.Common
newtype Float32le = Float32le
{ float32leValue :: Float
} deriving (Eq, Ord, Show)
$(deriveJson ''Float32le)
|
{
"pile_set_name": "Github"
}
|
@mixin text-decoration($value) {
// <text-decoration-line> || <text-decoration-style> || <text-decoration-color>
@include prefixer(text-decoration, $value, moz);
}
@mixin text-decoration-line($line: none) {
// none || underline || overline || line-through
@include prefixer(text-decoration-line, $line, moz);
}
@mixin text-decoration-style($style: solid) {
// solid || double || dotted || dashed || wavy
@include prefixer(text-decoration-style, $style, moz webkit);
}
@mixin text-decoration-color($color: currentColor) {
// currentColor || <color>
@include prefixer(text-decoration-color, $color, moz);
}
|
{
"pile_set_name": "Github"
}
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -fblocks %s
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks -fobjc-arc %s
// expected-no-diagnostics
struct X {
__unsafe_unretained id object;
int (^ __unsafe_unretained block)(int, int);
};
void f(struct X x) {
x.object = 0;
x.block = ^(int x, int y) { return x + y; };
}
|
{
"pile_set_name": "Github"
}
|
crlf
crlf
lf
crlf
crlf
|
{
"pile_set_name": "Github"
}
|
# should_error
# no-collect-stats
try:
raise SystemExit, "hello"
except Exception as e:
pass
|
{
"pile_set_name": "Github"
}
|
run_spec(__dirname, ["python"], { pythonVersion: "3" });
|
{
"pile_set_name": "Github"
}
|
// Copyright 2011 The Snappy-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package snappy
import (
"encoding/binary"
"errors"
"io"
)
// Encode returns the encoded form of src. The returned slice may be a sub-
// slice of dst if dst was large enough to hold the entire encoded block.
// Otherwise, a newly allocated slice will be returned.
//
// The dst and src must not overlap. It is valid to pass a nil dst.
func Encode(dst, src []byte) []byte {
if n := MaxEncodedLen(len(src)); n < 0 {
panic(ErrTooLarge)
} else if len(dst) < n {
dst = make([]byte, n)
}
// The block starts with the varint-encoded length of the decompressed bytes.
d := binary.PutUvarint(dst, uint64(len(src)))
for len(src) > 0 {
p := src
src = nil
if len(p) > maxBlockSize {
p, src = p[:maxBlockSize], p[maxBlockSize:]
}
if len(p) < minNonLiteralBlockSize {
d += emitLiteral(dst[d:], p)
} else {
d += encodeBlock(dst[d:], p)
}
}
return dst[:d]
}
// inputMargin is the minimum number of extra input bytes to keep, inside
// encodeBlock's inner loop. On some architectures, this margin lets us
// implement a fast path for emitLiteral, where the copy of short (<= 16 byte)
// literals can be implemented as a single load to and store from a 16-byte
// register. That literal's actual length can be as short as 1 byte, so this
// can copy up to 15 bytes too much, but that's OK as subsequent iterations of
// the encoding loop will fix up the copy overrun, and this inputMargin ensures
// that we don't overrun the dst and src buffers.
const inputMargin = 16 - 1
// minNonLiteralBlockSize is the minimum size of the input to encodeBlock that
// could be encoded with a copy tag. This is the minimum with respect to the
// algorithm used by encodeBlock, not a minimum enforced by the file format.
//
// The encoded output must start with at least a 1 byte literal, as there are
// no previous bytes to copy. A minimal (1 byte) copy after that, generated
// from an emitCopy call in encodeBlock's main loop, would require at least
// another inputMargin bytes, for the reason above: we want any emitLiteral
// calls inside encodeBlock's main loop to use the fast path if possible, which
// requires being able to overrun by inputMargin bytes. Thus,
// minNonLiteralBlockSize equals 1 + 1 + inputMargin.
//
// The C++ code doesn't use this exact threshold, but it could, as discussed at
// https://groups.google.com/d/topic/snappy-compression/oGbhsdIJSJ8/discussion
// The difference between Go (2+inputMargin) and C++ (inputMargin) is purely an
// optimization. It should not affect the encoded form. This is tested by
// TestSameEncodingAsCppShortCopies.
const minNonLiteralBlockSize = 1 + 1 + inputMargin
// MaxEncodedLen returns the maximum length of a snappy block, given its
// uncompressed length.
//
// It will return a negative value if srcLen is too large to encode.
func MaxEncodedLen(srcLen int) int {
n := uint64(srcLen)
if n > 0xffffffff {
return -1
}
// Compressed data can be defined as:
// compressed := item* literal*
// item := literal* copy
//
// The trailing literal sequence has a space blowup of at most 62/60
// since a literal of length 60 needs one tag byte + one extra byte
// for length information.
//
// Item blowup is trickier to measure. Suppose the "copy" op copies
// 4 bytes of data. Because of a special check in the encoding code,
// we produce a 4-byte copy only if the offset is < 65536. Therefore
// the copy op takes 3 bytes to encode, and this type of item leads
// to at most the 62/60 blowup for representing literals.
//
// Suppose the "copy" op copies 5 bytes of data. If the offset is big
// enough, it will take 5 bytes to encode the copy op. Therefore the
// worst case here is a one-byte literal followed by a five-byte copy.
// That is, 6 bytes of input turn into 7 bytes of "compressed" data.
//
// This last factor dominates the blowup, so the final estimate is:
n = 32 + n + n/6
if n > 0xffffffff {
return -1
}
return int(n)
}
var errClosed = errors.New("snappy: Writer is closed")
// NewWriter returns a new Writer that compresses to w.
//
// The Writer returned does not buffer writes. There is no need to Flush or
// Close such a Writer.
//
// Deprecated: the Writer returned is not suitable for many small writes, only
// for few large writes. Use NewBufferedWriter instead, which is efficient
// regardless of the frequency and shape of the writes, and remember to Close
// that Writer when done.
func NewWriter(w io.Writer) *Writer {
return &Writer{
w: w,
obuf: make([]byte, obufLen),
}
}
// NewBufferedWriter returns a new Writer that compresses to w, using the
// framing format described at
// https://github.com/google/snappy/blob/master/framing_format.txt
//
// The Writer returned buffers writes. Users must call Close to guarantee all
// data has been forwarded to the underlying io.Writer. They may also call
// Flush zero or more times before calling Close.
func NewBufferedWriter(w io.Writer) *Writer {
return &Writer{
w: w,
ibuf: make([]byte, 0, maxBlockSize),
obuf: make([]byte, obufLen),
}
}
// Writer is an io.Writer that can write Snappy-compressed bytes.
type Writer struct {
w io.Writer
err error
// ibuf is a buffer for the incoming (uncompressed) bytes.
//
// Its use is optional. For backwards compatibility, Writers created by the
// NewWriter function have ibuf == nil, do not buffer incoming bytes, and
// therefore do not need to be Flush'ed or Close'd.
ibuf []byte
// obuf is a buffer for the outgoing (compressed) bytes.
obuf []byte
// wroteStreamHeader is whether we have written the stream header.
wroteStreamHeader bool
}
// Reset discards the writer's state and switches the Snappy writer to write to
// w. This permits reusing a Writer rather than allocating a new one.
func (w *Writer) Reset(writer io.Writer) {
w.w = writer
w.err = nil
if w.ibuf != nil {
w.ibuf = w.ibuf[:0]
}
w.wroteStreamHeader = false
}
// Write satisfies the io.Writer interface.
func (w *Writer) Write(p []byte) (nRet int, errRet error) {
if w.ibuf == nil {
// Do not buffer incoming bytes. This does not perform or compress well
// if the caller of Writer.Write writes many small slices. This
// behavior is therefore deprecated, but still supported for backwards
// compatibility with code that doesn't explicitly Flush or Close.
return w.write(p)
}
// The remainder of this method is based on bufio.Writer.Write from the
// standard library.
for len(p) > (cap(w.ibuf)-len(w.ibuf)) && w.err == nil {
var n int
if len(w.ibuf) == 0 {
// Large write, empty buffer.
// Write directly from p to avoid copy.
n, _ = w.write(p)
} else {
n = copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p)
w.ibuf = w.ibuf[:len(w.
|
{
"pile_set_name": "Github"
}
|
client
dev tun
proto udp
remote 89.238.140.53 1194
resolv-retry infinite
remote-random
nobind
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
ping 15
ping-restart 0
ping-timer-rem
reneg-sec 0
comp-lzo no
remote-cert-tls server
auth-user-pass ../Own_VPN_Config/nordvpnauth.txt
verb 3
pull
fast-io
cipher AES-256-CBC
auth SHA512
<ca>
-----BEGIN CERTIFICATE-----
MIIFCjCCAvKgAwIBAgIBATANBgkqhkiG9w0BAQ0FADA5MQswCQYDVQQGEwJQQTEQ
MA4GA1UEChMHTm9yZFZQTjEYMBYGA1UEAxMPTm9yZFZQTiBSb290IENBMB4XDTE2
MDEwMTAwMDAwMFoXDTM1MTIzMTIzNTk1OVowOTELMAkGA1UEBhMCUEExEDAOBgNV
BAoTB05vcmRWUE4xGDAWBgNVBAMTD05vcmRWUE4gUm9vdCBDQTCCAiIwDQYJKoZI
hvcNAQEBBQADggIPADCCAgoCggIBAMkr/BYhyo0F2upsIMXwC6QvkZps3NN2/eQF
kfQIS1gql0aejsKsEnmY0Kaon8uZCTXPsRH1gQNgg5D2gixdd1mJUvV3dE3y9FJr
XMoDkXdCGBodvKJyU6lcfEVF6/UxHcbBguZK9UtRHS9eJYm3rpL/5huQMCppX7kU
eQ8dpCwd3iKITqwd1ZudDqsWaU0vqzC2H55IyaZ/5/TnCk31Q1UP6BksbbuRcwOV
skEDsm6YoWDnn/IIzGOYnFJRzQH5jTz3j1QBvRIuQuBuvUkfhx1FEwhwZigrcxXu
MP+QgM54kezgziJUaZcOM2zF3lvrwMvXDMfNeIoJABv9ljw969xQ8czQCU5lMVmA
37ltv5Ec9U5hZuwk/9QO1Z+d/r6Jx0mlurS8gnCAKJgwa3kyZw6e4FZ8mYL4vpRR
hPdvRTWCMJkeB4yBHyhxUmTRgJHm6YR3D6hcFAc9cQcTEl/I60tMdz33G6m0O42s
Qt/+AR3YCY/RusWVBJB/qNS94EtNtj8iaebCQW1jHAhvGmFILVR9lzD0EzWKHkvy
WEjmUVRgCDd6Ne3eFRNS73gdv/C3l5boYySeu4exkEYVxVRn8DhCxs0MnkMHWFK6
MyzXCCn+JnWFDYPfDKHvpff/kLDobtPBf+Lbch5wQy9quY27xaj0XwLyjOltpiST
LWae/Q4vAgMBAAGjHTAbMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqG
SIb3DQEBDQUAA4ICAQC9fUL2sZPxIN2mD32VeNySTgZlCEdVmlq471o/bDMP4B8g
nQesFRtXY2ZCjs50Jm73B2LViL9qlREmI6vE5IC8IsRBJSV4ce1WYxyXro5rmVg/
k6a10rlsbK/eg//GHoJxDdXDOokLUSnxt7gk3QKpX6eCdh67p0PuWm/7WUJQxH2S
DxsT9vB/iZriTIEe/ILoOQF0Aqp7AgNCcLcLAmbxXQkXYCCSB35Vp06u+eTWjG0/
pyS5V14stGtw+fA0DJp5ZJV4eqJ5LqxMlYvEZ/qKTEdoCeaXv2QEmN6dVqjDoTAo
k0t5u4YRXzEVCfXAC3ocplNdtCA72wjFJcSbfif4BSC8bDACTXtnPC7nD0VndZLp
+RiNLeiENhk0oTC+UVdSc+n2nJOzkCK0vYu0Ads4JGIB7g8IB3z2t9ICmsWrgnhd
NdcOe15BincrGA8avQ1cWXsfIKEjbrnEuEk9b5jel6NfHtPKoHc9mDpRdNPISeVa
wDBM1mJChneHt59Nh8Gah74+TM1jBsw4fhJPvoc7Atcg740JErb904mZfkIEmojC
VPhBHVQ9LHBAdM8qFI2kRK0IynOmAZhexlP/aT/kpEsEPyaZQlnBn3An1CRz8h0S
PApL8PytggYKeQmRhl499+6jLxcZ2IegLfqq41dzIjwHwTMplg+1pKIOVojpWA==
-----END CERTIFICATE-----
</ca>
key-direction 1
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
e685bdaf659a25a200e2b9e39e51ff03
0fc72cf1ce07232bd8b2be5e6c670143
f51e937e670eee09d4f2ea5a6e4e6996
5db852c275351b86fc4ca892d78ae002
d6f70d029bd79c4d1c26cf14e9588033
cf639f8a74809f29f72b9d58f9b8f5fe
fc7938eade40e9fed6cb92184abb2cc1
0eb1a296df243b251df0643d53724cdb
5a92a1d6cb817804c4a9319b57d53be5
80815bcfcb2df55018cc83fc43bc7ff8
2d51f9b88364776ee9d12fc85cc7ea5b
9741c4f598c485316db066d52db4540e
212e1518a9bd4828219e24b20d88f598
a196c9de96012090e333519ae18d3509
9427e7b372d348d352dc4c85e18cd4b9
3f8a56ddb2e64eb67adfc9b337157ff4
-----END OpenVPN Static key V1-----
</tls-auth>
|
{
"pile_set_name": "Github"
}
|
{
"randomStatetest100" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.6.0-alpha.0-11+commit.978e68d2",
"lllcversion" : "Version: 0.5.0-develop.2018.11.9+commit.9709dfe0.Linux.g++",
"source" : "src/GeneralStateTestsFiller/stRandom/randomStatetest100Filler.json",
"sourceHash" : "5a7773117ba7a738174d9b0689a6cb0374ff146b05571dafce7d50ebcbb92728"
},
"env" : {
"currentCoinbase" : "0x945304eb96065b2a98b57a48a06ae28d285a71b5",
"currentDifficulty" : "0x20000",
"currentGasLimit" : "0x7fffffffffffffff",
"currentNumber" : "0x01",
"currentTimestamp" : "0x03e8",
"previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"post" : {
"Byzantium" : [
{
"hash" : "0x54dfd10f0de86225537244edc47ec0ed9f8e665f0f6271d15e7707f67eca981b",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Constantinople" : [
{
"hash" : "0x54dfd10f0de86225537244edc47ec0ed9f8e665f0f6271d15e7707f67eca981b",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"ConstantinopleFix" : [
{
"hash" : "0x54dfd10f0de86225537244edc47ec0ed9f8e665f0f6271d15e7707f67eca981b",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Homestead" : [
{
"hash" : "0x5881f750258fb642a9cc86dc9a7800652e2fe6bd40b7fa84d514344e90ee25c3",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
},
"pre" : {
"0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x414243444342444283f24455",
"nonce" : "0x00",
"storage" : {
}
},
"0x945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2e",
"code" : "0x6000355415600957005b60203560003555",
"nonce" : "0x00",
"storage" : {
}
},
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : [
"0x42"
],
"gasLimit" : [
"0x061a80"
],
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : [
"0x0186a0"
]
}
}
}
|
{
"pile_set_name": "Github"
}
|
li.file {
border-bottom: 1px solid rgba(234,234,234,1);
padding: units(0.25) units(1);
&:first-child {
border-top: 1px solid rgba(234,234,234,1);
}
h4 {
font-weight: normal;
}
summary:focus {
outline: 0;
}
.status {
background: rgba(0,0,0,0.3);
border-radius: units(0.2);
color: white;
display: inline-block;
font-size: units(0.7);
font-weight: bold;
margin-right: units(0.5);
text-align: center;
width: units(5);
&.added {
background: rgba(113,206,110,1);
}
&.modified {
background: rgba(106,144,201,1);
}
&.deleted {
background: rgba(251,27,46,1);
}
}
.diff {
margin-top: units(0.5);
}
.line {
font-family: monospace;
font-size: units(0.75);
pre {
margin: 0;
padding: 0 units(0.25);
}
&.add {
background: rgba(221,255,221,1);
}
&.delete {
background: rgba(255,221,221,1);
}
&.marker {
background: rgba(248,250,253,1);
}
}
}
|
{
"pile_set_name": "Github"
}
|
from collections import OrderedDict
from json.tests import PyTest, CTest
class TestUnicode(object):
def test_encoding1(self):
encoder = self.json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
js = encoder.encode(s)
self.assertEqual(ju, js)
def test_encoding2(self):
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = self.dumps(u, encoding='utf-8')
js = self.dumps(s, encoding='utf-8')
self.assertEqual(ju, js)
def test_encoding3(self):
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
j = self.dumps(u)
self.assertEqual(j, '"\\u03b1\\u03a9"')
def test_encoding4(self):
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
j = self.dumps([u])
self.assertEqual(j, '["\\u03b1\\u03a9"]')
def test_encoding5(self):
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
j = self.dumps(u, ensure_ascii=False)
self.assertEqual(j, u'"{0}"'.format(u))
def test_encoding6(self):
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
j = self.dumps([u], ensure_ascii=False)
self.assertEqual(j, u'["{0}"]'.format(u))
def test_big_unicode_encode(self):
u = u'\U0001d120'
self.assertEqual(self.dumps(u), '"\\ud834\\udd20"')
self.assertEqual(self.dumps(u, ensure_ascii=False), u'"\U0001d120"')
def test_big_unicode_decode(self):
u = u'z\U0001d120x'
self.assertEqual(self.loads('"' + u + '"'), u)
self.assertEqual(self.loads('"z\\ud834\\udd20x"'), u)
def test_unicode_decode(self):
for i in range(0, 0xd7ff):
u = unichr(i)
s = '"\\u{0:04x}"'.format(i)
self.assertEqual(self.loads(s), u)
def test_object_pairs_hook_with_unicode(self):
s = u'{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}'
p = [(u"xkd", 1), (u"kcw", 2), (u"art", 3), (u"hxm", 4),
(u"qrt", 5), (u"pad", 6), (u"hoy", 7)]
self.assertEqual(self.loads(s), eval(s))
self.assertEqual(self.loads(s, object_pairs_hook = lambda x: x), p)
od = self.loads(s, object_pairs_hook = OrderedDict)
self.assertEqual(od, OrderedDict(p))
self.assertEqual(type(od), OrderedDict)
# the object_pairs_hook takes priority over the object_hook
self.assertEqual(self.loads(s,
object_pairs_hook = OrderedDict,
object_hook = lambda x: None),
OrderedDict(p))
def test_default_encoding(self):
self.assertEqual(self.loads(u'{"a": "\xe9"}'.encode('utf-8')),
{'a': u'\xe9'})
def test_unicode_preservation(self):
self.assertEqual(type(self.loads(u'""')), unicode)
self.assertEqual(type(self.loads(u'"a"')), unicode)
self.assertEqual(type(self.loads(u'["a"]')[0]), unicode)
# Issue 10038.
self.assertEqual(type(self.loads('"foo"')), unicode)
def test_bad_encoding(self):
self.assertRaises(UnicodeEncodeError, self.loads, '"a"', u"rat\xe9")
self.assertRaises(TypeError, self.loads, '"a"', 1)
class TestPyUnicode(TestUnicode, PyTest): pass
class TestCUnicode(TestUnicode, CTest): pass
|
{
"pile_set_name": "Github"
}
|
/*
File: AUBuffer.h
Abstract: Part of CoreAudio Utility Classes
Version: 1.1
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
#ifndef __AUBuffer_h__
#define __AUBuffer_h__
#include "../../../juce_core/native/juce_mac_ClangBugWorkaround.h"
#include <TargetConditionals.h>
#if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
#include <AudioUnit/AudioUnit.h>
#else
#include <AudioUnit.h>
#endif
#include <string.h>
#include "CAStreamBasicDescription.h"
#include "CAAutoDisposer.h"
#include "CADebugMacros.h"
// make this usable outside the stricter context of AudiUnits
#ifndef COMPONENT_THROW
#define COMPONENT_THROW(err) \
do { DebugMessage(#err); throw static_cast<OSStatus>(err); } while (0)
#endif
/*! @class AUBufferList */
class AUBufferList {
enum EPtrState {
kPtrsInvalid,
kPtrsToMyMemory,
kPtrsToExternalMemory
};
public:
/*! @ctor AUBufferList */
AUBufferList() : mPtrState(kPtrsInvalid), mExternalMemory(false), mPtrs(NULL), mMemory(NULL),
mAllocatedStreams(0), mAllocatedFrames(0), mAllocatedBytes(0) { }
/*! @dtor ~AUBufferList */
~AUBufferList();
/*! @method PrepareBuffer */
AudioBufferList & PrepareBuffer(const CAStreamBasicDescription &format, UInt32 nFrames);
/*! @method PrepareNullBuffer */
AudioBufferList & PrepareNullBuffer(const CAStreamBasicDescription &format, UInt32 nFrames);
/*! @method SetBufferList */
AudioBufferList & SetBufferList(const AudioBufferList &abl) {
if (mAllocatedStreams < abl.mNumberBuffers)
COMPONENT_THROW(-1);
mPtrState = kPtrsToExternalMemory;
memcpy(mPtrs, &abl, (char *)&abl.mBuffers[abl.mNumberBuffers] - (char *)&abl);
return *mPtrs;
}
/*! @method SetBuffer */
void SetBuffer(UInt32 index, const AudioBuffer &ab) {
if (mPtrState == kPtrsInvalid || index >= mPtrs->mNumberBuffers)
COMPONENT_THROW(-1);
mPtrState = kPtrsToExternalMemory;
mPtrs->mBuffers[index] = ab;
}
/*! @method InvalidateBufferList */
void InvalidateBufferList() { mPtrState = kPtrsInvalid; }
/*! @method GetBufferList */
AudioBufferList & GetBufferList() const {
if (mPtrState == kPtrsInvalid)
COMPONENT_THROW(-1);
return *mPtrs;
}
/*! @method CopyBufferListTo */
void CopyBufferListTo(AudioBufferList &abl) const {
if (mPtrState == kPtrsInvalid)
COMPONENT_THROW(-1);
memcpy(&abl, mPtrs, (char *)&abl.mBuffers[abl.mNumberBuffers] - (char *)&abl);
}
/*! @method CopyBufferContentsTo */
void CopyBufferContentsTo(AudioBufferList &abl) const {
if (mPtrState == kPtrsInvalid)
COMPONENT_THROW(-1);
const AudioBuffer *srcbuf = mPtrs->mBuffers;
AudioBuffer *destbuf = abl.mBuffers;
for (UInt32 i = 0; i < abl.mNumberBuffers; ++i, ++srcbuf, ++destbuf) {
if (i >= mPtrs->mNumberBuffers) // duplicate last source to additional outputs [4341137]
--srcbuf;
if (destbuf->mData != srcbuf->mData)
memmove(destbuf->mData, srcbuf->mData, srcbuf->mDataByteSize);
destbuf->mDataByteSize = srcbuf->mDataByteSize;
}
}
/*! @method Allocate */
void Allocate(const CAStreamBasicDescription &format, UInt32 nFrames);
/*! @method Deallocate */
void Deallocate();
/*! @method UseExternalBuffer */
void UseExternalBuffer(const CAStreamBasicDescription &format, const AudioUnitExternalBuffer &buf);
// AudioBufferList utilities
/*! @method ZeroBuffer */
static void ZeroBuffer(AudioBufferList &abl) {
AudioBuffer *buf = abl.mBuffers;
for (UInt32 i = abl.mNumberBuffers ; i--; ++buf)
memset(buf->mData, 0, buf->mDataByteSize);
}
#if DEBUG
/*! @method PrintBuffer */
static void PrintBuffer(const char *label, int subscript, const AudioBufferList &abl, UInt32 nFrames = 8, bool asFloats = true);
#endif
/*! @method GetAllocatedFrames */
UInt32 GetAllocatedFrames() const { return mAllocatedFrames; }
private:
/*! @ctor AUBufferList */
AUBufferList(AUBufferList &) { } // prohibit copy constructor
/*! @var mPtrState */
EPtrState mPtrState;
/*! @var mExternalMemory */
bool mExternalMemory;
/*! @var mPtrs */
AudioBufferList * mPtrs;
/*! @var mMemory */
Byte * mMemory;
/*! @var mAllocatedStreams */
UInt32 mAllocatedStreams;
/*! @var mAllocatedFrames */
UInt32 mAllocatedFrames;
/*! @var mAllocatedBytes */
UInt32 mAllocatedBytes;
};
// Allocates an
|
{
"pile_set_name": "Github"
}
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3